function positionInfo(d){var b=d;this.getElementLeft=h;function h(){var i=0;var j;if(typeof(b)=="object"){j=b}else{j=document.getElementById(b)}while(j!=null){i+=j.offsetLeft;j=j.offsetParent}return parseInt(i)}this.getElementWidth=g;function g(){var i;if(typeof(b)=="object"){i=b}else{i=document.getElementById(b)}return parseInt(i.offsetWidth)}this.getElementRight=e;function e(){return h(b)+g(b)}this.getElementTop=f;function f(){var j=0;var i;if(typeof(b)=="object"){i=b}else{i=document.getElementById(b)}while(i!=null){j+=i.offsetTop;i=i.offsetParent}return parseInt(j)}this.getElementHeight=a;function a(){var i;if(typeof(b)=="object"){i=b}else{i=document.getElementById(b)}return parseInt(i.offsetHeight)}this.getElementBottom=c;function c(){return f(b)+a(b)}}function CalendarControl(){var y="CalendarControl";var z=0;var s=0;var l=0;var p=0;var t=0;var j=0;var k=["January","February","March","April","May","June","July","August","September","October","November","December"];var f=null;function h(B){var A=y;var C=null;if(typeof(A)=="object"){C=A}else{C=document.getElementById(A)}if(C!=null){if(C.style){C=C.style;if(C[B]){return C[B]}else{return null}}else{return null}}}function b(B,E,C){var A=C;var D=null;if(typeof(A)=="object"){D=A}else{D=document.getElementById(A)}if((D!=null)&&(D.style!=null)){D=D.style;D[B]=E}}function n(A,B){b(A,B,y)}function e(A,B){return[31,((!(A%4)&&((A%100)||!(A%400)))?29:28),31,30,31,30,31,31,30,31,30,31][B-1]}function v(C,D,A){var B=new Date(C,D-1,A);return B.getDay()}this.clearDate=u;function u(){f.value="";m()}this.setDate=d;function d(B,D,A){if(f){if(D<10){D="0"+D}if(A<10){A="0"+A}var C=D+"-"+A+"-"+B;f.value=C;m()}return}this.changeMonth=a;function a(A){s+=A;l=0;if(s>12){s=1;z++}else{if(s<1){s=12;z--}}calendar=document.getElementById(y);calendar.innerHTML=i()}this.changeYear=x;function x(A){z+=A;l=0;calendar=document.getElementById(y);calendar.innerHTML=i()}function r(){var A=new Date().getYear();if(A<1900){A+=1900}return A}function o(){return new Date().getMonth()+1}function q(){return new Date().getDate()}function i(){var H=1;var A=0;var G=v(z,s,H);var C=e(z,s);var F=null;var E="<table cellspacing='0' cellpadding='0' border='0'>";E=E+"<tr class='header'>";E=E+"  <td colspan='2' class='previous'><a href='javascript:changeCalendarControlMonth(-1);'>&lt;</a> <a href='javascript:changeCalendarControlYear(-1);'>&laquo;</a></td>";E=E+"  <td colspan='3' class='title'>"+k[s-1]+"<br>"+z+"</td>";E=E+"  <td colspan='2' class='next'><a href='javascript:changeCalendarControlYear(1);'>&raquo;</a> <a href='javascript:changeCalendarControlMonth(1);'>&gt;</a></td>";E=E+"</tr>";E=E+"<tr><th>S</th><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th></tr>";for(var D=0;D<6;D++){E=E+"<tr>";for(var B=0;B<7;B++){if(D==0&&G==B){A=1}else{if(A==1&&H>C){A=0}}if(A){if(H==j&&z==p&&s==t){F="current"}else{if(B==0||B==6){F="weekend"}else{F="weekday"}}E=E+"<td><a class='"+F+"' href=\"javascript:setCalendarControlDate("+z+","+s+","+H+')">'+H+"</a></td>";H++}else{E=E+"<td class='empty'>&nbsp;</td>"}}E=E+"</tr>"}E=E+"<tr class='header'><th colspan='7' style='padding: 3px;'><a href='javascript:clearCalendarControl();'>Clear</a> | <a href='javascript:hideCalendarControl();'>Close</a></td></tr>";E=E+"</table>";return E}this.show=w;function w(G){g=0;if(f==G){return}else{f=G}if(f){try{var C=new String(f.value);var B=C.split("-");t=parseInt(B[0],10);j=parseInt(B[1],10);p=parseInt(B[2],10)}catch(F){}}if(!(p&&t&&j)){t=o();j=q();p=r()}s=t;l=j;z=p;if(document.getElementById){calendar=document.getElementById(y);calendar.innerHTML=i(z,s);n("display","block");var D=new positionInfo(f);var E=new positionInfo(y);var A=D.getElementLeft();var H=D.getElementBottom();n("left",A+"px");n("top",H+"px");if(document.all){b("display","block","CalendarControlIFrame");b("left",A+"px","CalendarControlIFrame");b("top",H+"px","CalendarControlIFrame");b("width",E.getElementWidth()+"px","CalendarControlIFrame");b("height",E.getElementHeight()+"px","CalendarControlIFrame")}}}this.hide=m;function m(){if(f){n("display","none");b("display","none","CalendarControlIFrame");f=null}}this.visible=c;function c(){return f}this.can_hide=g;var g=0}var calendarControl=new CalendarControl();function showCalendarControl(a){calendarControl.show(a)}function clearCalendarControl(){calendarControl.clearDate()}function hideCalendarControl(){if(calendarControl.visible()){calendarControl.hide()}}function setCalendarControlDate(b,c,a){calendarControl.setDate(b,c,a)}function changeCalendarControlYear(a){calendarControl.changeYear(a)}function changeCalendarControlMonth(a){calendarControl.changeMonth(a)}document.write("<iframe id='CalendarControlIFrame' src='javascript:false;' frameBorder='0' scrolling='no'></iframe>");document.write("<div id='CalendarControl'></div>");
