function applystatustext()
{
	if(document.addEventListener) { document.addEventListener("mousemove", function(event) { showstatustext(event.target); }, false); }
	if(document.attachEvent) { document.attachEvent("onmousemove", function() { showstatustext(window.event.srcElement); }); }
}

function statustext(obj)
{
	if (obj.onclick || obj.onchange)
	{
		if(obj.addEventListener) { obj.addEventListener("mousemove", function() { showstatustext(obj); }, false); }
		if(obj.attachEvent) { obj.attachEvent("onmousemove", function() { showstatustext(obj); }); }

		if(obj.addEventListener) { obj.addEventListener("mouseout", function() { window.status=''; }, false); }
		if(obj.attachEvent) { obj.attachEvent("onmouseout", function() { window.status=''; }); }	
	}
}
if(window.addEventListener) { window.addEventListener("load", applystatustext, false); }
if(window.attachEvent) { window.attachEvent("onload", applystatustext ); }

function showstatustext(obj)
{
	
	var statustext = "";
	// check for onclick
	if (obj.onclick)
	{
		onclicktext = ""+obj.onclick;
		onclicktext = onclicktext.split("\n");
		onclicktext.pop();
		onclicktext.shift();
		for(index in onclicktext)
		{
			onclicktext[index] = onclicktext[index].replace(/[\s]+$/,'').replace(/^[\s]+/,'');
		}
		onclicktext = onclicktext.join('');
		onclicktext = "onclick:"+onclicktext;
		statustext += onclicktext;
	}
	// check for onchange
	if (obj.onchange)
	{
		onchangetext = ""+obj.onchange;
		onchangetext = onchangetext.split("\n");
		onchangetext.pop();
		onchangetext.shift();
		for(index in onchangetext)
		{
			onchangetext[index] = onchangetext[index].replace(/[\s]+$/,'').replace(/^[\s]+/,'');
		}
		onchangetext = onchangetext.join('');
		onchangetext = "onchange:"+onchangetext;
		statustext += onchangetext;
	}
	if (obj.type=="submit")
	{
		typesubmittext = "type:submit";
		statustext += typesubmittext;
	}
	
	var parent = obj.parentNode;
	while(parent!=null && parent!=document.body)
	{
		if (typeof(parent.tagName)!="undefined" && (parent.tagName+"")	.toLowerCase()=="a")
		{
			if (parent.onclick)
			{
				onclicktext = ""+parent.onclick;
				onclicktext = onclicktext.split("\n");
				onclicktext.pop();
				onclicktext.shift();
				for(index in onclicktext)
				{
					onclicktext[index] = onclicktext[index].replace(/[\s]+$/,'').replace(/^[\s]+/,'');
				}
				onclicktext = onclicktext.join('');
				onclicktext = "onclick:"+onclicktext;
				statustext += onclicktext;
			}	
			if (parent.href)
			{
				hreftext = "href:"+parent.href;
				statustext += hreftext;
			}		
		}
		parent = parent.parentNode;
	}
	if (window.status != statustext)
	{
		window.status = statustext;
	}
	//obj.onmouseout = function() { window.status=''; }
}
