﻿
// PFP namespace
if (typeof (PFP) == "undefined") {
    var PFP = { };
}

// Create a namespace for recipes
if (typeof (PFP.Recipe) == "undefined") {
    PFP.Recipe = {
        visibleRecipe: 1
    };
}

$j(document).ready(function() {
    $j('.other-recipes a:first').attr('class', 'selected');
    $j('.other-recipes a').click(function(e) {
        PFP.Recipe.visibleRecipe = Number($j(this).attr('id').substr(5, 1));
        $j('.other-recipes a').attr('class', '');
        $j(this).attr('class', 'selected');

        // Hide recipe content for other recipes and show the current recipe content
        $j('.recipe-content .recipe').hide();
        $j('.recipe-content #recipe' + PFP.Recipe.visibleRecipe).show();

        // Same thing for large image
        $j('.eat-better-content .recipe-main-image').hide();
        $j('.eat-better-content #main' + PFP.Recipe.visibleRecipe).show();

        return false;
    });
});