﻿var g_ArrResServerName=["浙江电信1","浙江电信2","广东电信","浙江电信3","美国电信","浙江网通","浙江网通2"];
var g_ArrResServerList=["http://9.yx007.com/","http://2.yx007.com/","http://3.yx007.com/","http://4.yx007.com/","http://6.yx007.com/","http://7.yx007.com/","http://8.yx007.com/"];
var alert1="只有登录后才能进行收藏游戏操作。是否要先登录YX007？";
var ArrInfo={
'net':'很抱歉，网络通讯出现问题，未能成功访问指定页面！',
'excep':'很抱歉，程序出了点异常错误，请尽快通知网站管理员！',
'tmout':'很抱歉，网络通讯超时，请确认您已经连接到互联网！'};
var endid=40665;
var m_gm_stared=false;
var VW=new Object;
var g_this=this;
var adlist=false;
VW.ua=window.navigator.userAgent.toLowerCase();
VW.env={bDebug:false,bFirefox:false,bOpera:false,bOpera7Up:false,bOpera6Dn:false,bIE:false,bIE4:false,bIE5:false,bIE6:false,bIE7:false,bIE4Up:false,bIE5Up:false,bIE6Up:false,bIE7Up:false,bIEBox:false,bNetscape:false,bMac:false};
VW.debug=function(oError,msg){if(VW.env.bDebug){if(msg){alert(msg);}else{alert(oError.description);}}}

function vw_set_debug(bDebug){VW.env.bDebug=bDebug;}
function vw_isdefine(obj){return("undefined"!=typeof obj);}

Cookie = {
    set : function (name,value,days,path) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
	if(path==undefined || path ==null || path==""){path="/";}
        document.cookie = name+"="+value+expires+";domain=.yx007.com;path="+path;
    },
    get : function (name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
    },
    remove : function (name) {
        this.set(name,"",-1);
    }
}


function vw_init_env()
{
	try{
	if(window.opera){
	VW.env.bOpera=true;
	var i=VW.ua.indexOf("opera");
	if(-1!=i){
	var v=parseInt(VW.ua.charAt(i+6));
	VW.env.bOpera7Up=(v>=7);
	VW.env.bOpera6Dn=(v<7);}}
	else{
	if(navigator.vendor!="KDE"&&document.all&&VW.ua.indexOf("msie")!=-1){
	VW.env.bIE4Up=(parseFloat(navigator.appVersion)>=4);
	VW.env.bIE5Up=(parseFloat(navigator.appVersion)>=5);
	VW.env.bIE6Up=(parseFloat(navigator.appVersion)>=6);
	VW.env.bIE7Up=(parseFloat(navigator.appVersion)>=7);
	VW.env.bIE4=(-1!=VW.ua.indexOf("msie 4"));
	VW.env.bIE5=(-1!=VW.ua.indexOf("msie 5"));
	VW.env.bIE6=(-1!=VW.ua.indexOf("msie 6"));
	VW.env.bIE7=(-1!=VW.ua.indexOf("msie 7"));
	VW.env.bIE=(-1!=VW.ua.indexOf("msie"));}
	else
		{if(document.layers){VW.env.bNetscape=true;}}
	}
	VW.env.bIEBox=VW.env.bIE&&(document.compatMode==null||document.compatMode!="CSS1Compat");
	VW.env.bFirefox=VW.ua.match(/firefox/)?true:false;
	VW.env.bMac=VW.ua.match(/mac/)?true:false;}
	catch(e){}
}
vw_init_env();

function vw_ge()
{
	var oRet=[];
	var sid="";
	var i=0;
	for(i=0;i<arguments.length;i++)
	{
		sid=arguments[i];
		if("object"==typeof(sid)){oRet.push(sid);}
		else if("string"==typeof(sid)){oRet.push(document.getElementById(sid));}
		if(1==arguments.length){return oRet.length?oRet[0]:null;}
	}
	return oRet;
}
function $(){return vw_ge.apply(this,arguments);}

function vw_gea(vid)
{
	var oRet=[],sid="",i=0,obj=null;
	if("object"==typeof(vid))
		{oRet.push(vid);}
	else
		if("string"==typeof(vid))
			{
				obj=document.all(vid);
				if(vw_is_array(obj)){oRet=obj;}else{oRet.push(obj);}
			}
	return oRet;
}
function $a()
{return vw_gea.apply(this,arguments);}

function vw_gce(sTagName,sClsName,oNode)
{
	var oRet=[];
	try{
		var obj=oNode?$(oNode):document;
		var arr=obj.getElementsByTagName(sTagName);
		for(i=0;i<arr.length;i++){if(sClsName==arr[i].className){oRet[oRet.length]=arr[i];}}
	}
	catch(err){VW.debug(err,"error in vw_gce : "+err.description);}
	return oRet;
}

function vw_gide(sTagName,sIdSearch,oNode)
{
	var oRet=[];
	try
	{
		var obj=oNode?$(oNode):document;
		var arr=obj.getElementsByTagName(sTagName);
		var i=0;
		for(i=0;i<arr.length;i++){
		if(sIdSearch&&sIdSearch.length)
			{if(arr[i].id&&-1!=arr[i].id.indexOf(sIdSearch)){oRet.push(arr[i]);}}
		else
			{oRet.push(arr[i]);}
		}
	}
	catch(err){VW.debug(err,"error in vw_gide : "+err.description);}
	return oRet;
}

function vw_enable_window(vid,benable)
{
	try{
	var obj=$(vid);
	if(obj)
		{obj.disabled=!benable;}
	else
		{throw new Error("undefined object");}
	}
	catch(err){VW.debug(err,"error in vw_enable_window : "+err.description);}
}
function $ew(){return vw_enable_window.apply(this,arguments);}

function vw_get_window_text(vid)
{
	var stext="";
	try
		{
			var obj=vw_ge(vid);
			var sTagName;
			if(obj)
				{
					sTagName=obj.tagName.toLowerCase();
					if("select"==sTagName)
						{stext=obj.options[obj.selectedIndex].value;}
					else 
						if(obj.length>1)
							{
								if("input"==obj[0].tagName.toLowerCase()&&"radio"==obj[0].type.toLowerCase())
									{for(i=0;i<obj.length;i++){if(obj[i].checked){stext=obj[i].value;break;}}}
							}
						else
							{
								switch(sTagName){
								case "input":
								case "button":
								case "textarea":{stext=obj.value;break;}
								default:{stext=obj.innerHTML;break;}
								}
							}
				}
			else
				{throw new Error("undefined object");}
		}
	catch(err)
		{VW.debug(err,"error in vw_get_window_text : "+err.description);}
	return stext;
}
function $gwt(){return vw_get_window_text.apply(this,arguments);}

function vw_set_window_text(vid,stext,bForceText)
{
try{
var obj=$(vid);
if(obj){
	switch(obj.tagName.toLowerCase()){
	case "input":{obj.value=stext;break;}
	case "button":{obj.value=stext;break;}
	default:{if(bForceText) obj.innerText=stext; else obj.innerHTML=stext;break;}
	}
}
else{
throw new Error("undefined object");}}
catch(err){
VW.debug(err,"error in vw_set_window_text : "+err.description);}}
function $swt()
{return vw_set_window_text.apply(this,arguments);}

function vw_get_class(vid)
{
var sClsName="";
try{
var obj=$(vid);
if(obj){sClsName=obj.className;}
else{throw new Error("undefined object");}}
catch(err){
VW.debug(err,"error in vw_get_class : "+err.description);}
return sClsName;}
function $gc()
{return vw_get_class.apply(this,arguments);}

function vw_set_class(vid,sClsName)
{
try{var obj=$(vid);if(obj){obj.className=sClsName;}else{throw new Error("undefined object");}}
catch(err){VW.debug(err,"error in vw_set_class : "+err.description);}
}
function $sc()
{return vw_set_class.apply(this,arguments);}

function vw_add_class(vid,sClsName)
{
try{
var obj=$(vid);
var sCls="";
if(obj){
sCls=" "+obj.className+" ";
if(-1==sCls.indexOf(" "+sClsName+" ")){
obj.className=(obj.className+(obj.className.length?" ":"")+sClsName);}}
else{
throw new Error("undefined object");}}
catch(err){
VW.debug(err,"error in vw_set_class : "+err.description);}}
function $ac()
{return vw_add_class.apply(this,arguments);}

function vw_rm_class(vid,sClsName)
{
try{
	var obj=$(vid);
	var sCls="";
	var arr=[];
	var tmp=[];
	var i=0;
	if(obj&&obj.className&&obj.className.length){
		sCls=" "+obj.className+" ";
		if(-1!=sCls.indexOf(" "+sClsName+" ")){
		arr=obj.className.split(" ");
		tmp=[];
		for(i=0;i<arr.length;i++){if(sClsName!=arr[i]){tmp[tmp.length]=arr[i];}}
		obj.className=tmp.join(" ");}}
	else{throw new Error("undefined object");}
}
catch(err){
VW.debug(err,"error in vw_set_class : "+err.description);}}
function $rc()
{return vw_rm_class.apply(this,arguments);}

function vw_show_window(vid,bShow,oPoint)
{
	try
	{
		var obj=$(vid);
		if(obj)
		{
			if(bShow)
				{obj.style.display="";if(oPoint){vw_set_window_point(vid,oPoint);}}
			else
				{obj.style.display="none";}
		}
		else{throw new Error("undefined object");}
	}
	catch(err){VW.debug(err,"error in vw_show_window : "+err.description);}
}
function $sw(){return vw_show_window.apply(this,arguments);}

function vw_is_window_show(vid)
{
	var bShow=false;
	try
	{
		var obj=$(vid);
		if(obj)
			{if("none"==obj.style.display){bShow=false;}else{bShow=true;}}
		else
			{throw new Error("undefined object");}
	}
	catch(err){VW.debug(err,"error in vw_show_window : "+err.description);}
	return bShow;
}
function $iws()
{return vw_is_window_show.apply(this,arguments);}

function vw_set_window_focus(vid,nIndex,bNotSelected)
{
	try
	{
		var obj=null;
		if("object"==typeof(vid))
			{obj=vid;}
		else
			{ if(nIndex&&nIndex>0) {obj=document.all(vid)[nIndex];} else {obj=$(vid);} }
		if(obj)
			{if(!bNotSelected){obj.select();}obj.focus();}
		else
			{throw new Error("undefined object");}
	}
	catch(err){VW.debug(err,"error in vw_set_window_focus : "+err.description);}
}
function $swf()
{return vw_set_window_focus.apply(this,arguments);}

function vw_get_window_client_size()
{
var nWidth=0,nHeight=0;
try{
if("number"==typeof(window.innerWidth)){
nWidth=window.innerWidth;
nHeight=window.innerHeight;}
else{
if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
nWidth=document.documentElement.clientWidth;
nHeight=document.documentElement.clientHeight;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
nWidth=document.body.clientWidth;
nHeight=document.body.clientHeight;}}}
catch(err){
VW.debug(err,"error in vw_get_window_client_size : "+err.description);}
return{width:nWidth,height:nHeight,Height:nHeight};}

function vw_get_event_point(oEvent)
{
var nX,nY;
if(VW.env.bIE){
nX=window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft;
nY=window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop;}
else{
nX=oEvent.clientX+window.scrollX;
nY=oEvent.clientY+window.scrollY;}
return{x:nX,left:nX,y:nY,top:nY};}
function $gep()
{return vw_get_event_point.apply(this,arguments);}

function vw_get_window_point(vid)
{
function getBorderLeft(el){
return VW.env.bIE?el.clientLeft:parseInt(window.getComputedStyle(el,null).getPropertyValue("border-left-width"));}
function getInnerLeft(el){
if(el==null){
return 0;}
if(VW.env.bIEBox&&el==document.body||!VW.env.bIEBox&&el==document.documentElement){
return 0;}
return getLeft(el)+getBorderLeft(el);}
function getLeft(el){
if(el==null){return 0;}
return el.offsetLeft+getInnerLeft(el.offsetParent);}
function getInnerTop(el){
if(el==null){
return 0;}
if(VW.env.bIEBox&&el==document.body||!VW.env.bIEBox&&el==document.documentElement){
return 0;}
return getTop(el)+getBorderTop(el);}
function getBorderTop(el){
return VW.env.bIE?el.clientTop:parseInt(window.getComputedStyle(el,null).getPropertyValue("border-top-width"));}
function getTop(el){
if(el==null){return 0;}
return el.offsetTop+getInnerTop(el.offsetParent);}
var obj=null;
var oRet={top:0,left:0,width:0,height:0};
try{
obj=$(vid);
if(obj){oRet={top:getTop(obj),left:getLeft(obj),width:obj.offsetWidth,height:obj.offsetHeight};}
else{throw new Error("undefined object");}
}
catch(err){VW.debug(err,"error in vw_get_window_point : "+err.description);}
return oRet;}
function $gwp()
{return vw_get_window_point.apply(this,arguments);}

function vw_set_window_point(vid,oPoint)
{
try{
var obj=$(vid);
if(obj&&oPoint){
obj.style.left=oPoint.left+"px";
obj.style.top=oPoint.top+"px";}
else{
throw new Error("undefined object");}}
catch(err){
VW.debug(err,"error in vw_set_window_point : "+err.description);}}
function $swp()
{return vw_set_window_point.apply(this,arguments);}

function vw_remove_element(vid)
{
try{
var obj=$(vid);
if(obj){
var oParent=obj.parentNode;
if(oParent){
oParent.removeChild(obj);}}
else{
throw new Error("undefined object");}}
catch(err){
VW.debug(err,"error in vw_remove_element : "+err.description);}}
function $re()
{return vw_remove_element.apply(this,arguments);}

function vw_window_open(sUrl,nWidth,nHeight,bNewWin,bCenter)
{
if(sUrl&&sUrl.length>7){
if(bCenter){
var nleft=screen.width/ 2- nWidth/ 2;
var ntop=screen.Height/ 2- nHeight/ 2;
return window.open(sUrl,bNewWin?"_blank":"_self","height="+nHeight+",width="+nWidth+",left="+nleft+",top="+ntop+",status=yes,toolbar=no,menubar=no,location=no");}
else{
return window.open(sUrl,bNewWin?"_blank":"_self");}}
return null;}
function $wo()
{return vw_window_open.apply(this,arguments);}

function vw_event_attach(vid,sEventName,pfnEventProc)
{
try{
var obj=$(vid);
if(obj){
if(window.ActiveXObject){
obj.attachEvent("on"+sEventName,pfnEventProc);}
else{
obj.addEventListener(sEventName,pfnEventProc,false);}}
else{
throw new Error("undefined object");}}
catch(err){
VW.debug(err,"error in vw_event_attach : "+err.description);}}
function $ea()
{return vw_event_attach.apply(this,arguments);}

function vw_event_detach(vid,sEventName,pfnEventProc)
{
try{
var obj=$(vid);
if(obj){
if(window.ActiveXObject){
obj.detachEvent("on"+sEventName,pfnEventProc);}
else{
obj.removeEventListener(sEventName,pfnEventProc,false);}}
else{
throw new Error("undefined object");}}
catch(err){
VW.debug(err,"error in vw_event_detach : "+err.description);}}
function $ed()
{return vw_event_detach.apply(this,arguments);}

function vw_rd(sUrl,nTimeout)
	{setTimeout("window.location.href='"+sUrl+"';",nTimeout?nTimeout:0);}
function $rd()
{return vw_rd.apply(this,arguments);}

function vw_show_body_scrollbar(bShow)
{
window.document.body.scroll=bShow?"yes":"no";
window.document.body.style.overflowY=bShow?"visible":"hidden";}

function array_value_exists(vValue,Arr)
{
if(Arr instanceof Array){
for(var i=0;i<Arr.length;i++){
if(vValue==Arr[i]){
return true;}}}
return false;}

function vw_left_trim(str){return str.replace(/^\s*/,"");}
function vw_right_trim(str){return str.replace(/\s*$/,"");}
function vw_trim(str){return vw_right_trim(vw_left_trim(str));}

function vw_cnstrlen(str){
var nRet=0;
try{
var cArr=str.match(/[^\x00-\xff]/ig);
nRet=str.length+(cArr==null?0:cArr.length);}
catch(err){}
return nRet;}

function vw_get_speclen_string(str,nLen,sTrimMarker)
{
var sRet=str;
try{if(sRet.length>nLen){sRet=sRet.substr(0,nLen)+sTrimMarker;}}
catch(err){}
return sRet;}

function vw_print_r(theObj,vSpecTab)
{
var sRet="";
var vTab=vSpecTab?vSpecTab:"\t";
var vTab2=vTab.substr(0,vTab.length-1);
if(theObj.constructor==Array||theObj.constructor==Object){
sRet+=(typeof(theObj)+"\n"+vTab2+"(\n");
for(var p in theObj){
if(theObj[p].constructor==Array||theObj[p].constructor==Object){
sRet+=(vTab+"["+p+"] => "+typeof(theObj)+" ");
sRet+=vw_print_r(theObj[p],(vTab+"\t"));}
else{
sRet+=(vTab+"["+p+"] => "+theObj[p]+"\n");}}
sRet+=(vTab2+")\n");}
return sRet;}

function vw_is_array(obj)
{
	if(!obj){return false;}
	return(-1!=obj.constructor.toString().indexOf("Array"));
}

function vw_is_numeric(str)
{
var a=parseInt(str,10);
return(a.toString(10)==str);}

function CVwAjax()
{
	var m_ArrMsXmlProgid=new Array('MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP');
	var m_sFrameId="id_frame_ajax_"+parseInt(Math.floor((Math.random())*10000));
	var m_oFrameAjax=null;
	var m_oFormNode=null;
	var m_nTimeOutId=0;
	var m_nIntervalId=0;
	var m_nIntervalTime=50;
	var m_oHttp=null;
	var m_fpCallbackFunc=null;
	var m_vArglist=null;

	this.MyUrlEncode=function(Va){
	return Va.replace(/:/g,'%3A').replace(/\//g, '%2F').replace(/\?/g, '%3F').replace(/&/g, '%26').replace(/=/g,'%3D');};

	this.UrlEncode=function(Va){
	if(encodeURIComponent) return encodeURIComponent(Va);
	if(escape) return escape(Va);};

	this.HtmlEncode=function(Va){
	return Va.replace(/&/g,'&amp').replace(/'/g,'&quot;').replace(/</g,'&lt;').replace(/>/g,'&gt;');};

	this.HttpGetResponse=function(strUrl,fpCallbackFunc,vArglist,sPostData){
	var oHttp=null,bPost=false;
	if(strUrl.length>0){
	strUrl+=(-1!=strUrl.indexOf("?")?"&":"?")+"rand="+Math.floor((Math.random())*10000);
	if(m_oHttp&&m_oHttp&&0!=m_oHttp.readyState){m_oHttp.abort();}
	oHttp=GetHttpObject();
	if(oHttp){
	m_oHttp=oHttp;
	m_fpCallbackFunc=fpCallbackFunc;
	m_vArglist=vArglist;
	bPost=(sPostData&&sPostData.length);
	m_oHttp.open(bPost?"POST":"GET",strUrl,true);
	if(bPost){
	SetHeader("Content-Type","application/x-www-form-urlencoded");
	SetHeader("content-length",sPostData.length);}
	HandleReadyState();
	m_oHttp.send(bPost?sPostData:null);}
	}};

	this.HttpSendPost=function(strUrl,fpCallbackFunc,vArglist,sPostData)
		{return this.HttpGetResponse(strUrl,fpCallbackFunc,vArglist,sPostData);};

	this.HttpPostForm=function(sFormId,strTagUrl,fpCallbackFunc,vArglist){
	var oForm=GetFormObjectById(sFormId);
	if(!oForm) return false;
	m_oFormNode=oForm;
	m_oFrameAjax=CreateFrame(null);
	m_fpCallbackFunc=fpCallbackFunc;
	m_vArglist=vArglist;
	DoPostForm(m_oFormNode,m_oFrameAjax,strTagUrl);
	ReleaseObject();
	return true;};

	this.GetFormData=function(sFormId){
	var oForm=GetFormObjectById(sFormId);
	if(!oForm){return null;}
	var sFormData="",oElement,sName,sValue,bEnable,hasSubmit=false;
	var i=0;
	for(i=0;i<oForm.elements.length;i++){
	oElement=oForm.elements[i];
	bEnable=oForm.elements[i].disabled?false:true;
	sName=oForm.elements[i].name;
	sValue=oForm.elements[i].value;
	if(!bEnable||!sName){continue;}
	switch(oElement.type){
	case "select-one":
	case "select-multiple":{
	for(var j=0;j<oElement.options.length;j++){
	if(oElement.options[j].selected){
	if(window.ActiveXObject){
	sFormData+=encodeURIComponent(sName)+'='+encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text)+'&';}
	else{
	sFormData+=encodeURIComponent(sName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}}break;
	case "radio":
	case "checkbox":{
		if(oElement.checked){
		sFormData+=encodeURIComponent(sName)+'='+encodeURIComponent(sValue)+'&';}}break;
	case "file":
	case undefined:
	case "undefined":
	case "reset":
	case "button":break;
	case "submit":{
		if(hasSubmit==false){
		sFormData+=encodeURIComponent(sName)+'='+encodeURIComponent(sValue)+'&';
		hasSubmit=true;}}break;
	default:{sFormData+=encodeURIComponent(sName)+'='+encodeURIComponent(sValue)+'&';}
	break;}}
	return sFormData.substr(0,sFormData.length-1);};

	function CreateHttpObject()
	{
		var obj=null;
		try{obj=new XMLHttpRequest();}
		catch(e){
			for(var i in m_ArrMsXmlProgid)
				{try{obj=new ActiveXObject(m_ArrMsXmlProgid[i]);break;}catch(e){}}
		}
		finally{return obj;}
	}
	function GetHttpObject(){return CreateHttpObject();}

	function ReleaseObject()
	{if(m_oHttp){m_oHttp=null;}}

	function GetFormObjectById(sFormId)
	{
	var oForm=null;
	if(typeof sFormId=='string')
		{oForm=(document.getElementById(sFormId)||document.forms[sFormId]);}
	else
		if(typeof sFormId=='object'){oForm=sFormId;}
	return oForm;}

	function CreateFrame(sSecureUri)
	{
	var frameId=m_sFrameId;
	var oframe=null;
	if(window.ActiveXObject)
	{
		oframe=document.createElement('<IFRAME id="'+frameId+'" name="'+frameId+'">');
		if(typeof sSecureUri=='boolean')
			{oframe.src="JavaScript:false";}
		else{oframe.src=sSecureUri;}
	}
	else
	{
		oframe=document.createElement('IFRAME');
		oframe.id=frameId;
		oframe.name=frameId;
	}
	oframe.style.position='absolute';
	oframe.style.top='-1000px';
	oframe.style.left='-1000px';
	document.body.appendChild(oframe);
	return oframe;}

	function SetHeader(sLabel,sValue)
	{
	if(!m_oHttp)return;
	if(sLabel&&sLabel.length&&sValue){m_oHttp.setRequestHeader(sLabel,sValue);}}

	function DoPostForm(oForm,oFrameAjax,sUri)
	{
	if(!oForm) return false;
	if(!oFrameAjax) return false;
	oForm.action=sUri;
	oForm.enctype='multipart/form-data';
	oForm.method='POST';
	oForm.target=oFrameAjax.id;
	oForm.submit();
	var CallbackDoPostForm=function(){
	var oResponse={};
	oResponse.responseText=oFrameAjax.contentWindow.document.body?oFrameAjax.contentWindow.document.body.innerHTML:null;
	oResponse.responseXML=oFrameAjax.contentWindow.document.XMLDocument?oFrameAjax.contentWindow.document.XMLDocument:oFrameAjax.contentWindow.document;
	oResponse.argument=m_vArglist;
	if(m_fpCallbackFunc.postfrm)
	{
		if(m_fpCallbackFunc.advmode){m_fpCallbackFunc.postfrm(oResponse);}
		else{m_fpCallbackFunc.postfrm(oResponse.responseText,m_vArglist);}
	}
	if(window.ActiveXObject)
		{oFrameAjax.detachEvent("onload",CallbackDoPostForm);}
	else
		{oFrameAjax.removeEventListener("load",CallbackDoPostForm,false);}
	window.setTimeout(function(){document.body.removeChild(oFrameAjax);},100);
	};
	if(window.ActiveXObject){
	oFrameAjax.attachEvent('onload',CallbackDoPostForm);}
	else{
	oFrameAjax.addEventListener('load',CallbackDoPostForm,false);}}

	function HandleReadyState()
	{
		if(m_fpCallbackFunc&&m_fpCallbackFunc.timeout)
		{m_nTimeOutId=window.setTimeout(function(){ProcessTimeout();},m_fpCallbackFunc.timeout);}
		m_nIntervalId=window.setInterval
		(
		function(){if(m_oHttp&&4==m_oHttp.readyState){ClearAllTimer();HandleTransactionResponse();}},
		m_nIntervalTime);
	}

	function ProcessTimeout()
	{
	if(IsCallInProgress()){m_oHttp.abort();ClearAllTimer();HandleTransactionResponse(true);return true;}
	return false;}

	function ClearAllTimer()
	{
	if(m_nIntervalId){window.clearInterval(m_nIntervalId);}
	if(m_nTimeOutId){window.clearTimeout(m_nTimeOutId);}
	m_nIntervalId=0;
	m_nTimeOutId=0;}

	function IsCallInProgress()
	{
	if(!m_oHttp) return false;
	return(4!=m_oHttp.readyState&&0!=m_oHttp.readyState);}

	function HandleTransactionResponse(bIsTimeout)
	{
		if(!m_fpCallbackFunc){ReleaseObject();return;}
		var nStatusCode=0,oResponse=null,pfnProc=null;
		try
		{
			if(undefined !==m_oHttp.status&&0!=m_oHttp.status)
				{nStatusCode=m_oHttp.status;}
			else
				{nStatusCode=13030;}
		}
		catch(err){nStatusCode=13030;}
		if(nStatusCode>=200&&nStatusCode<300)
		{
			try{
				oResponse=CreateResponseObject();
				if(m_fpCallbackFunc.success)
				{
					if(m_fpCallbackFunc.advmode)
						{m_fpCallbackFunc.success(oResponse);}
					else
						{m_fpCallbackFunc.success(oResponse.responseText,m_vArglist);}
				}
			}
			catch(err){}
		}
		else
		{
			try
			{
				switch(nStatusCode)
				{
					case 12002:
					case 12029:
					case 12030:
					case 12031:
					case 12152:
					case 13030:
					{
						oResponse=CreateExceptionObject(bIsTimeout?bIsTimeout:false);
						if(bIsTimeout&&m_fpCallbackFunc.tmoproc)
							{pfnProc=m_fpCallbackFunc.tmoproc;}
						else
							{pfnProc=m_fpCallbackFunc.failure;}
						if(pfnProc)
						{
							if(m_fpCallbackFunc.advmode)
								{pfnProc(oResponse);}
							else
								{pfnProc(oResponse.responseText,m_vArglist);}
						}
					}break;
					default:{
					oResponse=CreateResponseObject();
					if(m_fpCallbackFunc.failure){
					if(m_fpCallbackFunc.advmode){
					m_fpCallbackFunc.failure(oResponse);}
					else{
					m_fpCallbackFunc.failure(oResponse.responseText,m_vArglist);}}}break;
				}
			}
			catch(err){}
		}
		ReleaseObject();
		oResponse=null;
	}

	function CreateResponseObject()
	{
	var obj={};
	var ArrHeader={};
	try
	{
		var headerStr=m_oHttp.getAllResponseHeaders();
		var header=headerStr.split('\n');
		var delimitPos=0;
		for(var i=0;i<header.length;i++)
		{
			delimitPos=header[i].indexOf(':');
			if(-1!=delimitPos){
			ArrHeader[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}
		}
	}
	catch(e){}
	obj.fid=m_oHttp.fid;
	obj.status=m_oHttp.status;
	obj.statusText=m_oHttp.statusText;
	obj.getResponseHeader=ArrHeader;
	obj.getAllResponseHeaders=headerStr;
	obj.responseText=m_oHttp.responseText;
	obj.responseXML=m_oHttp.responseXML;
	obj.argument=m_vArglist;
	return obj;}

	function CreateExceptionObject(bIsAbort)
	{
	var COMM_CODE=0;
	var COMM_ERROR='communication failure';
	var ABORT_CODE=-1;
	var ABORT_ERROR='transaction timeout or aborted';
	var obj={};
	try{
	obj.fid=m_oHttp.fid;
	obj.argument=m_vArglist;
	if(bIsAbort){
	obj.status=ABORT_CODE;
	obj.statusText=ABORT_ERROR;
	obj.responseText=ABORT_ERROR;}
	else{
	obj.status=COMM_CODE;
	obj.statusText=COMM_ERROR;
	obj.responseText=COMM_ERROR;}}
	catch(e){}
	return obj;}
}

var CONST_OP_SUCC_GET=0;
var CONST_OP_SUCC_SAVE=1;
var CONST_OP_ERR_NOTLOGIN=-6;
var CONST_AJAX_OP_ALL_GET='allget';
var CONST_AJAX_OP_DIG_SAVE='digsave';
var CONST_AJAX_OP_DIGPEOPLE_SAVE='digpeoplesave';
var CONST_AJAX_OP_FAV_GET='favget';
var CONST_AJAX_OP_FAV_SAVE='favsave';
var CONST_AJAX_OP_FAV_MODIFY='favmodify';
var CONST_AJAX_OP_FAVPEOPLE_SAVE='favpeoplesave';
var CONST_AJAX_OP_FAVCOUNT_SAVE='favcountsave';
var CONST_AJAX_OP_FAV_DELETE='favdelete';
var CONST_AJAX_OP_VISIT_SAVE='visitsave';
var CONST_AJAX_OP_VOTE_SAVE='votesave';
var CONST_AJAX_OP_VOTEPEOPLE_SAVE='votepeoplesave';
var CONST_AJAX_OP_VISITOR_SAVE='visitorsave';
var CONST_AJAX_OP_FRIEND_SAVE='friendsave';
var CONST_AJAX_OP_PLAYED_GET='playedget';
var CONST_AJAX_OP_PLAYED_SAVE='playedsave';
var CONST_HASHDB_USER_TYPE_FAVED='faved';
var CONST_HASHDB_USER_TYPE_DIGED='diged';
var CONST_HASHDB_USER_TYPE_VISITOR_PEOPLE='visitorpeople';
var CONST_HASHDB_USER_TYPE_VOTE_PEOPLE='votepeople';
var CONST_HASHDB_USER_TYPE_PLAYED='played';
var CONST_LOGIN_ERROR_SUCCESS=0;
var CONST_LOGIN_ERROR_PARAM=-1;
var CONST_LOGIN_ERROR_USRNOTEXIST=-2;
var CONST_LOGIN_ERROR_PASSWORD=-3;
var CONST_LOGIN_ERROR_DENY=-4;
var CONST_REMOTE_RANGE_STEP=900000;
var g_timerSystemHint=0;
var g_bGameLoadFinished=false;
var g_cDragGePopBox=null;
function CXGameFramework(){
var m_oThis=this;
var m_oUsrData={};
var m_ArrRegedOnLoadFunc=[];
this.installFrame=function(){
vw_event_attach(window,"load",handleLoad);
vw_event_attach(window,"resize",handleResize);
};

this.installFrameEx=function(){handleLoad();};
this.regOnLoadFunc=function(pfnFunc)
{var i=0,bExist=false;
for(i=0;i<m_ArrRegedOnLoadFunc.length;i++){if(pfnFunc==m_ArrRegedOnLoadFunc[i]){bExist=true;break;}}
if(!bExist){m_ArrRegedOnLoadFunc.push(pfnFunc);}
};

this.setUserData=function(oUsrData){m_oUsrData=oUsrData;};
this.isLogin=function(){return Cookie.get("userID");};
this.getSafeUId=function(){return m_oUsrData.sSafeUId;};
this.getUserName=function(){return m_oUsrData.sUserName;};
this.getDefaultUserImg=function(){return "/images/default_uimg.gif";};
this.getDefaultGameImg=function(){return "/images/game_default.jpg";};
this.getRandServer=function(){return g_ArrResServerList[((new Date()).getSeconds()%g_ArrResServerList.length)];};

this.saveToFav=function(gameID)
{
	if(!g_cFrm.isLogin())
	{
		if (confirm(alert1))
		{$rd("/user/login");}
	}
	else
		{
			{
				var callbackAjaxProc=
				{
					advmode:false,
					timeout:1*60*1000,
					failure:function(sText,vArglist){lib_process_error("","net");},
					success:function(sText,vArglist){alert(sText);}
				};
				var ajax=new CVwAjax();
				ajax.HttpGetResponse("/asp/fav/AddFlash.asp?id="+gameID,callbackAjaxProc);
			}
		}
};

this.delFromFav=function(gameID)
{
	if(!g_cFrm.isLogin())
	{
		if (confirm(alert1))
		{$rd("/user/login");}
	}
	else
		{
			{
				var callbackAjaxProc=
				{
					advmode:false,
					timeout:1*60*1000,
					failure:function(sText,vArglist){lib_process_error("","net");},
					success:function(sText,vArglist){alert(sText);
					parent.document.getElementById(""+gameID+"").style.display=none;}

				};
				var ajax=new CVwAjax();
				ajax.HttpGetResponse("/asp/fav/DelFlash.asp?id="+gameID,callbackAjaxProc);
			}
		}
};
this.picxh=function(comid)
{
	if(!g_cFrm.isLogin())
	{
		if (confirm(alert1)){$rd("/user/login");}
	}
	else
	{
		var callbackAjaxProc={
			advmode:false,
			timeout:1*60*1000,
			failure:function(sText,vArglist){lib_process_error("","net");},
			success:function(sText,vArglist){
				try
				{
					if (sText=="ok") {alert("献花成功！"); } else {alert("你已经献过花了！");}
					CmtInit();ChangeCmtState(2);			
				}
				catch(error){lib_process_error(error,"excep");}
			}
		};
		var ajax=new CVwAjax();
		ajax.HttpGetResponse("/asp/ajax/picxhcom.asp?id="+comid,callbackAjaxProc);
	}
};
this.picidxh=function(picid,flowers)
{
	if(!g_cFrm.isLogin())
	{
		if (confirm(alert1))
		{$rd("/user/login");}
	}
	else
		{
			{
		var callbackAjaxProc={
		advmode:false,
		timeout:1*60*1000,
		failure:function(sText,vArglist){lib_process_error("","net");},
		success:function(sText,vArglist){
			try
			{
				if (sText=="ok") {alert("献花成功！");
				parent.document.getElementById("pic"+picid+"").innerHTML=flowers+1;

			} else if (sText=="nocom") {alert("此截图没有评论，不能献花！");

			} else {alert("你已经献过花了！");}

			}

			catch(error){}
		}
	};
				var ajax=new CVwAjax();
				ajax.HttpGetResponse("/asp/ajax/picxh.asp?id="+picid,callbackAjaxProc);
			}
		}
};
this.getResPathByMd5=function(sMd5,sBurl,sType,sId,sServer)
{
	var sRet="";
	if(!sType){sType="swf";}
	if(sMd5.indexOf("http://")<0){
		if (sId > endid)
			{sRet="http://1.yx007.com/"+sMd5;}
		else
			{
				if(sServer>-1){
					if (g_ArrResServerList[sServer].indexOf(".swf")>1){sRet=""+g_ArrResServerList[sServer];}
					else{sRet=""+g_ArrResServerList[sServer]+sMd5;}
				}else{
					sRet="http://9.yx007.com/"+sMd5;
					if (sBurl!="")
					{
						sRet=g_ArrResServerList[7];
					}
				}
			}
	}else{
		sRet=sMd5;
	}
	return sRet;
};


this.getUserPicHtml=function(uid,nWidth,nHeight,sClsName,oInfo){
var bSmall=(nWidth<=20&&nHeight<=20);
var sImgPath=m_oThis.getUserPicPathByUId(uid,bSmall);
var sUsrImgId="usrimg_"+uid+"_"+parseInt(Math.floor((Math.random())*10000));
var sImg="";
if(""==sImgPath){m_oThis.getDefaultUserImg();}
sImg=""+"<img "+((sClsName&&""!=sClsName)?("class="+sClsName):"")+" "+"src=\"" + m_oThis.getDefaultUserImg() + "\" width="+nWidth+" height="+nHeight+" border=0 align=absMiddle id=\"" + sUsrImgId + "\" ";
if(oInfo){
sImg+="onmouseover=\"JavaScript:g_cFrm.onUIconOver(this,'" + uid + "','" + oInfo['uname'] + "','" + oInfo['uext'] + "');\" "+"onmouseout=\"JavaScript:g_cFrm.onUIconOut();\" ";}
sImg+="/><img src=\"" + sImgPath + "\" width=0 height=0 style=\"border:0px;\" "+"onload=\"JavaScript:$('" + sUsrImgId + "').src=this.src;$sw(this,false);\" />";
return sImg;};

this.getLeftWidth=function(){
var nWinWidth=vw_get_window_client_size().width;
return Math.max(Math.floor((nWinWidth-24)*0.25),249);};

this.onUIconOver=function(oImg,uid,uname,sExt){
if(!oImg||oImg.id.indexOf("usrimg_")<0){return false;}
var oPot=$gwp(oImg);
oPot.top=oPot.top+oPot.height;
if((oPot.left+240)>vw_get_window_client_size().width){
oPot.left=(vw_get_window_client_size().width-250);}
$swt("divLargerIcon",getLargerIconHtml(oImg,uid,uname,sExt));
$swp("divLargerIcon",oPot);
$sw("divLargerIcon",true);};

this.onUIconOut=function(){$sw("divLargerIcon",false);};
this.gotoMyPage=function(sSp){vw_rd(m_oUsrData.sUriMy+(sSp?('/'+sSp):''));};

function getLargerIconHtml(oImg,uid,uname,sExt){
var str=''+'<table class="cntbox" width=240 border=0 cellpadding=0 cellspacing=0>'+'<tr><td id="tit" style="height:20px;" colspan=2><div class="karrodiv etxtb">'+uname+'</div></td></tr>'+'<tr>'+'<td width=88 style="text-align:center;padding: 4px 2px;">'+g_cFrm.getUserPicHtml(uid,80,80,'limg')+'</td>'+'<td style="padding: 4px;" valign=top>'+sExt+'</td>'+'</tr>'+'</table>';
return str;}

function handleLoad()
{
	handleResize();
	ListUserLoginStr();
	execRegedOnLoadFunc();
	window.setTimeout(setTM,1500);
}

function handleResize(){
try{
var nWinWidth=vw_get_window_client_size().width;
var nWinHeight=vw_get_window_client_size().height;
var oBody=$("body");
var oMarkAll=$("maskAll");
var oPreLogin=$("preLogin");
var oPreMember=$("preMember");
var oGePopBox=$("gePopBox");
var oPlayFcDiv=$("id_div_fc_tab");
if(oBody){
	if(nWinWidth<=1000){oBody.style.width="1000px";}
	else{oBody.style.width="100%";}
}
if(oMarkAll){
oMarkAll.style.width=(nWinWidth)+"px";
oMarkAll.style.height=(nWinHeight)+"px";}
if(oPreLogin){
oPreLogin.style.width="460px";
oPreLogin.style.height="130px";
oPreLogin.style.top=(nWinHeight/2-130)+"px";
oPreLogin.style.left=(nWinWidth/2-230)+"px";}
if(oPreMember){
oPreMember.style.width="460px";
oPreMember.style.height="130px";
oPreMember.style.top=(nWinHeight/2-180)+"px";
oPreMember.style.left=(nWinWidth/2-230)+"px";}
if(oGePopBox){
oGePopBox.style.width="460px";
oGePopBox.style.height="230px";
oGePopBox.style.top=(nWinHeight/2-180)+"px";
oGePopBox.style.left=(nWinWidth/2-230)+"px";}
if(oPlayFcDiv){
oPlayFcDiv.style.width=(nWinWidth)+"px";
oPlayFcDiv.style.height=(nWinHeight)+"px";}
var oFocusFlash=$("id_focusflash");
if(oFocusFlash){
var nFocusWidth=Math.floor(m_oThis.getLeftWidth()-4);
var nFocusHeight=Math.floor(nFocusWidth*(158/364));
oFocusFlash.width=nFocusWidth;
oFocusFlash.height=nFocusHeight;}}
catch(err){
lib_process_error(err.description,"excep");}}

function ListUserLoginStr()
{
	var
	mess1="凌晨好";
	hr = new Date().getHours();
	if (( hr >= 4 ) && (hr < 7)){mess1="清晨好";}
	if (( hr >= 7 ) && (hr < 11)){mess1="早上好";}
	if (( hr >= 11) && (hr <= 13)){mess1="上午好";}
	if (( hr >= 13) && (hr <= 18)){mess1="下午好";}
	if ((hr >= 18) && (hr <= 24)){mess1="晚上好";}
	$swt('ListTime',mess1);
	if (m_oThis.isLogin())
		{userStr = '<nobr>' + mess1+','+unescape(unescape(Cookie.get("UserName")))+' | <a href="/user/mydata/" target="_self">修改资料</a> | <a href="/user/mygame/" target="_self">收藏夹</a> | <a id="latestplaygames" href="javascript:ListPlayedGames();void(0);" target="_self">游戏记录</a> | <a href="/asp/fav/CheckUserLogin.asp?action=logout" target="_self">退出</a></nobr>';
		$swt('ulogin',userStr);}
}

function execRegedOnLoadFunc()
{
	if(0==m_ArrRegedOnLoadFunc.length){return false;}
	for(i=0;i<m_ArrRegedOnLoadFunc.length;i++){m_ArrRegedOnLoadFunc[i]();}
}
}


var g_cFrm=new CXGameFramework();
g_cFrm.installFrame();

function lib_get_evalvalue(str)
{
var vRet=null;
try{eval("var vRet = "+str);}catch(err){}
return vRet;}

function lib_process_alertmsg(msg)
{return lib_show_systemhint(msg);}

function lib_process_error(error,errIdx)
{
if(errIdx&&ArrInfo[errIdx])
	{alert(ArrInfo[errIdx]+"\n"+error);}
else
	{alert(error);}}

function lib_show_systemhint(msg,bIsBold,nTimeout)
{
var oPt=vw_get_window_point("id_nvbar_my");
var sTxt=bIsBold?("<b>"+msg+"</b>"):msg;
oPt.left+=(oPt.width+(VW.env.bIE?8:5));
oPt.top+=(VW.env.bIE?-1:0);
$swt("id_hintxt",sTxt);
$sw("id_tab_syshint",true,oPt);
if(g_timerSystemHint){window.clearTimeout(g_timerSystemHint);}
window.setTimeout(function(){$sw("id_tab_syshint",false);g_timerSystemHint=0;},
nTimeout?nTimeout:30*1000);}

function lib_get_followhinthtml(sType,sContent,nWidth)
{
var str=""+"<div class=mbox>"+"<div class=\"mbox" + sType + "\" "+(nWidth?(" style=\"width:" + nWidth + "px\" "):"")+">"+sContent+"</div><div class=sp></div>"+"</div>";
return str;}

function lib_show_virtualswf(bShow)
{
	var ofg=$("flashgame");
	var ofvp=$("flashgame_vpic");
	var ofload=$("flashgame_loading");
	if(ofg&&ofvp&&ofload){
		$sw("flashgame_vpic",bShow);
		if(bShow){$sw("flashgame",false);$sw("flashgame_loading",false);}
		else{
			if(m_gm_stared == true){$sw("flashgame",true);$sw("flashgame_loading",false);}
			else{$sw("flashgame",false);$sw("flashgame_loading",true);}
		}
	}
}

function lib_show_virtualswf(bShow)
{
	var ofg=$("flashgame");
	var ofvp=$("flashgame_vpic");
	var ofload=$("flashgame_loading");
	if(ofg&&ofvp&&ofload){
		$sw("flashgame_vpic",bShow);
		if(bShow){$sw("flashgame",false);$sw("flashgame_loading",false);}
		else{
			if(m_gm_stared == true){$sw("flashgame",true);$sw("flashgame_loading",false);}
			else{$sw("flashgame",false);$sw("flashgame_loading",true);}
		}
	}
}

function lib_show_maskall(bShow)
{
$sw("maskAll",bShow);
if(false==bShow){
lib_show_prelogin(false);
lib_show_premember(false);
lib_show_gepopbox(false);}
}

function lib_show_prelogin(bShow)
{
lib_show_virtualswf(bShow);
$sw("preLogin",bShow);
$sw("maskAll",bShow);
if(bShow){
lib_http_get_response(
"/t/login.htm",
30*1000,false,
function(sText,vArglist){
$swt("preLogin",sText);
$swt("id_span_safe_uid",g_cFrm.getSafeUId());});}}

function lib_show_premember(bShow)
{
lib_show_virtualswf(bShow);
$sw("preMember",bShow);
$sw("maskAll",bShow);
if(bShow){
lib_http_get_response(
"/t/member.htm",
30*1000,false,
function(sText,vArglist){
$swt("preMember",sText);});}}

function lib_show_gepopbox(bShow,sTitle,sContent,sButton,pfnSuccCallback,bSetDataOnly)
{
	lib_show_virtualswf(bShow);
	$sw("gePopBox",bShow);
	$sw("maskAll",bShow);
	var pfnSetPopBox=function(){
		if(sTitle){$swt("gePopBox_title",sTitle);}
		if(sContent){$swt("gePopBox_msg",sContent);}
		if(sButton){
			if("[hidden]"==sButton){$sw("gePopBox_button_row",false);}
			else{$swt("gePopBox_button",sButton);}
		}
		if(!g_cDragGePopBox){
			var cDragGePopBox;
			}
	};
	if(bShow){
		if($("gePopBox_title")&&$("gePopBox_msg")){pfnSetPopBox();}
		if(!bSetDataOnly){
			lib_http_get_response("/t/pop_box.htm",30*1000,false,function(sText,vArglist){$swt("gePopBox",sText);pfnSetPopBox();if(pfnSuccCallback){pfnSuccCallback();}});
		}
	}
}

function lib_handle_keydown(sFrmId,ArrCtrl,sSubmitBtnId)
{
	var oFrm=$(sFrmId);
	var oBtn=$(sSubmitBtnId);
	if(oFrm&&oBtn&&vw_is_array(ArrCtrl))
	{
		var callbackKeydownProc=function(evt){if(13==evt.keyCode){oBtn.click();}};
		for(var i=0;i<ArrCtrl.length;i++){vw_event_attach($(ArrCtrl[i]),"keydown",callbackKeydownProc);}
		vw_event_attach(document,"keydown",function(evt){if(evt.ctrlKey&&13==evt.keyCode){oBtn.click();}});
	}
};

function lib_add_favorite(obj)
{
	if(window.sidebar&&"object"==typeof(window.sidebar)&&"function"==typeof(window.sidebar.addPanel))
		{window.sidebar.addPanel('■007小游戏 - YX007.com','http://www.yx007.com/?fav','');}
	else
	{	if(document.all&&"object"==typeof(window.external))
			{window.external.addFavorite('http://www.yx007.com/?fav','■007小游戏 - YX007.com');}
	}
}

function lib_http_get_response(sUrl,nTimeout,bQuietMode,callbackSuccessProc,vArglist)
{
if(!nTimeout){nTimeout=2*60*1000;}
var callbackAjaxGProc={
advmode:false,
timeout:nTimeout,
tmoproc:function(sText,vArglist){if(!bQuietMode){lib_process_error("","tmout");}},
failure:function(sText,vArglist){if(!bQuietMode){lib_process_error("","net");}},
success:function(sText,vArglist){if(callbackSuccessProc){callbackSuccessProc(sText,vArglist);}}};
window.setTimeout(
function(){(new CVwAjax()).HttpGetResponse(sUrl,callbackAjaxGProc,vArglist);},
0);}

function BindListPlayedGames()
{
	if (listPlayedGames)
		{listPlayedGames = false;}
	else
		{
			$('userplayedgames').style.display = "none";
			$ed("body","click",BindListPlayedGames);
		}
}

function ListPlayedGames()
{
	playerGames = unescape(Cookie.get("playerGames"));
	if (playerGames)
	{
		var games = playerGames.split("|");
		var gameListStr = '';
		n = games.length > 20 ? 20 : games.length;
		for (i=0; i<n-1; i++)
		{
			gameInfo = games[i].split("$");
			gameListStr += '<a href="/list/play_'+gameInfo[0]+'.htm"><span>'+gameInfo[2]+'</span>'+gameInfo[1]+'</a>';
		}
		gameListStr += '<a href="javascript://" onclick="ClearPlayedGames()" style="text-align:center;" target="_self">清空列表</a>';
		$swt("userplayedgames",gameListStr);
		$("userplayedgames").style.left=document.body.clientWidth/2+215+"px";
		$("userplayedgames").style.display='block';
		listPlayedGames = true;
		$ea("body","click",BindListPlayedGames);
	}
}

function ClearPlayedGames()
{
	Cookie.remove("playerGames");alert("记录清理成功!");
}

function getstr(n,m){
	var ghtml='';
	for(i=n;i<m;i++){
		if(isNaN(game[i][0])){gurl=game[i][0];}else{gurl='/list/play_'+game[i][0]+'.htm';}
		if (game[i][3].substr(0,7)!="http://")
		{
			game[i][3]="http://img.yx007.com/sp2/"+game[i][3];
		}
		ghtml+='<li class="thumbpic" title="'+game[i][1]+'&#13;'+game[i][2]+'个玩友收藏该游戏&#13;好评:'+game[i][4]+'好评率:'+game[i][5]+'%"><div class="in"><a href="'+gurl+'"><img src="'+game[i][3]+'"></a></div><div class="c_detail"><span class="votebar"><font class="goodv" style="width:'+game[i][5]+'%;">'+game[i][4]+'</font></span><a href="'+gurl+'" class="lstt">'+game[i][1]+'</a></div></li>';
	}
	return ghtml;
}

function tab(n,divname)
{
	var h3list=vw_gide("h3","",divname);
	for (i=0;i<h3list.length;i++)
	{
		h3list[i].className = "sq_taboff";
	}
	listTag = n>3 ? 'eliteg2':'eliteg';
	$swt($(listTag),gstr[n]);
	if (n>3){n=n-4;}
	h3list[n].className = "sq_tabon";
	setTM();
}

function killErrors() {return true;}
//window.onerror = killErrors;

var lastTM=null;
function setTM()
{
	var a=vw_gide("a");
	for(var i=0;i<a.length;i++)
	{
		if(a[i].getAttribute("img"))
		{
			a[i].onmouseover=function (){showThumb(this);}
			a[i].onmouseout=function (){hideThumb();}
		}else
		{
			if(a[i].parentNode&&a[i].parentNode.className=="in"&&!a[i].onmouseover)
			{
				a[i].parentNode.onmouseover=function (){
					var aArr = this.getElementsByTagName("a");
					var gameid=aArr[0].href.replace(/http:\/\/www\.yx007\.com\/list\/play_(\d*)\.htm/g,"$1");
					if (this.childNodes.length<2)
					{
						var addA=document.createElement("a");
						if (typeof(isdeletegame)!="undefined")
						{
							addA.title="删除该游戏";
							addA.className="delgame";
							addA.href='javascript:g_cFrm.delFromFav('+gameid+');';
						}else
						{
							addA.title="收藏该游戏";
							addA.className="addgame";
							addA.href='javascript:g_cFrm.saveToFav('+gameid+');';
						}
						addA.target="_self";
						this.appendChild(addA);
					}else
					{
						aArr[1].className=typeof(isdeletegame)!="undefined"?"delgame":"addgame";
					}
				}
				a[i].parentNode.onmouseout=function (){
					var aArr = this.getElementsByTagName("a");
					if (aArr[1].className!=""){aArr[1].className="";}
				}
			}
		}
	}
}
document.write("<div id='TMdiv' style='display:none;'><img src=/i/bk.gif id='TMimg'><div id='TMtext'></div></div>");

function moveThumb(a)
{
	var p=getMouse(a);
	if(document.documentElement)
	{
		var b=document.documentElement;
		if(p.x>b.clientWidth+b.scrollLeft-163)p.x-=170;
		if(p.y>b.clientHeight+b.scrollTop-140)p.y-=150;
	}
	$('TMdiv').style.left=(p.x+27)+"px";
	$('TMdiv').style.top=(p.y+27)+"px";
}

function showThumb(a)
{
	$('TMimg').src="http://img.yx007.com/sp2/"+a.getAttribute('img');
	$swt("TMtext", $gwt(a).replace(/^(.*?)\&nbsp\;/g,''));
	$sw('TMdiv',true);
	a.onmousemove=moveThumb;
}

function hideThumb()
{
	lastTM=null;
	if ($('TMdiv')){$sw('TMdiv',false);}
}

function getMouse(a)
{
	a=a||window.event;
	if(a.pageX||a.pageY) return {x:a.pageX,y:a.pageY};
	return {x:a.clientX+document.documentElement.scrollLeft,y:a.clientY+document.documentElement.scrollTop};
}
function ctab(e)
{
	var currentpage=e.getAttribute("page");
	var contentid=e.parentNode.getAttribute("contain");
	var t=e.parentNode.getElementsByTagName("a");
	var m=$(contentid).childNodes;
	for (i=0; i<t.length; i++)
	{
		t[i].className="";
		m[i].style.display="none";
	}
	t[currentpage-1].blur();
	t[currentpage-1].className="current";
	m[currentpage-1].style.display="";
}
function textlink(){
	document.write('<a href="http://www.webgame188.cn/reg/950061.htm">仙域</a>');
}