var submit_comment_xmlHttp
function submit_comment() 
{
submit_comment_xmlHttp=GetXmlHttpObject()


 

if (submit_comment_xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return
 }

var media= document.getElementById('media').value;
var id = document.getElementById('id').value;
var title = document.getElementById('title').value;

var name = document.getElementById('Name').value;
var grade= document.getElementById('Grade').value;
var state= document.getElementById('State').value;
var city= document.getElementById('City').value;
var email= document.getElementById('Email').value;
var comment= document.getElementById('Comment').value;
var school= document.getElementById('School').value;

   var submit_comment_url = '../ajax/submit_comment.php';
   var submit_comment_params = "name="+name+"&media="+media+"&id="+id+"&title="+title+"&grade="+grade+"&state="+state+"&email="+email+"&comment="+comment+"&school="+school+"&city="+city;

   submit_comment_xmlHttp.open("POST", submit_comment_url, true);
   submit_comment_xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   submit_comment_xmlHttp.setRequestHeader("Content-length", submit_comment_params.length);
   submit_comment_xmlHttp.setRequestHeader("Connection", "close");
   submit_comment_xmlHttp.onreadystatechange = submit_comment_statechange;
   submit_comment_xmlHttp.send(submit_comment_params);



}

function submit_comment_statechange() 
{
    if (submit_comment_xmlHttp.readyState==4 || submit_comment_xmlHttp.readyState=="complete")
    { 
        document.getElementById("commentform").innerHTML = submit_comment_xmlHttp.responseText;
    } 
}
