var myrules = {
	'#eCard_tab' : function(element){
		element.onclick = function(){
			toggleTab($('eCard_box'),$('eCard_tab'));
		}
	},
	'#giclee_tab' : function(element){
		element.onclick = function(){
			toggleTab($('giclee_box'),$('giclee_tab'));
		}
	},
	'#orig_tab' : function(element){
		element.onclick = function(){
			toggleTab($('orig_box'),$('orig_tab'));
		}
	},
	'.back' : function(element){
		if (element){
			var newa = document.createElement('a');
			newa.setAttribute('href','#');
			newa.setAttribute('title','back to previous page');
			newa.appendChild(document.createTextNode('< back'));
			newa.onclick = function(){history.back();return false;}
			element.appendChild(newa,element.firstChild);
		}
	}
};

Behaviour.register(myrules);



// Now some load events...

Behaviour.addLoadEvent(function(){
	if (document.location.hash != "#eCard_edit") { // close the eCard tab if no URL hash
		setTab($('eCard_box'),$('eCard_tab'),'closed');
	}
});


