/// <summary>
/// Retrieve Headers of the Extend Search URL
/// </summary>
function ExtendSearch()
{
	var xmlhttp=GetXml();
	xmlhttp.open("HEAD", "/tc.dll?ac=SearchExtend'"+ document.getElementById("OTID").value,true);
	xmlhttp.send(null)
}

/// <summary>
/// Retrieve Headers of the Stop Search URL
/// </summary>
function StopSearch()
{
	var xmlhttp=GetXml();
	xmlhttp.open("HEAD", "/tc.dll?ac=SearchStop"+ document.getElementById("OTID").value,true);
	xmlhttp.send(null)
}

/// <summary>
///Uses Pipe Delimited File (process_page.htm) to get search status
/// </summary>
function ProgressStatus()
{
	var xmlhttp=GetXml();
	xmlhttp.open("GET", "/tc.dll?ac=progress&next=process_page.htm" + document.getElementById("QTID").value,true);
	
	//Populate Spans in Page from the array created by the pipe delimted file
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			var strServiceResponse = xmlhttp.responseText
			var arrResponse = strServiceResponse.split("|");
			document.getElementById("Progress_Bar").style.width = arrResponse[7] + "%";
			document.getElementById("ProgressPercentage").innerHTML = arrResponse[7] + "%";
			document.getElementById("FaresSearched").innerHTML = arrResponse[3];
			document.getElementById("TotalFaresSearched").innerHTML = arrResponse[4];
			document.getElementById("FaresObtained").innerHTML = arrResponse[9];
		}
	 }
	xmlhttp.send(null)
	
	//Recalls This Function, set in Milliseconds ie 500 is 0.5 seconds
	setTimeout("ProgressStatus()", 500);
}

var count=0;
function BlagProgressStatus()
{
	document.getElementById("Progress_Bar").style.width = count + "%";
	document.getElementById("ProgressPercentage").innerHTML = count + "%";	
	count ++;
	if ((count > 70) && (count < 90))
	{
		setTimeout("BlagProgressStatus()", 2000);
	}
	else if (count >= 90)
	{
		setTimeout("BlagProgressStatus()", 5000);
	}
	else
	{
		setTimeout("BlagProgressStatus()", 600);
	}
}