//for spanish language validation
function spanish_valid_reg()
{
		  errorMsg = " ";  
		  invalid = null;
    emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/	
    numericExpression = /^[0-9]+$/;
    alphaExp = /^[a-zA-Z]+$/; 
		  if(document.frm_spanish.surname.value == "")
		  {
		   errorMsg += "Por favor, escriba el apellido (Apellido).\n";
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.surname;
		   }
		  }
		  
		  if (document.frm_spanish.title.value == "")
		 {
		   errorMsg += "Por favor, introduzca el título.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.title;
		   }
		 }
		 
		  if (document.frm_spanish.first_name.value == "")
		 {
		   errorMsg += "Por favor, introduzca el nombre.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.first_name;
		   }
		 }
		 
		   if (document.frm_spanish.mailing_address.value == "")
		 {
		   errorMsg += "Por favor, introduzca la dirección de correo.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.mailing_address;
		   }
		 }
		 
		   if (document.frm_spanish.city.value == "")
		 {
		   errorMsg += "Por favor, introduzca ciudad.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.city;
		   }
		 }
		 
		   /*if (document.frm_spanish.zip_code.value == "")
		 {
		   errorMsg += "Por favor, introduzca el código postal.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.zip_code;
		   }
		 }
		
		 if(!numericExpression.test(document.frm_spanish.zip_code.value))
	     {
	       errorMsg += "Por favor, introduzca el código postal válido.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.zip_code;
		   }
	     }*/
		
		 
		   if (document.frm_spanish.country.value == "Select")
		 {
		   errorMsg += "Por favor, introduzca país.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.country;
		   }
		 }		 
		   if (document.frm_spanish.email_address.value == "")
		 {
		   errorMsg += "Por favor, introduzca la dirección de correo electrónico.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.email_address;
		   }
		 }
		 
		 
		 if(!emailRe.test(document.frm_spanish.email_address.value))
	     {
	       errorMsg += "Por favor, introduzca dirección de correo electrónico válida.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.email_address;
		   }
	     }	
		 
		 // for language  
		    frmCheckform = document.frm_spanish;
			var chks = document.getElementsByName('chk_language[]');
			var hasChecked = false;
			for (var i = 0; i < chks.length; i++)
	        {
			if (chks[i].checked)
			{
	
			   hasChecked = true;
			   break;
	
			 }
	
			}
			if (!hasChecked)
			{
			  errorMsg +="Por favor, seleccione al menos un idioma.\n";
			}
			
			 // registration cost
			if (document.frm_spanish.full_reg.checked == false &&
			document.frm_spanish.RSCJ.checked == false &&
			document.frm_spanish.young_alumni.checked == false && 
			document.frm_spanish.accompanying.checked == false )
			{
				//alert(document.frm_english.full_reg.checked);
			errorMsg +="Vous devez choisir au moins une case à cocher pour les frais d'inscription.\n";
										/*return false;
										}
										else
										{				
										return true;*/							
										
			 if ( invalid == null )
			  {
			    invalid = document.frm_spanish.excelsior_holel_single;
			  }	
			  
			}
			
			// hotel cost
			/*if (document.frm_spanish.excelsior_holel_single.checked == false &&
			document.frm_spanish.excelsior_holel_twin.checked == false &&
			document.frm_spanish.excelsior_holel_triple.checked == false && 
			document.frm_spanish.victoria_holel_single.checked == false && 
			document.frm_spanish.victoriar_holel_twin.checked == false &&
			document.frm_spanish.victoria_holel_triple.checked == false &&			
			document.frm_spanish.baystreet_holel_single.checked == false &&
			
			document.frm_spanish.baystreet_holel_twin.checked == false &&
			document.frm_spanish.baystreet_holel_triple.checked == false &&
			document.frm_spanish.plevna_holel_single.checked == false && 
			document.frm_spanish.plevna_holel_twin.checked == false && 
			document.frm_spanish.plevna_holel_triple.checked == false &&
			document.frm_spanish.imperial_holel_single.checked == false &&
			document.frm_spanish.imperial_holel_twin.checked == false && 
			document.frm_spanish.imperial_holel_triple.checked == false)*/
			
			if (document.frm_spanish.excelsior_holel_single.checked == false &&			
			document.frm_spanish.victoria_holel_single.checked == false && 					
			document.frm_spanish.baystreet_holel_single.checked == false &&			
			document.frm_spanish.plevna_holel_single.checked == false &&		
			document.frm_spanish.imperial_holel_single.checked == false)
			{
				//alert(document.frm_english.full_reg.checked);
			    errorMsg +="Tienes que elegir al menos una opción de alojamiento en hoteles.\n";
							if ( invalid == null )
						   {
							 invalid = document.frm_spanish.excelsior_holel_single;
						   }
							/*return false;
							}
							else
							{				
							return true;*/
		    }
			
			// for pre post congrss
			/*frmCheckform1 = document.frm_spanish;
			var chks1 = document.getElementsByName('chk_congress[]');
			var hasChecked = false;
			for (var i = 0; i < chks1.length; i++)
	        {
			if (chks1[i].checked)
			{
	
			   hasChecked = true;
			   break;
	
			 }
	
			}
			if (!hasChecked)
			{
			  errorMsg +="Por favor, seleccione al menos un post anterior congrss.\n";
			}
			// for chk_excursions
			frmCheckform2 = document.frm_spanish;
			var chks2 = document.getElementsByName('chk_excursions[]');
			var hasChecked = false;
			for (var i = 0; i < chks2.length; i++)
	        {
			if (chks2[i].checked)
			{	
			   hasChecked = true;
			   break;	
			 }
	
			}
			if (!hasChecked)
			{
			  errorMsg +="Por favor, seleccione al menos un local de excursiones.\n";
			}	*/
			// for credit card payment
			/*frmCheckform1 = document.frm_spanish;
			var chks1 = document.getElementsByName('chk_card[]');
			var hasChecked = false;
			for (var i = 0; i < chks1.length; i++)
	        {
			if (chks1[i].checked)
			{
	
			   hasChecked = true;
			   break;
	
			 }
	
			}
			if (!hasChecked)
			{
			  errorMsg +="Por favor, seleccione al menos un pago con tarjeta de crédito tipo.\n";
			}*/
			
		/*   if (document.frm_spanish.total_payment.value == "")
		 {
		   errorMsg += "Por favor, introduzca el pago total.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.total_payment;
		   }
		 }*/
		 
		   /*if (document.frm_spanish.credit_card_no.value == "")
		 {
		   errorMsg += "Por favor, introduzca número de tarjeta de crédito.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.credit_card_no;
		   }
		 }		 
		 
		 if (document.frm_spanish.ccv_no.value == "")
		 {
		   errorMsg += "Por favor, introduzca CCV no\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.ccv_no;
		   }
		 }	 
		 
		   if (document.frm_spanish.name_on_card.value == "")
		 {
		   errorMsg += "Por favor, introduzca el nombre que aparece en la tarjeta.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.name_on_card;
		   }
		 }	
		 
		  if (document.frm_spanish.expiry_date.value == "")
		 {
		   errorMsg += "Por favor, introduzca la fecha de expiración.\n";
		
		   if ( invalid == null )
		   {
			 invalid = document.frm_spanish.expiry_date;
		   }
		 }	*/
		
		if(document.frm_spanish.agree.checked == false)
	      {
		     errorMsg += "por favor revise los términos y condiciones.\n";
			 if ( invalid == null )
		     {
			 invalid = document.frm_spanish.agree;
		     }
		  }
		  
		 //for display all message at a time 
		 if (errorMsg == " ")
		 {
		   //document.frm_english.submit();	 
		   return true;
		 }
		 else
		 {
		   alert("Los siguientes son obligatorio:\n" + errorMsg);
		   //invalid.focus();
		   return false;
		 }
		 return true;
}
