//document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>');

//==========================================系统兼容函数
//决断是否是IE浏览器
function IsIE(){ //ie? 
   if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1) 
    return true; 
   else 
    return false; 
} 

//返回新建对象
var ThisObjTemp = null;
function $create(str)
{
    if (document.all) {return document.createElement(str);}
    str = str.Trim().replace(/^<|\/?\s*>$/g,"");
    var a = str.split(/\s+/);
    var o = document.createElement(a[0]);
    if (a.length>1)
    {
        str.replace(/(\w+)=([^\s\'\"]+)|(\w+)=\'([^\']+)\'|(\w+)=\"([^\"]+)\"/g,function(v,v1,v2,v3,v4,v5,v6)
        {
                o.setAttribute(v1||v3||v5,v2||v4||v6);
        });
    }
    return o;
}

var Mouse = new function(){
    this.x = 0;
    this.y = 0;
    this.capture = function(evt){
        if (document.all) {//  IE
            try{
            Mouse.x = window.event.x + document.body.scrollLeft;
            Mouse.y = window.event.y + document.body.scrollTop;
            }catch(e){}
        } else if (document.layers||document.getElementById) {    //  Netscape
            Mouse.x = evt.pageX;
            Mouse.y = evt.pageY;
        }
        //alert(Mouse.x + "/" + Mouse.y); //test
    };
    if (document.layers) { //netscape
        document.captureEvents(Event.MOUSEMOVE);
    }
    //此行代码影响鼠标事件
    //document.onmousemove = this.capture;
}


function GetScroll()
{
    var t, l, w, h;
    if (document.documentElement && document.documentElement.scrollTop) {
    t = document.documentElement.scrollTop;
    l = document.documentElement.scrollLeft;
    w = document.documentElement.scrollWidth;
    h = document.documentElement.scrollHeight;
    } else if (document.body) {
    t = document.body.scrollTop;
    l = document.body.scrollLeft;
    w = document.body.scrollWidth;
    h = document.body.scrollHeight;
    }
    return { t: t, l: l, w: w, h: h };
} 
//为FOXFIRE创建innerText的属性
if(!IsIE()){ //firefox innerText define
   HTMLElement.prototype.__defineGetter__("innerText", 
    function(){
     var anyString = "";
     var childS = this.childNodes;
     for(var i=0; i<childS.length; i++) {
      if(childS[i].nodeType==1)
       anyString += childS[i].tagName=="BR" ? '\n' : childS[i].innerText;
      else if(childS[i].nodeType==3)
       anyString += childS[i].nodeValue;
     }
     return anyString;
    } 
   ); 
   HTMLElement.prototype.__defineSetter__("innerText",function(sText){this.textContent=sText; });
}
/**
 *   兼容firefox的 outerHTML  使用以下代码后，firefox可以使用element.outerHTML
 **/




if(window.HTMLElement) {
    HTMLElement.prototype.click = function()
{
       var evt = this.ownerDocument.createEvent('MouseEvents');
       evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
       this.dispatchEvent(evt);
};
    
    HTMLElement.prototype.__defineSetter__("outerHTML",function(sHTML){
        var r=this.ownerDocument.createRange();
        r.setStartBefore(this);
        var df=r.createContextualFragment(sHTML);
        this.parentNode.replaceChild(df,this);
        return sHTML;
        });

    HTMLElement.prototype.__defineGetter__("outerHTML",function(){
     var attr;
        var attrs=this.attributes;
        var str="<"+this.tagName.toLowerCase();
        for(var i=0;i<attrs.length;i++){
            attr=attrs[i];
            if(attr.specified)
                str+=" "+attr.name+'="'+attr.value+'"';
            }
        if(!this.canHaveChildren)
            return str+">";
        return str+">"+this.innerHTML+"</"+this.tagName.toLowerCase()+">";
        });
        
 HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){
  switch(this.tagName.toLowerCase()){
            case "area":
            case "base":
         case "basefont":
            case "col":
            case "frame":
            case "hr":
            case "img":
            case "br":
            case "input":
            case "isindex":
            case "link":
            case "meta":
            case "param":
            return false;
        }
        return true;

     });
}

//onmouseenter和onmouseleave. 
var xb =
{
    evtHash: [],

    ieGetUniqueID: function(_elem)
    {
        if (_elem === window) { return 'theWindow'; }
        else if (_elem === document) { return 'theDocument'; }
        else { return _elem.uniqueID; }
    },

    addEvent: function(_elem, _evtName, _fn, _useCapture)
    {
        if (typeof _elem.addEventListener != 'undefined')
        {
            if (_evtName == 'mouseenter')
                { _elem.addEventListener('mouseover', xb.mouseEnter(_fn), _useCapture); }
            else if (_evtName == 'mouseleave')
                { _elem.addEventListener('mouseout', xb.mouseEnter(_fn), _useCapture); } 
            else
                { _elem.addEventListener(_evtName, _fn, _useCapture); }
        }
        else if (typeof _elem.attachEvent != 'undefined')
        {
            var key = '{FNKEY::obj_' + xb.ieGetUniqueID(_elem) + '::evt_' + _evtName + '::fn_' + _fn + '}';
            var f = xb.evtHash[key];
            if (typeof f != 'undefined')
                { return; }
            
            f = function()
            {
                _fn.call(_elem);
            };
        
            xb.evtHash[key] = f;
            _elem.attachEvent('on' + _evtName, f);
    
            // attach unload event to the window to clean up possibly IE memory leaks
            window.attachEvent('onunload', function()
            {
                _elem.detachEvent('on' + _evtName, f);
            });
        
            key = null;
            //f = null;   /* DON'T null this out, or we won't be able to detach it */
        }
        else
            { _elem['on' + _evtName] = _fn; }
    },    

    removeEvent: function(_elem, _evtName, _fn, _useCapture)
    {
        if (typeof _elem.removeEventListener != 'undefined')
            { _elem.removeEventListener(_evtName, _fn, _useCapture); }
        else if (typeof _elem.detachEvent != 'undefined')
        {
            var key = '{FNKEY::obj_' + xb.ieGetUniqueID(_elem) + '::evt' + _evtName + '::fn_' + _fn + '}';
            var f = xb.evtHash[key];
            if (typeof f != 'undefined')
            {
                _elem.detachEvent('on' + _evtName, f);
                delete xb.evtHash[key];
            }
        
            key = null;
            //f = null;   /* DON'T null this out, or we won't be able to detach it */
        }
    },
    
    mouseEnter: function(_pFn)
    {
        return function(_evt)
        {
            var relTarget = _evt.relatedTarget;                
            if (this == relTarget || xb.isAChildOf(this, relTarget))
                { return; }

            _pFn.call(this, _evt);
        }
    },
    
    isAChildOf: function(_parent, _child)
    {
        if (_parent == _child) { return false };
        
        while (_child && _child != _parent)
            { _child = _child.parentNode; }
        
        return _child == _parent;
    }    
};

//为Number对象
Number.prototype.toFixed=function(len)
{
    var add = 0;
    var s,temp;
    var s1 = this + "";
    var start = s1.indexOf(".");
    if(s1.substr(start+len+1,1)>=5)add=1;
    var temp = Math.pow(10,len);
    s = Math.floor(this * temp) + add;
    return s/temp;
}
//为string对象增加TRIM的功能
String.prototype.Trim = function(){return this.replace(/(^[ |　]*)|([ |　]*$)/g, "");}
String.prototype.Length = function()
{
    var i,sum;
    sum=0;
    var str = this;
    for(i=0;i<str.length;i++)
    {
        if ((str.charCodeAt(i)>=0) && (str.charCodeAt(i)<=255))
            sum=sum+1;
        else
            sum=sum+2;
    }
    return sum;
}

//获取控件绝对左坐标 象素单位
function   GetAbsLeft(e){var   l=e.offsetLeft;   while(e=e.offsetParent)   l   +=   e.offsetLeft;   return   l;}   
//获取控件绝对顶坐标 象素单位
function   GetAbsTop(e) {var   t=e.offsetTop;     while(e=e.offsetParent)   t   +=   e.offsetTop;     return   t;}


function WindowObject(name) 
{
    if (window.navigator.userAgent.toLowerCase().indexOf("msie")<1) 
    {
        return window[name];
    }
    else 
    {
        return document[name];
    }
}

//==========================================end系统兼容函数


/////////////////////////通用函数集
//var PreAlertObj = null
//function ChkErrorTag(e,s)
//{
//    return 
//	if (bAlert || PreAlertObj == e){ e.focus();e.select();}
//	bAlert = false;
//	PreAlertObj = e;
//	return;
//	eParent = e.parentNode;		
//	var e1 = eParent.childNodes[0];
//	var s1 = "请检查您的"+s+"："+e.value;
//	e.value = "";e.focus();
//	if (e1.tagName != "DIV")
//	{
//		e1 = document.createElement("div");	
//		e1.style.color = "#6D6D6D";
//		eParent.insertBefore(e1,eParent.childNodes[0]);
//	}
//	e1.innerHTML = s1;
//}
function ChkTelephone(s)
{
	var partern = /^\d{5,9}(-\d{1,4})?(,\d{5,9}(-\d{1,4})?){0,3}$/;
	s = s.Trim();
	if (s.value == "" || !partern.test(s) ){return false;}
	return true;
	
}
function ChkMobile(s)
{
    
	var partern = /^(13\d{9}|15[3689]\d{8})?(,13\d{9}|15[3689]\d{8}){0,2}$/;
	s = s.Trim();
	if (s.value == "" || !partern.test(s) ){return false;}
	return true;
}

function ChkEmail(s)
{
    var partern=/^(\s*([A-Za-z0-9_-]+(\.\w+)*@([\w-]+\.)+\w{2,3})\s*)?(,\s*([A-Za-z0-9_-]+(\.\w+)*@([\w-]+\.)+\w{2,3})\s*){0,2}$/;
	s = s.Trim();
	if (s.value == "" || !partern.test(s) ){return false;}
	return true;
}

function ChkInts(v)
{
    var partern=/^(\d+)?(,\d+)*$/;
	if (v == ""){return false;}
	if (!partern.test(v)){ return false;}
	return true;
}

function ChkInt(obj)
{
	var v = obj.value.replace(/１/g,"1").replace(/２/g,"2").replace(/３/g,"3").replace(/４/g,"4").replace(/５/g,"5").replace(/６/g,"6").replace(/７/g,"7").replace(/８/g,"8").replace(/９/g,"9").replace(/０/g,"0");
	var S = /^\d+$/;
	if(!S.test(v)){
		if(arguments[1]){obj.value = arguments[1];}
		else {obj.value = "";}
		return false;
	}
	obj.value = v;
	return true;
}

//onkeypress(onkeydown)="return ChkDigit(this)"
//style="ime-mode:disabled"
function ChkDigit(e)
{
    var key = event.keyCode;
	return ((key>=48 && key<=58) || key == 13);
}

function ChkDigits(e)
{
    var key = event.keyCode;
	return ((key>=48 && key<=58) || key == 13 || key == 44);
}

function chkNumeric()
{
    var key = event.keyCode;
	return ( (key>=48 && key<=58) || key == 46 || key == 13);
}

function isNumeric(obj,isEmpty)
{
    var S = /^(-?\d+)(\.\d+)?$/;
	var V =  (obj.attributes["prevalue"]?obj.attributes["prevalue"].value:"");
	var v = obj.value;
	if (isEmpty && v == ""){  return;}
	if(!S.test(v))
	{
		if (arguments[2]) {alert("请输入正确的数据类型！");}
		obj.value = V;
		obj.select();
		return false;
	}
	return true;
}

function StrNormal(obj)
{
    var v = obj.value.Trim();
	var S = /^(,|.| |'|")*$/;
	//alert(S.test(v));
	return true;
	if (S.test(v))
	{
	    alert("请不要使用特殊字符！");
		return false;
	}
	return true;

}

function ChkDate(obj){
	var ret = true,arrDate;
	var V =  (obj.attributes["prevalue"]?obj.attributes["prevalue"].value:"");
    if(obj.value == "" && V == "")
	{//如果为空，则通过校验 
		ret = true; 
	}
	else
	{
		var pattern = /^((\\d{4})|(\\d{2}))-(\\d{1,2})-(\\d{1,2})$/g; 
		var str = obj.value.Trim().split(' ');
		if(!pattern.test(str[0])){ret = false; }
		arrDate = str[0].split("-"); 
		if(parseInt(arrDate[0],10)<100){arrDate[0] = 2000 + parseInt(arrDate[0],10) + ""; }
		var date =  new Date(arrDate[0],(parseInt(arrDate[1],10)-1)+"",arrDate[2]); 
		if(date.getFullYear()==arrDate[0] && date.getMonth()==(parseInt(arrDate[1],10) -1)+"" && date.getDate()==parseInt(arrDate[2],10)){
			ret = true; 
		}
		else {ret = false; }
		
		if(str[1] && str[1]!=''){
			pattern2 = /^(([1-2][0-4])|([0-1]?[0-9])):([0-5]?[0-9]):([0-5]?[0-9])$/g;
			ret = pattern2.test(str[1]);
		}
	}
	//alert(obj.value);
	//alert(ret);
	if (!ret){  obj.value = V;}
	return ret;
}

function SetDateNext(obj,name,day,k)
{
    if (obj.value == ""){return;}
    if (!ChkDate(obj)){ return true;}
    arrDate = obj.value.split("-"); 
    var ik = typeof(k)=="undefined"?1:k;
    var d ;
    switch(ik)
    {
    case "y":
    //d = new Date(parseInt(arrDate[0],10)+day,(parseInt(arrDate[1],10)-1)+"",parseInt(arrDate[2],10));
    document.getElementById(name).value = (parseInt(arrDate[0],10)+day) + "-" +arrDate[1] +"-"+arrDate[2];
    return;
    break;
    case "m":
    d = new Date(arrDate[0],(parseInt(arrDate[1],10)-1)+day,arrDate[2]);
    break;
    default:
    d = new Date(arrDate[0],arrDate[1],arrDate[2]);
    d = d.valueOf();
    d = d + (day* 24 * 60 * 60 * 1000);
    d = new Date(d);
    break;
    }
    document.getElementById(name).value = d.getFullYear() + "-" + (d.getMonth()) + "-" + d.getDay();
}



function ReplaceChr(obj,v1,v2)
{
    obj.value = obj.value.replace(v1,v2);
}


var Cookies = {};
/**//**
 * 设置Cookies
 */
Cookies.Set = function(name, value){
     var argv = arguments;
     var argc = arguments.length;
     var expires = (argc > 2) ? argv[2] : null;
     var path = (argc > 3) ? argv[3] : '/';
     var domain = (argc > 4) ? argv[4] : null;
     var secure = (argc > 5) ? argv[5] : false;
     document.cookie = name + "=" + escape (value) +
       ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
       ((path == null) ? "" : ("; path=" + path)) +
       ((domain == null) ? "" : ("; domain=" + domain)) +
       ((secure == true) ? "; secure" : "");
};
/**//**
 * 读取Cookies
 */
Cookies.Get = function(name){
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    var j = 0;
    while(i < clen){
        j = i + alen;
        if (document.cookie.substring(i, j) == arg)
            return Cookies.GetCookieVal(j);
        i = document.cookie.indexOf(" ", i) + 1;
        if(i == 0)
            break;
    }
    return null;
};
/**//**
 * 清除Cookies
 */
Cookies.Clear = function(name) {
  if(Cookies.Get(name)){
    var expdate = new Date(); 
    expdate.setTime(expdate.getTime() - (86400 * 1000 * 1)); 
    Cookies.Set(name, "", expdate); 
  }
};

Cookies.GetCookieVal = function(offset){
   var endstr = document.cookie.indexOf(";", offset);
   if(endstr == -1){
       endstr = document.cookie.length;
   }
   return unescape(document.cookie.substring(offset, endstr));
};


//UHeaderError(e,sex)
//用户头像显示出错时显示默认头像
//调用方式<img  onerror="UHeaderError(this,1);" />
var iHeaderHas = 0;
function UHeaderError(e,sex)
{
    if (e.error){return;}
    e.error = "1";
    var s = sex;
//    if (typeof(sex) == "undefined" || sex == "" || sex == "1") { s = 'man';}
//    else { s = 'woman';}
//    var inx = iHeaderHas;
//    while (iHeaderHas == inx)
//    {
//        inx = parseInt(12*Math.random());
//    }    
//    if (inx <= 0 ){ inx = 1;}
//    if (inx > 12) { inx = 12;}
//    iHeaderHas = inx;
//    e.src='http://member.winfang.com/imgs/' +s + '/'+ inx + '.gif';
    
    if (s != "0" && s != "1") { s = "1";}
    s = "headerimg"+s;    
    e.src='http://images1.winfang.com/imgs/' +s + '.gif';
    
}

//图片显示错误时显示默认阳随机图片 调用方式：onerror="PicError(this,'quanzi')"
//PicError(e,folder)
//e 图片对象
//folder 默认图片的目录 1-10.jpg
var PicRndNum = 0;
function PicError(e,folder)
{
    if (e.error){return;}
    e.error = "1";
    var fol = folder;
    if (typeof(fol) == "undefined" || fol == "") { fol = 'def';}
    PicRndNum ++;
    if (PicRndNum > 10){ PicRndNum  = 1;}
    var inx = PicRndNum;
//    while (PicRndNum == inx)
//    {
//        inx = parseInt(10*Math.random());
//    }    
//    if (inx <= 0 ){ inx = 1;}
//    if (inx > 10) { inx = 10;}
//    PicRndNum = inx;

    
    
    e.src='http://images1.winfang.com/imgs/' +fol + '/'+ inx + '.gif';
    
}



//相片
function PhotoError(e)
{
    if (e.error){return;}
    e.error = "1"; 
    e.src='http://images1.winfang.com/imgs/headerimg1.gif';
    
}

//图片最大不超过
//e 图片对象
//w1 最大宽度
//h1 最大高度,不传值时，仅限制宽度
function PhotoMax(e,w1,h1)
{
    var w = 100;
    var h = 100;
    var b = false;
    var isW= false;
    var isH= false;
    if (typeof(w1) != "undefined") { w = w1;}
    if (typeof(h1) != "undefined") { h = h1; b = true;}
    
    var img = document.createElement("IMG");
    img.src = e.src;
    var currentW = img.width;
    if (currentW < e.width) { currentW = e.width ;}
    
    var currentH = img.height;
    if (currentH < e.height) { currentH = e.height ;}
    
    if (currentW > w ){ e.style.width = w+"px"; isW = true;}
    
    if (b && currentH > h ){ e.style.height = h+"px"; isH = true;}
    
    if ((isW && isH) || (!isW && !isH))
    {}
    else
    {
        if (isW && e.height != "" )//清空HEIGHT属性
        {
            e.removeAttribute("height") ;
        }
        if (isH && e.width != "" )//清空WIDTH属性
        {
            e.removeAttribute("width") ;
        }
    }
    //if (isW || isH){ e.title+= '(点击查看大图)'; e.onmousedown = function(){ window.open(e.src);};}
    img = null;

}

//UrlCopy(url)
//复制当前地址
//调用方式<a onclick="return UrlCopy()"></a>或<a onclick="return UrlCopy('http://www.xxx.com/#1')"></a>
function UrlCopy(url)
{
    var u = url;
    if (typeof(url) == "undefined" ){ u = window.location.toString();}
    window.clipboardData.setData("Text",u);
    alert("地址复制成功。");
    return false;
}

//加好友
function addFriend(friend_uid,nid) 
{ 
     if ( !MemChkLogin()) {return false;}
     window.showModelessDialog("http://home.winfang.com/addFriend.aspx?uid=" + escape(friend_uid)+"&nid="+escape(nid), "","dialogWidth=550px;dialogHeight=280px;scroll=no;");
     return false;
}

var Uid = "";
var Nid = "";

//检查会员登录
function MemChkLogin()
{
    if (typeof(Uid) == "undefined"){  alert('未能获取到登录帐号.');return false;}
    if (Uid == '')
    {
        var userCookie = Cookies.Get("winfanguser");
        if (userCookie == null || userCookie.indexOf("uid")<0)
        {
            
            //var obj1 = document.getElementById("aMemLogin");
            if (typeof(LoginShow) != "undefined"){LoginShow();}
            else
            {
                alert('请您先登录.');window.location="http://member.winfang.com/login.aspx?tourl="+escape(window.location.href);
            }
            return false;
        }
        var uid = userCookie.split('uid=')[1];
        Uid = unescape(uid.split('&')[0]);
        
        var nid = userCookie.split('nid=')[1];
        Nid = unescape(nid.split('&')[0]);        
    }
    return true;
}


//站内通用信息
//uid 接收信息的UID
//nid 接收信息的妮称
//ty  发送信息时的频道代码
function MemSendMessage(uid,nid,ty)
{
    if (!MemChkLogin()){return false;}
    window.showModelessDialog("http://in.winfang.com/gol/MemMessageSend.aspx?uid="+escape(uid)+"&nid="+escape(nid)+"&ty="+ty, "","dialogWidth=550px;dialogHeight=280px;scroll=no;");
    return false;
}

//打招呼
function MemSendZaoHu(uid,nid)
{
    if (!MemChkLogin()){return false;}
     window.showModelessDialog("http://in.winfang.com/gol/HiFriend.aspx?uid="+escape(uid)+"&nid="+escape(nid), "","dialogWidth=580px;dialogHeight=350px;scroll=no;");
    return false;
}


//隐藏DIV面板
function DivHidden(name)
{
    var obj = document.getElementById(name);
    if (obj){obj.style.display = "none";}
    return false;
}

//返回在线编辑器内的文本
function GetFckContent(name)
{ 
    var s = "FCKeditor1___Frame";
    if (typeof(name) != "undefined") { s = name;}
    var frame0 = window.frames[s];
    if (frame0 && frame0.frames[0])
    {
     return frame0.frames[0].document.body.innerText;
    }
    return "";
}

//带查询关键词的频道跳转
function NaviGoTo()
{
    var keyObj = (document.getElementById("key")||document.getElementById("word")||document.getElementById("kw"));
    if (!keyObj){return;}
    var keys = keyObj.value;
    if (keys != "" && keys != "请输入要搜索的关键词" && keys!="请输入标题或内容关键词")
    {
        var obj = new Array(document.getElementById("aNaviDown"),document.getElementById("aNaviAsk"),document.getElementById("aNaviBaike"));
        if (obj[0])  obj[0].href="http://down.winfang.com/search.aspx?key="+keys;
        if (obj[1])  obj[1].href="http://ask.winfang.com/search.aspx?key="+keys;
        if (obj[2])  obj[2].href="http://baike.winfang.com/search.aspx?word="+keys;
    }
}

//当前的随机数
var RandomNumber = "";
document.write('<script'+' id="jsGetRndNumber" type="text/javascript" ></'+'script><iframe id="ifGetRndNumber" style="display:none;"></iframe>');
function FreRandomNumber()
{
    document.getElementById('ifGetRndNumber').src = "http://in.winfang.com/gol/GetRandomNum.ashx";
    var obj = document.getElementById('jsGetRndNumber');
    obj.src = "http://in.winfang.com/gol/GetRandomNum.ashx";
}


function SetBackUrl(obj,istourl)
{
	if (obj.innerText == "退出"){  istourl = true;}
	var url = window.location.toString();
	if (typeof(istourl) == 'undefined')
	{
		istourl = true;		
		var len = url.length;
		if (url.substring(len-1,len) == '/' || url.indexOf('index.')>0 || url.indexOf('default.')>0 || url == 'http://business.winfang.com/tdjr.html' || url == 'http://business.winfang.com/kfs.html'
		 || url == 'http://business.winfang.com/fws.html' || url == 'http://business.winfang.com/pts.html'
		 || url == 'http://business.winfang.com/chdl.html' || url == 'http://business.winfang.com/ghjz.html'
		 || url == 'http://business.winfang.com/ggtg.html' || url == 'http://business.winfang.com/jccg.html'
		 || url == 'http://business.winfang.com/gcqy.html' || url == 'http://business.winfang.com/glzx.html'
		 || url == 'http://business.winfang.com/sydc.html' || url == 'http://business.winfang.com/tc.html')
		{   istourl = false;}
	
	}
	if (!istourl){  return;}
	
    var href = obj.href;
    if ( href.indexOf('?') > 0 )
    {
        href += "&tourl="+escape(url);
    }
    else
    {
        href += "?tourl="+escape(url);
    }
    obj.href = href;
}

function UserIsLogin()
{
	var UserCookie = Cookies.Get("winfanguser");
    if (UserCookie == null || UserCookie.indexOf("uid")<0)
    {
        return false;
    }
    return true;
}
