﻿//功能：取得cookie的值
function getCookie(name)
{
    var cookiestring=document.cookie;
    var search=name + "=";
    var offset = cookiestring.indexOf(search) 
    if (offset != -1)
    {
        offset += search.length;
        var end = cookiestring.indexOf("&", offset);
        if (end == -1)  end = cookiestring.length;
        var returnstring= cookiestring.substring(offset, end);
        end = returnstring.indexOf(";");
	    if(end != -1)   returnstring=decodeURIComponent(returnstring.substring(0, end)).toString();
	    else    returnstring=decodeURIComponent(returnstring).toString();
	    if (returnstring!=null) {return returnstring;}else{return "";}
    }
    else
    {
        return "";
    }
}
//注销
function logout()
{
    url="User/Process.aspx?action=logout";
    ajax_process_out(url);
}
//用户控件注销
function logout2()
{
    url="../User/Process.aspx?action=logout";
    ajax_process_out_uc(url);
}
//用户控件注销
function ajax_process_out(url)
{  

    CreateXmlHttp();
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = ajax_sumbit;
	xmlHttp.send(null);
	function ajax_sumbit() 
	{
		if (xmlHttp.readyState == 4){
		    if(xmlHttp.status==200)
		    {
		        if(xmlHttp.responseText=="logout")
                {
                     document.getElementById("islogin").style.display="block";
                     document.getElementById("logined").style.display="none";
                    document.getElementById("islogin").innerHTML="[<a href='User/Reg.aspx' title='免费注册'>免费注册</a>]&nbsp;[<a href='User/Login.aspx'>请登录</a>] ";
                    document.getElementById("welcome").innerHTML="您好，欢迎来到5izd健康体检频道！";                   
                }
		    }
		}
	}
}
function ajax_process_out_uc(url)
{  

    CreateXmlHttp();
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = ajax_sumbit;
	xmlHttp.send(null);
	function ajax_sumbit() 
	{
		if (xmlHttp.readyState == 4){
		    if(xmlHttp.status==200)
		    {
		        if(xmlHttp.responseText=="logout")
                {
                     document.getElementById("Head1_UserState1_islogin").style.display="block";
                     document.getElementById("Head1_UserState1_logined").style.display="none";
                    document.getElementById("Head1_UserState1_islogin").innerHTML="[<a href='User/Reg.aspx' title='免费注册'>免费注册</a>]&nbsp;[<a href='User/Login.aspx'>请登录</a>] ";
                    document.getElementById("Head1_UserState1_welcome").innerHTML="您好，欢迎来到5izd健康体检频道！";                   
                }
		    }
		}
	}
}
//输出字符串
function $W(str)
{
    document.write(str);
}

//根据ID获取指定对象
function $(e) 
{
   return document.getElementById ? document.getElementById(e) : null;
}

//根据Name获取指定对象
function $N(e)
{
    return document.getElementsByName(e);
}

//函数功能：左侧分类选中状态样式改变
		function ChangeClass(tdID)
		{
				var tempid;
				for(var i=0; i<=parseInt(document.getElementById("txtTypeLength").value);i++)
				{
					if($("tbType"+i))
						$("tbType"+i).className = "CursorHand";
				}
				$(tdID).className = "TypeSelected";
		}
//进度条启动
		function Begin(ImgNum)
		{
			var m_Img;
			if (ImgNum=="1") {m_Img="process02.gif";}
			if (!document.getElementById("processbar_div"))
			{
				m_str="<div id='processbar_div' style='position:absolute;background:#FFF;border:solid 1px #737373;padding:5px;width:150px;height:80px;left:350px;top:350px;z-index:1000;display:;'><img src='/images/"+m_Img+"' border=0><br>数据加载中...</div>";
				document.body.insertAdjacentHTML("beforeEnd",m_str);
			}
			document.getElementById("processbar_div").style.display="";
		}
//进度条关闭
		function End()
		{
		    if(document.getElementById("processbar_div"))
		    {
			    document.getElementById("processbar_div").style.display="none";
			}
		}
		function CheckLogin()
		{
			if (getCookie("WorkID")=="")
			{
				alert("请您先登录!");
				location.href="/index.htm";
			}
		}
//函数功能：除去所有空白
String.prototype.Trim = function()
{
	var regEx = /\s*/g;
	return this.replace(regEx,''); 
}
//------------------------------------------------------	
//函数功能：过滤html编码(新)
String.prototype.HtmlEncodeNew = function () {
	return this
		.replace(/&/g, "&amp;")
		.replace(/^[ ]/, '&nbsp;')
		.replace(/"/g, "&quot;")
		.replace(/</g, "&lt;")
		.replace(/>/g, "&gt;");
}
String.prototype.endcodeDot = function ()
{
	return this
		.replace(/&/g, "%26")
		.replace(/\+/g, "%2b");//只有此行有分号
}
//函数功能：过滤html编码(旧)
function HtmlEncode(str){
	var NewStr="";
	for(var i=0;i<str.length;i++) 
	{
		var temp=str.substring(i,i+1);
		temp = temp.replace("&","&amp;");
		temp = temp.replace(">", "&gt;");
		temp = temp.replace("<","&lt;");
		NewStr=NewStr+temp;
	}
	return NewStr;
}

String.prototype.startsWith = function(s){
	if(this.length<s.length)
		return false;
	if(this.substr(0,s.length) == s)
		return true;
	return false;
}
String.prototype.endsWith = function(s){
	if(this.length<s.length)
		return false;
	if(this.substring(this.length-s.length)==s)
		return true;
	return false;
}


//功能：使表单只能输入数字
//调用方法：在input属性里加上 onkeyup="numonly(this);" onBlur="numonly(this);"
		function numonly(n){ 
		n.value=n.value.replace(/\D/g,'') 
		} 
//功能：取得地址栏传值
//调用方法：比如地址为show.htm?id=2 取得id的值： QueryString("id")
function QueryString(qs)
{
	s = location.href;
	var SharpIndex=s.indexOf("#");
	if (SharpIndex!=-1) {
		s=s.substring(0,SharpIndex);
	}
	s = s.replace("?","?&").split("&");
	re = "";
	for(i=1;i<s.length;i++)
	{
		if(s[i].indexOf(qs+"=")==0)
		{
			re = s[i].replace(qs+"=","");
		}
	}
	return re;
}
//Begin打开弹出窗口
//url为弹出窗口的URL地址
//nu_width为弹出窗口的宽度
//nu_height为弹出窗口的高度
		var newWindow = null;
		function openwin(url,stoolbar)
		{
			if (! newWindow || newWindow.closed)
				newWindow = window.open(url,"",stoolbar);
			else
				newWindow = window.open(url,"",stoolbar);
				newWindow.focus();
		}
		function openurl(url,nu_width,nu_height)
		{
			var nu_left=(window.screen.width-nu_width)/2-5;
			var nu_top=(window.screen.height-nu_height)/2-40;
			openwin(url,"toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,top="+nu_top+",left="+nu_left+",width=" + nu_width + ",height=" + nu_height);
		}
//End打开弹出窗口
		function movemenu(indexnum)
		{
				
			for(var i=1; i<=10;i++)
			{
				if($("menu"+i))
					$("menu"+i).className = "menu";
			}
			$("menu"+indexnum).className = "menu now";
		}

//功能：取得文件名称扩展名
//调用方法示例：var newimgpath=imgpath.GetExtensionName();
	String.prototype.GetExtensionName = function()
	{
		var regEx = /^.*\/[^\/]*(\.[^\.\?]*).*$/;
		return this.replace(regEx,'$1');
	}

//Begin 分页
		function JudgeNumOnly(obj) 
		{ 
			obj.value=obj.value.replace(/\D/g,'');
		}
		function JudgeGoPage(p_txtNumName, p_PageCount)
		{ 
			var m_ret = true;
			var m_toPage = document.getElementById(p_txtNumName);
			if ( m_toPage.value == '' ) 
			{ 
				alert('抱歉，转到的页数不能为空，请重新输入!');
				m_toPage.focus(); 
				m_ret = false;
			} 
			else if( parseInt(m_toPage.value)<1 || parseInt(m_toPage.value)>p_PageCount ) 
			{ 
				alert('抱歉，只能输入1至'+p_PageCount+'的整数，请重新输入！');
				m_toPage.focus();
				m_ret = false;
			}
			return m_ret;
		}
//End 分页

//Begin================================================================
//函数功能：只能输入正负号，数字和小数点(用于输入金额用）
//调用方法：在input属性里加上 onkeypress='numonly1(this)' onkeyup='numonly1(this)' onblur='numonly2(this)'
		function numonly1(k)
		{
			if(!k.value.match(/^[\+\-]?\d*?\.?\d*?$/))
				k.value=k.t_value;
			else
				k.t_value=k.value;
			if(k.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))
				k.o_value=k.value
		} 
		function numonly2(k)
		{
			if(!k.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?|\.\d*?)?$/))
				k.value=k.o_value;
			else
			{
				if(k.value.match(/^\.\d+$/))
					k.value=0+k.value;
				if(k.value.match(/^\.$/))
					k.value=0;k.o_value=k.value;
			}
		} 
//End================================================================

//同步方式取回xml数据
		var xmlHttp = false;
		function ReturnXmlNoAsy(url)
		{
			if (!xmlHttp) {//创建xmlHttp
				try{xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");} //IE
				catch (e){try {xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");}catch (e2) {xmlHttp = false;}}
				if (!xmlHttp && typeof XMLHttpRequest != 'undefined'){xmlHttp = new XMLHttpRequest();}
			}
			var m_str = "";
			xmlHttp.open("GET", url, false);
			xmlHttp.onreadystatechange = function(){if (xmlHttp.readyState == 4){
			if(xmlHttp.status==200){
			m_str = xmlHttp.responseText;
			}
			}};
			xmlHttp.send(null);
			return m_str;
		}

	
//创建xmlHttp对象
function CreateXmlHttp()
{
	try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch (e) { try { xmlHttp = new XMLHttpRequest(); }
	catch (e) { xmlHttp = false; }}}
}
//Ajax处理函数
function ajax_process(url,id)
{
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = ajax_sumbitemployment;
	xmlHttp.send(null);
	function ajax_sumbitemployment() 
	{
		if (xmlHttp.readyState == 1) {document.getElementById(id).innerHTML="数据读取中...";}
		if (xmlHttp.readyState == 3) {document.getElementById(id).innerHTML="数据交互中....";}
		if (xmlHttp.readyState == 4){
		    if(xmlHttp.status==200)
		    {
		        document.getElementById(id).innerHTML=xmlHttp.responseText;
		    }
		}
	}
}
		
function GetCookieVal(offset)
//获得Cookie解码后的值
{
	var endstr = document.cookie.indexOf (":", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function SetCookie(name, value)
//设定Cookie值
{
	var expdate = new Date();
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	if(expires!=null) expdate.setTime(expdate.getTime() + ( expires * 1000 ));
	document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
	+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain))
	+((secure == true) ? "; secure" : "");
}
function DelCookie(name)
//删除Cookie
{
	var exp = new Date();
	exp.setTime (exp.getTime() - 1);
	var cval = GetMyCookie (name);
	document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString();
}
//  Function to return the value of the cookie specified by "name".
//    name - String object containing the cookie name.
//    returns - String object containing the cookie value, or null if
//      the cookie does not exist.
function GetNoEscapeCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) 
	{
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} 
	else
		begin += 2;
		
	var end = document.cookie.indexOf(";", begin);
	if (end == -1) end = dc.length;
	return dc.substring(begin + prefix.length, end);
}


//浏览器类型及版本检测
function getOs() 
{ 
   var OsObject = ""; 
   if(navigator.userAgent.indexOf("MSIE")>0) { 
        return "MSIE"; 
   } 
   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){ 
        return "Firefox"; 
   } 
   if(isSafari=navigator.userAgent.indexOf("Safari")>0) { 
        return "Safari"; 
   }  
   if(isCamino=navigator.userAgent.indexOf("Camino")>0){ 
        return "Camino"; 
   } 
   if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){ 
        return "Gecko"; 
   } 
   
} 
//加入收藏夹
function bookmarksite()
{
var title = document.title;
var url =window.location.href;
if (window.sidebar) // firefox
  window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print)
{ // opera
  var elem = document.createElement('a');
  elem.setAttribute('href',url);
  elem.setAttribute('title',title);
  elem.setAttribute('rel','sidebar');
  elem.click();
} 
else if(document.all)// ie
  window.external.AddFavorite(url, title);
}
//设为首页
function SetHome(obj){
var vrl="http://www.5izd.com";
       try{
               obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
       }
       catch(e){
               if(window.netscape) {
                       try {
                               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
                       }  
                       catch (e)  { 
                               alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");  
                       }
                       var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                       prefs.setCharPref('browser.startup.homepage',vrl);
                }
       }
}



//近回所有选定项
function GetSetChecked()
{
    var list = document.documentElement.getElementsByTagName("input"); 
    var strid="";
    for(i=0;i<list.length;i++)
    {  
        if(list[i].type == "checkbox"&& list[i].checked)
        {
            if(strid=="")
                strid=list[i].value;
            else
                strid+="|"+list[i].value;
        }
    } 
    return strid;   
}

///选定CheckBox
function SelChecked()
{
    var cboxAll=$("cboxAll");
    var list = document.documentElement.getElementsByTagName("input");
    for(i=0;i<list.length;i++)
    {  
        if(list[i].type == "checkbox")
        {
            list[i].checked =true;
        }
    }
}
///反选
function RevChecked()
{
    var cboxAll=$("cboxAll");
    var list = document.documentElement.getElementsByTagName("input");
    for(i=0;i<list.length;i++)
    {  
        if(list[i].type == "checkbox")
        {
            list[i].checked =!list[i].checked;
        }
    }
}

//－－－－－－防sql注入
function  IsValid(oField)
{
    oField=unescape(oField);
    re=/;|#|([\s\b+()]*select|update|insert|delete|declare|@|exec|dbcc|alter|drop|create|backup|if|else|end|and|or|add|set|open|close|use|begin|return|as|go|exists)[\s\b+]/i; 
    var e = re.test(oField);
    if(e) {
    
    location.href="../bug.aspx";//请更换提示页
    return true;
    }else
    {
        return false;
    }
 }
 
//检查String类型的值，是否为空
//长度是否大于1
function CheckLength(str)
{
    if(str!=null){
        str =str.Trim();
        if(str.length>0){
        return true;
        }}
   return false;
}
//切换层样式
function change(id,classid)
{
switch(classid)
{
case 1:
$(id).className="";
break;
case 2:
$(id).className="";
break;
}
}
function change2(item,state)
{
  item.className = "DivClose"+state;
}

//显示城市层
function showcity(id)
{
$(id).style.display="block";
}
function ShowCity()
 {
   TypeShow("DivImg");
 }
 //显示层+背景
function TypeShow(Elem)
{
	$(Elem).style.display="block";	
}
//隐藏层+背景
function TypeHidden(Elem)
{
	$(Elem).style.display="none";
}
//改变省份
function setProvince(name,value)
{
   TypeHidden("DivImg");
   addCookie("User_Place",escape(name)+"|"+value);
   window.location.reload();
}
function addCookie(objName,objValue)
{
    //添加cookie
    var str = objName + "=" + objValue;
        var date = new Date();
        var ms = 24*3600*1000;
        date.setTime(date.getTime() + ms);
        str += "; expires=" + date.toGMTString();
        str += ";path=" + "/"
    document.cookie = str;
}
//点击会员中心时的判断
function CheckUserCenter1()
{
    if(getCookie('User_Info')=="")
    {
        window.parent.location.href='/tj/user/login.aspx';      
    }
    else
    {
        window.parent.location.href='/tj/user/UserCenter.aspx';      
    }
}
//首页点击我要预约时触发
function CountIn(p_iActivities)
{
    if(getCookie('User_Info')=="")
    {
        AlertMessage(msg2['notLogin'],2);
    }
    else
    {
        var xmlHttp=false;
        var wHeight=0;
        var url="/tj/Hospital/Process.aspx?action=countIn&piactivities="+p_iActivities;
        try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
        catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
        catch (e) { try { xmlHttp = new XMLHttpRequest(); }
        catch (e) { xmlHttp = false; }}}
        xmlHttp.open("GET",url,true);
        xmlHttp.onreadystatechange=function(){
        if(xmlHttp.readyState==4){
        if(xmlHttp.status==200){
            var returnValue=xmlHttp.responseText;
            if(returnValue=="true")//符合条件 
            {
                window.open('/tj/user/yytz.aspx?piactivities='+p_iActivities);
            }
            else if(returnValue=="false")//没有激活
            {
                $('TjCheckYy1_divMessage').style.top=wHeight+"px";
                AlertMessage(msg2['jhjkk'],5);
            }
            else if(returnValue=="false1")//登录超时
            {
                $('TjCheckYy1_divMessage').style.top=wHeight+"px";
                AlertMessage(msg2['loginTimeOut'],3);
            }
            else if(returnValue=="false2")//没有开通
            {
                AlertMessage(msg2['ktjkk'],4);
            }
            else
            {
                AlertMessage(msg2['notLogin'],2);
            }
        }
        }};xmlHttp.send(null);     
    }
}
var btnid="";
var objss=null;
var oldss=null;
document.onkeydown=function(e)
{
   var entCode=0;
   if(navigator.userAgent.indexOf("MSIE")<=0)
   {
        entCode=e.which;    
   }
   else
   {
        entCode=event.keyCode;
   }
   if (entCode== 13)
   {
        if(objss!=null)
        {
            $(objss).focus(); 
            if(oldss!=null)
            {
                objss=oldss;
            }
        }
   }
}
document.onkeyup=function(e)
{
   var entCode=0;
   if(navigator.userAgent.indexOf("MSIE")<=0)
   {
        entCode=e.which;    
   }
   else
   {
        entCode=event.keyCode;
   }
   if (entCode== 13)
   { 
       if(objss!=null)
       {
          $(objss).focus(); 
       }
   }
}
function SetFocuss3(objValue,oldValue)
{
    objss=objValue;
    oldss=oldValue;
}
function SetFocuss2(objValue)
{
    objss=objValue;
}
function SetFocuss(objValue)
{
    objss=objValue;
    oldss=objValue;
}

function ChangeShow(dnum)
{
    var meun="UserMenu_submeun_";
    var img="img_";
    var nowd =$(meun+dnum).style.display;
    if(nowd=="none")
    {
    $(meun+dnum).style.display="block";
    $(img+dnum).src="images/jiantouxia.jpg";
    }
    else
    {
    $(meun+dnum).style.display="none";
    $(img+dnum).src="images/jiantou.jpg";
    }
}


function GetSetCheckedNew()
{
    var list = document.documentElement.getElementsByTagName("input"); 
    var strid="";
    for(i=0;i<list.length;i++)
    {  
        if(list[i].type == "checkbox"&& list[i].checked)
        {
            if(strid=="")
                strid=list[i].value;
            else
                strid+=","+list[i].value;
        }
    } 
    return strid;   
}

function AjaxReturnValue(url)
{
    var m_str = "";
    CreateXmlHttp();
    xmlHttp.open("GET",url,false);
    xmlHttp.send(null);
    if(xmlHttp.status==200)
    {
        m_str=xmlHttp.responseText;
    }
    return m_str;
}

function LoadCity(elem,id)
{
    var xmlHttp=false;
    var ipnce=parseInt($(elem).value);
    if(ipnce>0)
    {
        var url ="/zs/address/AddAddress.ashx?option="+ipnce+"&rnd="+Math.random();
        try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
        catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
        catch (e) { try { xmlHttp = new XMLHttpRequest(); }
        catch (e) { xmlHttp = false; }}}
        xmlHttp.open("GET",url,true);
        xmlHttp.onreadystatechange=function(){
        if(xmlHttp.readyState==4){
        if(xmlHttp.status==200){
        var _options=eval(xmlHttp.responseText);
        var selcity=$(id);
        if(_options.length>0){
        selcity.options.length=0;
        for(i=0;i<_options.length;i++){
            var varitem = CreateOption(_options[i].name,_options[i].value);
            selcity.options.add(varitem);
        }}}
        }};xmlHttp.send(null);
    }
    else
    {
        $(id).options.length=0;
        $(id).options.add(CreateOption('请选择','0'));
    }
}

function CreateOption(txt,value)
{
    var _option=document.createElement("option");
    _option.value=value;
    _option.text=txt;
    return _option;
}

function BindDailHandle(){
    var elems= document.getElementsByName("dail");
    for(i=0;i<elems.length;i++){
        elems[i].onclick =function(){
            chkHandle(this,"delgcond",this.value);
        }
    }
}

function chkHandle(obj,target,text){
	var oTarget = $(target);
	var bPrefix = true;
	if(oTarget.value.endsWith("？")||oTarget.value.endsWith("。"))
		bPrefix = false;
	if(obj.checked){
		if(oTarget.value.indexOf(text) == -1){
			if(oTarget.value.Trim() == "")
				oTarget.value = text;
			else
				oTarget.value += (bPrefix? "，" : "") + text;
		}
	}
	else{
		var reg = new RegExp("^" + text + "，?|，?" + text, "ig");
		oTarget.value = oTarget.value.replace(reg,"");
	}
}
function change2(item,state)
{
  item.className = "DivClose"+state;
}
function ShowCity()
 {
   TypeShow("DivImg");
 }
 //显示层+背景
function TypeShow(Elem)
{
	$(Elem).style.display="block";	
}
//隐藏层+背景
function TypeHidden(Elem)
{
	$(Elem).style.display="none";
}
//改变省份
function setProvince(name,value)
{
   TypeHidden("DivImg");
   addCookie("User_Place",escape(name)+"|"+value);
   window.location.reload();
}
function addCookie(objName,objValue)
{
    //添加cookie
    var str = objName + "=" + objValue;
        var date = new Date();
        var ms = 24*3600*1000;
        date.setTime(date.getTime() + ms);
        str += "; expires=" + date.toGMTString();
        str += ";path=" + "/"
    document.cookie = str;
}
function Createli()
{
    var _value =unescape(GetNoEscapeCookie("product"));
    if(_value!="null"){
        var args =_value.split('&');
        if(typeof args=="object"){
            var title="";
            var url="";
            var _ul =$("oldview");
            for(var a=0;a<args.length;a++){
                title=args[a];
                url=args[a+1];
                if(CheckLength(title)){;
                    var _li =document.createElement("li");
                    var _a =document.createElement("a");
                    _a.setAttribute("target","_blank");
                    _a.setAttribute("title",title);
                    _a.setAttribute("href",url);
                    _a.innerHTML=title;
                    _li.appendChild(_a);
                    _ul.appendChild(_li);
                } 
                a=a+1;
            }
        }
    }
}

function loginOut()
{
    var url="/tj/User/Process.aspx?action=logout";
     try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
        catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
        catch (e) { try { xmlHttp = new XMLHttpRequest(); }
        catch (e) { xmlHttp = false; }}}
        xmlHttp.open("GET",url,true);
        xmlHttp.onreadystatechange=function(){
        if(xmlHttp.readyState==4){
        if(xmlHttp.status==200){
            if(xmlHttp.responseText=="logout")
            {location.href="/tj/User/Login.aspx";}            
        }
        }};xmlHttp.send(null);
}


var msg2=new Array();
msg2['loginTimeOut']='登录信息已过期,<br/>为了安全起见请重新登录';
msg2['ktjkk']='您还未开通健康卡！';
msg2['jhjkk']='未激活健康卡！';
msg2['notLogin']='您还未登录，<br/>只有登录后才能进行此操作！';
