function loadContents(page){
    var start = page*10;
    $('#news_headlines').fadeOut('slow',loadHeadlines);
    $('#load').remove();
    $('#news_headlines').html("<div id='load'>Loading...<"+"/div>");
    $('#load').show();
    function loadHeadlines() {
        $('#news_headlines').load("http://www.geos.tv/services/newsheadlines.php?scope=homepage&start="+start,'',showNewContent());
    }
    function showNewContent() {
        $('#news_headlines').fadeIn('normal',hideLoader());
    }
    function hideLoader() {
        $('#load').hide();
    }
    return false;
}
function loadBroadcast(country_id){
    $("#broadcast_today").load("http://www.geos.tv/services/broadcast.php?scope=region&country_id="+country_id);
}
function loadFeatSeries(sid){
    $('#featured_series').html("<div class='loading'>Loading...<"+"/div>");
    $("#featured_series").load("http://www.geos.tv/services/series.php?scope=homepage&series_id="+sid);
}
function loadFeatEpisode(eid){
    $('#featured_episode').html("<div class='loading'>Loading...<"+"/div>");
    $("#featured_episode").load("http://www.geos.tv/services/episodes.php?scope=homepage&episode_id="+eid);
}
function loadFeatPerson(pid){
    $('#featured_person').html("<div class='loading'>Loading...<"+"/div>");
    $("#featured_person").load("http://www.geos.tv/services/people.php?scope=homepage&person_id="+pid);
}
function loadFeatCharacter(cid){
    $('#featured_character').html("<div class='loading'>Loading...<"+"/div>");
    $("#featured_character").load("http://www.geos.tv/services/characters.php?scope=homepage&character_id="+cid);
}
$(document).ready(function(){
    $("ul.nav").superfish();
    $("#member_menubar").load("http://www.geos.tv/services/member.php?url=http://www.geos.tv");
    loadContents(0);
    $("#news-pagination").pagination(100, {
        items_per_page:10,
        link_to: "javascript:void(0);",
        callback:loadContents
    });
    loadFeatSeries();
    loadFeatEpisode();
    loadFeatPerson();
    loadFeatCharacter();
    loadBroadcast(222);
});