/* Brend Selector Zoom Effect */

jQuery(document).ready(function() {
  //move the image in pixel
  var move = -12;
  //zoom percentage, 1.2 =120%
  var zoom = 1.2;
  //On mouse over those thumbnail
  jQuery('.zitem').hover(function() {
  //Set the width and height according to the zoom percentage
    width = $('.zitem').width() * zoom;
	height = $('.zitem').height() * zoom;
    //Move and zoom the image
	jQuery(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
	//Display the caption
	jQuery(this).find('div.caption').stop(false,true).fadeIn(200);
	},
  function() {
  //Reset the image
    jQuery(this).find('img').stop(false,true).animate({'width':$('.zitem').width(), 'height':$('.zitem').height(), 'top':'0', 'left':'0'}, {duration:100});
    //Hide the caption
	jQuery(this).find('div.caption').stop(false,true).fadeOut(200);
  });
});

/* ------------------------------------------------------------------ */

/* Menu Products Fade In popup*/
jQuery(document).ready(function(){
  jQuery('.subMenu').css("zIndex","-1");
  jQuery('#trigger').mouseover(function() {
    jQuery('.subMenu').stop().animate({"opacity": "1"}, "fast");
    jQuery('.subMenu').css("zIndex","10");
  });
  jQuery('#trigger').click(function() {
    jQuery('.subMenu').stop().animate({"opacity": "1"}, "fast");
    jQuery('.subMenu').css("zIndex","10");
  });
  jQuery('.subMenu').mouseleave(function() {
    jQuery('.subMenu').stop().animate({"opacity": "0"}, "fast");
    jQuery('.subMenu').css("zIndex","-1");
  });
  jQuery('.logo').mouseover(function() {
    jQuery('.subMenu').stop().animate({"opacity": "0"}, "fast");
    jQuery('.subMenu').css("zIndex","-1");
  });
});

/* Filter menu fade popup */
jQuery(document).ready(function(){
  jQuery(".filer-list li").hide();
  jQuery(".filer-list ul").hover(
    function () {
	  jQuery(this).children("li").show('fast');
    },function(){
	  jQuery(this).children("li").hide('fast');
	});
});
jQuery(document).ready(function(){
  jQuery(".filer-list li").hide();
  jQuery(".filer-list").click(
    function () {
	  jQuery(this).children("li").show('fast');
    },function(){
	  jQuery(this).children("li").hide('fast');
	});
});


/* Anything Slider Trigger & Setup */
  jQuery(function(){
    jQuery('#slider')
      .anythingSlider({
        startStopped     : false,
        buildArrows      : false,
        buildNavigation  : true,
        width: 964,
        height: 495,
        animationTime : 1,
        pauseOnHover : true,
        delay : 15000,
        buildStartStop: true
    })
    .anythingSliderFx({
        // target the entire panel and fade will take 500ms
        '.panel' : [ 'fade', 600, 'easeInOutCirc' ]
    });
  });
  jQuery(function(){
    jQuery('#subSlider')
      .anythingSlider({
        startStopped     : true,
        buildArrows      : true,
        showMultiple     : 4,
        buildNavigation  : true,
        height: 250,
        animationTime : 800,
        buildStartStop: false,
        toggleArrows : true
    });
  });

/* Scroll to top */
  jQuery(document).ready(function() {
    jQuery('a[href=#top]').click(function(){
     jQuery('html, body').animate({scrollTop:0}, 'slow');
       return false;
    });
  });

/* brend Hover Img Swap */
  jQuery(function() {
    jQuery('.brend-link img[title]').hover(function() {
        jQuery(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('title')).attr('title', $(this).attr('tmp')).removeAttr('tmp');
    }).each(function() {
        jQuery('<img />').attr('src', $(this).attr('title'));
    });;
  });

  jQuery(document).ready(function() {
    jQuery(".white-subBut").hover(
        function () {
          jQuery(this).children(".white-subBut > span").addClass("yellow-arrow");
        },
        function () {
          jQuery(this).children(".white-subBut > span").removeClass("yellow-arrow");
        }
    );

    /*jQuery('.subdir').hide(); */

    jQuery('.white-but-prod').click(function() {
      jQuery('.subdir').slideToggle('fast', function() {
      });
    });
  });


  /* Tabed Content */
  jQuery(document).ready(function(){
    // When a link is clicked
      jQuery("a.tab").click(function () {
        // switch all tabs off

  	  jQuery(".active").removeClass("active");
        // switch this tab on
  	  jQuery(this).addClass("active");
        // slide all content up
  	  jQuery(".content").hide();
        // slide this content up
  	  var content_show = $(this).attr("title");
  	  jQuery("#"+content_show).show();
      });
    });
