function FullPlay(sUrl) {
	if(movie.readystate==4){
		if(sUrl.substr(sUrl.length-4,4).toLowerCase()==".swf")
			sUrl = sUrl.substr(0,sUrl.length-4);
		window.open("FullPlay.htm?"+sUrl,"4399","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://cnc.4399.com/flash/FullPlay.htm?"+sUrl,"4399","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,"4399","fullscreen");
	window.opener =null;
	window.close();
}
function FullPlay3(sUrl) {
	window.open("FullPlay1.htm?"+sUrl,"4399","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;
	}
}

function ReSize(strSize){
	var intNextWidth;
	var intNextHeight;

	if (_w==0){
		_w = 750
	}

	if (_h==0){
		_h = 563
	}

	switch (strSize){
	case "1280":
		intNextWidth = 1000;
		intNextHeight = GetSize(intNextWidth,728,"h");
		break;
	case "1024":
		intNextWidth = 700;
		intNextHeight = GetSize(intNextWidth,509,"h");
		break;
	case "800":
		intNextWidth = 550;
		intNextHeight = GetSize(intNextWidth,400,"h");
		break;
	case "min":
		intNextWidth = 437;
		intNextHeight = GetSize(intNextWidth,281,"h");
		break;
	default :
		intNextWidth = _w;
		intNextHeight = _h;
		break;
	}

	movie.width = intNextWidth;
	movie.height = intNextHeight;
	//document.location.hash = "22";
	GoToBestPosition();
}
function getTop(e){
	var offset=e.offsetTop;
	if(e.offsetParent!=null) offset+=getTop(e.offsetParent);
	return offset;
}

function GoToBestPosition(){
	var objBestPosition = document.getElementById("22");
	var intBestPosition = getTop(objBestPosition);
	window.scrollTo(0,intBestPosition);
}

function GetSize(w, h, m){
	var t;
	if(m == "w"){
		t = parseInt(_w * h/_h);
		return t;
	}else{
		t = parseInt(w * _h/_w);
		return t;
	}
}
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(){
	try{
		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)
		}
	}
	catch(e){
		if(getOs()!=0){
			nTimeoutId = setTimeout('refreshProgress()',1000);
		}
	}
}

function Replay(){
	var strMovieUrl;

	if(movie.PercentLoaded()==100){
		if(getOs()==0){
			strMovieUrl = movie.movie;
			movie.movie = " ";
			movie.movie = strMovieUrl;
		}
		else{
			strMovieUrl = movie.src;
			movie.src = " ";
			movie.src = strMovieUrl;
		}
	}
}