$(document).ready(function() { 
		
	$(".selectors").hide(); //Hide all content
	$(".pmnav ul li:first").addClass("active").show(); //Activate first tab
	$(".selectors:first").show(); //Show first tab content

	//Tab Navigation
	$(".pmnav ul li").click(function() {

		$(".pmnav ul li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".selectors").hide(); //Hide all tab content
		$(".products li").hide(); //Hide all tab content
		
		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
	    $('#pmcontainer li ul li').removeClass("current");
		return false;
	});
	
	$('.products li').hide();
	$('#pmcontainer li ul li').click(function(e){
	    e.preventDefault();
	    $('.products li').hide();
	    	var classes = $(this).attr('class').split(' ');
				$.each(classes, function() {
	        $('.products li.' + this).fadeIn("slow");
	    });
	    $('#pmcontainer li ul li').removeClass("current");
	    $(this).addClass("current");
	});
	

/*
	$("ul.qatips li a").hover(function() {
        $(this).siblings("div").stop()
        .show()
        .css("display","block");

    	}, function() {
        $(this).siblings("div").stop()
        .hide();
    });
*/


    $(".tooltip").hover(function() {
        $(this).next("div").stop()
        .show()
        .css("display","block");

    	},
    function() {
        $(this).next("div").stop()
        .fadeOut();
    	});
    	
	$.pricemap = {
	    '0' : $([]),
	    'High' : $('.products .ps10'),
	    'Top' : $('.products .a12'),
	    'Mid' : $('.products .b8f, .products .b12r'),
	    'Low' : $('.products .c2, .products .d145')
	  };
	
	  $('.pricefilter').change(function() {
	    // hide all
	    $.each($.pricemap, function() { this.hide(); });
	    // show current
	    $.pricemap[$(this).val()].show();
	  });
	

});


