﻿// JScript File
function feedbackPopup(){
		url = "feedback/feedback.aspx?page=" + escape(window.location.href)
        popUpWin(url, 'console', '300', '350');
}

function submitIt() {
	if (document.Contact.customerFeedback.value=="" || document.Contact.customerFeedback.value==ourWording){
		alert("Please enter your comments");
		document.Contact.customerFeedback.focus();
		return false;
	}
	var message = document.Contact.customerFeedback.value;
	if (message.length < 10 || message.length > 500){
		alert("Your message must be between 10 and 500 characters in length");
		document.Contact.customerFeedback.focus();
		return false;
	}
	document.Contact.customerFeedback.value = document.Contact.customerFeedback.value.replace(/[^a-z0-9-\.,_\{\}\\\/ ]/gi," ");
	return true;
}

var ourWording = "Please note that this facility is for feedback only, we are unable to respond to your message.";   

function initFeedback(){
	var txtElem = document.getElementById("customerFeedback");
	txtElem.value = ourWording;
	addEvent(txtElem, 'focus', CommentsOnfocus, false);
}

function CommentsOnfocus(){
	var txtElem = document.getElementById("customerFeedback");
	if (txtElem.value == ourWording) {
		txtElem.value = "";
	}	
}



