// JavaScript Document
//Funcion para abrir ventanas estilo pop-up
		var win = null;
		function NewWindow(mypage,myname,w,h,scroll){
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2-15 : 0;
		settings =
		'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
		win = window.open(mypage,myname,settings)
		if(win.window.focus){win.window.focus();}
		}

//Function para js
function change_country(){
 if (document.precontact.country.value != "United States"){
 document.precontact.state.value = "N/A";
 }
}

// JavaScript Document

  //Funcion de revision de correo en espanol
  function revisaForm () { 

	//Inicializar las variables
	var errorMsg = "";
	
	//Revisamos el nombre
	if (document.form.name.value == ""){
		errorMsg += "\n\tName \t\t- Write a name.";	
	}
	
	//Revisamos si la direccion de correo electronico es correcta
	if ((document.form.email.value == "") || (document.form.email.value.length > 0 && (document.form.email.value.indexOf("@",0) == - 1 || document.form.email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail \t\t- Write a valid email address.";
	}
	
	//Revisamos el telefono
	if (document.form.phone.value == ""){
		errorMsg += "\n\tPhone \t\t- Write a phone number.";	
	}
	
	//Revisamos el asunto
	/*if (document.form.fax.value == ""){
		errorMsg += "\n\tFaz \t\t- Write a Fax Number.";	
	}*/
	
	//Revisamos el mensaje
	if (document.form.mailing.value == ""){
		errorMsg += "\n\tMailing Address \t- Write a mailing address.";	
	}

	//Revisamos el mensaje
	if (document.form.city.value == ""){
		errorMsg += "\n\tCity \t\t- Write a city.";	
	}
		
	//Revisamos el mensaje
	if (document.form.country.value == ""){
		errorMsg += "\n\tCountry \t\t- Write a country.";	
	}

	//Revisamos el mensaje
	if (document.form.zip.value == ""){
		errorMsg += "\n\tZip Code \t\t- Write a zip code.";	
	}

	//Revisamos el mensaje
	if (document.form.state.value == ""){
		errorMsg += "\n\tState \t\t- Write a state.";	
	}

	//Revisamos el mensaje
	if (document.form.mes.value == ""){
		errorMsg += "\n\tMessage \t\t- Write a message.";	
	}
				
	//Si ocurre algun problema lo mostramos con un alert
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "The following fields need to be fixed before re-submitting the form.\n";
		msg += "______________________________________________________________\n\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
	}