<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="x-ua-compatible" content="ie=7" />
<title>全屏</title>
<script language="javascript" type="text/javascript" src="/jss/un_domain_xss.js"></script>
<style type="text/css">
/*common*/
body{font-size:12px;font-family:宋体;color:#333333;background:#000000;margin:0;text-align:center;}div{margin:0 auto;padding:0;}
from,ul,img{border:none;}.clear{clear:both;height:0;font-size:0;overflow:hidden;}
h1,h2,h3,h4,h5,h6,h7,form,select,input,ul,li,label,img,p{padding:0;margin:0;}li{list-style:none;overflow:hidden;}
/*container*/
#container{width:100%;background:#000000;}
/*menu_box*/
#menu_box{height:34px;padding:5px 20px 6px;}
#menu_box #close_btn{float:right;width:35px;height:34px;}
#menu_box #close_btn a{float:right;width:35px;height:27px;background:url(/imageyx/fullscreenclose.gif) no-repeat;}
#menu_box a span{display:none;}
#menu_box #control_btn{float:left;text-align:center;}
#menu_box #control_btn a{color:#ffffff;font-size:16px;font-weight:bold;margin-left:5px;line-height:33px;float:left;width:35px;height:27px;}
#menu_box #control_btn a span{display:none;}
#menu_box #control_btn .restart{background:url(/imageyx/fullscreenclose.gif) -72px 0 no-repeat;width:35px;height:27px;}
#menu_box #control_btn .ScaleOut{background:url(/imageyx/fullscreenclose.gif) -108px 0 no-repeat;width:35px;height:27px;}
#menu_box #control_btn .ScaleIn{background:url(/imageyx/fullscreenclose.gif) -144px 0 no-repeat;width:35px;height:27px;}
/*left_box*/
#left_box{width:1px;overflow:hidden;text-align:center;background:#333333;z-index:2;}
#left_box #play_box{width:1px;height:1px;overflow:hidden;}
#left_box #play_box #wait{width:640px;height:480px;margin-bottom:3000px;overflow:hidden;display:none;}
#left_box #play_box #play{width:640px;height:480px;overflow:hidden;}
#play_box #load{position:relative;height:9px;margin-bottom:3px;overflow:hidden;text-align:left;display:none;}
#play_box #load #bar{width:0%;height:9px;margin:0;background:#01A6DE;overflow:hidden;}
#play_box #load #txt{position:absolute;left:47%;top:-2px;height:12px;color:#0f0;font-size:10px;}
/*method*/
#method{height:33px;line-height:39px;padding-left:11px;white-space:nowrap;overflow:hidden;color:#CACACA;text-align:center;}
</style>
</head>
<body>
<div id="container">
	<div id="menu_box">
		<div id="control_btn"><a href="javascript:void(0);" onclick="QP.Replay()" class="restart"><span>重玩</span></a><a href="javascript:void(0);" onclick="player.scale(1)" class="ScaleOut"><span>放大</span></a><a href="javascript:player.scale(-1);" class="ScaleIn"><span>缩小</span></a></div>
		<div id="close_btn"><a href="javascript:void(0);" onclick="window.close();return false;"><span>退出全屏</span></a></div>
	</div>
	<div id="left_box">
		<table height="100%" width="100%" cellspacing="0" cellpadding="0"><tbody><tr><td height="100%" valign="middle"><div id="play_box">
			<div id="load"><div id="bar"></div><div id="txt">Loading...</div></div>
			<div id="wait"></div>
			<div id="play"></div>
		</div></td></tr></tbody></table>
	</div>
	<div id="method"></div>
</div>
<script type="text/javascript">
if(self!=top){top.location=self.location;}
function get_request(item){
	var value = location.search.match(new RegExp("[\?\&\&amp;]"+item+"=([^\&]*)(\&?)","i"));
	return value ? value [1]: value;
}
//detect plugin
var detectableWithVB = false;
var pluginFound = false;
function detectFlash(redirectURL, redirectIfFound) {
    pluginFound = detectPlugin('Shockwave','Flash'); 
    if(!pluginFound && detectableWithVB) {
	pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.1');
    }
    return pluginFound;
}
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
    document.writeln('<script language="VBscript">');
    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');
    document.writeln('Function detectActiveXControl(activeXControlName)');
    document.writeln('  on error resume next');
    document.writeln('  detectActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    document.writeln('  End If');
    document.writeln('End Function');
	document.writeln('</scr' + 'ipt>');
}
function detectPlugin() {
    var daPlugins = detectPlugin.arguments;
    var pluginFound = false;
    if (navigator.plugins && navigator.plugins.length > 0) {
		var pluginsArrayLength = navigator.plugins.length;
		for (var pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) {
		    var numFound = 0;
		    for(var namesCounter=0; namesCounter < daPlugins.length; namesCounter++) {
				if( (navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) || 
				    (navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0) ) {
				    numFound++;
				}   
		    }
		    if(numFound == daPlugins.length) {pluginFound = true;break;}
		}
    }
    return pluginFound;
}
//createflash
var QP = new Object();
QP.drawIframe = function (p_Src, p_id, p_width, p_height){
	return "<iframe src=\""+p_Src+"\" frameborder=\"0\" name=\""+p_id+"\" id=\""+p_id+"\" height=\""+p_height+"\" width=\""+p_width+"\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" border=\"0\"></iframe>";
};
QP.drawSWF = function (p_Src, p_Var, p_id, p_width, p_height, p_AllowAd, p_StopPop){
	var str='<object id="'+p_id+'" width="'+p_width+'" height="'+p_height+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"><param name="movie" value="'+p_Src+'"/><param name="flashvars" value="'+p_Var+'"/><param name="quality" value="high"/><param name="bgcolor" value="#000"/>';
	if(p_StopPop==1){str+='<param name="allowScriptAccess" value="never"/>\n<param name="allowNetworking" value="internal"/>';}
	if(p_AllowAd==1){str+='<param name="allowScriptAccess" value="always"/>';}
	str+='<embed id="'+p_id+'_em" name="'+p_id+'" width="'+p_width+'" height="'+p_height+'" src="'+p_Src+'" flashvars="'+p_Var+'"';
	if(p_StopPop==1){str+=' allowScriptAccess="never" allowNetworking="internal"';}
	if(p_AllowAd==1){str+=' allowScriptAccess="always"';}
	str+=' quality="high" bgcolor="#000" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" /></object>';
	return str;
};
QP.drawDCR = function(p_Src, p_id, p_width, p_height){
	var str = "";
	if(detectFlash()){
		str = '<object id="'+p_id+'" width="'+p_width+'" height="'+p_height+'" classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,0,0,0"><param name="background" value="#000"><param name="swStretchStyle" value="fill"><param name="logo" value="false"><param name="menu" value="false"><param name="src" value="'+p_Src+'"><embed id="'+p_id+'_em" name="'+p_id+'" src="'+p_Src+'" background="#000" logo="false" menu="false" width="'+p_width+'" height="'+p_height+'" pluginspage="http://www.macromedia.com/shockwave/download/"></embed></object>';
	}
	else{
		str = '<div><iframe src="http://www.4399.com/shockwaveplayer.html" height="120" width="450" marginheight="0" marginwidth="0" scrolling="no" frameborder="0"></iframe></div>';
	}
	return str;
}
QP.drawXAP = function(p_Src, p_id, p_width, p_height){
	var str='<object id="'+p_id+'" width="'+p_width+'" height="'+p_height+'" data="data:application/x-silverlight," type="application/x-silverlight-2-b2"><param name="source" value="'+p_Src+'"/><param name="onerror" value="onSilverlightError" /><param name="background" value="black" /><a href="http://go.microsoft.com/fwlink/?LinkID=115261" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object>';
	return str;
}
//变量调节
var _v,_w,_h,_p,_e,_n;//变量,宽,高,路径,扩展名,游戏名
var _gamemark = get_request("gamemark") || "1|0|0|0|0|0|0|0|0|0";

var _playmode=_gamemark.split('|')[0];
var _AllowAd=_gamemark.split('|')[1];
var _StopPop=_gamemark.split('|')[2];

var _loadad = false;
if(_gamemark.split('|')[6] == 1) _loadad = false;

_v = get_request("gamevar");
_p = get_request("gamepath");
_method = get_request("method");
_n = get_request("gamename");
document.title = "4399小游戏 " + _n;
//server
function readcookie(name){var cookieValue = "";var search = name + "=";if(document.cookie.length > 0){offset = document.cookie.indexOf(search);if (offset != -1){offset += search.length;end = document.cookie.indexOf(";", offset);if (end == -1) end = document.cookie.length;cookieValue = unescape(document.cookie.substring(offset, end));}}return cookieValue;};
function setcookie(name,value,expirehours){var expiration = new Date((new Date()).getTime() +expirehours*3600000);document.cookie = name+ "=" + value + ";expires=" + expiration.toGMTString()+";domain=www.4399.com;path=/;";};
//
_e = _p.replace(/^(.+?)(\.([^\.\?]+?))(\?.+?)?$/g, "$2");
if(_e == '.swf'){
	_playmode = 1;
}else if(_e == '.dcr'){
	_playmode = 2;
}else if(_e == '.xap'){
	_playmode = 3;
}else if(_e == '.htm' || _e == '.html'){
	_playmode = 4;
}else{
	_playmode = 0;
}
//函数
QP.drawA = function(){
	return '<iframe src="/loadimg/loading.htm" height="480" width="640" marginheight="0" marginwidth="0" scrolling="no" frameborder="0"></iframe>';
}
QP.Player = function(w,h,$){
	var str = new Array();
	switch(_playmode){
		case 1 :
			str.push(QP.drawSWF(_p, _v, "gameobj", "100%", "100%", _AllowAd, _StopPop));
			break;
		case 2 :
			str.push(QP.drawDCR(_p, "gameobj",  "100%", "100%"));break;
		case 3 :
			str.push(QP.drawXAP(_p, "gameobj",  "100%", "100%"));break;
		case 4 :
			str.push(QP.drawIframe(_p + '?w='+w+'&h='+h+'&v='+ _v, "gameobj", w, h));break;
		default :
			str.push('<div style="height:50px;background:color:#000;"><a href="'+ _p +'" target="_blank" style="#fff">下载该文件</a></div>');break;
	}
	if($) document.getElementById("wait").innerHTML = QP.drawA();
	document.getElementById("play").innerHTML =  str.join("");
};
QP.Replay = function(){
	document.getElementById("play").innerHTML = document.getElementById("play").innerHTML;
	switch(_playmode){
		case 1 :
			var _strTemp = document.getElementById("gameobj").movie;
			document.getElementById("gameobj").movie=" ";
			document.getElementById("gameobj").movie=_strTemp;

			var agt=window.navigator.userAgent.toLowerCase();

			if (agt.indexOf("msie")<0){
				document.getElementById("gameobj_em").src = document.getElementById("gameobj_em").src;
			}

			break;
		case 4 :
			document.getElementById("gameobj").src=document.getElementById("gameobj").src;
			break;
	}
};
var get_scrheight = function(){
	if(self.innerHeight) return {"w":self.innerWidth, "h":self.innerHeight};
	if(document.documentElement && document.documentElement.clientHeight) return {"w":document.documentElement.clientWidth,"h":document.documentElement.clientHeight};
	
	if(document.body) return {"w":document.body.clientWidth,"h":document.body.clientHeight};
};
var player = function(){
	var $ = function(id){return id ? document.getElementById(id) : null;},
	consts = {"plusW" : 10, "plusH" : 78};
	div = {"container" : $("container"), "leftBox" : $("left_box"), "playBox" : $("play_box"), "play" : $("play")},
	swf = {"method":_method, "mode" : _playmode},
	iswait = true,
	isshowad = _loadad,
	waittime = 0,
	waitout = null,
	get_sizebasewidth = function(w){return {"w":w,"h":Math.floor(w*(swf.h/swf.w))};},
	get_realsize = function(o){return{"w":o.clientWidth,"h":o.clientHeight};},
	set_size = function(size, o){o.style.width = size.w + "px";if(size.h) o.style.height = size.h + "px";},
	set_nmode = function(size){
		set_size({"w":parseInt(size.w - consts.plusW), "h":parseInt(size.h - consts.plusH)}, div.container);
		set_size({"w":parseInt(size.w - consts.plusW), "h":parseInt(size.h - consts.plusH)}, div.leftBox);
		if(iswait && isshowad){
			set_size({"w":640,"h":480}, div.playBox);
		}
		else{
			set_size({"w":parseInt(size.w - consts.plusW), "h":parseInt(size.h - consts.plusH)}, div.playBox);
		}
		set_size({"w":parseInt(size.w - consts.plusW), "h":parseInt(size.h - consts.plusH)}, div.play);
	};
	return {
		init:function(){
			//$("method").innerHTML = decodeURI(swf.method);
			var size = get_scrheight();
			set_nmode(size);
			QP.Player(parseInt(size.w - consts.plusW), parseInt(size.h - consts.plusH), isshowad);
			this.wait();
		},
		zoom:function(){
			var size = get_scrheight();
			set_nmode(size);
			if(swf.mode == 4){
				document.getElementById("gameobj").style.width= parseInt(size.w - consts.plusW) + "px";
				document.getElementById("gameobj").style.height = parseInt(size.h - consts.plusH) + "px";
				//document.getElementById("gameobj").src=_p + '?w='+parseInt(size.w - consts.plusW)+'&h='+parseInt(size.h - consts.plusH)+'&v='+ _v;
			}
			else{
				document.getElementById("gameobj").style.width = "100%";
				document.getElementById("gameobj").style.height = "100%";
			}
			document.getElementById("gameobj").style.marginTop = "0px";
		},
		scale:function(intDirection){
			var scr_size=get_scrheight();
			var agt=window.navigator.userAgent.toLowerCase();
			var objGame = document.getElementById("gameobj");

			if ((swf.mode == 1 || swf.mode == 2)&&agt.indexOf("msie")<0){
				objGame = document.getElementById("gameobj_em");
			}
			var size = get_realsize(objGame);
			var __w=size.w,__h=size.h;
			size.w = __w+150*intDirection;
			size.h = __h+parseInt(__h/__w*150)*intDirection;

			if (scr_size.w<=(size.w + consts.plusW)||scr_size.h<(size.h + consts.plusH)){
				size.h = scr_size.h-consts.plusH;
				size.w = scr_size.w-consts.plusW;
			}

			if (size.w*size.h<60000){
				return;
			}

			//set_nmode(size);

			objGame.style.width= size.w + "px";
			objGame.style.height = size.h + "px";
			objGame.style.marginTop = parseInt((scr_size.h - size.h - consts.plusH)/2) + "px";
		},
		wait:function(){
			var loaded = 0;
			try{loaded = window.document.gameobj.PercentLoaded();$("load").style.display = "block";}
			catch(e){loaded = 100;}
			this.showad(isshowad, "block"); //loading 广_告
			if(loaded === 100){
				if(waittime >= 6000){
					iswait = false;
					set_size(get_realsize(div.play), div.playBox);
					clearTimeout(waitout);
					this.showad(isshowad, "none"); //loading 广_告
					$("load").style.display = "none";
				}
				else{
					iswait = true;
					waittime += 300;
					var that = this;
					$("load").style.display = "none";
					waitout = setTimeout(function(){that.wait()},300);
				}
			}
			else{
				$("load").style.display = "block";
				$("bar").style.width =loaded + "%";
				$("txt").innerHTML = "Load " + loaded + "%";
				if (waittime >= 6000) {
					iswait = false;
					set_size(get_realsize(div.play), div.playBox);
					this.showad(isshowad, "none"); //loading 广_告
				}
				var that = this;
				waittime += 300;
				waitout = setTimeout(function(){that.wait()},300);
			}
		},
		showad:function(b, d){
			if(!b) return;
			$("wait").style.display = d;
		}
	};
}();
player.init();
window.onresize = function(){player.zoom();};
</script>
<script src='http://w.cnzz.com/c.php?id=30039538' language='JavaScript' charset='gb2312'></script>
</body>
</html>
