/*
	document.observe("dom:loaded", function() {

		$$('input[defValue]').each( function( element ) {
			!element.getValue()?element.setValue(element.readAttribute('defValue')):'';
			element.observe('focus', function() { this.getValue()==this.readAttribute('defValue')?this.setValue(''):''});
			element.observe('blur', function() {!this.getValue()?this.setValue(this.readAttribute('defValue')):''});
			element.up('form').observe('submit', function(item, event) {item.getValue()==item.readAttribute('defValue')?item.setValue(''):'';}.curry(element));
		});
		
	});
*/
	
	function mbbutton(title, url, width)
	{
		this.title = title;
		this.url = url;
		this.width = width;
	}

	function easyMessageBox(message, buttons)
	{
		var text = message + "<div style='clear:both;'></div><br>";
		for( var x=0; x < buttons.length; x++ )
		{
			button = buttons[x];
			if( button.url != "" )
			{
				text = text + ("<a href=\"" + button.url + "\" onClick=\"mbClose();\" style='float:left;margin-left:10px;width:" + button.width + "px;'><div class=\"mbbutton\">" + button.title + "</div></a>");
			}
			else
			{
				text = text + ("<a href=\"javascript:;\" onClick=\"mbClose();\" style='float:left;margin-left:10px;width:" + button.width + "px;'><div class=\"mbbutton\">" + button.title + "</div></a>");
			}
		}
		messageBox(text);
	}

	function messageBox(text)
	{
		obj = document.getElementById("messageboxcontent");
		if( obj )
		{
			obj.innerHTML = text;
			obj = document.getElementById("messagebox");
			if( obj )
			{
				obj.style.display="block";
			}
		}
	}
	function mbClose()
	{
		obj = document.getElementById("messagebox");
		if( obj )
		{
			obj.style.display="none";
		}
	}
