Sphere = {} Sphere.Tracker = new function() { this.track = function ( ele, site, area ) { if( !ele.href ) return; var trackimg = new Image(); trackimg.src = 'http://www.sphere.com/widgets/sphereit/tracker?site='+site+'&area='+area+'&href='+ele.href; } } Sphere.Widget = new function() { var SKELETON_MARKUP = '
'; var CONTENT_URL = 'http://www.sphere.com/widgets/sphereit/content?siteid=time_eyeonscience'; if(document.characterSet) CONTENT_URL += ('&cset='+escape(document.characterSet)); CONTENT_URL += '&url='; var widget; var widgetContent; var widgetLoading; var content; appendStylesheet(); this.search = function( source ) { if( !content || (source && content.source!=source ) ) { requestContent( source ); if( widget ){ widget.parentNode.removeChild(widget); content=null; widget=null; } } if( !widget ) draw(); show(); return false; } this.close = function() { if( widget ) widget.style.display ='none'; } this.processContent = function (incomingContent) { content = incomingContent; //alert("processContent:"+content); if( !widgetContent ) return; widgetContent.innerHTML = content.content; widgetContent.style.height = widgetLoading.clientHeight +'px'; widgetLoading.style.display = 'none'; widgetContent.style.display = 'block'; zoomToFull(); } function requestContent( local ) { //alert("requestContent"); var script = document.createElement('script'); script.src = CONTENT_URL + escape(local || location.href); document.body.appendChild(script); } 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'; } center(); return false; } widgetContent.style.height = (widgetContent.clientHeight + 20) +'px'; center(); return true; } }); } function ieahack( col ) { for( var i=0; i