//显示/隐藏侧栏
function SideSwitch() {
	if ($(window.parent.document).find("#MainFrame").attr("cols") == "0,*") {
		$(window.parent.document).find("#MainFrame").attr("cols", "180,*");
		$("#SideSwitch").html("<font color='#FFFF00'>隐藏侧栏</font>");
	} else {
		$(window.parent.document).find("#MainFrame").attr("cols", "0,*");
		$("#SideSwitch").html("<font color='#FFFF00'>显示侧栏</font>");
	}
}

//全选
function CheckAll(form) {
         for(var i = 0; i < form.elements.length; i++){
             var e = form.elements[i];
             if(e.Name != "ChkAll" && e.disabled == false)
             e.checked = form.ChkAll.checked;
         }
}

//判断是否选择
function IsCheck(ObjName) {
         var Obj = document.getElementsByName(ObjName); //获取复选框数组
         var ObjLen = Obj.length; //获取数组长度
         var Flag = false; //是否有选择
         for(var i = 0; i < ObjLen; i++){
            if(Obj[i].checked == true){
              Flag = true;
              break;
            }
         }
return Flag;
}

//栏目合并判断
function ConfirmUnite() {
	if ($("#CurrentClassID").attr("value") == $("#TargetClassID").attr("value")) {
		alert("请不要在相同栏目内进行操作！");
		$("#TargetClassID").focus();
		return false;
	}
return true;
}

//弹出新窗口
function POPWin (PageUrl, WinTitle, WinWidth, WinHeight){
    var width = WinWidth, height = WinHeight;
	var left = (screen.width / 2) - width / 2;
	var top = (screen.height / 2) - height / 2;
	
	var StyleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenX=' + left + ',screenY=' + top;
	window.open(PageUrl, WinTitle, StyleStr);
}    