﻿var xmlhttp;

function incrementViewCount()
{	
	str = '/';		
	str2 = '.';
	href = location.href;
	if (href.lastIndexOf(str) != -1)
	{	
		href = href.substring(href.lastIndexOf(str) +1, href.length);


		if (href.lastIndexOf(str2) == -1)
			href = 'index';
		else
			href = href.substring(0, href.lastIndexOf(str2));
		
		sendIncrementSignal(href);
	}
}

function sendIncrementSignal(page)
{
xmlhttp=null;
if (window.XMLHttpRequest)
  {// code for IE7, Firefox, Opera, etc.
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
  xmlhttp.open("GET","/~SRPPA/page_count.php?page="+page,true);
  xmlhttp.send(null);
  }
}