﻿function getCookie(name){var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));if(arr != null) return decodeURI(arr[2]); return null;}
function SetCookie(cookiename,cookievalue,cookieexpdate,domainname)
{
    document.cookie = cookiename + "=" + escape(cookievalue)
    + "; domain=" + domainname
    + "; path=" + "/"
    + "; expires=" + cookieexpdate.toGMTString();
}
function showLogin()
{
    if (getCookie('user')!=null)
        document.write('欢迎您：'+getCookie('user')+' <a href="/User/">管理中心</a> <a href="/logout.aspx">注销</a>');
    else
        document.write('<a href="/login.aspx">登录</a> <a href="/reg.aspx">注册</a>');
}

function showimg(o)
{
    o.src = '/images/none.gif';
}

function ChangeVali()
{
    $('#code')[0].src='/ValidateImg.aspx?'+Math.random();
}

