var xmlHttp

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

document.getElementById("tableCaseInfo").innerHTML="<span class='textBody'>Case Information</span>"
var progress = document.getElementById("Progress");
progress.style.display = '';

var dln=document.getElementById("dl_number").value
var namelast=document.getElementById("name_last").value
var namemiddle=document.getElementById("name_middle").value
var namefirst=document.getElementById("name_first").value
var dobd=document.getElementById("dobd").value
var dobm=document.getElementById("dobm").value
var doby=document.getElementById("doby").value
var county=document.getElementById("county").value
var test1=document.getElementById("search_type1")
var test2=document.getElementById("search_type2")
var test3=document.getElementById("search_type3")
var search_type = ""
if(test1.checked)  search_type = "exact";
if(test2.checked)  search_type = "partial";
if(test3.checked)  search_type = "soundex";
var url="NameSearchDisplay.php"
url=url+"?dln="+dln
url=url+"&namelast="+namelast
url=url+"&namemiddle="+namemiddle
url=url+"&namefirst="+namefirst
url=url+"&doby="+doby
url=url+"&dobm="+dobm
url=url+"&dobd="+dobd
url=url+"&county="+county
url=url+"&search_type="+search_type
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

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

document.getElementById("tableCaseInfo").innerHTML="<span class='textBody'>Case Information</span>"
var progress = document.getElementById("Progress");
progress.style.display = '';

var namelast=document.getElementById("name_last").value
var namemiddle=document.getElementById("name_middle").value
var namefirst=document.getElementById("name_first").value
var zip=document.getElementById("zip").value
var county=document.getElementById("county").value
var test1=document.getElementById("search_type1")
var test2=document.getElementById("search_type2")
var search_type = ""
if(test1.checked)  search_type = "exact";
if(test2.checked)  search_type = "partial";
var url="SexOffenderSearchDisplay.php"
url=url+"?namelast="+namelast
url=url+"&namemiddle="+namemiddle
url=url+"&namefirst="+namefirst
url=url+"&zip="+zip
url=url+"&county="+county
url=url+"&search_type="+search_type
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

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

var progress = document.getElementById("Progress");
progress.style.display = '';

var namelast=document.getElementById("name_last").value
var namefirst=document.getElementById("name_first").value
var dobd=document.getElementById("dobd").value
var dobm=document.getElementById("dobm").value
var doby=document.getElementById("doby").value
var currentState=document.getElementById("currentState").value
var searchState=document.getElementById("searchState").value
var streetAddress=document.getElementById("streetAddress").value
var city=document.getElementById("City").value
var zip=document.getElementById("zipCode").value
var ssn=document.getElementById("ssn").value
var url="tenantSearchDisplay.php"
url=url+"?namelast="+namelast
url=url+"&namefirst="+namefirst
url=url+"&dob="+doby+dobm+dobd
url=url+"&searchState="+searchState
url=url+"&address="+streetAddress
url=url+"&city="+city
url=url+"&currentState="+currentState
url=url+"&zip="+zip
url=url+"&ssn="+ssn
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("tableSearchResults").innerHTML=xmlHttp.responseText 
	var progress = document.getElementById("Progress");
	progress.style.display = 'none';
	fdTableSort.init("NameSearchTable");
 } 
}

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 tenantDetailDisplay(searchdb,firstname,lastname,dob,ssn,recordID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
document.getElementById("tableCaseInfo").innerHTML="<img src='images/progress_orange.gif'>"
var url="tenantSearchDetail.php"
url=url+"?searchdb="+searchdb+"&firstname="+firstname+"&lastname="+lastname+"&dob="+dob+"&ssn="+ssn+"&recordid="+recordID
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedDetail
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function caseDisplay(caseno,type)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
document.getElementById("tableCaseInfo").innerHTML=""
var url="caseDisplay.php"
url=url+"?caseno="+caseno+"&type="+type
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedDetail
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function caseSexDisplay(registration_no)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
document.getElementById("tableCaseInfo").innerHTML=""
var url="caseSexDisplay.php"
url=url+"?registration_no="+registration_no
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedDetail
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedDetail() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	document.getElementById("tableCaseInfo").innerHTML=xmlHttp.responseText 
	var progress = document.getElementById("Progress");
	progress.style.display = 'none';
	var button = document.getElementById("continue");
	button.style.display = 'none';
	var tableSearchResults = document.getElementById("tableSearchResults");
	tableSearchResults.style.display = '';
 } 
}

function displayRegister()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="Register.php"
xmlHttp.onreadystatechange=stateChangedRegister 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedRegister()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("tableRegister").innerHTML=xmlHttp.responseText     
 }
}

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

var progress = document.getElementById("Progress");
progress.style.display = '';

var namelast=document.getElementById("name_last").value
var namemiddle=document.getElementById("name_middle").value
var namefirst=document.getElementById("name_first").value
var dobd=document.getElementById("dobd").value
var dobm=document.getElementById("dobm").value
var doby=document.getElementById("doby").value
var url="NationalSearchDisplay.php"
url=url+"?namelast="+namelast
url=url+"&namemiddle="+namemiddle
url=url+"&namefirst="+namefirst
url=url+"&doby="+doby
url=url+"&dobm="+dobm
url=url+"&dobd="+dobd
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

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

var progress = document.getElementById("Progress");
progress.style.display = '';

var ssn=document.getElementById("ssnumber").value
var url="nameTraceDisplay.php"
url=url+"?ssn="+ssn
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedDetail
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function tenantPrintDetail(searchdb,firstname,lastname,dob,ssn,recordID)
{
var url="tenantPrintDetail.php"
url=url+"?searchdb="+searchdb+"&firstname="+firstname+"&lastname="+lastname+"&dob="+dob+"&ssn="+ssn+"&recordid="+recordID
url=url+"&sid="+Math.random()
	window.location.href=url;
}

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

var progress = document.getElementById("Progress");
progress.style.display = '';

var ssn=document.getElementById("ssnumber").value
var url="nameTraceDisplay.php"
url=url+"?ssn="+ssn
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function casePrintDetail(caseno,type,lastname)
{
var url="casePrintDetail.php"
url=url+"?caseno="+caseno+"&type="+type
url=url+"&sid="+Math.random()
window.open(url,'pdfprint','toolbar=0,menubar=0,location=0,status=0');
}

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

var email=document.getElementById("emailAddress").value
var url="emailPasswd.php"
url=url+"?email="+email
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedRegister
xmlHttp.open("GET",url,true)
xmlHttp.send(null)


}

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

document.getElementById("tableCaseInfo").innerHTML="<span class='textBody'>Case Information</span>"
var progress = document.getElementById("Progress");
progress.style.display = '';

var namelast=document.getElementById("name_last").value
var namemiddle=document.getElementById("name_middle").value
var namefirst=document.getElementById("name_first").value
var court=document.getElementById("court").value
var county=document.getElementById("county").value
var test1=document.getElementById("search_type1")
var test2=document.getElementById("search_type2")
var test3=document.getElementById("search_type3")
var search_type = ""
if(test1.checked)  search_type = "exact";
if(test2.checked)  search_type = "partial";
if(test3.checked)  search_type = "soundex";
var url="CalendarSearchDisplay.php"
url=url+"?namelast="+namelast
url=url+"&namemiddle="+namemiddle
url=url+"&namefirst="+namefirst
url=url+"&court="+court
url=url+"&county="+county
url=url+"&search_type="+search_type
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

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

document.getElementById("tableCaseInfo").innerHTML="<span class='textBody'>Case Information</span>"
var progress = document.getElementById("Progress");
progress.style.display = '';

var namelast=document.getElementById("name_last").value
var namemiddle=document.getElementById("name_middle").value
var namefirst=document.getElementById("name_first").value
var zipcode=document.getElementById("zip_code").value
var county=document.getElementById("county").value
var test1=document.getElementById("search_type1")
var test2=document.getElementById("search_type2")
var test3=document.getElementById("search_type3")
var search_type = ""
if(test1.checked)  search_type = "exact";
if(test2.checked)  search_type = "partial";
if(test3.checked)  search_type = "soundex";
var url="DWISearchDisplay.php"
url=url+"?namelast="+namelast
url=url+"&namemiddle="+namemiddle
url=url+"&namefirst="+namefirst
url=url+"&zipcode="+zipcode
url=url+"&county="+county
url=url+"&search_type="+search_type
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
