﻿/* Overriding Javascript's Alert Dialog */

//function precargaFondos(){} // Esta funcion se sobreescribe en la pagina rejilla

function Cargando(msg,ico) {
    precargaFondos();
    $('#alert').jqmShow();
    precargaFondos();
    
    $('div.jqmAlertTitle').html("Espere un momento");
    
    $('div.jqmAlertContent').html(ico + "<br />Cargando...");
//      .html(msg);
}


function alert(msg) {
  $('#alert')
    .jqmShow();
    //.find('div.jqmAlertContent');
    
    $('div.jqmAlertContent').html(msg);
//      .html(msg);
   
   $('div.jqmAlertTitle').html("Alerta!");
   
    var myClose=function(hash) { hash.w.fadeOut('2000',function(){ hash.o.remove(); }); }; 
    $('#alert').jqm({onHide:myClose});
    setTimeout(function(){ $('#alert').jqmHide(); }, 2000); 
     
}

$().ready(function() {
  $('#alert').jqm({overlay: 0, modal: true, trigger: false});
  
  // trigger an alert whenever links of class alert are pressed.
  $('a.alert').click(function() { 
    alert('You Have triggered an alert!'); 
    return false;
  });
});

