  function createXMLHttpRequestStatistics(){
	  var req;
	  if (window.XMLHttpRequest){
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject){
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	return req;
  }

 	function getAutonomyStatistics(XMLHttpRec,articleIds,divId) {
 		// alert(articleIds);
		 // Abort any currently pending requests for this XMLHttpRequest Object
		 XMLHttpRec.onreadystatechange = function () {}
		 XMLHttpRec.abort();
		 var urlMapping = "";
		  
		 if(urlMapping ==""){
			urlMapping="";
		 }else	{
			urlMapping="/" + urlMapping;
		  }
		
		 var url = urlMapping+"/getStatisticsList?articleIds="+articleIds;
		 XMLHttpRec.open("GET", url, true);
		 XMLHttpRec.onreadystatechange = function () {
		               callbackStatistics(XMLHttpRec,divId);
		 }
		 XMLHttpRec.send(null);

 	} // end of function


	function callbackStatistics(req,divId){
	  if (req.readyState==4){
      if (req.status == 200){
      	if (window.ActiveXObject){
          	msPopulateStatistics(req,divId);
		}else if (window.XMLHttpRequest){
            nonMSPopulateStatistics(req,divId);        
         }
      	}
      }
	 }

	function nonMSPopulateStatistics(r,divId){
		// alert("Inside  nonMSPopulate");
   		var resp = r.responseText;
		 //alert("Inside  nonmsPopulate : " + resp);
		var myJSONObject = eval('(' + resp + ')');
		displayStatistics(myJSONObject,divId);
	}

	function msPopulateStatistics(r,divId){
  		// alert("Inside  msPopulate");
		var resp = r.responseText;
	 	 // alert("Inside  msPopulate : " + resp);
	   	var myJSONObject = eval('(' + resp + ')');
		displayStatistics(myJSONObject,divId);
		   	
  	}

	function displayStatistics(infoObj,divId){
		var i;
	    var mostHTML = "";
	   
		if (typeof(infoObj.Comment)=="undefined")
		{
			mostHTML += 'No Data Found';
			return;
		}
		
		for (i = 0; i < infoObj.Comment.length; i++)
		{
			var mostId = infoObj.Comment[i];
			if (typeof(mostId.title)!="undefined")
			{
			mostHTML+="<div class='mostData' style='width:286px;'><span class='mostImage'>";
			mostHTML+="<img src='/template/ver1-0/images/most_Image.gif' height='5' width='4' border='0' /></span>";
			mostHTML+="<span class='mostInnerTxt'><a href='"+mostId.articleUrl+"'>"+mostId.title+"</a></span></div>";
			}
	
		}
		document.getElementById(divId).innerHTML = mostHTML;
		
	}

