var xmlhttp

function commentSubmit(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var namevalue=encodeURIComponent(document.getElementById("commentarea").value)
var parameters="comments="+namevalue;
document.getElementById("commentsView").innerHTML="<div class='commentbg'><table cellpadding='0' cellspacing='0' width='790px' border='0'><tr><td align=center><span class='text1' style='color: black'>~patience is a virtue~</span></td></tr></table></div>";
xmlhttp.onreadystatechange=commentStateChanged;
xmlhttp.open("POST",str,true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
xmlhttp.send(parameters)
}

function getComments(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
//alert(str);
document.getElementById("commentsView").innerHTML="<div class='commentbg'><table cellpadding='0' cellspacing='0' width='790px' border='0'><tr><td align=center><span class='text1' style='color: black'>~patience is a virtue~</span></td></tr></table></div>";
xmlhttp.onreadystatechange=commentStateChanged;
xmlhttp.open("GET",str,true);
xmlhttp.send(null);
}

function commentStateChanged()
{
if (xmlhttp.readyState==4)
  {
	//alert(xmlhttp.responseText);
	document.getElementById("commentsView").innerHTML=xmlhttp.responseText;
	//alert("comments submitted successfully");
  }
}

