﻿//JQuery scripts
$(document).ready(function(){

    //this is the script that handles swapping lists in recipe finder module
    $('.recipe-finder .categories a').each(function(){
        
        $(this).click(function(){
	        $('.recipe-finder .categories a').removeClass('selected');
        	$(this).addClass('selected');
            
            var listname = $(this).attr('rel');
            
            //hide all tabs first
            $('.recipe-finder div').hide();
        
            $('div#' + listname + '-list').show();
    
        });
        
    });
    
        //this is the script that handles swapping lists in recipe toggle module
    $('#recipe-toggle .categories a').each(function(){
        
        $(this).click(function(){
	        $('#recipe-toggle .categories a').removeClass('selected');
        	$(this).addClass('selected');
            
            var listname = $(this).attr('rel');
            
            //hide all tabs first
            $('#recipe-toggle div').hide();
        
            $('div#' + listname + '-list').show();
    
        });
        
    });
	
	     //this is the script that handles swapping content on CYOM My Favorites display view
    $('.cyom .tabs a').each(function(){
        
        $(this).click(function(){
	        $('.cyom .tabs a').removeClass('selected');
        	$(this).addClass('selected');
            
            var listname = $(this).attr('rel');
            
            //hide all tabs first
            $('#menu-sections div#courses').hide();
			$('#menu-sections div#shopping-list').hide();
            $('#menu-sections div#instructions').hide();

            $('div#' + listname).show();
			//$('.cyom .print-type').html('<link rel="stylesheet" href="/styles/myfinecooking_shoplist_print.css" media="print" />');
    
        });
        
    });
   
});