var background = 0;
var timeout = 4000;
var contents = new Array("page_one", "page_two", "page_three", "page_four", "page_five");
$(document).ready(function(){
    
    setTimeout('changeBackground()', timeout);

   
});

function changeBackground(){
    if(background < 4){
         background++;
    }
    else{
        background = 0;
    }
    
    $(".pagebg").fadeOut("slow");
    $("#" + contents[background]).fadeIn("slow");
   
    console.log(background);
    setTimeout('changeBackground()', timeout);
}