var loadstatustext="<img src='iconos/loading.gif' /> Procesando ..."
var contenedor_anterior

//-----------------------------------------------------------------------------------------------------------
function objetoAjax(){
	var xmlhttp=false;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (E) {
 			xmlhttp = false;
 		}
  	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

//-----------------------------------------------------------------------------------------------------------
function GetContenedorAnterior(){
	contenedor_anterior = document.getElementById("general").innerHTML
}
//-----------------------------------------------------------------------------------------------------------
function Regresar(){
	contenedor=document.getElementById("general")
	contenedor.innerHTML=contenedor_anterior	
}
//-----------------------------------------------------------------------------------------------------------
function EnviarMensaje() {
	var contenedor
	var	nombre
	var	apellido
	var pais
	var empresa
	var direccion
	var telefono
	var email
	var comentario		
	
	nombre = document.frmContact.nombre.value;
	apellido = document.frmContact.apellido.value;
	pais = document.frmContact.pais.value;
	empresa = document.frmContact.empresa.value;
	direccion = document.frmContact.direccion.value;
	telefono = document.frmContact.telefono.value;
	email = document.frmContact.email.value;
	comentario = document.frmContact.comentario.value;

	//validando
	if(nombre==""){ 
	alert("ENTER THE NAME");
	document.frmContact.nombre.focus();
	return;
	} 

	if(apellido==""){ 
	alert("ENTER THE LAST NAME");
	document.frmContact.apellido.focus();
	return;
	} 

	if(pais==""){ 
	alert("ENTER THE COUNTRY");
	document.frmContact.pais.focus();
	return;
	} 

	/*if(empresa==""){ 
	alert("ENTER THE COMPANY");
	document.frmContact.empresa.focus();
	return;
	} */

	if(direccion==""){ 
	alert("ENTER THE ADRESS");
	document.frmContact.direccion.focus();
	return;
	} 

	if(telefono==""){ 
	alert("ENTER THE TELEPHONE");
	document.frmContact.telefono.focus();
	return;
	}
	

	if(email==""){ 
	alert("ENTER THE EMAIL");
	document.frmContact.email.focus();
	return;
	} 

	if(comentario==""){ 
	alert("ENTER THE COMMENTS");
	document.frmContact.comentario.focus();
	return;
	} 
	contenedor=document.getElementById("general")
	contenedor.innerHTML=loadstatustext
	ajax=objetoAjax();
	ajax.open("POST", "enviacontactenos.php",true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	ajax.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
	ajax.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
	ajax.setRequestHeader("Pragma", "no-cache");
	ajax.onreadystatechange=function() {if (ajax.readyState==4) {contenedor.innerHTML = ajax.responseText}}
	ajax.send("nombre="+nombre+"&apellido="+apellido+"&pais="+pais+"&empresa="+empresa+"&direccion="+direccion+"&telefono="+telefono+"&email="+email+"&comentario="+comentario)
}
//-----------------------------------------------------------------------------------------------------------
if(navigator.appVersion.substring(0,1)>=3)
	{
	bot1		=new Image();
	bot1.src 	="iconos/m2.gif";
	bot1p		=new Image();
	bot1p.src 	="iconos/m2p.gif";
	bot2		=new Image();
	bot2.src 	="iconos/m3.gif";
	bot2p		=new Image();
	bot2p.src 	="iconos/m3p.gif";
	bot3		=new Image();
	bot3.src 	="iconos/m4.gif";
	bot3p		=new Image();
	bot3p.src 	="iconos/m4p.gif";
	bot4		=new Image();
	bot4.src 	="iconos/sm1.gif";
	bot4p		=new Image();
	bot4p.src 	="iconos/sm1p.gif";
	bot5		=new Image();
	bot5.src 	="iconos/sm2.gif";
	bot5p		=new Image();
	bot5p.src 	="iconos/sm2p.gif";
	bot6		=new Image();
	bot6.src 	="iconos/sm3.gif";
	bot6p		=new Image();
	bot6p.src 	="iconos/sm3p.gif";
	bot7		=new Image();
	bot7.src 	="iconos/sm4.gif";
	bot7p		=new Image();
	bot7p.src 	="iconos/sm4p.gif";
	bot8		=new Image();
	bot8.src 	="iconos/sm5.gif";
	bot8p		=new Image();
	bot8p.src 	="iconos/sm5p.gif";
	bot9		=new Image();
	bot9.src 	="iconos/sm6.gif";
	bot9p		=new Image();
	bot9p.src 	="iconos/sm6p.gif";
	bot10		=new Image();
	bot10.src 	="iconos/sm7.gif";
	bot10p		=new Image();
	bot10p.src 	="iconos/sm7p.gif";
}

function CambiaImg(imgid,imgnew)
        {
        if(navigator.appVersion.substring(0,1)>=3)
                {
                document.images[imgid].src=eval(imgnew+".src");
                }
}
//-----------------------------------------------------------------------------------------------------------
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-----------------------------------------------------------------------------------------------------------
function AbreVen(url){
window.open(url,'regiones','toolbar=no,scrollbars=yes,resizable=no,height=456,width=790')
}
//-----------------------------------------------------------------------------------------------------------