var sLayer = 'flashGame';
function writeGame(sSwf, nWidth, nHeight, sFlashVars, bPlay, sWMode) {
	//
	window.scroll(0,0);
	//
	resize(sLayer);
	//
	MM_showHideLayers(sLayer,'','show');
	//
	if(hasRightVersion) {
			if(typeof(sFlashVars) =="undefined") {
				flashVars = "";
			} else {
				flashVars = sFlashVars
			}
   	 		var oeTags = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    		+ 'WIDTH="100%" HEIGHT="100%"'
    		+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="player">'
    		+ '<PARAM NAME="MOVIE" VALUE="' + sSwf + '">'
   	 		+ '<PARAM NAME="PLAY" VALUE="true">'
   	 		+ '<PARAM NAME="QUALITY" VALUE="high">'
			+ '<param name="scale" value="noscale" />'
    		+ '<PARAM NAME="MENU" VALUE="false">'
			//+ '<param name="wmode" value="transparent">'
			+ '<param name="allowScriptAccess" value="sameDomain" />'
			+ '<param name="FlashVars" value="'+flashVars
			+ '" />'
    		+ '<EMBED SRC="' + sSwf + '"'
			+ 'name="player"'
			+ 'scale="noscale"'
    		+ 'width="100%"'
			+ 'height="100%"'
			//+ 'wmode="transparent"'
    		+ 'PLAY="true"'
    		+ 'LOOP="false"'
			+ 'allowScriptAccess="sameDomain"'
    		+ 'QUALITY="high"'
    		+ 'MENU="false"'
			+ 'flashvars="'+flashVars
			+'"'
    		+ 'TYPE="application/x-shockwave-flash"'
    		+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
    		+ '<\/EMBED>'
    		+ '<\/OBJECT>';
	
	} else {
		var oeTags = '<a href="http://www.macromedia.com/go/getflashplayer" onclick="MM_showHideLayers(\'flashGame\',\'\',\'hide\');" target="_blank">Download Flash</a>';
	}

	// write flash
	if (document.getElementById(sLayer)) {
		document.getElementById(sLayer).innerHTML = oeTags;
	} else if (document.all && bLoaded) {
		document.all[sLayer].innerHTML = oeTags;
    }	
	
}	


function resize()
{
	var myWidth = 0, myHeight = 0, htmHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
   		//Non-IE
		myWidth = window.clientWidth;
    	myHeight = window.innerHeight;
		htmHeight = document.documentElement.scrollHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
   		//IE 6+ in 'standards compliant mode'
    	myWidth = document.documentElement.clientWidth;
    	myHeight = document.documentElement.clientHeight;
		htmHeight = document.documentElement.scrollHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    	//IE 4 compatible
    	myWidth = document.body.clientWidth;
    	myHeight = document.body.clientHeight;
		htmHeight = document.body.offsetHeight;
	}

	if (document.layers) {
		document.all[sLayer].height = htmHeight;
	} else 	if (document.all) {
		if(is_mac && is_ie) {
			document.getElementById(sLayer).style.height = htmHeight+"px";
		} else {
			document.all[sLayer].style.height = htmHeight;
		} 
	} else 	if (!document.all && document.getElementById) {
		document.getElementById(sLayer).style.height = htmHeight+"px";
	}

}

window.onresize = resize;

