// 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";
	}
	
  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";
}

function cerrarVentana()
{
 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";
}



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úmero de teléfono inválido, sólo escriba números");}
   else
    { 
	
	
		new Ajax.Updater('areaInterna', "../ventanaIeu/atiendeSolicitud.asp",
		  {   
			  parameters: "nombre2="+ $('nombre2').value + "&telefono2=" + $('telefono2').value +"&rnd="+Math.random(),
			  method: 'post',   
			  onComplete: function(transport) 
			  {    
				 
			  } 
		 }); 

	
	}	

}


