﻿//-------------frame
if (window != top) top.location.href = location.href;

//-------------QuickRes2a
function CheckQuickRes(form) {
    var resultOK = true;
    if (form.ContactMeName.value == "") {
        returnObjById('ContactMeNameReq').style.visibility = 'visible';
        form.ContactMeName.focus();

        return false;
    }
    else if (form.ContactMeName.value != "") {
        returnObjById('ContactMeNameReq').style.visibility = 'hidden';
    }

    var reg = /\d{5}\d*/;

    if (!reg.test(form.ContactMePhone.value) && resultOK == true) {

        returnObjById('ContactMePhoneReq').style.visibility = 'visible';
        form.ContactMePhone.focus();
        return false;
    }
    else if (reg.test(form.ContactMePhone.value)) {
        returnObjById('ContactMePhoneReq').style.visibility = 'hidden';
    }

    var reEmail = re = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

    if (!reEmail.test(form.ContactMeEmail.value) && resultOK == true) {
        returnObjById('ContactMeEmailReq').style.visibility = 'visible';
        form.ContactMeEmail.focus();
        return false;
    }
    else if (reEmail.test(form.ContactMeEmail.value)) {
        returnObjById('ContactMeEmailReq').style.visibility = 'hidden';
    }

    if (form.ContactMeCountry.value == "" && resultOK == true) {
        returnObjById('ContactMeCountryReq').style.visibility = 'visible';
        form.ContactMeCountry.focus();
        //resultOK = false;
        return false;
    }
    else if (form.ContactMeCountry.value != "") {
        if (returnObjById('ContactMeCountryeReq') != null)
            returnObjById('ContactMeCountryeReq').style.visibility = 'hidden';
    }
    return true;
}
function OnlyDecimal(e) {
    var key;
    var keychar;
    var reg;

    if (window.event) {
        // for IE, e.keyCode or window.event.keyCode can be used
        key = e.keyCode;
    }
    else if (e.which) {
        // netscape
        key = e.which;
    }
    else {
        // no event, so pass through
        return true;
    }

    if (key == 8) return true; // backspace

    keychar = String.fromCharCode(key);
    reg = /\d/;
    return reg.test(keychar);
}

function returnObjById(id) {
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;
}

function clock() {
    if (hours < 10 && new String(hours).length < 2) hours = "0" + hours;
    if (minutes < 10 && new String(minutes).length < 2) minutes = "0" + minutes;
    if (seconds < 10) seconds = "0" + seconds;

    //var time = hours + ":" + minutes + ":" + seconds +" CET";
    var time = hours + ":" + minutes + " CET";

    document.getElementById("clock").innerHTML = time;

    if (++minutes >= 60) {
        minutes = 0;
        hours++;
    }

    if (hours >= 24)
        hours = 0;

    setTimeout("clock()", 60000);
}
//--------------ApartmentDetailsNavigation
var newHtml;
function saveCurrent(nr, listID, link) {


    window.location = apartmentsapart.Modules.ApartmentDetailsNavigation.saveCurrentListNr(nr, listID, link).value;

    /*var req = mint.Request();
    req.OnSuccess = function() {
    newHtml = this.responseText;       
    newHtml = newHtml.replace(/"controls"/gi, "\"controls\" style=\"opacity:0\"");
    }
    req.Send(url);
    var group = mint.fx.Group(null, 20, 500);
    group.Add("controls", "opacity", null, 0);
    group.OnDone = function(group){
    document.body.innerHTML=newHtml; 
    mint.fx.Fade("controls", 100, 20, 500);  
    }
 
 group.Run();*/
}
function show() {
    document.getElementById('ApartmentDetailsNavigation').style.display = 'block';
}
function ColorIn(obj) {
    mint.fx.Color(obj, "backgroundColor", null, "975821", 20, 500);
    mint.fx.Color(obj, "borderColor", null, "975821", 20, 500);

}

function ColorOut(obj) {
    mint.fx.Color(obj, "backgroundColor", null, "4a5889", 20, 500);
    mint.fx.Color(obj, "borderColor", null, "4a5889", 20, 500);
}
//---------------ratingswindow
function showWindow(e, url) {
    if (!e) e = window.event;

    var posx = 0;
    var posy = 0;

    if (e.pageX || e.pageY) {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
    }

    var elem = document.getElementById('ratingsWindow');

    posx -= elem.offsetWidth;

    if (posx + elem.offsetWidth > document.body.offsetWidth)
        posx = document.body.offsetWidth - elem.offsetWidth;
    if (posy + elem.offsetHeight > document.body.offsetHeight)
        posy = document.body.offsetHeight - elem.offsetHeight;

    elem.style.visibility = 'visible';
    elem.style.left = posx + 'px';
    elem.style.top = posy + 'px';
    elem.style.width = 337 + 'px';
    elem.style.height = 400 + 'px';
    elem.style.borderBottomStyle = "solid";
    elem.style.borderBottomWidth = "1px";

    window.frames["ifRatings"].location = url;

    document.getElementById("ifRatings").width = "337";
    document.getElementById("ifRatings").height = "385";

    if (document.getElementById("bing") != undefined)
        document.getElementById("bing").style.display = 'none';
}

function showPriceWindow(e, url) {
    if (!e) e = window.event;

    var posx = 0;
    var posy = 0;

    if (e.pageX || e.pageY) {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
    }

    var elem = document.getElementById('ratingsWindow');

    posx -= elem.offsetWidth;
    posy -= elem.offsetHeight;

    if (posx + elem.offsetWidth > document.body.offsetWidth)
        posx = document.body.offsetWidth - elem.offsetWidth;
    if (posy + elem.offsetHeight > document.body.offsetHeight)
        posy = document.body.offsetHeight - elem.offsetHeight;

    elem.style.visibility = 'visible';
    elem.style.left = posx + 'px';
    elem.style.top = posy + 'px';
    elem.style.width = 435 + 'px';
    elem.style.height = 400 + 'px';
    elem.style.borderBottomStyle = "double";
    elem.style.borderBottomWidth = "8px";

    window.frames["ifRatings"].location = url;

    document.getElementById("ifRatings").width = "435";
    document.getElementById("ifRatings").height = "385";

    if (document.getElementById("bing") != undefined)
        document.getElementById("bing").style.display = 'none';
}

function showServiceWindow(e, url) {
    if (!e) e = window.event;

    var posx = 0;
    var posy = 0;

    if (e.pageX || e.pageY) {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
    }

    var elem = document.getElementById('ratingsWindow');

    posy -= elem.offsetHeight / 2;

    if (posx + elem.offsetWidth > document.body.offsetWidth)
        posx = document.body.offsetWidth - elem.offsetWidth;
    //if(posy + elem.offsetHeight > document.body.offsetHeight)
    //	posy = document.body.offsetHeight - elem.offsetHeight;

    elem.style.visibility = 'visible';
    elem.style.left = posx + 'px';
    elem.style.top = posy + 'px';
    elem.style.width = 510 + 'px';
    elem.style.height = 245 + 'px';
    elem.style.borderBottomStyle = "solid";
    elem.style.borderBottomWidth = "1px";

    window.frames["ifRatings"].location = url;

    document.getElementById("ifRatings").width = "510";
    document.getElementById("ifRatings").height = "230";

    if (document.getElementById("bing") != undefined)
        document.getElementById("bing").style.display = 'none';
}

function showBookingWindow(e, url) {
    if (!e) e = window.event;

    var posx = 0;
    var posy = 0;

    if (e.pageX || e.pageY) {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
    }

    var elem = document.getElementById('ratingsWindow');

    posy -= elem.offsetHeight / 2;
    posx -= elem.offsetWidth;

    if (posx + elem.offsetWidth > document.body.offsetWidth)
        posx = document.body.offsetWidth - elem.offsetWidth;
    //if(posy + elem.offsetHeight > document.body.offsetHeight)
    //	posy = document.body.offsetHeight - elem.offsetHeight;

    elem.style.visibility = 'visible';
    elem.style.left = posx + 'px';
    elem.style.top = posy + 'px';
    elem.style.width = 510 + 'px';
    elem.style.height = 245 + 'px';
    elem.style.borderBottomStyle = "solid";
    elem.style.borderBottomWidth = "1px";

    window.frames["ifRatings"].location = url;

    document.getElementById("ifRatings").width = "510";
    document.getElementById("ifRatings").height = "230";

    if (document.getElementById("bing") != undefined)
        document.getElementById("bing").style.display = 'none';
}

function showGWindow(e, url, wth, hth) {
    if (!e) e = window.event;

    var posx = 0;
    var posy = 0;
    if (e.pageX || e.pageY) {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
    }

    var elem = document.getElementById('ratingsWindow');

    posx -= elem.offsetWidth;
    //posy -= elem.offsetHeight;

    if (posx + elem.offsetWidth > document.body.offsetWidth)
        posx = document.body.offsetWidth - elem.offsetWidth;
    if (posy + elem.offsetHeight > document.body.offsetHeight)
        posy = document.body.offsetHeight - elem.offsetHeight;

    elem.style.visibility = 'visible';
    elem.style.left = posx + 'px';
    elem.style.top = posy + 'px';

    elem.style.width = wth + 'px';
    elem.style.height = 15 + parseInt(hth) + 'px';
    elem.style.borderBottomStyle = "solid";
    elem.style.borderBottomWidth = "1px";

    window.frames["ifRatings"].location = url;
    document.getElementById("ifRatings").width = parseInt(wth);
    document.getElementById("ifRatings").height = parseInt(hth);

    if (document.getElementById("bing") != undefined)
        document.getElementById("bing").style.display = 'none';    
}

function showGWindowOnList(e, url, wth, hth, bing) {
    if (!e) e = window.event;

    var posx = 0;
    var posy = 0;
    if (e.pageX || e.pageY) {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
    }

    var elem = document.getElementById('ratingsWindow');

    posx -= elem.offsetWidth;
    //posy -= elem.offsetHeight;

    if (posx + elem.offsetWidth > document.body.offsetWidth)
        posx = document.body.offsetWidth - elem.offsetWidth;
    if (posy + elem.offsetHeight > document.body.offsetHeight)
        posy = document.body.offsetHeight - elem.offsetHeight;

    elem.style.visibility = 'visible';
    elem.style.left = posx + 'px';
    elem.style.top = posy + 'px';

    elem.style.width = wth + 'px';
    elem.style.height = 15 + parseInt(hth) + 'px';
    elem.style.borderBottomStyle = "solid";
    elem.style.borderBottomWidth = "1px";

    document.getElementById("bing").style.display = 'block';
    document.getElementById("bing").children[0].href = "javascript:MapWindow('" + bing + "')";

    window.frames["ifRatings"].location = url;
    document.getElementById("ifRatings").width = parseInt(wth);
    document.getElementById("ifRatings").height = parseInt(hth);
}

function showGRWindow(e, url, wth, hth) {
    if (!e) e = window.event;

    var posx = 0;
    var posy = 0;
    if (e.pageX || e.pageY) {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
    }

    var elem = document.getElementById('ratingsWindow');

    //  posx -= elem.offsetWidth;
    //posy -= elem.offsetHeight;

    if (posx + elem.offsetWidth > document.body.offsetWidth)
        posx = document.body.offsetWidth - elem.offsetWidth;
    if (posy + elem.offsetHeight > document.body.offsetHeight)
        posy = document.body.offsetHeight - elem.offsetHeight;


    elem.style.visibility = 'visible';
    elem.style.left = posx + 'px';
    elem.style.top = posy + 'px';


    elem.style.width = wth + 'px';
    elem.style.height = 15 + parseInt(hth) + 'px';
    elem.style.borderBottomStyle = "solid";
    elem.style.borderBottomWidth = "1px";

    window.frames["ifRatings"].location = url;
    document.getElementById("ifRatings").width = parseInt(wth);
    document.getElementById("ifRatings").height = parseInt(hth);

    if (document.getElementById("bing") != undefined)
        document.getElementById("bing").style.display = 'none';    
}

function showSVWindow(e, url, wth, hth) {
    if (!e) e = window.event;

    var posx = 0;
    var posy = 0;
    if (e.pageX || e.pageY) {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
    }

    var elem = document.getElementById('ratingsWindow');

    posx -= elem.offsetWidth;
    //posy -= elem.offsetHeight;

    if (posx + elem.offsetWidth > document.body.offsetWidth)
        posx = document.body.offsetWidth - elem.offsetWidth;
    if (posy + elem.offsetHeight > document.body.offsetHeight)
        posy = document.body.offsetHeight - elem.offsetHeight;

    elem.style.visibility = 'visible';
    elem.style.left = posx + 'px';
    elem.style.top = posy + 'px';

    elem.style.width = wth + 'px';
    elem.style.height = 15 + parseInt(hth) + 'px';
    elem.style.borderBottomStyle = "solid";
    elem.style.borderBottomWidth = "1px";

    window.frames["ifRatings"].location = url;
    document.getElementById("ifRatings").width = parseInt(wth);
    document.getElementById("ifRatings").height = 20 + parseInt(hth);

    if (document.getElementById("bing") != undefined)
        document.getElementById("bing").style.display = 'none';    
}

function hideWindow() {
    document.getElementById('ratingsWindow').style.visibility = 'hidden';
    window.frames["ifRatings"].location = 'about:blank';
}

var moving = false;
var offX = 0;
var offY = 0;

function setWindowPos(e) {
    if (!moving) return;
    if (!e) e = window.event;

    var elem = document.getElementById('ratingsWindow');
    elem.style.left = e.clientX - offX + 'px';
    elem.style.top = e.clientY - offY + 'px';
}

function lockWindow(e) {
    var elem = document.getElementById('ratingsWindow');
    offX = e.clientX - elem.offsetLeft;
    offY = e.clientY - elem.offsetTop;

    moving = true;
    document.onmousemove = setWindowPos;
    document.onmouseup = unlockWindow;
}

function unlockWindow() {
    moving = false;
    document.onmousemove = null;
    document.onmouseup = null;
}

function MapWindow(mypage) {
    var win = null;
    var w = 800;
    var h = 600;
    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
    TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
    myname = "MAP";

    settings = 'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=no, resizable=yes';
    win = window.open('', myname, settings);
    win.location.href = mypage;
    //win.onload = sc;
    //window.scrollTo(0,500);
}
function FitWindow(mypage) {
    myname = "MAP";

    settings = 'height=' + screen.height + ',width=' + screen.width + ',scrollbars=no, resizable=yes';
    win = window.open('', myname, settings);
    mypage = mypage.toString().replace('mapwidth=0', 'mapwidth=' + screen.width);
    mypage = mypage.toString().replace('mapheight=0', 'mapheight=' + screen.height);
    win.location.href = mypage;
}
function NewWindow(mypage, w, h, myname, scroll) {
    var win = null;
    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
    TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;

    settings = 'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',resizable=no';

    win = window.open(mypage, myname, settings).focus();
}

//autoscrolling ajaxapartmentlist
function Scroller(len, width, height, version, name) {
    this.lenCounter = len;
    this.scrollerwidth = width;
    this.scrollerheight = height;
    this.tab = new Array();
    this.scrollerspeed = 1;
    this.lefttime = 0;
    this.ifmove = 0;
    this.pauseit = 1;
    this.copyspeed = 0;
    this.iedom = document.all || document.getElementById;
    this.actualSize = '';
    this.cross_scroller;
    this.ns_scroller;
    this.pausespeed = (this.pauseit == 0) ? this.copyspeed : 0;
    this.VersionScroller = version;
    this.name = name;

    this.runSpeed = function(speed, scrollname, idd) {
        if (this.tab[scrollname + idd] == undefined)
            this.tab[scrollname + idd] = 0;
        this.copyspeed = speed;
        if (this.copyspeed == this.scrollerspeed) {
            this.populate(scrollname, idd);
        }
        else {
            clearInterval(this.lefttime);
        }
    }

    this.populate = function(scrollname, id) {
        var scrollercontent = document.getElementById(scrollname + id).innerHTML;
        if (this.iedom) {
            this.cross_scroller = document.getElementById ? document.getElementById(scrollname + id) : document.all.iescroller
            if (this.VersionScroller == 1) {
                if (this.tab[scrollname + id] == 0) this.cross_scroller.style.top = "0px"
                this.actualSize = this.cross_scroller.offsetHeight;
            }
            else if (this.VersionScroller == 2) {
                if (this.tab[scrollname + id] == 0) this.cross_scroller.style.left = "0px"
                this.actualSize = this.cross_scroller.offsetWidth;
            }
        }
        else if (document.layers) {
            this.ns_scroller = document.ns_scroller.document.ns_scroller2
            if (this.VersionScroller == 1) {
                if (this.tab[scrollname + id] == 0) this.ns_scroller.top = "0px"
            }
            else if (this.VersionScroller == 2) {
                if (this.tab[scrollname + id] == 0) this.ns_scroller.left = "0px"
            }
            this.ns_scroller.document.write(scrollercontent)
            this.ns_scroller.document.close()
            if (this.VersionScroller == 1) {
                this.actualSize = this.ns_scroller.document.height;
            }
            else if (this.VersionScroller == 2) {
                this.actualSize = this.ns_scroller.document.width;
            }
        }
        this.tab[scrollname + id] = this.tab[scrollname + id] + 1;

        this.lefttime = setInterval(this.name + ".scrollscroller()", 40);      
    }

    this.scrollscroller = function() {
        if (this.cross_scroller != undefined && this.copyspeed == this.scrollerspeed) {
            if (this.iedom) {
                if (this.VersionScroller == 1) {
                    if (parseInt(this.cross_scroller.style.top) > (this.actualSize * (-1 * this.lenCounter) + 8))
                        this.cross_scroller.style.top = parseInt(this.cross_scroller.style.top) - this.copyspeed + "px"
                    else
                        this.cross_scroller.style.top = this.scrollerheight;
                }
                else if (this.VersionScroller == 2) {
                    if (parseInt(this.cross_scroller.style.left) > (this.actualSize * (-1 * (this.lenCounter/70)) + 8))
                        this.cross_scroller.style.left = parseInt(this.cross_scroller.style.left) - this.copyspeed + "px"
                    else
                        this.cross_scroller.style.left = this.scrollerwidth;
                }
            }
            else if (document.layers) {
                if (this.VersionScroller == 1) {
                    if (this.ns_scroller.top > (this.actualSize * (-1 * this.lenCounter) + 8))
                        this.ns_scroller.top -= this.copyspeed
                    else
                        this.ns_scroller.top = this.scrollerheight;
                }
                else if (this.VersionScroller == 2) {
                    if (this.ns_scroller.left > (this.actualSize * (-1 * (this.lenCounter/70)) + 8))
                        this.ns_scroller.left -= this.copyspeed
                    else
                        this.ns_scroller.left = this.scrollerwidth;
                }
            }
        }
    }
}

//---------------------------------------keyboard list paging
function keyboardPaging() {
    AddEvent(window, 'load', function() {
        AddEvent(document, 'keydown', function(e) {
            if (!e) e = window.event;
            var keyCode = e.keyCode;
            switch (keyCode) {
                case 37:
                    getPage(als.currentPage - 1);
                    break;

                case 39:
                    getPage(als.currentPage + 1); 
                    break;
            }
        });
    });
}
function CalendarPicker(df, dt, lang) {
    jQuery.datepicker.setDefaults(jQuery.datepicker.regional[lang]);
    jQuery('#' + df).data('df', df);
    jQuery('#' + df).data('dt', dt);
    jQuery('#' + df).datepicker(
            {
                dateFormat: 'dd/mm/yy'
              , firstDay: 1
              , minDate: 0
              , numberOfMonths: 2
              , constrainInput: true
              , changeMonth: true
              , changeYear: true
              , showOn: 'both'
              , onSelect: function(selectedDate) {
                  var minDate = jQuery(this).datepicker('getDate');
                  if (minDate) {
                      minDate.setDate(minDate.getDate() + 1);
                  }
                  jQuery('#' + jQuery(this).data('dt')).datepicker('option', 'minDate', minDate || new Date()); // Date + 1 or tomorrow by default
                  var tmp = '#' + jQuery(this).data('dt');
                  setTimeout('jQuery(\'' + tmp + '\').focus()', 100);
              }
              , beforeShow: function(input, inst) {
                  input.disabled = true;
              }
              , beforeShowDay: function(date) {
                  return [true, (typeof (jQuery(this).datepicker('option', 'dateTo')) != 'undefined' && (date.getDate() == jQuery(this).datepicker('option', 'dateTo').getDate() + 1) && (date.getMonth() == jQuery(this).datepicker('option', 'dateTo').getMonth())) ? 'selectedDate' : ''];
              }
              , onClose: function(dateText, inst) { inst.input.removeAttr('disabled'); }
            });
    jQuery('#' + dt).data('df', df);
    jQuery('#' + dt).data('dt', dt);
    jQuery('#' + dt).datepicker(
            {
                dateFormat: 'dd/mm/yy'
              , firstDay: 1
              , numberOfMonths: 2
              , constrainInput: true
              , changeMonth: true
              , changeYear: true
              , showOn: 'both'
              , onSelect: function(selectedDate) {
                  var maxDate = jQuery(this).datepicker('getDate');
                  if (maxDate) {
                      maxDate.setDate(maxDate.getDate() - 1);
                      jQuery('#' + jQuery(this).data('df')).datepicker('option', 'dateTo', maxDate);
                  }
              }
              , beforeShow: function(input, inst) {
                  input.disabled = true;
                  var minDate = jQuery('#' + jQuery(this).data('df')).datepicker('getDate');
                  if (minDate) {
                      minDate.setDate(minDate.getDate() + 1);
                  }
                  jQuery(this).datepicker('option', 'minDate', minDate || new Date()); // Date + 1 or tomorrow by default                  
              },
              beforeShowDay: function(date) {
              return [true, (typeof(jQuery(this).datepicker('option', 'minDate')) != 'undefined' && (date.getDate() == jQuery(this).datepicker('option', 'minDate').getDate() - 1) && (date.getMonth() == jQuery(this).datepicker('option', 'minDate').getMonth())) ? 'selectedDate' : '']; 
              }
              , onClose: function(dateText, inst) { inst.input.removeAttr('disabled'); }
            });
}
