// this is a script to write the div for the video
function notrgvids()
{
document.getElementById("trgfrontvids").innerHTML ="";
document.getElementById("trgfrontvids").style.height ="0px";
clearTimeout(myInterval);
}

var	vidinfo = "?&";
	vidinfo += "Svidname=" + Svidname + "&";
	vidinfo += "Pvidname=" + Pvidname + "&";
	vidinfo += "bgColor=" + bgColor + "&";
	vidinfo += "txtColor=" + txtColor + "&";
	vidinfo += "txtOverColor=" + txtOverColor + "&";
	vidinfo += "streamSpeed=" + streamSpeed + "&";
	vidinfo += "enable_js_trg=" + enable_js_trg; 	
// background-color:#ccff00;

var trgfsdiv = ('<div id="trgfrontvids" style="position:absolute; z-index:10000; top:300px; left:35%; height:340px; width:310px;   ">');
trgfsdiv +=  ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="275" height="350" title="Powered By Instant Increase.com">');
trgfsdiv +=  ('<param name="movie" value="http://www.likeloans.com/vidtests/main_vid_test.swf" />');
trgfsdiv +=  ('<param name="quality" value="high" />');
trgfsdiv +=  ('<param name="wmode" value="transparent" />');
trgfsdiv +=  ('<param name="allowScriptAccess" value="always" />');
trgfsdiv +=  ('<param name="FlashVars" value="' + vidinfo + '" />');
trgfsdiv +=  ('<embed src="http://www.likeloans.com/vidtests/main_vid_test.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="275" height="350" wmode="transparent" allowScriptAccess="always" FlashVars="' + vidinfo + '"></embed>');
trgfsdiv +=  ('</object>');
trgfsdiv +=  ('</div>');

document.write(trgfsdiv);

function vidscreenwidth() {
  var vidscreenwidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    vidscreenwidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    vidscreenwidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    vidscreenwidth = document.body.clientWidth;
  }
return vidscreenwidth;
}


trg_attachOnloadEvent(floatingDiv);

// attach func function to window onload event (crossbrowser compatible)
function trg_attachOnloadEvent(func) {
	if(typeof window.addEventListener != 'undefined') {
		// moz, saf1.2, ow5b6.1
		window.addEventListener('load', func, false);
	} else if (typeof document.addEventListener != 'undefined') {
		// MSN/OSX, op7.50, saf1.2, ow5b6.1
		document.addEventListener('load', func, false);
	} else if (typeof window.attachEvent != 'undefined') {
		// ie5.0w, ie5.5w, ie6w
		window.attachEvent('onload', func);
	} else {
		// all other browsers
		if (typeof window.onload == 'function') {
			var oldonload = onload;
			window.onload = function() {
				oldonload();
				func();
			};
		} else {
				window.onload = func;
		}
	}
}

var myInterval;
function floatingDiv()
{
	var top = vidTopPos; // added by ray
	var left = (vidscreenwidth()*.5)-(120); // added by ray
	
	var startX = left, startY = top;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	var px = document.layers ? "" : "px";
function ml(id)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	if(d.layers)el.style=el;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};
	el.x = startX; el.y = startY;
	return el;
}
	window.floatDiv=function()
{
 	var pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
 
	var dY = startY;
 	if (pY+top > startY)
	{
		dY = pY+top;
	}
 	else
	{
		dY = startY;
 	}
	 ftlObj.y += (dY - ftlObj.y);
	 ftlObj.sP(ftlObj.x, ftlObj.y);
	 myInterval = setTimeout("floatDiv()", 5);
}
	ftlObj = ml("trgfrontvids");
	floatDiv();
}
