var CatalogFront = {
 
 idProduct : null,
 scrollerOptions : {
 next: '.images-scroller-right', 
 prev: '.images-scroller-left',
 interval: 4000,
 loop: true, 
 speed: 600,
 size: 3
 },
 
 init : function() {
 
 $('.display-more').click(function() {
 var idString = 'subcategory_' + $(this).attr('rel');
 if( $('#' + idString ).length > 0 ) {
 $('#' + idString ).fadeIn(500);
 return false;
 }
 });
 
 $('.images-scroller-content').scrollable(this.scrollerOptions);
 
 $('.images-scroller-content .items div').click(function() {
 $('#main_image img').attr('src', $(this).attr('rel') );
 });
 
 $('#main_image').click(function() {
 var bigUrl = $(this).find('img').eq(0).attr('src');
 bigUrl = bigUrl.split('detail').join('origin');
 Core.Modal.image(bigUrl);
 });

 /*$('#get_quote_button').click(function() {
 CatalogFront.getQuote();
 });*/
 
 $('.catalog-sidebar')
 .find('li.level-0 a').click(function() {
 var id = $(this).parent('li').eq(0).attr('rel');
 $('li.level-1[rel="' + id + '"]').fadeIn(500);
 $('li.level-1[rel!="' + id + '"]').fadeOut(50);
 return false;
 });
 
 },
 
 getQuote : function() {
 Core.Modal.open({
 ajax : {
 url:Core.getUrl('catalog/product/quote/id/' + CatalogFront.idProduct )
 }
 });
 },
 
 goToDescription : function() {
 $.scrollTo('.product-box-description', 800);
 },
 
 goToComments : function() {
 $.scrollTo('.product-box-comments', 800);
 }
 
};
Core.registerPlugin( CatalogFront );
