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 x="CalendarControl";var y=0;var r=0;var k=0;var o=0;var s=0;var i=0;var j=["January","February","March","April","May","June","July","August","September","October","November","December"];var f=null;var e=null;var t=null;function g(A){var z=x;var B=null;if(typeof(z)=="object"){B=z}else{B=document.getElementById(z)}if(B!=null){if(B.style){B=B.style;if(B[A]){return B[A]}else{return null}}else{return null}}}function b(A,D,B){var z=B;var C=null;if(typeof(z)=="object"){C=z}else{C=document.getElementById(z)}if((C!=null)&&(C.style!=null)){C=C.style;C[A]=D}}function m(z,A){b(z,A,x)}function d(z,A){return[31,((!(z%4)&&((z%100)||!(z%400)))?29:28),31,30,31,30,31,31,30,31,30,31][A-1]}function u(B,C,z){var A=new Date(B,C-1,z);return A.getDay()}this.setDate=c;function c(D,F,A){if(f){if(F<10){F="0"+F}if(A<10){A="0"+A}if((typeof(e)!="undefined")&&(e!="")){var z=e+D+F+A;window.location=z}else{var B="";var C="";if((typeof(t)!="undefined")&&(t!="")){B=t[2];C=t[0]+t[1]}if((B!="/")&&(B!="-")){B="-"}if((C!="us")&&(C!="uk")&&(C!="rs")){C="uk"}var E="";if(C=="uk"){E=A+B+F+B+D}if(C=="us"){E=F+B+A+B+D}if(C=="rs"){E=D+B+F+B+A}f.value=E}l()}return}this.changeMonth=a;function a(z){r+=z;k=0;if(r>12){r=1;y++}else{if(r<1){r=12;y--}}calendar=document.getElementById(x);calendar.innerHTML=h()}this.changeYear=w;function w(z){y+=z;k=0;calendar=document.getElementById(x);calendar.innerHTML=h()}function q(){var z=new Date().getYear();if(z<1900){z+=1900}return z}function n(){return new Date().getMonth()+1}function p(){return new Date().getDate()}function h(){var G=1;var z=0;var F=u(y,r,G);var B=d(y,r);var E=null;var D="<table cellspacing='0' cellpadding='0' border='0'>";D=D+"<tr class='header'>";D=D+"  <td colspan='2' class='previous'><a href='javascript:changeCalendarControlMonth(-1);' title='previous month'>&lt;</a>&nbsp;&nbsp;&nbsp;<a href='javascript:changeCalendarControlYear(-1);' title='previous year'>&lt;&lt;</a></td>";D=D+"  <td colspan='3' class='title'>"+j[r-1]+"<br>"+y+"</td>";D=D+"  <td colspan='2' class='next'><a href='javascript:changeCalendarControlYear(1);' title='next year'>&gt;&gt;</a>&nbsp;&nbsp;&nbsp;<a href='javascript:changeCalendarControlMonth(1);' title='next month'>&gt;</a></td>";D=D+"</tr>";D=D+"<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 C=0;C<6;C++){D=D+"<tr>";for(var A=0;A<7;A++){if(C==0&&F==A){z=1}else{if(z==1&&G>B){z=0}}if(z){if(G==i&&y==o&&r==s){E="current"}else{if(A==0||A==6){E="weekend"}else{E="weekday"}}D=D+"<td><a class='"+E+"' href=\"javascript:setCalendarControlDate("+y+","+r+","+G+')">'+G+"</a></td>";G++}else{D=D+"<td class='empty'>&nbsp;</td>"}}D=D+"</tr>"}D=D+"<tr class='header'><th colspan='7' style='padding: 3px;'><a href='javascript:hideCalendarControl();'>Close</a></td></tr>";D=D+"</table>";return D}this.show=v;function v(I,J,z){e=z;t=J;if(f==I){return}else{f=I}var N="";var A="";var K=0;var F=0;var D=0;if((typeof(t)!="undefined")&&(t!="")){N=t[2];A=t[0]+t[1]}if((N!="/")&&(N!="-")){N="-"}if((A!="us")&&(A!="uk")&&(A!="rs")){A="uk"}if(A=="us"){K=1;F=0;D=2}if(A=="uk"){K=0;F=1;D=2}if(A=="rs"){K=2;F=1;D=0}if(f){try{var H=new String(f.value);var L=H.split(N);i=parseInt(L[K],10);s=parseInt(L[F],10);o=parseInt(L[D],10)}catch(C){}}if(!(o&&s&&i)){i=p();s=n();o=q()}k=i;r=s;y=o;if(document.getElementById){calendar=document.getElementById(x);calendar.innerHTML=h(y,r);b("display","block","CalendarControlIFrame");m("display","block");var M=new positionInfo(f);var B=new positionInfo(x);var G=M.getElementLeft();var E=M.getElementBottom();m("left",G+"px");m("top",E+"px");b("left",G+"px","CalendarControlIFrame");b("top",E+"px","CalendarControlIFrame");b("width",B.getElementWidth()+"px","CalendarControlIFrame");b("height",B.getElementHeight()+"px","CalendarControlIFrame")}}this.hide=l;function l(){if(f){m("display","none");b("display","none","CalendarControlIFrame");f=null}}}var calendarControl=new CalendarControl();function showCalendarControl(a,c,b){calendarControl.show(a,c,b)}function hideCalendarControl(){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>");
