/*
 * 
	bm_logs

 */

;(function($){
var $$;


$$ = $.fn.bm_logs = function($options) {

	// set default options
	var $defaults = {

	};
	
	// extend the options
	var $opts = $.extend($defaults, $options);
	
	// bring the options to the jquery object
	for (var i in $opts) {
		$.bm_logs[i]  = $opts[i];
	}
};


$.extend({bm_logs : {
	LOGEVENT_URL : "php/logs/logEvent.php",

	logEvent : function(piWhichAction)
	{
		try
		{
			// piWhichAction should be a valid row in the bm_actions table
			var sParams = "?action_key="+piWhichAction+"&user_key="+$.bm_users.user_key+"&login_name="+$.bm_users.login_name+"&browser="+gsBrowser;
			//$.bm_users.show_query_params=true;
			if ($.bm_users.show_query_params)winWrite("sparms products update "+$.bm_logs.LOGEVENT_URL+sParams);
			httpRequest.open("GET", $.bm_logs.LOGEVENT_URL+sParams, true);
			httpRequest.onreadystatechange = $.bm_logs.logEventHttpResponse;
			httpRequest.send(null)	
		} catch(err)
		{
			errorHandler("bm_logs.logEvent",err);
		}
	},
	logEventHttpResponse : function()
	{
		try
		{
			if (httpRequest.readyState == 4) 
			{
				var sResults = httpRequest.responseText;
				var e;
			}
		} catch(err)
		{
			errorHandler("logEventHttpResponse",err);
		}
	}
}
})

})(jQuery);
