var xmlHttp

function showResult(str)
{
if (str.length==0)
 { 
 document.getElementById("livesearch").
 innerHTML="";
 document.getElementById("livesearch").
 style.border="0px";
 document.getElementById("livesearch").style.display = "none";
 
 return
 }

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 

var url="http://www.pureadmin.co.uk/search/data_processing/livesearch.php";
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
		document.getElementById("livesearch").innerHTML = xmlHttp.responseText;
		// IE 6 BUG FIXING
		document.getElementById("livesearch").style.backgroundColor = "#FFFFFF";
		document.getElementById("livesearch").style.border = "1px solid #A5ACB2";
		document.getElementById("livesearch").style.position = "absolute";
		document.getElementById("livesearch").style.zIndex = "99999999";
		document.getElementById("livesearch").style.marginTop = "28px";
		document.getElementById("livesearch").style.marginLeft = "1px";
		document.getElementById("livesearch").style.display = "block";
		document.getElementById("livesearch").style.width = "168px";
	}
	else {
		document.getElementById("livesearch").style.display = "none";
		document.getElementById("header_retailers_all").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 setSearchterm(searchterm) {
	
	document.getElementById("livesearch").innerHTML="";
	 // IE 6 BUG FIXING
	document.getElementById("livesearch").style.backgroundColor="#C5FEFF";
	document.getElementById("livesearch").style.border="0px";
	document.getElementById("livesearch").style.display="none";
	document.getElementById("content_left_column_main_search").value = searchterm;
}
*/
/*
var cr = -1;	// current row
var mr = 5;	// number of rows
document.onkeydown = KeyCheck;
function KeyCheck(e)  {
    var keyID = (window.event) ? event.keyCode : e.keyCode;
    switch(keyID) {
        case 38: 
        // focus up
        if (cr >= 0) {
          normal_row_color();
          cr = cr - 1;
          change_row_color();
        }  
        break;      
        case 40: 
        // focus down
        if (cr <= mr) {
          normal_row_color();
	  cr = cr + 1;	
          change_row_color();
        }
	break;
    }
}
function normal_row_color() {
   if (document.getElementById('row' + cr) != null) {
       unhighlight('row' + cr);
   }
}
function change_row_color() {
  if (document.getElementById('row' + cr) != null) {
	   //document.getElementById('row' + cr).focus(); 
	  highlight('row' + cr);
  }	  
}
*/
function highlight(obj_id) {
	document.getElementById(obj_id).style.color = '#CCCCCC';
	document.getElementById(obj_id).style.textDecoration = 'underline';

}
function unhighlight(obj_id) {
	document.getElementById(obj_id).style.color = '#CCCCCC';
}