function loadXMLDoc_TellFriend() { 

  var url = "http://www.mylunch.ie/modules/restaurant/act_tellfriend.cfm";
  var params = "";
  /* ****SEt up Params ****** */
  params += "YourFirstName="+document.myform.YourFirstName.value+"&YourLastName="+document.myform.YourLastName.value+"&YourEmail="+document.myform.YourEmail.value+"&FriendEmail="+document.myform.FriendEmail.value;
  params += "&FriendFirstName="+document.myform.FriendFirstName.value+"&FriendLastName="+document.myform.FriendLastName.value;	
  params += "&Message="+document.myform.Message.value+"&restkey="+document.myform.restkey.value;

  if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
  } else {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4 && xmlhttp.status==200) {
      document.getElementById("Div_TellFriendError").innerHTML=xmlhttp.responseText;
	  var str = xmlhttp.responseText;
	  var matchedword = str.match("Thank");
	  if (matchedword=="Thank"){
	    document.getElementById("Div_TellFriend").style.display = "none";
	  }
	}
  }

  xmlhttp.open("POST", url, true);
  //Send the proper header information along with the request
  xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlhttp.setRequestHeader("Content-length", params.length);
  xmlhttp.setRequestHeader("Connection", "close");
  xmlhttp.send(params);
}

