
function menuFix() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onMouseDown=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onMouseUp=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onmouseout=function() {
		this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), 

"");
		}
	}
}
window.onload=menuFix;


function confirmAndOpen(msg, url, open) {
  if (!msg || !url) {
    alert("都是空的，没法办啊！");
    return false;
  }
  var ua = navigator.userAgent.toLowerCase();  //获取用户端信息
  var info = {
    ie: /msie/.test(ua) && !/opera/.test(ua),    //匹配IE浏览器
    op: /opera/.test(ua),   //匹配Opera浏览器
    sa: /version.*safari/.test(ua),   //匹配Safari浏览器
    ch: /chrome/.test(ua),   //匹配Chrome浏览器
    ff: /gecko/.test(ua) && !/webkit/.test(ua)   //匹配Firefox浏览器
  };
  var ie = info.ie;
  var ver = false;
  if (ie) {
    var b = ua.indexOf("msie"); //检测特殊字符串"MSIE "的位置
    if (b > 0) {
      b += 5;
      ver = (parseFloat(ua.substring(b, ua.indexOf(";", b))) >= 7);
    }
  }
  var goon = false;
  if (!ver) {
    goon = confirm(msg);
  }
  if (!ie || ver || goon) {
    if (open) {
      window.open(url);
    } else {
      window.location = url;
    }
  }
  return true;
}


