
var GAMES = ["nes", "gba", "psx", "wsc", "psp"];
var options = {path: "/"}
function showhide(el) {
    var ul   = $( "ul", $(el).parent() );
    var game = $(ul).attr("id");
    var c    = $.cookie(game);
    if(c == "show") {
        $.cookie(game, "hide", options);
        $(ul).hide();
    } else {
        $.cookie(game, "show", options);
        $(ul).show();
    }
}

$(document).ready(function() {
    $.each(GAMES, function() {
        var game = this + "collapse";
        var ul   = "ul#" + game;
        $(ul).hide();

        var c = $.cookie(game);
        if(c == "show") {
            $(ul).show();
        } else {
            $.cookie(game, "hide", options);
            $(ul).hide();
        }
        });
    $("input#foo").focus(function(){
            if($(this).val() == "<= Follow these directions") {
                $(this).val('');
            }
        });
    $("input#foo").blur(function() {
            if($(this).val() == "") {
                $(this).val("<= Follow these directions");
            }
        });
    $("h1.collapse").click(function() {showhide(this)});
});

