function pre_expand(e)
{
	var targ, root;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3)
	{
		targ = targ.parentNode;
	}

	if(targ.parentNode) root = targ.parentNode;
	else if(targ.parentElement) root = targ.parentElement;

	if (!root.style.overflow || root.style.overflow == "auto")
	{
		targ.innerText = "Contract «";
		root.style.overflow = "visible";
		root.style.width = "100%";
	}
	else
	{
		targ.innerText = "Expand »";
		root.style.overflow = "auto";
		root.style.width = "600px";
	}
}

function bugConfirm( mid )
{
	if( confirm( 'Are you sure you want to flag this message as a bug?' ) )
	{
		my_title = prompt( 'Please enter a name for this bug.' );
		my_priority = prompt( 'Please enter a numerical priority level for this bug.' );
		return_url = window.location.href;
		
		window.location.href = "/bug/new_bug.php?mid="+mid+"&name="+my_title+"&priority="+my_priority+"&return="+return_url;
	}
}