/*
    Copyright (c) 2008 Sculpt The Future Ltd
	All Rights Reserved
*/
function activateFlash(oArgs) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="' + oArgs.codebase + '" width="' + oArgs.width + '" height="' + oArgs.height + '" id="' + oArgs.id + '">\n');
    document.write('<param name="FlashVars" value="' + oArgs.flashvars + '" />\n');
    document.write('<param name="allowScriptAccess" value="' + oArgs.allowscriptaccess + '" />\n');
    document.write('<param name="movie" value="' + oArgs.movie + '" />\n');
    document.write('<param name="quality" value="high" />\n');
    document.write('<param name="loop" value="' + oArgs.loop + '" />\n');
    document.write('<param name="menu" value="' + oArgs.menu + '" />\n');
    document.write('<param name="allowFullScreen" value="' + oArgs.allowfullscreen + '" />\n');
    document.write('<param name="scale" value="' + oArgs.scale + '" />\n');
    document.write('<param name="align" value="' + oArgs.align + '" />\n');
    document.write('<param name="salign" value="' + oArgs.salign + '" />\n');
    document.write('<param name="bgcolor" value="' + oArgs.bgcolor + '" />\n');
    document.write('<param name="wmode" value="' + oArgs.wmode + '" />\n');
    document.write('<embed src="' + oArgs.movie + '" loop="' + oArgs.loop + '" menu="' + oArgs.menu + '" scale="' + oArgs.scale + '" allowFullScreen="' + oArgs.allowfullscreen + '" quality="high" bgcolor="' + oArgs.bgcolor + '" width="' + oArgs.width + '" height="' + oArgs.height + '" name="' + oArgs.id + '" align="' + oArgs.align + '" salign="' + oArgs.salign + '" allowScriptAccess="' + oArgs.allowscriptaccess + '" type="application/x-shockwave-flash" pluginspage="' + oArgs.pluginspage + '" flashvars="' + oArgs.flashvars + '" wmode="' + oArgs.wmode + '" />\n');
    document.write('</object>\n');
}
function onWindowResize(agentaction) {
	var myWidth = 0, myHeight = 0;
	if (typeof(window.innerWidth) == 'number') {
		myWidth = window.innerWidth; myHeight = window.innerHeight;
	}
	else if (document.documentElement && (document.documentElement.clientWidth ||document.documentElement.clientHeight)) {
		myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight;
	}
	else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		myWidth = document.body.clientWidth; myHeight = document.body.clientHeight;
	}
	
	if (myWidth < 1000) {
		myWidth = 1000;
	}
	
	if (myHeight < 550) {
		myHeight = 550;
	}
	
	// update content div size 
	var contentDiv = document.getElementById("flashcontainer");
	contentDiv.style.height = myHeight + "px";
	
	contentDiv.style.width = myWidth + "px";
	contentDiv.style.height = myHeight + "px";
	
	if (agentaction != true) {
		// set timer - force the event handler to fire one extra time
		timeOut = setTimeout("onWindowResize(true)", 200);
	}
	else {
		// event handler was called by timer - clear timeout
		clearTimeout(timeOut);
	}
}
function updateFlashContainer(h) {
	var contentDiv = document.getElementById("flashcontainer");
	if (h < 575) {
		h = 575;
	}
	contentDiv.style.height = h + "px";
	onWindowResize();
}
function setInitialDimensions() {
	var myWidth = 0, myHeight = 0;
	if (typeof(window.innerWidth) == 'number') {
		myWidth = window.innerWidth; myHeight = window.innerHeight;
	}
	else if (document.documentElement && (document.documentElement.clientWidth ||document.documentElement.clientHeight)) {
		myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight;
	}
	else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		myWidth = document.body.clientWidth; myHeight = document.body.clientHeight;
	}
	
	if (myWidth < 1000) {
		myWidth = 1000;
	}
	
	if (myHeight < 575) {
		myHeight = 575;
	}
	
	// update content div size 
	var contentDiv = document.getElementById("flashcontainer");
	contentDiv.style.height = myHeight + "px";
	var winheight = parseInt(document.documentElement.scrollHeight);
	var boheight = parseInt(document.body.scrollHeight);
	if (winheight > myHeight) {
		contentDiv.style.width = myWidth-15 + "px";
	}
	else {
		contentDiv.style.width = myWidth + "px";
	}
}
