// JavaScript Document
// Use with Mootools

window.onload = function() {
	$$(".fade").forEach(function(element){
		
		element.style.width = element.firstChild.clientWidth;
		element.style.height = element.firstChild.clientHeight;
		
		element.firstChild.opacity = 1;
		element.style.background = "url("+element.firstChild.src.replace("-off","-on")+") no-repeat";
		
		var myFx;
		
		element.onmouseover =  function(){
			
			if(typeof myFx != 'undefined')
			{	myFx.stop();
			}
			myFx = new Fx.Style(element.firstChild, 'opacity').start(element.firstChild.opacity,0);
    	}
	
		element.onmouseout =  function(){
	
			if(typeof myFx != 'undefined')
			{	myFx.stop();
			}
			myFx = new Fx.Style(element.firstChild, 'opacity').start(element.firstChild.opacity,1);
    	}
  });
	//here
	$$('a.disjointed').forEach(function(el) {
    	
		el.onmouseover = function() {
        	$(el.id + '-show').toggleClass('show');
			
    	};
		
		el.onmouseout = function() {
        	$(el.id + '-show').removeClass('show');
			
    	};
	
	});	
};



	
	
	
	/*
	showHide = new Fx.Style('whatever', 'opacity', {duration: 500});
	//add click events
	$('showIt').addEvent('onmouseover', function(){
		showHide.start(1);
	});
	$('hideIt').addEvent('onmouseout', function(){
		showHide.start(0);
	});
	*/



