function agenciaPromoVeri(){
	msn="";
	fnom = trim(window.document.getElementById("agName").value);
	fdirec = trim(window.document.getElementById("address").value);
	farea = trim(window.document.getElementById("area").value);
	ftele1 = trim(window.document.getElementById("telepri").value);
	ftele2 = trim(window.document.getElementById("telefono").value);
	femail = trim(window.document.getElementById("email").value);

	if( fnom=="" ){ msn+="- Name vacio.\n"; }else{
		if( exp0.test(fnom) || exp2.test(fnom) ){ msn+="- Name invalido.\n"; }
	}
	if( femail=="" ){ msn+="- Email vacio.\n"; }else{
		if( !FSfncValidateEmailAddress(window.document.getElementById("email"),false) ){  msn+="- Email invalido.\n"; } 
	}
	if( fdirec=="" ){ msn+="- Address vacio.\n"; }
	
	veritel = GeneralVeriPhone(farea,ftele1,ftele2);
	if( veritel=="vacio" ){ msn+="- Phone "+veritel+"\n"; }else{
		if( veritel!="ok" ){ msn+="- Phone "+veritel+"\n";	}
	}
	
	if( msn=="" ){ window.document.form1.submit(); }else{ alert(msn); }
}

function aeroVerMenu(valor){
	if( valor!="" ){
		window.document.getElementById("menuNo").style.display="none";
		window.document.getElementById("menuSi").style.display="block";
		
	}else{ 
		window.document.getElementById("menuSi").style.display="none";
		window.document.getElementById("menuNo").style.display="block";
	}
}

function aeroVerOpc(valor){
	miaero = window.document.getElementById("aero").value;
	window.document.getElementById("frameAero").src = "agencias_frame.php?aero="+miaero+"&opc="+valor;	
}

function formRegistro(){

	miagent = window.document.getElementById("agentHidden").value;
	mensaje = "";
	if( miagent=="si" ){
		miarc = window.document.getElementById("arc").value;
		if( miarc=="" ){ mensaje+= "- Casilla ARC/AITAN vacio.\n"; }
		miagName = window.document.getElementById("agName").value;
		if( miagName=="" ){ mensaje+= "- Casilla Agency Name vacio.\n"; 
		}else{ if( exp0.test(miagName) || exp2.test(miagName) ){ mensaje+= "- Casilla Agency Name es invalido.\n"; } }
	}else{
		micompany = window.document.getElementById("company").value;
		if( micompany=="" ){ mensaje+= "- Casilla Company vacio.\n"; 
		}else{ if( exp0.test(micompany) || exp2.test(micompany) ){ mensaje+= "- Casilla Company es invalido.\n"; } }
	}
	miuser = window.document.getElementById("user").value;
	if( miuser=="" ){ mensaje+= "- Casilla Usuario esta vacio.\n"; 
	}else{ 
		if( exp1.test(miuser) || exp4.test(miuser) ){ mensaje+= "- Casilla Usuario contiene caracteres invalidos.\n";		
		}else{
			if( miuser.length>9 ){ mensaje+= "- Casilla Usuario no mas de 9 caracteres.\n"; } 
		}
	}
	mipass = window.document.getElementById("pass").value;
	if( mipass=="" ){ mensaje+= "- Casilla Password esta vacio.\n"; 
	}else{ 
		if( exp1.test(mipass) || exp4.test(mipass) ){ mensaje+= "- Casilla Password contiene caracteres invalidos.\n";		
		}else{
			if( mipass.length>9 ){ mensaje+= "- Casilla Password no mas de 9 caracteres.\n"; } 
		}
	}
	miemail = window.document.getElementById("email").value;
	miemailX = window.document.getElementById("emailX").value;
	if( miemail!="" || miemailX!=""){
		es1 = FSfncValidateEmailAddress(window.document.getElementById("email"),false);
		es2 = FSfncValidateEmailAddress(window.document.getElementById("emailX"),false);
		if(!es1 || !es2){ mensaje+= "- Casilla de Emails no validos.\n";
		}else{ if( miemail!=miemailX ){ mensaje+= "- Casilla de Emails no corresponden.\n"; } }
	}else{ mensaje+= "- Casilla de Emails vacios.\n"; }
	
	mifname = window.document.getElementById("fName").value;
	if( mifname!="" ){ if( exp0.test(mifname) || exp2.test(mifname) ){ mensaje+= "- Casilla First Name es invalido.\n"; }
	}else{ mensaje+= "- Casilla First Name vacio.\n"; }
	
	milname = window.document.getElementById("lName").value;
	if( milname!="" ){ if( exp0.test(milname) || exp2.test(milname) ){ mensaje+= "- Casilla Last Name es invalido.\n"; }
	}else{ mensaje+= "- Casilla Last Name vacio.\n"; }
	
	if( window.document.getElementById("address").value=="" ){ mensaje+="- Casilla Street Address vacio.\n"; }

	micity = window.document.getElementById("city").value;
	if( micity!="" ){ if( exp0.test(micity) || exp2.test(micity) ){ mensaje+= "- Casilla City es invalido.\n"; }
	}else{ mensaje+= "- Casilla City vacio.\n"; }
	
	mipais = window.document.getElementById("country").value;
	if( mipais=="USA" ){
		if( window.document.getElementById("state").value==0 ){ mensaje+= "- Casilla State no seleccionada.\n"; }
	}else{
		if( window.document.getElementById("province").value==0 ){ mensaje+= "- Casilla Province no seleccionada.\n"; }
	}
	
	mizip = window.document.getElementById("zip").value;
	if( mizip=="" ){ mensaje+= "- Casilla Zip vacio.\n"; 
	}else{ if( exp1.test(mizip) || exp3.test(mizip) || exp4.test(mizip) ){ mensaje+= "- Casilla Zip invalido.\n"; } }
	
	mifono = window.document.getElementById("phone").value;
	if( mifono=="" ){ mensaje+= "- Casilla Phone vacio.\n"; 
	}else{ if( exp1.test(mifono) || exp3.test(mifono) || exp4.test(mifono) ){ mensaje+= "- Casilla Phone invalido.\n"; } }
	
	if( mensaje=="" ){ 
		window.document.form1.submit(); 
	}else{ alert("Datos Incompletos:\n"+mensaje) }
}
function formOlvidar(){
	miemail = window.document.getElementById("email").value;
	if(FSfncValidateEmailAddress(window.document.getElementById("email"),false)){ 
		window.location="agencias.php?email="+miemail;
	}
}

function verAgent(pregunta){
	if( pregunta=="yes" ){
		window.document.getElementById("preg2").style.display = "none";
		window.document.getElementById("preg1").style.display = "block";
		window.document.getElementById("preg3").style.display = "block";
		window.document.getElementById("agentHidden").value = "si";
	}else{
		window.document.getElementById("preg1").style.display = "none";
		window.document.getElementById("preg2").style.display = "block";
		window.document.getElementById("preg3").style.display = "none";
		window.document.getElementById("agentHidden").value = "no";
	}
}