function Cal(el,_2){
this.wrapEl=el;
this.dayEl=null;
this.monthYrEl=null;
this.disp=false;
this.calWrap=null;
this.sizeX=null;
this.sizeY=null;
this.lBut=null;
this.myIndex=_2;
this.weekDayEl=null;
this.hideEls=false;
this.hiddenEls=null;
var uA=navigator.userAgent.toLowerCase();
if((uA.indexOf("mac")!=-1&&uA.indexOf("msie")!=-1)||uA.indexOf("safari")!=-1){
return false;
}
if((uA.indexOf("msie 5.5")!=-1)||(uA.indexOf("msie 6")!=-1)){
this.hideEls=true;
}
var _4=xGetElementsByTagName("input",this.wrapEl);
var _5=null;
var qS="";
for(var i=0;i<_4.length;i++){
if(_4[i].type=="hidden"){
if(_4[i].name=="calURL"){
_5=_4[i].value;
}else{
if(_4[i].name.match(/^cal(.)+/)){
qS+="&"+escape(_4[i].name)+"="+escape(_4[i].value);
}
}
}
}
if(_5==null){
return false;
}
if(_5.match(/\?/)){
_5+="&";
}else{
_5+="?";
}
_5+="calIndex="+this.myIndex+qS;
this.disp=false;
this.wrapEl.innerHTML="<input type=\"text\" size=\"3\" disabled=\"true\" class=\"calWeekDay\" id=\"cal_day_"+this.myIndex+"\"/> "+this.wrapEl.innerHTML+"<iframe class=\"calWrap\" src=\""+_5+"\" id=\"cal_"+this.myIndex+"\" name=\"cal_"+this.myIndex+"\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\" style=\"left:-99999px;top:-99999px;\"></iframe>"+"<input type=\"button\" class=\"calBut\" value=\"&nbsp;\" title=\"Choose dates from calendar\" id=\"cal_but_"+this.myIndex+"\"/>";
this.weekDayEl=document.getElementById("cal_day_"+this.myIndex);
this.calWrap=document.getElementById("cal_"+this.myIndex);
document.body.appendChild(this.calWrap);
this.lBut=document.getElementById("cal_but_"+this.myIndex);
var _8=xGetElementsByTagName("select",this.wrapEl);
for(var i=0;i<_8.length;i++){
if(_8[i].name=="startDay"){
this.dayEl=_8[i];
}else{
if(_8[i].name=="startMonthYearCombi"){
this.monthYrEl=_8[i];
}
}
if(this.dayEl!=null&&this.monthYrEl!=null){
break;
}
}
if(this.dayEl==null||this.monthYrEl==null){
return false;
}
this.sizeX=this.calWrap.offsetWidth;
this.sizeY=this.calWrap.offsetHeight;
var _9=this;
this._passCapDocClick=function(e){
_9.capDocClick(e);
};
if(!addEvent(window.document,"click",this._passCapDocClick,false)){
window.document.onclick+=this._passCapDocClick;
}
this.dayEl.onchange=this.monthYrEl.onchange=function(){
_9.dropDownChange();
};
this.dropDownChange=function(){
var d=new Date();
var _c=this.dayEl.selectedIndex+1;
var _d=this.monthYrEl.options[this.monthYrEl.selectedIndex].value.split("|");
d.setDate(1);
d.setMonth(_d[0]-1);
d.setFullYear(_d[1]);
var _e=getDaysInMonth(d);
if(_e<_c){
d.setDate(_e);
this.dayEl.options[_e-1].selected=true;
}else{
d.setDate(_c);
}
this.weekDayEl.value=_dateDays_short[d.getDay()];
this.updateCookies(d);
window.frames["cal_"+this.myIndex].ThisCal.redraw(d);
};
this.updateCookies=function(d){
setCookie("startDay",d.getDate(),"","/");
setCookie("startMonth",d.getMonth()+1,"","/");
setCookie("startYear",d.getYear(),"","/");
};
this.notifyChange=function(d,_11){
var cM=d.getMonth()+1;
var cY=d.getFullYear();
var _14=cM+"|"+cY;
this.dayEl.options[d.getDate()-1].selected=true;
for(i=0;i<this.monthYrEl.options.length;i++){
if(this.monthYrEl.options[i].value==_14){
this.monthYrEl.options[i].selected=true;
break;
}
}
this.weekDayEl.value=_dateDays_short[d.getDay()];
if(!_11){
this.calDisp();
this.updateCookies(d);
}
};
this.capDocClick=function(e){
if(!e){
e=window.event;
}
var _16=getTarg(e);
var _17,posY,tX,tY=0;
if(e.pageX||e.pageY){
_17=e.pageX;
posY=e.pageY;
}else{
if(e.clientX||e.clientY){
_17=e.clientX;
posY=e.clientY;
}
}
if(_16.id=="cal_but_"+this.myIndex){
var uA=navigator.userAgent.toLowerCase();
if(uA.indexOf("msie")!=-1){
_17+=document.body.scrollLeft;
posY+=document.body.scrollTop;
tX=(_17-this.sizeX)+this.lBut.offsetWidth*2;
tY=posY+Math.ceil(this.lBut.offsetHeight/2);
}else{
var _19=getAbsolutePos(this.lBut);
tX=(_19.x2+this.lBut.offsetWidth)-this.sizeX;
tY=_19.y2;
}
var ft=this;
var p=function(){
ft.calDisp(tX,tY);
};
this.lBut.blur();
setTimeout(p,50);
}else{
if(this.disp){
if(!(_17>this.x&&_17<this.x+this.sizeX)&&!(posY>this.y&&posY<this.y+this.sizeY)){
this.calDisp();
}
}
}
return;
};
this.calDisp=function(x,y){
if(this.disp){
tX=-99999;
tY=-99999;
}else{
tX=x;
tY=y;
}
this.calWrap.style.left=tX+"px";
this.calWrap.style.top=tY+"px";
this.disp=!this.disp;
};
}
function attachCals(){
var els=getElementsByClassName("calDate",document);
for(var i=0;i<els.length;i++){
cals[cals.length]=new Cal(els[i],i);
}
}
cals=new Array();
addLoadEvent(attachCals,true);

