<!--
window.status="网站管理系统";

// 校验数字
function isNum(argvalue) {
	argvalue = argvalue.toString();

	if (argvalue.length == 0) { return false; }

	for (var n = 0; n < argvalue.length; n++) {
	  if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9") { return false; }
	}
	return true;
}
// 校验email
function isValidEmail(argValue) {
	argValue = argValue.toString();
	if (argValue.match("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,3}$") == null)
	{
		return false;
	}
	return true;
}
//  Pop Sheet Window
function popImg(strImage) {
	strImage = "../../common/details/dtl_img.php3?ci_id=" + strImage;
	window.open(strImage,'img','left=40,top=40,width=400,height=500,resizable=yes,scrollbars=yes');
}
//  Pop Sheet Window
function popSheet(strURL) {
	window.open(strURL,'view','left=20,top=20,width=400,height=450,resizable=yes,scrollbars=yes');
}

//  pop-up a new sheet window
function popNewSheet(strURL,width,height) {
	if (width == null)
		width = 550;
	if (height == null)
		height = 500;
	WinParam = "left=" + ((screen.width-width)/2) + ",top=" + ((screen.height-height)/2) + ",width=" + width + ",height=" + height + ",resizable=yes,scrollbars=yes";
	window.open(strURL,'newSheet',WinParam);
}
/*
function popNewSheet(strURL,width,height) {
	if (width == null)
		width = 550;
	if (height == null)
		height = 500;
	WinParam = "fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";
	var newSheetWindow = window.open(strURL,'newSheet',WinParam,true);
	var windowX = Math.ceil( (window.screen.width  - width) / 2 );
	var windowY = Math.ceil( (window.screen.height - height) / 2 );
	newSheetWindow.resizeTo(width,height)
	newSheetWindow.moveTo(windowX,windowY)
}
*/

//  Pop Alert Window
function popAlert(strAlert){
	strAlert ="Please save this sheet, then press this button!";
	window.alert(strAlert);
	return false;
}
//  Pop Alert Window
function popSaveAs(strSaveAs){
	strSaveAs ="Do you want to save as this sheet?";
	return window.confirm(strSaveAs);
}
//  Pop Alert Window
function popRollbackConf(strRollbackConf){
	strRollbackConf ="This sheet has been confirmed already! \n\n Now it rollbacked!";
	return window.alert(strRollbackConf);
}
//  Pop-up Alert Window
function popRollbackDel(strRollbackDel){
	strRollbackDel ="This sheet has been deleted already! \n\n Now it rollbacked!";
	return window.alert(strRollbackDel);
}

function popListbox(strURL,width,height) {
	if (width == null)
		width = 550;
	if (height == null)
		height = 500;
	WinParam = "fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";
	var newSheetWindow = window.open(strURL,'newSheet',WinParam,true);
	var windowX = Math.ceil( (window.screen.width  - width) / 2 );
	var windowY = Math.ceil( (window.screen.height - height) / 2 );
	newSheetWindow.resizeTo(width,height)
	newSheetWindow.moveTo(windowX,windowY)
	
}

/* 标准删除, 编辑, 增加动作*/
function GetOneSelectedID(objForm) {
	for (i=0; i<objForm.elements.length; i++) {
		if (objForm.elements[i].type != "checkbox") continue;
		if (objForm.elements[i].checked) return objForm.elements[i].value;
	}
}
function newItem(url,width,height) {	popNewSheet(url,width,height); }
function editItem(url,width,height) {	popNewSheet(url,width,height); }
function deleteItem(objForm) {
	objForm.action.value = 'delete';
	return confirm("确实要删除吗？");
}
function Checked(objForm) {
	CheckedCount = 0;
	for (i=0; i<objForm.elements.length; i++) {
		if (objForm.elements[i].type != "checkbox") continue;
		if (objForm.elements[i].checked) CheckedCount++;
	}
	if (CheckedCount == 0) {
		if( objForm.btndel != null ) { objForm.btndel.disabled = true; }
		if( objForm.btnedt != null ) { objForm.btnedt.disabled = true; }
	} else {
		if( objForm.btndel != null ) { objForm.btndel.disabled = false; }
		if( objForm.btnedt != null ) { objForm.btnedt.disabled = CheckedCount==1 ? false : true; }
	}
	return false;
}
function CheckSubmit(objForm) {			return deleteItem(objForm) ? true : false; }

/* 标准关闭动作 */
function ClosePopupWin() {
	opener.location.replace(opener.location);
	window.close();
}

//-->