utilities = { /* funzioni di appoggio */

	stopDefaultAction:function(event)
	{
		event.returnValue = false;
		
		if (typeof event.preventDefault != "undefined")
		{
			event.preventDefault();
		}
	},
	
	attachEventListener:function(eventType, target, functionRef, capture)
	{
		if (typeof target.addEventListener != "undefined")
		{
			target.addEventListener(eventType, functionRef, capture);
		}
		else if (typeof target.attachEvent != "undefined")
		{
			target.attachEvent("on" + eventType, functionRef)
		}
		else
		{
			eventType = "on" + eventType;
			
			if (typeof target[eventType] == "function")
			{
				var oldListener = target[eventType];
				
				target[eventType] = function()
				{
					oldListener();
					return functionRef();
				};
								
			}
			else
			{
				target[eventType] = functionRef;
			}
		}
	},

	addLoadListener:function(functionRef)
	{
	  if (typeof window.addEventListener != 'undefined')
	  {
		window.addEventListener('load', functionRef, false);
	  }
	  else if (typeof document.addEventListener != 'undefined')
	  {
		document.addEventListener('load', functionRef, false);
	  }
	  else if (typeof window.attachEvent != 'undefined')
	  {
		window.attachEvent('onload', functionRef);
	  }
	  else
	  {
		var oldListener = window.onload;
		if (typeof window.onload != 'function')
		{
		  window.onload = functionRef;
		}
		else
		{
		  window.onload = function()
		  {
			oldListener();
			return functionRef();
		  };
		}
	  }
	}

}