function FullPlay(sUrl) {
	if(document.getElementById("flashgame").readystate==4){
		if(sUrl.substr(sUrl.length-4,4).toLowerCase()==".swf")
			sUrl = sUrl.substr(0,sUrl.length-4);
		window.open("FullPlay.htm?"+sUrl,"ychot","fullscreen");
		window.opener =null;
		window.close();
	}
	else{
		alert("请等动画下载完毕再全屏播放，Thanks：）");
	}
}
function FullPlay2(sUrl) {
	if(sUrl.substr(sUrl.length-4,4).toLowerCase()==".swf")
		sUrl = sUrl.substr(0,sUrl.length-4);
	window.open("http://game.ychot.net/flash/FullPlay.htm?"+sUrl,"ychot","fullscreen");
	window.opener =null;
	window.close();
}
function FullPlay1(sUrl) {
	if(sUrl.substr(sUrl.length-4,4).toLowerCase()==".swf")
		sUrl = sUrl.substr(0,sUrl.length-4);
	window.open("FullPlay.htm?"+sUrl,"ychot","fullscreen");
	window.opener =null;
	window.close()
}
function FullPlay3(sUrl) {
	window.open("FullPlay1.htm?"+sUrl,"ychot","menubar=no,toolbar=no,location=no,status=no,fullscreen=yes");
	window.opener = null;
	window.close()
}
function GameScale(width){
	switch(width){
	case '800':
		movie.width="650px";
		movie.height=430;
		break;
	case '1024':
		movie.width="671px";
		movie.height="486px";
		break;
	case '1280':
		movie.width="880px";
		movie.height="661px";
		break;
	default:
		movie.width="650px";
		movie.height="430px";
		break;
	}
}
var screenWidth = location.search.split('?')[1]

function getOs(){
	var agt=window.navigator.userAgent.toLowerCase();
	if(agt.indexOf("msie")>=0)return 0;
	if(agt.indexOf("firefox")>=0)return 1;
	if(agt.indexOf("opera")>=0)return 3;
	if(agt.indexOf("camino")>=0)return 4;
	if(agt.indexOf("gecko/")>=0)return 5;
	return 0;
}

function refreshProgress(){
	var nPercentLoaded = Math.abs(movie.PercentLoaded());
	bar.style.width=Math.ceil((downProgressWidth-80-100-2)*nPercentLoaded/100)+"px";

	if(nPercentLoaded==100){
		clearTimeout(nTimeoutId);
		bar.style.width=(downProgressWidth-80-100-2)+"px";
		downStatus.innerHTML="下载完毕";
	}
	else{
		nTimeoutId = setTimeout('refreshProgress()',300)
	}
}
