/* 
Methods for resizing the flash stage at runtime.

setFlashWidth(divid, newW)
divid: id of the div containing the flash movie.
newW: new width for flash movie

setFlashWidth(divid, newH)
divid: id of the div containing the flash movie.
newH: new height for flash movie

setFlashSize(divid, newW, newH)
divid: id of the div containing the flash movie.
newW: new width for flash movie
newH: new height for flash movie

canResizeFlash()
returns true if browser supports resizing flash, false if not. 
*/
function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}
function setFlashHeight(divid, newH){
	//alert(newH);
	document.getElementById(divid).style.height = newH+"px";		
}
function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}
function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}

function ShowCommercial(){
	document.getElementById('CommercialDiv').style.display='';
	document.getElementById('CommercialDiv').innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" name="Commercial" width="770" height="432" align="middle" id="Commercial"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="scale" value="noscale" /><param name="movie" value="Commercial.swf" /><param name="quality" value="high" /><param name="salign" value="lt" /><param name="bgcolor" value="#ffffff" /><embed src="Commercial.swf" scale="noscale" quality="high" salign="lt" bgcolor="#0C63AB" width="770" height="432" name="Commercial" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" /></object><br />&nbsp;&nbsp;<a href="javascript:CloseCommercial();" style="text-decoration:none; font-weight:bold; color:#009;font-size:16px;">Close Demo</a><br /><br />';
	window.location='#KeyRingThing';
}

function CloseCommercial(){
	document.getElementById('CommercialDiv').style.display='none';
	document.getElementById('CommercialDiv').innerHTML='';
	window.location='#KeyRingThing';
}
