//--------------------------------------------------------------------------------------------------------------------------------
function envia_datos1(form_toyota)
{
		
		if (form_toyota.fecha_1.value == "" || form_toyota.fecha_1.value == "0000-00-00") 
		{
         	alert ("It must select the date of beginning");
         	form_toyota.fecha_1.focus(); 		 
		 	return false;
  		}
		else 
		if (form_toyota.fecha_2.value == "" || form_toyota.fecha_2.value == "0000-00-00") 
		{
        	alert ("It must select the final date ");
        	form_toyota.fecha_2.focus(); 		 
			return false;
  		}
		else 
		if (form_toyota.fecha_1.value < form_toyota.date_fecha_reservacion.value) 
		{
        	alert ("the dates are incorrect");
        	form_toyota.fecha_1.focus(); 		 
			return false;
		}
		else 
		if (form_toyota.fecha_1.value > form_toyota.fecha_2.value) 
		{
        	alert ("The date of beginning must be smaller than the final date");
        	form_toyota.fecha_1.focus(); 		 
			return false;
		}
		else
		if (form_toyota.fecha_1.value == form_toyota.fecha_2.value) 
		{
        	if (form_toyota.int_hora_inicio.value == form_toyota.int_hora_final.value) 
			{
				if (form_toyota.indicador_inicio.value ==  form_toyota.indicador_final.value) 
				{
					alert ("The hours of beginning and end must be different");
					form_toyota.fecha_1.focus(); 		 
					return false;
				}	
				else
				if (form_toyota.indicador_inicio.value == "p.m.") 
				{
					alert ("The final hour is incorrect");
					form_toyota.fecha_1.focus(); 		 
					return false;
				}	
			}	
			else
			if (form_toyota.int_hora_inicio.value > form_toyota.int_hora_final.value) 
			{
				if (form_toyota.indicador_inicio.value ==  form_toyota.indicador_final.value) 
				{
					alert ("The hour of beginning must be smaller to the end");
					form_toyota.fecha_1.focus(); 		 
					return false;
				}	
				else
				if (form_toyota.indicador_inicio.value == "p.m.") 
				{
					alert ("The final hour is incorrect");
					form_toyota.fecha_1.focus(); 		 
					return false;
				}	
			}
			else
			if (form_toyota.indicador_inicio.value == "p.m." && form_toyota.indicador_final.value == "a.m.") 	{
					alert ("The final hour is incorrect");
					form_toyota.fecha_1.focus(); 		 
					return false;
				}	
		}
		return true;
}
 
//--------------------------------------------------------------------------------------------------------------------------------
function envia_datos2(form_daihatsu)
{
		if (form_daihatsu.fecha_1.value == "" || form_daihatsu.fecha_1.value == "0000-00-00") 
		{
         	alert ("It must select the date of beginning");
         	form_daihatsu.fecha_1.focus(); 		 
		 	return false;
  		}
		else 
			if (form_daihatsu.fecha_2.value == "" || form_daihatsu.fecha_2.value == "0000-00-00") 
			{
         		alert ("It must select the final date ");
         		form_daihatsu.fecha_2.focus(); 		 
		 		return false;
  			}
			else 
				if (form_daihatsu.fecha_1.value < form_daihatsu.date_fecha_reservacion2.value) 
				{
        			alert ("the dates are incorrect");
         			form_daihatsu.fecha_1.focus(); 		 
		 			return false;
				}
				else 
					if (form_daihatsu.fecha_1.value > form_daihatsu.fecha_2.value) 
					{
        				alert ("The date of beginning must be smaller than the final date");
         				form_daihatsu.fecha_1.focus(); 		 
		 				return false;
					}
					else
				    	if (form_daihatsu.fecha_1.value == form_daihatsu.fecha_2.value) 
						{
        					if (form_daihatsu.int_hora_inicio.value == form_daihatsu.int_hora_final.value) 
							{
			
								if (form_daihatsu.indicador_inicio.value ==  form_daihatsu.indicador_final.value) 
								{
									alert ("The hours of beginning and end must be different");
									form_daihatsu.fecha_1.focus(); 		 
									return false;
								}	
								else
									if (form_daihatsu.indicador_inicio.value == "p.m.") 
									{

										alert ("The final hour is incorrect");
										form_daihatsu.fecha_1.focus(); 		 
										return false;
									}	
							}	
							else
								if (form_daihatsu.int_hora_inicio.value > form_daihatsu.int_hora_final.value) 
								{
									if (form_daihatsu.indicador_inicio.value ==  form_daihatsu.indicador_final.value) 
									{
										alert ("The hour of beginning must be smaller to the end");
										form_daihatsu.fecha_1.focus(); 		 
										return false;
									}	
									else
										if (form_daihatsu.indicador_inicio.value == "p.m.") 
										{
											alert ("The final hour is incorrect");
											form_daihatsu.fecha_1.focus(); 		 
											return false;
										}	
								}
								else
									if (form_daihatsu.indicador_inicio.value == "p.m." && form_daihatsu.indicador_final.value == "a.m.") 
									{
										alert ("The final hour is incorrect");
										form_daihatsu.fecha_1.focus(); 		 
										return false;
									}	
								
						}

	return true;
}

/*--------------------------------------------------------------------------------------------------------------------------------
function envia_datos3()
{
		if (form_tres.fecha_1.value == "" || form_tres.fecha_1.value == "0000-00-00") 
		{
         	alert ("Debe seleccionar la fecha de inicio");
         	form_tres.fecha_1.focus(); 		 
		 	return false;
  		}
		else 
			if (form_tres.fecha_2.value == "" || form_tres.fecha_2.value == "0000-00-00") 
			{
         		alert ("Debe seleccionar la fecha final ");
         		form_tres.fecha_2.focus(); 		 
		 		return false;
  			}
			else 
				if (form_tres.fecha_1.value < form_tres.date_fecha_reservacion2.value) 
				{
        			alert ("las fechas son incorrectas");
         			form_tres.fecha_1.focus(); 		 
		 			return false;
				}
				else 
					if (form_tres.fecha_1.value > form_tres.fecha_2.value) 
					{
        				alert ("La fecha de inicio debe ser menor que la fecha final");
         				form_tres.fecha_1.focus(); 		 
		 				return false;
					}
					else
				    	if (form_tres.fecha_1.value == form_tres.fecha_2.value) 
						{
        					if (form_tres.int_hora_inicio.value == form_tres.int_hora_final.value) 
							{
			
								if (form_tres.indicador_inicio.value ==  form_tres.indicador_final.value) 
								{
									alert ("Las horas de  inicio y final deben de ser distintas");
									form_tres.fecha_1.focus(); 		 
									return false;
								}	
								else
									if (form_tres.indicador_inicio.value == "p.m.") 
									{
										alert ("La hora final es incorrecta");
										form_tres.fecha_1.focus(); 		 
										return false;
									}	
							}	
							else
								if (form_tres.int_hora_inicio.value > form_tres.int_hora_final.value) 
								{
									if (form_tres.indicador_inicio.value ==  form_tres.indicador_final.value) 
									{
										alert ("La hora de  inicio debe ser menor a la final");
										form_tres.fecha_1.focus(); 		 
										return false;
									}	
									else
										if (form_tres.indicador_inicio.value == "p.m.") 
										{
											alert ("La hora final es incorrecta");
											form_tres.fecha_1.focus(); 		 
											return false;
										}	
								}
								else
									if (form_tres.indicador_inicio.value == "p.m." && form_tres.indicador_final.value == "a.m.") 
									{
										alert ("La hora final es incorrecta");
										form_tres.fecha_1.focus(); 		 
										return false;
									}	
								
						}
			
		
	document.form_tres.submit();
	return true;
}
*/
//--------------------------------------------------------------------------------------------------------------------------------
function envia_datos4(form_cuatro)
{
		if (form_cuatro.fecha_1.value == "" || form_cuatro.fecha_1.value == "0000-00-00") 
		{
         	alert ("It must select the date of beginning");
         	form_cuatro.fecha_1.focus(); 		 
		 	return false;
  		}
		else 
			if (form_cuatro.fecha_2.value == "" || form_cuatro.fecha_2.value == "0000-00-00") 
			{
         		alert ("It must select the final date ");
         		form_cuatro.fecha_2.focus(); 		 
		 		return false;
  			}
			else 
				if (form_cuatro.fecha_1.value < form_cuatro.date_fecha_reservacion2.value) 
				{
        			alert ("the dates are incorrect");
         			form_cuatro.fecha_1.focus(); 		 
		 			return false;
				}
				else 
					if (form_cuatro.fecha_1.value > form_cuatro.fecha_2.value) 
					{
        				alert ("The date of beginning must be smaller than the final date");
         				form_cuatro.fecha_1.focus(); 		 
		 				return false;
					}
					else
				    	if (form_cuatro.fecha_1.value == form_cuatro.fecha_2.value) 
						{
        					if (form_cuatro.int_hora_inicio.value == form_cuatro.int_hora_final.value) 
							{
			
								if (form_cuatro.indicador_inicio.value ==  form_cuatro.indicador_final.value) 
								{
									alert ("he hours of beginning and end must be different");
									form_cuatro.fecha_1.focus(); 		 
									return false;
								}	
								else
									if (form_cuatro.indicador_inicio.value == "p.m.") 
									{
										alert ("The final hour is incorrect");
										form_cuatro.fecha_1.focus(); 		 
										return false;
									}	
							}	
							else
								if (form_cuatro.int_hora_inicio.value > form_cuatro.int_hora_final.value) 
								{
									if (form_cuatro.indicador_inicio.value ==  form_cuatro.indicador_final.value) 
									{
										alert ("The hour of beginning must be smaller to the end");
										form_cuatro.fecha_1.focus(); 		 
										return false;
									}	
									else
										if (form_cuatro.indicador_inicio.value == "p.m.") 
										{
											alert ("The final hour is incorrect");
											form_cuatro.fecha_1.focus(); 		 
											return false;
										}	
								}
								else
									if (form_cuatro.indicador_inicio.value == "p.m." && form_cuatro.indicador_final.value == "a.m.") 
									{
										alert ("The final hour is incorrect");
										form_cuatro.fecha_1.focus(); 		 
										return false;
									}	
								
						}
	return true;
}
 
function ValidaCampo(form)
{
  fecha = form.value;
  form.value = "";
  form.value = fecha;
  form.focus(); 		 
  return false;
}
