

function fPopUpCalendarDlg(ctrlobj)
{
	showx = event.screenX - event.offsetX - 4 - 210 ; // + deltaX;
	showy = event.screenY - event.offsetY + 18; // + deltaY;
	newWINwidth = 210 + 4 + 18;
	retval = window.showModalDialog("popcalendar.htm", "", "dialogWidth:197px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );
	if( retval != null )
	{
		ctrlobj.focus();
		ctrlobj.value = retval;
	}
}

		function setAge(birobj,ageobj)
		{
			var year = birobj.value.substring(0,4);
			var dNow = new Date();
			var age = dNow.getFullYear() - parseInt(year);
			ageobj.value = "" + age;
		}
	
				function isZipCode(src)
				{
					isZipCode1=/^[1-9]\d{5}$/;
					return(isZipCode1.test(src));
				}
			
				function isMoney(src)
				{
					isMoney1=/^[-\+]?\d+$/;
					isMoney2=/^[-\+]?\d+(\.\d+)?$/;
					return(isMoney1.test(src)||isMoney2.test(src));
				//	isMoney1 =/^\d{1,10}\.\d{0,2}$/;
				//	return(isMoney1.test(src));
				}
			
				function isTelephone(src)
				{
					isTelephone1=/^(\+\d+ )?(\(\d+\) )?[\d ]+$/;
					return(isTelephone1.test(src));
				}
				
				function isFacsimile(src)
				{
					isFacsimile1=/^(\+\d+ )?(\(\d+\) )?[\d ]+$/;
					return(isFacsimile1.test(src));
				}
				
				function isAge(src)
				{
					isAge1=/^(1[0-2]\d|\d{1,2})$/;
					return(isAge1.test(src));
				}
				
				function  isInteger(src)
				{	
			//		isInteger1=/^\d+$";
					isInteger1=/^\d+$/;
					return(isInteger1.test(src));
				}
				
				function isEmail(src)
				{
					isEmail1=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
					return(isEmail1.test(src));
				}
				
				function isMobile(src)
				{
					isMobile1=/^((\(\d{2,3}\))|(\d{3}\-))?13\d{9}$/;
				//	isMobile1=/^(86)*0*13\d{9}/;
					return(isMobile1.test(src));
				}
				
				function isFloat(src)
				{
				/*	isFloat1=/^\\d+(\\.\\d+)?$/;
					return(isFloat1.test(src));*/
					isFloat1=/^[-\+]?\d+$/;
					isFloat2=/^[-\+]?\d+(\.\d+)?$/;
					return(isFloat1.test(src)||isFloat2.test(src));
				}
				
				//检查DataGrid中是否有选中
				function CheckChk()
				{
					var chks = document.getElementsByTagName("input");
					for(var i = 0;i<chks.length;i++)
					{
						if(chks[i].type == 'checkbox')
						{
							if(chks[i].id.indexOf('chk')>-1)
							{
								if(chks[i].checked == true)
								{
									return true;
								}
							}
						}
					}
					return false;
				}
		
	
	
function OpenNewPage(Url)
{
	window.open(Url,'','scrollbars=yes,width='+810+',height='+505+',top='+(screen.height-460)/2+',left='+(screen.width-750)/2);
		
}
				function isTelephone(src)
				{
					isTelephone1=/^(\+\d+ )?(\(\d+\) )?[\d ]+$/;
				    isTelephone2=/^\d{0}$/;
					return(isTelephone1.test(src)||isTelephone2.test(src));
				}
				function isStaffNum(src)
				{
					isStaffNum1=/^(\+\d+ )?(\(\d+\) )?[\d ]+$/;
				    isStaffNum2=/^\d{0}$/;
					return(isStaffNum1.test(src)||isStaffNum2.test(src));
				}
				
				function isSalesNum(src)
				{
					isSalesNum1=/^(\+\d+ )?(\(\d+\) )?[\d ]+$/;
				    isSalesNum2=/^\d{0}$/;
					return(isSalesNum1.test(src)||isSalesNum2.test(src));
				}
				
				function isZipCode(src)
				{
					isZipCode1=/^\d{0}$/;
					isZipCode2=/^\d{6}$/;
					return(isZipCode1.test(src)||isZipCode2.test(src));			
				
				}
				function isRegisterDate(src)
				{
					isRegisterDate1=/^\d{0}$/;
					isRegisterDate2=/^(\d{4}-((0[1-9]{1})|(1[0-2]{1}))-((0[1-9]{1})|([1-2]{1}[0-9]{1})|(3[0-1]{1}))){1}(\s\d{2}:\d{2}:\d{2})?$/;
					return(isRegisterDate1.test(src)||isRegisterDate2.test(src));
				}
				function isCancelsDate(src)
				{
					isCancelsDate1=/^\d{0}$/;
					isCancelsDate2=/^(\d{4}-((0[1-9]{1})|(1[0-2]{1}))-((0[1-9]{1})|([1-2]{1}[0-9]{1})|(3[0-1]{1}))){1}(\s\d{2}:\d{2}:\d{2})?$/;
					return(isCancelsDate1.test(src)||isCancelsDate2.test(src));
				}
				function isRegisterCapital(src)
				{
				    isRegisterCapital1=/^(\+\d+ )?(\(\d+\) )?[\d ]+$/;
				    isRegisterCapital2=/^(\+\d+ )?(\(\d+\) )?[\d ]+.\d{2}$/;
				    isRegisterCapital3=/^\d{0}$/;
				    return(isRegisterCapital1.test(src)||isRegisterCapital2.test(src)||isRegisterCapital3.test(src));
				}
				function isBusinessArea(src)
				{
				    isBusinessArea1=/^(\+\d+ )?(\(\d+\) )?[\d ]+$/;
				    isBusinessArea2=/^(\+\d+ )?(\(\d+\) )?[\d ]+.\d{2}$/;
				    isBusinessArea3=/^\d{0}$/;
				    return(isBusinessArea1.test(src)||isBusinessArea2.test(src)||isBusinessArea3.test(src));
				}
				function isIDCode(src)
				{
					
					isIDCode1=/^\d{0}$/;
					isIDCode2=/^\d{15}$/;
					isIDCode3=/^\d{18}$/;
					isIDCode4=/^\d{17}x$/;
					
					return(isIDCode1.test(src)||isIDCode2.test(src)||isIDCode3.test(src)||isIDCode4.test(src));
				}
				function isIDCode(src)
				{
					
					isIDCode1=/^\d{0}$/;
					isIDCode2=/^\d{15}$/;
					isIDCode3=/^\d{18}$/;
					isIDCode4=/^\d{17}x$/;
					
					return(isIDCode1.test(src)||isIDCode2.test(src)||isIDCode3.test(src)||isIDCode4.test(src));
				}
function isIDCode(src)
				{
					isIDCode1=/^\d{15}(\d{2}[A-Za-z0-9])?$/;
					return(isIDCode1.test(src));
				}
			
				function isZipCode(src)
				{
					isZipCode1=/^[1-9]\d{5}$/;
					return(isZipCode1.test(src));
				}
			
				function isMoney(src)
				{
					isMoney1=/^[-\+]?\d+$/;
					isMoney2=/^[-\+]?\d+(\.\d+)?$/;
					return(isMoney1.test(src)||isMoney2.test(src));
				//	isMoney1 =/^\d{1,10}\.\d{0,2}$/;
				//	return(isMoney1.test(src));
				}
			
				function isTelephone(src)
				{
					isTelephone1=/^(\+\d+ )?(\(\d+\) )?[\d ]+$/;
					return(isTelephone1.test(src));
				}
				
				function isFacsimile(src)
				{
					isFacsimile1=/^(\+\d+ )?(\(\d+\) )?[\d ]+$/;
					return(isFacsimile1.test(src));
				}
				
				function isAge(src)
				{
					isAge1=/^(1[0-2]\d|\d{1,2})$/;
					return(isAge1.test(src));
				}
				
				function  isInteger(src)
				{	
			//		isInteger1=/^\d+$";
					isInteger1=/^\d+$/;
					return(isInteger1.test(src));
				}
				
				function isEmail(src)
				{
					isEmail1=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
					return(isEmail1.test(src));
				}
				
				function isMobile(src)
				{
					isMobile1=/^((\(\d{2,3}\))|(\d{3}\-))?13\d{9}$/;
				//	isMobile1=/^(86)*0*13\d{9}/;
					return(isMobile1.test(src));
				}
				
				function isFloat(src)
				{
				/*	isFloat1=/^\\d+(\\.\\d+)?$/;
					return(isFloat1.test(src));*/
					isFloat1=/^[-\+]?\d+$/;
					isFloat2=/^[-\+]?\d+(\.\d+)?$/;
					return(isFloat1.test(src)||isFloat2.test(src));
				}
				
				//检查DataGrid中是否有选中
				function CheckChk()
				{
					var chks = document.getElementsByTagName("input");
					for(var i = 0;i<chks.length;i++)
					{
						if(chks[i].type == 'checkbox')
						{
							if(chks[i].id.indexOf('chk')>-1)
							{
								if(chks[i].checked == true)
								{
									return true;
								}
							}
						}
					}
					return false;
				}
			