

function FullPlay(sUrl) {
	if(document.getElementById("flashgame").readystate==4){
		window.open("../Playflash.htm?"+sUrl,"4399","fullscreen");
		window.close()
	}
	else{
		alert("请等动画下载完毕再全屏播放，Thanks：）");
	}
}
function FullPlay1(sUrl) {
	window.open("../Playflash.htm?"+sUrl,"4399","fullscreen");
	window.close()
}
function GameScale(width){
	switch(width){
	case '800':
		document.getElementById('flashgame').width=600;
		document.getElementById('flashgame').height=430;
		break;
	case '1024':
		document.getElementById('flashgame').width=655;
		document.getElementById('flashgame').height=480;
		break;
		case '1152':
		document.getElementById('flashgame').width=750;
		document.getElementById('flashgame').height=540;
		break;	
	case '1280':
		document.getElementById('flashgame').width=880;
		document.getElementById('flashgame').height=660;
		break;
	default:
		document.getElementById('flashgame').width=655;
		document.getElementById('flashgame').height=480;
		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 "1152":
		intNextWidth = 880;
		intNextHeight = GetSize(intNextWidth,660,"h");
		break;
	case "1024":
		intNextWidth = 700;
		intNextHeight = GetSize(intNextWidth,510,"h");
		break;
	case "800":
		intNextWidth = 600;
		intNextHeight = GetSize(intNextWidth,430,"h");
		break;
	default :
		intNextWidth = _w;
		intNextHeight = _h;
		break;
	}

	movie.width = intNextWidth;
	movie.height = intNextHeight;
	//document.location.hash = "#22";
}

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 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;
		}
	}
}
