/* Fix non-HTML5 browsers */
document.createElement('header');
document.createElement('section');
document.createElement('nav');
document.createElement('footer');



$(function(){
    // Set up the rotation on home page =========================
    $(".scrollable")
        .scrollable({size: 3, clickable: false, keyboard: false})
        //.autoscroll({autoplay: true, interval: 7000, steps: 1})
        .circular();
        
	// disable selection bug in home page promotions
    $.extend($.fn.disableTextSelect = function() {
        return this.each(function(){
            if($.browser.mozilla){//Firefox
                $(this).css('MozUserSelect','none');
            }else if($.browser.msie){//IE
                $(this).bind('selectstart',function(){return false;});
            }else{//Opera, etc.
                $(this).mousedown(function(){return false;});
            }
        });
    });
    $('#scrollbox').disableTextSelect();
    
    // Allows social footer icons to be clickable =================
    $('#foot-nav li em').click(function(){
        $(window.location).attr('href', $(this).next().attr("href"));
    });
    
	// About page scrolling images
    $('#slider').nivoSlider({
        directionNav: false,
        controlNav: false,
        pauseTime: 4000,
        keyboardNav: false
    });
    
	// home page scrolling images
    $('#home_slider').nivoSlider({
        directionNav: true,
        controlNav: false,
        pauseTime: 4000,
        keyboardNav: false,
        effect: 'fade'
    });
    
	// comment toggle functionality
    $('.commentlist').css('display', 'none');
    $('#comments').hover(function(){
        $(this).css('cursor', 'pointer');
    });
    $('#comments').click(function(){
        $('.commentlist').toggle("slow");
    });
    
	// make post headings clickable
    $('.post>h2').click(function(){
        $(window.location).attr('href', $(this).children('a').attr("href"));
    });
});