// -----------------------------------------------------------------------------------
// 
// REQUIRES: Mootools v1.2, Moopix v2.0
//
// -----------------------------------------------------------------------------------
// --- version date: 2008.08.11 ------------------------------------------------------


window.addEvent('domready', function(){
	
	// blur all links on the page on focus to avoid dotted outlines
	$$('a').addEvent('focus', function(){ this.blur(); });
	
	// construct a menu of galleries
	buildMenu = function(id,collection){
		collection.galleries.each(function(gal,i){
			// exclude the "0" gallery, reserved for the homepage
			//if(i > 0) {
				if(i == id){ var active = "selected"; }
				var li = new Element('li').injectInside('moopix-menu');
				var link = new Element('a', { 'href': 'portfolio.php?gal='+i+'', 'class': active }).set('html', gal.title).injectInside(li);
			//}
		}.bind(this));
		
		// show & hide menu	
		 $('nav-portfolio').addEvents({
			mouseenter: function(){ this.addClass('menu'); },
			mouseleave: function(){ this.removeClass('menu'); }
		});
	}
});