
function writeTopSpace()
{
	document.write("<TABLE border='0' cellspacing='0' cellpadding='0' width='100%'><TR><TD height='5'></TD></TR></TABLE>");
}

function writeSearchForm(strUrl)
{
	document.write("<TABLE border='0' cellspacing='0' cellpadding='0'>");
	document.write("<FORM METHOD='POST' NAME='frmWhere' ACTION='"+strUrl+"?IsFirstSearch=1'><INPUT TYPE='hidden' NAME='WhereSql'></FORM>");
	document.write("<TR><TD></TD></TR></TABLE>");
}

function onSearchData(strSearchUrl,lngHeight,lngWidth)
{
		var dte=new Date();
		var strResult=showModalDialog(strSearchUrl+"?dte="+dte.getTime(),0,"dialogHeight:"+lngHeight+"px;dialogWidth:"+lngWidth+"px;status=no");
		if(strResult==null){
			return;
		}
		frmWhere.elements(0).value=strResult;
		frmWhere.submit();
}

function trim(strValue)
{
	var intStart=0;
	for(var i=0;i<strValue.length;i++)
	{
		if(strValue.substring(i,i+1)!=" "){
			intStart=i;
			break;
		}
	}
	var intEnd=strValue.length;
	for(var i=strValue.length;i>=0;i--)
	{
		if(strValue.substring(i-1,i)!=" "){
			intEnd=i;
			break;
		}
	}
	return strValue.substring(intStart,intEnd);
}

function getFindCount(strSource,strFind)
{
	var s=strSource.split(strFind);
	return s.length-1;
}

function getStringLength(strValue)
{
	var k=0;
	for(var i=0;i<strValue.length;i++){
		if(strValue.charCodeAt(i)>=0 && strValue.charCodeAt(i)<=255){
			k=k+1;
		}
		else{
			k=k+2;
		}
	}
	return k;
}

function isInt(strValue)
{
	if(strValue.substring(0,1)=="+" || strValue.substring(0,1)=="-"){
		strValue=strValue.substr(1);
	}
	if(strValue.length==0){
		return false;
	}
	for(var i=0;i<strValue.length;i++){
		if(strValue.charCodeAt(i)<48 || strValue.charCodeAt(i)>57){
			return false;
		}
	}
	return true;
}

function isEmail(intstr) { //v3.0
    if ((intstr.indexOf("@")<0)){ //是否在0-9之间
        return false;
      }
 return true;
	}
	

function isDouble(strValue)
{
	if(strValue.substring(0,1)=="+" || strValue.substring(0,1)=="-"){
		strValue=strValue.substr(1);
	}
	if(strValue.length==0){
		return false;
	}
	if(getFindCount(strValue,".")>1){
		return false;
	}
	if(strValue.substring(0,1)=="." || strValue.substring(strValue.length-1,strValue.length)=="."){
		return false;
	}
	for(var i=0;i<strValue.length;i++){
		var code=strValue.charCodeAt(i);
		if(code==46 || (code>=48 && code<=57)){}
		else{
			return false;
		}
	}
	return true;
}

function replace(strSource,strFind,strNew)
{
	while(strSource.indexOf(strFind,0)>=0){
		strSource=strSource.replace(strFind,strNew);
	}
	return strSource;
}

//,=44 '=39 "=34 >=62 <=60 & 38 ?
function replaceErrChar(strValue)
{
	strValue=replace(strValue,",","，");
	strValue=replace(strValue,"'","’");
	strValue=replace(strValue,"\"","”");
	strValue=replace(strValue,">","］");
	strValue=replace(strValue,"<","［");
	strValue=replace(strValue,"&","＋");
	strValue=replace(strValue,"?","？");
	return strValue;
}

//,=44 '=39 "=34 >=62 <=60 & 38 ?
function replaceHtmlErrChar(strValue)
{
	strValue=replace(strValue,"'","’");
	strValue=replace(strValue,"\"","”");
	strValue=replace(strValue,">","］");
	strValue=replace(strValue,"<","［");
	return strValue;
}

//yyyy-mm-dd
function isShortDate(strValue)
{
	if(strValue.length!=10){
		return false;
	}
	if(strValue.substring(4,5)!="-"){
		return false;
	}
	if(strValue.substring(7,8)!="-"){
		return false;
	}
	var strYear=strValue.substring(0,4);
	var strMonth=strValue.substring(5,7);
	var strDay=strValue.substring(8,10);
	if(isInt(strYear)==false){
		return false;
	}
	if(isInt(strMonth)==false){
		return false;
	}
	if(isInt(strDay)==false){
		return false;
	}
	if(strYear<1900 || strYear>2050){
		return false;
	}
	if(strMonth<1 || strMonth>12){
		return false;
	}
	if(strDay<1 || strDay>31){
		return false;
	}
	return true;
}

function isTel(intstr) { //v3.0
 var theMark='0123456789-';
 for (var i=0;i<=intstr.length-1;i++)
   {
    var onechar;
    onechar=intstr.substring(i,i+1);
     if ((theMark.indexOf(onechar)==-1)){ //是否在0-9之间
        return false;
     }
   }
 return true;
	}

//12:23:12
function isTime(strValue)
{
	if(strValue.length!=8){
		return false;
	}
	if(strValue.substring(2,3)!=":"){
		return false;
	}
	if(strValue.substring(5,6)!=":"){
		return false;
	}
	var strHour=strValue.substring(0,2);
	var strMin=strValue.substring(3,5);
	var strSen=strValue.substring(6,8);
	if(isInt(strHour)==false){
		return false;
	}
	if(isInt(strMin)==false){
		return false;
	}
	if(isInt(strSen)==false){
		return false;
	}
	if(strHour<0 || strHour>23){
		return false;
	}
	if(strMin<0 || strMin>59){
		return false;
	}
	if(strSen<0 || strSen>59){
		return false;
	}
	return true;
}

//yyyy-mm-dd hh:mm:ss
function isLongDate(strValue)
{
	if(strValue.length!=19){
		return false;
	}	
	if(isShortDate(strValue.substring(0,10))==false){
		return false;
	}
	if(isTime(strValue.substring(11,19))==false){
		return false;
	}
	return true;
}

function focus(ctlText,strInfo)
{
	alert(strInfo);
	if(ctlText.disabled==true){
		return
	}
	ctlText.focus();
	ctlText.select();	
}


function formOnSubmit(frmForm)
{
	for(var i=0;i<frmForm.elements.length;i++){
		var ctl=frmForm.elements[i];
		if(ctl.getAttribute("IsTime")!=null){
			if(isShortDate(ctl.value)==false && isLongDate(ctl.value)==false){
				alert("时间必须不能为空");
				return false;
			}
		}
		//
		if(ctl.getAttribute("type").toUpperCase()=="TEXT" || ctl.getAttribute("type").toUpperCase()=="PASSWORD" || ctl.getAttribute("type").toUpperCase()=="FILE"|| ctl.tagName=="TEXTAREA" )
			{
			var strInfo=ctl.getAttribute("Info");
			ctl.value=trim(ctl.value);
			
			if(ctl.getAttribute("IsHtml")=="1"){
				//ctl.value=replaceHtmlErrChar(ctl.value);
			}
			else{
				//ctl.value=replaceErrChar(ctl.value);
			}

			if(ctl.getAttribute("NoEmpty")=="1"){
				if(ctl.value==""){
					focus(ctl,strInfo+"不能为空");
					return false;
				}
			}

			if(ctl.value!=""){
				if(ctl.getAttribute("isTel")=="1"){
					if(isTel(ctl.value)==false){
						focus(ctl,strInfo+"应符合电话号码格式");
						return false;
					}
				}				
				if(ctl.getAttribute("IsInt")=="1"){
					if(isInt(ctl.value)==false){
						focus(ctl,strInfo+"应是整数");
						return false;
					}
				}	
				if(ctl.getAttribute("isEmail")=="1"){
					if(isEmail(ctl.value)==false){
						focus(ctl,strInfo+"不是标准邮箱");
						return false;
					}
				}
				

				if(ctl.getAttribute("IsDouble")=="1"){
					if(isDouble(ctl.value)==false){
						focus(ctl,strInfo+"应是小数型数据");
						return false;
					}
				}

				if(ctl.getAttribute("MaxValue")!=null){
					var dblValue=new Number(ctl.value);
					var dblMax=new Number(ctl.getAttribute("MaxValue"));
					if(dblValue>dblMax){
						focus(ctl,strInfo+"不能大于"+ctl.getAttribute("MaxValue"));
						return false;
					}
				}

				if(ctl.getAttribute("MinValue")!=null){
					var dblValue=new Number(ctl.value);
					var dblMin=new Number(ctl.getAttribute("MinValue"));
					if(dblValue<dblMin){
						focus(ctl,strInfo+"不能小于"+ctl.getAttribute("MinValue"));
						return false;
					}
				}

				if(ctl.getAttribute("MaxLen")!=null){
					var dblMaxLen=new Number(ctl.getAttribute("MaxLen"));
					if(getStringLength(ctl.value)>dblMaxLen){
						focus(ctl,strInfo+"字符长度不能超过"+ctl.getAttribute("MaxLen"));
						return false;
					}
				}
				//ADD BY QHY----------------
				if(ctl.getAttribute("MinLen") != null){
					var dblMinLen=new Number(ctl.getAttribute("MinLen"));
					if( getStringLength(ctl.value) < dblMinLen ){
						focus(ctl,strInfo + "字符长度不能低于" + ctl.getAttribute("MinLen"));
						return false;
					}
				}//----------------------------------

				if(ctl.getAttribute("IsShortDate")=="1"){
					if(isShortDate(ctl.value)==false){
						focus(ctl,strInfo+"应是日期型数据（如：2003-04-18）");
						return false;
					}
				}

				if(ctl.getAttribute("IsLongDate")=="1"){
					if(isLongDate(ctl.value)==false){
						focus(ctl,strInfo+"应是日期型数据（如：2003-04-18 12:23:00）");
						return false;
					}
				}
			}

		}
	}
	return true;
}









function CloseFrm()
{
	self.close();
}


function clearText(txtId,txtName)
{
	txtId.value="";
	txtName.value="";
}

function getRadioSelectId(optValue)
{
	for(var i=0;i<optValue.length;i++){
		if(optValue[i].checked==true){
			return i;
		}
	}
	return null;
}

function KeyFilter(type)
{
	var berr=false;
	
	switch(type)
	{
		case 'date':
			if (!(event.keyCode == 45 || event.keyCode == 47 || (event.keyCode>=48 && event.keyCode<=57)))
				berr=true;
			break;
		case 'number':
			if (!(event.keyCode>=48 && event.keyCode<=57))
				berr=true;
			break;
		case 'cy':
			if (!(event.keyCode == 46 || (event.keyCode>=48 && event.keyCode<=57)))
				berr=true;
			break;
		case 'long':
			if (!(event.keyCode == 45 || (event.keyCode>=48 && event.keyCode<=57)))
				berr=true;
			break;
		case 'double':
			if (!(event.keyCode == 45 || event.keyCode == 46 || (event.keyCode>=48 && event.keyCode<=57)))
				berr=true;
			break;
		default:
			if (event.keyCode == 35 || event.keyCode == 37 || event.keyCode==38)
				berr=true;
	}
	return !berr;
}

	function val(strValue)
	{
		return new Number(strValue);
	}

	function onShortDatePickerChange(txtYear,txtMonth,txtDay,txtDate)
	{
		if(txtYear.value==""){
			txtYear.value=(new Date()).getFullYear();
		}
		if(txtMonth.value==""){
			txtMonth.value=(new Date()).getMonth()+1;
		}
		if(txtDay.value==""){
			txtDay.value=(new Date()).getDate();
		}
		var iYear=val(txtYear.value);
		var iMonth=val(txtMonth.value);
		var iDay=val(txtDay.value);

		var dteTime=new Date(iYear,iMonth-1,iDay);
		dteTime.setYear(iYear);
		dteTime.setMonth(iMonth-1);
		dteTime.setDate(iDay);
		txtYear.value=getLongValueForDate(dteTime.getFullYear(),"year");
		txtMonth.value=getLongValueForDate(dteTime.getMonth()+1);
		txtDay.value=getLongValueForDate(dteTime.getDate());
		txtDate.value=txtYear.value+"-"+txtMonth.value+"-"+txtDay.value;
	}

	function onLongDatePickerChange(txtYear,txtMonth,txtDay,txtDate,txtHour,txtMinutes,txtSecond)
	{
		if(txtYear.value==""){
			txtYear.value=(new Date()).getFullYear();
		}
		if(txtMonth.value==""){
			txtMonth.value=(new Date()).getMonth()+1;
		}
		if(txtDay.value==""){
			txtDay.value=(new Date()).getDate();
		}
		if(txtHour.value==""){
			txtHour.value=(new Date()).getHours();
		}
		if(txtMinutes.value==""){
			txtMinutes.value=(new Date()).getMinutes();
		}
		if(txtSecond.value==""){
			txtSecond.value=(new Date()).getSeconds();
		}
		var iYear=val(txtYear.value);
		var iMonth=val(txtMonth.value);
		var iDay=val(txtDay.value);
		var iHour=val(txtHour.value);
		var iMinutes=val(txtMinutes.value);
		var iSecond=val(txtSecond.value);

		var dteTime=new Date(iYear,iMonth-1,iDay,iHour,iMinutes,iSecond);
		dteTime.setYear(iYear);
		dteTime.setMonth(iMonth-1);
		dteTime.setDate(iDay);
		dteTime.setHours(iHour);
		dteTime.setMinutes(iMinutes);
		dteTime.setSeconds(iSecond);
		txtYear.value=getLongValueForDate(dteTime.getFullYear(),"year");
		txtMonth.value=getLongValueForDate(dteTime.getMonth()+1);
		txtDay.value=getLongValueForDate(dteTime.getDate());
		txtHour.value=getLongValueForDate(dteTime.getHours());
		txtMinutes.value=getLongValueForDate(dteTime.getMinutes());
		txtSecond.value=getLongValueForDate(dteTime.getSeconds());
		txtDate.value=txtYear.value+"-"+txtMonth.value+"-"+txtDay.value+" "+txtHour.value+":"+txtMinutes.value+":"+txtSecond.value;
	}

	function getLongValueForDate(iValue,strType)
	{
		if(strType=="year"){
			if(iValue>2050 || iValue<1900){
				return (new Date()).getFullYear();
			}
			else{
				return iValue;
			}
		}
		else{
			if(iValue<10){
				return "0"+iValue;
			}
			else{
				return iValue;
			}
		}
	}

	function getLongSystemTime()
	{
		var iYear=(new Date()).getFullYear();
		var iMonth=(new Date()).getMonth()+1;
		var iDay=(new Date()).getDate();
		var iHour=(new Date()).getHours();
		var iMinutes=(new Date()).getMinutes();
		var iSecond=(new Date()).getSeconds();
        return iYear+"-"+iMonth+"-"+iDay+"-"+iHour+"-"+iMinutes+"-"+iSecond;
	}
	function getShortSystemTime()
	{
		var iYear=(new Date()).getFullYear();
		var iMonth=(new Date()).getMonth()+1;
		var iDay=(new Date()).getDate();
        return iYear+"年"+iMonth+"月"+iDay+"日";
	}

	function createShortDatePicker(strName,strDefault)
	{
		var idYear="createLongDatePicker_Year"+strName;
		var idMonth="createLongDatePicker_Month"+strName;
		var idDay="createLongDatePicker_Day"+strName;
		var idDate="createLongDatePicker_Date"+strName;
		document.write("<span STYLE=\"BORDER-TOP: #7C7C7C solid 1px;BORDER-LEFT: #7C7C7C solid 1px;BORDER-BOTTOM: #FFFFFF solid 1px;BORDER-RIGHT: #FFFFFF solid 1px;width:85;BACKGROUND-color:#FFFFFF;\"><INPUT TYPE=\"text\" ID=\""+idYear+"\" MAXLENGTH=4 STYLE=\"WIDTH:33;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onShortDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+")\" onblur=\"return onShortDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+")\"><B>-</B><INPUT TYPE=\"text\" MAXLENGTH=2 ID=\""+idMonth+"\" STYLE=\"WIDTH:18;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onShortDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+")\" onblur=\"return onShortDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+")\"><B>-</B><INPUT TYPE=\"text\" MAXLENGTH=2 ID=\""+idDay+"\" STYLE=\"WIDTH:18;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onShortDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+")\" onblur=\"return onShortDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+")\"><INPUT ID=\""+idDate+"\" TYPE=\"hidden\" NAME=\""+strName+"\" IsTime=\"1\">");
		var iYear=(new Date()).getFullYear();
		var iMonth=(new Date()).getMonth()+1;
		var iDay=(new Date()).getDate();
		if(strDefault!=null){
			iYear=val(strDefault.substring(0,4));
			iMonth=val(strDefault.substring(5,7));
			iDay=val(strDefault.substring(8,10));
		}
		document.all(idYear).value=iYear;
		document.all(idMonth).value=iMonth;
		document.all(idDay).value=iDay;
		onShortDatePickerChange(document.all(idYear),document.all(idMonth),document.all(idDay),document.all(idDate));
	}

	function createLongDatePicker(strName,strDefault)
	{
		var idYear="createLongDatePicker_Year"+strName;
		var idMonth="createLongDatePicker_Month"+strName;
		var idDay="createLongDatePicker_Day"+strName;
		var idHour="createLongDatePicker_Hour"+strName;
		var idMinutes="createLongDatePicker_Minutes"+strName;
		var idSecond="createLongDatePicker_Second"+strName;
		var idDate="createLongDatePicker_Date"+strName;
		document.write("<span STYLE=\"BORDER-TOP: #7C7C7C solid 1px;BORDER-LEFT: #7C7C7C solid 1px;BORDER-BOTTOM: #FFFFFF solid 1px;BORDER-RIGHT: #FFFFFF solid 1px;width:150;BACKGROUND-color:#FFFFFF;\"><INPUT TYPE=\"text\" ID=\""+idYear+"\" MAXLENGTH=4 STYLE=\"WIDTH:33;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><B>-</B><INPUT TYPE=\"text\" MAXLENGTH=2 ID=\""+idMonth+"\" STYLE=\"WIDTH:18;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><B>-</B><INPUT TYPE=\"text\" MAXLENGTH=2 ID=\""+idDay+"\" STYLE=\"WIDTH:18;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><INPUT TYPE=\"text\" ID=\""+idHour+"\" MAXLENGTH=2 STYLE=\"WIDTH:22;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><B>:</B><INPUT TYPE=\"text\" MAXLENGTH=2 ID=\""+idMinutes+"\" STYLE=\"WIDTH:18;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><B>:</B><INPUT TYPE=\"text\" MAXLENGTH=2 ID=\""+idSecond+"\" STYLE=\"WIDTH:18;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><INPUT ID=\""+idDate+"\" TYPE=\"hidden\" NAME=\""+strName+"\" IsTime=\"1\">");
		var iYear=(new Date()).getFullYear();
		var iMonth=(new Date()).getMonth()+1;
		var iDay=(new Date()).getDate();
		var iHour=(new Date()).getHours();
		var iMinutes=(new Date()).getMinutes();
		var iSecond=(new Date()).getSeconds();
		if(strDefault!=null){
			iYear=val(strDefault.substring(0,4));
			iMonth=val(strDefault.substring(5,7));
			iDay=val(strDefault.substring(8,10));
			iHour=val(strDefault.substring(11,13));
			iMinutes=val(strDefault.substring(14,16));
			iSecond=val(strDefault.substring(17,19));
		}
		document.all(idYear).value=iYear;
		document.all(idMonth).value=iMonth;
		document.all(idDay).value=iDay;
		document.all(idHour).value=iHour;
		document.all(idMinutes).value=iMinutes;
		document.all(idSecond).value=iSecond;
		onLongDatePickerChange(document.all(idYear),document.all(idMonth),document.all(idDay),document.all(idDate),document.all(idHour),document.all(idMinutes),document.all(idSecond));
	}
	
	function createLongDatePicker1(strName,strDefault)
	{
		var idYear="createLongDatePicker_Year"+strName;
		var idMonth="createLongDatePicker_Month"+strName;
		var idDay="createLongDatePicker_Day"+strName;
		var idHour="createLongDatePicker_Hour"+strName;
		var idMinutes="createLongDatePicker_Minutes"+strName;
		var idSecond="createLongDatePicker_Second"+strName;
		var idDate="createLongDatePicker_Date"+strName;
		document.write("<span STYLE=\"BORDER-TOP: #7C7C7C solid 1px;BORDER-LEFT: #7C7C7C solid 1px;BORDER-BOTTOM: #FFFFFF solid 1px;BORDER-RIGHT: #FFFFFF solid 1px;width:150;BACKGROUND-color:#FFFFFF;\"><INPUT TYPE=\"text\" ID=\""+idYear+"\" MAXLENGTH=4 STYLE=\"WIDTH:33;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><B>-</B><INPUT TYPE=\"text\" MAXLENGTH=2 ID=\""+idMonth+"\" STYLE=\"WIDTH:18;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><B>-</B><INPUT TYPE=\"text\" MAXLENGTH=2 ID=\""+idDay+"\" STYLE=\"WIDTH:18;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><INPUT TYPE=\"text\" ID=\""+idHour+"\" MAXLENGTH=2 STYLE=\"WIDTH:22;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><B>:</B><INPUT TYPE=\"text\" MAXLENGTH=2 ID=\""+idMinutes+"\" STYLE=\"WIDTH:18;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><B>:</B><INPUT TYPE=\"text\" MAXLENGTH=2 ID=\""+idSecond+"\" STYLE=\"WIDTH:18;text-align:right;border:0;\" onkeypress=\"return KeyFilter('number');\" onchange=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\" onblur=\"return onLongDatePickerChange("+idYear+","+idMonth+","+idDay+","+idDate+","+idHour+","+idMinutes+","+idSecond+")\"><INPUT ID=\""+idDate+"\" TYPE=\"hidden\" NAME=\""+strName+"\" IsTime=\"1\">");
		var iYear=(new Date()).getFullYear();
		var iMonth=(new Date()).getMonth()+1;
		var iDay=(new Date()).getDate()+1;
		var iHour=(new Date()).getHours();
		var iMinutes=(new Date()).getMinutes();
		var iSecond=(new Date()).getSeconds();
		if(strDefault!=null){
			iYear=val(strDefault.substring(0,4));
			iMonth=val(strDefault.substring(5,7));
			iDay=val(strDefault.substring(8,10));
			iHour=val(strDefault.substring(11,13));
			iMinutes=val(strDefault.substring(14,16));
			iSecond=val(strDefault.substring(17,19));
		}
		document.all(idYear).value=iYear;
		document.all(idMonth).value=iMonth;
		document.all(idDay).value=iDay;
		document.all(idHour).value=iHour;
		document.all(idMinutes).value=iMinutes;
		document.all(idSecond).value=iSecond;
		onLongDatePickerChange(document.all(idYear),document.all(idMonth),document.all(idDay),document.all(idDate),document.all(idHour),document.all(idMinutes),document.all(idSecond));
	}



///////////////////////////////////////// 得到一个对话框


document.write("<LINK href=\"js/datecontrol/DatePicker.css\" type=text/css rel=stylesheet>");
document.write("<SCRIPT language=javascript src=\"js/datecontrol/DateObject.js\"></SCRIPT>");
document.write("<SCRIPT language=javascript src=\"js/datecontrol/DatePicker.js\"></SCRIPT>");
document.write("<SCRIPT language=javascript src=\"js/datecontrol/editlib.js\"></SCRIPT>");
