// FPD Javascript Library

function debug(str)
{
	el = $('debug');
	if (el) {
		el.innerHTML = el.innerHTML + str + "<br/>";		
	}	
};

var Interface = {
	definePanelToggle: function(hide, show, body) {
		this.disableSelection(hide);
		this.disableSelection(show);
		Event.observe(hide, "click", function() {
			$(hide).hide();
			$(show).show();
			$(body).hide();
		});
		Event.observe(show, "click", function() {
			$(hide).show();
			$(show).hide();
			$(body).show();
		});
	},

	disableSelection: function(el, replacement_cursor) {
		el = $(el);
	    el.onselectstart = function() {
	        return false;
	    };
	    el.unselectable = "on";
	    el.style.MozUserSelect = "none";
	    if (!replacement_cursor) el.style.cursor = replacement_cursor;
	},
	
	dismissMessage: function(el) {
		$(el).hide();
	}
};

