$(document).ready(function(){
	initSidebarMenu();
	
	$(".catItem a img").css('opacity','0.6');
	$(".catItem span").css('opacity','0.6');
	$(".catItem").hover(function(){
		var objHover = $(this);
		$(this).children('a').children('span').fadeOut();
		$(this).children('a').children('img.normal').stop().animate({"width": "0px"}, "slow");
		$(this).children('a').children('img.hover').css('opacity','1');
	},function(){
		$(this).children('a').children('span').fadeIn();
		$(this).children('a').children('img.normal').stop().animate({"width": "100%"}, "slow");
		$(this).children('a').children('img.hover').css('opacity','0.6');
	});
	
	
	$(".AlbumItem span").css('opacity','0.6');
	$(".AlbumItem img").css('opacity','0.8');
	$(".AlbumItem").hover(function(){
		$(this).children('a').children('span').fadeIn();
		$(this).children('a').children('img').css('opacity','1');
	},function(){
		$(this).children('a').children('span').fadeOut();
		$(this).children('a').children('img').css('opacity','0.8');
	});
	
	$("#sidebar .pro_sidebar .item").css('opacity','0.4');
	$("#sidebar .pro_sidebar .item:first").css('opacity','1');
	$("#product").html($("#sidebar .pro_sidebar .item:first").children('.pro-comment').html());
	$("#sidebar .pro_sidebar .item:first").addClass('active');
	$("#sidebar .pro_sidebar .item").click(function(){
		$("#sidebar .pro_sidebar .item").css('opacity','0.4').removeClass('active');
		$("#product").html($(this).children('.pro-comment').html());
		$(this).css('opacity','1').addClass('active');
	});
	$("img.next").live('click',function(){
		$("#sidebar .pro_sidebar .item.active").next().click();
	});
	$("img.prev").live('click',function(){
		$("#sidebar .pro_sidebar .item.active").prev().click();
	});
    
	$("a[rel*=facebox]").colorbox();
	
	$('.content')
		.not('.home')
		.not('.sales_center-representative_other')
		.not('.sales_center-home_reps')
		.not('.gallery-image_gallery')
		.not('.product-download_collection')
		.not('.gallery-bulletin')
		.not('.auction')
		.not('.product-price')
		.not('.product-price-archive')
		.not('.product-price-view')
		.children('.content_inner').jScrollPane({
			showArrows: true
		});
	
	/* The small product thumbnails scroll bar */
		if($('#product').length > 0){
			$('#sidebar .pro_sidebar.en').scrollbar({
				taille_englobe: 80,
				taille_bouton: 25,
				debug: false,
				position: 'gauche',
				pas: 10,//75
				marge_scroll_contenu: 10,//15
				largeur_scrollbar: 5//5
			});

			$('#sidebar .pro_sidebar.fa').scrollbar({
				taille_englobe: 80,
				taille_bouton: 25,
				debug: false,
				position: 'droite',
				pas: 10,//75
				marge_scroll_contenu: 10,//15
				largeur_scrollbar: 5//5
			});
		}
	/* ---------------------------------------- */
});

// This method initiates the sidebar menu
	function initSidebarMenu(){
		$("#sidebar ul.menu .children").hide();
		$('#sidebar ul.menu li').hover(function(){
			$(this).children('.children').show();
			$(this).addClass('hover');
		},function(){
			$(this).children('.children').hide();
			$(this).removeClass('hover');
		});
		
	}
// --------------------------------------
