var xmlHttp;
var xmlHttp2;
var gOperation;

function showDetail(str)
{
//alert("showDetail");
  showSelection(str,"detail");
  
  xmlHttp2=GetXmlHttpObject()
  if (xmlHttp2==null)
  {
    alert ("Browser does not support HTTP2 Request")
    return
  }
  showSelection2(str,"detailFeed",2);
}

function showDetail2(str)
{
//alert("showDetail2");
  showSelection(str,"detail2");

  xmlHttp2=GetXmlHttpObject()
  if (xmlHttp2==null)
  {
    alert ("Browser does not support HTTP2 Request")
    return
  }
  showSelection2(str,"detailFeed2",2);
}

function showSelection(str,operation)
{
//alert("showSelection(str,operation)");
str=escape(str);
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
    showSelection2(str,operation,1);
}

function showSelection2(str,operation,xmlHttpObj){
//alert("showSelection(str,operation,xmlHttp");
var url="getajax2.php"
var urloption=""
if (operation=="detailFeed")
   url="getitem.php"
else if (operation=="detailFeed2") {
   url="getitem2.php"
   urloption="&ppp=100"
}
else
    gOperation=operation

url=url+"?q="+str
url=url+"&o="+operation
url=url+urloption
url=url+"&d=link2buy"
url=url+"&sid="+Math.random()
if (xmlHttpObj==1){
   xmlHttp.onreadystatechange=stateChanged
   xmlHttp.open("GET",url,true)
   xmlHttp.send(null)
} else {
   xmlHttp2.onreadystatechange=stateChanged
   xmlHttp2.open("GET",url,true)
   xmlHttp2.send(null)

}
}


function stateChanged()
{

if (xmlHttp!=null){
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   { 
   document.getElementById("txt"+gOperation).innerHTML=xmlHttp.responseText
   }
}

if (xmlHttp2!=null) {
  if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
   {
   document.getElementById("txtdetailFeed").innerHTML=xmlHttp2.responseText
   }
}

}


function GetXmlHttpObject()
{
  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;
}
