/* Copyright (c) 2008 Alessandro Cappellini (cappellini@econ.unito.it) 
 * GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Requires: jQuery 1.2+
 */

// ajax connections OVERRIDE

send_action = function (action,posX,posY,name,note) {
	dtNewDate = new Date();
	eventtime = dtNewDate.getTime();
  var curtime = eventtime-began_loading;  
  $.post("ajax/act.php",{time: curtime, action: action, posX: posX, posY: posY, name:name, note: note});
}


// ------------------------------------------------------------------------//
// ajax connection OVERRIDE

done_loading = function () {
var text ={ loadTime: ((new Date()).getTime() - began_loading) , appName: navigator.appName, userAgent: navigator.userAgent, language:navigator.language, appVersion: navigator.appVersion, appCodeName: navigator.appCodeName, platform: navigator.platform, innerHeight: window.innerHeight, innerWidth: window.innerWidth, outerHeight: window.outerHeight, outerWidth: window.outerWidth, colorDepth: window.screen.colorDepth, pixelDepth: window.screen.pixelDepth, height: window.screen.height, width: window.screen.width, availHeight: window.screen.availHeight, availWidth: window.screen.availWidth, docHeight: document.height, docWidth: document.width}

$.post("ajax/access.php",text);
}

// ------------------------------------------------------------------------//
// ON ELEMENT - ajax connections OVERRIDE

sendActionOnElement =function (action,posX,posY,note,name) {
	dtNewDate = new Date();
	eventtime = dtNewDate.getTime();
  var curtime = eventtime-began_loading;  

$.post("ajax/actOnElement.php",{time: curtime, action: action, posX: posX, posY: posY, note:note,name: name});

}


