function setTab(name,cursel,n,fun){
	for(i=1;i<=n;i++){
		var menu=document.getElementById(name+i);
		var con=document.getElementById("con_"+name+"_"+i);
		menu.className=i==cursel?"hover":"";
		if(con!=null){
			con.style.display=i==cursel?"block":"none";
		}	
	}
	if(fun!=''&&fun!=undefined){
		var exfun=eval(fun);
	}
}
function CloseWindow(obj){
	var element=document.getElementById(obj);
	element.style.display="none";
}
function oMove(obj)   
{   
    var otop,oleft;   
    tag_1=true;   
    otop = event.y - obj.offsetTop;   
    oleft = event.x - obj.offsetLeft;   
    obj.setCapture(); 
    obj.onmousemove = function(){   
    if(tag_1){   
		  obj.style.left = event.x - oleft;   
		  obj.style.top = event.y - otop;   
    }   
    }   
    obj.onmouseup = function(){   
       obj.onmouseup = null;   
       obj.style.filter = null;   
       tag_1=false;   
       obj.releaseCapture();   
    }   
}
//判断浏览器是否为IE
function isIE(){
      return (document.all && window.ActiveXObject && !window.opera) ? true : false;
} 
//取得页面的高宽
function getBodySize(){
   var bodySize = [];
   with(document.documentElement) {
    bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;//如果滚动条的宽度大于页面的宽度，取得滚动条的宽度，否则取页面宽度
    bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;//如果滚动条的高度大于页面的高度，取得滚动条的高度，否则取高度
   }
   return bodySize;
}
//创建遮盖层
function PopCoverDiv(){
   if (GetElement("cover_div")) {
   //如果存在遮盖层，则让其显示 
    GetElement("cover_div").style.display = 'block';
   } else {
   //否则创建遮盖层
    var coverDiv = MC('div');
    document.body.appendChild(coverDiv);
    coverDiv.id = 'cover_div';
    with(coverDiv.style) {
     position = 'absolute';
     background = '#CCCCCC';
     left = '0px';
     top = '0px';
     var bodySize = getBodySize();
     width = bodySize[0] + 'px'
     height = bodySize[1] + 'px';
     zIndex = 1;
     if (isIE()) {
      filter = "Alpha(Opacity=60)";//IE逆境
     } else {
      opacity = 0.6;
     }
    }
   }
}
//清除遮盖层
function ClearCoverDiv(){
  // document.documentElement.style.overflow='auto';//显示滚动条
   //document.oncontextmenu=new Function("event.returnValue=true;");
	//document.onselectstart=new Function("event.returnValue=true;");
   if (GetElement("cover_div")) {
   //如果存在遮盖层，则让其隐藏 
    GetElement("cover_div").style.display = 'none';
   }
}
function GetElement(id){
    return document.getElementById(id);//用M()方法代替document.getElementById(id)
}
function MC(t){
   return document.createElement(t);//用MC()方法代替document.createElement(t)
};
