﻿function $(id){ return document.getElementById(id);}

function zixun()
{
    
}
function zixunwh()
{
  
}
function keysearch(){
    if(!$("key").value)alert('搜索关键字不可为空');
	else window.location="/searchNews.aspx?key="+$("key").value;
}

function searchlistbypage(name,id){
   if($("txtlistp").value==""){ alert("请输入你要查询的页码！"); return;}
   if(isNaN($("txtlistp").value)){ alert("你输入的页码必须是数字！"); return;}
   var p=parseInt($("txtlistp").value);
   if(p<1) p=1;
   if(id!="") location.href="/"+name+"/"+id+"/"+p+"/";
   else location.href="searchNews.aspx?key="+name+"&page="+p;
}
var speed=40;//速度数值越大速度越慢
function CreateDiv(m1,m2,m3)
{ 
  if($(m2))
  {
     var my=document.createElement("div");
     my.appendChild($(m2));
     var ul=document.createElement("ul");
     ul.id=m1;
     my.appendChild(ul);
     $(m3).appendChild(my);
     Move(m1,m2,m3);  
  }
}
function Move(m1,m2,m3)
{
  var m1=$(m1);
  var m2=$(m2);
  var m3=$(m3);
  m1.innerHTML=m2.innerHTML;
  function Marquee()
  {
     if(m1.offsetWidth-m3.scrollLeft<=0){m3.scrollLeft-=m1.offsetWidth;}
     else m3.scrollLeft++;
  }
  var mar=setInterval(Marquee,speed); 
  m3.onmouseover=function(){clearInterval(mar);}
  m3.onmouseout=function(){mar=setInterval(Marquee,speed);}
}
function AddToFavorite(){
    if(document.all) window.external.addFavorite(document.URL,document.title);
    else if(window.sidebar) window.sidebar.addPanel(document.title,document.URL,"");
}
function SetHome(obj,vrl){
    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 imageslist(w,h,th){
    var pics = imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
    var links = imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
    var texts = imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5

    var focus_width=w;
    var focus_height=h;
    var text_height=th;
    var swf_height = focus_height+text_height;
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">'); 
    document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/images/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
    document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
    document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">'); 
    document.write('<embed src="/images/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
}
function writeDateInfo()
{        
    var day="";    
    var month="";         
    var ampm="";         
    var ampmhour="";         
    var myweekday="";         
    var year="";         
    mydate=new Date();        
    myweekday=mydate.getDay();         
    mymonth=mydate.getMonth()+1;         
    myday= mydate.getDate();         
    myyear= mydate.getYear();         
    year=(myyear > 200) ? myyear : 1900 + myyear;         
    if(myweekday == 0)         
    weekday="日";         
    else if(myweekday == 1)         
    weekday="一";         
    else if(myweekday == 2)         
    weekday="二";         
    else if(myweekday == 3)         
    weekday="三";        
    else if(myweekday == 4)        
     weekday="四";         
     else if(myweekday == 5)         
     weekday="五";         
     else if(myweekday == 6)         
     weekday="六";         
     document.write("今天是："+year+"年"+mymonth+"月"+myday+"日 星期"+weekday); 
 } 

var scrollxxk=1;
var pauseTime=3000;
var timer;
function xxk1(count,ids,h,div){
   for(var i=1;i<=count;i++){
       if(i==ids){
           $(h+i).className="h2";
           $(div+i).style.display="block";
       }
       else{
           $(h+i).className="h1";
           $(div+i).style.display="none";
       }
   }
   scrollxxk=ids;
}
function affScroll() {
     clearTimeout(timer);
     xxk1(3,scrollxxk,'xxk1h','xxk1div');
     scrollxxk+=1;
     if (scrollxxk==4) {scrollxxk=1;}
     timer=setTimeout("affScroll()",pauseTime);
}





function xxk2(count,ids,h,div){
   for(var i=1;i<=count;i++){
       if(i==ids){
           $(h+i).className="h2";
           $(div+i).style.display="block";
       }
       else{
           $(h+i).className="h1";
           $(div+i).style.display="none";
       }
   }
}








function mousemove(){
    for(var i=0;i<3;i++){
        $("xuanxiangka").children[i].onclick=function(){ openol(this.className);}
    }
    
    $("searchTxt").value="搜索耳鼻喉相关";
    $("searchTxt").style.fontWeight="bolder";
    $("searchTxt").style.color="#3280C2";
    $("searchTxt").onfocus=function(){this.value='';}
}
function openol(obj){
        var nub= obj.substring(2);
        for(var i=1;i<=3;i++){
            $("li"+i).style.display="none";
            $("xuanxiangka").children[i-1].className="li"+i;
            if(i==nub){
                $("li"+i).style.display="block";
                $("xuanxiangka").children[i-1].className="li"+i+"_open";
            }
        }   
}

var upzir2;
var upzirId2=0;
function upzi2(){
  if($("LR_Tb4")){
      if($("LR_Tb4").children[0].children[0].children[0].children[0]){$("LR_Tb4").children[0].children[0].children [0].children[0].src="/images/centerent1.gif";
     upzirId2=1;}
  }
  if(upzirId2==0)upzir2=setTimeout("upzi2()","10");
  else clearTimeout(upzir2);
}upzi2();
