var path = window.location.pathname;
	path.match("([^/]+)$");
var file = RegExp.$1;

if( !file ){ file = 'index.html'}

var swapLinks = {
	'#navbar img' : function(el){
		var origSrc=el.src;
		el.onmouseover = function(){ this.src = this.src.replace(/(-.+)*.gif$/, '-over.gif'); }
		el.onmouseout = function(){ this.src=origSrc; }
	},
	'#cartlink img' : function(el){
		var origSrc=el.src;
		el.onmouseover = function(){ this.src = this.src.replace(/(-.+)*.gif$/, '-over.gif'); }
		el.onmouseout = function(){ this.src=origSrc; }
	},
	'a' : function(el){
		var href = el.getAttribute('href', 2);
		if(href==file){
			el.className = "active";
			el.removeAttribute('href');
		}
	},
	'#navbar a.active img' : function(el){
		el.src = el.src.replace(/(-.+)*.gif$/, '-active.gif');
		el.onmouseover = '';
		el.onmouseout = '';
	}
};
Behaviour.register(swapLinks);
