var xmlhttp;

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("displayHere").innerHTML=xmlHttp.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

// Buttons and Divs

function buttonOver(thisId,thisIm){
var oversrc = "/graphics/" + thisIm + "On.jpg";
document.getElementById(thisId).src=oversrc;	
}

function buttonOut(thisId,thisIm){
var oversrc = "/graphics/" + thisIm + "Off.jpg";
document.getElementById(thisId).src=oversrc;	
}

function swapToButton(thisIM,thisSRC){
var oversrc = "/graphics/cal/" + thisSRC + "on.jpg";
document.getElementById(thisIM).src=oversrc;

}
function swapBackButton(thisIM,thisSRC){
var oversrc = "/graphics/cal/" + thisSRC + "off.jpg";
document.getElementById(thisIM).src=oversrc;
}

function openDiv(thisId) {
	if(document.getElementById(thisId).style.display==""){
SlideClosed(thisId);
	}
	else{
document.getElementById(thisId).style.display="none";
SlideOpen(thisId);
}
}

function openDivOnly(thisId) {
	if(document.getElementById(thisId).style.display==""){
//nothing
	}
	else{
document.getElementById(thisId).style.display="none";
SlideOpen(thisId);
}
}


function openDivOnlyNews(thisId) {
	if(document.getElementById(thisId).style.display==""){
//nothing
	}
	else{
document.getElementById(thisId).style.display="none";
SlideOpen(thisId);
document.getElementById('newsScroller').style.height="130px";
}
}

function closeDivOnly(thisId) {
	if(document.getElementById(thisId).style.display==""){
SlideClosed(thisId);
	}
	else{
//nothing
}
}

// End -------------------------------------------------------

// Login functions

function tryEnter(){

var thisLot;
thisLot =  "userName=" + encodeURIComponent(document.forms[0].username.value);
thisLot = thisLot + "&passWord=" + encodeURIComponent(document.forms[0].password.value);
//alert(thisLot);

var result = "&nbspRequired&nbsp";
document.getElementById('userFail').innerHTML = "";
document.getElementById('passFail').innerHTML = "";

if(document.forms[0].username.value==""){
document.getElementById('userFail').innerHTML = "&nbspRequired&nbsp";
return;
}

if(document.forms[0].password.value==""){
document.getElementById('passFail').innerHTML = "&nbsp<a href=/forgottenPassword.asp>Forgotten Password?</a>&nbsp";;
return;
}

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="/working/logIn.asp";
xmlHttp.onreadystatechange = alertContentsUser;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);
}

function alertContentsUser() {
      if (xmlHttp.readyState == 4) {
         if (xmlHttp.status == 200) {
		 result = "&nbsp;Not Recognised&nbsp;"
            if(xmlHttp.responseText=="1"){
            document.getElementById('userFail').innerHTML = result;
			}
			if(xmlHttp.responseText=="2"){
            document.getElementById('passFail').innerHTML = result;
			} 
			if(xmlHttp.responseText=="3"){
			getUrl = location.href;
            document.location.href=getUrl;
			}           
         } else {
            alert('There was a problem with the request.');
         }
      }     
   }

// End -------------------------------------------------------

function setHomepage(){
var id=1;
 if (confirm('Are you sure you want to update your homepage section(s)?\n\n')) {
	for (i=0; i<document.forms[0].elements.length; i++) { 
		el = document.forms[0].elements[i];
		if (el.type=="checkbox" && el.name.indexOf("hp")!=-1){
			if (el.checked) {
			id = id + "," + el.name.replace(/hp/, "");
			
}
		} 
	}
	updateHomepage(id);
	}
	
}




function updateHomepage(id){
var thisLot="id="+id;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  var url="/working/setHomepage.asp";
xmlHttp.onreadystatechange = refreshHomepage;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);
}

function refreshHomepage() {
      if (xmlHttp.readyState == 4) {
         
		 if (xmlHttp.status == 200) {		 
			getUrl = location.href;
            document.location.href=getUrl;
          
         } else {
            alert('There was a problem with the request.');
         }
      }  
	  }   
//----------------------------------------------------------------

var myTitle;

  function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

function addFavourite(){
tt = myTitle;
var sX = findPosX(document.getElementById('favStart'));
var sY = findPosY(document.getElementById('favStart')); 
var obj = document.getElementById('favMove');
obj.innerHTML=tt;
obj.style.left=sX + "px";
obj.style.top=sY + "px";
obj.style.display="";
StartMove();
}

function StartMove(){
var obj = document.getElementById('favMove');
var sX = findPosX(obj);
var sY = findPosY(obj); 
var fX = findPosX(document.getElementById('favGoTo'));
var fY = findPosY(document.getElementById('favGoTo')); 
if(sX<fX){
pos=parseFloat(sX+((fX-sX)/10));
obj.style.left=pos + "px";
pos2=parseFloat(sY+((fY-sY)/10));
obj.style.left=pos + "px";
obj.style.top=pos2 + "px";
setTimeout("StartMove()",10);
}
if(sX>parseFloat(fX-20)){
obj.style.display="none";
obj.style.left="0px"
obj.style.top="0px"
}
}

function addToFavourite(){

var thisLot;
thisLot =  "pageId=" + encodeURIComponent(window.favId);
thisLot = thisLot + "&pageTitle=" + encodeURIComponent(window.favTitle);
thisLot = thisLot + "&pageWebsite=" + encodeURIComponent(window.favWeb);
//alert(thisLot);
myTitle=window.favTitle;


xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="/working/addFavourite.asp";
xmlHttp.onreadystatechange = goFavourite;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);
}

function goFavourite() {
      if (xmlHttp.readyState == 4) {
         if (xmlHttp.status == 200) {
            if(xmlHttp.responseText=="1"){
            alert("You must be a registered user and logged in to use this function");
			}
			if(xmlHttp.responseText=="2"){
            addFavourite();
			setTimeout("refreshPage()",500);
			}           
         } else {
            alert('There was a problem with the request.');
         }
      }     
   }
   
   function refreshPage(){
   		getUrl = location.href;
        document.location.href=getUrl;		
}

function deleteFavourite(id){
var thisLot;
thisLot =  "pageId=" + encodeURIComponent(id);

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="/working/deleteFavourite.asp";
xmlHttp.onreadystatechange = goFavourite2;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);
}

function goFavourite2() {
      if (xmlHttp.readyState == 4) {
         if (xmlHttp.status == 200) {      
			setTimeout("refreshPage()",500);    
         } else {
            alert('There was a problem with the request.');
         }
      }     
   }
   
 function siteSearch(obj) {
var thisLot;
thisLot = document.forms[0].keyword.value;
if (thisLot==""){
alert("Please specify a keyword to search by");
}
else{
if(obj=="1"){
var url="/searchResults.asp?kw=" + thisLot;
}
else {
var url="/" + obj + "-searchResults.asp?kw=" + thisLot;
}
document.location.href=url;
}
}

 function siteSearch2(obj) {
var thisLot;
thisLot = document.forms[0].keyword2.value;
if (thisLot==""){
alert("Please specify a keyword to search by");
}
else{
if(obj=="1"){
var url="/searchResults.asp?kw=" + thisLot;
}
else {
var url="/" + obj + "-searchResults.asp?kw=" + thisLot;
}
document.location.href=url;
}
}

function newsMe(id){
document.getElementById('divThis').style.display='';
document.getElementById('apDiv1').style.display='';
document.body.scroll="no";
returnNews(id);
}

function returnNews(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/returnNews.asp";
url=url+"?id="+str;
//url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=displayNews;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function displayNews() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("newsHere").innerHTML=xmlHttp.responseText;
//resetAll();
}
else {
document.getElementById("newsHere").innerHTML="<br/><br/><br/><br/><center><img src=/graphics/common/loader.gif></center>";
}
}

function closeNews(){
document.getElementById('divThis').style.display='none';
document.getElementById('apDiv1').style.display='none';
document.body.scroll="yes";
}

function returnCal(mon)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  if(mon==13){
  returnCalAll();
  }
  else {
var url="/working/returnCal.asp";
url=url+"?mon="+mon;
xmlHttp.onreadystatechange=displayCal;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
}

function returnCalAll()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/returnCalAll.asp";
url=url+"?mon=13";
xmlHttp.onreadystatechange=displayCal;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function getAllYear()
{ 
var obj=document.forms[0].selectYear.value;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/returnCalAll.asp";
url=url+"?mon=13&year=" + obj;
xmlHttp.onreadystatechange=displayCal;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function displayCal() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("calHere").innerHTML=xmlHttp.responseText;
//resetAll();
}
else {
document.getElementById("calHere").innerHTML="<br/><br/><br/><br/><center><img src=/graphics/common/loader.gif></center>";
}
}

function calOver(thisId) {
var selected 
selected = document.getElementById(thisId);
selected.className = "calItemOn";
}

function calOut(thisId) {
var selected 
selected = document.getElementById(thisId);
selected.className = "calItem";
}

function ebMe(id){
document.getElementById('divThis').style.display='';
document.getElementById('apDiv1').style.display='';
document.body.scroll="no";
returnEvent(id);
}

function returnEvent(id)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/returnEvent.asp";
url=url+"?id="+id;
xmlHttp.onreadystatechange=displayNews;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function addOutlook(obj) {
alert("If asked if you want to 'Save' or 'Open', please click [ Open ]\n\nThis event will automatically add to your electronic calendar");
document.location.href="/ics/" + obj + ".ics";

}

function sendContactForm(){

var thisLot;
thisLot =  "inam=" + encodeURIComponent(document.forms[0].inam.value);
thisLot = thisLot + "&iadd=" + encodeURIComponent(document.forms[0].iadd.value);
thisLot = thisLot + "&itow=" + encodeURIComponent(document.forms[0].itow.value);
thisLot = thisLot + "&icou=" + encodeURIComponent(document.forms[0].icou.value);
thisLot = thisLot + "&ipos=" + encodeURIComponent(document.forms[0].ipos.value);
thisLot = thisLot + "&itel=" + encodeURIComponent(document.forms[0].itel.value);
thisLot = thisLot + "&iema=" + encodeURIComponent(document.forms[0].iema.value);
thisLot = thisLot + "&imes=" + encodeURIComponent(document.forms[0].imes.value);
//alert(thisLot);

var result = "&nbspRequired&nbsp";
document.getElementById('snam').innerHTML = "";
document.getElementById('stow').innerHTML = "";
document.getElementById('stel').innerHTML = "";
document.getElementById('sema').innerHTML = "";
document.getElementById('smes').innerHTML = "";

if(document.forms[0].inam.value==""){
document.getElementById('snam').innerHTML = result;
return;
}
if(document.forms[0].itow.value==""){
document.getElementById('stow').innerHTML = result;
return;
}
if(document.forms[0].itel.value==""){
document.getElementById('stel').innerHTML = result;
return;
}
if(document.forms[0].iema.value==""){
document.getElementById('sema').innerHTML = result;
return;
}
if(document.forms[0].imes.value==""){
document.getElementById('smes').innerHTML = result;
return;
}

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="/working/sendMessage.asp";
xmlHttp.onreadystatechange = messageResponse;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);
}


function messageResponse() {
      if (xmlHttp.readyState == 4) {
         if (xmlHttp.status == 200) {
            document.getElementById('thanksHere').innerHTML = xmlHttp.responseText;         
         } else {
            alert('There was a problem with the request.');
         }
      }     
   }
   
   function registerMe(){
   
var canMail

if(document.forms[0].canMail.checked){
canMail="No";
}
else
{
canMail="Yes";
}

var thisLot;
thisLot =  "fnam=" + encodeURIComponent(document.forms[0].fnam.value);
thisLot = thisLot + "&snam=" + encodeURIComponent(document.forms[0].snam.value);
thisLot = thisLot + "&email=" + encodeURIComponent(document.forms[0].email.value);
thisLot = thisLot + "&telephone=" + encodeURIComponent(document.forms[0].telephone.value);
thisLot = thisLot + "&securityQuestion=" + encodeURIComponent(document.forms[0].securityQuestion.value);
thisLot = thisLot + "&securityAnswer=" + encodeURIComponent(document.forms[0].securityAnswer.value);
thisLot = thisLot + "&ipassword=" + encodeURIComponent(document.forms[0].ipassword.value);
thisLot = thisLot + "&company=" + encodeURIComponent(document.forms[0].company.value);
thisLot = thisLot + "&canMail=" + encodeURIComponent(canMail);

//alert(thisLot);

var result = "&nbspRequired&nbsp";
document.getElementById('sfnam').innerHTML = "";
document.getElementById('ssnam').innerHTML = "";
document.getElementById('scom').innerHTML = "";
document.getElementById('semail').innerHTML = "";
document.getElementById('sque').innerHTML = "";
document.getElementById('sans').innerHTML = "";
document.getElementById('spas').innerHTML = "";

if(document.forms[0].fnam.value==""){
document.getElementById('sfnam').innerHTML = result;
return;
}
if(document.forms[0].snam.value==""){
document.getElementById('ssnam').innerHTML = result;
return;
}
if(document.forms[0].email.value==""){
document.getElementById('semail').innerHTML = result;
return;
}
if(document.forms[0].company.value==""){
document.getElementById('scom').innerHTML = result;
return;
}
if(document.forms[0].securityQuestion.value=="none"){
document.getElementById('sque').innerHTML = result;
return;
}
if(document.forms[0].securityAnswer.value==""){
document.getElementById('sans').innerHTML = result;
return;
}
if(document.forms[0].ipassword.value==""){
document.getElementById('spas').innerHTML = result;
return;
}

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="/working/registerMe.asp";
xmlHttp.onreadystatechange = messageResponse;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);
}

// PASSWORD REMINDERS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function sendUserName(){

var thisAlert="&nbsp;Required&nbsp;"

//error checking........................................................................
var username = document.forms[0].myUsername.value;

// reset fields before alert.......................................................
document.getElementById("alert1").innerHTML = "";
//..........................................................................................

if(username==""){
document.getElementById("alert1").innerHTML = thisAlert;
}
else {
var thisLot;
thisLot = "username="+ encodeURIComponent(document.forms[0].myUsername.value);

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
//alert(thisLot);
var url="/working/questionMe.asp";
//document.location.href=url+"?"+thisLot; 
xmlHttp.onreadystatechange = stateChangedP;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);
}
}

function sendAnswer(){

var thisAlert="&nbsp;Required&nbsp;"

//error checking........................................................................
var answer = document.forms[0].answer.value;

// reset fields before alert.......................................................
document.getElementById("alert1").innerHTML = "";
//..........................................................................................

if(answer==""){
document.getElementById("alert1").innerHTML = thisAlert;
}
else {
var thisLot;
thisLot = "answer=" + encodeURIComponent(document.forms[0].answer.value);
thisLot= thisLot + "&id=" + encodeURIComponent(document.forms[0].id.value);

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
//alert(thisLot);
var url="/working/passwordMe.asp";
//document.location.href=url+"?"+thisLot; 
xmlHttp.onreadystatechange = stateChangedP;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);
}
}

function stateChangedP() { 
document.getElementById("passwordHere").innerHTML="<br/><br/><br/><br/><center><img src=/graphics/common/loader.gif></center>";
if (xmlHttp.readyState==4){ 
document.getElementById("passwordHere").innerHTML=xmlHttp.responseText;
}
else {
document.getElementById("passwordHere").innerHTML="<br/><br/><br/><br/><center><img src=/graphics/common/loader.gif></center>";
}
}

//--------------------------------------------------------------------------------------------------------------------

function starshineRegister(){
   
var newsletter

if(document.forms[0].newsletter.checked){
newsletter="No";
}
else
{
newsletter="Yes";
}

var thisLot;
thisLot =  "ititle=" + encodeURIComponent(document.forms[0].ititle.value);
thisLot = thisLot + "&firstname=" + encodeURIComponent(document.forms[0].firstname.value);
thisLot = thisLot + "&surname=" + encodeURIComponent(document.forms[0].surname.value);
thisLot = thisLot + "&address1=" + encodeURIComponent(document.forms[0].address1.value);
thisLot = thisLot + "&address2=" + encodeURIComponent(document.forms[0].address2.value);
thisLot = thisLot + "&address3=" + encodeURIComponent(document.forms[0].address3.value);
thisLot = thisLot + "&address4=" + encodeURIComponent(document.forms[0].address4.value);
thisLot = thisLot + "&town=" + encodeURIComponent(document.forms[0].town.value);
thisLot = thisLot + "&county=" + encodeURIComponent(document.forms[0].county.value);
thisLot = thisLot + "&postcode=" + encodeURIComponent(document.forms[0].postcode.value);
thisLot = thisLot + "&telephone=" + encodeURIComponent(document.forms[0].telephone.value);
thisLot = thisLot + "&email=" + encodeURIComponent(document.forms[0].email.value);
thisLot = thisLot + "&emergencycontact=" + encodeURIComponent(document.forms[0].emergencycontact.value);
thisLot = thisLot + "&emergencycontactphone=" + encodeURIComponent(document.forms[0].emergencycontactphone.value);
thisLot = thisLot + "&tshirtsize=" + encodeURIComponent(document.forms[0].tshirtsize.value);
thisLot = thisLot + "&tshirtcollection=" + encodeURIComponent(document.forms[0].tshirtcollection.value);
thisLot = thisLot + "&medicalcondition=" + encodeURIComponent(document.forms[0].medicalcondition.value);
thisLot = thisLot + "&haveyouwalkedbefore=" + encodeURIComponent(document.forms[0].haveyouwalkedbefore.value);
thisLot = thisLot + "&iamwalkingbecause=" + encodeURIComponent(document.forms[0].iamwalkingbecause.value);
thisLot = thisLot + "&dateofbirth=" + encodeURIComponent(document.forms[0].dateofbirth.value);
thisLot = thisLot + "&teamname=" + encodeURIComponent(document.forms[0].teamname.value);
thisLot = thisLot + "&newsletter=" + encodeURIComponent(newsletter);


//alert(thisLot);


if(document.forms[0].firstname.value==""){
alert("We require your FIRSTNAME");
return;
}
if(document.forms[0].surname.value==""){
alert("We require your SURNAME");
return;
}
if(document.forms[0].address1.value==""){
alert("We require your ADDRESS");
return;
}
if(document.forms[0].town.value==""){
alert("We require your TOWN");
return;
}
if(document.forms[0].telephone.value==""){
alert("We require your TELEPHONE NUMBER");
return;
}
if(document.forms[0].emergencycontact.value==""){
alert("We require an EMERGENCY CONTACT");
return;
}
if(document.forms[0].emergencycontactphone.value==""){
alert("We require an EMERGENCY CONTACT TELEPHONE NUMBER");
return;
}
if(document.forms[0].medicalcondition.value==""){
alert("We need to know if you have any existing MEDICAL CONDITIONS");
return;
}
if(document.forms[0].dateofbirth.value==""){
alert("We nedd to know your DATE OF BIRTH");
return;
}

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="/sssSend.asp";
document.location.href=url+"?"+thisLot;
//xmlHttp.onreadystatechange = messageResponse;
//xmlHttp.open("POST",url,true);
//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
//xmlHttp.setRequestHeader("Content-length", thisLot.length);
//xmlHttp.setRequestHeader("Connection", "close");
//xmlHttp.send(thisLot);
}

//--------------------------------------------------------------------------------------------------------------------

function tributeRegister(){
   
var newsletter;
var mydate;
if(document.forms[0].newsletter.checked){
newsletter="No";
}
else
{
newsletter="Yes";
}

var thisLot;
thisLot =  "ititle=" + encodeURIComponent(document.forms[0].ititle.value);
thisLot = thisLot + "&firstname=" + encodeURIComponent(document.forms[0].firstname.value);
thisLot = thisLot + "&surname=" + encodeURIComponent(document.forms[0].surname.value);
thisLot = thisLot + "&address=" + encodeURIComponent(document.forms[0].address.value);
thisLot = thisLot + "&postcode=" + encodeURIComponent(document.forms[0].postcode.value);
thisLot = thisLot + "&telephone=" + encodeURIComponent(document.forms[0].telephone.value);
thisLot = thisLot + "&email=" + encodeURIComponent(document.forms[0].email.value);
thisLot = thisLot + "&rtitle=" + encodeURIComponent(document.forms[0].rtitle.value);
thisLot = thisLot + "&rfirstname=" + encodeURIComponent(document.forms[0].rfirstname.value);
thisLot = thisLot + "&rsurname=" + encodeURIComponent(document.forms[0].rsurname.value);
thisLot = thisLot + "&dob=" + encodeURIComponent(document.forms[0].dob.value);
thisLot = thisLot + "&relationship=" + encodeURIComponent(document.forms[0].relationship.value);
mydate=document.forms[0].drday.value;
mydate=mydate+"/"+document.forms[0].drmon.value;
mydate=mydate+"/2008";
thisLot = thisLot + "&datetoremeber=" + mydate;
thisLot = thisLot + "&message=" + encodeURIComponent(document.forms[0].message.value);
thisLot = thisLot + "&newsletter=" + encodeURIComponent(newsletter);


//alert(thisLot);


if(document.forms[0].firstname.value==""){
alert("We require your FIRSTNAME");
return;
}
if(document.forms[0].surname.value==""){
alert("We require your SURNAME");
return;
}
if(document.forms[0].address.value==""){
alert("We require your ADDRESS");
return;
}
if(document.forms[0].postcode.value==""){
alert("We require your POSTCODE");
return;
}
if(document.forms[0].telephone.value==""){
alert("We require your TELEPHONE NUMBER");
return;
}
if(document.forms[0].rsurname.value==""){
alert("We require a SURNAME");
return;
}
if(document.forms[0].rtitle.value==""){
alert("We require a TITLE");
return;
}
if(document.forms[0].rfirstname.value==""){
alert("We require a FIRSTNAME");
return;
}
if(document.forms[0].rsurname.value==""){
alert("We require a SURNAME");
return;
}
if(document.forms[0].dob.value==""){
alert("We require a DATE OF BIRTH");
return;
}
if(document.forms[0].relationship.value==""){
alert("We require a RELATIONSHIP");
return;
}

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="/tributefundSend.asp";
document.location.href=url+"?"+thisLot;
}

function tryMeNow(){
openDiv("ibasket");
}

// scripts Copyright Mark Fesco, Media Creative Ltd, April 2008 // scripts Copyright Mark Fesco, Media Creative Ltd, April 2008 // scripts Copyright Mark Fesco, Media Creative Ltd, April 2008 // scripts Copyright Mark Fesco, Media Creative Ltd, April 2008 // scripts Copyright Mark Fesco, Media Creative Ltd, April 2008

function getShop(thisArea){
returnShop(thisArea);
}

var bCode;
var canClose=true;
//var xmlhttp;

function stateChangedS() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("shopHere").innerHTML=xmlHttp.responseText;
}
else {
document.getElementById("shopHere").innerHTML="<br><br><br><center><img src=/graphics/loader.gif></center>";
}
}

function stateChanged2() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("basketHere").innerHTML=xmlHttp.responseText;
}
else {
document.getElementById("basketHere").innerHTML="<br><br><br><center><img src=/graphics/loader.gif></center>";
}
}

// Return Shop Area 
function returnShop(thisArea)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/returnshop.asp"
url=url+"?area="+thisArea;
xmlHttp.onreadystatechange=stateChangedS;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function returnCheckout()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/checkout.asp"
xmlHttp.onreadystatechange=stateChangedS;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

// Add to Basket 

var thisNumber;

function addToBasket(obj){
var thisNo = obj;
thisNumber = thisNo;
var i = "id" + obj
var x = "iquantity" + obj
var y = "icolour" + obj 
var d = "istyle" + obj
var s = "isize" + obj
var a = "parea" + obj
var p = "pcost" + obj

var id = document.getElementById(i).value;
var iquantity = document.getElementById(x).value;
var parea = document.getElementById(a).value;
var pcost = document.getElementById(p).value;


if(document.getElementById(s)){
var isize = document.getElementById(s).value;
}
else
{
var isize = "none";
}

if(document.getElementById(y)){
var icolour = document.getElementById(y).value;
}
else
{
var icolour = "none";
}

if(document.getElementById(d)){
var istyle = document.getElementById(d).value;
}
else
{
var istyle = "none";
}

var thisLot;
thisLot = "id=" + id;
thisLot = thisLot + "&iquantity=" + iquantity;
thisLot = thisLot + "&icolour=" + icolour;
thisLot = thisLot + "&istyle=" + istyle;
thisLot = thisLot + "&isize=" + isize;
thisLot=thisLot+"&parea="+parea;
thisLot=thisLot+"&pcost="+pcost;

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
alert ("Your browser does not support AJAX!");
 return;
 } 
var url="/working/addBasket.asp?r="+new Date().getTime();
//alert(thisLot);
//document.location.href=url + "&" + thisLot;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);
xmlHttp.onreadystatechange = alertContentsUser; 
}


function alertContentsUser() {
	  document.getElementById('baskethere'+thisNumber).innerHTML="<img src=/graphics/loader.gif>";      
	  if (xmlHttp.readyState == 4) {
         if (xmlHttp.status == 200) {
            //alert(xmlHttp.responseText);
            var result = "<span class=alerted>Item added to basket<br><a href=# id=" + thisNumber + " onmouseover=showAlert(event,'" + thisNumber + "'); >View Basket</a></span>";
			document.getElementById('baskethere'+thisNumber).innerHTML = result;  
			document.getElementById('showBasket').innerHTML="<a href=javascript:returnBasket();><img src=/graphics/common/basket.jpg border=0 alt=View the contents of your shopping basket...></a>" 
			        } else {
            alert('There was a problem with the request.');
         }
      }      
   }
   
   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   
   function choseFunction(){
   if(document.forms[0].selectFunction.value=="1"){
   removeBasket();
   }
   if(document.forms[0].selectFunction.value=="2"){
   updateBasket();
   }  
   } 
   
   //delete from basket
   
    function removeBasket() { 
 if (confirm('Are you sure you want to REMOVE the selection(s) ticked?\n\nThis action cannot be undone!')) {
	for (i=0; i<document.forms[0].elements.length; i++) { 
		el = document.forms[0].elements[i];
		if (el.type=="checkbox" && el.name.indexOf("checkBox")!=-1){
			if (el.checked) {
			var id = el.name.replace(/checkBox/, "");
			deleteme(id);
}
		} 
	}
	canClose=false;
	returnBasket();
	}
}

function deleteme(id){
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/deleteBasket.asp";
url=url+"?id="+id;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function deleteme2(id){
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/deleteBasket2.asp";
url=url+"?id="+id;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

    function emptyBasket() { 
 if (confirm('Are you sure you want to EMPTY the entire basket?\n\nThis action cannot be undone!')) {
	for (i=0; i<document.forms[0].elements.length; i++) { 
		el = document.forms[0].elements[i];
		if (el.type=="checkbox" && el.name.indexOf("checkBox")!=-1){
			//if (el.checked) {
			var id = el.name.replace(/checkBox/, "");
			deleteme2(id);
//}
		} 
	}
	//openDiv="2";
	returnBasket();
	setTimeout("document.location.href='/shopping-online.asp?st=General'",1000);
	}
}

function updateMe(id,qnt){
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/updateBasket.asp";
url=url+"?id="+id;
url=url+"&qnt="+qnt;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

    function updateBasket() { 
 if (confirm('Are you sure you want to UPDATE the selection(s) ticked?')) {
 var qnt;
 var x;
 var id;
	for (i=0; i<document.forms[0].elements.length; i++) { 
		el = document.forms[0].elements[i];
		if (el.type=="checkbox" && el.name.indexOf("checkBox")!=-1){
			if (el.checked) {
			id = el.name.replace(/checkBox/, "");
			x = "qnt" + id;
			qnt = document.getElementById(x).value;
			updateMe(id,qnt);
}
		} 
	}
	canClose=false;
	returnBasket();
	}
}

function makePayment() {

//error checking........................................................................
var ititle = document.forms[0].ititle.value;
var fname = document.forms[0].fname.value;
var sname = document.forms[0].sname.value;
var ad1 = document.forms[0].ad1.value;
var ad2 = document.forms[0].ad2.value;
var ad3 = document.forms[0].ad3.value;
var ad4 = document.forms[0].ad4.value;
var town = document.forms[0].town.value;
var county = document.forms[0].county.value;
var postcode = document.forms[0].postcode.value;
var country = document.forms[0].country.value;
var telephone = document.forms[0].telephone.value;
var emailaddress = document.forms[0].emailaddress.value;
var teddybears = document.forms[0].teddybears.value;

// reset fields before alert.......................................................
document.getElementById("a1").innerHTML = "&nbsp;";
document.getElementById("a2").innerHTML = "&nbsp;";
document.getElementById("a3").innerHTML = "&nbsp;";
document.getElementById("a4").innerHTML = "&nbsp;";
document.getElementById("a5").innerHTML = "&nbsp;";
document.getElementById("a6").innerHTML = "&nbsp;";
document.getElementById("a7").innerHTML = "&nbsp;";
document.getElementById("a8").innerHTML = "&nbsp;";
document.getElementById("a9").innerHTML = "&nbsp;";
document.getElementById("a10").innerHTML = "&nbsp;";
document.getElementById("a11").innerHTML = "&nbsp;";
document.getElementById("a12").innerHTML = "&nbsp;";
document.getElementById("a13").innerHTML = "&nbsp;";
document.getElementById("secureAlert").innerHTML = "&nbsp;";
//..........................................................................................

var thisAlert="<a name=alert></a>&nbsp;Required&nbsp;";

if(ititle==""){
document.getElementById("a1").innerHTML = thisAlert;
document.location.href="#alert";

}
else if (fname==""){
document.getElementById("a2").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (sname==""){
document.getElementById("a3").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (ad1==""){
document.getElementById("a4").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (ad2==""){
document.getElementById("a5").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (ad3==""){
document.getElementById("a6").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (ad4==""){
document.getElementById("a7").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (town==""){
document.getElementById("a8").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (county==""){
document.getElementById("a9").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (postcode==""){
document.getElementById("a10").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (country==""){
document.getElementById("a11").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (telephone==""){
document.getElementById("a12").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (emailaddress==""){
document.getElementById("a13").innerHTML = thisAlert;
document.location.href="#alert";
}
else if (teddybears==""){
document.getElementById("secureAlert").innerHTML = thisAlert;
document.location.href="#alert";
}

else {

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var thisLot;
thisLot = "teddybears=" + encodeURIComponent(document.forms[0].teddybears.value);
thisLot = thisLot + "&picnic=" + encodeURIComponent(document.forms[0].picnic.value);
var url="/securities/d8jeuf634hd76.asp"
//document.location.href=url+"?"+thisLot;
xmlHttp.onreadystatechange = alertContentsUser99;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);


}
}

function sendToPaypal(){

var thisLot;
thisLot = "basketCode=" + bCode; //encodeURIComponent(document.forms[0].basketCode.value);
//thisLot = thisLot + "&fname=" + encodeURIComponent(document.forms[0].fname.value);
//thisLot = thisLot + "&sname=" + encodeURIComponent(document.forms[0].sname.value);
//thisLot = thisLot + "&ad1=" + encodeURIComponent(document.forms[0].ad1.value);
//thisLot = thisLot + "&ad2=" + encodeURIComponent(document.forms[0].ad2.value);
//thisLot = thisLot + "&ad3=" + encodeURIComponent(document.forms[0].ad3.value);
//thisLot = thisLot + "&ad4=" + encodeURIComponent(document.forms[0].ad4.value);
//thisLot = thisLot + "&town=" + encodeURIComponent(document.forms[0].town.value);
//thisLot = thisLot + "&postcode=" + encodeURIComponent(document.forms[0].postcode.value);
//thisLot = thisLot + "&county=" + encodeURIComponent(document.forms[0].county.value);
//thisLot = thisLot + "&country=" + encodeURIComponent(document.forms[0].country.value);
//thisLot = thisLot + "&emailaddress=" + encodeURIComponent(document.forms[0].emailaddress.value);
//thisLot = thisLot + "&telephone=" + encodeURIComponent(document.forms[0].telephone.value);
//thisLot = thisLot + "&basketCode=" + encodeURIComponent(document.forms[0].basketCode.value);
//thisLot = thisLot + "&totalCost=" + encodeURIComponent(document.forms[0].totalCost.value);
// PAYPAL FIELDS HERE

var url="/working/sendToPaypal2.asp";
document.location.href=url+"?"+thisLot;

}


   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function returnBasket(){

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/view-basket.asp"
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
if(canClose==true){
		setTimeout("openDiv('ibasket')",300); 
		}
		else{
		canClose=true;
		}
}

function returnBasket2(){
//setTimeout("openDiv('ibasket')",300); 
//tryMeNow();
//setTimeout("fixIt()",300); 

}

function fixIt(){
//openDiv("ibasket");
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/working/view-basket.asp"
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
		setTimeout("openDiv('ibasket')",300); 
		}

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//document.write('<img src="/graphics/ribbon.gif" border="0" width="150" height="150" style="position:absolute; right:0px; top:0px; margin:0px; padding:0px">')

function showAlert(e,obj){

	MCalField=obj;
    var posx = 0;
    var posy = 0;
    if (!e) var e = window.event;
    if (e.clientX || e.clientY)
    {
        posx = e.clientX + document.body.scrollLeft;
        posy = e.clientY + document.body.scrollTop;
    }
    else if (e.pageX || e.pageY)
    {
        posx = e.pageX;
        posy = e.pageY;
    }
	document.getElementById('MAlert').style.left = posx-150;
	document.getElementById('MAlert').style.top = posy-176;
	document.getElementById('MAlert').style.display = '';
}

function stopAlert(){
document.getElementById('MAlert').style.display = 'none';
}

function checkCode(){
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var thisLot;
thisLot = "teddybears=" + encodeURIComponent(document.forms[0].teddybears.value);
thisLot = thisLot + "&picnic=" + encodeURIComponent(document.forms[0].picnic.value);
var url="/securities/d8jeuf634hd76.asp"
//document.location.href=url+"?"+thisLot;
xmlHttp.onreadystatechange = alertContentsUser99;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);
}


function alertContentsUser99() {
var selected;     
selected = document.getElementById("secureAlert"); 
if (xmlHttp.readyState == 4) {
         if (xmlHttp.status == 200) {
          if(xmlHttp.responseText=="1"){
		  selected.className = "alertTD";
		document.getElementById("secureAlert").innerHTML = "&nbsp;Code incorrect&nbsp;"; 
		//return;  
		  }
		 else {
okToGoNow();
 }

         } else {
		 //alert(xmlHttp.responseText);
            alert('There was a problem with the request.');
         }
      }     
   }
   
   function sendtopaypalwait() {
if (xmlHttp.readyState == 4) {
         if (xmlHttp.status == 200) {        
sendToPaypal();
         } else {
		 //alert(xmlHttp.responseText);
            alert('There was a problem with the request.');
         }
      }     
   }


function okToGoNow(){

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var thisLot;
thisLot = "ititle=" + encodeURIComponent(document.forms[0].ititle.value);
thisLot = thisLot + "&fname=" + encodeURIComponent(document.forms[0].fname.value);
thisLot = thisLot + "&sname=" + encodeURIComponent(document.forms[0].sname.value);
thisLot = thisLot + "&ad1=" + encodeURIComponent(document.forms[0].ad1.value);
thisLot = thisLot + "&ad2=" + encodeURIComponent(document.forms[0].ad2.value);
thisLot = thisLot + "&ad3=" + encodeURIComponent(document.forms[0].ad3.value);
thisLot = thisLot + "&ad4=" + encodeURIComponent(document.forms[0].ad4.value);
thisLot = thisLot + "&town=" + encodeURIComponent(document.forms[0].town.value);
thisLot = thisLot + "&postcode=" + encodeURIComponent(document.forms[0].postcode.value);
thisLot = thisLot + "&county=" + encodeURIComponent(document.forms[0].county.value);
thisLot = thisLot + "&country=" + encodeURIComponent(document.forms[0].country.value);
thisLot = thisLot + "&emailaddress=" + encodeURIComponent(document.forms[0].emailaddress.value);
thisLot = thisLot + "&telephone=" + encodeURIComponent(document.forms[0].telephone.value);
thisLot = thisLot + "&basketCode=" + encodeURIComponent(document.forms[0].basketCode.value);
thisLot = thisLot + "&cangiftaid=" + encodeURIComponent(document.forms[0].cangiftaid.value);
thisLot = thisLot + "&cancontact=" + encodeURIComponent(document.forms[0].cancontact.value);

bCode = encodeURIComponent(document.forms[0].basketCode.value);


//alert(thisLot);
var url="/working/sendToPaypal.asp";
//alert(thisLot);
//document.location.href=url+"?"+thisLot;
xmlHttp.onreadystatechange = sendtopaypalwait;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", thisLot.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(thisLot);

}

function makeDonation(){
document.location.href="/working/sendToPaypalDonate.asp";
}

//--------------------------------------------------------------------------------------------------------------------

function continueTrue(){


if(document.forms[0].fname.value==""){
alert("We require your FIRSTNAME");
return;
}
if(document.forms[0].sname.value==""){
alert("We require your SURNAME");
return;
}
if(document.forms[0].ad1.value==""){
alert("We require your ADDRESS");
return;
}
if(document.forms[0].town.value==""){
alert("We require your TOWN");
return;
}
if(document.forms[0].telephoneDay.value==""){
alert("We require your DAYTIME TELEPHONE NUMBER");
return;
}
if(document.forms[0].telephoneNight.value==""){
alert("We require your EVENING TELEPHONE NUMBER");
return;
}
if(document.forms[0].email.value==""){
alert("We require an EMAIL ADDRESS for you");
return;
}
if(document.forms[0].emergencyContact.value==""){
alert("We require an EMERGENCY CONTACT");
return;
}
if(document.forms[0].emergencyContactTelephone.value==""){
alert("We require an EMERGENCY CONTACT TELEPHONE NUMBER");
return;
}
if(document.forms[0].medicalConditions.value==""){
alert("We need to know if you have any existing MEDICAL CONDITIONS");
return;
}
if(document.forms[0].howHear.value==""){
alert("We would like to know HOW YOU HEARD of true Grit");
return;
}

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
  
var canContact

if(document.forms[0].canContact.checked){
canContact="Yes";
}
else
{
canContact="No";
}


var thisLot;
thisLot =  "ititle=" + encodeURIComponent(document.forms[0].ititle.value);
thisLot = thisLot + "&fname=" + encodeURIComponent(document.forms[0].fname.value);
thisLot = thisLot + "&sname=" + encodeURIComponent(document.forms[0].sname.value);
thisLot = thisLot + "&ad1=" + encodeURIComponent(document.forms[0].ad1.value);
thisLot = thisLot + "&ad2=" + encodeURIComponent(document.forms[0].ad2.value);
thisLot = thisLot + "&ad3=" + encodeURIComponent(document.forms[0].ad3.value);
thisLot = thisLot + "&ad4=" + encodeURIComponent(document.forms[0].ad4.value);
thisLot = thisLot + "&town=" + encodeURIComponent(document.forms[0].town.value);
thisLot = thisLot + "&county=" + encodeURIComponent(document.forms[0].county.value);
thisLot = thisLot + "&postcode=" + encodeURIComponent(document.forms[0].postcode.value);
thisLot = thisLot + "&telephoneDay=" + encodeURIComponent(document.forms[0].telephoneDay.value);
thisLot = thisLot + "&telephoneNight=" + encodeURIComponent(document.forms[0].telephoneNight.value);
thisLot = thisLot + "&email=" + encodeURIComponent(document.forms[0].email.value);
thisLot = thisLot + "&emergencyContact=" + encodeURIComponent(document.forms[0].emergencyContact.value);
thisLot = thisLot + "&emergencyContactTelephone=" + encodeURIComponent(document.forms[0].emergencyContactTelephone.value);
thisLot = thisLot + "&howHear=" + encodeURIComponent(document.forms[0].howHear.value);
thisLot = thisLot + "&canContact=" + encodeURIComponent(canContact);
thisLot = thisLot + "&medicalConditions=" + encodeURIComponent(document.forms[0].medicalConditions.value);
  
var url="/trueGritSend.asp";
document.location.href=url+"?"+thisLot;
//xmlHttp.onreadystatechange = messageResponse;
//xmlHttp.open("POST",url,true);
//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
//xmlHttp.setRequestHeader("Content-length", thisLot.length);
//xmlHttp.setRequestHeader("Connection", "close");
//xmlHttp.send(thisLot);
}

//--------------------------------------------------------------------------------------------------------------------


