$(function(){
		
	var minHeight = 113;
	var maxHeight = 320;
	
	var arrColours = new Array();
	var animating = new Array();
	
	arrColours['dd_wine_cat_3'] = '#d79595';
	arrColours['dd_wine_cat_2'] = '#b8b8a5';
	arrColours['dd_wine_cat_1'] = '#927184';
	arrColours['dd_wine_cat_4'] = '#d7c797';
	
	animating['dd_wine_cat_1'] = false;
	animating['dd_wine_cat_2'] = false;
	animating['dd_wine_cat_4'] = false;
	animating['dd_wine_cat_3'] = false;
	
	$('a.drop_down_container').mouseover(function(){
		
		$('a.drop_down_container').not($(this)).each(function(){
			$(this).trigger('mouseout');
		});
		
		//var type = $(this).attr('id').replace('dd_','');
		var type = $(this).attr('id');
		
		if($(this).height() == minHeight && animating[type] == false){
			animating[type] = true;
			$(this).animate({height:maxHeight,backgroundColor:arrColours[type]},200,function(){
				animating[type] = false;
			});
		}
		
	}).mouseout(function(){
		
		var type = $(this).attr('id').replace('dd_','');
		
		if($(this).height() > minHeight){
			
			animating[type] = true;
			$(this).animate({height:minHeight,backgroundColor:'#fff'},200,function(){
				animating[type] = false;
			});
		}
		
	}).click(function(){
		$(this).stop();
	});
	
	var xpos;
	var ypos;
	
	$().mousemove(function(e){
     	xpos = e.pageX; 
     	ypos = e.pageY;
   	}); 

   	setInterval(function(e){
		
   		if((xpos < 890 || xpos > 1130) || ypos > 300){
			$('a.drop_down_container').each(function(){
				$(this).trigger('mouseout');
			});
		}
	
		
	},2000);
	
	
	$('.cycle').cycle({
		fx:		'fade',
		speed:	1000,
		timeout:0,
		next:	'#gallery_next',
		prev:	'#gallery_prev'
	}).css('display','block');
   
	
	$('img.gallery_button').mouseover(function(){
		$(this).attr('src',$(this).attr('src').replace('1.png','2.png'));
	}).mouseout(function(){
		$(this).attr('src',$(this).attr('src').replace('2.png','1.png'));
	});
		
	
	$('a.gallery').lightBox({
		fixedNavigation: true
	});
	
});

