$(document).ready(function() {
    $("#under-right p").remove();
    $("#jswarning").remove();
    $("#under-right h3").removeClass("left");
    $("#under-right a").click(function(event) {
        $("#under-right a").removeClass("selected");
        $(this).addClass("selected");
        var nameTo = $(this).attr("name");
        event.preventDefault();
        changeText();
        $("#side").show("fast").find("p").hide().end().find("#"+nameTo).show().end().find(".sideClose").show().click(function(event) {
            $("#side").hide("fast");
            $("#under-right a").removeClass("selected")
            $(".sel").remove();
            event.preventDefault();
            $("#changeThis").stop(true);
        });
    });
    
    
    var smartass = new Array("tries and mostly fails to learn the ukulele.",
                              "goes about wearing a scarf that is sadly more Harry Potter than Dr Who.",
                              "enjoys the odd bottle of fine ale.",
                              "daydreams about having a cat.",
                              "ruthlessly kills houseplants. (Even cacti!)",
                              "listens to overly weird and/or noisy music.",
                              "really really likes <a href='http://podskok.com/owlforafiver'>drawing owls</a>.",
                              "comes up with weird board game concepts.",
                              "takes up your bandwidth with silly jokes.",
                              "writes fun stories about grim things."
                              );
    var count = 0;
    function changeText() {
      $("#changeThis").hide(300, function(){
        $(this).html(smartass[count]);
        $(this).show(300);
        
        count = (count < smartass.length)? (count+1) : 0;
        $(this).delay(4000).queue(function() {
          changeText();
          $(this).dequeue();
        });

      });
    }
    
});

