if (window.addEventListener) /* DOM method for binding an event */
window.addEventListener("load", init, false)
else if (window.attachEvent) /* IE exclusive method for binding an event */
window.attachEvent("onload", init)
else if (document.getElementById) /* support older modern browsers */
window.onload=init;

// the float div function 
function floatingDiv(divID) {
	
	// center the div
	var windowWidth = getWindowWidth();
	var windowHeight = getWindowHeight();
	var centerWindow = (windowWidth - windowHeight)/2;
	
	var startX = centerWindow; // startX = 0;
	var startY = 0;
	
	function getDiv(id) {
		var el;
		if (document.getElementById) {
			el = document.getElementById(id); /* IE 5+ and FF */
		} else if (document.all) {
			el = document.all[id]; /* IE 4 */
		} else if (document.layers) {
			el = document.layers[id]; /* NS 4+ */
		}
		el.updateXY = function(x,y) { 
			this.style.left = x+'px';
			this.style.top = y+'px';
		};
		el.x = startX;
		el.y = startY;
		return el;
	}
	window.moveDiv = function() {
		var pageTop = 0;
		if (document.documentElement && document.documentElement.scrollTop) {
			pageTop = document.documentElement.scrollTop; /* IE 6+ (strict mode) */
		} else if (document.body && document.body.scrollTop)
			pageTop = document.body.scrollTop; /* IE 4+ and FF (quirks mode) */
		else if (document.layers) {
			pageTop = window.document.pageYOffset; /* NS 4+ */
		} 
		myDiv.y += Math.round((pageTop + startY - myDiv.y)/8);
		
		myDiv.updateXY(myDiv.x, myDiv.y);
		setTimeout("moveDiv()", 10);
	}
	var myDiv = getDiv(divID);
	moveDiv();
}
function getWindowWidth() {
	// get the inner width of the browser window
	var myWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		myWidth = window.innerWidth; /* w3c */
	} else if (document.documentElement && document.documentElement.clientWidth) {
		myWidth = document.documentElement.clientWidth; /* IE 6+ (strict mode) */
	} else if (document.body && document.body.clientWidth) {
		myWidth = document.body.clientWidth; /* IE 4+ (quirks mode) */
	}
	return myWidth;
}
function getWindowHeight() {
	// get the inner height of the browser window
	var myHeight = 0;
	if (typeof (window.innerHeight) == 'number') {
		myHeight = window.innerHeight; /* w3c */
	} else if (document.documentElement && document.documentElement.clientHeight) {
		myHeight = document.documentElement.clientHeight; /* IE 6+ (strict mode) */
	} else if (document.body && document.body.clientHeight) {
		myHeight = document.body.clientHeight; /* IE 4+ (quirks mode) */
	}
	return myHeight;
}
function notrgvids() {
	document.getElementById('jj_div_movie').innerHTML='';
}
function init() {
	
	var windowHeight = getWindowHeight();
	
	var videoURL = 'http://wefixuglywebsites.com/new/sources/player2.swf';
	var effectURL = 'http://wefixuglywebsites.com/new/sources/brickpunch.swf';
	
	var var_Svidname = 'RedHotProspects3';
	var var_Pvidname = 'RedHotProspects3';
	var var_bgColor = '0xFF0000';
	var var_txtColor = '0x000000';
	var var_txtOverColor = '0x0000FF';
	var var_streamSpeed = '400';
	var var_enable_js_trg = '1';
	
	var flashvars = "effectURL="+effectURL
	+"&Svidname="+var_Svidname
	+"&Pvidname="+var_Pvidname
	+"&bgColor="+var_bgColor
	+"&txtColor="+var_txtColor
	+"&txtOverColor="+var_txtOverColor
	+"&streamSpeed="+var_streamSpeed
	+"&enable_js_trg="+var_enable_js_trg;
	
	// create flash movie code
	var flashMovie = '<object width="'+windowHeight+'" height="'+windowHeight+'"><param name="movie" value="'+videoURL+'"></param><param name="quality" value="high"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="transparent"></param><param name="flashvars" value="'+flashvars+'"></param><embed src="'+videoURL+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+windowHeight+'" height="'+windowHeight+'" wmode="transparent" flashvars="'+flashvars+'"></embed></object>';
	
	// create a div and put the flash movie code into it
	var objBody = document.getElementsByTagName('body')[0];
	var elDiv = document.createElement('div');
	elDiv.id = 'jj_div_movie';
	elDiv.style.zIndex = 10000;
	elDiv.style.position = 'absolute';
	elDiv.style.top = '0px';
	elDiv.className = elDiv.id;
	objBody.appendChild(elDiv);
	document.getElementById(elDiv.id).innerHTML=flashMovie;
	
	// start floating the div
	floatingDiv(elDiv.id);
	
}

function trgShowVideo() {
	

}