function submitTestimonial()
{
	if (checkForm())
	{
		var theForm = document.ReviewForm;
		theForm.postBack.value="true";		
		theForm.submit();
	}
}
function checkRequiredField(theField, errorMessage) {
    if (isEmpty(theField.value))
        return warnInvalid(theField, errorMessage);
    return true;
}
function trim(strText) {
	// this will get rid of leading spaces
    while (strText.substring(0,1) == ' ')
    	strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

    return strText;
}
function isEmpty(strValue) {
	if (strValue == null)
		return true;

	if (strValue.length == undefined)
		return true;

	strValue = trim(strValue);

	if (strValue.length == 0)
		return true;
	return false;
}
function warnInvalid(theField, s)
{    
    alert(s);    
    return false;
}
function checkForm()
{
	var theForm = document.ReviewForm;
	if (!checkRequiredField(theForm.fname, "Please enter your first name."))
		return false;
	if (!checkRequiredField(theForm.lname, "Please enter your last name."))
		return false;
	if (!checkRequiredField(theForm.testimonial, "Please enter the testimonial."))
		return false;	
	return true;
}
function changeCountry()
{
	var theForm = document.ReviewForm;	
	theForm.countryChange.value="true";
	theForm.submit();
}