function addToBookmark() {
    if (document.all) {
        window.external.AddFavorite(location.href, document.title);
    } else {
        if (window.sidebar) {
            window.sidebar.addPanel(document.title, location.href, '');
        }
    }
}

function isValidForm(obj) {
    return true;
}

function resetForm(obj) {
    return true;
}

function setFocusStyle(obj) {
    return true;
}

function DateValidator() {

    var msgDateValidator = '';

    this.isValidDate = function(dateStr) {

        // UPRAVENE NA DATUM DD.MM.YYYY - kopecky

        // Date validation function courtesty of
        // Sandeep V. Tamhankar (stamhankar@hotmail.com) -->

        // Checks for the following valid date formats:
        // MM/DD/YY MM/DD/YYYY MM-DD-YY MM-DD-YYYY

        var datePat = /^(\d{1,2})(\/|-|.)(\d{1,2})\2(\d{4})$/; // requires 4
        // digit year

        var now = new Date();

        var matchArray = dateStr.match(datePat); // is the format ok?
        if (matchArray == null) {
            this.msgDateValidator = dateStr + " Nesprávny formát dátumu.";
            return false;
        }
        month = matchArray[3]; // parse date into variables
        day = matchArray[1];
        year = matchArray[4];

        if (day < 1 || day > 31) {
            this.msgDateValidator = "sDeň musí mať hodnotu  1 až 31.";
            return false;
        }
        if (month < 1 || month > 12) { // check month range
            this.msgDateValidator = "Mesiac musí mať hodnotu 1 až 12.";
            return false;
        }
        if ((month == 4 || month == 6 || month == 9 || month == 11)
                && day == 31) {
            this.msgDateValidator = "Mesiac " + month + " nemá 31 - dní !"
            return false;
        }
        if (month == 2) { // check for february 29th
            var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
            if (day > 29 || (day == 29 && !isleap)) {
                this.msgDateValidator = "Február " + year + " nemá " + day
                        + " dní!";
                return false;
            }
        }

        /*
		 * if (year < now.getFullYear()) { this.msgDateValidator = "Vami zadaný
		 * rok " + year + " už bol !"; return false; }
		 */

        if (year > 2100) {
            this.msgDateValidator = "Zadali ste nesprávny rok !";
            return false;
        }
        return true;
    }

}
// objekt JS na public cast

function JSPublic() {

    this.ShowHideLogin = function() {
        $("#loginFields").slideToggle();
    }
    
    this.ShowHideRegistracia = function(showPart) {
       
        if (this.getStatusOpenedDiv(showPart)) {
            $('#' + showPart).slideUp(500);
        } else {
            $('#' +showPart).slideDown(500);
        }   
    
    }

    this.getStatusOpenedDiv = function(idDiv) {
        if ($('#' + idDiv).css('display') == 'block' ) {
            return true;
        } else {
            return false;
        }
    }

}
var PublicJS = new JSPublic();





