/**
 * @author Administrator
 */
function AutoHide(lblId){
		setTimeout(function(){
		$("#"+lblId).height(230); 
		},2000);
}
//显示隐藏项目
function Tab(id, subtabbox, headlist, headborder) {
    var ulValue = document.getElementById(subtabbox).childNodes;
    var livalue = document.getElementById(headlist).childNodes;
    for (j = 0; j < livalue.length; j++) {
        if (livalue[j].id == headborder)
            livalue[j].className = "topicborder";
        else
            livalue[j].className = "topicbg";
    }
    for (i = 0; i < ulValue.length; i++) {
        if (ulValue[i].id == id)
            ulValue[i].className = "show";
        else
            ulValue[i].className = "hide";
    }
}

//隐藏边栏
function hide(id) {
    document.getElementById(id).className = "hide";
}
function closet() {
    document.getElementById('header').style.margin = 0;
    document.getElementById('Gbody').className = "noguoqin";
    document.getElementById('guot').style.display = "none";
}
function optionMenu(nid,id){
    var ulValue = document.getElementById("navList").childNodes;
    var navValue = document.getElementById("znav").childNodes;
	for(i=0; i<ulValue.length; i++){
	    if (ulValue[i].id == id) 
	        ulValue[i].className = "show";
	    else 
	        ulValue[i].className = "hide";
	}
	for(j=0;j<navValue.length;j++)
	{
	    if(navValue[j].id == nid)
	        navValue[j].className = "hoverbg";
	    else
	        navValue[j].className = "bg";
	}
}
//通过ajax添加数据的方法
function addyue(caId) {
    
    var Name = document.getElementById('txtName').value;
    var Phone = document.getElementById('txtPhone').value;
    var Email = document.getElementById('txtEmail').value;
    var Address = document.getElementById('txtAddress').value;
    var Age = document.getElementById('txtAge').value;
    var Miaosu = document.getElementById('txtMiaosu').value;
    var Date = document.getElementById('txtDate').value;

    if (Name != "" || Phone != "" || Miaosu != "") {
        var url = "http://www.bjmwh.com/Resource/ajax/ajax.ashx";
        $.get(url, { "name": Name, "phone": Phone, "email": Email, "address": Address, "age": Age, "miaosu": Miaosu, "date": Date, "caId": caId, "type": "addyue" }, function(data) {
            if (data == 1) {
                alert('成功填写电子预约病历，请等待我院导医与您取得联系！');
            }
            else {
                alert('对不起！您的电子预约病历未能成功提交，请检查必填项是否填写完整！');
            }
        });
    }
    else
        alert("请将您的称呼，联系电话，年龄，描述和预约时间填写完整！谢谢");
}
//通过ajax获取的文章列表数据
function GetDynamic(type,aid,lblId) {
    var url = "http://www.bjmwh.com/Resource/ajax/ajax.ashx";
    $.get(url, { "type": type,"id":aid }, function(data) {
        var jsonInfos = eval('(' + data + ')');
        $.each(jsonInfos.artList, function(i, item) {
            $("#" + lblId).html($("#" + lblId).html() + item);
        });
    });
}
function hide(id) {
	document.getElementById(id).className = "hide";
} 
function tanchuAd()
{
	document.open("http://www.bjmwh.com/zhuanti/wyhd");
}
//动态修改静态页面内容的方法
function GetHtml(id,uri,imguri,type){
	if(type=='image')
	document.getElementById(id).innerHTML = '<a href="http://'+uri+'" target="_blank"><img src="http://'+imguri+'"/></a>';
	if(type=='flash')
	document.getElementById(id).innerHTML = '<li><a href="http://'+uri+'" target="_blank"><object width="560" height="70" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="http://'+imguri+'" name="movie"><param value="transparent" name="wmode"><param value="opaque" name="wmode"></object></a></li>';
}


