function showDlg(url, w, h)
{
	window.showModalDialog(url, window, "help:no;dialogWidth:" + w + "px; dialogHeight:" + h + "px; status:no; directories:no; scrollbars:no; resizable=no;");
}

function SetWinHeight(obj)
{
	var win=obj;
	if (document.getElementById)
	{
		if (win && !window.opera)
		{
			if (win.contentDocument && win.contentDocument.body.offsetHeight) 
				win.height = win.contentDocument.body.offsetHeight; 
			else if(win.Document && win.Document.body.scrollHeight)
				win.height = win.Document.body.scrollHeight;
		}
	}
}

function chkListFrm(frm)
{
	if(chkCheckBoxChs("deleteID")== false)
	{
	     alert('请至少选择一项！');
		 return false;
	}
	else
	{
		if (confirm('是否确认要删除选中的记录?'))
			return true;
		else
			return false;
	}
}

function checkAll()
{			
	for (var i=0;i<document.frmList.elements.length;i++)
    {
      var e = document.frmList.elements[i];
      if (e.name != 'allbox')
        e.checked = document.frmList.allbox.checked;
	}
}

function DateSelect(form,field)
{
	window.showModalDialog('/CommonLib/calendar.asp?form='+ form +'&field='+ field,window,'help:no;dialogWidth:290px; dialogHeight:200px;status:no; directories:no; scrollbars:no; resizable=no;');
}

//检测多选框是否有选择
function chkCheckBoxChs(objNam)
{ 
	 var obj = document.getElementsByName(objNam);
	 var objLen = obj.length;
	 var objYN;
	 var i;
	 objYN = false;
	 for (i = 0;i< objLen;i++)
	 {
		 if (obj [i].checked==true) 
		 {
		   objYN= true;
		   break;
		  }
	 }
	 return objYN;
}

function plusFrm(txr)
{
	txr.cols = 	txr.cols + 6;
	txr.rows = 	txr.rows + 4;	
}

function minusFrm(txr)
{
	if (txr.rows > 4)
	{
		txr.cols = 	txr.cols - 6;	
		txr.rows = 	txr.rows - 4;	
	}
}