var xmlHttp = GetXmlHttpObject();
var passgo;
    
function processForm() {

    //set variable names
    var concatUrl;
    
    var firstname, lastname, company, address, city, state, zipcode,
    country, phone, email, contactnotes, formusescaptcha, TextBoxUserCode
    
    if (document.contactform.firstname) 
        firstname = document.contactform.firstname.value;
        
    if (document.contactform.lastname)     
        lastname = document.contactform.lastname.value;
        
    if (document.contactform.company) 
        company = document.contactform.company.value;
        
    if (document.contactform.address) 
        address = document.contactform.address.value;
        
    if (document.contactform.city) 
        city = document.contactform.city.value;
        
    if (document.contactform.state)
        state = document.contactform.state.value;
        
    if (document.contactform.zipcode)
        zipcode = document.contactform.zipcode.value;
        
    if (document.contactform.country)
        country = document.contactform.country.value;
        
    if (document.contactform.phone)
        phone = document.contactform.phone.value;
        
    if (document.contactform.email)
        email = document.contactform.email.value;
        
    if (document.contactform.contactnotes)
        contactnotes = document.contactform.contactnotes.value;
        
    if (document.contactform.formusescaptcha)
        formusescaptcha = document.contactform.formusescaptcha.value;
        
    if (document.contactform.TextBoxUserCode)
        TextBoxUserCode = document.contactform.TextBoxUserCode.value;
    
    
    concatUrl = '/contact/file/process.asp?firstname=' + firstname + '&lastname=' + lastname +
               '&company=' + company + '&address=' + address + '&city=' + city + 
               '&state=' + state + '&zipcode=' + zipcode + '&phone=' + phone +
               '&country=' + country + '&email=' + email + '&contactnotes=' + contactnotes +
               '&formusescaptcha=' + formusescaptcha + '&TextBoxUserCode=' + TextBoxUserCode;
    
    xmlHttp.open("GET",concatUrl,false);
    xmlHttp.onreadystatechange = populateXML;
    xmlHttp.send(null);
    
    return passgo;

}

function populateXML() {
     if (xmlHttp.readyState == 4) {
        if (xmlHttp.status == 200) {
		     var xmlDoc = xmlHttp.responseXML;
		     var error = xmlDoc.getElementsByTagName("error")[0].firstChild.nodeValue;
		     
		     passgo = xmlDoc.getElementsByTagName("passgo")[0].firstChild.nodeValue;
	         document.getElementById("notice").innerHTML = error;  
		}
     }
}

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;
}