/*
	In here:
	- vertical slide for link (i.e. as with More Info link)
	- Ajax img retrieval for thumbnails
	- Moognify on images onclick
	
	Axed: accordion menus, image zoom _ wheelup/down custom events
*/

var portfolioFx = {

	// vertical slide for descriptions when More Info link is clicked
	makeDetailSlide: function(){
		var detailSlide =  new Fx.Slide('dd').hide();

		// make a.details show .dd when clicked
		$('details').addEvent('click', function(e){
			e = new Event(e);
			var elem = $('details');
			if(elem.getText() == "More Info »") {
				elem.setText("« Less Info");				
			} else {
				elem.setText("More Info »");
			}
			detailSlide.toggle();
			e.stop();
		});
	},
	imgToolTips: function() {
		$$('#thumbs').getElements('img').each(function(img){
			var tooltip = new Tips(img);
		});
	},
	// get thumbnail screenshots w/o reloading the pg
	imgGetNext: function() {
		$$('#thumbs').each(function(elem){
			var lnks = elem.getElements('a');
			lnks.each(function(lnk){
					lnk.addEvent('click', function(e){
					var url = lnk.getProperty('href');
					var event = new Event(e).stop();
					new Ajax(url, {
									method: 'get',
									update: $('thumbs'),
									evalScripts: true
					}).request();
				}.bind(this));			
			}, this);
		}, this);
	},
	init: function() {
		this.makeDetailSlide();
		this.imgToolTips();
		this.imgGetNext();
	}

};
