document.writeln("<SCRIPT language=javascript>");
document.writeln("\/\/	written	by Tan Ling	Wee	on 2 Dec 2001");
document.writeln("\/\/	last updated 20 June 2003");
document.writeln("\/\/	email :	fuushikaden@yahoo.com");
document.writeln("");
document.writeln("	var	fixedX = -1			\/\/ x position (-1 if to appear below control)");
document.writeln("	var	fixedY = -1			\/\/ y position (-1 if to appear below control)");
document.writeln("	var startAt = 1			\/\/ 0 - sunday ; 1 - monday");
document.writeln("	var showWeekNumber = 1	\/\/ 0 - don\'t show; 1 - show");
document.writeln("	var showToday = 1		\/\/ 0 - don\'t show; 1 - show");
document.writeln("	var imgDir = \"..\/Image\/\"			\/\/ directory for images ... e.g. var imgDir=\"\/img\/\"");
document.writeln("");
document.writeln("	var gotoString = \"返回当前月份\"");
document.writeln("	var todayString = \"今天是：\"");
document.writeln("	var weekString = \"周数\"");
document.writeln("	var scrollLeftMessage = \"单击滚动到上一月，长按持续滚动.\"");
document.writeln("	var scrollRightMessage = \"单击滚动到下一月，长按持续滚动.\"");
document.writeln("	var selectMonthMessage = \"单击选择月份.\"");
document.writeln("	var selectYearMessage = \"单击选择年份.\"");
document.writeln("	var selectDateMessage = \"选择 [date] 作为日期.\" \/\/ do not replace [date], it will be replaced by date.");
document.writeln("");
document.writeln("	var	crossobj, crossMonthObj, crossYearObj, monthSelected, yearSelected, dateSelected, omonthSelected, oyearSelected, odateSelected, monthConstructed, yearConstructed, intervalID1, intervalID2, timeoutID1, timeoutID2, ctlToPlaceValue, ctlNow, dateFormat, nStartingYear");
document.writeln("");
document.writeln("	var	bPageLoaded=false");
document.writeln("	var	ie=document.all");
document.writeln("	var	dom=document.getElementById");
document.writeln("");
document.writeln("	var	ns4=document.layers");
document.writeln("	var	today =	new	Date()");
document.writeln("	var	dateNow	 = today.getDate()");
document.writeln("	var	monthNow = today.getMonth()");
document.writeln("	var	yearNow	 = today.getYear()");
document.writeln("	var	imgsrc = new Array(\"drop1.gif\",\"drop2.gif\",\"left1.gif\",\"left2.gif\",\"right1.gif\",\"right2.gif\")");
document.writeln("	var	img	= new Array()");
document.writeln("");
document.writeln("	var bShow = false;");
document.writeln("");
document.writeln("    \/* hides <select> and <applet> objects (for IE only) *\/");
document.writeln("    function hideElement( elmID, overDiv )");
document.writeln("    {");
document.writeln("      if( ie )");
document.writeln("      {");
document.writeln("        for( i = 0; i < document.all.tags( elmID ).length; i++ )");
document.writeln("        {");
document.writeln("          obj = document.all.tags( elmID )[i];");
document.writeln("          if( !obj || !obj.offsetParent )");
document.writeln("          {");
document.writeln("            continue;");
document.writeln("          }");
document.writeln("      ");
document.writeln("          \/\/ Find the element\'s offsetTop and offsetLeft relative to the BODY tag.");
document.writeln("          objLeft   = obj.offsetLeft;");
document.writeln("          objTop    = obj.offsetTop;");
document.writeln("          objParent = obj.offsetParent;");
document.writeln("          ");
document.writeln("          while( objParent.tagName.toUpperCase() != \"BODY\" )");
document.writeln("          {");
document.writeln("            objLeft  += objParent.offsetLeft;");
document.writeln("            objTop   += objParent.offsetTop;");
document.writeln("            objParent = objParent.offsetParent;");
document.writeln("          }");
document.writeln("      ");
document.writeln("          objHeight = obj.offsetHeight;");
document.writeln("          objWidth = obj.offsetWidth;");
document.writeln("      ");
document.writeln("          if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft );");
document.writeln("          else if(( overDiv.offsetTop + overDiv.offsetHeight ) <= objTop );");
document.writeln("          else if( overDiv.offsetTop >= ( objTop + objHeight ));");
document.writeln("          else if( overDiv.offsetLeft >= ( objLeft + objWidth ));");
document.writeln("          else");
document.writeln("          {");
document.writeln("            obj.style.visibility = \"hidden\";");
document.writeln("          }");
document.writeln("        }");
document.writeln("      }");
document.writeln("    }");
document.writeln("     ");
document.writeln("    \/*");
document.writeln("    * unhides <select> and <applet> objects (for IE only)");
document.writeln("    *\/");
document.writeln("    function showElement( elmID )");
document.writeln("    {");
document.writeln("      if( ie )");
document.writeln("      {");
document.writeln("        for( i = 0; i < document.all.tags( elmID ).length; i++ )");
document.writeln("        {");
document.writeln("          obj = document.all.tags( elmID )[i];");
document.writeln("          ");
document.writeln("          if( !obj || !obj.offsetParent )");
document.writeln("          {");
document.writeln("            continue;");
document.writeln("          }");
document.writeln("        ");
document.writeln("          obj.style.visibility = \"\";");
document.writeln("        }");
document.writeln("      }");
document.writeln("    }");
document.writeln("");
document.writeln("	function HolidayRec (d, m, y, desc)");
document.writeln("	{");
document.writeln("		this.d = d");
document.writeln("		this.m = m");
document.writeln("		this.y = y");
document.writeln("		this.desc = desc");
document.writeln("	}");
document.writeln("");
document.writeln("	var HolidaysCounter = 0");
document.writeln("	var Holidays = new Array()");
document.writeln("");
document.writeln("	function addHoliday (d, m, y, desc)");
document.writeln("	{");
document.writeln("		Holidays[HolidaysCounter++] = new HolidayRec ( d, m, y, desc )");
document.writeln("	}");
document.writeln("");
document.writeln("	if (dom)");
document.writeln("	{");
document.writeln("		for	(i=0;i<imgsrc.length;i++)");
document.writeln("		{");
document.writeln("			img[i] = new Image");
document.writeln("			img[i].src = imgDir + imgsrc[i]");
document.writeln("		}");
document.writeln("		document.write (\"<div onclick=\'bShow=true\' id=\'calendar\'	style=\'z-index:+999;position:absolute;visibility:hidden;\'><table	width=\"+((showWeekNumber==1)?250:220)+\" style=\'font-family:arial;font-size:11px;border-width:1;border-style:solid;border-color:#a0a0a0;font-family:arial; font-size:11px}\' bgcolor=\'#ffffff\'><tr bgcolor=\'#0000aa\'><td><table width=\'\"+((showWeekNumber==1)?248:218)+\"\'><tr><td style=\'padding:2px;font-family:arial; font-size:11px;\'><font color=\'#ffffff\'><B><span id=\'caption\'><\/span><\/B><\/font><\/td><td align=right><a href=\'javascript:hideCalendar()\'><IMG SRC=\'\"+imgDir+\"close.gif\' WIDTH=\'15\' HEIGHT=\'13\' BORDER=\'0\' ALT=\'关闭窗口\'><\/a><\/td><\/tr><\/table><\/td><\/tr><tr><td style=\'padding:5px\' bgcolor=#ffffff><span id=\'content\'><\/span><\/td><\/tr>\")");
document.writeln("			");
document.writeln("		if (showToday==1)");
document.writeln("		{");
document.writeln("			document.write (\"<tr bgcolor=#f0f0f0><td style=\'padding:5px\' align=center><span id=\'lblToday\'><\/span><\/td><\/tr>\")");
document.writeln("		}");
document.writeln("			");
document.writeln("		document.write (\"<\/table><\/div><div id=\'selectMonth\' style=\'z-index:+999;position:absolute;visibility:hidden;\'><\/div><div id=\'selectYear\' style=\'z-index:+999;position:absolute;visibility:hidden;\'><\/div>\");");
document.writeln("	}");
document.writeln("");
document.writeln("	var	monthName =	new	Array(\"一月\",\"二月\",\"三月\",\"四月\",\"五月\",\"六月\",\"七月\",\"八月\",\"九月\",\"十月\",\"十一月\",\"十二月\")");
document.writeln("	var	monthName2 = new Array(\"一月\",\"二月\",\"三月\",\"四月\",\"五月\",\"六月\",\"七月\",\"八月\",\"九月\",\"十月\",\"十一月\",\"十二月\")");
document.writeln("	if (startAt==0)");
document.writeln("	{");
document.writeln("		dayName = new Array	(\"日\",\"一\",\"二\",\"三\",\"四\",\"五\",\"六\")");
document.writeln("	}");
document.writeln("	else");
document.writeln("	{");
document.writeln("		dayName = new Array	(\"一\",\"二\",\"三\",\"四\",\"五\",\"六\",\"<font color=red>日<\/font>\")");
document.writeln("	}");
document.writeln("	var	styleAnchor=\"text-decoration:none;color:black;\"");
document.writeln("	var	styleLightBorder=\"border-style:solid;border-width:1px;border-color:#a0a0a0;\"");
document.writeln("");
document.writeln("	function swapImage(srcImg, destImg){");
document.writeln("		if (ie)	{ document.getElementById(srcImg).setAttribute(\"src\",imgDir + destImg) }");
document.writeln("	}");
document.writeln("");
document.writeln("	function init()	{");
document.writeln("		if (!ns4)");
document.writeln("		{");
document.writeln("			if (!ie) { yearNow += 1900	}");
document.writeln("");
document.writeln("			crossobj=(dom)?document.getElementById(\"calendar\").style : ie? document.all.calendar : document.calendar");
document.writeln("			hideCalendar()");
document.writeln("");
document.writeln("			crossMonthObj=(dom)?document.getElementById(\"selectMonth\").style : ie? document.all.selectMonth	: document.selectMonth");
document.writeln("");
document.writeln("			crossYearObj=(dom)?document.getElementById(\"selectYear\").style : ie? document.all.selectYear : document.selectYear");
document.writeln("");
document.writeln("			monthConstructed=false;");
document.writeln("			yearConstructed=false;");
document.writeln("");
document.writeln("			if (showToday==1)");
document.writeln("			{");
document.writeln("			document.getElementById(\"lblToday\").innerHTML =	todayString + \"<a onmousemove=\'window.status=\\\"\"+gotoString+\"\\\"\' onmouseout=\'window.status=\\\"\\\"\' title=\'\"+gotoString+\"\' style=\'\"+styleAnchor+\"\' href=\'javascript:monthSelected=monthNow;yearSelected=yearNow;constructCalendar();\'>星期\"+dayName[(today.getDay()-startAt==-1)?6:(today.getDay()-startAt)]+\", \" + dateNow + \"号 \" + monthName[monthNow].substring(0,3)	+ \"	\" +	yearNow	+ \"年<\/a>\"");
document.writeln("			}");
document.writeln("");
document.writeln("			sHTML1=\"<span id=\'spanLeft\'	style=\'border-style:solid;border-width:1;border-color:#3366FF;cursor:pointer\' onmouseover=\'swapImage(\\\"changeLeft\\\",\\\"left2.gif\\\");this.style.borderColor=\\\"#88AAFF\\\";window.status=\\\"\"+scrollLeftMessage+\"\\\"\' onclick=\'javascript:decMonth()\' onmouseout=\'clearInterval(intervalID1);swapImage(\\\"changeLeft\\\",\\\"left1.gif\\\");this.style.borderColor=\\\"#3366FF\\\";window.status=\\\"\\\"\' onmousedown=\'clearTimeout(timeoutID1);timeoutID1=setTimeout(\\\"StartDecMonth()\\\",500)\'	onmouseup=\'clearTimeout(timeoutID1);clearInterval(intervalID1)\'>&nbsp<IMG id=\'changeLeft\' SRC=\'\"+imgDir+\"left1.gif\' width=10 height=11 BORDER=0>&nbsp<\/span>&nbsp;\"");
document.writeln("			sHTML1+=\"<span id=\'spanRight\' style=\'border-style:solid;border-width:1;border-color:#3366FF;cursor:pointer\'	onmouseover=\'swapImage(\\\"changeRight\\\",\\\"right2.gif\\\");this.style.borderColor=\\\"#88AAFF\\\";window.status=\\\"\"+scrollRightMessage+\"\\\"\' onmouseout=\'clearInterval(intervalID1);swapImage(\\\"changeRight\\\",\\\"right1.gif\\\");this.style.borderColor=\\\"#3366FF\\\";window.status=\\\"\\\"\' onclick=\'incMonth()\' onmousedown=\'clearTimeout(timeoutID1);timeoutID1=setTimeout(\\\"StartIncMonth()\\\",500)\'	onmouseup=\'clearTimeout(timeoutID1);clearInterval(intervalID1)\'>&nbsp<IMG id=\'changeRight\' SRC=\'\"+imgDir+\"right1.gif\'	width=10 height=11 BORDER=0>&nbsp<\/span>&nbsp\"");
document.writeln("			sHTML1+=\"<span id=\'spanMonth\' style=\'border-style:solid;border-width:1;border-color:#3366FF;cursor:pointer\'	onmouseover=\'swapImage(\\\"changeMonth\\\",\\\"drop2.gif\\\");this.style.borderColor=\\\"#88AAFF\\\";window.status=\\\"\"+selectMonthMessage+\"\\\"\' onmouseout=\'swapImage(\\\"changeMonth\\\",\\\"drop1.gif\\\");this.style.borderColor=\\\"#3366FF\\\";window.status=\\\"\\\"\' onclick=\'popUpMonth()\'><\/span>&nbsp;\"");
document.writeln("			sHTML1+=\"<span id=\'spanYear\' style=\'border-style:solid;border-width:1;border-color:#3366FF;cursor:pointer\' onmouseover=\'swapImage(\\\"changeYear\\\",\\\"drop2.gif\\\");this.style.borderColor=\\\"#88AAFF\\\";window.status=\\\"\"+selectYearMessage+\"\\\"\'	onmouseout=\'swapImage(\\\"changeYear\\\",\\\"drop1.gif\\\");this.style.borderColor=\\\"#3366FF\\\";window.status=\\\"\\\"\'	onclick=\'popUpYear()\'><\/span>&nbsp;\"");
document.writeln("			");
document.writeln("			document.getElementById(\"caption\").innerHTML  =	sHTML1");
document.writeln("");
document.writeln("			bPageLoaded=true");
document.writeln("		}");
document.writeln("	}");
document.writeln("");
document.writeln("	function hideCalendar()	{");
document.writeln("		crossobj.visibility=\"hidden\"");
document.writeln("		if (crossMonthObj != null){crossMonthObj.visibility=\"hidden\"}");
document.writeln("		if (crossYearObj !=	null){crossYearObj.visibility=\"hidden\"}");
document.writeln("");
document.writeln("	    showElement( \'SELECT\' );");
document.writeln("		showElement( \'APPLET\' );");
document.writeln("	}");
document.writeln("");
document.writeln("	function padZero(num) {");
document.writeln("		return (num	< 10)? \'0\' + num : num ;");
document.writeln("	}");
document.writeln("");
document.writeln("	function constructDate(d,m,y)");
document.writeln("	{");
document.writeln("		sTmp = dateFormat");
document.writeln("		sTmp = sTmp.replace	(\"dd\",\"<e>\")");
document.writeln("		sTmp = sTmp.replace	(\"d\",\"<d>\")");
document.writeln("		sTmp = sTmp.replace	(\"<e>\",padZero(d))");
document.writeln("		sTmp = sTmp.replace	(\"<d>\",d)");
document.writeln("		sTmp = sTmp.replace	(\"mmmm\",\"<p>\")");
document.writeln("		sTmp = sTmp.replace	(\"mmm\",\"<o>\")");
document.writeln("		sTmp = sTmp.replace	(\"mm\",\"<n>\")");
document.writeln("		sTmp = sTmp.replace	(\"m\",\"<m>\")");
document.writeln("		sTmp = sTmp.replace	(\"<m>\",m+1)");
document.writeln("		sTmp = sTmp.replace	(\"<n>\",padZero(m+1))");
document.writeln("		sTmp = sTmp.replace	(\"<o>\",monthName[m])");
document.writeln("		sTmp = sTmp.replace	(\"<p>\",monthName2[m])");
document.writeln("		sTmp = sTmp.replace	(\"yyyy\",y)");
document.writeln("		return sTmp.replace (\"yy\",padZero(y%100))");
document.writeln("	}");
document.writeln("");
document.writeln("	function closeCalendar() {");
document.writeln("		var	sTmp");
document.writeln("");
document.writeln("		hideCalendar();");
document.writeln("		ctlToPlaceValue.value =	constructDate(dateSelected,monthSelected,yearSelected)");
document.writeln("	}");
document.writeln("");
document.writeln("	\/*** Month Pulldown	***\/");
document.writeln("");
document.writeln("	function StartDecMonth()");
document.writeln("	{");
document.writeln("		intervalID1=setInterval(\"decMonth()\",80)");
document.writeln("	}");
document.writeln("");
document.writeln("	function StartIncMonth()");
document.writeln("	{");
document.writeln("		intervalID1=setInterval(\"incMonth()\",80)");
document.writeln("	}");
document.writeln("");
document.writeln("	function incMonth () {");
document.writeln("		monthSelected++");
document.writeln("		if (monthSelected>11) {");
document.writeln("			monthSelected=0");
document.writeln("			yearSelected++");
document.writeln("		}");
document.writeln("		constructCalendar()");
document.writeln("	}");
document.writeln("");
document.writeln("	function decMonth () {");
document.writeln("		monthSelected--");
document.writeln("		if (monthSelected<0) {");
document.writeln("			monthSelected=11");
document.writeln("			yearSelected--");
document.writeln("		}");
document.writeln("		constructCalendar()");
document.writeln("	}");
document.writeln("");
document.writeln("	function constructMonth() {");
document.writeln("		popDownYear()");
document.writeln("		if (!monthConstructed) {");
document.writeln("			sHTML =	\"\"");
document.writeln("			for	(i=0; i<12;	i++) {");
document.writeln("				sName =	monthName[i];");
document.writeln("				if (i==monthSelected){");
document.writeln("					sName =	\"<B>\" +	sName +	\"<\/B>\"");
document.writeln("				}");
document.writeln("				sHTML += \"<tr><td id=\'m\" + i + \"\' onmouseover=\'this.style.backgroundColor=\\\"#FFCC99\\\"\' onmouseout=\'this.style.backgroundColor=\\\"\\\"\' style=\'cursor:pointer\' onclick=\'monthConstructed=false;monthSelected=\" + i + \";constructCalendar();popDownMonth();event.cancelBubble=true\'>&nbsp;\" + sName + \"&nbsp;<\/td><\/tr>\"");
document.writeln("			}");
document.writeln("");
document.writeln("			document.getElementById(\"selectMonth\").innerHTML = \"<table width=70	style=\'font-family:arial; font-size:11px; border-width:1; border-style:solid; border-color:#a0a0a0;\' bgcolor=\'#FFFFDD\' cellspacing=0 onmouseover=\'clearTimeout(timeoutID1)\'	onmouseout=\'clearTimeout(timeoutID1);timeoutID1=setTimeout(\\\"popDownMonth()\\\",100);event.cancelBubble=true\'>\" +	sHTML +	\"<\/table>\"");
document.writeln("");
document.writeln("			monthConstructed=true");
document.writeln("		}");
document.writeln("	}");
document.writeln("");
document.writeln("	function popUpMonth() {");
document.writeln("		constructMonth()");
document.writeln("		crossMonthObj.visibility = (dom||ie)? \"visible\"	: \"show\"");
document.writeln("		crossMonthObj.left = parseInt(crossobj.left) + 50");
document.writeln("		crossMonthObj.top =	parseInt(crossobj.top) + 26");
document.writeln("");
document.writeln("		hideElement( \'SELECT\', document.getElementById(\"selectMonth\") );");
document.writeln("		hideElement( \'APPLET\', document.getElementById(\"selectMonth\") );			");
document.writeln("	}");
document.writeln("");
document.writeln("	function popDownMonth()	{");
document.writeln("		crossMonthObj.visibility= \"hidden\"");
document.writeln("	}");
document.writeln("");
document.writeln("	\/*** Year Pulldown ***\/");
document.writeln("");
document.writeln("	function incYear() {");
document.writeln("		for	(i=0; i<7; i++){");
document.writeln("			newYear	= (i+nStartingYear)+1");
document.writeln("			if (newYear==yearSelected)");
document.writeln("			{ txtYear =	\"&nbsp;<B>\"	+ newYear +	\"<\/B>&nbsp;\" }");
document.writeln("			else");
document.writeln("			{ txtYear =	\"&nbsp;\" + newYear + \"&nbsp;\" }");
document.writeln("			document.getElementById(\"y\"+i).innerHTML = txtYear");
document.writeln("		}");
document.writeln("		nStartingYear ++;");
document.writeln("		bShow=true");
document.writeln("	}");
document.writeln("");
document.writeln("	function decYear() {");
document.writeln("		for	(i=0; i<7; i++){");
document.writeln("			newYear	= (i+nStartingYear)-1");
document.writeln("			if (newYear==yearSelected)");
document.writeln("			{ txtYear =	\"&nbsp;<B>\"	+ newYear +	\"<\/B>&nbsp;\" }");
document.writeln("			else");
document.writeln("			{ txtYear =	\"&nbsp;\" + newYear + \"&nbsp;\" }");
document.writeln("			document.getElementById(\"y\"+i).innerHTML = txtYear");
document.writeln("		}");
document.writeln("		nStartingYear --;");
document.writeln("		bShow=true");
document.writeln("	}");
document.writeln("");
document.writeln("	function selectYear(nYear) {");
document.writeln("		yearSelected=parseInt(nYear+nStartingYear);");
document.writeln("		yearConstructed=false;");
document.writeln("		constructCalendar();");
document.writeln("		popDownYear();");
document.writeln("	}");
document.writeln("");
document.writeln("	function constructYear() {");
document.writeln("		popDownMonth()");
document.writeln("		sHTML =	\"\"");
document.writeln("		if (!yearConstructed) {");
document.writeln("");
document.writeln("			sHTML =	\"<tr><td align=\'center\'	onmouseover=\'this.style.backgroundColor=\\\"#FFCC99\\\"\' onmouseout=\'clearInterval(intervalID1);this.style.backgroundColor=\\\"\\\"\' style=\'cursor:pointer\'	onmousedown=\'clearInterval(intervalID1);intervalID1=setInterval(\\\"decYear()\\\",30)\' onmouseup=\'clearInterval(intervalID1)\'>-<\/td><\/tr>\"");
document.writeln("");
document.writeln("			j =	0");
document.writeln("			nStartingYear =	yearSelected-3");
document.writeln("			for	(i=(yearSelected-3); i<=(yearSelected+3); i++) {");
document.writeln("				sName =	i;");
document.writeln("				if (i==yearSelected){");
document.writeln("					sName =	\"<B>\" +	sName +	\"<\/B>\"");
document.writeln("				}");
document.writeln("");
document.writeln("				sHTML += \"<tr><td id=\'y\" + j + \"\' onmouseover=\'this.style.backgroundColor=\\\"#FFCC99\\\"\' onmouseout=\'this.style.backgroundColor=\\\"\\\"\' style=\'cursor:pointer\' onclick=\'selectYear(\"+j+\");event.cancelBubble=true\'>&nbsp;\" + sName + \"&nbsp;<\/td><\/tr>\"");
document.writeln("				j ++;");
document.writeln("			}");
document.writeln("");
document.writeln("			sHTML += \"<tr><td align=\'center\' onmouseover=\'this.style.backgroundColor=\\\"#FFCC99\\\"\' onmouseout=\'clearInterval(intervalID2);this.style.backgroundColor=\\\"\\\"\' style=\'cursor:pointer\' onmousedown=\'clearInterval(intervalID2);intervalID2=setInterval(\\\"incYear()\\\",30)\'	onmouseup=\'clearInterval(intervalID2)\'>+<\/td><\/tr>\"");
document.writeln("");
document.writeln("			document.getElementById(\"selectYear\").innerHTML	= \"<table width=44 style=\'font-family:arial; font-size:11px; border-width:1; border-style:solid; border-color:#a0a0a0;\'	bgcolor=\'#FFFFDD\' onmouseover=\'clearTimeout(timeoutID2)\' onmouseout=\'clearTimeout(timeoutID2);timeoutID2=setTimeout(\\\"popDownYear()\\\",100)\' cellspacing=0>\"	+ sHTML	+ \"<\/table>\"");
document.writeln("");
document.writeln("			yearConstructed	= true");
document.writeln("		}");
document.writeln("	}");
document.writeln("");
document.writeln("	function popDownYear() {");
document.writeln("		clearInterval(intervalID1)");
document.writeln("		clearTimeout(timeoutID1)");
document.writeln("		clearInterval(intervalID2)");
document.writeln("		clearTimeout(timeoutID2)");
document.writeln("		crossYearObj.visibility= \"hidden\"");
document.writeln("	}");
document.writeln("");
document.writeln("	function popUpYear() {");
document.writeln("		var	leftOffset");
document.writeln("");
document.writeln("		constructYear()");
document.writeln("		crossYearObj.visibility	= (dom||ie)? \"visible\" : \"show\"");
document.writeln("		leftOffset = parseInt(crossobj.left) + document.getElementById(\"spanYear\").offsetLeft");
document.writeln("		if (ie)");
document.writeln("		{");
document.writeln("			leftOffset += 6");
document.writeln("		}");
document.writeln("		crossYearObj.left =	leftOffset");
document.writeln("		crossYearObj.top = parseInt(crossobj.top) +	26");
document.writeln("	}");
document.writeln("");
document.writeln("	\/*** calendar ***\/");
document.writeln("   function WeekNbr(n) {");
document.writeln("      \/\/ Algorithm used:");
document.writeln("      \/\/ From Klaus Tondering\'s Calendar document (The Authority\/Guru)");
document.writeln("      \/\/ hhtp:\/\/www.tondering.dk\/claus\/calendar.html");
document.writeln("      \/\/ a = (14-month) \/ 12");
document.writeln("      \/\/ y = year + 4800 - a");
document.writeln("      \/\/ m = month + 12a - 3");
document.writeln("      \/\/ J = day + (153m + 2) \/ 5 + 365y + y \/ 4 - y \/ 100 + y \/ 400 - 32045");
document.writeln("      \/\/ d4 = (J + 31741 - (J mod 7)) mod 146097 mod 36524 mod 1461");
document.writeln("      \/\/ L = d4 \/ 1460");
document.writeln("      \/\/ d1 = ((d4 - L) mod 365) + L");
document.writeln("      \/\/ WeekNumber = d1 \/ 7 + 1");
document.writeln(" ");
document.writeln("      year = n.getFullYear();");
document.writeln("      month = n.getMonth() + 1;");
document.writeln("      if (startAt == 0) {");
document.writeln("         day = n.getDate() + 1;");
document.writeln("      }");
document.writeln("      else {");
document.writeln("         day = n.getDate();");
document.writeln("      }");
document.writeln(" ");
document.writeln("      a = Math.floor((14-month) \/ 12);");
document.writeln("      y = year + 4800 - a;");
document.writeln("      m = month + 12 * a - 3;");
document.writeln("      b = Math.floor(y\/4) - Math.floor(y\/100) + Math.floor(y\/400);");
document.writeln("      J = day + Math.floor((153 * m + 2) \/ 5) + 365 * y + b - 32045;");
document.writeln("      d4 = (((J + 31741 - (J % 7)) % 146097) % 36524) % 1461;");
document.writeln("      L = Math.floor(d4 \/ 1460);");
document.writeln("      d1 = ((d4 - L) % 365) + L;");
document.writeln("      week = Math.floor(d1\/7) + 1;");
document.writeln(" ");
document.writeln("      return week;");
document.writeln("   }");
document.writeln("");
document.writeln("	function constructCalendar () {");
document.writeln("		var aNumDays = Array (31,0,31,30,31,30,31,31,30,31,30,31)");
document.writeln("");
document.writeln("		var dateMessage");
document.writeln("		var	startDate =	new	Date (yearSelected,monthSelected,1)");
document.writeln("		var endDate");
document.writeln("");
document.writeln("		if (monthSelected==1)");
document.writeln("		{");
document.writeln("			endDate	= new Date (yearSelected,monthSelected+1,1);");
document.writeln("			endDate	= new Date (endDate	- (24*60*60*1000));");
document.writeln("			numDaysInMonth = endDate.getDate()");
document.writeln("		}");
document.writeln("		else");
document.writeln("		{");
document.writeln("			numDaysInMonth = aNumDays[monthSelected];");
document.writeln("		}");
document.writeln("");
document.writeln("		datePointer	= 0");
document.writeln("		dayPointer = startDate.getDay() - startAt");
document.writeln("		");
document.writeln("		if (dayPointer<0)");
document.writeln("		{");
document.writeln("			dayPointer = 6");
document.writeln("		}");
document.writeln("");
document.writeln("		sHTML =	\"<table	 border=0 style=\'font-family:verdana;font-size:10px;\'><tr>\"");
document.writeln("");
document.writeln("		if (showWeekNumber==1)");
document.writeln("		{");
document.writeln("			sHTML += \"<td width=20><b>\" + weekString + \"<\/b><\/td><td width=1 rowspan=7 bgcolor=\'#d0d0d0\' style=\'padding:0px\'><img src=\'\"+imgDir+\"divider.gif\' width=1><\/td>\"");
document.writeln("		}");
document.writeln("");
document.writeln("		for	(i=0; i<7; i++)	{");
document.writeln("			sHTML += \"<td width=\'20\' align=\'right\'><B>\"+ dayName[i]+\"<\/B><\/td>\"");
document.writeln("		}");
document.writeln("		sHTML +=\"<\/tr><tr>\"");
document.writeln("		");
document.writeln("		if (showWeekNumber==1)");
document.writeln("		{");
document.writeln("			sHTML += \"<td align=right>\" + WeekNbr(startDate) + \"&nbsp;<\/td>\"");
document.writeln("		}");
document.writeln("");
document.writeln("		for	( var i=1; i<=dayPointer;i++ )");
document.writeln("		{");
document.writeln("			sHTML += \"<td>&nbsp;<\/td>\"");
document.writeln("		}");
document.writeln("	");
document.writeln("		for	( datePointer=1; datePointer<=numDaysInMonth; datePointer++ )");
document.writeln("		{");
document.writeln("			dayPointer++;");
document.writeln("			sHTML += \"<td align=right>\"");
document.writeln("			sStyle=styleAnchor");
document.writeln("			if ((datePointer==odateSelected) &&	(monthSelected==omonthSelected)	&& (yearSelected==oyearSelected))");
document.writeln("			{ sStyle+=styleLightBorder }");
document.writeln("");
document.writeln("			sHint = \"\"");
document.writeln("			for (k=0;k<HolidaysCounter;k++)");
document.writeln("			{");
document.writeln("				if ((parseInt(Holidays[k].d)==datePointer)&&(parseInt(Holidays[k].m)==(monthSelected+1)))");
document.writeln("				{");
document.writeln("					if ((parseInt(Holidays[k].y)==0)||((parseInt(Holidays[k].y)==yearSelected)&&(parseInt(Holidays[k].y)!=0)))");
document.writeln("					{");
document.writeln("						sStyle+=\"background-color:#FFDDDD;\"");
document.writeln("						sHint+=sHint==\"\"?Holidays[k].desc:\"\\n\"+Holidays[k].desc");
document.writeln("					}");
document.writeln("				}");
document.writeln("			}");
document.writeln("");
document.writeln("			var regexp= \/\\\"\/g");
document.writeln("			sHint=sHint.replace(regexp,\"&quot;\")");
document.writeln("");
document.writeln("			dateMessage = \"onmousemove=\'window.status=\\\"\"+selectDateMessage.replace(\"[date]\",constructDate(datePointer,monthSelected,yearSelected))+\"\\\"\' onmouseout=\'window.status=\\\"\\\"\' \"");
document.writeln("");
document.writeln("			if ((datePointer==dateNow)&&(monthSelected==monthNow)&&(yearSelected==yearNow))");
document.writeln("			{ sHTML += \"<b><a \"+dateMessage+\" title=\\\"\" + sHint + \"\\\" style=\'\"+sStyle+\"\' href=\'javascript:dateSelected=\"+datePointer+\";closeCalendar();\'><font color=#ff0000>&nbsp;\" + datePointer + \"<\/font>&nbsp;<\/a><\/b>\"}");
document.writeln("			else if	(dayPointer % 7 == (startAt * -1)+1)");
document.writeln("			{ sHTML += \"<a \"+dateMessage+\" title=\\\"\" + sHint + \"\\\" style=\'\"+sStyle+\"\' href=\'javascript:dateSelected=\"+datePointer + \";closeCalendar();\'>&nbsp;<font color=#909090>\" + datePointer + \"<\/font>&nbsp;<\/a>\" }");
document.writeln("			else");
document.writeln("			{ sHTML += \"<a \"+dateMessage+\" title=\\\"\" + sHint + \"\\\" style=\'\"+sStyle+\"\' href=\'javascript:dateSelected=\"+datePointer + \";closeCalendar();\'>&nbsp;\" + datePointer + \"&nbsp;<\/a>\" }");
document.writeln("");
document.writeln("			sHTML += \"\"");
document.writeln("			if ((dayPointer+startAt) % 7 == startAt) { ");
document.writeln("				sHTML += \"<\/tr><tr>\" ");
document.writeln("				if ((showWeekNumber==1)&&(datePointer<numDaysInMonth))");
document.writeln("				{");
document.writeln("					sHTML += \"<td align=right>\" + (WeekNbr(new Date(yearSelected,monthSelected,datePointer+1))) + \"&nbsp;<\/td>\"");
document.writeln("				}");
document.writeln("			}");
document.writeln("		}");
document.writeln("");
document.writeln("		document.getElementById(\"content\").innerHTML   = sHTML");
document.writeln("		document.getElementById(\"spanMonth\").innerHTML = \"&nbsp;\" +	monthName[monthSelected] + \"&nbsp;<IMG id=\'changeMonth\' SRC=\'\"+imgDir+\"drop1.gif\' WIDTH=\'12\' HEIGHT=\'10\' BORDER=0>\"");
document.writeln("		document.getElementById(\"spanYear\").innerHTML =	\"&nbsp;\" + yearSelected	+ \"&nbsp;<IMG id=\'changeYear\' SRC=\'\"+imgDir+\"drop1.gif\' WIDTH=\'12\' HEIGHT=\'10\' BORDER=0>\"");
document.writeln("	}");
document.writeln("");
document.writeln("	function popUpCalendar(ctl,	ctl2, format) {");
document.writeln("		var	leftpos=0");
document.writeln("		var	toppos=0");
document.writeln("");
document.writeln("		if (bPageLoaded)");
document.writeln("		{");
document.writeln("			if ( crossobj.visibility ==	\"hidden\" ) {");
document.writeln("				ctlToPlaceValue	= ctl2");
document.writeln("				dateFormat=format;");
document.writeln("");
document.writeln("				formatChar = \" \"");
document.writeln("				aFormat	= dateFormat.split(formatChar)");
document.writeln("				if (aFormat.length<3)");
document.writeln("				{");
document.writeln("					formatChar = \"\/\"");
document.writeln("					aFormat	= dateFormat.split(formatChar)");
document.writeln("					if (aFormat.length<3)");
document.writeln("					{");
document.writeln("						formatChar = \".\"");
document.writeln("						aFormat	= dateFormat.split(formatChar)");
document.writeln("						if (aFormat.length<3)");
document.writeln("						{");
document.writeln("							formatChar = \"-\"");
document.writeln("							aFormat	= dateFormat.split(formatChar)");
document.writeln("							if (aFormat.length<3)");
document.writeln("							{");
document.writeln("								\/\/ invalid date	format");
document.writeln("								formatChar=\"\"");
document.writeln("							}");
document.writeln("						}");
document.writeln("					}");
document.writeln("				}");
document.writeln("");
document.writeln("				tokensChanged =	0");
document.writeln("				if ( formatChar	!= \"\" )");
document.writeln("				{");
document.writeln("					\/\/ use user\'s date");
document.writeln("					aData =	ctl2.value.split(formatChar)");
document.writeln("");
document.writeln("					for	(i=0;i<3;i++)");
document.writeln("					{");
document.writeln("						if ((aFormat[i]==\"d\") || (aFormat[i]==\"dd\"))");
document.writeln("						{");
document.writeln("							dateSelected = parseInt(aData[i], 10)");
document.writeln("							tokensChanged ++");
document.writeln("						}");
document.writeln("						else if	((aFormat[i]==\"m\") || (aFormat[i]==\"mm\"))");
document.writeln("						{");
document.writeln("							monthSelected =	parseInt(aData[i], 10) - 1");
document.writeln("							tokensChanged ++");
document.writeln("						}");
document.writeln("						else if	(aFormat[i]==\"yyyy\")");
document.writeln("						{");
document.writeln("							yearSelected = parseInt(aData[i], 10)");
document.writeln("							tokensChanged ++");
document.writeln("						}");
document.writeln("						else if	(aFormat[i]==\"mmm\")");
document.writeln("						{");
document.writeln("							for	(j=0; j<12;	j++)");
document.writeln("							{");
document.writeln("								if (aData[i]==monthName[j])");
document.writeln("								{");
document.writeln("									monthSelected=j");
document.writeln("									tokensChanged ++");
document.writeln("								}");
document.writeln("							}");
document.writeln("						}");
document.writeln("						else if	(aFormat[i]==\"mmmm\")");
document.writeln("						{");
document.writeln("							for	(j=0; j<12;	j++)");
document.writeln("							{");
document.writeln("								if (aData[i]==monthName2[j])");
document.writeln("								{");
document.writeln("									monthSelected=j");
document.writeln("									tokensChanged ++");
document.writeln("								}");
document.writeln("							}");
document.writeln("						}");
document.writeln("					}");
document.writeln("				}");
document.writeln("");
document.writeln("				if ((tokensChanged!=3)||isNaN(dateSelected)||isNaN(monthSelected)||isNaN(yearSelected))");
document.writeln("				{");
document.writeln("					dateSelected = dateNow");
document.writeln("					monthSelected =	monthNow");
document.writeln("					yearSelected = yearNow");
document.writeln("				}");
document.writeln("");
document.writeln("				odateSelected=dateSelected");
document.writeln("				omonthSelected=monthSelected");
document.writeln("				oyearSelected=yearSelected");
document.writeln("");
document.writeln("				aTag = ctl");
document.writeln("				do {");
document.writeln("					aTag = aTag.offsetParent;");
document.writeln("					leftpos	+= aTag.offsetLeft;");
document.writeln("					toppos += aTag.offsetTop;");
document.writeln("				} while(aTag.tagName!=\"BODY\");");
document.writeln("");
document.writeln("				crossobj.left =	fixedX==-1 ? ctl.offsetLeft	+ leftpos :	fixedX");
document.writeln("				crossobj.top = fixedY==-1 ?	ctl.offsetTop +	toppos + ctl.offsetHeight +	2 :	fixedY");
document.writeln("				constructCalendar (1, monthSelected, yearSelected);");
document.writeln("				crossobj.visibility=(dom||ie)? \"visible\" : \"show\"");
document.writeln("");
document.writeln("				hideElement( \'SELECT\', document.getElementById(\"calendar\") );");
document.writeln("				hideElement( \'APPLET\', document.getElementById(\"calendar\") );			");
document.writeln("");
document.writeln("				bShow = true;");
document.writeln("			}");
document.writeln("			else");
document.writeln("			{");
document.writeln("				hideCalendar()");
document.writeln("				if (ctlNow!=ctl) {popUpCalendar(ctl, ctl2, format)}");
document.writeln("			}");
document.writeln("			ctlNow = ctl");
document.writeln("		}");
document.writeln("	}");
document.writeln("");
document.writeln("	document.onkeypress = function hidecal1 () { ");
document.writeln("		if (event.keyCode==27) ");
document.writeln("		{");
document.writeln("			hideCalendar()");
document.writeln("		}");
document.writeln("	}");
document.writeln("	document.onclick = function hidecal2 () { 		");
document.writeln("		if (!bShow)");
document.writeln("		{");
document.writeln("			hideCalendar()");
document.writeln("		}");
document.writeln("		bShow = false");
document.writeln("	}");
document.writeln("");
document.writeln("	if(ie)");
document.writeln("	{");
document.writeln("		init()");
document.writeln("	}");
document.writeln("	else");
document.writeln("	{");
document.writeln("		window.onload=init");
document.writeln("	}		");
document.writeln("<\/SCRIPT>")