window.addEvent('domready', function() {	
	
	var catsBox = $('cats_box');
	catsBox.setStyle('opacity',0);	
	
	var myItems = $$('.pic');
	var picHolder = $('pic_box');
	
	var catItems = $$('#cats_box li');
	
	myItems.each(function(e){
		e.setStyle('opacity', 0);			    
	});
	
	catItems.each(function(e){
		e.set('morph', {duration: 250, ease: 'linear'});
		
		e.addEvents({
			'mouseenter': function(e){
				this.morph({'opacity':.65});
			}.bind(e),
			
			'mouseleave': function(e){
				this.morph({'opacity':1});
			}.bind(e),
			
			'click': function(e){
				//alert("thisURL: " + thisURL);
				location.href = thisURL;
			}
			
		});
		
	});
		
	
	
	
	//fade in
	var showIt = function(el){ 
		
		var fade_in = new Fx.Morph(el, {
			     duration: 1000, 
			     transition: Fx.Transitions.Cubic.easeOut, 
			     link: 'ignore'
		});
		
		fade_in.start({
		'opacity': 1
		});
		
	};
	
	//showIt.delay(20, null, heading);
	//showIt.delay(350, null, imgFurn);
	//showIt.delay(350, null, labelFurn);
	showIt.delay(100, null, catsBox);
	
	
	var myImages = new Asset.images(theImages, {
		
		onComplete: function(){
			var mySlider = new Showcase({
				slideTimer: 6000, 
				items: myItems,
				rightBox: $('right_pane'),
				initBox: picHolder
			});
			mySlider.start();
		}
		
	 });
	
});
