// stores the reference to the XMLHttpRequest object
var xmlHttp = createXmlHttpRequestObject(); 
// retrieves the XMLHttpRequest object
function createXmlHttpRequestObject() 
{  
  // will store the reference to the XMLHttpRequest object
  var xmlHttp;
  // if running Internet Explorer
  if(window.ActiveXObject)
  {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  // if running Mozilla or other browsers
  else
  {
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  // return the created object or display an error message
  if (!xmlHttp)
    alert("Error creating the XMLHttpRequest object.");
  else 
    return xmlHttp;
}
////////////////// Ranjana Darling ////////////////////

function update_view_counter(userid,int_upd)
{ 	
	var url="ajax_update_view.php?userid="+ userid + "&insert=" + int_upd;
	xmlHttp.onreadystatechange=subChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function subChanged() 
{ 
	if(xmlHttp.readyState==4)
	{ 
		document.getElementById("div_left_view").innerHTML=xmlHttp.responseText;
	}
}

////////////////// End  /////////////////////////////

