// Copyright CameoHD 2008
// CameoHD Placement Script 1.5a


writeObj();      

function init(){
    setIEStyle();
}


function setIEStyle(){
var Obj = document.getElementById('cameohd');
if(document.body.currentStyle['backgroundImage']=='none')
	{
		document.body.style.backgroundImage="url(http://www.cameohd.com/scripts/fixed.gif)";
		document.body.style.backgroundRepeat='no-repeat';
		document.body.style.backgroundAttachment='fixed';
	}
  if (navigator.appName =="Microsoft Internet Explorer" && navigator.userAgent.indexOf("Opera") < 0){ 
        Obj.style.setExpression('top','IE_Fixed()');
        } 
}

function IE_Fixed() {
        var Obj = document.getElementById('cameohd');
	var spot;
	var scrollTop;
	var clientHeight;
  if( typeof( window.innerWidth ) == 'number' ) { //Non-IE
    clientHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ standards compliant mode
    clientHeight  = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 
    clientHeight  = document.body.clientHeight;
  }
	if( typeof( window.pageYOffset ) == 'number' ) {	//Netscape
            scrollTop = window.pageYOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM 
    scrollTop = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrollTop = document.documentElement.scrollTop;
  } else {scrollTop=0;}
	
        spot=scrollTop+clientHeight-Obj.clientHeight ;	
	
	return spot;
}

function closeIframe(){
    var Obj = document.getElementById('cameohd');
        document.body.removeChild(Obj);
}


function writeObj(){
    var position;
    if (navigator.appName =="Microsoft Internet Explorer" && navigator.userAgent.indexOf("Opera") < 0){ 
        position = "absolute";
        } else {
        position = "fixed";
    }

    var URL = 'http://www.poweredbycameohd.com/live/spot-on/spot-on_anti_energy.swf';
    var Side = 'right';
    var Width = '528';
    var Height = '296';
        document.write('<object id="cameohd"  style="position:'+position+'; bottom:0px; '+Side+':0px; z-index:999; "');
	document.write(' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,19,0"');
	document.write('width="'+Width+'px" height="'+Height+'px">\n');
	document.write('\t<param name="movie" value="'+URL+'" />\n');
	document.write('\t<param name="quality" value="high" />\n');
	document.write('\t<param name="menu" value="false" />\n');
	document.write('\t<param name="wmode" value="transparent" />\n');
	document.write('\t<param name="AllowScriptAccess" value="always" />\n');
	document.write('\t<embed src="'+URL+'" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"');
	document.write('width="'+Width+'" height="'+Height+'" menu="false" AllowScriptAccess="always"></embed>\n');
	document.write('</object>\n');
        init();
}

