$(document).ready(function(){
        
     $('#linkHeaderTitle').hide();
         
     if (window.location.hash.substring(1) == "myBlog") {
         DisplayMyBlog()
     } else if (window.location.hash.substring(1) == "myProjects") {
         DisplayMyProjects()
     } else if (window.location.hash.substring(1) == "aboutMe") {
         DisplayAboutMe()
     }
    
    $(".homePageLink").click(function(event){
       $('#linkHeaderTitle').hide();
       $('#myBlog').hide();
       $('#myProjects').hide();
       $('#aboutMe').hide();
       $('#myBlogContents').text("");
       event.preventDefault();
    });
    
    $("#aboutMeLink").click(function(event){
       DisplayAboutMe();
       event.preventDefault();
    });
    
    $("#myProjectsLink").click(function(event){
       DisplayMyProjects();
       event.preventDefault();
    });
       
           
    $("#myBlogLink").click(function(event){
     DisplayMyBlog();
     event.preventDefault();
    });
    
    });
    
    function DisplayAboutMe() {
     //window.location.replace("http://kevin.fonner.net")
       $('#myBlog').hide();
       $('#myBlogContents').text("");
       $('#myProjects').hide();
       
       $('#linkHeaderTitle').show();
       $('#aboutMe').show();
    }
    
    function DisplayMyProjects() {
     //window.location.replace("http://kevin.fonner.net")
       $('#myBlog').hide();
       $('#myBlogContents').text("");
       $('#aboutMe').hide();
       
       $('#linkHeaderTitle').show();
       $('#myProjects').show();
    }
    
    function DisplayMyBlog() {
    //window.location.replace("http://kevin.fonner.net")
    $('#myProjects').hide();
    $('#aboutMe').hide();
    
    $('#linkHeaderTitle').show();
    $('#myBlog').show();
    $("#myBlogPagination").paginate({
        count 		: numberOfMyBlogPages,
        start 		: 1,
        display     : 8,
        border					: true,
        border_color			: '#fff',
        text_color  			: '#fff',
        background_color    	: 'black',	
        border_hover_color		: '#ccc',
        text_hover_color  		: '#000',
        background_hover_color	: '#fff',
        mouse					: 'press',
        onChange     			: function(page){
                                    LoadMyBlogContents(page);
                                }
    });
    LoadMyBlogContents(1);
     
    }
    
    function LoadMyBlogContents(pageNumber) {
     $.ajax({
           url: 'myBlogPages/myBlog_' + pageNumber,
           dataType: 'html',
           success: function(data) {
               //alert(data)
               $('#myBlogContents').html(data);
               $('html, body').animate({scrollTop:0}, 'slow');
               //alert(data);
           }
       });
}

