function wordCounter (this_field, show_word_count, show_char_count) { if (show_word_count == null) { show_word_count = true; } if (show_char_count == null) { show_char_count = false; } var char_count = this_field.value.length; var fullStr = this_field.value + " "; var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi; var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, ""); var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi; var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " "); var splitString = cleanedStr.split(" "); var word_count = splitString.length -1; if (fullStr.length <2) { word_count = 0; } if (show_word_count & show_char_count) { alert ("Word Count:\n" + " " + word_count + wordOrWords + "\n" + " " + char_count + charOrChars); }else { if (show_word_count) { alert ("Word Count: " + word_count + wordOrWords); }else { if (show_char_count) { alert ("Character Count: " + char_count + charOrChars); } } } return word_count; } function ReviewReady(form) { if (isInserted(form.rating) == false) { alert ("You have not selected your rating for $prod_ptitle."); form.rating.focus(); return false; } if (isInserted(form.summary) == false) { alert ("You have not entered a summary for your review."); form.summary.focus(); return false; } if (isInserted(form.review) == false) { alert ("You have not entered your review text."); form.review.focus(); return false; } var max=2000; if (form.review.value.length > max) { alert("You can't enter more than 2000 characters.\n\nPlease shorten your entry and save it again."); return false; } if (wordCounter(form.review,false,false)<12){ alert ("Your review must contain at least 12 words."); form.review.focus(); return false; } if (isInserted(form.location) == false) { alert ("Please enter where are you from."); form.location.focus(); return false; } if (isInserted(form.name) == false) { alert ("Please enter your Name."); form.name.focus(); return false; } return true; } function ReviewPanel(id,cref){ document.getElementById("review_link").innerHTML = "Hide Review Form"; document.getElementById("review_pan").innerHTML = "
Please Enter Your Review of Cate West: The Vanishing Files:

Rating:

5 = brilliant / 1 = poor

Summary:
Review:
Where are you from:
Your Personalised Signature:
Show your signature with the review?YesNo
"; } function ClearReviewPanel(){ document.getElementById("review_link").innerHTML = "Write A Review"; document.getElementById("review_pan").innerHTML = ""; }