/*
 * all rights reserved (also includes) 2010 - tomorow Sascha Bast
 * -> it's a feature not a bug
 */
var globalDate='2007-01-01';
function showPost(id){
    $('div.blog-posts').fadeOut('fast',function(){
        $('div.blog-posts').css('display','block');
        $('div.blog-posts').html('<img src="wp-content/themes/wp-coda/images/loading.gif">');
    })
    $.ajax({
        type:"POST",
        url: 'wp-content/plugins/ajaxIO/bridge.php',
        data: "action=showDetail&id="+id,
        success: function(data) {
            $('div.blog-detail-content').html(data);
            $('div.blog-posts').fadeOut('fast',function(){
                $('div.blog-detail').fadeIn(300)
            });
        }
    });
}
function refreshBlog(date){
    var category='';
    if(date!=undefined){
        globalDate=date;
    }
    $('div.blog-posts').fadeOut('fast',function(){
        $('div.blog-detail').fadeOut(300);
        $('div.blog-posts').css('display','block');
        $('div.blog-posts').html('<img src="wp-content/themes/wp-coda/images/loading.gif">');
    })
    if($('div#slide_26').attr('id')==undefined){
        category='4';
    }else{
        category='1';
    }
    $.ajax({
        type:"POST",
        url: 'wp-content/plugins/ajaxIO/bridge.php',
        data: "action=refreshBlog&date="+globalDate+"&category="+category,
        success: function(data) {
            $('div.blog-posts').fadeOut('fast',function(){
                $('div.blog-posts').html(data);
                $('div.blog-posts').fadeIn(300)
            })
        }
    });
}

function flipContainer(id,date){
    refreshBlog(date);
/*
    if($('#'+id).css('display')=='block'){
        $('#'+id).fadeOut();
    }else{
        $('#'+id).fadeIn();
    }*/
}


