var menu_highlighter = {
  shadow : ['#DDA5A5','#CE8282','#C46C6C','#8C3637','#8C3637'],
  size : ['1.2em','1.05em','1.02em','1em','1em'],
  decorate: function(element,index){
    
    var that = this;        
    element.select('a').each(function(e){   
      if( that.shadow.length <= index ){
        e.style.color = '#8C3637';
        e.style.fontSize = '1em';
      }else{
        e.style.color = that.shadow[index];
        e.style.fontSize = that.size[index];
      }
    });
  },
  higlight : function(element){
    var that = this;
    var down = 0;
    var up = 0;
    if(  element != undefined) {
      element.select('a').each(function(e){
        e.style.color = 'white';
        e.style.fontSize = '1.2em';
      });
      element.nextSiblings().each(function(e){
        if( e.classNames() == 'product_link' ){
          that.decorate(e,down);
          down++;
        }
      });
      element.previousSiblings().each(function(e){
        if( e.classNames() == 'product_link' ){
          that.decorate(e,up);        
          up++;       
        }
      });
    }
},
init : function(){
  
if( $('product_link_container') != undefined ){
$('product_link_container').style.height = '150px';
$('product_link_container').style.overflow= 'hidden';

if( $('active_product') != undefined ){
  menu_highlighter.higlight($('active_product'));
  $('product_link_container').scrollTop = ($('active_product').offsetTop - 142);
}

$('product_link_container').select('.product_link').each(function(e){
  Event.observe(e,'mouseover', function(e){
    menu_highlighter.higlight(this);

    if( this.viewportOffset().top > 290 && this.nextSiblings().length > 0){
      $('product_link_container').scrollTop = $('product_link_container').scrollTop + 13;
    }
    if( this.viewportOffset().top < 290 && this.previousSiblings().length > 0){
      $('product_link_container').scrollTop = $('product_link_container').scrollTop -  13;
    }
  });
});

Event.observe('nav_left','mouseout', function(e){
  if( e.target ==  e.currentTarget && $('active_product') != undefined  ){
    menu_highlighter.higlight($('active_product'));
    $('product_link_container').scrollTop = ($('active_product').offsetTop - 142);
  }  
});
}
}
};

var image_big = {
  show : function(element,height){  
    new Effect.Morph(element, { style: 'height:'+height+'px; top: -'+(height-58)+'px;', duration: 0.1 });
  },
  hide : function(element){
    new Effect.Morph(element, { style: 'height:58px; top: 0px;', duration: 0.7 });
    
  }  
};
