// Esta funcion valida los campos que se encuentra vacios en el formulario contactenos
function validateFieldsPromoters()	  
{	 
	f = document.formPromoters;
			    
	if(!f.campoNombre.value)
	{
		alert("Please Insert  your  first and last Name");
		f.campoNombre.focus();
		return false;
	}	
	if(!validateMail(f.campoEmail.value))
	{
    	alert("Please Insert or Verify your Adress of Email. The Format is: xxx'@'xxx'.'xxx'");
		f.campoEmail.focus();
		return false;
	}
	if(!f.campoTelefono.value)
	{
    	alert("Please Insert your Number Telephone");
		f.campoTelefono.focus();
		return false;
	}
	if(!f.campoTipoEvento.value)
	{
    	alert("Please Insert the Event Type. Example Concert, Theatre, Sports.");
		f.campoTipoEvento.focus();
		return false;
	}
	if(!f.campoDescripcion.value)
	{
    	alert("Please Insert Descripction of Event");
		f.campoDescripcion.focus();
		return false;
	}   
				
	f.submit();
}

function validateFieldsShows()	  
{	 
	f = document.formShows;
			    
	if(!f.campoNombre.value)
	{
		alert("Por favor inserte su Nombre");
		f.campoNombre.focus();
		return false;
	}	
	if(!validateMail(f.campoEmail.value))
	{
    	alert("Por favor inserte o verifique su email. El formato es: xxx'@'xxx'.'xxx'");
		f.campoEmail.focus();
		return false;
	}
	if(!f.campoEstado.value)
	{
    	alert("Por favor inserte su Estado");
		f.campoEstado.focus();
		return false;
	}
	if(!f.campoCode.value)
	{
    	alert("Por favor inserte su Zid Code");
		f.campocode.focus();
		return false;
	}
					
	f.submit();
}

function validateFieldsMaster()	  
{	 
	f = document.formMasters;
			    
	if(!f.campoNombre.value)
	{
		alert("Please Insert your first Name");
		f.campoNombre.focus();
		return false;
	}
	if(!f.campoApellido.value)
	{
		alert("Please Insert  your last Name");
		f.campoApellido.focus();
		return false;
	}	
	if(!validateMail(f.campoEmail.value))
	{
    	alert("Please Insert or Verify your Adress of Email. The Format is: xxx'@'xxx'.'xxx'");
		f.campoEmail.focus();
		return false;
	}
	if(!f.campoTelefono.value)
	{
    	alert("Please Insert your Number Telephone");
		f.campoTelefono.focus();
		return false;
	}
	if(!f.campoDireccion.value)
	{
    	alert("Please Insert you Address Line 1");
		f.campoDireccion.focus();
		return false;
	}
			
	f.submit();
}

// Esta funcion valida los campos para que solo se puedan ingresar numeros
var nav4 = window.Event ? true : false;
function acceptNum(evt)
{
	// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57
	var key = nav4 ? evt.which : evt.keyCode;
	return (key <= 13 || (key >= 48 && key <= 57));
}

// ESta funcion valida el formato del campo Email
function validateMail(emailstr) {
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(emailstr))
        return true;
    else
        return false;
}
