function validaDatosOlvCont(form){
	if(form.language.value == 'spanish.inc.php'){
		msg = 'Debe digitar el correo electronico!';	
	}else{
		msg = 'You must write the email address!';	
	}
	if (form.email_address.value == ""){
	  alert(msg);
	  form.email_address.focus();
	  return false;
	}
}

function validaDatosContactenos(form){
	//if(form.language.value == 'spanish.inc.php'){
		/*msg1 = 'Debe digitar su nombre!';
		msg2 = 'Debe digitar su n\xfamero de tel\xe9fono!';
		msg3 = 'Debe digitar su correo electr\xf3nico!';
		msg4 = 'Debe digitar sus comentarios!';
		msg5 = 'Debe digitar su apellido!';*/
		msg1 = 'You must write your name!';	
		msg2 = 'You must write your phone number!';	
		msg3 = 'You must write your email address!';	
		msg4 = 'You must write your comments!';	
	/*}else{
		msg1 = 'You must write your name!';	
		msg2 = 'You must write your phone number!';	
		msg3 = 'You must write your email address!';	
		msg4 = 'You must write your comments!';	
	//}*/
	if(form.frm_nombre.value == ''){
		alert(msg1);
		form.frm_nombre.focus();
		return false;
	}if(form.frm_apellido.value == ''){
		alert(msg5);
		form.frm_apellido.focus();
		return false;
	}else if(form.frm_correo.value == ''){
		alert(msg3);	
		form.frm_correo.focus();
		return false;
	}else if(form.frm_telefono.value == ''){
		alert(msg2);
		form.frm_telefono.focus();
		return false;
	}else if(form.frm_comentario.value == ''){
		alert(msg4)	;
		form.frm_comentario.focus();
		return false;
	}
}

function validaDatosLogin(form){
	if(form.language.value == 'spanish.inc.php'){
		msg1 = 'Debe digitar su usuario!';
		msg2 = 'Debe digitar su clave!';
	}else{
		msg1 = 'You must write your user name!';
		msg2 = 'You must write your password!';
	}
	if(form.frm_usuario.value == ''){
		alert(msg1);
		form.frm_usuario.focus();
		return false;
	}else if(form.frm_password.value == ''){
		alert(msg2);	
		form.frm_password.focus();
		return false;
	}
}

function validaDatosEditCliInfo(form){
	if(form.language.value == "spanish.inc.php"){
		msg1 = "Por favor, escriba su nombre!";
		msg2 = "Por favor, escriba sus apellidos!";
		msg3 = "Por favor, escriba su correo electrónico!";
		msg4 = "Por favor, confirme su correo electrónico!";
		msg5 = "Por favor, seleccione su país!";
		msg6 = "Por favor, escriba la ciudad!";
		msg7 = "Por favor, seleccione su estado!";
		msg8 = "Por favor, escriba su dirección física!";
		msg9 = "Por favor, escriba su teléfono!";
		msg10 = "Por favor, escriba su contraseña!";
		msg11 = "Por favor, escriba la confirmacion de su contraseña!";
	}else{
		msg1 = "Please, write your name!";
		msg2 = "Please, write your lastname!";
		msg3 = "Please, write your email!";
		msg4 = "Please, confirm your email!";
		msg5 = "Please, choose your country!";
		msg6 = "Please, write your city!";
		msg7 = "Please, choose your state!";
		msg8 = "Please, write your address!";
		msg9 = "Please, write your phone number!";
		msg10 = "Please, write your password!";
		msg11 = "Please, confirm your password!";
	}
	ms = 0;
	if (form.customers_firstname.value == "")
	{
		msg = msg1;
		ms = 1;
		form.customers_firstname.focus(); 		 
	} else
	if (form.customers_lastname.value == "")
	{
		msg = msg2;
		ms = 1;
		form.customers_lastname.focus(); 		 
	} else
	if (form.customers_email_address.value == "")
	{
		msg = msg3;
		ms = 1;
		form.customers_email_address.focus(); 		 
	} else
	if (form.customers_email_address.value == "")
	{
		msg = msg4;
		ms = 1;
		form.customers_reemail_address.focus(); 		 
	} else
	if (form.opciones.value == "0")
	{
		msg = msg5;
		ms = 1;
		form.opciones.focus(); 		 
	} else
	if (form.customers_city.value == "")
	{
		msg = msg6;
		ms = 1;
		form.customers_city.focus(); 		 
	} else 
	if (form.customers_street_address.value == "")
	{
		msg = msg8;
		ms = 1;
		form.customers_street_address.focus(); 		 
	} else 
	if (form.customers_telephone.value == "")
	{
		msg = msg9;
		ms = 1;
		form.customers_telephone.focus(); 		 
	} else 
	if (form.customers_postcode.value == "")
	{
		//msg = "Please write your ZIP!";
		//ms = 1;
		//form.customers_postcode.focus(); 		 
	} else
	if (form.passwd_1.value == "")
	{
		msg = msg10;
		ms = 1;
		form.passwd_1.focus(); 		 
	} else 
	if (form.passwd_2.value == "")
	{
		msg = msg11;
		ms = 1;
		form.passwd_2.focus(); 		 
	} 
	
	 if (ms == 1)
	  {
			alert (msg);
			return false;
	  }
}

function validaDatosCambiarPass(form){	
	if(form.language.value == 'spanish.inc.php'){
		msg1 = 'Debe incluir su contraseña actual!';
		msg2 = 'Debe incluir su nueva contraseña!';
		msg3 = 'Debe confirmar la contraseña!';
		msg4 = 'Ambas contraseñas deben coincidir!';	
		msg5 = 'Contraseña actual inválida!';
	}else{
		msg1 = 'You must write your actual password!';
		msg2 = 'You must write your password!';
		msg3 = 'You must confirm the password!';
		msg4 = 'The passwords must match!';
		msg5 = 'Wrong actual password!';
	}
	if(form.OldPassword.value == ""){
		alert(msg1);
		form.OldPassword.focus();
		return false;
	}else if(form.NewPassword.value == ""){
		alert(msg2);
		form.NewPassword.focus();
		return false;
	}else if(form.Repassword.value == ""){
		alert(msg3);
		form.Repassword.focus();
		return false;
	}else if(form.NewPassword.value != form.Repassword.value){
		alert(msg4);
		form.NewPassword.value = '';
		form.Repassword.value = '';
		form.NewPassword.focus();
		return false;
	}else if(form.OldPassword.value != form.OldPasswordBD.value){
		alert(msg5);
		form.OldPassword.value = '';
		form.OldPassword.focus();
		return false;
	}
}

function validaDatosFecEsp(form){
	if(form.language.value == 'spanish.inc.php'){
		msg1 = 'Debe seleccionar la fecha!';	
		msg2 = 'Debe digitar un aviso!';
	}else{
		msg1 = 'You must select the date!';	
		msg2 = 'You must write the notice!';
	}
	if (form.de.value == ""){
		alert(msg1)
		form.de.focus(); 		 
		return false;
	}else if (form.comment.value == ""){
		alert(msg2)
		form.comment.focus(); 
		return false;
	} 
	
}//end function 

function updateCar(form){
	form.submit();	
}

function copyData(form){	
	if(form.checkbox.checked == true){
		form.sa_customers_firstname.value = 	form.ba_customers_firstname.value;
		form.sa_customers_lastname.value = 	    form.ba_customers_lastname.value;
		form.sa_customers_company.value =  	    form.ba_customers_company.value;
		form.sa_customers_email.value =  	    form.ba_customers_email.value;
		document.getElementById('text_country').style.display = 'block';
		document.getElementById('combo_country').style.display = 'none';
		form.sa_customers_country.value =  	    form.ba_customers_country.value;
		form.sa_customers_city.value =  	    form.ba_customers_city.value;
		document.getElementById('fila_valores').style.display = 'none';
		document.getElementById('fila_states').style.display = 'block';
		form.sa_customers_state.value =  	    form.ba_customers_state.value;
		form.sa_customers_street_address.value = form.ba_customers_street_address.value;
		form.sa_customers_telephone.value = 	  form.ba_customers_telephone.value;
		form.sa_customers_postcode.value = 	    form.ba_customers_postcode.value;
	}else{
		form.sa_customers_firstname.value = 	 "";
		form.sa_customers_lastname.value = 	 "";
		form.sa_customers_company.value =  	 "";
		form.sa_customers_email.value =  	 "";
		document.getElementById('text_country').style.display = 'none';
		document.getElementById('combo_country').style.display = 'block';
		form.sa_customers_country.value =  	 "";
		form.sa_customers_city.value =  	 "";
		document.getElementById('fila_valores').style.display = 'block';
		document.getElementById('fila_states').style.display = 'none';
		form.sa_customers_state.value =  	 "";
		form.sa_customers_street_address.value = 	 "";
		form.sa_customers_telephone.value = 	 "";
		form.sa_customers_postcode.value = 	 "";
	}
}

function validaDatosConfAdd(){
	if(document.shipping_address.language.value == "spanish.inc.php"){
		msg1 = 'Por favor escriba su nombre!';
		msg2 = 'Por favor escriba su apellido!';
		msg3 = 'Por favor escriba su email!';
		msg4 = 'Por favor escriba su país!';
		msg5 = 'Por favor escriba su ciudad!';
		msg6 = 'Por favor escriba su estado!';
		msg7 = 'Por favor escriba su dirección!';
		msg8 = 'Por favor escriba su teléfono!';
		msg9 = 'Por favor escriba su código postal!';
		msg10 = 'Por favor seleccione un país!';
	}else{
		msg1 = 'Please write your first name!';
		msg2 = 'Please write your last name!';
		msg3 = 'Please write your email!';
		msg4 = 'Please write your country!';
		msg5 = 'Please write your city!';
		msg6 = 'Please write your state!';
		msg7 = 'Please write your address!';
		msg8 = 'Please write your phone number!';
		msg9 = 'Please write your zip code!';
		msg10 = 'Please choose a country!';
	}
	if (document.shipping_address.sa_customers_firstname.value == "" ){
		alert(msg1); 
		document.shipping_address.sa_customers_firstname.focus();
		return false;
	}
	if (document.shipping_address.sa_customers_lastname.value == "" ){
		alert(msg2); 
		document.shipping_address.sa_customers_lastname.focus();
		return false;
	}	
	if (document.shipping_address.sa_customers_email.value == "" ){
		alert(msg3); 
		document.shipping_address.sa_customers_email.focus();
		return false;
	}
	if(document.getElementById('text_country').style.display == 'block'){
		if (document.shipping_address.sa_customers_country.value == "" ){
			alert(msg4); 
			document.shipping_address.sa_customers_country.focus();
			return false;
		}
	}else{
		if (document.shipping_address.opciones.value == "0" ){
			alert(msg10); 
			document.shipping_address.opciones.focus();
			return false;
		}else{
			var country_id = document.getElementById('opciones').value;
			document.getElementById('sa_customers_country_id').value = country_id;
		}
	}
	if (document.shipping_address.sa_customers_city.value == "" ){
		alert(msg5); 
		document.shipping_address.sa_customers_city.focus();
		return false;
	}
	if(document.getElementById('fila_states').style.display == 'block'){
		if (document.shipping_address.sa_customers_state.value == "" ){
			alert(msg6); 
			document.shipping_address.sa_customers_state.focus();
			return false;
		}
	}else{
		if(document.shipping_address.sa_customers_state.value != "0"){
			var state_id = document.getElementById('valores').value;
			document.getElementById('sa_customers_state_id').value = state_id;	
		}
	}
	if (document.shipping_address.sa_customers_street_address.value == "" ){
		alert(msg7); 
		document.shipping_address.sa_customers_street_address.focus();
		return false;
	}
	if (document.shipping_address.sa_customers_telephone.value == "" ){
		alert(msg8); 
		document.shipping_address.sa_customers_telephone.focus();
		return false;
	}
	if (document.shipping_address.sa_customers_postcode.value == "" ){
		alert(msg9); 
		document.shipping_address.sa_customers_postcode.focus();
		return false;
	}	
}//end function 

/*function redirectConfAdd(){
	//location.href = '?action=20';
	location.href = 'editinfo';
}*/

function toggleText_review() {
	var objShortText = document.getElementById('escribir_comentario').style;
	
	if ((objShortText.display == 'block') || (objShortText.display == '')) {
		objShortText.display = 'none';		
	} else {
		objShortText.display = 'block';		
	}
}

function validaDatosReview(form){
	if(form.language.value == "spanish.inc.php"){
		msg1 = 'Debe escribir su nombre!';
		msg2 = 'Debe escribir su email!';
		msg3 = 'Debe escribir un comentario!';		
	}else{
		msg1 = 'You must write your name!';
		msg2 = 'You must write your email!';
		msg3 = 'You must write a review!';		
	}
	if(form.NamePerson.value == ""){
		alert(msg1);
		form.NamePerson.focus();
		return false;
	}else if(form.EmailPerson.value == ""){
		alert(msg2)	;
		form.EmailPerson.focus();
		return false;
	}else if(form.txt_review.value == ""){
		alert(msg3)	;
		form.txt_review.focus();
		return false;
	}
}

function validaDatosTellaF(form){			  
	if(form.language.value == 'spanish.inc.php'){
		msg1 = "su nombre!";
		msg2 = "su email!";
		msg3 = "el nombre de su amigo!";
		msg4 = "el email de su amigo!";
		msg5 = "sus comentarios!";
		msg6 = "Por favor escriba ";
	}else{
		msg1 = "your name!";
		msg2 = "your email!";
		msg3 = "your friend's name!";
		msg4 = "your friend's email!";
		msg5 = "the comments!";
		msg6 = "Please write ";
	}
	ms = 0;
	if (form.txt_your_name.value == ""){
		msg = msg1;
		ms = 1;
		form.txt_your_name.focus(); 		 
	}else if (form.txt_your_mail.value == ""){
		msg = msg2;
		ms = 1;
		form.txt_your_mail.focus(); 		 
	}else if (form.txt_frieds_name.value == ""){
		msg = msg3;
		ms = 1;
		form.txt_frieds_name.focus(); 		 
	}else if (form.txt_friends_mail.value == ""){
		msg = msg4;
		ms = 1;
		form.txt_friends_mail.focus(); 		 
	}else if (form.txtcomments.value == ""){
		msg = msg5;
		ms = 1;
		form.txtcomments.focus(); 		 
	} 
	if (ms == 1){
		alert(msg6 + msg);
		return false;
	}
}//end function 

function validaDatosRegistrese(form){
	if(form.language.value == "spanish.inc.php"){
		msg1 = "Por favor, escriba su nombre!";
		msg2 = "Por favor, escriba sus apellidos!";
		msg3 = "Por favor, escriba su correo electrónico!";
		msg4 = "Por favor, confirme su correo electrónico!";
		msg5 = "Los correos electrónicos deben ser iguales!";
		msg6 = "Por favor, seleccione su país!";
		msg7 = "Por favor, escriba la ciudad!";
		msg8 = "Por favor, seleccione su estado!";
		msg9 = "Por favor, escriba su dirección física!";
		msg10 = "Por favor, escriba su teléfono!";
		msg11 = "Por favor, escriba su contraseña!";
		msg12 = "Por favor, escriba la confirmacion de su contraseña!";
		msg13 = "La confirmación de contraseña no corresponde a su contraseña!";
		msg14 = "Debe aceptar los Términos y Condiciones!";
	}else{
		msg1 = "Please, write your name!";
		msg2 = "Please, write your lastname!";
		msg3 = "Please, write your email!";
		msg4 = "Please, confirm your email!";
		msg5 = "The emails must match!";
		msg6 = "Please, choose your country!";
		msg7 = "Please, write your city!";
		msg8 = "Please, choose your state!";
		msg9 = "Please, write your address!";
		msg10 = "Please, write your phone number!";
		msg11 = "Please, write your password!";
		msg12 = "Please, confirm your password!";
		msg13 = "The passwords must match!";
		msg14 = "You must accept the Terms and Conditions";
	}
	var ms = 0;
	  
	  
	if (form.customers_firstname.value == ""){
		msg = msg1;
		ms = 1;
		form.customers_firstname.focus(); 		 
	}else if (form.customers_lastname.value == ""){
		msg = msg2;
		ms = 1;
		form.customers_lastname.focus(); 		 
	}else if (form.customers_email_address.value == ""){
		msg = msg3;
		ms = 1;
		form.customers_email_address.focus(); 		 
	}else if (form.customers_reemail_address.value == ""){
		msg = msg4;
		ms = 1;
		form.customers_reemail_address.focus(); 		 
	}else if (form.customers_reemail_address.value != form.customers_email_address.value){
		msg = msg5;
		ms = 1;
		form.customers_reemail_address.focus(); 		 
	}else if (form.opciones.value == '0'){
		msg = msg6;
		ms = 1;
		form.opciones.focus(); 		 
	}else if (form.customers_city.value == ""){
		msg = msg7;
		ms = 1;
		form.customers_city.focus(); 		 
	}else if (form.customers_street_address.value == ""){
		msg = msg9;
		ms = 1;
		form.customers_street_address.focus(); 		 
	}else if (form.customers_telephone.value == ""){
		msg = msg10;
		ms = 1;
		form.customers_telephone.focus(); 		 
	}else if (form.passwd_1.value == ""){
		msg = msg11;
		ms = 1;
		form.passwd_1.focus(); 		 
	}else if (form.passwd_2.value == ""){
		msg = msg12;
		ms = 1;
		form.passwd_2.focus(); 		 
	}else if (form.passwd_2.value != form.passwd_1.value ){
		msg = msg13;
		ms = 1;
		form.passwd_2.focus(); 		 
	}else if(document.getElementById('acepto').checked == false){
		msg = msg14;
		ms = 1;
	}
	
		
	if (ms == 1){
		alert (msg);
		return false;
	}
	document.customer.Submit.value = "yes";
	document.customer.submit();
}//end function 

function habilitarEnviar(valor){
	if(valor.value == 'acepto'){
		document.getElementById('span_registrar').style.display = "inline";	
	}else if(valor.value == 'no_acepto'){
		document.getElementById('span_registrar').style.display = "none";	
	}
}

function validaDatosConfOrder(form){
	if(form.language.value == "spanish.inc.php"){
		msg = "Debe seleccionar el método de pago!";	
	}else{
		msg = "You must choose the payment method!";	
	}
	
	if(form.esquema_pago[0].checked != true && form.esquema_pago[1].checked != true){
		alert(msg);
		return false;
	}	
}
