var ajax = new sack();

function whenLoading(){
dropmenuobj=document.getElementById? document.getElementById("addcommentbutton") : addcommentbutton
dropmenuobj.disabled=true;
dropmenuobj.value="Loading..."
}

function whenLoaded(){
dropmenuobj=document.getElementById? document.getElementById("addcommentbutton") : addcommentbutton
window.location = "#comments";
message2.setCode('<body style=\"font-size: small;color: white;background-color: #0B2734;\">Add Another Comment</body>');
dropmenuobj.value = "Add Comment";
dropmenuobj.disabled = false;
}


function whenCompleted(){
dropmenuobj=document.getElementById? document.getElementById("videocomments") : videocomments
dropmenuobj.innerHTML=this.response;
alert("Your VIDEO Comment Has Been Submitted, There is no need to press Submit Again.");
}

function ajaxvideocomment(vidq,obj){
	var messageval = message2.getCode();
  
	ajax.setVar("vidq", vidq); // recomended method of setting data to be parsed.
        ajax.encVar("comment", messageval); // recomended method of setting data to be parsed.
        ajax.requestFile = "/ajax/thevideocomments.php";
        ajax.method = "POST";
        ajax.onLoading = whenLoading;
        ajax.onLoaded = whenLoaded;
//      ajax.onInteractive = whenInteractive;
        ajax.onCompletion = whenCompleted;
        ajax.runAJAX();
}

