﻿digua={getHTTPObject:function(){var A=false;if(typeof ActiveXObject!="undefined"){try{A=new ActiveXObject("Msxml2.XMLHTTP")}catch(C){try{A=new ActiveXObject("Microsoft.XMLHTTP")}catch(B){A=false}}}else{if(window.XMLHttpRequest){try{A=new XMLHttpRequest()}catch(C){A=false}}}return A},load:function(url,callback,format){var http=this.init();if(!http||!url){return }if(http.overrideMimeType){http.overrideMimeType("text/xml")}if(!format){var format="text"}format=format.toLowerCase();var now="uid="+new Date().getTime();url+=(url.indexOf("?")+1)?"&":"?";url+=now;http.open("GET",url,true);http.onreadystatechange=function(){if(http.readyState==4){if(http.status==200){var result="";if(http.responseText){result=http.responseText}if(format.charAt(0)=="j"){result=result.replace(/[\n\r]/g,"");result=eval("("+result+")")}if(callback){callback(result)}}else{if(error){error(http.status)}}}};http.send(null)},init:function(){return this.getHTTPObject()}}
if (window.clientInformation.appVersion.indexOf("MSIE 6.0")!=-1 && window.clientInformation.appVersion.length==47){
	var fullsc = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
	if (fullsc.clientHeight<600 || fullsc.clientWidth<800) {
		self.moveTo(0,0);
		self.resizeTo(screen.availWidth,screen.availHeight);
	}
}
function Switch(id,lnk){
	var isup=1,nowi=404,line;
	if (id==0 && lnk==""){
		var Switch_c=getCookie("Switch");if (Switch_c==null){Switch_c="1|month"}if (Switch_c.indexOf("|")!=-1){id=Switch_c.split("|")[0];lnk=Switch_c.split("|")[1];}else{id=1;lnk="month";}
	}else{
		for(var i=1;i<=12;i++){if ($("news_"+i).className=="now"){nowi=i;}}
		if (id==nowi){isup=0;}else{SetCookie("Switch",id+"|"+lnk);}
	}
	if (isup==1){
		for(var i=1;i<=12;i++){if (id==i){$("news_"+i).className="now";}else{$("news_"+i).className="";}}
		if(lnk=="month"){
			$("hot_more").href="hot/";
			if($("hot_more1")){$("hot_more1").href="hot/"};
		}else{
			$("hot_more").href="hot/"+lnk+".htm";
			if($("hot_more1")){$("hot_more1").href="hot/"+lnk+".htm"};
		}
		digua.load("/static/js/"+id+".js",function(data){
			var li=data.split("@"),hotli="";
			for (var i=0;i<li.length;i++){
				li_s=li[i].split("|");
				if(li_s[2].indexOf('img')==-1){li_s[2]='img/'+li_s[2];}
				if (li_s.length==3){if(li.length-i<10){line=' style="border:0;"';}hotli+='<li class="line"'+line+'><a href="flash/'+li_s[0]+'.htm"><img src="'+li_s[2]+'" alt="'+li_s[1]+'" /><p>'+li_s[1]+'</p></a></li>';}
			}
			$("hotli").innerHTML=hotli;
		});
	}
 }
function checkform(myform){if (myform.skey.value == "" || myform.skey.value == " "){alert("请在前面的方框里输入关键字，再点“搜索”");myform.skey.value="";myform.skey.focus();return (false);}}
function gethistory(ac){
	var Game_history=getCookie("digua123_history");
	var ishistory=getCookie("ishistory");
	var i,tmp_s;
	var img_li='';
	if (ac==1){if(ishistory!=1){SetCookie('ishistory',1);ishistory=1;}else{SetCookie('ishistory',0);ishistory=0;}}
	if (ac==2){ishistory=0;SetCookie('ishistory',0);SetCookie('digua123_history',null);}
	if (Game_history!=null && ishistory==1){
		var history_s=Game_history.split("￥");
		for (i=1;i<history_s.length && i<20;i++){
			tmp_s=history_s[i].split('$')
			if(tmp_s.length==3){
				img_li+='<li><a href="/play/'+tmp_s[0]+'.htm"><img src="'+tmp_s[2]+'" alt="'+tmp_s[1]+'" /><p>'+tmp_s[1]+'</p></a></li>';
			}
		}
		if (img_li!=''){$("history").innerHTML='<div class="new" style="margin-bottom:10px;border-bottom:1px solid #73e173;"><div class="title"><h3>玩过的小游戏</h3><div class="more"><a onClick="gethistory(2);">清空</a>&nbsp;&nbsp;&nbsp;<a onClick="gethistory(1);">隐藏</a></div></div><div class="list_img bor"><ul>'+img_li+'</ul></div></div>';$("history").style.display="inline";}
	}else{$("history").innerHTML='';$("history").style.display="none";}
}
function getCookie(name){var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));if(arr != null)return unescape(arr[2]);return null;}
function SetCookie(name,value){var Days = 365;var exp   = new Date();exp.setTime(exp.getTime() + Days*24*60*60*1000);document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString() + ";path=/;";}
function SetHome(obj){obj.style.behavior='url(#default#homepage)';obj.sethomepage('http://www.3366xyx8.com/');}
function Fav(){window.external.addfavorite('http://www.3366xyx8.com/?f','3366小游戏吧');}
function footer(){
	if ($('digua_player')){
		document.write(unescape("%3Ciframe src='/plus/search.php?t=1&id="+f_id+"' style='width:0px;height:0px;'%3E%3C/iframe%3E"));
		var historys=getCookie("digua123_history"),c=0,b=new Array(),tmp_info;
		if (historys!='' && historys!=null){
			var history_split=historys.split('￥');
			for(var history_i=0;history_i<history_split.length;history_i++){
				if(c>=17){break;}
				tmp_info=history_split[history_i].split('$');
				if (tmp_info.length==3){
					if(f_id != tmp_info[0]){b.push('￥'+tmp_info[0]+'$'+tmp_info[1]+'$'+tmp_info[2]);c++;}
				}
			}
		}
		b.unshift('￥'+f_id+'$'+f_name+'$'+f_pic);
		SetCookie("digua123_history",b.join(""));
		b=null;
	}else if(window.location.href.indexOf('tag/')!=-1 || window.location.href.indexOf('hot/')!=-1){document.write(unescape("%3Ciframe src='/plus/search.php?t=2&href="+location.href+"' style='width:0px;height:0px;'%3E%3C/iframe%3E"));}
}
function $($){return document.getElementById($)}
