 jQuery(document).ready(function()
	 {	
		var inReferrer = escape(document.referrer)+"";
		// URL to the tracker
		// the question mark must stay at the end!
		var dlSaving = "No";
		function checkTimeZone() 
		{
			/*var rightNow = new Date();
			//alert(rightNow.getDate()+"-"+ rightNow.getMonth() +"-"+ rightNow.getFullYear() +" "+rightNow.getHours()+":"+rightNow.getMinutes()+":"+rightNow.getSeconds());
			//alert(rightNow.toGMTString());
			var date1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
			var date2 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0);

	var temp = date1.toGMTString();
			var date3 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
			var temp = date2.toGMTString();
			var hoursDiffStdTime = (date1 - date3) / (1000 * 60 * 60);

	return hoursDiffStdTime;*/
			var rightNow = new Date();
			//alert(rightNow.toGMTString());
			var date1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
			var date2 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0);
			var temp = date1.toGMTString();
			var date3 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
			var temp = date2.toGMTString();
			var date4 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));

			var hoursDiffStdTime = (date1 - date3) / (1000 * 60 * 60);
			var hoursDiffDaylightTime = (date2 - date4) / (1000 * 60 * 60);
	if (hoursDiffDaylightTime == hoursDiffStdTime) {
			dlSaving = "No";
		//alert("Time zone is GMT " + hoursDiffStdTime + ".\nDaylight Saving Time is NOT observed here.");
	} else {
		dlSaving = "Yes";
		//alert("Time zone is GMT " + hoursDiffStdTime + ".\nDaylight Saving Time is observed here.");
		}
			return hoursDiffStdTime;
		}
		function testForCpu() {
			if (navigator.cpuClass) {
				switch (navigator.cpuClass) {
					case "x86" : theCpu = "x86 [Intel processor]"; break;
					case "68K" : theCpu = "68K [Motorola processor]"; break;
					case "Alpha" : theCpu = "Alpha [Digital processor]"; break;
					case "PPC" : theCpu = "PPC [Motorola processor]"; break;
					case "Other" : theCpu = "Other"; break;
				}
			}
			else { theCpu = "Unknown"; }
			return theCpu;
		}
		
		var theCpu = testForCpu();
		var sDimensions = screen.width + "x" + screen.height ;
		var sDepth = screen.colorDepth + "Bit";
		var sTitle = document.title;
var sTimeZone = checkTimeZone() ;


if (navigator.cookieEnabled) { var cookieSupport = navigator.cookieEnabled; }
else { var cookieSupport = "no"; }
rightNow = new Date();
		var passData = "&noscript=false&timezone="+sTimeZone+"&dls="+dlSaving+"&y="+rightNow.getFullYear()+"&m="+(parseInt(rightNow.getMonth()) + 1)+"&d="+rightNow.getDate()+"&h="+rightNow.getHours()+"&i="+rightNow.getMinutes()+"&s="+rightNow.getSeconds()+"&pgtitle="+sTitle+"&cookieSupport=" + cookieSupport + "&theCpu=" + theCpu + "&sDimensions=" + sDimensions + "&sDepth=" + sDepth + "&inReferrer=" + inReferrer+"&uri="+location.href;
		
					//	st="<img src='"; 
					//	mi="http://localhost/lasvegas_cakephp/data.php?"+ passData; 
				//		en="' alt='' border='0' width='0' height='0'>";
				//		document.write(st+mi+en);
	
	 jQuery.ajax({
            type : "POST",
            url:"/visitors/visitortraking",
            data:passData,
            success: function(data){
//				alert(data);
	 		},
            complete:function(){
				// alert('ok');				            
		}
        });
 });

