﻿// JScript 文件

function chgMenu()
{
    var menu=document.getElementById("menu1");
    var num=getCookie("Menu");
    
    
    var liArr=menu.getElementsByTagName("li");
    for(var i=0;i<liArr.length;i++)
    {
        if(i==num)
        {
            liArr[i].className="menuFocus";
        }
        else
        {
            liArr[i].className="menuChannel";
        }
    }   
    
}

function getCookie(cookie_name){
    var allcookies = document.cookie;
    var cookie_pos = allcookies.indexOf(cookie_name);
    // 如果找到了索引，就代表cookie存在，
    // 反之，就说明不存在。
    if(cookie_pos != -1){
        // 把cookie_pos放在值的开始，只要给值加1即可。
        cookie_pos += cookie_name.length + 1;
        var cookie_end = allcookies.indexOf(";", cookie_pos);
        if(cookie_end == -1){
            cookie_end = allcookies.length;
        }
        var value = unescape(allcookies.substring(cookie_pos, cookie_end));
        return value;
    }
   return -1;
}

function GetRTime()
{
var myDate = new Date();
var nowhours=myDate.getHours();
var nowmend=myDate.getMinutes();
var nowsecond=myDate.getSeconds();
var EndTime=1000 * 60 * 60 * 24;
var nowtime=1000 * 60 * 60 * nowhours +nowmend*60*1000+nowsecond*1000;
var nMS =86400000 - nowtime;
var nH=Math.floor(nMS/(1000*60*60)) % 24;
var nM=Math.floor(nMS/(1000*60)) % 60;
var nS=Math.floor(nMS/1000) % 60;
if(nMS>= 0)
{
 document.getElementById("RemainH").innerText=nH;
 document.getElementById("RemainM").innerText=nM;
 document.getElementById("RemainS").innerText=nS;
}
setTimeout("GetRTime()",1000);
}


//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 bMenu(index,flag){
			for(var i=0;i<3;i++){/* 最多支持9个标签 */
				if(GetObj("bcon"+i)&&GetObj("bj"+i)){
					GetObj("bcon"+i).style.display = 'none';
					GetObj("bj"+i).className = "tunavtab2";
				}
			}
			if(GetObj("bcon"+index)&&GetObj("bj"+index)){
				GetObj("bcon"+index).style.display = 'block';
				GetObj("bj"+index).className = "tunavtab1";
			}
		}
		
		
Sys.Application.add_load(function()
{
    var form = Sys.WebForms.PageRequestManager.getInstance()._form;
    form._initialAction = form.action = window.location.href;
});



        function setcookie(name,name1)
        {
        var date=new Date();
        var expiresDays=365;
        date.setTime(date.getTime()+expiresDays*24*3600*1000);
        document.cookie="City=" +name+";expires="+date.toGMTString();
        document.cookie="CityPinyin="+name1+";expires="+date.toGMTString();
        }    
        
        
        
        function showSubmit(obj)
        {
            if(obj.value==1)
            {
                document.getElementById("imgshow").style.display="";
            }
            else
            {
                document.getElementById("imgshow").style.display="none";
            }
        }