﻿// JScript 文件
function searchClick(tbx)
{
    if(tbx.value=="请输入疾病名称"||tbx.value=="病情详述"||tbx.value=="请输入您想要查询的内容"||tbx.value=="说明详细病情，有助安排医生、便捷就医"||tbx.value=="请在此补充病情详细说明（网上挂号免普通门诊挂号费，优先就诊无需排队）")
    {
        tbx.value="";
    }
}
function IsChoose()
{
    var tbx = document.getElementById("txtName");
    var tel = document.getElementById("txtTel");
    var time = document.getElementById("txtTime");
    var agree = document.getElementById("cbxAgree");
    if(tbx.value.replace(/(^\s*)|(\s*$)/g, "")=="")
    {
        alert('请输入姓名！');
        tbx.focus();
        return false;
    }
    if(tel.value.replace(/(^\s*)|(\s*$)/g, "")=="")
    {
        alert('请输入电话！');
        tel.focus();
        return false;
    }
    if(tel.value.length<7)
    {
        alert('电话号码不正确！');
        tel.focus();
        return false;
    }
    if(time.value.replace(/(^\s*)|(\s*$)/g, "")=="")
    {
        alert('请输入预约时间！');
        time.focus();
        return false;
    }
    if(!agree.checked)
    {
        alert('您未同意隐私协议！');
        return false;
    }
    return true;
}
function gb2312(key)
{
	var r = "";
	for(var i=0;i<key.length;i++){
		var t = key.charCodeAt(i);
		if(t>=0x4e00 || t==0x300A || t==0x300B){
			try{
			execScript("ascCode=hex(asc(\""+key.charAt(i)+"\"))", "vbscript"); r += ascCode.replace(/(.{2})/g, "%$1"); }
			catch(e)
			{}
		}
		else{r += escape(key.charAt(i))}
	}
	return r;
}
function checkFrmP(frm)
{
		var s=gb2312(frm.g_from.value);
		var t=gb2312(frm.g_to.value);
		var tt=frm.g_cmdpathtype.value
		var url="http://www.ddmap.com/mstmap50007/g_d_path.jsp?g_bstype=11&g_from="+s+"&g_to="+t+"&g_cmdpathtype="+tt+"&g_mapid=23";
		window.open(url)
		return false;
}
function searchweb()
{
var searchword = document.getElementById("tbxSearch").value;
if(searchword == "请输入搜索内容" || searchword.length == 0)
	return false;

var typevalue = document.getElementById("db1ssinput").value;
var searchwebform = document.getElementById("searchwebform");
if(typevalue.indexOf("文章") > 0)
    searchwebform.action = "http://www.cqxh120.com/SearchNews.aspx";
else if(typevalue.indexOf("医生") > 0)
    searchwebform.action = "http://www.cqxh120.com/SearchDoctors.aspx";
else if(typevalue.indexOf("设备") > 0)
    searchwebform.action = "http://www.cqxh120.com/SearchTechnology.aspx";
else
    searchwebform.action = "http://www.cqxh120.com/SearchNews.aspx";
}
