jQuery.noConflict();

function shrinkMenu(obj) {
	// When the menu is hidden, change the active state
	obj.removeClass("nav-active");
	obj.css("background","url(/images/menu_plus-minus.gif) -218px 6px no-repeat");	
}

function showMenu(obj) {
	obj.addClass("nav-active");
	obj.css("background","url(/images/menu_plus-minus.gif) 4px 6px no-repeat");	
}

function imgReplace(url,title,bigurl) {
	//product_zoom.scale(0);
	jQuery("#handle").css({ left: 0 });
	jQuery(".main-product-image").attr("src",url);
	jQuery(".main-product-image").attr("title",title);
	if(jQuery("#enlarge").length) {
	  jQuery("#enlarge").attr("href",bigurl);
	  jQuery("#enlarge").attr("title",title);
	}
}



jQuery(document).ready(function(){
  /*if (jQuery("#home-slider").length) {
		jQuery("#home-slider").easySlider({
			loop: true,                           // Looping
			orientation: 'fade',                  // Fading
			autoplayDuration: 3000,               // Autoplay with 1 second intervals
			autogeneratePagination: false,         // Automatically generate pagination links
			restartDuration: 2500,                // In case of user interaction, restart the autoplay after 2.5 seconds
			pauseable: true
		});
	}
  */
  if(jQuery("#product-image-lightbox").length) {
     jQuery('#product-image-lightbox a[rel=lightbox]').lightBox();
  }
  jQuery(".block-categories li.level0 > a").click(function() {
    obj = jQuery(this);
    active_menu = obj.parent().parent().children(".active");
    
    if (!obj.parent().hasClass("active")) {
      prev_menu = active_menu.children("ul.level0");
      active_menu.removeClass("active");
      jQuery(this).next().slideDown("slow").parent().addClass("active");
      prev_menu.slideUp("slow");
    }
    
    return false;
  });
  
  jQuery(".block-categories li.level1").each( function() { if(!jQuery(this).hasClass('active')) jQuery(this).find('ul.level1').hide(); });
  
  if(jQuery("#home-slider").length) {
      //Default Action
      jQuery(".tab_content").hide(); //Hide all content
      jQuery("ul.tabs li:first").addClass("active").show(); //Activate first tab
      jQuery(".tab_content:first").show(); //Show first tab content
    
      //On Click Event
      jQuery("ul.tabs li").click(function() {
      jQuery("ul.tabs li").removeClass("active"); //Remove any "active" class
      jQuery(this).addClass("active"); //Add "active" class to selected tab
      jQuery(".tab_content").hide(); //Hide all tab content
      var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
      jQuery(activeTab).fadeIn(); //Fade in the active content
      return false;
     }); 
  }

});

