function stopBubble(a){a=getEventObj(a);a.cancelBubble=true;a.stopPropagation&&a.stopPropagation()}var nextFocus;function getEventObj(a){if(!a)a=window.event;return a}function SetNextFocus(a){nextFocus=a;if(nextFocus)nextFocus.onfocus=hideCalendarControl+nextFocus.onfocus}function SetPrevFocus(a){if(a)a.onfocus=hideCalendarControl+a.onfocus}function objNext(e,d){for(var c=false,b=e.elements,a=0;a<b.length;a++){if("hidden"!=b[a].type&&false==b[a].disabled&&IsVis(b[a])&&c)return b[a];if(d.id==b[a].id)c=true}return null}function objPrev(e,d){for(var c=false,b=e.elements,a=b.length-1;a>=0;a--){if("hidden"!=b[a].type&&false==b[a].disabled&&IsVis(b[a])&&c)return b[a];if(d.id==b[a].id)c=true}return null}function IsVis(a){if(!a||a.type=="hidden")return false;while(a&&a.style&&a.style.display!="none")a=a.parentNode;return!a||!a.style}function Control_onFocus(b,a){showCalendarControl(a)}function positionInfo(h){var a=h;this.getElementLeft=d;function d(){var c=0,b;if(typeof a=="object")b=a;else b=document.getElementById(a);while(b!=null){c+=b.offsetLeft;b=b.offsetParent}return parseInt(c)}this.getElementWidth=c;function c(){var b;if(typeof a=="object")b=a;else b=document.getElementById(a);return parseInt(b.offsetWidth)}this.getElementRight=g;function g(){return d(a)+c(a)}this.getElementTop=e;function e(){var c=0,b;if(typeof a=="object")b=a;else b=document.getElementById(a);while(b!=null){c+=b.offsetTop;b=b.offsetParent}return parseInt(c)}this.getElementHeight=b;function b(){var b;if(typeof a=="object")b=a;else b=document.getElementById(a);return parseInt(b.offsetHeight)}this.getElementBottom=f;function f(){return e(a)+b(a)}}function CalendarControl(){var f="CalendarControl",b=0,a=0,k=0,e=0,g=0,h=0,u=["January","February","March","April","May","June","July","August","September","October","November","December"],c=null;function d(c,e,d){var b=d,a=null;if(typeof b=="object")a=b;else a=document.getElementById(b);if(a!=null&&a.style!=null){a=a.style;a[c]=e}}function i(a,b){d(a,b,f)}function o(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 q(c,a,d){var b=new Date(c,a-1,d);return b.getDay()}this.setDate=t;function t(d,b,e){if(c){var a=b+"/"+e+"/"+(d+"").substring(2,4);c.value=a;l()}return}this.changeMonth=r;function r(c){a+=c;k=0;if(a>12){a=1;b++}else if(a<1){a=12;b--}calendar=document.getElementById(f);calendar.innerHTML=j()}this.changeYear=s;function s(a){b+=a;k=0;calendar=document.getElementById(f);calendar.innerHTML=j()}function n(){var a=(new Date).getYear();if(a<1900)a+=1900;return a}function m(){return(new Date).getMonth()+1}function p(){return(new Date).getDate()}function j(){var d=1,j=0,l=q(b,a,d),m=o(b,a),i=null,c="<table cellspacing='0' cellpadding='0' border='0'>";c=c+"<tr class='header'>";c=c+"  <td colspan='2' class='previous'><a href='javascript:changeCalendarControlMonth(-1);'>&lt;</a> <a href='javascript:changeCalendarControlYear(-1);'>&laquo;</a></td>";c=c+"  <td colspan='3' class='title'>"+u[a-1]+"<br>"+b+"</td>";c=c+"  <td colspan='2' class='next'><a href='javascript:changeCalendarControlYear(1);'>&raquo;</a> <a href='javascript:changeCalendarControlMonth(1);'>&gt;</a></td>";c=c+"</tr>";c=c+"<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 k=0;k<6;k++){c=c+"<tr>";for(var f=0;f<7;f++){if(k==0&&l==f)j=1;else if(j==1&&d>m)j=0;if(j){if(d==h&&b==e&&a==g)i="current";else if(f==0||f==6)i="weekend";else i="weekday";c=c+"<td><a class='"+i+"' href=\"javascript:setCalendarControlDate("+b+","+a+","+d+')">'+d+"</a></td>";d++}else c=c+"<td class='empty'>&nbsp;</td>"}c=c+"</tr>"}c=c+"<tr class='header'><th colspan='7' style='padding: 3px;'><a href='javascript:hideCalendarControl();'>Close</a></td></tr>";c=c+"</table>";return c}this.show=v;function v(r){if(c==r)return;else c=r;if(c)try{var u=new String(c.value),l=u.split("/");g=parseInt(l[0],10);h=parseInt(l[1],10);if(l[2].length==2)e=2e3+parseInt(l[2],10);else e=parseInt(l[2],10)}catch(v){}if(!(e&&g&&h)){g=m();h=p();e=n()}a=g;k=h;b=e;if(document.getElementById){calendar=document.getElementById(f);calendar.innerHTML=j(b,a);d("display","block","CalendarControlIFrame");i("display","block");var q=new positionInfo(c),o=new positionInfo(f),s=q.getElementLeft(),t=q.getElementBottom();i("left",s+"px");i("top",t+"px");d("left",s+"px","CalendarControlIFrame");d("top",t+"px","CalendarControlIFrame");d("width",o.getElementWidth()+"px","CalendarControlIFrame");d("height",o.getElementHeight()+"px","CalendarControlIFrame")}}this.hide=l;function l(){if(c){i("display","none");d("display","none","CalendarControlIFrame");c=null}}}var calendarControl=new CalendarControl;function showCalendarControl(a){(a.className==null||a.className!=null&&a.className.toUpperCase()!="READONLY")&&calendarControl.show(a)}function hideCalendarControl(){calendarControl.hide()}function setCalendarControlDate(b,a,c){calendarControl.setDate(b,a,c)}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>");
