function ResumeError(){return true;}window.onerror = ResumeError;
var dirMenu;window.onload = function(){dirMenu = new SDMenu("controlPanelDir");dirMenu.init();};
function signinCheck(){if(document.getElementById('aUSERNAME').value == ""){alert('用户名不能为空!'); document.getElementById('aUSERNAME').focus();return false;}if(document.getElementById('aPASSWORD').value == ""){alert('密码不能为空!'); document.getElementById('aPASSWORD').focus();return false;}document.forms['fAdminLogin'].submit();}

function selectAll(obj){
  for(var i = 0;i<obj.elements.length;i++)
   if(obj.elements[i].type == "checkbox")
    obj.elements[i].checked = true;
}
function selectOther(obj){
 for(var i = 0;i<obj.elements.length;i++)
 if(obj.elements[i].type == "checkbox" )
  { 
    if(!obj.elements[i].checked)
  obj.elements[i].checked = true;
  else obj.elements[i].checked = false;
  }
}

function ContentDo(val){
	var id='';var runit=false;
	document.formListInfo.action= '?Action=' +val;
//	for(var i = 0; i < frm.P_ID.length; i++){
//		if(frm.P_ID[i].checked){runit=true;}
//	}
	runit=true;
	if(runit){
		if(val=='DODelete'){
			if(confirm('您确定要删除这些记录吗?\n\n请您务必确认！')){document.formListInfo.submit();}
		}else if(val=='DOUpdate') {
		if(confirm('您确定要移动这些记录吗?\n\n请您务必确认！')){document.formListInfo.submit();} 		
		}else if(val=='Check_true') {
		if(confirm('您确定要推荐这些记录吗?\n\n请您务必确认！')){document.formListInfo.submit();} 		
		}else if(val=='Check_false') {
		if(confirm('您确定要取消这些推荐记录吗?\n\n请您务必确认！')){document.formListInfo.submit();}
		}else if(val=='RefreshTime') {document.formListInfo.submit();}
	}
}


function dodel(){if (confirm("注意：删除一个栏目/分类，其下属的所有子栏目和内容将全部被清空\n\n您确定要进行此操作？")){document.del.submit();}}

function setCopy(_sTxt){try{if(window.clipboardData){window.clipboardData.setData("Text", _sTxt);alert('复制分页标签成功！\n\n您可以将分页标签直接粘贴至需要翻页的内容处。');}else if(window.netscape) {netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);if(!clip) return;var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);if(!trans) return;trans.addDataFlavor('text/unicode');var str = new Object();var len = new Object();var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);var copytext = _sTxt;str.data = copytext;trans.setTransferData("text/unicode", str, copytext.length*2);var clipid = Components.interfaces.nsIClipboard;if (!clip) return false;clip.setData(trans, null, clipid.kGlobalClipboard);}}catch(e){}}

function tabsAdminV0(thisObj,Num){if(thisObj.className == "tabCurrent")return;var tabObj = thisObj.parentNode.id;var tabList = document.getElementById(tabObj).getElementsByTagName("li");for(i=0; i <tabList.length; i++){if (i == Num){thisObj.className = "tabCurrent";document.getElementById(tabObj+"_content"+i).style.display = "block";}else{tabList[i].className = "tabNormal";document.getElementById(tabObj+"_content"+i).style.display = "none";}}}