// JavaScript Document

function ajaxFunction(iIndex,iMessage){
  //document.getElementById("targetLocation").innerHTML = "Loading...";
  var xmlhttp;
  if (window.XMLHttpRequest){
	// code for IE7+, Firefox, Chrome, Opera, Safari
	xmlhttp=new XMLHttpRequest();
  }else if (window.ActiveXObject){
	// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }else{
	alert("Your browser does not support XMLHTTP!");
  }


  var params = "startIndex="+iIndex+"&addComment="+iMessage;
  
  xmlhttp.open("POST","/_includes/services/getBlogFeed.php",true);
  //http.open("POST", url, true);
  
  //Send the proper header information along with the request
  xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlhttp.setRequestHeader("Content-length", params.length);
  xmlhttp.setRequestHeader("Connection", "close");

  xmlhttp.onreadystatechange=function(){
	if(xmlhttp.readyState==4){
	  document.getElementById("blogFeed").innerHTML = xmlhttp.responseText;
	}
  }

  xmlhttp.send(encodeURI(params));
  
}



function init(){
	ajaxFunction(0,'none');	
}
