// Javascript Rules

var cprules = {
	'div#cp-bottom' : function(element) {
		// See if Control Panel is rendered or die
		cpb = $('cp-bottom');
		cpt = $('cp-top');
		if (!cpb || !cpt) { return; };
		cpt.innerHTML = cpb.innerHTML;
		cpt.style.display = 'block';
		cpb.style.display = 'none';
	},
	'div#control-panel' : function(element) {
		element.anim = new fx.Height(element, {duration: 400});
		element.anim.hide();
	},
	'div#masthead-cp' : function(element) {
		var xcControlPanel = $('control-panel');
		element.onclick = function()
		{
			xcControlPanel.anim.toggle(); 
			return false;
		}
	}
};
	
Behaviour.register(cprules);