
function DLG_SelectDate(obj)
{			
	var oldDate = obj.value;		
	var strData = window.showModalDialog("DLG//Calendar/dlg_cal.htm",oldDate,"dialogHeight: 279px; dialogWidth: 330px;edge: Raised; center: Yes; help: no; resizable: no; status: no;");
	if (strData!=-1)
		obj.value=strData;
}
function SelectColor(obj) 
{
	var arr = showModalDialog("DLG/Color/selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0");
	if (arr != null)
		obj.value = arr;		
}
var oldHTML =  "";
var objTxt;
function ShowHtmlEditor2(obj)
{
	oldHTML = obj.value;
	objTxt = obj;
	var feature = "height=500,width=570,left=" + (window.screen.width-500)/2 + ",top=" + (window.screen.height-500)/2 + ",menubar=no,scrollbars=yes";
	window.open("DLG/HtmlEditor/index.htm","HtmlEditor",feature);
}
function GetHtmlValue()
{	
	return oldHTML;
}
function SetHtmlValue(str)
{
	if(objTxt)
	{
		objTxt.value = str;
	}
}
//È«Ñ¡
function SelAllCheck(tabID)
{
	var Tab = document.all(tabID);
	if(Tab == null )
	return;
	var chks = Tab.all.tags("input");
	if(chks == null )
	return;
	if(chks.length)
	{
		for(i=0;i<chks.length;i++)
		{
			if(chks[i].type == "checkbox" )
			{
				chks[i].checked = true;
			}
		}
	}
	else if(chks.type == "checkbox" )
	{
		chks.checked = true;
	}
}
//·´Ñ¡
function btnNotSelAll(TabID)
{
	var Tab = document.all(TabID);
	if(Tab == null )
	return;
	var chks = Tab.all.tags("input");
	if(chks == null )
	return;
	if(chks.length)
	{
		for(i=0;i<chks.length;i++)
		{
			if(chks[i].type == "checkbox")
			{
				chks[i].checked = !chks[i].checked;
			}
		}
	}
	else if(chks.type == "checkbox")
	{
		chks.checked = !chks.checked;	
	}
}
function MyTrim(s) {
    var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
    return (m == null) ? "" : m[1];
}