/* -- BEGIN SPHERE JS -- */ // site id for bookmarket var SPHERE_SITE_ID = ""; SPHERE_SITE_ID = "washpost_metro"; //MediaPixel Removed // Omniture /* The core url used by all methods to make calls to the remote omniture code. the 'action' arg will be the name of a method to be called by eval in the sphereomni_api js code. */ function getSphereOmnitureRemoteActionUrl(action){ return "http://www.surphace.com/partner/omniture/sphereomni_api.php?siteid=washpost_metro&evt="+action; } function getSphereOmnitureQueueActionUrl(action){ return "http://www.surphace.com/partner/omniture/sphereomni_queue.php?evt="+action+"&siteid=washpost_metro"; } Sphere = {} Sphere.addStylesheet = function(stylesheet_href) { var stylesheet = document.createElement("link"); stylesheet.rel = "stylesheet"; stylesheet.type = "text/css"; stylesheet.href = stylesheet_href; stylesheet.media = "all"; document.lastChild.firstChild.appendChild(stylesheet); } Sphere.Browser = new function() { var ua, s, i; this.isIE = false; this.isNS = false; this.version = null; ua = navigator.userAgent; s = "MSIE"; if ((i = ua.indexOf(s)) >= 0) { this.isIE = true; this.version = parseFloat(ua.substr(i + s.length)); return; } s = "Netscape6/"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = parseFloat(ua.substr(i + s.length)); return; } // Treat any other "Gecko" browser as NS 6.1. s = "Gecko"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = 6.1; return; } } Sphere.Tracker = new function() { this.track = function ( ele, site, area, quadtitle,sphereid,metadata) { if( !ele.href ) return; /* -- the following may or may not be present, so check and init if necessary -- sphereid is used by ssi and represents site id by proxy -- metadata should be in the form of a pipe-delimited string e.g. k=v|b=y */ try{ if(!quadtitle){ quadtitle = '';} }catch(anErr){ quadtitle = ''; } try{ if(!sphereid){ sphereid = '';} }catch(anErr){ sphereid = ''; } try{ if(!metadata){ metadata = '';} }catch(anErr){ metadata = ''; } // put document referrer metadata in it's own try/catch block so that it is set even if metadata isn't init'd try{ if (document.referrer != ''){ metadata += "|referrer=" + document.referrer; } }catch(anErr){ } sphereom = new SphereOmniture(); sphereom.click(ele.href, area, site, quadtitle,sphereid,metadata); } } Sphere.Widget = new function() { var SKELETON_MARKUP = '
'; var CONTENT_URL = 'http://www.surphace.com/widgets/sphereit/content?siteid=washpost_metro'; if(document.characterSet) CONTENT_URL += ('&cset='+escape(document.characterSet)); CONTENT_URL += '&CXNID=1000009.430098529NXC&url='; var widget; var widgetContent; var widgetLoading; var content; var dragObj = {}; if(document.getElementsByTagName('base').length>0) { if (window.addEventListener){ window.addEventListener('load', appendStylesheet, false); } else if (window.attachEvent){ window.attachEvent('onload', appendStylesheet); } } else { appendStylesheet(); } if (Math.random() <= 0.1) { try{ sphereom = new SphereOmniture(); sphereom.track('popup_view', 'washpost_metro_popup_view','','',''); }catch(anErr){} } this.search = function( source ) { if( !content || (source && content.source!=source ) ) { requestContent( source ); dragObj.elNode = null; if( widget ){ widget.parentNode.removeChild(widget); content=null; widget=null; } } if( !widget ) draw(); show(); /* var reqimgurl = 'http://stats.surphace.com/widgets/sphereit/?action=display&siteid=washpost_metro'; var reqimg = new Image(); reqimg.src = reqimgurl; if (reqimg.style) { // In Safari 2.0.x, reqimg has no style until it's appended, so skip this (fixed in Safari 3) reqimg.style.display = 'none'; document.body.appendChild(reqimg); } */ return false; } this.close = function() { if( widget ) widget.style.display ='none'; } this.processContent = function (incomingContent) { content = incomingContent; for(i=0;i<1000;i++){ test='444'}; if( !widgetContent ) return; widgetContent.innerHTML = content.content+ "" ; widgetContent.style.height = widgetLoading.clientHeight +'px'; widgetLoading.style.display = 'none'; widgetContent.style.display = 'block'; zoomToFull(); // moved from search for popup sphereom = new SphereOmniture(); sphereom.popup(); } function requestContent( local ) { //alert("requestContent"); Sphere.Widget.script = document.createElement('script'); Sphere.Widget.script.src = CONTENT_URL + escape(local || location.href); setTimeout(function(){ document.body.appendChild(Sphere.Widget.script);}, 1); } function zoomToFull() { //alert("zoomToFull"); Animator.add( { process: function() { if( widgetContent.clientHeight >= widgetContent.scrollHeight-20) { widgetContent.style.height = widgetContent.scrollHeight+'px'; if( iecheck() ) { ieahack(widget.getElementsByTagName("a")); document.getElementById("sphereiframeblock").style.height = (Number(widget.scrollHeight)-24)+'px'; document.getElementById("sphereiframeblock").style.display = 'block'; alphaBackgrounds(); } center(); return false; } widgetContent.style.height = (widgetContent.clientHeight + 20) +'px'; center(); return true; } }); } function ieahack( col ) { for( var i=0; i