﻿function EKCalendar(){}
EKCalendar.configure=function(){
    EKCalendar.Config=function(){};
    EKCalendar.Config.imagePath="Assets/Images/Icons/";
    EKCalendar.Config.calendarImages=["control_rewind_blue.gif","control_fastforward_blue.gif","cross.gif","down.gif","control_rewind_blue.gif","control_fastforward_blue.gif"];
    EKCalendar.Config.maxScreen=960;
    EKCalendar.Config.txtClose="";
    EKCalendar.Config.txtPrevMonth="";
    EKCalendar.Config.txtNextMonth="";
    EKCalendar.Config.txtSlctMonth="";
    EKCalendar.Config.txtSlctYear="";
    EKCalendar.Config.monthLong=["January","February","March","April","May","June","July","August","September","October","November","December"];
    EKCalendar.Config.monthShort=["01","02","03","04","05","06","07","08","09","10","11","12"];
    EKCalendar.Config.dayShort=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];
    EKCalendar.Config.firstDay = 0;
    EKCalendar.Config.monthDays=[31,28,31,30,31,30,31,31,30,31,30,31];
    EKCalendar.MSIE=(navigator.userAgent.indexOf("MSIE")>=0&&navigator.userAgent.indexOf("Opera")<0);
    EKCalendar.Opera=(navigator.userAgent.indexOf("Opera")>=0);
    EKCalendar.iCab=(navigator.userAgent.indexOf("iCab")>=0);
};

EKCalendar.padLeft=function(D,B,A){
    var C=D+"";
    while(C.length<A){
        C=B+C
    }
    return C
};

EKCalendar.showItem=function(A){
    A.style.display="block";
    A.style.visibility="visible";
};

EKCalendar.hideItem=function(A){
    A.style.display="none";
    A.style.visibility="hidden";
};

EKCalendar.isHidden=function(A){
    return(A.style.display=="none")
};

EKCalendar.findPos=function(A){
    var B=function(){};
    B.x=0;B.y=0;
    while(A.offsetParent){
        B.x+=A.offsetLeft;
        B.y+=A.offsetTop;
        A=A.offsetParent
     }
     return B
};

EKCalendar.getWindowSize=function(){
    var A=function(){};
    A.width=0;
    A.height=0;
    if(typeof (window.innerWidth)=="number"){
        A.width=window.innerWidth;
        A.height=window.innerHeight
    }else{
        if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
            A.width=document.documentElement.clientWidth;
            A.height=document.documentElement.clientHeight
        }else{
            if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
                A.width=document.body.clientWidth;
                A.height=document.body.clientHeight
            }
        }
    }return A
};

EKCalendar.getScrollPosition=function(){
    var A=function(){};
    A.x=0;
    A.y=0;
    if(typeof (window.pageYOffset)=="number"){
        A.x=window.pageXOffset;A.y=window.pageYOffset
    }else{
        if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){
            A.x=document.body.scrollLeft;
            A.y=document.body.scrollTop
        }else{
            if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){
                A.x=document.documentElement.scrollLeft;
                A.y=document.documentElement.scrollTop
            }
        }
    }
    return A
};

EKCalendar.preloadImages=function(){
    if(document.images){
        for(var B=0;B<this.Config.calendarImages.length;B++){
            var A=new Image(1,1);
            A.src=this.Config.imagePath+this.Config.calendarImages[B]
        }
     }
};

EKCalendar.purge=function(D){
    if(this.MSIE){
        var B=D.attributes,C,A,E;
        if(B){
            A=B.length;
            for(C=0;C<A;C+=1){
                E=B[C].name;
                if(typeof D[E]==="function"){
                    D[E]=null
                }
             }
        }
        B=D.childNodes;
        if(B){
            A=B.length;
            for(C=0;C<A;C+=1){
                this.purge(D.childNodes[C])
            }
         }
     }
 };
 
EKCalendar.leapYear=function(A){
    return((A%400)===0||((A%4)===0&&(A%100)!==0))
};

EKCalendar.cancelEvent=function(){
    return false
};

EKCalendar.resolveMonth=function(D,A,C){
    for(var B=0;B<12;B++){
        if(this.Config.monthShort[B]==D){
            if(A>0&&A<=this.Config.monthDays[B]){
                return B
            }
            else{
                if(A==29&&B==1&&this.leapYear(C)){
                return B
                }
                else{
                    return -1
                }
            }
        }
     }
     return -1
};

EKCalendar.parseDate=function(B){
    if(B){
        var D=B.split("/");
        if(D.length==3){
            if(D[2].length==2){
                D[2]="20"+D[2]
            }
            D[2]=parseFloat(D[2]);
            D[0]=parseFloat(D[0]);
            D[1]=this.resolveMonth(D[1],D[0],D[2]);
            if(D[1]!=-1){
                try{var A=new Date(D[2],D[1],D[0]);               
                if(A<this.startDate){
                    A.setTime(this.startDate.getTime())
                }
                if(A>this.endDate){
                    A.setTime(this.endDate.getTime());
                    A.setDate(1)
                }
                return A
                }
                catch(C){
                    return this.startDate
                }
            }
          }
     }
return this.startDate
};

EKCalendar.display=function(B,A,D,C,F,E){
    if(!this.Config){
        return 
    }
    if(typeof C=="undefined"){
        C=null
    }
    if(typeof F=="undefined"){
        F=0
    }
    if(typeof E=="undefined"){
        E=0
    }
    this.startDate=new Date(A.getTime());
    this.endDate=new Date(D.getTime());
    if(B&&B.tagName=="INPUT"){
        this.inputDate=this.parseDate(B.value);
        this.outputDate=new Date(this.inputDate.getTime())
    }
    else{
        return 
    }
    if(!this.calendarDiv){
        this.initialize()
    }else{
        if(!this.isHidden(this.calendarDiv)){
            this.closeCalendar();
            return false
        }
        this.updateMonths(this.monthPicker);
        this.updateYears(this.yearPicker);
        this.writeCalendarContent()
    }
    this.returnDateTo=B;
    this.dependentDateTo=C;
    this.dependentDaysDiff=F;
    this.calendarDiv.style.zIndex=-1000;
    this.showItem(this.calendarDiv);
    this.positionCalendar(E);
    this.calendarDiv.style.zIndex=1000;
    if(this.iframe){
        this.showItem(this.iframe);
        this.iframe.style.height="140px";
        this.iframe.style.width="195px"
    }
};

EKCalendar.initialize=function(){
    if(this.MSIE){
        this.iframe=document.createElement("IFRAME");
        this.iframe.style.position="absolute";
        this.iframe.border="0px";
        this.iframe.style.border="0px";
        document.body.appendChild(this.iframe)
     }
     this.calendarDiv=document.createElement("DIV");
     this.calendarDiv.id="calendarDiv";
     this.calendarDiv.onselectstart=this.cancelEvent;
     this.calendarDiv.onmousedown=this.cancelEvent;
     this.calendarDiv.style.zIndex=1000;
     document.body.appendChild(this.calendarDiv);
     this.writeTopBar();
     this.updateMonths(this.monthPicker);
     this.updateYears(this.yearPicker);
     this.writeCalendarContent()
};

EKCalendar.writeTopBar=function(){
    this.topBar=document.createElement("DIV");
    this.topBar.className="topBar";
    this.topBar.id="topBar";
    this.calendarDiv.appendChild(this.topBar);
    this.prevMonthButton=document.createElement("DIV");
    this.prevMonthButton.style.marginRight="1px";
    this.prevMonthButton.id="prevMonthButton";
    var A=document.createElement("IMG");
    A.src=this.Config.imagePath+this.Config.calendarImages[0];
    A.title=this.Config.txtPrevMonth;
    A.alt=this.Config.txtPrevMonth;
    A.onclick=this.switchMonth;
    this.prevMonthButton.appendChild(A);
    this.topBar.appendChild(this.prevMonthButton);
    
    if(this.Opera||this.iCab){
        this.prevMonthButton.style.width="16px"
    }
    
    this.nextMonthButton=document.createElement("DIV");
    this.nextMonthButton.style.marginRight="10px";this.nextMonthButton.id="nextMonthButton";
    var G=document.createElement("IMG");
    G.src=this.Config.imagePath+this.Config.calendarImages[1];
    G.title=this.Config.txtNextMonth;G.alt=this.Config.txtNextMonth;
    G.onclick=this.switchMonth;this.nextMonthButton.appendChild(G);
    this.topBar.appendChild(this.nextMonthButton);
    
    if(this.Opera||this.iCab){
        this.nextMonthButton.style.width="16px"
    }
    
    var B=document.createElement("DIV");
    B.onclick=this.showMonthDropDown;
    this.calendarMonthTxt=document.createElement("SPAN");this.calendarMonthTxt.innerHTML=this.Config.monthLong[this.inputDate.getMonth()];B.appendChild(this.calendarMonthTxt);
    this.topBar.appendChild(B);
    B.style.width="87px";
    B.style.marginRight="0px";
    var F=document.createElement("IMG");
    F.src=this.Config.imagePath+this.Config.calendarImages[3];
    F.title=this.Config.txtSlctMonth;
    F.alt=this.Config.txtSlctMonth;
    F.style.styleFloat="";
    F.style.marginLeft="5px";
    B.appendChild(F);
    B.className="selectBox";
    
    if(this.Opera||this.iCab){
        F.style.cssText="float: right; position: relative";
        F.style.position="relative";
        F.style.styleFloat="right";
    }
    
    this.monthPicker=document.createElement("DIV");
    this.monthPicker.style.left="44px";
    this.monthPicker.style.top=B.offsetTop+B.offsetHeight+1+"px";
    this.monthPicker.style.width="90px";
    this.monthPicker.style.display="none";
    this.monthPicker.className="monthYearPicker";
    this.monthPicker.id="monthDropDown";
    this.calendarDiv.appendChild(this.monthPicker);
    var C=document.createElement("DIV");
    C.onclick=this.showYearDropDown;
    this.calendarYearTxt=document.createElement("SPAN");
    this.calendarYearTxt.innerHTML=this.inputDate.getFullYear();
    C.appendChild(this.calendarYearTxt);this.topBar.appendChild(C);
    C.style.width="45px";var E=document.createElement("IMG");
    E.src=this.Config.imagePath+this.Config.calendarImages[3];
    E.title=this.Config.txtSlctYear;
    E.alt=this.Config.txtSlctYear;
    E.style.styleFloat="right";
    E.style.marginLeft="5px";
    C.appendChild(E);
    C.className="selectBox";

    if(this.Opera||this.iCab){
        C.style.width="45px";
        E.style.cssText="float: right";
        E.style.position="relative";
        E.style.styleFloat="right"
        }
        
    this.yearPicker=document.createElement("DIV");
    this.yearPicker.style.left="136px";
    this.yearPicker.style.top=B.offsetTop+B.offsetHeight+1+"px";
    this.yearPicker.style.display="none";
    this.yearPicker.style.width="48px";
    this.yearPicker.className="monthYearPicker";
    this.yearPicker.id="yearDropDown";
    this.calendarDiv.appendChild(this.yearPicker);
    var D=document.createElement("IMG");
        D.src=this.Config.imagePath+this.Config.calendarImages[2];
        D.title=this.Config.txtClose;
        D.alt=this.Config.txtClose;
        D.className="pointer";
        D.style.styleFloat="right";
        D.onclick=this.closeCalendar;
    this.topBar.appendChild(D);

    if(!document.all){
        D.style.position="absolute";
        D.style.right="2px";
    }

    this.calendarContent=document.createElement("DIV");
    this.calendarDiv.appendChild(this.calendarContent);
};

// Update Months
EKCalendar.updateMonths=function(B){
    this.purge(B);B.innerHTML="";
    var D=0;
    var C=this.Config.monthLong.length;
    if(this.outputDate.getFullYear()<=this.startDate.getFullYear()){
        D=this.startDate.getMonth();
        }
    if(this.outputDate.getFullYear()>=this.endDate.getFullYear()){
        C=this.endDate.getMonth()+1;
        }
    
    for(;D<C;D++){
        var A=document.createElement("DIV");
        A.innerHTML=this.Config.monthLong[D];
        A.onmouseover=this.highlightMonthYear;
        A.onmouseout=this.highlightMonthYear;
        A.onclick=this.selectMonth;
        A.id="month_"+D;
        A.onselectstart=this.cancelEvent;B.appendChild(A);
     }
 };

// Update Years 
EKCalendar.updateYears=function(C){
    this.purge(C);C.innerHTML="";
    var A=this.startDate.getFullYear();
    var E=this.endDate.getFullYear()-this.startDate.getFullYear()+1;
    for(var D=A;D<(A+E);D++){
        var B=document.createElement("DIV");
        B.innerHTML=D;
        B.onmouseover=this.highlightMonthYear;
        B.onmouseout=this.highlightMonthYear;
        B.onclick=this.selectYear;
        B.onselectstart=this.cancelEvent;
        C.appendChild(B);
    }
};

EKCalendar.highlightMonthYear=function(){
    switch(this.className){
        case"monthYearActive":
            this.className="";
            break;
        case"monthYearSelected":
            this.className="monthYearSelected monthYearActive";
        break;
        case"monthYearSelected monthYearActive":
            this.className="monthYearSelected";
            break;
        default:
            this.className="monthYearActive";
    }
};
    
EKCalendar.showMonthDropDown=function(){
    if(!EKCalendar.isHidden(EKCalendar.monthPicker)){
        EKCalendar.hideItem(EKCalendar.monthPicker);
    }else{
        EKCalendar.showItem(EKCalendar.monthPicker);
        EKCalendar.hideItem(EKCalendar.yearPicker);
    }
};

EKCalendar.showYearDropDown=function(){
    if(!EKCalendar.isHidden(EKCalendar.yearPicker)){
        EKCalendar.hideItem(EKCalendar.yearPicker);
    }else{
        EKCalendar.showItem(EKCalendar.yearPicker);
        EKCalendar.hideItem(EKCalendar.monthPicker);
    }
};

EKCalendar.selectMonth=function(){
    EKCalendar.calendarMonthTxt.innerHTML=this.innerHTML;EKCalendar.hideItem(EKCalendar.monthPicker);
    EKCalendar.outputDate.setMonth(this.id.replace(/[^\d]/g,""));
    EKCalendar.outputDate.setDate(1);
    EKCalendar.writeCalendarContent()
};

EKCalendar.selectYear=function(){
    EKCalendar.calendarYearTxt.innerHTML=this.innerHTML;
    EKCalendar.hideItem(EKCalendar.yearPicker);
    EKCalendar.outputDate.setFullYear(this.innerHTML.replace(/[^\d]/g,""));
    EKCalendar.outputDate.setDate(1);
    if(EKCalendar.outputDate<EKCalendar.startDate){
        EKCalendar.outputDate.setTime(EKCalendar.startDate.getTime());
    }
    if(EKCalendar.outputDate>EKCalendar.endDate){
        EKCalendar.outputDate.setFullYear(EKCalendar.endDate.getFullYear());
        EKCalendar.outputDate.setMonth(EKCalendar.endDate.getMonth());
        EKCalendar.outputDate.setDate(1);
    }
    EKCalendar.updateMonths(EKCalendar.monthPicker);
    EKCalendar.writeCalendarContent()
 };
    
EKCalendar.switchMonth=function(){
    var A=EKCalendar.outputDate.getFullYear();
    if(this.src.indexOf("control_rewind_blue")>=0){
        if(EKCalendar.outputDate.getMonth()===0){
            EKCalendar.outputDate.setYear(A-1);
            EKCalendar.outputDate.setMonth(11)
        }else{
            EKCalendar.outputDate.setMonth(EKCalendar.outputDate.getMonth()-1)
        }
    }else{
        if(EKCalendar.outputDate.getMonth()==11){
            EKCalendar.outputDate.setYear(A+1);
            EKCalendar.outputDate.setMonth(0)
        }else{
            EKCalendar.outputDate.setMonth(EKCalendar.outputDate.getMonth()+1)
        }
    }
    if(A!=EKCalendar.outputDate.getFullYear()){
        EKCalendar.updateMonths(EKCalendar.monthPicker)
    }
    EKCalendar.writeCalendarContent()
 };
    
EKCalendar.updateButtons=function(){
    var A=this.prevMonthButton;
    var B=this.nextMonthButton;
    if((this.outputDate.getFullYear()<=this.startDate.getFullYear())&&this.outputDate.getMonth()<=this.startDate.getMonth()){
        A.firstChild.src=this.Config.imagePath+this.Config.calendarImages[4];
        A.className="arrow";
        A.firstChild.onclick=null;
        A.firstChild.title="";
        A.firstChild.alt=""
     }else{
        A.firstChild.src=this.Config.imagePath+this.Config.calendarImages[0];
        A.className="pointer";
        A.firstChild.onclick=this.switchMonth;
        A.firstChild.title=this.Config.txtPrevMonth;
        A.firstChild.alt=this.Config.txtPrevMonth;
     }
     if(this.outputDate.getFullYear()>=this.endDate.getFullYear()&&this.outputDate.getMonth()>=this.endDate.getMonth()){
        B.firstChild.src=this.Config.imagePath+this.Config.calendarImages[5];
        B.className="arrow";
        B.firstChild.onclick=null;
        B.firstChild.title="";
        B.firstChild.alt=""
     }else{
        B.firstChild.src=this.Config.imagePath+this.Config.calendarImages[1];
        B.className="pointer";
        B.firstChild.onclick=this.switchMonth;
        B.firstChild.title=this.Config.txtNextMonth;
        B.firstChild.alt=this.Config.txtNextMonth
     }
};

EKCalendar.updateHighlights=function(){
    for(var C=0;C<this.yearPicker.childNodes.length;C++){
        var A=this.yearPicker.childNodes[C];
        A.className="";
        if(A.innerHTML==this.outputDate.getFullYear()){
            A.className="monthYearSelected"
        }
     }
     for(var B=0;B<this.monthPicker.childNodes.length;B++){
          var D=this.monthPicker.childNodes[B];
          D.className="";
          if(D.id=="month_"+this.outputDate.getMonth()){
              D.className="monthYearSelected"
          }
     }
};
        
EKCalendar.highlightDay=function(A){
    switch(A.className){
        case"activeDay":
            A.className="activeDayOver";
            break;
        case"activeDayOver":
            A.className="activeDay";
            break;
        case"Day pointer":
            A.className="DayOver pointer";
            break;
        case"Day arrow":
            A.className="DayOver arrow";
            break;
        case"DayOver pointer":
            A.className="Day pointer";
            break;
        case"DayOver arrow":
            A.className="Day arrow";
            break;
     }
};

EKCalendar.closeCalendar=function(){
    EKCalendar.monthPicker.style.display="none";
    EKCalendar.yearPicker.style.display="none";
    EKCalendar.calendarDiv.style.display="none";
    if(EKCalendar.iframe){
        EKCalendar.iframe.style.display="none"
    }
};

EKCalendar.writeCalendarContent=function(){
    var F='<table width="210" cellspacing="0"><tbody><tr>';
    for(var E=0;E<this.Config.dayShort.length;E++){
        F+='<td class="daysBar">'+this.Config.dayShort[E]+"</td>"
    }
    F+="</tr>";
    this.calendarMonthTxt.innerHTML=this.Config.monthLong[this.outputDate.getMonth()];
    var I=new Date();
    I.setTime(this.outputDate.getTime());
    I.setDate(1);
    var C=I.getDay();
    C=C+this.Config.firstDay;
    if(C===0){C=7}C--;
    this.calendarYearTxt.innerHTML=this.outputDate.getFullYear();
    F+="<tr>";
    for(var D=0;D<C;D++){
        F+='<td class="inActiveDay">&nbsp;</td>'
    }
    var K=C;
    var A=this.Config.monthDays[this.outputDate.getMonth()];
    if(A==28){
        if(this.leapYear(this.outputDate.getFullYear())){
            A=29
        }
     }
     var H=0;
     var G=0;
     var B=A;
     if(this.outputDate.getFullYear()<=this.startDate.getFullYear()&&this.outputDate.getMonth()<=this.startDate.getMonth()){
        G=this.startDate.getDate()
     }
     if(this.outputDate.getFullYear()>=this.endDate.getFullYear()&&this.outputDate.getMonth()>=this.endDate.getMonth()){
        B=this.endDate.getDate()
     }
     if(this.outputDate.getFullYear()==this.inputDate.getFullYear()&&this.outputDate.getMonth()==this.inputDate.getMonth()){
        H=this.inputDate.getDate()
     }
     for(var J=1;J<=A;J++){
        if(K>0&&K%7===0){
            F+="</tr><tr>"
        }
        if(J>=G&&J<=B){
            if(J==H){
                F+='<td id="day_'+J+'" class="activeDay" onmouseover="EKCalendar.highlightDay(this);" onmouseout="EKCalendar.highlightDay(this);" onclick="EKCalendar.pickDate(this);">'+J+"</td>"
            }else{
                F+='<td '+(K==5||K==6||K==12||K==13||K==19||K==20||K==26||K==27||K==33||K==34?'class="WeekendDay pointer"':'class="Day pointer"')+' id="day_'+J+'" onmouseover="EKCalendar.highlightDay(this);'+(K==5||K==6||K==12||K==13||K==19||K==20||K==26||K==27||K==33||K==34?'this.style.backgroundColor=\'#FFCC66\';this.style.color=\'#000\';':'')+'" onmouseout="EKCalendar.highlightDay(this);'+(K==5||K==6||K==12||K==13||K==19||K==20||K==26||K==27||K==33||K==34?'this.style.backgroundColor=\'#FDF4F2\';this.style.color=\'#000\';':'')+'" onclick="EKCalendar.pickDate(this);">'+J+"</td>"
            }
        }else{
            F+='<td id="day_'+J+'" class="inActiveDay arrow">'+J+"</td>"
        }
        K++;
    }
    F+="</tr></tbody></table>";
    this.calendarContent.innerHTML=F;
    if(!document.all){
        this.topBar.style.top="";
        this.topBar.style.bottom="0px"
    }
    if(this.iframe){
        setTimeout("EKCalendar.resizeIframe();",10)
    }
    this.updateButtons();
    this.updateHighlights();
};
     
EKCalendar.resizeIframe=function(){
    this.iframe.style.width=this.calendarDiv.offsetWidth+"px";
    this.iframe.style.height=this.calendarDiv.offsetHeight+"px"
};

EKCalendar.pickDate=function(A){
    EKCalendar.outputDate.setDate(A.id.replace(/[^\d]/g,""));
    //EKCalendar.returnDateTo.value=EKCalendar.padLeft(EKCalendar.outputDate.getDate(),"0",2)+"/"+EKCalendar.Config.monthShort[EKCalendar.outputDate.getMonth()]+"/"+EKCalendar.padLeft(EKCalendar.outputDate.getFullYear()-2000,"0",2);
    EKCalendar.returnDateTo.value=EKCalendar.padLeft(EKCalendar.outputDate.getDate(),"0",2)+"/"+EKCalendar.Config.monthShort[EKCalendar.outputDate.getMonth()]+"/"+EKCalendar.outputDate.getFullYear();
    if(EKCalendar.dependentDateTo){
        EKCalendar.outputDate.setDate(EKCalendar.outputDate.getDate()+EKCalendar.dependentDaysDiff);
            if(EKCalendar.outputDate>EKCalendar.endDate){EKCalendar.outputDate.setDate(EKCalendar.endDate.getDate())}
            if(EKCalendar.outputDate<EKCalendar.startDate){EKCalendar.outputDate.setDate(EKCalendar.startDate.getDate())
    }
    //EKCalendar.dependentDateTo.value=EKCalendar.padLeft(EKCalendar.outputDate.getDate(),"0",2)+"/"+EKCalendar.Config.monthShort[EKCalendar.outputDate.getMonth()]+"/"+EKCalendar.padLeft(EKCalendar.outputDate.getFullYear()-2000,"0",2)}EKCalendar.closeCalendar()
    EKCalendar.dependentDateTo.value=EKCalendar.padLeft(EKCalendar.outputDate.getDate(),"0",2)+"/"+EKCalendar.Config.monthShort[EKCalendar.outputDate.getMonth()]+"/"+EKCalendar.outputDate.getFullYear()}EKCalendar.closeCalendar()
    if(typeof updateSearchCalendars=='function') updateSearchCalendars();
};

EKCalendar.positionCalendar=function(D){
    var G=this.findPos(this.returnDateTo);
    var A=this.getScrollPosition();
    var C=this.getWindowSize();
    var F=G.x;
    var B=G.y+this.returnDateTo.offsetHeight+2;
    var E=this.calendarDiv;
    if((E.offsetHeight+B)>(A.y+C.height)){
        window.scrollTo(A.x,A.y+(E.offsetHeight+B)-(A.y+C.height)+25)
    }
    if(EKCalendar.Config.maxScreen!==0&&C.width>EKCalendar.Config.maxScreen){
        C.width=EKCalendar.Config.maxScreen+(document.body.clientWidth-EKCalendar.Config.maxScreen)/2
    }
    if((E.offsetWidth+F+20)>(A.x+C.width)){
        F=G.x+this.returnDateTo.offsetWidth-E.offsetWidth
    }
    this.calendarDiv.style.left=F+D+"px";
    this.calendarDiv.style.top=B+"px";
    if(this.iframe){
        this.iframe.style.left=this.calendarDiv.style.left;
        this.iframe.style.top=this.calendarDiv.style.top
    }
};

EKCalendar.configure()




EKCalendar.Config.monthLong = ['January','February','March','April','May','June','July','August','September','October','November','December'];
EKCalendar.Config.monthShort = ['01','02','03','04','05','06','07','08','09','10','11','12'];
EKCalendar.Config.dayShort = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'];
EKCalendar.Config.firstDay = 0;
EKCalendar.Config.monthDays = [31,28,31,30,31,30,31,31,30,31,30,31];
EKCalendar.Config.imagePath = '/Assets/Images/icons/';
EKCalendar.preloadImages();
