$(document).ready(function() {

	// current menu
	// highlight tab function
	var path = location.pathname;
	var home = "/";
	$("#nav a[href='" + [path || home] + "']").parent('li').each(function() {
		$(this).addClass("current"); 
	});	

  $('.promo-box').orbit({
		animation: 'fade',       // fade, horizontal-slide, vertical-slide, horizontal-push
    animationSpeed: 800,     // how fast animtions are
    timer: true,
	  advanceSpeed: 4000, 		 // if timer is enabled, time between transitions 
    pauseOnHover: true,
		directionalNav: false,
		bullets: true
  });	

	// form transform
	$('.col_2 form').jqTransform();

	// Option href follow
	$(".category-container .jqTransformSelectWrapper ul li a").click(function(){
		var index = $(this).html();
		var value = '';
		$('.jqTransformSelectWrapper select option').each(function(){
			var i = $(this).html();
			if (index == i){
				value = $(this).attr('value');
				window.location.href=value;
			}
		});
	});

	// fancybox
	$('.show .product-image a').fancybox();
	
	$('.show .buttons a.transparent').fancybox();

	$('div.filter').hide();

	// filter toggle
	$("a.filter").click(function(){
			$('div.filter').toggle('slow');
			$(this).parent().toggleClass("open");
	});

	$('.filter .button').click(function(){
		$('.filter form').submit();
	});

});

