	function GetCookieVal(offset)
		{
			var endstr = document.cookie.indexOf(";", offset);
			if (endstr == -1)
				endstr = document.cookie.length;
			return unescape(document.cookie.substring(offset, endstr));
		}
	function GetCookie(name)
		{
			var arg = name + "=";
			var alen = arg.length;
			var clen = document.cookie.length;
			var i = 0;
			while (i < clen) {
				var j = i + alen;
				if (document.cookie.substring(i, j) == arg)
					return GetCookieVal(j);
				i = document.cookie.indexOf(" ", i) + 1;
				if (i == 0)
					break;
			}
			return null;
		}
	var dBody = null;function getBody(){
		if(!dBody)dBody=(document.compatMode&&document.compatMode.indexOf('CSS')>-1)?document.documentElement:document.body;return dBody;
		}
	function getScrollX(){
		return window.pageXOffset||window.scrollX||getBody().scrollLeft||0;
		}
	function getScrollY(){
		return window.pageYOffset||window.scrollY||getBody().scrollTop||0;
		}
	function OpenList(){
		var x=document.documentElement.clientWidth/2+getScrollX()-850/2;
		var y=document.documentElement.clientHeight/2+getScrollY()-426/2;
		var sWidth=document.body.scrollWidth;
		var sHeight=document.body.scrollHeight;
		var _bg=document.getElementById('light').style;
		var _list=document.getElementById('ListWindow').style;
		document.getElementById("iframeList").src="http://xj.webgame.com.cn/list/xj.html";
		_bg.display='block'; 
		_bg.width=sWidth+"px";
		_bg.height=sHeight+"px";
		_list.display='block';	
		_list.top=y+"px";
		_list.left=x+"px";
		}
	function CloseList(){
		document.getElementById('light').style.display='none'; 	
		document.getElementById('ListWindow').style.display='none'; 
		}
	function OpenReg(){
		var from=GetCookie("from");
		window.open("http://passport.webgame.com.cn/register.do?type=xj&from="+from+"&forward=http://xj.webgame.com.cn/list/xj.html");
		}
	function OpenLj(){
		var x=document.documentElement.clientWidth/2+getScrollX()-647/2;
		var y=document.documentElement.clientHeight/2+getScrollY()-378/2;
		var sWidth=document.body.scrollWidth;
		var sHeight=document.body.scrollHeight;
		var _bg=document.getElementById('light').style;
		var _list=document.getElementById('RegWindow').style;
		var from=GetCookie("from");
		//document.getElementById("iframeReg").src="/udc/traverse/jump.html?from="+from;
		document.getElementById("iframeReg").src="http://passport.webgame.com.cn/login/act/xj/xj_travers.jsp?forward=http://xjhd.webgame.com.cn/udc/traverse/jump.html&from="+from;
		_bg.display='block'; 
		_bg.width=sWidth+"px";
		_bg.height=sHeight+"px";
		_list.display='block';	
		_list.top=y+"px";
		_list.left=x+"px";
	}
	function CloseReg(){
		document.getElementById('light').style.display='none'; 	
		document.getElementById('RegWindow').style.display='none'; 
		}
		
//Copy
function copy(theField,isalert)
{
  var obj=document.getElementById(theField);
  if(obj!=null)
  {
    var clipBoardContent=obj.value;
    obj.select();
    window.clipboardData.setData("Text",clipBoardContent); 
    if(isalert!=false)
      alert("复制成功!");
  }
  else
  {
     alert("Error!");
  }
}

//Question
function Next()
{
  var temp=document.getElementsByName("question");
  for (i=0;i<temp.length;i++){
    if(temp[i].checked){
		window.location.href="q_"+temp[i].value+".html";
      }
  }
}