// complex functions are part of msgs, below

var Rules = {

	// Show us stuff that we've hidden from non-JS users
	'.show' : function(element) {
		Element.show(element);
	}
,
	// Hide stuff that non-JS users will always see
	'.hide' : function(element) {
		Element.hide(element);
	}
,
	// Popup windows
	'a.popup:click' : function(element){
	
		// Only do popup if window size is big enough.
		if ( screen.width > 800 && screen.height > 600 ) {
			element.href = '#';
			popupurl = element.rel+'/popup/';
			msgs.popup.open({url:popupurl});
			return false;
		}
	}
}

var msgs = {
	popup: {
		open: function(options) {
			this.options = {
				url: '#',
				width: 800,
				height: 600,
				scrollbars: 1
			}
			Object.extend(this.options, options || {});
			window.open(this.options.url, 'popup', 'width='+this.options.width+',height='+this.options.height+',scrollbars='+this.options.scrollbars);
			if (window.focus) {newwindow.focus()}
		}
	}
}
