jQuery(function($) {

        $('.hover_show:empty').parent('.smalltext').hide(); // Fixes little bug

        // Make whole side nav li clickable
        $(".sidenav li").css('cursor','pointer').click(function(){ // set cursor to pointer and on click
                 window.location=$(this).find("a").attr("href"); // Give the li the a's href
                 return false; // Stop default action
        });

        // Animate drop down menu
        if ( !$.browser.msie && !$.browser.opera && jDropDown == 'y') { // If not IE or Opera
                $('.sidenav li ul').hide(); // Stop the dropdown from showing
                $('.sidenav li').stop().hover(function() { // When hover menu item
                        $(this).children('ul').slideDown('slow'); // Slide down drop down menu
                }, function() { // When hover off menu item
                        $(this).children('ul').slideUp('slow'); // Slide up drop down menu
                });
        }

        // Get tweets for footer
        if (twitterName !== '') {
                $.getJSON( // Pull tweets
                        'http://search.twitter.com/search.json?callback=?&rpp=4&q=from:' + twitterName, // Pull tweets url
                        function(data) {
                                $.each(data, function(i, tweets) { // for each tweet
                                        for(var num = 0; num < tweets.length; num++) { // If tweet is not empty
                                                if(tweets[num].text !== undefined) { // If tweet is defined
                                                        $('ul#twitter').append('<li><div><a href="http://twitter.com/' + twitterName + '"><img width="33" style="margin-right:5px;" align="left" src="' + tweets[num].profile_image_url + '">' + tweets[num].text + '</a></div><span> ' + tweets[num].from_user + '</span></li>'); // Show tweet
                                                }
                                        }
                                });
                        }
                );
        }

});

