function chkvalue(strValue)
	{
		var oddnum=new Array(1,3,5,7,8,10,12);
		var evennum=new Array(4,6,9,11);
		var intpos=-1;
		var strtemp="";
		var strtemp1="";
		var intI=true;
		strtemp=strValue;
		if (strtemp!="")
		{
			intpos=strtemp.indexOf("/");
			if (intpos>0) 
			{
				strtemp1=strtemp.substring(0,intpos);
				flag=isNaN(strtemp1)
				if (flag==true)
				{			
					alert("年必須為數值");
					return false;
				}
				var intyear=parseInt(strtemp1,10);
				if (intyear<1911) 
				{	
					alert("年輸入錯誤");
					return false;
				}else
				{
					strtemp=strtemp.substring(intpos+1,strtemp.length);
					intpos=strtemp.indexOf("/");
					if (intpos>0)
					{
						strtemp1=strtemp.substring(0,intpos);
						flag=isNaN(strtemp1)
						if (flag==true)
						{			
							alert("月份必須為數值");
							return false;
						}
						var intmonth=parseInt(strtemp1,10);
						if (intmonth>12)
						{
							alert("月份輸入錯誤");
							return false;
						}else
						{
							if (intmonth==2)
							{
								//intyear+=1911//年度轉為西元年
								intDay1=0
								if ((intyear % 400)==0)
								{
									intDay1=29;
								}else if ((intyear % 100)==0)
								{
									intDay1=28;
								}else if ((intyear % 4)==0)
								{
									intDay1=29;
								}else
								{
									intDay1=28;
								}
								strtemp=strtemp.substring(intpos+1,strtemp.length);
								var intday=parseInt(strtemp,10);
								if (intday>intDay1)
								{
									switch (intDay1)
									{
										case 28:
											alert("二月天數(不為閏年)最多為" + intDay1 + "天");
											return false;
											break;
										case 29:
											alert("二月天數(閏年)最多為" + intDay1 + "天");
											return false;
											break;
									}									
								}				
								
							}else
							{
								for (var i=0;i<oddnum.length;i++)
								{
									if (oddnum[i]==intmonth) 
									{
										intI=false;//為奇數月
										break;
									}
								}
								switch (intI)
								{
									case true:
										strtemp=strtemp.substring(intpos+1,strtemp.length);
										flag=isNaN(strtemp)
										if (flag==true)
										{				
											alert("日期必須為數值");
											return false;
										}
										var intday=parseInt(strtemp,10);
										if (intday>30)
										{
											alert("偶數月天數最多為30天");
											return false;
										}				
										break;
									case false:
										strtemp=strtemp.substring(intpos+1,strtemp.length);
										flag=isNaN(strtemp)
										if (flag==true)
										{				
											alert("日期必須為數值");
											return false;
										}
										var intday=parseInt(strtemp,10);
										if (intday>31)
										{
											alert("奇數月天數最多為31天");
											return false;
										}				
										break;
								}
							}							
						}
					}
					else
					{
						alert("日期輸入錯誤");
						return false;
					}
				}				
			}
			else
			{
				alert("日期輸入錯誤");
				return false;
			}
				
		}
		return true;
	}
/**
*函式名稱：getInputDate(objText)
*函式功能：另開小視窗，顯示萬年曆。
*          該萬年曆可變更，年、月，
*          點選該日，則將該年月日帶入
*          呼叫本函式的位置
*日    期：90/11/14
*/
function getInputDate(objText){


    //messageData.innerText = "使用window.event.client取得滑鼠座標：X=>"+window.event.clientX+"Y=>"+window.event.clientY+"\r\n"+
    //                        "使用window.event.screen取得滑鼠座標：X=>"+window.event.screenX+"Y=>"+window.event.screenY;
    var x=window.event.screenX;
    var y=window.event.screenY;    
 //alert(objText);
    var inCalendar = window.showModalDialog("date/calendar.htm",null,"status=no ; dialogLeft:"+x+"px ; dialogTop:"+y+"px ; dialogWidth:210px ; dialogHeight:190px ;");
    //回傳值設定
    objText.value = inCalendar;
    //focus離開
    objText.blur();
}


//下拉式日期檢查 start
function RecheckDate1 (theform) 
{
	var yy = theform.syear1.value;
	var mm = theform.smonth1.options.selectedIndex;
	var dd = theform.sday1.options.selectedIndex;
	if (theform.smonth1.options[theform.smonth1.options.selectedIndex].text != "")
	{
		days = DaysOfTheMonth (yy, mm);
		end = days -1;
		olddays = theform.sday1.length-1;
		if ( dd > end )
		{
			theform.sday1.options[end].selected = true;
		}

		if ( olddays > days ) 
		{
			/*for (i=days; i<olddays; i++) 
			{
				theform.sday1.options[i] = null;
			}*/
			theform.sday1.length = days+1;
			return 0;
		}

		if (olddays < days) 
		{
			for (i=olddays; i<=days; i++) 
			{
				//theform.sday1.length = days+1;
				theform.sday1.options[i] = new Option (i, i);
				//theform.sday1.options[i] = new Option (i,i);
			}
		}
	}
}

function RecheckDate2 (theform) 
{
	var yy = theform.syear2.value;
	var mm = theform.smonth2.options.selectedIndex;
	var dd = theform.sday2.options.selectedIndex;
	if (theform.smonth2.options[theform.smonth2.options.selectedIndex].text != "")
	{
		days = DaysOfTheMonth (yy, mm);
		end = days -1;
		olddays = theform.sday2.length-1;
		if ( dd > end )
		{
			theform.sday2.options[end].selected = true;
		}

		if ( olddays > days ) 
		{
			/*for (i=days; i<olddays; i++) 
			{
				theform.sday2.options[i] = null;
			}*/
			theform.sday2.length = days+1;
			return 0;
		}

		if (olddays < days) 
		{
			for (i=olddays; i<=days; i++) 
			{
				//theform.sday2.length = days+1;
				theform.sday2.options[i] = new Option (i, i);
				//theform.sday2.options[i] = new Option (i,i);
			}
		}
	}
}

function RecheckDate3 (theform) 
{
	var yy = theform.syear3.value;
	var mm = theform.smonth3.options.selectedIndex;
	var dd = theform.sday3.options.selectedIndex;
	if (theform.smonth3.options[theform.smonth3.options.selectedIndex].text != "")
	{
		days = DaysOfTheMonth (yy, mm);
		end = days -1;
		olddays = theform.sday3.length-1;
		if ( dd > end )
		{
			theform.sday3.options[end].selected = true;
		}

		if ( olddays > days ) 
		{
			/*for (i=days; i<olddays; i++) 
			{
				theform.sday3.options[i] = null;
			}*/
			theform.sday3.length = days+1;
			return 0;
		}

		if (olddays < days) 
		{
			for (i=olddays; i<=days; i++) 
			{
				//theform.sday3.length = days+1;
				theform.sday3.options[i] = new Option (i, i);
				//theform.sday3.options[i] = new Option (i,i);
			}
		}
	}
}

function RecheckDate4 (theform) 
{
	var yy = theform.syear4.value;
	var mm = theform.smonth4.options.selectedIndex;
	var dd = theform.sday4.options.selectedIndex;
	if (theform.smonth2.options[theform.smonth2.options.selectedIndex].text != "")
	{
		days = DaysOfTheMonth (yy, mm);
		end = days -1;
		olddays = theform.sday4.length-1;
		if ( dd > end )
		{
			theform.sday4.options[end].selected = true;
		}

		if ( olddays > days ) 
		{
			/*for (i=days; i<olddays; i++) 
			{
				theform.sday4.options[i] = null;
			}*/
			theform.sday4.length = days+1;
			return 0;
		}

		if (olddays < days) 
		{
			for (i=olddays; i<=days; i++) 
			{
				//theform.sday4.length = days+1;
				theform.sday4.options[i] = new Option (i, i);
				//theform.sday4.options[i] = new Option (i,i);
			}
		}
	}
}

function DaysOfTheMonth (yy, mm)
{
	var monthday = new Array(0,31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
	if ((yy % 4 == 0 && yy % 100 != 0) || yy % 400 == 0)
	{
		monthday[2] = 29;
	}
	return monthday[mm];
}
//日期檢查 end