function spanishStringDateToDate(s) {
    var a = s.split("/");
    var d = new Date(a[2], a[1], a[0]);
    return (d);
}

function setDatePicker(sId) {
    var oDate = new Date();
    var iYear = oDate.getFullYear();
    var iYearFrom = 1900
    var iYearTo =  iYear - 18;
  
    $("#" + sId).datepicker({
        showOn: "button",
        buttonImage: "/images/calendario.gif",
        dateFormat: "dd/mm/yy",
        buttonImageOnly: true,
        dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
        monthNamesShort: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
        changeMonth: true,
        changeYear: true,
        yearRange: iYearFrom + ":" + iYearTo
    });
}

// ------------------------------------------
// Enviar mensaje, recomendar.
// ------------------------------------------
function getDestinatariosFromList(sLstId) {
    var sDestinatarios = "";
    $("#" + sLstId + " option").each(function () {
        sDestinatarios += $(this).val() + "-";
    });
    if (sDestinatarios != "") { sDestinatarios = sDestinatarios.substr(0, sDestinatarios.length - 1); }
    return (sDestinatarios);
}

function formatItem(row) { return row[0] + " (<strong>id: " + row[1] + "</strong>)"; }
function formatResult(row) { return row[0].replace(/(<.+?>)/gi, ''); }
// ------------------------------------------
