function check(){
if(document.myForm.name.value.length == 0){
alert("You must include your name!");
return(1);
}
if(document.myForm.comment.value.length == 0){
alert("You must include a comment!");
return(1);
}
var wordLength = document.myForm.comment.value.split(' ').length;
if(wordLength>250){
alert("Your comment is too long. It must not exceed 250 words!");
return(1);
}
document.myForm.submit();
}

function words(){
var length = document.myForm.comment.value.split(' ').length;
document.getElementById("wordCount").innerHTML="</br>Words: " + length;
}

var xmlHttp

function getComments(pProduct)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="/getComments.php"
url=url+"?product="+pProduct
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("comments").
 innerHTML=xmlHttp.responseText;
 } 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
 {
 objXMLHttp=new XMLHttpRequest()
 }
else if (window.ActiveXObject)
 {
 objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
 }
return objXMLHttp
}