
// 弹出选择颜色对话框，只能用于后台页面调用。
function openSelColorDialog(color) {
	var url = "eWebEditor/Dialog/selcolor.htm";
	returnStr = window.showModalDialog(url,'','dialogWidth:230pt;dialogHeight:190pt;help:no;status:no;scroll:no');
	if (returnStr != undefined) {
		color.value = returnStr;
	}
}

/*
 * 提示用户正在处理的浮动窗口
 * author: 刘宏杰
 * date: 06-12-04
 */
document.writeln('<iframe id=ProcessingLayer frameborder=0 style="z-index: 10000; position: absolute; width: 100%; height: 100%; FILTER: alpha(opacity=80); display: none;"></iframe>');
//主程序
function PCSMain(left, top){
	var PCSStyle = window.document.all.ProcessingLayer.style;
	if (!left || !top) {
		PCSStyle.height = document.body.scrollHeight;
		PCS(document.body.clientWidth/2-150,document.body.clientHeight/2-100);
	} else {
		PCS(left, top);
	}
	PCSStyle.display = "";
}
function PCS(left,top){
	var PCSFrame = '<html><head><scr' + 'ipt>';
	PCSFrame += '</scr' + 'ipt></head><body>';
	PCSFrame += '<div style="z-index:10001; position: absolute; left:'+left+'; top:'+top+';"><TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD bgcolor=#ff9900><TABLE WIDTH=100% height=70 BORDER=0 CELLSPACING=2 CELLPADDING=0><TR><td bgcolor=#eeeeee align=center>正在处理, 请稍候……</td></tr></table></td></tr></table></div><body></html>';
	window.frames.ProcessingLayer.document.writeln(PCSFrame);
	//PCSMoveto(left,top);
}
function PCSMoveto(left,top){
	PCSStyle.left = left;
	PCSStyle.top = top;
}
function PCSClose(){		//关闭提示用户正在处理的浮动窗口
    var PCSStyle = window.document.all.ProcessingLayer.style;
	PCSStyle.display = "none";
}

// 跳转到指定的URL
function gotourl(url) {
	PCSMain();
	window.location.href = url;
}

// 全选或取消所有的多选框
function checkAll(form){
	for (var i=0; i<form.elements.length; i++)
	{
		var e = form.elements[i];
		if (e.name == "chkID[]")
			e.checked = form.chkall.checked;
	}
}

// 显示隐藏Layer
function showHideLayer(layer, show) {
	var obj = document.getElementById(layer);
	if (obj != null) {
		if (show == 'show')	{
			obj.style.visibility = 'visible';
		} else if (show == 'hide') {
			obj.style.visibility = 'hidden';
		}
	}
}

// 判断是否进行删除操作
function isDelete(url) {
	if (confirm('确定要删除吗!')) {
		gotourl(url);
	}
}
function isDeleteAll() {
	if (confirm('您确定要删除您所选的吗?')) {
		PCSMain();
		return true;
	} else {
		return false;
	}
}

function openWindow(url,width,height){
	window.open(url,'','width='+width+',height='+height+'');
}

function showSubMenu(num){
	menu = eval("subMenu"+num);
	if (menu.style.display == "none")
		menu.style.display = "";
	else
		menu.style.display = "none";
}


function openLinkUrl(url){
	location.href = url;
}
