//<SCRIPT LANGUAGE=javascript>

function add_onload(o, strFunc, is_return)
{
	var __old_onload = o.onload;
	o.onload = function()
	{
		if (__old_onload) __old_onload();

		if(is_return)
			return eval(strFunc);
		else
			eval(strFunc);
	}
}

// is_return - passing in return at the start of the string results in errors in all browsers.
// this flag allows the resulting event call to return a value to the callee
function add_onclick(o, strFunc, is_return)
{
	var __old_click = o.onclick;
	o.onclick = function()
	{
		if (__old_click) __old_click();

		if(is_return)
			return eval(strFunc);
		else
			eval(strFunc);
	}
}

function add_onerror(o, strFunc, is_return)
{
	var __old_error = o.onerror;
	o.onerror = function()
	{
		if (__old_error) __old_error();

		if(is_return)
			return eval(strFunc);
		else
			eval(strFunc);
	}
}