function flashCM(URL,width,height,vars,bgColor,winmode) {

	var id=URL.split("/")[URL.split("/").length-1].split(".")[0];
	if(vars==null) vars='';
	if(bgColor==null) bgColor='#FFFFFF';
	if(winmode==null) winmode='opaque';

	document.write("	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' "); 
	document.write("		width='"+width+"' height='"+height+"' id='"+id+"' align='middle'> ");
	document.write("	<param name='allowScriptAccess' value='always' /> ");
	document.write("	<param name='movie' 						value='"+URL+"' /> ");
	document.write("	<param name='FlashVars' 				value='"+vars+"' /> ");
	document.write("	<param name='wmode' 						value='"+winmode+"' /> ");
		document.write("	<param name='allowFullScreen' value='true' /> ");
	document.write("	<param name='menu' 							value='false' /> ");
	document.write("	<param name='quality'						value='high' /> ");
	document.write("	<param name='bgcolor'						value='"+bgColor+"' /> ");
	document.write("	<embed src='"+URL+"' flashVars='"+vars+"' wmode='"+winmode+"' menu='false' quality='high' ");
	document.write("		bgcolor='"+bgColor+"' width='"+width+"' height='"+height+"' name='"+id+"' align='middle' ");
	document.write("		allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /> ");
	document.write("	</object> ");
}
x = 0;
y = 0;
w = screen.availWidth;
h = screen.availHeight;
function win_move(tx, ty,tw,th) {
	cw = Math.abs(tw-w)>1
    ch = Math.abs(th-h)>1
	if (cw || ch) {
		w = w+(tw-w)*0.5;
		h = h+(th-h)*0.5;
		window.moveTo(x, y);
           x=(screen.width-w)/2;
		   y=(screen.height-h)/2 - 30;
		window.resizeTo(w, h);
	} else {
		clearInterval(id);
	}
}

function autoSize(x, y,w,h) {
	id = setInterval("win_move("+x+","+y+","+w+","+h+")", 10);
}
function fullScreen(){
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.SendKeys("{F11}");
}


