function getPostParameters2(){
var poststr =
"rcode=" + encodeURI( document.getElementById("myform").rcode.value ) +
"&pid=" + encodeURI( document.getElementById("myform").pid.value ) +
"&sfname=" + encodeURI( document.getElementById("myform").sfname.value ) +
"&slname=" + encodeURI( document.getElementById("myform").slname.value ) +
"&sage=" + encodeURI( document.getElementById("myform").sage.value ) +
"&sgrade=" + encodeURI( document.getElementById("myform").sgrade.value ) +
"&city=" + encodeURI( document.getElementById("myform").city.value ) +
"&state=" + encodeURI( document.getElementById("myform").state.value ) +
"&zip=" + encodeURI( document.getElementById("myform").zip.value ) +
"&login=" + encodeURI( document.getElementById("myform").login.value ) +
"&stype=" + encodeURI( document.getElementById("myform").stype.value ) +
"&province=" + encodeURI( document.getElementById("myform").province.value ) +
"&country=" + encodeURI( document.getElementById("myform").country.value ) +
"&sschool=" + encodeURI( document.getElementById("myform").sschool.value ) ;
return poststr
}

function getPostParameters(){
var poststr =
"rcode=" + encodeURI( document.getElementById("myform").rcode.value ) +
"&rectype=" + encodeURI( document.getElementById("myform").rectype.value ) +
"&email=" + encodeURI( document.getElementById("myform").email.value ) +
"&lname=" + encodeURI( document.getElementById("myform").lname.value ) +
"&fname=" + encodeURI( document.getElementById("myform").fname.value ) ;
return poststr
}
function formToQueryString(frm) {
  var r = [];
  for(var i = 0, e = frm.elements, n = e.length; i < n; ++i)
    r.push(encodeURIComponent(e[i].name) + '=' + encodeURIComponent(e[i].value));
  return r.join("&");
}
function processGetPost(){
var myajax=ajaxpack.ajaxobj
var myfiletype=ajaxpack.filetype
if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally
if (myfiletype=="txt") {
alert(myajax.responseText)
if (document.forms[0].sfname) {
 document.forms[0].sfname.value ="";
}
if (myajax.responseText == "You have completed all the required fields. The record has been added to the database. Please close the form window and continue to Step 2.") {
ajaxwin1.hide();
}
 }
else 
{
alert(myajax.responseXML)
}
}
}
}

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
  } 
var url="usernameval.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")
 { 
 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;
}

