// JavaScript Document

function ventana()
{ posicionX=0;
  posicionY=0;
 //alert( window.pageYOffset);
  if(window.pageYOffset) //mozilla
    { posicionX= (window.outerWidth /2) - 150 + "px";
	  posicionY= window.pageYOffset  + 80 + "px";
	}
   else
    { posicionX= (document.body.clientWidth / 2) - 60 + "px";
	  posicionY= document.body.scrollTop + 80 + "px";
	}
  if(document.getElementById("divVentana")){
	  document.getElementById("divVentana").style.left= posicionX;
	  document.getElementById("divVentana").style.top= posicionY;
	  document.getElementById("divVentana").style.width="300 px";
	  document.getElementById("divVentana").style.height="320 px";
	  document.getElementById("divVentana").style.visibility="visible";
	  document.getElementById("divVentana").style.position="fixed";  
  }
  else{
	  parent.document.getElementById("divVentana").style.left= posicionX;
	  parent.document.getElementById("divVentana").style.top= posicionY;
	  parent.document.getElementById("divVentana").style.width="300 px";
	  parent.document.getElementById("divVentana").style.height="320 px";
	  parent.document.getElementById("divVentana").style.visibility="visible";
	  parent.document.getElementById("divVentana").style.position="fixed"; 
  }
}

function cerrarVentana()
{

   if(document.getElementById("divVentana")){	 
	  /*document.getElementById("divVentana").style.left= "1 px";
	  document.getElementById("divVentana").style.top= "1 px";
	  document.getElementById("divVentana").style.width="1 px";
	  document.getElementById("divVentana").style.height="1 px";*/
	  document.getElementById("divVentana").style.visibility="hidden";
   }
   else{
	  /*parent.document.getElementById("divVentana").style.left= "1 px";
	  parent.document.getElementById("divVentana").style.top= "1 px";
	  parent.document.getElementById("divVentana").style.width="1 px";
	  parent.document.getElementById("divVentana").style.height="1 px";*/
	  parent.document.getElementById("divVentana").style.visibility="hidden";    
   }
   


}



function enviarDatos()
{  
   nombre=   document.getElementById("nombre2").value;
   telefono= document.getElementById("telefono2").value;
   nombre=   nombre.replace(/^\s*|\s*$/g,"");
   telefono= telefono.replace(/^\s*|\s*$/g,"");
   
   
   if (nombre.length == 0)
    { alert("Proporiocione su nombre");}
   else if ((telefono.length < 10) || (isNaN(telefono)) )
    { alert("N\u00FAmero de tel\u00E9fono inv\u00E1lido, s\u00F3lo escriba n\u00FAmeros");}
   else
    { 
        //document.location = "../../../ventanaIeu/atiendeSolicitud.asp?nombre2"+nombre+"&telefono2="+ telefono +"&rnd="+Math.random();
	    
	/*
		new Ajax.Updater('areaInterna', "../../../ventanaIeu/atiendeSolicitud.asp",
		  {   
			  parameters: "nombre2="+ nombre + "&telefono2=" + telefono +"&rnd="+Math.random(),
			  method: 'post',   
			  onComplete: function(transport) 
			  {    
				 
			  } 
		 });  
	
		*/
		 document.getElementById("button2").disabled = "disabled";
	     new Ajax.Request("../../../ventanaIeu/atiendeSolicitud.asp", {
		  method: 'post',
		  parameters: "nombre2="+ nombre + "&telefono2=" + telefono +"&rnd="+Math.random(),
		  onSuccess: function(transport) {
			 parent.document.getElementById("areaInterna").innerHTML = "<br><br><span class='style20'><center>Un asesor se pondr&aacute; en contacto contigo a la brevedad.</center></span>";
		  }
		});
		 
		  
		  
		 
	}	

}

