var xmlHttp

var rpage = 'http://www.google.com'
var ImRunning = false;

//--------------------------------------------------------------------------
function showliveauctionlinks(str,counter)
{

//if ( document.getElementById(counter).style.display == 'none' ) {

//alert ('counterID:'+counter+' style:'+document.getElementById(counter).style.display);

  if (!ImRunning) {
    ImRunning = true;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null) {
      alert ("Your browser does not support AJAX!");
      ImRunning = false;
      return;
    }	
var url="liveauctionlinks.asp";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedLive;
//xmlHttp.open("GET",url,true);
theLiveCounter = counter;

	url2="collapse.asp";
	
	if (document.getElementById(theLiveCounter).style.display == 'none')
	{
	xmlHttp.open("GET",url,true);
	}
	else
	{
	xmlHttp.open("GET",url2,true);
	//alert ('closing');
	}

showHideLive();
xmlHttp.send(null);
}
//}

//else
//{
//alert ('already open');
//theLiveCounter = counter;
//xmlHttp.onreadystatechange=stateChangedLive;
//showHideLive();
//}

}






//--------------------------------------------------------------------------
function showalphabet(counter)
{

//if ( document.getElementById(counter).style.display == 'none' ) {

//alert ('counterID:'+counter+' style:'+document.getElementById(counter).style.display);

  if (!ImRunning) {
    ImRunning = true;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null) {
      alert ("Your browser does not support AJAX!");
      ImRunning = false;
      return;
    }	
xmlHttp.onreadystatechange=stateChangedLive;
//xmlHttp.open("GET",url,true);
theLiveCounter = counter;

showHideLive();
//xmlHttp.send(null);
}
//}

//else
//{
//alert ('already open');
//theLiveCounter = counter;
//xmlHttp.onreadystatechange=stateChangedLive;
//showHideLive();
//}

}







//--------------------------------------------------------------------------
function stateChangedLive() 
{ 
if (xmlHttp.readyState==4)
{
	
var whatWasReturned = xmlHttp.responseText;
var pos = whatWasReturned.indexOf("i2iSOi2i"); 
if (pos == -1)
{
document.getElementById(theLiveCounter).innerHTML=xmlHttp.responseText;
//document.getElementById(theLiveCounter).style.display = '';
//HideAjaxLoaderImageWorking4();
ImRunning = false;
}
else
{
ImRunning = false;
window.location = rpage;
}
}
}

//--------------------------------------------------------------------------
function showHideLive()
{

if (document.getElementById(theLiveCounter).style.display == 'none')
{
document.getElementById(theLiveCounter).style.display = 'block';
} 
else 
{
document.getElementById(theLiveCounter).style.display = 'none';
}
} 

//--------------------------------------------------------------------------
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;
}

//--------------------------------------------------------------------------
function ShowAjaxLoaderImage()
{
document.getElementById("ajaxloaderimage").style.display="block";
document.getElementById("ajaxloadertext").style.display="block";
}

function HideAjaxLoaderImage()
{
document.getElementById("ajaxloaderimage").style.display="none";
document.getElementById("ajaxloadertext").style.display="none";
}