var xmlHttp

function showCustomer(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="http://www.inseta.org.za/intern_students/content/getcustomer.asp";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{
//alert (xmlHttp.readyState)
//alert (xmlHttp.responseText)
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
//}

if(xmlHttp.responseText == "<table><tr><td>2 nominations already made using this SDL No.</td></tr></table>")
{
	//alert("test")
//window.location = "http://www.google.co.za"; 
}

}


//var varredirect=xmlHttp.responseText.indexOf('<table><tr><td>2 nominations already made using this SDL No.</td></tr></table>');
//if (varredirect!= -1 ) 
//{ 
//window.location = "http://www.google.co.za" 
//}
}



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;
}
