// JavaScript Document
        var Browsername;
        var Browsertype;
        var Sys = {};
        var ua = navigator.userAgent.toLowerCase();
        var s;
        (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
        (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
        (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
        (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
        (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;

        //以下进行测试
        if (Sys.ie) {Browsername='IE';Browsertype=Sys.ie;}
        if (Sys.firefox) {Browsername='Firefox';Browsertype=Sys.firefox;}
        if (Sys.chrome) {Browsername='Chrome';Browsertype=Sys.chrome;}
        if (Sys.opera) {Browsername='Opera';Browsertype=Sys.opera;}
        if (Sys.safari) {Browsername='Safari';Browsertype=Sys.safari;}


function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function menuhover(menuobj) {
	var links = menuobj.getElementsByTagName("a");
	for(i=0; i<links.length; i++) {
		if(window.location.href==links[i].href) {
		    links[i].className = 'here';
		} else {
			links[i].className = '';
		}
		links[i].onmouseover = function() {
			for(j=0; j<links.length; j++) {
				links[j].className = '';
			}
			this.className = 'here_now';
		}
		links[i].onmouseout = function() {
			for(j=0; j<links.length; j++) {
				links[j].className = '';
				if(window.location.href==links[j].href){links[j].className = 'here';}
			}
	}
	}
}

function topmenu () {
	if(!document.getElementById("menu")) return false;
	var menuobj = document.getElementById("menu");
	menuhover(menuobj);
}
addLoadEvent(topmenu);

