var xmlHttp3;
var divretorno3;
var valexterno3;

function Pagina3_(page_name3_,valdiv3_,externo3_)
{ 
valexterno3=externo3_;
divretorno3=valdiv3_;
xmlHttp3=GetXmlHttpObject3();

if (xmlHttp3==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 


if (divretorno3 == '' )
{
document.getElementById("mainframe").innerHTML="<html><br><br><br><br><br><center><img src='images/wait.gif'><br><strong style='font-family:Trebuchet MS;font-size:10pt;color:#999999'>Cargando, Espere un momento...</strong></center></html>";

}
else
{
  if (valexterno3 > 0) 
  {
opener.document.getElementById(divretorno).innerHTML="<html><br><center><img src='images/wait.gif'><br><strong style='font-family:Trebuchet MS;font-size:10pt;color:#999999'>Cargando, Espere un momento...</strong></center></html>";

 }
  else
  {
document.getElementById(divretorno).innerHTML="<html><br><center><img src='images/wait.gif'><br><strong style='font-family:Trebuchet MS;font-size:10pt;color:#999999'>Cargando, Espere un momento...</strong></center></html>";
  
  }
}

var url3;


url3=page_name3_;

//document.getElementById("contiene").innerHTML="<html><br><br><br><center><img src='img/indicator.gif'><br><strong style='font-family:Trebuchet MS;font-size:14pt;color:#0049b7'>Cargando...</strong></center></html>";
xmlHttp3.onreadystatechange=stateChange3;
xmlHttp3.open("GET",url3,true);
xmlHttp3.send(null);

}



function stateChange3() 
{ 

if (xmlHttp3.readyState==4)
{ 
   if (divretorno3 == '' )
      {
       document.getElementById("mainframe").innerHTML=xmlHttp3.responseText;	
      }
   else
      {
       if (valexterno3 > 0) 
          {
          opener.document.getElementById(divretorno3).innerHTML=xmlHttp3.responseText;		  
          }
       else
	      {
          document.getElementById(divretorno3).innerHTML=xmlHttp3.responseText;	
		  }
      }
   
   if (divretorno3=="no_items")
     {
     alert("Articulo Agregado a Pedido");	
     } 
}

}

function GetXmlHttpObject3()
{
var xmlHttp=null;

try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }


return xmlHttp;
} 
