var xmlHttp

function showWhy() {
	document.getElementById('why').style.display = 'block';
	document.getElementById('whyq').style.display = 'none';
}

function showProcedureType(str) {
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  }
 var url="procedures.php"
 url=url+"?q="+str
 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") {
 xmlDoc=xmlHttp.responseXML;
 document.getElementById("procname").style.visibility='visible';
 document.forms['procname'].procdd.length=0;
 document.forms['procname'].procdd.options[0] = new Option("Select Procedure","");
 for(i=0;i<xmlDoc.getElementsByTagName("name").length;i++) {
  document.forms['procname'].procdd.options[i+1] = new Option(xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue,xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue);
  }
 }
}

function showProcedureType2(str) {
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  }
 var url="procedures.php"
 url=url+"?q="+str
 url=url+"&sid="+Math.random()
 xmlHttp.onreadystatechange=stateChanged2
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
 }

function stateChanged2() {
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
 xmlDoc=xmlHttp.responseXML;
 document.getElementById("procname2").style.visibility='visible';
 document.forms['procname2'].procdd2.length=0;
 document.forms['procname2'].procdd2.options[0] = new Option("Select Procedure","");
 for(i=0;i<xmlDoc.getElementsByTagName("name").length;i++) {
  document.forms['procname2'].procdd2.options[i+1] = new Option(xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue,xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue);
  }
 }
}

function showProcedureType3(str) {
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  }
 var url="procedures.php"
 url=url+"?q="+str
 url=url+"&sid="+Math.random()
 xmlHttp.onreadystatechange=stateChanged3
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
 }

function stateChanged3() {
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
 xmlDoc=xmlHttp.responseXML;
 document.getElementById("procname3").style.visibility='visible';
 document.forms['procname3'].procdd3.length=0;
 document.forms['procname3'].procdd3.options[0] = new Option("Select Procedure","");
 for(i=0;i<xmlDoc.getElementsByTagName("name").length;i++) {
  document.forms['procname3'].procdd3.options[i+1] = new Option(xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue,xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue);
  }
 }
}

function GetXmlHttpObject() {
 var objXMLHttp=null
 if (window.XMLHttpRequest) { objXMLHttp=new XMLHttpRequest() }
 else if (window.ActiveXObject) { objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") }
 return objXMLHttp
 }

function inputProc(str) {
	document.forms['getinfo2'].proc.value = str;
	document.getElementById("proc1").style.visibility='visible';
}

function inputProc2(str) {
	document.forms['getinfo2'].proced2.value = str;
	document.getElementById("proc2").style.visibility='visible';
	document.getElementById("resetbutton").attributes["onclick"].value = 'resetForm2()';
}

function inputProc3(str) {
	document.forms['getinfo2'].proced3.value = str;
	document.getElementById("proc3").style.visibility='visible';
}

function resetForm() {
	document.getElementById("pro1").style.visibility='hidden';
	document.getElementById("procname").style.visibility='hidden';
	document.getElementById("pro2").style.visibility='visible';
}

function resetForm2() {
	document.getElementById("resetbutton").style.visibility='hidden';
	document.getElementById("pro2").style.visibility='hidden';
	document.getElementById("procname2").style.visibility='hidden';
	document.getElementById("pro3").style.visibility='visible';
}

function plsspec() {
 if (document.forms['getinfo'].language.value == "Other") { document.getElementById("otherlang").style.visibility = 'visible'; }
}

function CheckPriv() {
	if (document.getinfo2.privbox.checked==true && document.forms['getinfo2'].proc.value != "") {
		document.getElementById("submit2").disabled=false;
	}
	else { document.getElementById("submit2").disabled=true; }
}