// JavaScript Document
// Tracking Code by Sangeeth(sangeethweerasinghe@yahoo.com) -07-22-2009-
// Using Ajax,JS,ASP


//IP to Location Details Code
    if(google.loader.ClientLocation)
    {
        visitor_lat = google.loader.ClientLocation.latitude;
        visitor_lon = google.loader.ClientLocation.longitude;
        visitor_city = google.loader.ClientLocation.address.city;
        visitor_region = google.loader.ClientLocation.address.region;
        visitor_country = google.loader.ClientLocation.address.country;
        visitor_countrycode = google.loader.ClientLocation.address.country_code;
//        document.getElementById('yourinfo').innerHTML = '<p>Lat/Lon: ' + visitor_lat + ' / ' + visitor_lon + '</p><p>Location: ' + visitor_city + ', ' + visitor_region + ', ' + visitor_country + ' (' + visitor_countrycode + ')</p>';
    }
    else
    {
        document.getElementById('yourinfo').innerHTML = '';
    }
//IP to Location Details Code

window.onload = ajaxTrackFunction;
function ajaxTrackFunction()
{
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!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  document.myForm.time.value=xmlhttp.responseText;
  }
}
	var jsurl=location.href;																//read current URL
	var urlajax="http://www.eurodesigncenter.com/track/track.asp";			//get server page for var
	urlajax=urlajax+"?url="+jsurl;															//add URL var to server page

	urlajax=urlajax+"&visitor_lat="+visitor_lat;															//add URL var to server page
	urlajax=urlajax+"&visitor_lon="+visitor_lon;															//add URL var to server page
	urlajax=urlajax+"&visitor_city="+visitor_city;															//add URL var to server page
	urlajax=urlajax+"&visitor_region="+visitor_region;															//add URL var to server page
	urlajax=urlajax+"&visitor_country="+visitor_country;															//add URL var to server page
	urlajax=urlajax+"&visitor_countrycode="+visitor_countrycode;
	xmlhttp.open("GET",urlajax,true);														//call server page
	xmlhttp.send(null);
}
