// JavaScript Document

function sendRequest(feedback,commentDivId)
{

	var pageLocation=window.location;
	var strFeedback = feedback.value;
	strFeedback = strFeedback.replace(/&/g,"&amp;");
	strFeedback = strFeedback.replace(/'/g,"''");
        strFeedback = strFeedback.replace(/</g,"''");
	pageLocation = escape(pageLocation);


	if (feedback.value==''|| feedback.value =='Send us your suggestions' )
	{
		alert('Please enter your comments then submit.')
		return false;
	}
	else
	{	
	// create XML for HTTP POST
	var oDomDoc = Sarissa.getDomDocument();
	var xmlString = "<request><feedback>"+strFeedback+"</feedback><pagelocation>"+pageLocation+"</pagelocation></request>";
	oDomDoc = (new DOMParser()).parseFromString(xmlString, "text/xml");

	// debug-target: popup XML request for debugging

	// create XMLHTTPRequest object and POST xml
	var xmlhttp = new XMLHttpRequest();
	xmlhttp.open("POST", "http://www.parkdeanholidays.co.uk/resource/js/pagecommentconn.asp", false);
	xmlhttp.send(oDomDoc);

	// enable following line
	var oDomResultDoc = xmlhttp.responseXML;

	// debug-target display xml response result
	//alert("XML HTTP Response: "+Sarissa.serialize(oDomResultDoc));

	// initialize result
	var elResult = oDomResultDoc.getElementsByTagName("return");
	var returnValue = elResult[0].getElementsByTagName("feedbackentered")[0].firstChild.nodeValue;
	
	if (returnValue=="true")
	{
	document.getElementById('customerFeedbackRight').innerHTML='&#160;'
	commentDivId.innerHTML = '<p class="text" style="font-size:14px;margin-top:10px;">Thank you for your comments. Please note these comments are reviewed automatically and we cannot respond.  Please see <a href="http://www.parkdeanholidays.co.uk/help-and-advice/faqs.htm">FAQs</a> if you need help.</p>';	 
	}
	else
	commentDivId.innerHTML = '<p class="text">There is problem.</p>';

	}
}	