﻿// JavaScript Document

var isIE=(document.all&&document.getElementById&&!window.opera)?true:false; 
var isMozilla=(!document.all&&document.getElementById&&!window.opera)?true:false; 
var isOpera=(window.opera)?true:false;
var seturl='url(#default#homepage)';
var aUrls=document.URL.split("/");
//var weburl="http://"+aUrls[2]+"/";
var weburl=window.location.href.toLowerCase()
//var webname='长沙玛丽亚妇产医院';
var webname=document.title;

function setHomepage()
{	if(isMozilla){
		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',weburl);
	}
	if(isIE){
		this.homepage.style.behavior=seturl;this.homepage.sethomepage(weburl); 
	}
}

//收藏代码
function addfavorite()
{
	if(isMozilla){
		if (document.all){ window.external.addFavorite(weburl,webname);}
		else if (window.sidebar){ window.sidebar.addPanel(webname, weburl,"");}
	}
	if(isIE){window.external.AddFavorite(weburl, webname);}	
}

//QQ对话代码
function openwin(QQ,sigkey){
var Win=window.open('http://sighttp.qq.com/cgi-bin/check?sigkey=b66102b5823e242415359e6c74dec6a80effdb0e87e1edd9bef2265b8484e243efdc078b4eae83476ec1a707829f2923');
  Win.opner=document.window;
  Win.focus();
  }

   function TurnUrl(strUrl)
{   
   if(strUrl!='')
  {         
    window.location=strUrl;
  }
}


 function OnSearchSubmit()
{
   var keyword=document.getElementById("Keyword").value;
   if(keyword==''||keyword==null||keyword=='请输入关键词')
  {
      alert("请填写您想要搜索的关键词");
       return ;
    }else{
                           
         window.location=" /search.aspx?searchtype=0&Keyword="+escape(keyword);
    }
}

//tab菜单切换代码
function settab(name,cursel,n){
for(i=1;i<=n;i++){
 var menu=document.getElementById(name+i);
 var con=document.getElementById(""+name+"_"+i);
 menu.className=i==cursel?"hover":"";
 con.style.display=i==cursel?"block":"none";
 }
}

//首页广告收缩代码
var intervalId = null; 
function slideAd(id,nStayTime,sState,nMaxHth,nMinHth){ 
   this.stayTime=nStayTime*1000 || 3000; 
   this.maxHeigth=nMaxHth || 400; 
   this.minHeigth=nMinHth || 0; 
   this.state=sState || "down" ; 
   var obj = document.getElementById(id); 
   if(intervalId != null)window.clearInterval(intervalId); 
   function openBox(){ 
    var h = obj.offsetHeight; 
    obj.style.height = ((this.state == "down") ? (h + 5) : (h - 5))+"px"; 
     if(obj.offsetHeight>this.maxHeigth){ 
     window.clearInterval(intervalId); 
     intervalId=window.setInterval(closeBox,this.stayTime); 
     } 
     if (obj.offsetHeight<=this.minHeigth){ 
     window.clearInterval(intervalId); 
     obj.style.display="none"; 
     } 
   } 
   function closeBox(){ 
    slideAd(id,this.stayTime,"up",nMaxHth,nMinHth); 
   } 
   intervalId = window.setInterval(openBox,10); 
} 

function copyAll(ob){
  var obj=MM_findObj(ob); if (obj) { 
  obj.select();js=obj.createTextRange();js.execCommand("Copy");}
  alert("代码已成功复制!");
}

function MM_findObj(n,d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

var g_child;
var g_hideTimer = null;
var g_locked = false;
function $id(id){return document.getElementById(id);}
function getPos(parentObj){
 var parentPos = [];
 parentPos[0] = parentObj.offsetLeft;//x
 parentPos[1] = parentObj.offsetTop;//y
 while (parentObj = parentObj.offsetParent)
 {
parentPos[0] += parentObj.offsetLeft;
  parentPos[1] += parentObj.offsetTop;
 }
 return parentPos;
}
function showQQ(parentObj,childName){if(g_hideTimer != null){clearTimeout(g_hideTimer);return;}
 var parentPos = getPos(parentObj);
 $id(childName).style.left = parentPos[0] + "px";
 $id(childName).style.top = parentPos[1] + 38 + "px";
 $id(childName).style.display = "block";
 g_child = $id(childName);
}
function hideQQ(){if(g_locked == true){return;}else{g_hideTimer = setTimeout(function(){hidingMenu();},1);}}
function hidingMenu(){g_child.style.display = "none"; clearTimeout(g_hideTimer); g_hideTimer = null; if(g_locked == true){g_locked = false;}}

//显示在在咨询链接
var CallMe ="<a href=\"http:\/\/lr.zoosnet.net\/LR\/Chatpre.aspx?id=LEF48441527&lng=cn\"><\/a><a href=\"http:\/\/lr.zoosnet.net\/LR\/Chatpre.aspx?id=LEF48441527&lng=cn\"><\/a><a href=\"javascript:void(0)\"  onmouseover=\"showQQ(this,\'qqList\')\" onmouseout=\"hideQQ()\"><\/a><a href=\"http:\/\/lr.zoosnet.net\/LR\/Chatpre.aspx?id=LEF48441527&lng=cn\"><\/a><div class=\'qqList\' id=\'qqList\' onmouseover=\"showQQ()\" onmouseout=\"hideQQ()\"><ul><li><a onclick=\"hidingMenu()\" href=\"http:\/\/sighttp.qq.com\/cgi-bin\/check?sigkey=f70901068471abd84e28a74eda22d2255c3d934590bc487aa3570ed07bd4e8c3\" target=_blank><img border=\"0\" SRC=\'http:\/\/wpa.qq.com\/pa?p=1:897022479:1\' alt=\'计划生育专家\'><span>计划生育专家<\/span><\/a><\/li><li><a onclick=\"hidingMenu()\" href=\"http:\/\/sighttp.qq.com\/cgi-bin\/check?sigkey=bee83fce38c32209542b935f292ecfc4f2ca30f5bcb63fde535cece78bf85a5e\" target=_blank><img border=\"0\" SRC=\'http:\/\/wpa.qq.com\/pa?p=1:1061620133:1\' alt=\'不孕不育专家\'><span>不孕不育专家<\/span><\/a><\/li><li><a onclick=\"hidingMenu()\" href=\"http:\/\/sighttp.qq.com\/cgi-bin\/check?sigkey=698067e1781ccaf23bcc4ef6a13069298e8e83bff49b1fdf90340fe161d232b6\" target=_blank><img border=\"0\" SRC=\'http:\/\/wpa.qq.com\/pa?p=1:779264417:1\' alt=\'宫颈疾病专家\'><span>宫颈疾病专家<\/span><\/a><\/li><li><a onclick=\"hidingMenu()\" href=\"http:\/\/sighttp.qq.com\/cgi-bin\/check?sigkey=6939345459103743b344b0b259278f5be26b10de75f1b240bfee8725acea8e20\" target=_blank><img border=\"0\" SRC=\'http:\/\/wpa.qq.com\/pa?p=1:1067819357:1\' alt=\'乳腺诊疗专家\'><span>乳腺诊疗专家<\/span><\/a><\/li><li><a onclick=\"hidingMenu()\" href=\"http:\/\/sighttp.qq.com\/cgi-bin\/check?sigkey=b66102b5823e242415359e6c74dec6a80effdb0e87e1edd9bef2265b8484e243efdc078b4eae83476ec1a707829f2923\" target=_blank><img border=\"0\" SRC=\'http:\/\/wpa.qq.com\/pa?p=1:875920:1\' alt=\'其它疾病咨询\'><span>其它疾病咨询<\/span><\/a><\/li><\/ul><\/div>";//QQ对话链接有效期至2010年9月1日

//显示搜索按钮
var ShowSearch ="<input id=\"Keyword\" name=\"Keyword\" value=\"请输入关键词\" maxlength=\"49\" onfocus=\"if (this.value==this.defaultValue) this.value = \'\';\" onblur=\"if(this.value==\'\') this.value=this.defaultValue\"\/><input class=\"SubmitSearch\" type=\"submit\" onclick=\"OnSearchSubmit();\" value=\"  \" \/>";

var ShowZoosnetLink ="<a href=\"#\" class=\"c_content_ask_1\"><\/a><a href=\"#\" class=\"c_content_ask_2\"><\/a>";

//添加网摘代码
var WangZhai="<strong><font color=\"#0E63E4\">收<\/font><font color=\"#58C600\">藏<\/font><font color=\"#996699\">到<\/font><font color=\"#C00012\">网<\/font><font color=\"#795f00\">摘<\/font><font color=\"#327F00\">:<\/font><\/strong>  <a href=\"javascript:window.open(\'http:\/\/cang.baidu.com\/do\/add?it=\'+encodeURIComponent(document.title.substring(0,76))+\'&iu=\'+encodeURIComponent(location.href)+\'&fr=ien#nw=1\',\'_blank\',\'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes\'); void 0\"><img border=\"0\" src=\"\/Skin\/main\/images\/WangZhai\/baidu.gif\" alt=\"Baidu搜藏\"><\/a> <a href=\"javascript:window.open(\'http:\/\/shuqian.qq.com\/post?from=3&title=\'+encodeURIComponent(document.title)+\'&uri=\'+encodeURIComponent(document.location.href)+\'&jumpback=2&noui=1\',\'favit\',\'width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes\');void(0)\"><img src=\"\/Skin\/main\/images\/WangZhai\/qq.gif\" alt=\"QQ书签\"  border=\"0\" title=\"QQ书签\"><\/a> <a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(vivi=window.open(\'http:\/\/vivi.sina.com.cn\/collect\/icollect.php?pid=2008&title=\'+escape(d.title)+\'&url=\'+escape(d.location.href)+\'&desc=\'+escape(t),\'vivi\',\'scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes\'));vivi.focus();\" title=\"收藏的网页将被永久地保存到爱问ViVi收藏夹http:\/\/vivi.sina.com.cn\"><img src=\"\/Skin\/main\/images\/WangZhai\/vivi.gif\" alt=\"新浪ViVi\" border=\"0\"><\/a> <a href=\"#\" onclick=\"window.open(\'http:\/\/myweb.cn.yahoo.com\/popadd.html?url=\'+encodeURIComponent(document.location.href)+\'&title=\'+encodeURIComponent(document.title), \'Yahoo\',\'scrollbars=yes,width=440,height=440,left=80,top=80,status=yes,resizable=yes\');\"><img src=\"\/Skin\/main\/images\/WangZhai\/yahoo.gif\" alt=\"Yahoo书签\" border=\"0\"><\/a> <a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(keyit=window.open(\'http:\/\/www.365key.com\/storeit.aspx?t=\'+escape(d.title)+\'&u=\'+escape(d.location.href)+\'&c=\'+escape(t),\'keyit\',\'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes\'));keyit.focus();\" title=\"功能强大的网络收藏夹，一秒钟操作就可以轻松实现保存带来的价值、分享带来的快乐\"><img src=\"\/Skin\/main\/images\/WangZhai\/365key.gif\" alt=\"365Key网摘\" border=\"0\"><\/a> <a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(yesky=window.open(\'http:\/\/hot.yesky.com\/dp.aspx?t=\'+escape(d.title)+\'&u=\'+escape(d.location.href)+\'&c=\'+escape(t)+\'&st=2\',\'yesky\',\'scrollbars=no,width=400,height=480,left=75,top=20,status=no,resizable=yes\'));yesky.focus();\" title=\"天极网摘：文摘|图摘|闪摘|乐摘 http:\/\/hot.yesky.com\"><img src=\"\/Skin\/main\/images\/WangZhai\/yesky.gif\" alt=\"天极网摘\" border=\"0\"><\/a> <a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(wozhai=window.open(\'http:\/\/www.wozhai.com\/wozhai\/Cento.asp#t=\'+escape(d.title)+\'&u=\'+escape(d.location.href)+\'&c=\'+escape(t),\'wozhai\',\'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes\'));wozhai.focus();\"><img src=\"\/Skin\/main\/images\/WangZhai\/wozhai.gif\" alt=\"我摘\" border=\"0\"><\/a> <a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(vivi=window.open(\'http:\/\/my.poco.cn\/fav\/storeIt.php?t=\'+escape(d.title)+\'&u=\'+escape(d.location.href)+\'&c=\'+escape(t),\'_blank\',\'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes\'));\" title=\"收藏到POCO 网摘http:\/\/share.poco.cn\"><img src=\"\/Skin\/main\/images\/WangZhai\/poco.gif\" alt=\"POCO网摘\" border=\"0\"><\/a> <a href=\"javascript:t=document.title;u=location.href;e=document.selection?(document.selection.type!=\'None\'?document.selection.createRange().text:\'\'):(document.getSelection?document.getSelection():\'\');void(open(\'http:\/\/bookmark.hexun.com\/post.aspx?title=\'+escape(t)+\'&url=\'+escape(u)+\'&excerpt=\'+escape(e),\'HexunBookmark\',\'scrollbars=no,width=600,height=450,left=80,top=80,status=no,resizable=yes\'));\"><img src=\"\/Skin\/main\/images\/WangZhai\/hexun.gif\" alt=\"和讯网摘\" border=\"0\"><\/a> <a title=\"鼠标选中部分作为描述，提交到diglog.com\" href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(keyit=window.open(\'http:\/\/www.diglog.com\/submit.aspx?title=\'+escape(d.title)+\'&url=\'+escape(d.location.href)+\'&description=\'+escape(t),\'keyit\',\'scrollbars=yes,width=500,height=500,left=65,top=20,status=no,resizable=yes\'));keyit.focus();\"><img src=\"\/Skin\/main\/images\/WangZhai\/digit.gif\" border=\"0\" alt=\"提交新发现，Dig it\" \/><\/a> <a href=\"javascript:{var o=document.createElement(\'scri\'+\'pt\');o.src=\'http:\/\/img.chouti.com\/js\/cooperate.js?v=\'+Math.random();o.id=\'ct_bookmark_scripts\';o.type=\'text\/javascript\';o.charset=\'utf-8\';document.body.appendChild(o);void(0);var lug=\'\';}\"><img src=\"\/Skin\/main\/images\/WangZhai\/chouti.gif\" alt=\"收藏到抽屉\" border=\"0\" \/><\/a> <a href=\"javascript:location.href=\'http:\/\/www.google.com\/bookmarks\/mark?op=add&bkmk=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)\"><img src=\"\/Skin\/main\/images\/WangZhai\/google.gif\" alt=\"Google书签\" border=\"0\"><\/a> <a href=\"javascript:location.href=\'http:\/\/del.icio.us\/post?&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)\"><img src=\"\/Skin\/main\/images\/WangZhai\/delicious.gif\" alt=\"Del.icio.us\" border=\"0\"><\/a> <a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(live=window.open(\'https:\/\/favorites.live.com\/quickadd.aspx?marklet=1&mkt=en-us&url=\'+escape(d.location.href)+\'&title=\'+escape(d.title)+\'&top=1\',\'live\',\'scrollbars=no,status=no,resizable=yes\'));live.focus();\"><img src=\"\/Skin\/main\/images\/WangZhai\/live.gif\" alt=\"Windows Live\" border=\"0\"><\/a><a href=\"http:\/\/www.onwww.cn\/\" title=\"将此页顶到上网摘链\" target=_blank><img border=\"0\" src=\"\/Skin\/main\/images\/WangZhai\/z.gif\" alt=\"上网摘链\"><\/a>";

var Tips ="<FONT color=#ff00ff>（本站信息仅供参考，并非诊断治疗之依据，如有身体不适，请尽快就医诊治。） <STRONG>长沙玛丽亚妇产医院专家提示：<\/STRONG>如您发现有任何疾病症状，请立即到国家正规的专科医院接受检查。长沙玛丽亚妇产医院疾病咨询热线<STRONG><FONT color=#0000ff>0731-88922323<\/font><\/STRONG>,我们将为您提供全面的疾病或健康方面的咨询服务！<\/font>";

function showLocale(objD)
{
	var str,colorhead,colorfoot;
	var yy = objD.getYear();
	if(yy<1900) yy = yy+1900;
	var MM = objD.getMonth()+1;
	if(MM<10) MM = '0' + MM;
	var dd = objD.getDate();
	if(dd<10) dd = '0' + dd;
	var hh = objD.getHours();
	if(hh<10) hh = '0' + hh;
	var mm = objD.getMinutes();
	if(mm<10) mm = '0' + mm;
	var ss = objD.getSeconds();
	if(ss<10) ss = '0' + ss;
	var ww = objD.getDay();
	if  ( ww==0 )  colorhead="<font color=\"#FF0000\">";
	if  ( ww > 0 && ww < 6 )  colorhead="<font color=\"#373737\">";
	if  ( ww==6 )  colorhead="<font color=\"#b9167f\">";
	if  (ww==0)  ww="星期日";
	if  (ww==1)  ww="星期一";
	if  (ww==2)  ww="星期二";
	if  (ww==3)  ww="星期三";
	if  (ww==4)  ww="星期四";
	if  (ww==5)  ww="星期五";
	if  (ww==6)  ww="星期六";
	colorfoot="</font>"
	str = colorhead + yy + "-" + MM + "-" + dd + " " + hh + ":" + mm + ":" + ss + "  " + ww + colorfoot;
	return(str);
}
function tick()
{
	var today;
	today = new Date();
	document.getElementById("localtime").innerHTML = showLocale(today);
	window.setTimeout("tick()", 1000);
}
function displaySubMenu(li) {
	var subMenu = li.getElementsByTagName("ul")[0];
	subMenu.style.display = "block";
}
function hideSubMenu(li) {
	var subMenu = li.getElementsByTagName("ul")[0];
	subMenu.style.display = "none";
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
