// JavaScript Document
var xmlHttp

function showHint(str)
{
if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML=""
  return
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  }

// cpn is the Current Page Name, needed later
if(document.location.href == "http://www.indianaforestproducts.com/IFPCApplication/parent-add.php") {
	var url = "gethint.php"
	var cpn = "1" // on gethint.php goes to parent-add-action.php
	url = url + "?q=" + str
	url = url + "&cpn=" + cpn
	url = url + "&childID=" + php
} else if(document.location.href == "http://www.indianaforestproducts.com/IFPCApplication/preCompanyUpdate.php") {
	var url = "gethint.php"	
	var cpn = "2" // goes to addExistingCompany.php
	url = url + "?q=" + str
	url = url + "&cpn=" + cpn
} else {
	var url = "IFPCApplication/gethint.php"
	var cpn = "3" // goes to companyProfile.php
	url = url + "?q=" + str
	url = url + "&cpn=" + cpn
	if(document.location.href == "http://www.indianaforestproducts.com/logging.php") {
		var sec = "Logging/Harvesting"
		url = url + "&sec=" + sec		
	} else if(document.location.href == "http://www.indianaforestproducts.com/primary.php") {
		var sec = "Primary"
		url = url + "&sec=" + sec
	} else if(document.location.href == "http://www.indianaforestproducts.com/secondary.php") {
		var sec = "Secondary"
		url = url + "&sec=" + sec
	} else if(document.location.href == "http://www.indianaforestproducts.com/engineered.php") {
		var sec = "Engineered Wood Product"
		url = url + "&sec=" + sec
	} else if(document.location.href == "http://www.indianaforestproducts.com/equipment.php") {
		var sec = "Equipment Manufacturer"
		url = url + "&sec=" + sec
	} else if(document.location.href == "http://www.indianaforestproducts.com/service.php") {
		var sec = "Service/Suppliers"
		url = url + "&sec=" + sec
	}
}


xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint").innerHTML=xmlHttp.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;
}
