﻿//welcome
function welcome(){
	var tNow = new Date();
	var iHour = tNow.getHours();
	var sWelcome;
	if(iHour == 23||iHour < 1){sWelcome='午夜';}
	else if(iHour <  6){sWelcome='凌晨';}
	else if(iHour <  8){sWelcome='早晨';}
	else if(iHour < 11){sWelcome='上午';}
	else if(iHour < 13){sWelcome='中午';}
	else if(iHour < 17){sWelcome='下午';}
	else if(iHour < 19){sWelcome='傍晚';}
	else{sWelcome='晚上';}
	sWelcome += '好!';
	document.write(sWelcome);
}

var load2=false;
var load4=false;
var load3=false;
function showDiv(obj,num,len)
{
	//
  var iSetID="i"+obj+num;
  if ( num==2 && !load2){
     try{document.getElementById(iSetID).src="#";
	 }catch(e){};
	 if(obj == 'ntes'){load2=true;}
  }else if ( num==3 && !load3){
     try{document.getElementById(iSetID).src="#"}catch(e){};
     if(obj == 'ntes'){load3=true;}
  }else if ( num==4 && !load4){
     try{document.getElementById(iSetID).src="#"}catch(e){};
      if(obj == 'ntes'){load4=true;}
  }
 for(var id = 1;id<=len;id++)
 {
  var setID=obj+id;
  var setnavID=obj+"nav"+id;
  if(id==num){
  	try{document.getElementById(setID).style.display="block"}catch(e){};
  	try{document.getElementById(setnavID).className="on"}catch(e){};
  }else{
  	try{document.getElementById(setID).style.display="none"}catch(e){};
  	try{document.getElementById(setnavID).className=""}catch(e){};
  }
 }  
}


 barColors = new Array(4);
 //barColors[0] = "#DCDCDC";
 barColors[1] = "red";
 barColors[2] = "orange";
 barColors[3] = "green";
 function DrawBar(level) 
 {
   var bar1 = document.getElementById('levelBar1');
   var bar2 = document.getElementById('levelBar2');
   var bar3 = document.getElementById('levelBar3');
   var fontColor = document.getElementById('levelcolor');
   if (level == 3) 
   {
     //bar1.style.background = barColors[1];
     bar1.className = barColors[1];
     //bar2.style.background = barColors[0];
     //bar3.style.background = barColors[0];
     fontColor.style.color = barColors[1];
   } else if (level == 2) 
   {
     //bar1.style.background = barColors[2];
     bar1.className = barColors[2];
     //bar2.style.background = barColors[2];
     bar2.className = barColors[2];
     //bar3.style.background = barColors[0];
     fontColor.style.color = barColors[2];
   } else if (level == 1)
   {
     //bar1.style.background = barColors[3];
     bar1.className = barColors[3];
     //bar2.style.background = barColors[3];
     bar2.className = barColors[3];
     //bar3.style.background = barColors[3];
     bar3.className = barColors[3];
     fontColor.style.color = barColors[3];
   }
 }