﻿// JavaScript Document
function GetDiv(DivId)
{
	return document.getElementById(DivId);
	}
	
function ShowDiv(D1,D2,i,n,class1,class2)
{
	
   var j;
   for(j=1;j<=n;j++)
   {
	   GetDiv(D2+j).style.display="none";
	   GetDiv(D1+j).className=class1;
   }
   GetDiv(D2+i).style.display="";
   GetDiv(D1+i).className=class2;

}
 
  
function addCookie(){   
    try{   
        window.external.AddFavorite('http://www.sxhmyy.com','山西惠民中西医结合医院');    
    }catch(e){   
        (window.sidebar)?window.sidebar.addPanel('山西惠民中西医结合医院','http://www.sxhmyy.com',''):alert('请使用按键 Ctrl+d，收藏山西惠民中西医结合医院');    
    }   
}   
  
function setHomepage(){　 // 设置首页   
    if (document.all){   
        document.body.style.behavior = 'url(#default#homepage)';   
        document.body.setHomePage('http://www.sxhmyy.com');   
    }else if (window.sidebar){   
        if (window.netscape){   
            try {   
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");   
            }catch (e) {   
                alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");   
            }   
        }   
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);   
        prefs.setCharPref('browser.startup.homepage', 'http://www.sxhmyy.com');   
    }   
}    


function change_tab(d,className)
{
	GetDiv(d).className=className;
}


/*文字滚动*/ 
function scrollup(o,d,c){
       if(d==c){
              var t=o.firstChild.cloneNode(true);
              o.removeChild(o.firstChild);
              o.appendChild(t);
              t.style.marginTop=o.firstChild.style.marginTop='0px';
       }
       else{
              var s=3,c=c+s,l=(c>=d?c-d:0);
              o.firstChild.style.marginTop=-c+l+'px';
              window.setTimeout(function(){scrollup(o,d,c-l)},100);
       }
}

window.onload=function(){
       var o=document.getElementById('infozone');
       window.setInterval(function(){scrollup(o,31,0);},5000);
} 
/*文字滚动*/

function ShowTab(D1,D2,D3,i,n,class1,class2)
{
	
   var j;
   for(j=1;j<=n;j++)
   {
	   GetDiv(D2+j).style.display="none";
	   GetDiv(D3+j).style.display="none";
	   GetDiv(D1+j).className=class1;
   }
   GetDiv(D2+i).style.display="";
   GetDiv(D3+i).style.display="";
   GetDiv(D1+i).className=class2;

}
