$(function() {
    $('#holder').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 0,
        pager:  '#gallery ul',
        pagerAnchorBuilder: function(idx, slide) {
            return '#gallery ul li:eq(' + (idx) + ') a';
        }
    });
    
	if ($('#headlines').length > 0){
		$('#headlines').cycle({
			timeout: 8000,
			slideExpr: 'dd',
			cleartype:  true,
			pauseOnPagerHover: true,
			sync: false
		});
		
  	 }
   
    $('#office').hover(
    	function(){
    		$(this).stop(true, true).animate({
    			width: 650
    		},'600').find('ul').fadeIn('600'),
    		$('#kitchen').stop(true, true).animate({
    			width: 60,
    			right: 0
    		},'600'),
    		$(this).find('div').show().css({opacity:0}).animate({opacity:.6},'600');    		
    	},
    	function(){
    		$(this).stop(true, true).animate({
    			width: 355
    		},'600').find('ul').fadeOut('600'),
    		$('#kitchen').stop(true, true).animate({
    			width: 355,
    			right: 0
    		},'600'),
    		$(this).find('div').animate({opacity:0},'600');
    	})


    $('#kitchen').hover(
    	function(){
    		$(this).stop(true, true).animate({
    			width: 650,
      			right: 0
  			},'600').find('ul').fadeIn('600'),
    		$('#office').stop(true, true).animate({
    			width: 60
    		},'600'),
    		$(this).find('div').show().css({opacity:0}).animate({opacity:.6},'600');    		
  			
    	},
    	function(){
    		$(this).stop(true, true).animate({
    			width: 355,
    			right: 0
    		},'600').find('ul').fadeOut('600'),
    		$('#office').stop(true, true).animate({
    			width: 355
    		},'600'),
    		$(this).find('div').animate({opacity:0},'600');
    	})
    

	$('.products .product').hover(
		function(){ 
			$(this).find('img').fadeTo('fast',.6);
		},
		function(){
			$(this).find('img').fadeTo('fast',1);
		}
	)   
});
