var time_variable;
 
function getXMLObjectss()  //XML OBJECT
{
   var xmlHttp = false;
   try {
     xmlHttp = new ActiveXObject("Msxml2.XMLHTTP")  // For Old Microsoft Browsers
   }
   catch (e) {
     try {
       xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")  // For Microsoft IE 6.0+
     }
     catch (e2) {
       xmlHttp = false   // No Browser accepts the XMLHTTP Object then false
     }
   }
   if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
     xmlHttp = new XMLHttpRequest();        //For Mozilla, Opera Browsers
   }
   return xmlHttp;  // Mandatory Statement returning the ajax object created
}
 
var xmlhttp = new getXMLObjectss();	//xmlhttp holds the ajax object


function saveguestcomment() {

  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var commentt = document.getElementById("guest_comment");

    xmlhttp.open("POST","/delta/pack_files/page:1091/save_comment.php",true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponsess;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

    xmlhttp.send("commentt=" + escape(encodeURI(commentt.value)) + "&user=" + userid.value + "&author" + author.value + "&type=" + type.value); //Posting txtname to PHP File
}
}


function handleServerResponsess() {
   if (xmlhttp.readyState == 4) {
     if(xmlhttp.status == 200) {
var type = document.getElementById("type");
var userid = document.getElementById("userid");
var author = document.getElementById("author");
url='/delta/pack_files/newsfeed/feed.php?type=' + type.value + '&author' + author.value + '&user=' + userid.value;
ajaxpage(url, 'gcomments');
     }
     else {
        alert("Error during AJAX call. Please try again");
     }
   }
}
