if(!R9_Objects){
var R9_Objects=[];
}
function R9CalPageMouseDown(id,e){
R9_Objects[id].pagemousedown(e);
}
function R9CalCalendarMouseDown(id,e){
R9_Objects[id].calmousedown(e);
}
function R9Calendar(){
this.id=null;
this.gstrHTML=null;
this.totalViews=0;
this.initialViewsToCreate=2;
this.Views=new Array(144);
this.objToAlignTo;
this.origMth;
this.origYr;
this.views;
this.firstValidDate=new Date();
this.lastValidDate=new Date();
this.earliestDateAllowed;
this.latestDateAllowed;
this.dteSelected=new Date();
this.iTextFields=0;
this.arRegisteredTextFields=new Array();
this.iSelFields=0;
this.arRegisteredSelFields=new Array();
this.arSourceTextFields=new Array();
this.iSourceTextFields=0;
this.arAssocTextFields=new Array();
this.iAssocTextFields=0;
this.arSourceSelFields=new Array();
this.iSourceSelFields=0;
this.arAssocSelFields=new Array();
this.iAssocSelFields=0;
this.dteToday;
this.selMth;
this.currentMth;
this.currentYr;
this.arNonActiveDates=new Array();
this.lastValidatedSelDate="";
this.lastValidatedTxtDate="";
this.lastValidatedDate=new Date();
this.bStartDebugging=false;
this.bUpdatingFieldsAuto=false;
this.bCreatingCalendar=true;
this.bCalendarCreated=false;
this.bPoppedUp=false;
this.bValidatingDate=false;
this.bChangingSelectedDate=false;
this.dteInitialFirstValidDate=new Date();
this.dteInitialFromMonth=parseInt(this.dteInitialFirstValidDate.getMonth());
this.dteInitialFromYear=this.dteInitialFirstValidDate.getFullYear();
this.oldmousedown=null;
this.calClicked=false;
this.arrMonths=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
this.dow=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
this.firstDOW=(1-1);
this.changeCB=null;
this.initialize=function(){
this.id=R9_Objects.length;
R9_Objects[this.id]=this;
};
this.init=function(){
this.selMth=0;
this.dteToday=new Date();
this.dteToday.setHours("00");
this.dteToday.setMinutes("00");
this.dteToday.setSeconds("00");
};
this.prevMth=function(_5,_6,_7){
var _8,_9;
_8=parseInt(_6);
_9=parseInt(_5)-1;
_9=parseInt(_9)-(parseInt(_7));
if(_9<1){
_9=11;
_8=parseInt(_8)-1;
}
this.changeMonth(_9,_8);
};
this.nextMth=function(_a,_b,_c){
var _d,_e;
_d=parseInt(_b);
_e=parseInt(_a)+1;
_e=parseInt(_e)-(parseInt(_c)-1);
if(_e>12){
_e=parseInt(_e)-12;
_d=parseInt(_d)+1;
}
this.changeMonth(_e,_d);
};
this.strikeExcludedDates=function(){
for(i=0;i<this.arNonActiveDates.length;i++){
dteExcluded=this.arNonActiveDates[i];
this.Date_strike(dteExcluded);
}
};
this.Text_registered=function(_f){
var i;
for(i=0;i<this.iTextFields;i++){
if(_f==this.arRegisteredTextFields[i]){
return true;
}
}
return false;
};
this.Select_registered=function(_11){
var i;
for(i=0;i<this.iSelFields;i++){
if(_11==this.arRegisteredSelFields[i]){
return true;
}
}
return false;
};
this.registerTextField=function(_13){
if(!this.Text_registered(_13)){
this.arRegisteredTextFields[this.iTextFields]=_13;
this.iTextFields++;
}
};
this.registerSelectField=function(_14){
if(!this.Select_registered(_14)){
this.arRegisteredSelFields[this.iSelFields]=_14;
this.iSelFields++;
}
};
this.registerFieldPair=function(_15,_16){
this.registerTextField(_15);
this.registerSelectField(_16);
};
this.deregisterAllFields=function(){
this.arRegisteredTextFields=new Array();
this.iTextFields=0;
this.arRegisteredSelFields=new Array();
this.iSelFields=0;
};
this.deregisterTextField=function(_17){
temp_arRegisteredTextFields=new Array();
tempFields=0;
for(i=0;i<this.arRegisteredTextFields.length;i++){
if(this.arRegisteredTextFields[i]==_17){
}else{
temp_arRegisteredTextFields[tempFields++]=this.arRegisteredTextFields[i];
}
}
this.arRegisteredTextFields=temp_arRegisteredTextFields;
this.iTextFields=this.arRegisteredTextFields.length;
};
this.deregisterSelectField=function(_18){
temp_arRegisteredSelFields=new Array();
tempFields=0;
for(i=0;i<this.arRegisteredSelFields.length;i++){
if(this.arRegisteredSelFields[i]==_18){
}else{
temp_arRegisteredSelFields[tempFields++]=this.arRegisteredSelFields[i];
}
}
this.arRegisteredSelFields=temp_arRegisteredSelFields;
};
this.isValidDate=function(_19){
if(Date.parse(_19)!=Date.parse(_19)){
return false;
}
return true;
};
this.Text_updateAssociatedFields=function(_1a,_1b){
for(i=0;i<this.arSourceTextFields.length;i++){
if(this.arSourceTextFields[i]==_1a){
txtAssociatedFieldId=this.arAssocTextFields[i];
selAssociatedFieldId=this.arAssocSelFields[i];
this.txtAssociatedField_update(_1a,_1b,txtAssociatedFieldId,selAssociatedFieldId);
}
}
};
this.updateRegisteredFields=function(){
if(this.bUpdatingFieldsAuto){
return;
}else{
this.bUpdatingFieldsAuto=true;
}
if(this.bCreatingCalendar){
return;
}
strMonthYear=this.Date_getStringMonth((parseInt(this.dteSelected.getMonth())+1),this.dteSelected.getFullYear());
var i;
for(i=0;i<this.arRegisteredSelFields.length;i++){
objToUpdate=document.getElementById(this.arRegisteredSelFields[i]);
objToUpdate.selectedIndex=this.Select_getOptionPosition(objToUpdate,strMonthYear);
}
for(i=0;i<this.iTextFields;i++){
objToUpdate=document.getElementById(this.arRegisteredTextFields[i]);
objToUpdate.value=this.dteSelected.getDate();
this.Date_validate(this.arRegisteredTextFields[i],this.arRegisteredSelFields[i],null,false);
this.Text_updateAssociatedFields(this.arRegisteredTextFields[i],this.arRegisteredSelFields[i]);
}
this.bUpdatingFieldsAuto=false;
};
this.Select_getOptionPosition=function(_1d,_1e){
selectedIndex=0;
for(i=0;i<_1d.options.length;i++){
if(_1d.options[i].text==_1e){
selectedIndex=i;
}
}
return (selectedIndex);
};
this.changeSelectDate=function(_1f){
if(this.bChangingSelectedDate){
return;
}else{
this.bChangingSelectedDate=true;
}
if(this.bCreatingCalendar==true){
return;
}
oldSelectedDate=new Date(this.dteSelected);
if(this.isValidDate(_1f)){
_1f=new Date(_1f);
if(this.Date_isGreaterThan(this.earliestDateAllowed,_1f)){
_1f=new Date(this.earliestDateAllowed.getFullYear(),this.earliestDateAllowed.getMonth(),this.earliestDateAllowed.getDate());
}
while(!this.Date_isActiveDate(_1f)&&(this.Date_isGreaterThanOrEqualTo(this.latestDateAllowed,_1f))){
_1f.setDate(parseInt(_1f.getDate())+1);
}
if(!this.Date_isGreaterThanOrEqualTo(this.latestDateAllowed,_1f)){
_1f=new Date(oldSelectedDate);
}
this.dteSelected=new Date(_1f);
if(!this.Date_isVisible(this.dteSelected)){
this.currentMth=this.dteSelected.getMonth();
this.currentYr=this.dteSelected.getFullYear();
}
rewriteMonth=parseInt(this.currentMth)+1;
if(this.bPoppedUp==true){
this.reWrite(this.getView(rewriteMonth+(12*((this.currentYr-this.origYr)+1)),this.dteSelected.getMonth()+1,this.dteSelected.getFullYear(),this.dteSelected));
}
this.updateRegisteredFields();
}
this.bChangingSelectedDate=false;
if(this.changeCB!=null&&this.changeCB.length>0){
eval(this.changeCB);
}
};
this.Date_isVisible=function(_20){
var _21=_20.getMonth();
var _22=_20.getFullYear();
if(this.currentYr==_22){
if(this.currentMth==_21){
return true;
}else{
if((_21<=(this.currentMth+this.views))&&(_21>=this.currentMth)){
return true;
}
}
}
return false;
};
this.changeMonth=function(_23,_24){
this.currentMth=_23+1;
this.currentYr=_24;
this.reWrite(this.getView(_23+(12*((_24-this.origYr)+1)),_23,_24,this.dteToday));
};
this.reWrite=function(_25){
document.getElementById("CalendarView").innerHTML=_25;
strId=this.dteSelected.getDate()+this.Date_getStringMonth((this.dteSelected.getMonth()+1),this.dteSelected.getFullYear());
for(iView=1;iView<=this.totalViews;iView++){
newStrId=strId+iView;
if(document.getElementById(newStrId)){
if(document.getElementById(newStrId).className=="currMthDay"){
document.getElementById(newStrId).className="selected";
}
}else{
}
}
this.strikeExcludedDates();
if(this.objToAlignTo){
this.Div_position(this.objToAlignTo);
}
};
this.Date_isGreaterThanOrEqualTo=function(_26,_27){
if(this.Date_isEqualTo(_26,_27)){
return true;
}else{
if(_26.valueOf()>_27.valueOf()){
return true;
}else{
return false;
}
}
return false;
};
this.Date_isGreaterThan=function(_28,_29){
if(!this.Date_isEqualTo(_28,_29)){
if(_28.valueOf()>_29.valueOf()){
return true;
}else{
return false;
}
}else{
return false;
}
return false;
};
this.Date_isEqualTo=function(_2a,_2b){
if(_2a.getMonth()==_2b.getMonth()){
if(_2a.getFullYear()==_2b.getFullYear()){
if(_2a.getDate()==_2b.getDate()){
return true;
}
}
}
return false;
};
this.Date_getDayClass=function(_2c,_2d){
dteToday=new Date();
if(!this.Date_isActiveDate(_2c)){
strDayClass="inactiveDay";
return (strDayClass);
}
if(_2d.getMonth()==_2c.getMonth()){
strDayClass="currMthDay";
}else{
if(this.Date_isGreaterThan(_2d,_2c)){
strDayClass="prevMthDay";
}else{
strDayClass="nextMthDay";
}
}
return (strDayClass);
};
this.Date_isLeapYear=function(_2e){
var _2f=new Date();
_2f.setFullYear(_2e.getFullYear());
_2f.setMonth(2);
_2f.setDate(1);
dteLastDayOfFeb=_2f;
dteLastDayOfFeb.setDate(_2f.getDate()-1);
if(dteLastDayOfFeb.getDate()==29){
return (true);
}else{
return (false);
}
return (false);
};
this.Date_getTotalDaysInMth=function(_30){
var _31;
if(this.Date_isLeapYear(_30)){
_31=new Array(31,29,31,30,31,30,31,31,30,31,30,31);
}else{
_31=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
}
totalDaysCurrMth=_31[_30.getMonth()];
return (totalDaysCurrMth);
};
this.Date_getPrevDaysForMthView=function(_32){
iDayOfWeek=_32.getDay();
iDayOfWeek++;
if(iDayOfWeek>1){
iPrevDays=iDayOfWeek-1;
}else{
iPrevDays=0;
}
if(this.firstDOW!=0){
if(iPrevDays>=this.firstDOW){
iPrevDays=iPrevDays-this.firstDOW;
}else{
iPrevDays=7-this.firstDOW-iPrevDays;
}
}
return (iPrevDays);
};
this.Date_getDaysInView=function(_33){
iDaysInMthView=this.Date_getPrevDaysForMthView(_33);
iDaysInMthView=iDaysInMthView+this.Date_getTotalDaysInMth(_33);
iNumWeeks=Math.round(((iDaysInMthView+6)/7)-0.5);
iTotalDays=iNumWeeks*7;
return (iTotalDays);
};
this.Date_getFirstOfMonthInCalendarView=function(_34,_35){
dteFirstInMthYr=new Date(_35,parseInt(_34)-1,1);
return (dteFirstInMthYr);
};
this.Date_isActiveDate=function(_36){
if(this.Date_isGreaterThanOrEqualTo(_36,this.dteToday)){
if(this.Date_isGreaterThanOrEqualTo(_36,this.earliestDateAllowed)){
if(this.Date_isGreaterThanOrEqualTo(this.latestDateAllowed,_36)){
if(!this.Date_isInactiveDate(_36)){
return true;
}
}
}
}
return false;
};
this.Date_isInactiveDate=function(_37){
var i;
if(this.arNonActiveDates.length==0){
}else{
for(i=0;i<this.arNonActiveDates.length;i++){
if(this.Date_isEqualTo(_37,this.arNonActiveDates[i])){
return true;
}
}
}
if(this.Date_isGreaterThan(this.firstValidDate,_37)){
return true;
}
if(this.Date_isGreaterThan(_37,this.lastValidDate)){
return true;
}
return false;
};
this.Date_getMonthValue=function(_39){
for(i=0;i<this.arrMonths.length;i++){
if(this.arrMonths[i]==_39){
return (i);
}
}
};
this.Date_getStringMonth=function(_3a,_3b){
strMonth=this.arrMonths[_3a-1];
strMonth=strMonth+" "+_3b;
return (strMonth);
};
this.Document_write=function(_3c){
gstrHTML=gstrHTML+_3c;
};
this.Div_hide=function(_3d){
this.bPoppedUp=false;
if(document.layers){
document[_3d].visibility="hide";
document["frame"+_3d].visibility="hide";
}else{
if(document.all){
document.all[_3d].style.visibility="hidden";
document.all["frame"+_3d].style.visibility="hidden";
}else{
if(document.getElementById){
document.getElementById(_3d).style.visibility="hidden";
document.getElementById("frame"+_3d).style.visibility="hidden";
}
}
}
this.deregisterAllFields();
this.resetExcludedDates();
};
this.Div_show=function(_3e){
if(document.layers){
document[_3e].visibility="show";
document["frame"+_3e].visibility="show";
}else{
if(document.all){
document.all[_3e].style.visibility="visible";
document.all["frame"+_3e].style.visibility="visible";
}else{
if(document.getElementById){
document.getElementById(_3e).style.visibility="visible";
document.getElementById("frame"+_3e).style.visibility="visible";
}
}
}
};
this.writeTopOfHTMLTable=function(_3f,_40,_41,_42){
var _43,_44;
gstrHTML=gstrHTML+"<table border=0 class=\"calendar\" cellspacing=\"0\" cellpadding=\"0\" id=\"calendar\"     >";
if(this.selMth==0){
gstrHTML=gstrHTML+"<tr> <!-- top row --><td class=\"headerCell\" colspan=\"15\"><a class=\"close\" href=\"javascript: R9_Objects["+this.id+"].hideCalendar();\">close</a>\t</td>\t</tr>";
}
var _45=new Date();
_45.setYear(_40);
_45.setMonth(_3f-1);
_45.setDate(1);
prevViewDate=new Date(_45);
prevViewDate.setMonth(parseInt(prevViewDate.getMonth())-parseInt(this.selMth));
prevViewDate.setDate(parseInt(prevViewDate.getDate())-1);
if(this.Date_isGreaterThanOrEqualTo(prevViewDate,this.earliestDateAllowed)){
gstrHTML=gstrHTML+"<tr><td colspan=\"15\"><table class=\"prevnext\" border=\"0\">     <!--containing top row after the close button (prev button, select month, next button) -->   <tr>    <td width=\"33%\" align=\"left\"><input class=\"prevnextbtn\" type=\"button\" id=\"btnPrevMth\" name=\"btnPrevMth\" width=\"5px\" value=\"&laquo;\" onClick=\"R9_Objects["+this.id+"].prevMth("+_3f+","+_40+","+this.selMth+");\" />";
}else{
gstrHTML=gstrHTML+"<tr><td colspan=\"15\"><table class=\"prevnext\" border=\"0\">     <!--containing top row after the close button (prev button, select month, next button) -->   <tr>    <td width=\"33%\" align=\"left\"><input class=\"prevnextbtn\" type=\"button\" id=\"btnPrevMth\" name=\"btnPrevMth\" width=\"5px\" value=\"&laquo;\" onClick=\"\" disabled/>";
}
gstrHTML=gstrHTML+"</td><td width=\"33%\" align=\"center\">";
gstrHTML=gstrHTML+"<select id=\"selMthList\" class=\"selMth\""+parseInt(this.selMth)+" width=\"66px\" onChange=\"javascript:document.location.href=this.value;\">";
this.selMth=parseInt(this.selMth)+1;
_43=this.origYr;
_44=this.origMth;
i=0;
while(i<=12){
if(_44<=12){
displayMonth=_44;
}else{
_43=parseInt(this.origYr)+1;
displayMonth=parseInt(_44)-12;
}
if((_3f==displayMonth)&&(_40==_43)){
strUrlString="javascript: R9_Objects["+this.id+"].changeMonth("+parseInt(displayMonth.toString())+","+_43+")";
if(displayMonth<10){
displayMonth="0"+displayMonth.toString();
}
gstrHTML=gstrHTML+"<option value=\""+strUrlString+"\" selected>"+this.Date_getStringMonth(displayMonth,_43).toUpperCase()+"</option>";
}else{
strUrlString="javascript: R9_Objects["+this.id+"].changeMonth("+parseInt(displayMonth.toString())+","+_43+")";
if(displayMonth<10){
displayMonth="0"+displayMonth.toString();
}
gstrHTML=gstrHTML+"<option value=\""+strUrlString+"\">"+this.Date_getStringMonth(displayMonth,_43)+"</option>";
}
_44++;
i++;
}
gstrHTML=gstrHTML+"</select>";
iViewsRemaining=parseInt(this.views)-parseInt(this.selMth);
currentViewMaxDate=new Date(_45);
currentViewMaxDate.setMonth(currentViewMaxDate.getMonth()+iViewsRemaining+1);
currentViewMaxDate.setDate(currentViewMaxDate.getDate()-1);
if(this.Date_isGreaterThan(this.latestDateAllowed,currentViewMaxDate)){
gstrHTML=gstrHTML+"</td>\t<td width=\"33%\" align=\"right\"><input class=\"prevnextbtn\" type=\"button\" value=\"&raquo;\" id=\"btnNextMth\" name=\"btnNextMth\" onClick=\"R9_Objects["+this.id+"].nextMth("+_3f+","+_40+","+this.selMth+");\" /></td></tr>\t</table></td></tr>";
}else{
gstrHTML=gstrHTML+"</td>\t<td width=\"33%\" align=\"right\"><input class=\"prevnextbtn\" type=\"button\" value=\"&raquo;\" id=\"btnNextMth\" name=\"btnNextMth\" onClick=\"\" disabled/></td></tr>\t</table></td></tr>";
}
gstrHTML=gstrHTML+"<tr class=\"dayOfWeekRow\"><td></td>";
for(var i=0;i<7;i++){
var _47=(i+this.firstDOW)%7;
gstrHTML=gstrHTML+"<td class=\"dayOfWeek\">"+this.dow[_47].charAt(0)+"</td><td></td>";
}
gstrHTML=gstrHTML+"<td></td></tr>";
};
this.findPosX=function(obj){
var _49=0;
if(obj.offsetParent){
while(obj.offsetParent){
_49+=obj.offsetLeft;
obj=obj.offsetParent;
}
}else{
if(obj.x){
_49+=obj.x;
}
}
return _49;
};
this.findPosY=function(obj){
var _4b=0;
if(obj.offsetParent){
while(obj.offsetParent){
_4b+=obj.offsetTop;
obj=obj.offsetParent;
}
}else{
if(obj.y){
_4b+=obj.y;
}
}
return _4b;
};
this.Div_position=function(_4c){
var _4d,_4e,_4f,_50;
var div;
var _52,_53;
_4e=this.findPosX(_4c);
_4d=this.findPosY(_4c);
div=document.getElementById("CalendarView");
frame=document.getElementById("frameCalendarView");
_53=_4d-(div.offsetHeight/2);
_52=_4e+_4c.offsetWidth+5;
if(_53<0){
_53=0;
}
if(_52<0){
_52=0;
}
frame.height=div.offsetHeight+2;
frame.width=div.offsetWidth+2;
frame.style.top=(_53-0+0)+"px";
frame.style.left=(_52-0+0)+"px";
div.style.top=_53+"px";
div.style.left=_52+"px";
div.zIndex=1000;
};
this.createView=function(_54,_55,_56,_57,_58,_59){
var _5a;
this.init();
gstrHTML="";
this.origMth=_56;
this.origYr=_57;
this.firstValidDate=new Date(this.dteInitialFirstValidDate);
this.firstValidDate.setHours(0);
this.firstValidDate.setMinutes(0);
this.firstValidDate.setSeconds(0);
this.currentMth=_54;
this.currentYr=_55;
this.dteSelected=new Date(_59);
this.views=_58;
this.earliestDateAllowed=new Date(this.firstValidDate);
this.lastValidDate=new Date(this.earliestDateAllowed);
this.lastValidDate.setFullYear(this.lastValidDate.getFullYear()+1);
this.earliestDateAllowed.setDate(1);
this.latestDateAllowed=new Date(this.firstValidDate);
this.latestDateAllowed.setFullYear(this.origYr+1);
this.latestDateAllowed.setMonth(this.latestDateAllowed.getMonth()+1);
this.latestDateAllowed.setDate(1);
this.latestDateAllowed.setDate(this.latestDateAllowed.getDate()-1);
this.latestDateAllowed.setHours("23");
this.latestDateAllowed.setMinutes("59");
this.latestDateAllowed.setSeconds("59");
var _5b=new Date(_55,parseInt(_54)-1,1);
var _5c=_5b.getMonth();
_5c=parseInt(_5c)+this.views;
_5b.setMonth(_5c);
_5b.setDate(parseInt(_5b.getDate())-1);
while(this.Date_isGreaterThan(_5b,this.latestDateAllowed)==true){
this.views=this.views-1;
_5b.setDate(1);
_5b.setDate(parseInt(_5b.getDate())-1);
}
if(this.origMth==0){
this.origMth=_54;
this.origYr=_55;
}
_5a=1;
this.draw(_54,_55,_56,_57);
var _5d=_54;
var _5e=_55;
while(_5a<this.views){
newYear=parseInt(_55);
newMonth=parseInt(_54)+1;
if(newMonth>12){
newMonth=parseInt(newMonth)-12;
newYear=parseInt(newYear)+1;
}
dteFirstOfNewMonth=new Date();
dteFirstOfNewMonth.setYear(newYear);
dteFirstOfNewMonth.setMonth(newMonth-1);
dteFirstOfNewMonth.setDate(1);
if(this.Date_isGreaterThanOrEqualTo(this.latestDateAllowed,dteFirstOfNewMonth)){
this.draw(newMonth,newYear,_56,_57);
}else{
}
_5a=_5a+1;
}
this.Views[_5d+(12*((_5e-this.origYr)+1))]=gstrHTML;
gstrHTML="";
};
this.Date_displayAsPrevNext=function(_5f,_60,_61){
var _62=false;
var _63=false;
if(this.views==1){
return true;
}
var _64=new Date(_61,_60,1);
if(this.Date_isGreaterThanOrEqualTo(_5f,_64)){
_62=true;
}else{
_63=true;
}
var _65=this.views-(this.selMth);
if((_62==true)&&(_65==0)){
return true;
}
if((_63==true)&&(this.selMth==1)){
return true;
}
return false;
};
this.draw=function(_66,_67,_68,_69){
this.totalViews++;
var _6a=new Date();
if(_66<1||_66>12){
_66=_6a.getMonth()+1;
}
if(_67<2005||_67>2028){
_67=_6a.getFullYear();
}
this.writeTopOfHTMLTable(_66,_67,_68,_69);
firstDayCurrentMth=new Date(this.Date_getFirstOfMonthInCalendarView(_66,_67));
iDaysPrev=this.Date_getPrevDaysForMthView(firstDayCurrentMth);
_6a=new Date(firstDayCurrentMth);
_6a.setDate(firstDayCurrentMth.getDate()-iDaysPrev);
dysRemainingInView=this.Date_getDaysInView(firstDayCurrentMth);
iRow=0;
while((dysRemainingInView>0)||((iRow<6)&&(this.views==this.selMth))){
iRow++;
gstrHTML=gstrHTML+"<tr class='numbersRow'><td>&nbsp;</td>";
dysDisplayedThisRow=0;
while(((dysRemainingInView>0)||((iRow<7)&&(this.views==this.selMth)))&&(dysDisplayedThisRow<7)){
displayMonth=parseInt(_6a.getMonth())+1;
gstrHTML=gstrHTML+"<td tabindex=-1 "+" id='"+_6a.getDate();
gstrHTML=gstrHTML+this.Date_getStringMonth(displayMonth,_6a.getFullYear())+this.totalViews+"'";
gstrHTML=gstrHTML+" name='"+_6a.getDate();
gstrHTML=gstrHTML+this.Date_getStringMonth(displayMonth,_6a.getFullYear())+this.totalViews+"'";
dayClass=this.Date_getDayClass(_6a,firstDayCurrentMth);
gstrHTML=gstrHTML+" class='"+dayClass+"' >";
if((this.Date_isActiveDate(_6a))&&(dayClass!="prevMthDay")&&(dayClass!="nextMthDay")){
strURL="<a tabindex=-1 href='javascript:R9_Objects["+this.id+"].changeSelectDate(\"";
strURL=strURL+_6a+"\");R9_Objects["+this.id+"].Div_hide(\"CalendarView\");'>"+_6a.getDate()+"</a>";
gstrHTML=gstrHTML+strURL;
}else{
if((dayClass=="prevMthDay")||(dayClass=="nextMthDay")){
if(this.Date_displayAsPrevNext(_6a,_66,_67)==true){
gstrHTML=gstrHTML+""+_6a.getDate()+"";
}
}else{
gstrHTML=gstrHTML+"<strike>"+_6a.getDate()+"</strike>";
}
}
gstrHTML=gstrHTML+"</td><td class=\"daySpacer\">&nbsp;</td>";
dysRemainingInView--;
dysDisplayedThisRow++;
_6a.setDate(_6a.getDate()+1);
}
gstrHTML=gstrHTML+"</tr>";
}
while(iRow<6){
gstrHTML=gstrHTML+"<tr><td colspan=14>&nbsp;</td></tr>";
iRow++;
}
gstrHTML=gstrHTML+"</table>";
};
this.createCalendar=function(_6b,_6c,_6d,_6e){
this.bCreatingCalendar=true;
this.currentMth=_6d;
this.currentYr=_6e;
if((_6b=="")||(_6b==null)){
_6b=new Date();
}else{
_6b=new Date(_6b);
}
this.dteInitialFromMonth=_6b.getMonth()+1;
this.dteInitialFromYear=_6b.getFullYear();
dteFromDate=_6b.getDate();
this.dteInitialFirstValidDate=new Date(this.dteInitialFromYear,this.dteInitialFromMonth-1,dteFromDate);
dteMonth=this.dteInitialFromMonth;
dteYear=this.dteInitialFromYear;
for(iViewCalendar=1;iViewCalendar<=this.initialViewsToCreate;iViewCalendar++){
this.createView(dteMonth,dteYear,this.dteInitialFromMonth,this.dteInitialFromYear,_6c,this.dteInitialFirstValidDate);
dteMonth++;
if(dteMonth>12){
dteMonth=parseInt(dteMonth)-12;
dteYear++;
}
}
this.bCreatingCalendar=false;
this.bCalendarCreated=true;
this.changeSelectDate(this.dteInitialFirstValidDate);
var id=this.id;
var _70=document.getElementById("CalendarView");
_70.onmousedown=function(e){
R9CalCalendarMouseDown(id,e);
};
this.oldmousedown=document.onmousedown?document.onmousedown:null;
document.onmousedown=function(e){
R9CalPageMouseDown(id,e);
};
};
this.calmousedown=function(e){
this.calClicked=true;
};
this.pagemousedown=function(e){
if(!this.calClicked){
this.hideCalendar();
if(this.oldmousedown){
this.oldmousedown(e);
}
}
this.calClicked=false;
};
this.Select_getYear=function(_75){
selText=_75.options[_75.selectedIndex].text;
strArray=selText.split(" ");
return (strArray[1]);
};
this.Select_getMonth=function(_76){
selText=_76.options[_76.selectedIndex].text;
strArray=selText.split(" ");
strMonth=this.Date_getMonthValue(strArray[0]);
return (strMonth);
};
this.Date_strike=function(_77){
_77=new Date(_77);
strId=_77.getDate()+this.Date_getStringMonth((_77.getMonth()+1),_77.getFullYear());
for(iView=1;iView<=this.totalViews;iView++){
if(document.getElementById(strId+iView)){
document.getElementById(strId+iView).innerHTML="<strike>"+_77.getDate()+"</strike>";
}
}
};
this.resetExcludedDates=function(){
this.arNonActiveDates=new Array();
};
this.setExcludedDates=function(_78){
this.arNonActiveDates=_78;
};
this.addExcludedDates=function(_79){
var _7a=this.arNonActiveDates.length;
for(iExcludedDate=0;iExcludedDate<_79.length;iExcludedDate++){
this.arNonActiveDates[_7a++]=new Date(_79[iExcludedDate]);
}
};
this.addPeriodOfExcludedDates=function(_7b,_7c){
var i=this.arNonActiveDates.length;
var _7e=new Date(_7b);
while(this.Date_isGreaterThan(_7c,_7e)){
this.arNonActiveDates[i]=new Date(_7e);
_7e.setDate(parseInt(_7e.getDate())+1);
i=i+1;
}
};
this.hideCalendar=function(){
this.Div_hide("CalendarView");
};
this.getView=function(idx,_80,_81,_82){
if(this.Views[idx]==null){
this.createView(_80,_81,this.dteInitialFromMonth,this.dteInitialFromYear,this.views,_82);
}
return this.Views[idx];
};
this.popUp=function(_83,_84,_85,_86,_87,_88){
this.changeCB=_88;
if(!this.bPoppedUp){
this.bPoppedUp=true;
}else{
this.Div_hide("CalendarView");
this.bPoppedUp=true;
}
if(_86){
this.objToAlignTo=_86;
}else{
if(_85){
this.objToAlignTo=_85;
}else{
if(_84){
this.objToAlignTo=_84;
}
}
}
this.resetExcludedDates();
if((_84)&&(_85)){
strYear=this.Select_getYear(_85);
strMonth=this.Select_getMonth(_85);
strDay=_84.value;
if(strDay==""){
strDay="1";
_84.value=1;
}
dteSelectedDate=new Date(strYear,strMonth,strDay,0,0,0);
this.registerFieldPair(_84.id,_85.id);
}
if((_83=="")||(_83==null)){
_83=new Date();
}else{
_83=new Date(_83);
}
_83.setHours(0);
_83.setMinutes(0);
_83.setSeconds(0);
if(this.Date_isGreaterThan(_83,this.earliestDateAllowed)){
this.addPeriodOfExcludedDates(this.earliestDateAllowed,_83);
}
this.firstValidDate=new Date(_83);
if((dteSelectedDate=="")||(dteSelectedDate==null)){
dteSelectedDate=this.dteSelected;
}else{
if(_87){
this.addExcludedDates(_87);
}
this.changeSelectDate(dteSelectedDate);
}
this.dteInitialFromMonth=_83.getMonth()+1;
this.dteInitialFromYear=_83.getFullYear();
dteFromDate=_83.getDate();
this.dteInitialFirstValidDate=this.dteInitialFromMonth+"/"+dteFromDate+"/"+this.dteInitialFromYear;
dteMonth=parseInt(this.dteSelected.getMonth())+1;
dteYear=this.dteSelected.getFullYear();
this.Div_position(this.objToAlignTo);
if(!this.Date_isVisible(this.dteSelected)){
this.reWrite(this.getView(dteMonth+(12*((dteYear-this.origYr)+1)),dteMonth,dteYear,dteSelectedDate));
}
this.Div_show("CalendarView");
};
this.generateSelect=function(_89,_8a,_8b,_8c,_8d,_8e,_8f,_90,_91){
var _92,_93,i;
var _95;
strSelectString="<select class=\"calendar_my_select\"  id=\""+_8d+"\""+" name=\""+_8d+"\""+" width=\"66px\"  onChange=\"javascript: R9_Objects["+this.id+"].Date_validate('"+_8e+"','"+_8d+"','"+_8f+"',"+_90+");"+((_91==null)?"":_91)+"\" onFocus=\"javascript: R9_Objects["+this.id+"].Date_validate('"+_8e+"','"+_8d+"','"+_8f+"',"+_90+");\">";
_92=_8c;
_93=_8b+1;
i=0;
while(i<=12){
if(_93<=12){
_95=_93;
}else{
_92=parseInt(_8c)+1;
_95=parseInt(_93)-12;
}
if((_89==_95)&&(_8a==_92)){
if(_95<10){
_95="0"+_95.toString();
}
strUrlString=""+_95+_92;
strSelectString=strSelectString+"<option value=\""+strUrlString+"\" selected>"+this.Date_getStringMonth(_95,_92)+"</option>";
}else{
if(_95<10){
_95="0"+_95.toString();
}
strUrlString=""+_95+_92;
strSelectString=strSelectString+"<option value=\""+strUrlString+"\">"+this.Date_getStringMonth(_95,_92)+"</option>";
}
_93++;
i++;
}
strSelectString=strSelectString+"</select>";
return (strSelectString);
};
this.Date_getDayString=function(_96){
iDayValue=_96.getDay();
sDayString=this.dow[iDayValue];
return (sDayString);
};
this.Date_changed=function(_97,_98){
this.bStartDebugging=true;
if(this.Date_isEqualTo(this.dteSelected,this.lastValidatedDate)){
}else{
Date_lastValidated=new Date(this.dteSelected);
this.lastValidatedTxtDate=document.getElementById(_97).value;
this.lastValidatedSelDate=document.getElementById(_98).text;
return true;
}
if(this.lastValidatedTxtDate!=document.getElementById(_97).value){
Date_lastValidated=new Date(this.dteSelected);
this.lastValidatedTxtDate=document.getElementById(_97).value;
this.lastValidatedSelDate=document.getElementById(_98).text;
return true;
}
if(!this.lastValidatedSelDate!=document.getElementById(_98).text){
Date_lastValidated=new Date(this.dteSelected);
this.lastValidatedTxtDate=document.getElementById(_97).value;
this.lastValidatedSelDate=document.getElementById(_98).options[document.getElementById(_98).selectedIndex].text;
return true;
}
return false;
};
this.Date_validate=function(_99,_9a,_9b,_9c){
if(this.bUpdatingFieldsAuto){
}
if(this.bValidatingDate){
return;
}else{
this.bValidatingDate=true;
}
if(this.bCreatingCalendar==true){
return;
}
if(!this.Date_changed(_99,_9a)){
this.bValidatingDate=false;
return;
}
dteDay=document.getElementById(_99).value;
if(dteDay==""){
this.bValidatingDate=false;
return;
}
objSelect=document.getElementById(_9a);
iSelected=objSelect.selectedIndex;
strMonthYear=objSelect.options[iSelected].text;
strArray=strMonthYear.split(" ");
selectedYear=strArray[1];
selectedMonth=strArray[0];
selectedMonth=this.Date_getMonthValue(selectedMonth);
dteSelectedMonthYearDate=new Date(selectedYear,selectedMonth,1);
if(dteDay>=this.Date_getTotalDaysInMth(dteSelectedMonthYearDate)){
dteDay=this.Date_getTotalDaysInMth(dteSelectedMonthYearDate);
document.getElementById(_99).value=dteDay;
}
dteSelectedDate=new Date(selectedYear,selectedMonth,dteDay);
if(document.getElementById(_99+"label")){
document.getElementById(_99+"label").innerHTML=this.Date_getDayString(dteSelectedDate);
}
if(this.bUpdatingFieldsAuto==false){
this.changeSelectDate(dteSelectedDate);
}
if((!this.bPoppedUp)&&(_9c==true)){
if(_9b){
this.popUp("",document.getElementById(_99),document.getElementById(_9a),document.getElementById(_9b),null);
}else{
this.popUp("",document.getElementById(_99),document.getElementById(_9a),null,null);
}
}
this.bValidatingDate=false;
};
this.Text_validateChars=function(_9d){
if(this.bValidatingDate){
return;
}else{
this.bValidatingDate=true;
}
if(this.bUpdatingFieldsAuto){
return;
}
var _9e="";
var _9f=false;
txtContents=_9d.value;
if(txtContents.length>1){
_9f=true;
lenContents=1;
}else{
lenContents=txtContents.length;
}
i=0;
while(i<=lenContents){
if((parseInt(txtContents.charAt(i))>=0)&&(parseInt(txtContents.charAt(i))<=9)){
_9e=_9e+txtContents.charAt(i);
}else{
_9f=true;
}
i=i+1;
}
if(parseInt(_9e)>31){
_9f=true;
_9e=_9e.charAt(1);
}
if(_9f){
_9d.value=_9e;
this.bValidatingDate=false;
return false;
}
this.bValidatingDate=false;
return true;
};
this.txtAssociatedField_update=function(_a0,_a1,_a2,_a3){
var _a4=this.Date_getDateFromFieldPair(_a0,_a1);
var _a5=this.Date_getDateFromFieldPair(_a2,_a3);
if(this.Date_isGreaterThan(_a4,_a5)){
_a5=new Date(_a4);
_a5.setDate(_a5.getDate()+7);
document.getElementById(_a2).value=_a5.getDate();
var _a6=document.getElementById(_a3);
var _a7=this.Date_getStringMonth((parseInt(_a5.getMonth())+1),_a5.getFullYear());
_a6.selectedIndex=this.Select_getOptionPosition(_a6,_a7);
this.Date_validate(_a2,_a3,null,false);
}
};
this.Text_associateTextField=function(_a8,_a9){
this.arSourceTextFields[this.iSourceTextFields]=_a8.id;
this.arAssocTextFields[this.iAssocTextFields]=_a9.id;
this.iSourceTextFields++;
this.iAssocTextFields++;
if(window.addEventListener){
}else{
}
};
this.Sel_associateSelField=function(_aa,_ab){
this.arSourceSelFields[this.iSourceSelFields]=_aa.id;
this.arAssocSelFields[this.iAssocSelFields]=_ab.id;
this.iSourceSelFields++;
this.iAssocSelFields++;
if(window.addEventListener){
}else{
}
};
this.setDayLabel=function(_ac,_ad){
var _ae=this.Date_getDateFromFieldPair(_ac,_ad);
if(_ae!=null&&document.getElementById(_ac+"label")){
document.getElementById(_ac+"label").innerHTML=this.Date_getDayString(_ae);
}
};
this.Date_getDateFromFieldPair=function(_af,_b0){
var _b1=document.getElementById(_b0);
var _b2=document.getElementById(_af);
if((_b2)&&(_b1)){
var _b3=_b1.options[_b1.selectedIndex].text;
var _b4=_b3.split(" ");
var _b5=_b4[1];
var _b6=_b4[0];
var _b6=this.Date_getMonthValue(_b6);
var _b7=new Date(_b5,_b6,_b2.value,0,0,0);
return (_b7);
}
return (null);
};
}
// r9compressed
