// suppress all errors
try {


// console logging
onespot.use_console = false;

// log message to console
onespot.logger = function(message) {
  if (onespot.use_console) {
    try {
      console.log(message);
    } catch(e) {
      alert(message);
    }
  }
}

// create a new <iframe> element
onespot.iframe = document.createElement('iframe');

// set attributes to hide <iframe>
onespot.iframe.style.display = 'block';
onespot.iframe.style.width = '0';
onespot.iframe.height = '0';
onespot.iframe.frameBorder = '0';
onespot.iframe.border = '0';
onespot.iframe.scrolling = 'no';

// check for onespot object
if (typeof onespot == 'object') {

  // check for placeholder property; use default if not specified
  if (typeof onespot.placeholder == 'string') {
    onespot.logger('! placeholder: ' + onespot.placeholder);
  } else {
    onespot.placeholder = 'onespot';
    onespot.logger('! placeholder: using ' + onespot.placeholder + ' (default)');
  }

  // append the new element to the placeholder <div>
  onespot.element = document.getElementById(onespot.placeholder);
  onespot.element.appendChild(onespot.iframe);

  // create a string to use as a new document object
  onespot.page = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' +
                 '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">' +
                 '  <head>' +
                 '    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>' +
                 '    <title>OneSpot Integrated Story Module</title>' +
                 '  </head>' +
                 '  <body>' +
                 '    <scr' + 'ipt type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></scr' + 'ipt>' +
                 '    <scr' + 'ipt type="text/javascript" src="http://static.onespot.com/javascripts/ism/v1.1/builder.js"></scr' + 'ipt>' +
                 '  </body>' +
                 '</html>';

  // get a handle on the <iframe> document
  onespot.doc = onespot.iframe.contentWindow || onespot.iframe.contentDocument;
  if (onespot.doc.document) {
    onespot.doc = onespot.doc.document;
  }

  // open, write content to, and close the document
  onespot.doc.open();
  onespot.doc.write(onespot.page);
  onespot.doc.close();

} else {

  onespot.logger('Main settings object "onespot" is not defined. Please refer to the implementation instructions.');

}


} catch(e) {}