//-------------------------------------------------------------------------
// Genera una ventana modal en Jquert(fondo negro con un cargando)
//-------------------------------------------------------------------------
// Version: 1.0
// Fecha de Creacion: 15/03/2009
// Autor: Giovanny TArifeño Peña - www.plusweb.cl - gtarifeno(at)plusweb.cl
// Original: http://www.elwebmaster.com/articulos/ventana-modal-con-jquery-en-3-pasos
//-------------------------------------------------------------------------


//select all the a tag with name equal to modal 
function GModal() 
{ 
	var id = "#dialog"; 
 
	//Get the screen height and width 
	var maskHeight = jQuery(document).height()+63; 
	var maskWidth = jQuery(window).width(); 
 
	//Set height and width to mask to fill up the whole screen 
	jQuery('#mask').css({'width':maskWidth,'height':maskHeight}); 
	 
	//transition effect       
	jQuery('#mask').fadeIn(3000);     
	jQuery('#mask').fadeTo("slow",0.8);   
 
	//Get the window height and width 
	var winH = jQuery(window).height(); 
	var winW = jQuery(window).width(); 
		   
	//Set the popup window to center 
	jQuery(id).css('top',  winH/2-jQuery(id).height()/2); 
	jQuery(id).css('left', winW/2-jQuery(id).width()/2); 
 
	//transition effect 
	jQuery(id).fadeIn(2000);   
 
}
 
//if close button is clicked 
function cerrarGModal()
{
	//jQuery('#mask, .window').hide(); 
	jQuery('#mask, .window').fadeOut(2000);
}
     

