  jQuery.noConflict();

jQuery.fn.slidinateIt = function() {
	parentUl = jQuery(this[0]).parent();
	if(jQuery(this[0]).hasClass("active")) {
		window.location.href = jQuery(this).find(".category-slider-link").attr("href");
	}
	parentUl.find("li.active").removeClass("active");
	jQuery(this[0]).addClass("active");
}

jQuery.fn.slidinate = function() {
	jQuery(this).each(function() {
		jQuery(this).children("li").each(function() {
			jQuery(this).click(function() { jQuery(this).slidinateIt() });
		});
	});
}

jQuery.fn.expandatron = function() {
	jQuery(this).each(function() {
		jQuery(this).toggle(function() {
			jQuery(this).next().show();
			jQuery(this).html("hide all");
		}, function() {
			jQuery(this).next().hide();
			jQuery(this).html("show all");
		});
	});
}

jQuery(document).ready(function(){
	
	jQuery(".video-cat-slider").slidinate();
	jQuery(".showall").expandatron();
	
	if(jQuery("#video-single-slider").length){
	
		jQuery("#video-single-slider").easySlider({
  		auto: true,
  		continuous: true,
  		pause:7000,
  		nextId: "slider1next",
  		prevId: "slider1prev"
  	});

	  
	}
	if(jQuery("#expand-cat").length) {
	
	  jQuery("#expand-cat a").click(function() {
	      jQuery(this).hide();
	      jQuery("#deexpand-cat a").show();
	      jQuery(".subcategories-menu").show();
	      return false;
	  });
  	 jQuery("#deexpand-cat a").click(function() {
  	      jQuery(this).hide();
  	      jQuery("#expand-cat a").show();
  	      jQuery(".subcategories-menu").hide();
  	      return false;
  	  }); 
	}
	
});
