function $$(Obj) {
	return document.getElementById(Obj);
}
var d=new Date().getTime();
//标签切换
function setTab(name,cursel,n){
	for(i=1;i<=n;i++){
		var menu=$$(name+i);
		var con=$$("con_"+name+"_"+i);
		menu.className=i==cursel?"hover":"";
		con.style.display=i==cursel?"":"none";
		}
	}
//表格效果
var objchecked=null;
function over(obj)
{
if(obj.checked=="checked") return false;
obj.oldClassName=obj.className;
obj.className = "on";
}
function out(obj)
{
if(obj.checked=="checked") return false;
obj.className = obj.oldClassName;
}
function clicked(obj)
{
if(objchecked!=null)
{
objchecked.className = objchecked.oldClassName;
objchecked.checked="";
}
objchecked=obj;
objchecked.oldClassName=obj.oldClassName;
obj.className = "ced";
obj.checked="checked";
}
//层控制函数
function OpenDiv(UrlInfo, Width) {
	if (!Width) {
		Width = 560;
	}
	if (document.body.scrollHeight < document.body.offsetHeight) {
		$$("oDiv1").style.height = "100%";
	} else {
		$$("oDiv1").style.height = document.body.scrollHeight + "px";
	}
	$$("oDiv1").style.display = "block";
	$$("oDiv2").style.top = document.body.scrollTop + 220 + "px";
	$$("oDiv2").style.display = "block";
	$$("oDiv2").innerHTML = "<iframe name=\"IndexFrame\" id=\"IndexFrame\" src=" + UrlInfo + " frameborder=\"0\" scrolling=\"no\" height=\"450\" width=\"" + Width + "\" onLoad=\"document.all['IndexFrame'].style.height=IndexFrame.document.body.scrollHeight\"></iframe>";
	$$("IndexFrame").src = $$("IndexFrame").src;
}
function CloseDiv() {
	window.parent.document.getElementById("oDiv2").style.display = "none";
	window.parent.document.getElementById("oDiv1").style.display = "none";
}
//得到日期及星期
function dateInfo() {
    var day = "";
    var month = "";
    var ampm = "";
    var ampmhour = "";
    var myweekday = "";
    var year = "";
    mydate = new Date();
    myweekday = mydate.getDay();
    mymonth = mydate.getMonth() + 1;
    myday = mydate.getDate();
    myyear = mydate.getYear();
    year = (myyear > 200) ? myyear: 1900 + myyear;
    if (myweekday == 0) weekday = " 星期日";
    else if (myweekday == 1) weekday = " 星期一";
    else if (myweekday == 2) weekday = " 星期二";
    else if (myweekday == 3) weekday = " 星期三";
    else if (myweekday == 4) weekday = " 星期四";
    else if (myweekday == 5) weekday = " 星期五";
    else if (myweekday == 6) weekday = " 星期六";
    return year + "年" + mymonth + "月" + myday + "日 " + weekday;
}
//登录状态
	//$.get("1.html?d="+d, function(data){
$(function(){
	
	$.get("/slttz/preissue?method=getUserInfo&d="+new Date().getTime(), function(data){
		try{
			var obj=eval('(' + data + ')');
			var nickname="";
			if (obj.nickname){
				nickname=obj.nickname
				}else{
				nickname=obj.userName	
					}
					
			var getHost = function(url) { 
         var host = "null";
         if(typeof url == "undefined" || null == url)
                 url = window.location.href;
         var regex = /(.*\:\/\/[^\/]*).*/;
         var match = url.match(regex);
         if(typeof match != "undefined"
          && null != match)
          host = match[1];
         return host;
}
var genUrl=getHost();
			if (genUrl=="http://caipiao.sports.mop.com"||genUrl=="http://mop.wozhongla.com"||genUrl=="http://wozhongla.sports.sohu.com"){
				var _txt='<a href="/cbportal/userinfo/showUserInfo.htm">'+nickname+'</a>[<a href="/cbportal/userinfo/loginOut.htm">退出</a>] 余额：<a href="/cbportal/usercenter/lotoList!ListAll.htm"><span class="tre sum">'+obj.sum+'</span></a>元 [<a href="/cbportal/charge/chargeinit!initCharge.htm">充值</a>] [<a href="/cbportal/userinfo/showUserInfo.htm">会员中心</a>]';
				}else{
				var _txt='欢迎您 ，<a href="/cbportal/userinfo/showUserInfo.htm">'+nickname+'</a>[<a href="/cbportal/userinfo/loginOut.htm">退 出</a>]！&nbsp;&nbsp;账户余额：<a href="/cbportal/usercenter/lotoList!ListAll.htm"><span class="tre sum">'+obj.sum+'</span></a>元 [<a href="/cbportal/charge/chargeinit!initCharge.htm"><strong>充值</strong></a>] [<a href="/cbportal/userinfo/showUserInfo.htm"><strong>会员中心</strong></a>]';	
					}
			$("#loginState").html(_txt);
			var memlevel=obj.memlevel;
			if (memlevel){
				var memlevelSrt="认证会员";
				}else{
				var memlevelSrt="普通会员";	
				}
			$("#homeDengji").html(memlevelSrt);
			$("#homeDuanxin").html(obj.unread);
			$("#homeJifen").html(obj.score);
			$("#homeTouxiang").attr("src",obj.personIcon);
			$("#homeLogin1").hide();
			$("#homeLogin2").show();
		  } catch (e){
				var locationHref=document.location.href;
			if (locationHref=="http://www.wozhongla.com/"||locationHref=="http://www.wozhongla.com") locationHref="/cbportal/userinfo/showUserInfo.htm";
		 $("#loginState").html('你好，欢迎您！[<a href="/cbportal/userinfo/showLogin.htm?backUrl='+locationHref+'">请登录</a>] [<a href="/cbportal/userinfo/showRegister.htm">免费注册</a>]');
		 $("#homeLogin1").show();
		$("#homeLogin2").hide();
		  }
			
	})
})	
//逗号分隔数字
function commaSplit(srcNumber) {
	var txtNumber = '' + srcNumber;
	var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
	var arrNumber = txtNumber.split('.');
	arrNumber[0] += '.';
	do {
		arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
	} while (rxSplit.test(arrNumber[0]));
	if (arrNumber.length > 1) {
		return arrNumber.join('');
	}
	else {
return arrNumber[0].split('.')[0];
      }
}