﻿$(function() {
    $('input.fecha').datepicker({
        changeMonth: true,
        changeYear: true,
        dayNamesMin: cal_dia_corto,
        firstDay: cal_dia_inicio,
        monthNames: cal_mes_largo,
        monthNamesShort: cal_mes_corto,//['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
        dateFormat: cal_formato_fecha,
        yearRange: '1900:2100',
        showAnim: 'blind',
        showOtherMonths: true,
        selectOtherMonths: true
        
    });
});



$(document).ready(function() {
    //$("input.autocompletar").css("border", "9px solid red");
    //$("select").sexyCombo();

    /* LightBox en la Ayuda
    $(".iframe,a[href$='Ayuda.aspx']").colorbox({
    initialWidth: "600",
    initialHeight: "400",
    width: "1100",
    height: "700",
    iframe: true 
    });
    */
    /* Sexy ToolTip
    $.each($('a'), function() {
    $(this).tooltip('<p>' + $(this).attr('href') + '</p>', {
    width: 400,
    //  style: 'alert',
    sticky: 0,
    hook: 1
    });
    });
    */
    /*
    $.each($('.tooltip_info'), function() {
    $(this).tooltip('<p><div style="float:left; margin-right:5px"><img src="Imagenes/msjInfo.png"/></div><div>' + $(this).attr('title') + '</div></p>', {
    width: 400,
    //  style: 'alert',
    sticky: 0,
    hook: 1
    });
    });
    */

    $.each($("input.autocompletar"), function() {

        var title = "Para ver los posibles valores, hacer doble clic sobre este campo";
        $(this).attr("title", title);
        $(this).tooltip("<p>" + title + "</p>");

        var id = $(this).attr('id');
        var idContenido = '#' + id + "_contenido";
        var v = document.getElementById(idContenido);
        var contenido = $(idContenido).html();
        $(idContenido).hide();
        if (contenido != "") {
            $(this).autocomplete(contenido.split("|"),
            {
                autoFill: true,
                width: 320,
                max: 100,
                scroll: true,
                scrollHeight: 300,
                minChars: 0
            }

            );
        }
    });
    $.each($('.tooltip_info'), function() {
        $(this).tooltip('<p><div style="float:left; margin-right:5px"><img src="Imagenes/msjInfo.png"/></div><div>' + $(this).attr('title') + '</div></p>', {
            width: 400,
            //  style: 'alert',
            sticky: 0,
            hook: 1
        });
    });
});

