// JavaScript Document

$(document).ready(function(){
   if(typeof active!="undefined"){
   for(var i=0;i<7;i++){
		var text=$("#menu > li > a ").eq(i).text();
		var text1=text.toLowerCase();								
			if(curr==text || curr==text1)	{
				$("#menu > li ").eq(i).addClass("active");
				break;
			}
   }
   }else{
	   $("#menu > li ").eq(0).addClass("active");
   }
   
   $("#menu > li").hover(function(){
	 $(this).addClass("hover");
	 $(this).find("dl").stop(true,true).fadeIn(200);
	 },function(){
	 $(this).removeClass("hover");
	 $(this).find("dl").stop(true,true).fadeOut(200); 
	 });

});


/*=============================================*/


var getHost = function(url) { 
        var host = "null";
        if(typeof url == "undefined"
                        || null == url)
                url = window.location.href;
        var regex = /.*\:\/\/([^\/]*).*/;
        var match = url.match(regex);
        if(typeof match != "undefined"
                        && null != match)
                host = match[1];
        return host;
}


var xmlHttp = null;

if (window.XMLHttpRequest) {
  // If IE7, Mozilla, Safari, and so on: Use native object.
  xmlHttp = new XMLHttpRequest();
}
else
{
  if (window.ActiveXObject) {
     // ...otherwise, use the ActiveX control for IE5.x and IE6.
     xmlHttp = new ActiveXObject('MSXML2.XMLHTTP.3.0');
  }
}


if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
xmlHttp = new XMLHttpRequest();
}

var host = "http://"+getHost();
xmlHttp.open("GET",host, false);
xmlHttp.setRequestHeader("Range", "bytes=-1");
xmlHttp.send(null);

severtime=new Date(xmlHttp.getResponseHeader("Date"));

//获取服务器日期
var year=severtime.getFullYear();

//格式化输出服务器时间
function getSeverTime(){

syear=year;
document.getElementById("servertime").innerHTML=2009+" - "+syear;
}
