<!--  initialize the slideshow when the DOM is ready -->
$(document).ready(function() {
    $('.promociones').cycle({
fx: 'fade',
speed:500, //The speed option defines the number of milliseconds it will take to transition from one slide to the next.
timeout:5000,//The timeout option specifies how many milliseconds will elapse between the start of each transition.
pause:  1,
pager:  '#nav',
slideExpr: 'img' 
});
});

$(document).ready(function() {
    $('.banners1').cycle({
fx: 'scrollDown',
speed:500,
timeout:5000,
pause:  1,
easing: 'bounceout', 
delay:  -2000
});
});

function PopupCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}

function validaMail(email)
	{
	  var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
	  return regex.test(email);
	}


function validar(forma) {

		if (forma.Nombre.value.length==0)
	{
		alert("Es necesario proporcionar su Nombre.");
		forma.Nombre.focus();
		return(false);
	}

		if (forma.TipoEvento.value.length==0)
	{
		alert("Es necesario proporcionar el Tipo de Evento. Ej. boda, quinceaños, posada, etc.");
		forma.TipoEvento.focus();
		return(false);
	}

		if (forma.LugarEvento.value.length==0)
	{
		alert("Es necesario proporcionar el Lugar donde se llevara acabo el Evento.");
		forma.LugarEvento.focus();
		return(false);
	}
	
		if (forma.HorarioEvento.value.length==0)
	{
		alert("Es necesario proporcionar el Horario del Evento.");
		forma.HorarioEvento.focus();
		return(false);
	}

		if (forma.Email.value.length==0)
	{
		alert("Es necesario proporcionar su E-Mail.");
		forma.Email.focus();
		return(false);
	}
	
		if (!validaMail(forma.Email.value))
	{
		alert("Es necesario proporcionar correctamente su dirección de E-mail.  Ej: usuario@micorreo.com");
		forma.Email.focus();
		return(false);
	}
	
		if (forma.Telefono.value.length==0)
	{
		alert("Es necesario proporcionar su Numero Telefonico.");
		forma.Telefono.focus();
		return(false);
	}
			
	return(true);
}

