addLoadEvent(Navbox);
addLoadEvent(woyao);

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function $(id){ return document.getElementById(id); }

function Navbox(){
	var NavId=$("KeShi1");
	var NavList=NavId.getElementsByTagName("li");
	for(i=0;i<NavList.length;i++){
		var NavDiv=get_lastChild(NavList[i]);
		if(NavList[i].className.indexOf("Disease")!==1){
			NavDiv.onmouseover=function(){
				this.style.border="#fc8c2a 1px solid";
				this.style.borderTop="#fc8c2a 2px solid";
				this.style.backgroundColor="#fff1d1";
			}
				NavDiv.onmouseout=function(){
				this.style.border="#fff 1px solid";
				this.style.borderTop="#fff 2px solid";
				this.style.backgroundColor="";
			}
		}
				
		if(NavList[i].className.indexOf("Disease")!=-1) continue;
			
		NavDiv.onmouseover=function()
		{
		//alert (this.nodeName)
		this.style.borderTop="#fc8c2a 2px solid";
		this.style.borderBottom="#fc8c2a 1px solid";
		this.style.borderLeft=this.style.borderBottom;
		this.style.position="relative";
		this.style.backgroundColor="#fff1d1";
		var hiddenBox=get_lastChild(this);
		hiddenBox.style.position="absolute";
		hiddenBox.style.zIndex="1000";
		hiddenBox.style.left="197px";
		hiddenBox.style.top="-2px";
		hiddenBox.style.display="block";
		hiddenBox.style.border="#fc8c2a 1px solid";
		hiddenBox.style.borderTop="#fc8c2a 2px solid";
		}
		NavDiv.onmouseout=function()
		{

		this.style.borderTop="#fff 2px solid";
		this.style.borderBottom="#fff 1px solid";
		this.style.borderLeft=this.style.borderBottom;
		this.style.position="relative";
		this.style.backgroundColor="";
		var hiddenBox=get_lastChild(this);
		hiddenBox.style.display="none";
		}
		
	}
}
function get_lastChild(n){
	var x=n.lastChild;
	while(x.nodeType!=1){
	 x=x.previousSibling;
	}
	return x;
}

function woyao(){
	var woyao=$("woyao");
	var woda=$("woda");
	woyao.onmouseover=function(){
		this.style.cursor="pointer";
		this.style.background="url(2009images/home/new_ask001.gif) left top no-repeat"
		}
	woyao.onmouseout=function(){
		this.style.background="url(2009images/home/new_ask.gif) left top no-repeat"

		}
	woyao.onclick=function(){
		window.open("2009ask.asp","_blank")
		//window.location
		}
		
	woda.onmouseover=function(){
		this.style.cursor="pointer";
		this.style.background="url(2009images/home/new_da001.gif) left top no-repeat"
		}
	woda.onmouseout=function(){
		this.style.background="url(2009images/home/new_da.gif) left top no-repeat"

		}		
		
	woda.onclick=function(){
		window.open("2009unsettle.asp","_blank")
		}		
}

function tabDiv(obj,num,len,cn){
	var cssname=cn;
	for(var id = 1;id<=len;id++){
		var ss = obj+id;
		var snav = obj+"nav"+id;
		var More = obj+"link";
		var BoxDiv = document.getElementById(ss);
		var ClassDiv = document.getElementById(snav);
		var MoreLink = document.getElementById(More);
		if(id == num){
			try {BoxDiv.style.display="block";	ClassDiv.className=cssname; MoreLink.href=ClassDiv.childNodes[0].href;}catch(e){};
		}else{
			try {BoxDiv.style.display="none"; ClassDiv.className="";}catch(e){};
		}
	}
}

//¡Á?D??¨®¨¨?¨°??o1??¡¥
function startmarquee(lh,speed,delay,index){ 
	var t; 
	var p=false; 
	var o=$("marqueebox"+index); 
	o.innerHTML+=o.innerHTML; 
	o.onmouseover=function(){p=true} 
	o.onmouseout=function(){p=false} 
	o.scrollTop = 0; 
	function start(){ 
		t=setInterval(scrolling,speed); 
		if(!p) o.scrollTop += 1; 
	} 
	function scrolling(){ 
		if(o.scrollTop%lh!=0){ 
			o.scrollTop += 1; 
			if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0; 
		}else{ 
			clearInterval(t); 
			setTimeout(start,delay); 
		} 
	} 
	setTimeout(start,delay); 
} 
//startmarquee(56,30,3000,0); 

// ¨°?¨¦¨²¨ª???1??¡¥

addLoadEvent(Slider.init);


// JavaScript Document ?¨²??¨°?¨¦¨²¨ºy
var indexMain = function(){
	this.initial.apply(this,arguments);
}
indexMain.prototype = {
	initial : function(frameId,textareaId,boderDiv,isGG){
		this.setOnlineNum();
	},
	$ : function(id){
		return document.getElementById(id);
	},
	setOnlineNum : function(){
		var numY;
		var numP;
		var D = new Date();
		hours = D.getHours();
		switch(hours){
			case 0:
			numP = 90300;	
			numY = 5000;
			break;
			case 1:
			numP = 35100;	
			numY = 2500;
			break;
			case 2:
			numP = 18300;	
			numY = 1600;
			break;
			case 3:
			numP = 18300;	
			numY = 1600; 
			break;
			case 4:
			numP = 11700;	
			numY = 900; 
			break;
			case 5:
			numP = 12000;	
			numY = 900; 
			break;
			case 6:
			numP = 30900;	
			numY = 2500;
			break;
			case 7:
			numP = 36900;	
			numY = 2800;
			break;
			case 8:
			numP = 76200;	
			numY = 6500;
			break;
			case 9:
			numP = 102000;	
			numY = 7500;
			break;
			case 10:
			numP = 110100;	
			numY = 8000;
			break;
			case 11:
			numP = 154800;	
			numY = 10000;
			break;
			case 12:
			numP = 120300;	
			numY = 9000;
			break;
			case 13:
			numP = 96900;	
			numY = 8200; 
			break;
			case 14:
			numP = 120000;	
			numY = 9500; 
			break;
			case 15:
			numP = 128400;	
			numY = 10000; 
			break;
			case 16:
			numP = 157500;	
			numY = 12000; 
			break;
			case 17:
			numP = 126300;	
			numY = 11000; 
			break;
			case 18:
			numP = 96900;	
			numY = 8000;
			break;
			case 19:
			numP = 105000;	
			numY = 8000; 
			break;
			case 20:
			numP = 117900;	
			numY = 9000; 
			break;
			case 21:
			numP = 160500;	
			numY = 11000; 
			break;
			case 22:
			numP = 121500;	
			numY = 9000; 
			break;
			case 23:
			numP = 94500;	
			numY = 6000; 
			break;
			default:
			num = 0
			break;
		}
		this.$("doctorOnlineNum").innerHTML=numY+parseInt(100*Math.random());
		//this.$("userOnlineNum").innerHTML=numP+parseInt(Math.random()*1000);
	}
}

var indexObj = new indexMain();