﻿
var loading = document.createElement("div");
function ShowLoading(show_idv,id){
    loading.setAttribute("id","div_loading");    
    loading.style.width = "250px";
    loading.style.height = "35px";
    loading.style.marginLeft = "10px";
    loading.style.marginTop = "10px";
    loading.innerHTML = "正在获取数据. <img src='../../image/icon/loading/"+id+".gif' />";    
    $(show_idv).appendChild(loading);
}
function CloseLoading(show_idv){
    $(show_idv).removeChild(loading);
}
function search()
{
    var key = $F("searchkey");
    var blog_type = $F("searchblog_type");
    location.href = "../../channel/blog/search.aspx?key=" + key + "&blog_type=" + blog_type;
}  
//预约就医版块的搜索
function search_app()
{
    var key = $F("searchkey");
    var type = $F("searchtype");
    location.href = "../../channel/appointment/search.aspx?key=" + key + "&type=" + type;
} 
function search_exam(ddl_city,ddl_sex,ddl_price)
{
    location.href ="../../channel/appointment/search_exam.aspx?set_cityid="+$F(ddl_city)+"&am_setmealprice="+$F(ddl_sex)+"&am_setmealsex="+$F(ddl_price);
}
function SetCookie(name,value)//两个参数，一个是cookie的名子，一个是值
{
    var Days = 30; //此 cookie 将被保存 30 天
    var exp  = new Date();    //new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
function getCookie(name)//取cookies函数        
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) return unescape(arr[2]); return null;

}
function delCookie(name)//删除cookie
{
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval=getCookie(name);
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}

function changecss(color)//更换CSS样式
{    
    document.getElementById("ctl00_membercss").href="../../CSS/color" + color + ".css";
    SetCookie("stylesheet",color);
}
function initStyle()
{
    if(getCookie("stylesheet") !=null)
        document.getElementById("ctl00_membercss").href="../../CSS/color" + getCookie("stylesheet") + ".css";
}
function goqq(qq)
{
    var url ="http://wpa.qq.com/msgrd?V=1&Uin="+qq+"&Site=www.qq.com&Menu=yes ";
    window.open(url);
}
function showmenu(id,type){
    if(id == undefined)id=0;
    var menu = type=="home"?$("home"): $("li_"+type+"_"+id);
    var menu_a =  type=="home"?$("home_a"): $("a_"+type+"_"+id);
    if(eval(menu) == undefined){
        menu=$("home");
        menu_a=$("home_a");
        }
    menu.style.backgroundImage= type=="p"?'url("content/image/menu_li_bg3.gif")':'url("content/image/menu_li_bg3.gif")';
    
    menu.style.height='40px';
    menu.style.fontWeight='bold'; 
    menu_a.style.color="#D63A3A"; 
}
