// JScript 文件

function getCookie(c_name)
{
    if (document.cookie.length>0)
    { 
        c_start=document.cookie.indexOf(c_name + "=")
        if (c_start!=-1)
        { 
            c_start=c_start + c_name.length+1 
            c_end=document.cookie.indexOf(";",c_start)
            if (c_end==-1) 
            {
                c_end=document.cookie.length;
            }
            return unescape(document.cookie.substring(c_start,c_end))
        } 
    }
    return ""
}

function setCookie(c_name,value,expiredays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays)
    document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString())
}

function window.onload()
{   
    if(arr=document.cookie.match(/scrollTop=([^;]+)(;|$)/))   
        document.documentElement.scrollTop=parseInt(arr[1]);   
}   
function window.onbeforeunload()
{   
    document.cookie="scrollTop="+document.documentElement.scrollTop;   
}

function setdateinf()
{
    today=new Date();
    var day; var date; var hello; var wel;
    hour=new Date().getHours()
    if(hour < 6)hello='凌晨好！'
        else if(hour < 9)hello='早上好！'
        else if(hour < 12)hello='上午好！'
        else if(hour < 14)hello='中午好！'
        else if(hour < 17)hello='下午好！'
        else if(hour < 19)hello='傍晚好！'
        else if(hour < 22)hello='晚上好！'
        else {hello='夜里好！'}
    if(today.getDay()==0)day='星期日'
        else if(today.getDay()==1)day='星期一'
        else if(today.getDay()==2)day='星期二'
        else if(today.getDay()==3)day='星期三'
        else if(today.getDay()==4)day='星期四'
        else if(today.getDay()==5)day='星期五'
        else if(today.getDay()==6)day='星期六'
        var username;
        username='';
        if (arguments.length>0 ) 
        {
			if (arguments[0]!=null&&arguments[0]!="")
			{
				username='<FONT color=red>'+hello+'<STRONG>'+arguments[0]+'</STRONG></FONT>';
			}
        }
        
    date='&nbsp;'+username+' 今天是：'+(today.getFullYear())+'年'+(today.getMonth() + 1 )+'月'+today.getDate()+'日&nbsp;'+day;
    return date;
}

//document.location.host //获取网页域名地址
//document.location.href //获取网页完整路径
//document.title //获取网页的标题
//设为首页
function SetDefaul(obj,weburl)
{
    obj.style.behavior='url(#default#homepage)';
    obj.setHomePage(weburl);
}
//设为首页
function SetDefaul1(obj)
{
    SetDefaul(obj,document.location.href);
}
//设为首页
function SetDefaul2(obj)
{
    SetDefaul(document.location.host);
}
//加入收藏
function AddFavorite(weburl,webtit)
{
    window.external.AddFavorite(weburl,webtit);
}
//加入收藏
function AddFavorite1()
{
    AddFavorite(document.location.href,document.title);
}
//加入收藏
function AddFavorite2(webtit)
{
    AddFavorite(document.location.host,webtit);
}

function linkAdress(s)        
{         
    window.open(s);        
}         

