$(function(){

    $(".tabs").tabs(".panes > .pane");

    $(".contacts-title").click(function(){

//        if($(this).hasClass("icon_active")){
//
//            $(this).removeClass("icon_active");
//            $(this).next(".contacts-description").hide();
//        }
//        else {
            $(".contacts-title").removeClass("icon_active");
            $(".contacts-description").hide();

            $(this).addClass("icon_active");
            $(this).next(".contacts-description").show();
//        }

        return false;
    });
	
	$('.also-bought-title').hover(
        function() {
            $(this).css({'height':'auto', 'paddingBottom':'5px'});
        },
        function(){
            $(this).css({'height':'36px', 'paddingBottom':0});
        }
    );
	
	$('.also-bought-title a').each(function(){
		
		if($(this).height() > 36) {
			
			$(this).next().show();
		}
	});

    $('.expand-title').click(function(){

        $(this).toggleClass('icon_active');
        $(this).nextAll('.expand-content').toggle();

        return false;
    });

    $('.fancybox').fancybox();

    $('.slideshow-container').cycle({
        prev: '.slideshow-controls-prev',
        next: '.slideshow-controls-next',
        cleartypeNoBg: true,
        timeout: 0
    });
	
	
	$('.div2 table').each(function(){
		width = $(this).width() + 2;
		
		$(this).parent().width(width).parent().prev().children().width(width);
	});
	
	$(".wrapper1").scroll(function(){
		$(".wrapper2")
			.scrollLeft($(".wrapper1").scrollLeft());
	});
	
	$(".wrapper2").scroll(function(){
		$(".wrapper1")
			.scrollLeft($(".wrapper2").scrollLeft());
	});
	
		$("a[rel=example_group]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over'
	});
})
