// JavaScript Document

function ajaxcall()
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }

  var name = document.couponEntryForm.Name.value;
  var age = document.couponEntryForm.Age.value;
  var email = document.couponEntryForm.Email.value;
  var neareststore = document.couponEntryForm.NearestStore.value;
  var sportinginterests = "";
  for (var i=0; i < document.couponEntryForm.SportingInterests.length; i++) {
     if (document.couponEntryForm.SportingInterests[i].checked) {
	    sportinginterests = sportinginterests + ", " + document.couponEntryForm.SportingInterests[i].value;
	  }
  }
  var mobilephone = document.couponEntryForm.MobilePhone.value;
 
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
      document.getElementById("couponEntryForm").innerHTML=xmlHttp.responseText;
	  scroll(0,0);
      }	  
    }
  xmlHttp.open("GET", "cfajax/process.cfm?name=" + name + "&age=" + age + "&email=" + email + "&neareststore=" + neareststore + "&sportinginterests=" + sportinginterests + "&mobilephone=" + mobilephone, true);
  xmlHttp.send(null);
  }
