/*This function is used to add an event that triggers a function on a html element
		Example : addEvent(window, 'load', myfunction);
*/
function addEvent(obj, evType, fn)
{ 
	if (obj.addEventListener)
	{ 
		obj.addEventListener(evType, fn, false);
		return true;
	 }
	else if (obj.attachEvent)
	{ 
   		var r = obj.attachEvent("on"+evType, fn);
		return r;
	}
	else
	{ 
		return false; 
	} 
}

