// JavaScript Document
window.addEvent('domready',function(){ 
	
	//=====================================
	//==== FEATURED PRODUCTS
	
	var overFx = [];
	var underoverFx = [];
	var Mosmargin = 20;
	
	$$('#featuredPro .over').each(function(el,i){ 
		overFx[i] = new Fx.Morph(el, {duration:300, wait:false,transition:Fx.Transitions.Expo.easeOut}).set({'opacity':0, 'background-color': '#000'})
	});
	
	$$('#featuredPro .underover').each(function(el,i){ 
		el.addEvent('click',function(e){ 
			document.location.href=el.getNext().get('href'); 
		}); 
		underoverFx[i] = new Fx.Morph(el, {duration:300, wait:false,transition:Fx.Transitions.Expo.easeOut}).set({'opacity':0,'margin-top':Mosmargin}) 
	});
	
	$$('#featuredPro .item').each(function(el,i){
		el.addEvents({
			'mouseover':
				function(e){ 
					overFx[i].start({'opacity':0.8});
					underoverFx[i].start({'opacity':1,'margin-top':0}); 
				},
			'mouseleave':
				function(e){ 
					overFx[i].start({'opacity':0}); 
					underoverFx[i].start({'opacity':0,'margin-top':Mosmargin}); 
				}
		});
	}); 
	
	//=====================================
	//==== NEWS HOME
	
	var overNewsFx = [];
	var over2NewsFx = [];
	var overMainLinksFx = [];	
	
	$$('#news .over').each(function(el,i){
		overNewsFx[i] = new Fx.Morph(el, {duration:300, wait:false,transition:Fx.Transitions.Expo.easeOut}).set({'opacity':0.6, 'background-color': '#000'});
	});
	
	$$('#news .over2').each(function(el,i){
		over2NewsFx[i] = new Fx.Morph(el, {duration:300, wait:false,transition:Fx.Transitions.Expo.easeOut}).set({'background-color': '#242526'});
	});
	
	$$('#news .mainLink').each(function(el,i){ 
		overMainLinksFx[i] = new Fx.Morph(el, {duration:300, wait:false,transition:Fx.Transitions.Expo.easeOut}).set({'background-color': '#242526'})
	});
	
	
	$$('#news .item').each(function(el,i){
		el.addEvents({
			'mouseover':
				function(e){
					overNewsFx[i].start({'opacity':0});
					overMainLinksFx[i].start({'background-color': '#303133'}); 
				},
			'mouseleave':
				function(e){ 
					overNewsFx[i].start({'opacity':0.6});
					overMainLinksFx[i].start({'background-color': '#242526'});
				}
		});
	}); 
	
	
})
