// This script is used as the AJAX frontend for the Order Tracking and Repair Status page.
function showorder(str1, str2, script) {
	xmlHttp=GetXmlHttpObject();
 	if (xmlHttp==null) {
 		alert ("Browser does not support HTTP Request");
 		return;
  } 

  //Form Validation
  reason = isEmpty(str1, "An order ID must be entered!<br />"); 
	reason += validLength(str1, "Order ID / RI number must be 7 digits long.<br />", 7, 7);
  reason += validateNum(str1, "Order ID / RI number must contain only numbers.<br />");
  reason += isZipcode(str2);

  if (reason != "") {
	  reason = "<h3>Form Not Submitted</h3>\n<p style=\"font-weight: bold; text-align: center\">The following errors were found:</p>" + reason;
    updateHTML( reason, 'output' );
    return false;
  } 

	script=script+"?id="+str1.value+"&zip="+str2.value;
	script=script+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function() {stateChanged("output", xmlHttp);}
	xmlHttp.open("GET",script,true);
	xmlHttp.send(null);
}
