YAHOO.namespace("calendar");
var Dom=YAHOO.util.Dom,currentCal=null,calMap=new Object();
YAHOO.widget.CalendarGroup.prototype.placeHolder="";
YAHOO.widget.CalendarGroup.prototype.imageHolder="";
YAHOO.widget.CalendarGroup.prototype.today=null;
YAHOO.widget.CalendarGroup.prototype.alert=false;
YAHOO.widget.CalendarGroup.prototype.currMonthDisp=null;
YAHOO.widget.Calendar.prototype.doPreviousMonthNav=function(C,B){var A=new Date();
if(B.currMonthDisp<=A.getMonth()){return false
}B.currMonthDisp=B.currMonthDisp-1;
Event.preventDefault(C);
setTimeout(function(){B.previousMonth();
var D=Dom.getElementsByClassName(B.Style.CSS_NAV_LEFT,"a",B.oDomContainer);
if(D&&D[0]){try{D[0].focus()
}catch(E){}}},0)
};
YAHOO.widget.Calendar.prototype.doNextMonthNav=function(B,A){A.currMonthDisp=A.currMonthDisp+1;
Event.preventDefault(B);
setTimeout(function(){A.nextMonth();
var C=Dom.getElementsByClassName(A.Style.CSS_NAV_RIGHT,"a",A.oDomContainer);
if(C&&C[0]){try{C[0].focus()
}catch(D){}}},0)
};
function creatorCal(B,C,K,G,D,E,H,I){if(K==null){K=90
}var A,F={pages:I||3,close:true,LOCALE_WEEKDAYS:"1char"},J=new Date();
J.setDate(J.getDate()+K);
F.mindate=E||new Date();
if(I==1){F.iframe=true
}if(K<0){}else{F.maxdate=J
}A=new YAHOO.widget.CalendarGroup(B,C,F);
A.render();
A.hide();
calMap[B]=A;
A.placeHolder=D;
A.alert=H||false;
A.placeHolderReal=B;
A.imageHolder=G;
A.currMonthDisp=(new Date).getMonth();
A.selectEvent.subscribe(handleSelect,A,true);
Dom.replaceClass(Dom.getElementsByClassName("today","td",C),"today","selected")
}function handleSelect(K,I,E){var C,L,G,M,H,D=0,F,B=false,J=new Date(),A=I[0];
J.setHours(0);
J.setMilliseconds(0);
J.setMinutes(0);
J.setSeconds(0);
C=A[0];
L=C[0];
G=C[1];
M=C[2];
if(M<10){M="0"+M
}if(G<10){G="0"+G
}H=Dom.get(E.placeHolder);
H.value=M+"/"+G+"/"+L;
H=Dom.get(E.placeHolderReal);
H.value=G+"/"+M+"/"+L;
if(E.alert){E.hide();
return 
}if(J<=setJSDate(H.value)){for(F in calMap){if(F!=null){if(B){calMap[F].cfg.setProperty("minDate",H.value,false);
calMap[F].render();
Dom.removeClass(Dom.getElementsByClassName("today","td",calMap[F].containerId),"today","previous");
calMap[F].hide();
break
}D++;
if((D==1)&&(calMap[F]==E)){B=true;
continue
}}}}E.hide()
}function show(A){if(currentCal!=null){currentCal.hide()
}calMap[A].show();
currentCal=calMap[A]
}function hideCal(A){if(A!=null&&calMap!=null){if(calMap[A]!=null){calMap[A].hide()
}}}function hide(D){try{if(calMap!=null){var G=null,C=null,B=null,F=null;
if(D==null||D==undefined){if(window.event!=null){B=window.event.srcElement
}}else{B=D.target
}if(B!=null){G=B.id
}if(G!=undefined&&G!=""){try{if(G==null){return 
}if(currentCal!=null){if((currentCal.placeHolder==G)||(currentCal.imageHolder==G)){}else{if(currentCal!=null){C=Dom.getAncestorByClassName(B,"yui-calcontainer multi");
if(C!=null){return 
}currentCal.hide();
currentCal=null
}}}}catch(E){B=null
}}else{if(currentCal!=null){C=Dom.getAncestorByClassName(B,"yui-calcontainer multi");
if(C!=null){return 
}currentCal.hide();
currentCal=null
}for(cal in calMap){calMap[cal].hide()
}}}}catch(A){}}hideEscCal=function(){if(currentCal!=null){currentCal.hide()
}else{for(cal in calMap){calMap[cal].hide()
}}};