function addEvent_(o, e, f)
{
	if(typeof(o.addEventListener) != 'undefined') o.addEventListener(e, f, false);
	else if(typeof(o.attachEvent) != 'undefined') o.attachEvent('on' + e, f); 
}

function remove(o, e, f)
{
	if(o.removeEventListener) o.removeEventListener(e, f, false);
	else if(o.detachEvent) o.detachEvent('on'+e, f);
}

function trim(string)
{
	for(var i = 0; i < string.length; i++)
	{
		if(string.charAt(i) != ' ' && string.charAt(i) != '\\n' && string.charAt(i) != '\\t' && string.charAt(i) != '\\r')
		{
			string = string.substring(i, string.length);
			break;
		}
	}
	for(var i = string.length-1; i >= 0; i--)
	{
		if(string.charAt(i) != ' ' && string.charAt(i) != '\\n' && string.charAt(i) != '\\t' && string.charAt(i) != '\\r')
		{
			string = string.substring(0, i+1);
			break;
		}
	}
	return string;
}

