// dataminer.js, käyttää jqueryä
// copy: Mikko Nieminen 2007
// copy: Kodes internetpalvelut
// All Rights Reserved

function selain() {
	// from: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
	// not mentionably modified
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return myWidth + ' | ' + myHeight;  
}

function aika() {
    var aika = new Date();
    var alku = aika.getTime();
    return alku;
}  


$(document).ready(function() {
		
	$.getJSON("http://www.kodes.fi/loki/logger.php", { reso: screen.width+"x"+screen.height, bpp: screen.colorDepth, kayttis: navigator.platform, urli: location.href }, function(data) {});
	//var aikaalku = aika();	

	$().click(function(e) {	
			$('#status').html(e.pageX+', '+e.pageY);
			//alert("x="+e.pageX+"&y="+e.pageY);			
			//var kului = (aika()-aikaalku);	
			$.getJSON("http://www.kodes.fi/loki/logger.php", { x: e.pageX, y: e.pageY, ikkuna: selain() }, function(data){ 
			//alert(data.tulos);
		  } );
		});
		
})


