<!-- hide script from non-script enabled browsers

var review_submitted = false;

// function to check review details are correct before submitting
function CheckReview()
{
  	if ( review_submitted )
	{
		alert ( "Your review has already been submitted. Please wait..." );
		return false;
	}

  	// initialise variables
	var errorMsg = "";

	// check for a name
	if (document.review_form.reviewer_name.value == "")
	{
		errorMsg += "\n Name \t\t- Enter your name";
	}
	// check for a location
	if (document.review_form.reviewer_from.value == "")
	{
		errorMsg += "\n Location \t- Enter your town and country";
	}
	// check for a review
	if (document.review_form.review_text.value == "")
	{
		errorMsg += "\n Review \t- Enter your review";
	}
	else if ( document.review_form.review_text.value.length < 100 )
	{
		errorMsg += "\n Review \t- is too short please be more descriptive.";
	}
	// check for a rating
	if (document.review_form.review_rating.value == "")
	{
		errorMsg += "\n Rating \t- Select your rating for this product";
	}

	// if there is a problem with the review then display the error(s)
	if (errorMsg != "")
	{
		msg = "____________________________________________\n\n";
		msg += " Your review could not be submitted because of a problem.\n";
		msg += " Please correct the following and then re-submit.\n";
		msg += "___________________________________________\n";

		// display the error
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}

	// no problems
	review_submitted = true;
	return true;
}
// end script hiding -->
