﻿// JScript 文件

function Rands()
{
	var _Rd=parseInt(Math.random(Math.random()*2147483647)*100);
	_Rd=_Rd>10?_Rd:10+_Rd;
	this._Rands=_Rd;
	return _Rd;
}
function Browser()
{
	var _Agt = navigator.userAgent.toLowerCase();
	var _bs  = /(firefox|netscape|opera).?[\/| ](.)\.([^;\)]+|[^\)]+\))$/.exec(_Agt);
	if(!_bs) _bs = /(msie) (.)\.[^;]+;/.exec(_Agt);
	var _os=/(windows) (nt) ([0-9]+)\.([0-9]+)/.exec(_Agt);
	var __os="Windows XP";
	if(_os[0]=="windows 98")__os="Windwos 98";
	else if(_os[0]=="windows nt 5.0")__os="Windwos 2000";
	else if(_os[0]=="windows nt 5.1")__os="Windwos xp";
	else if(_os[0]=="windows nt 5.2")__os="Windows 2003";
	else if(_os[0]=="windows nt 6.0")__os="Windows Vista";
	else __os="MacPPC";
	this._OptionSys=__os;
try
{
	this._Browser=_bs[1]+_bs[2];
}catch(e)
{this._Browser="Opera9";}
	var win_height=window.parent.screen.height;
	var win_width=window.parent.screen.width;
	this._Ration=win_width+"*"+win_height;
	//return _bs[1]+_bs[2]+"|"+_os[0]+"|"+win_width+"*"+win_height;

}
function DateTimes()
{
	var _now=new Date
	var _datetimes=_now.getFullYear().toString()+_now.getMonth().toString()+_now.getDate().toString()+_now.getHours().toString()+_now.getMinutes().toString()+_now.getSeconds().toString();
	this._DateTimes=_datetimes;
	return _datetimes;
}
function Close()
{
	var blnCheckUnload = true;window.onbeforeunload=function(){	if((window.event.clientX>document.body.clientWidth&&event.clientY<0)||event.altKey){delCookie("wajcookie");}};
}
function getFromURL()
{
	/*var fromurl=document.referrer;
	var currenturl=window.location.href;
	var temp_domain=document.domain;
	fromurl = fromurl == "" || fromurl.indexOf(temp_domain) > 0 ? "about:blank" : fromurl;
	this._Fromurl=fromurl;
	this._Currenturl=currenturl;
	this._DetailPage=getRegxChar(currenturl,"1");
	return;*/
	var fromURL=top.document.referrer;
	var currenturl=top.window.location.href;
	var temp_fromURL=fromURL.split("/");
	var temp_currenturl=currenturl.split("/");
	if(fromURL=="" || temp_fromURL[2]==temp_currenturl[2]) fromURL="about:blank";
	this._Fromurl=fromURL;
	this._Currenturl=currenturl;
	this._DetailPage=getRegxChar(currenturl,"1");
}
function getRegxChar(str,type)
{
	switch(type)
	{
		case "1": var temp=str.split("/");var index=parseInt(temp.length-1);if(temp[index]||temp[index]!=""){return temp[index].substring(0,temp[index].lastIndexOf('.'));}return "index";
	}
}
function Main(pagename)
{  
	var p= new getFromURL();
	var br=new Browser();
	var FirstEnterPage=p._Currenturl; 
	var FromURL=p._Fromurl; 
	var VisitPageDetail=p._DetailPage; 
	if(document.getElementById("hidVisitPageDetail")) VisitPageDetail=document.getElementById("hidVisitPageDetail").value;
	if(pagename!="")
		VisitPageDetail=pagename;
	var CurrentURL=p._Currenturl; 
	var OpSystem=br._OptionSys; 
	var IeType=br._Browser; 
	var SysRation=br._Ration;
	var Game="";
	var Server="";
	Game= document.getElementById("hidGameName") != null ? document.getElementById("hidGameName").value : "0";
	Server= document.getElementById("hidServerName") != null ? document.getElementById("hidServerName").value : "0";
	var GEOrderId=document.getElementById("labOrderID")!=null?document.getElementById("labOrderID").innerHTML:"0";
	var rel=cheapaion.ajax.WebAction.getJavaScriptSendInfo(FirstEnterPage,FromURL,VisitPageDetail,CurrentURL,OpSystem,IeType,SysRation,Game,Server,GEOrderId).value;
	if(rel=="-1")
		cheapaion.ajax.WebAction.getJavaScriptSendInfo(FirstEnterPage,FromURL,VisitPageDetail,CurrentURL,OpSystem,IeType,SysRation,Game,Server,GEOrderId);
}
Main("");