﻿ 

function Log(msg) {
    try { if (window.console && console.log) console.log(msg); }
    catch (err) { } //ignore console logging
}

function focus(ctl) {
    var objCtl = document.getElementById(ctl);
    if (objCtl == null) { objCtl = document.getElementsByName(ctl); objCtl = (objCtl.length > 0 ? objCtl[0] : null); }
    if (objCtl != null && !objCtl.disabled) { if (objCtl.focus) objCtl.focus(); if (objCtl.select) objCtl.select(); }
}

(function() {
    // wire up Date prototype extentions immediately upon loading this file 
    if (!Date.prototype.toCleanTime) {
        Date.prototype.toCleanTime = function() {
            var strDate = this.getFullYear() + '/' + (this.getMonth() + 1) + '/' + this.getDate();
            var objDateClean = new Date(strDate);
            return objDateClean;
        }
    } 
})();


// Spanish text for jQueryUI datepicker
if ($ && $.datepicker) {
    $.datepicker.regional['es'] = {
        closeText: 'Cerrar',
        prevText: '&#x3c;Ant',
        nextText: 'Sig&#x3e;',
        currentText: 'Hoy',
        monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
                'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
        monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun',
                'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
        dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
        dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Juv', 'Vie', 'Sáb'],
        dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sá'],
        dateFormat: 'dd/mm/yy',
        firstDay: 0,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''
    };
}


