/* jQuery on document ready */
$(document).ready(function() {
    // handle navigation link click
	$('#danube_menu ul li a, #danube_menu .dropdown-menu li a, .test a').click(function () {                                                   
            loadAjaxContent($(this).attr('url'));
            //loadUrlPic($(this).attr('url'));
	});
    //handle arrowclicks
        $('.test a').click(function () {
            //loadUrlPic($(this).attr('url'));
            //alert("fu");
            loadApiPic(-1);
	});
});

function loadAjaxContent(url) {
        var dataTmp;
	$.get(url, function (data) {
                dataTmp = data;
                bodyelem = $("html,body");
                bodyelem.animate();
	}).complete(function() {
            $('#site-content-wrapper').slideUp({duration: 'slow',
            complete: function(){
                $('#site-content').html(dataTmp);
                $('#site-content-wrapper').slideDown('slow');
                site_content_is_visible = true;
            }});
        }); 
}
function loadUrlPic(url_pic) {
    var dataTmp;
    $.get(url_pic, function (data) {
        dataTmp = data;
        bodyelem = $("html,body");
        bodyelem.animate();
    }).complete(function() {
            $('.carousel-inner').slideUp({duration: 'slow',
            complete: function(){
                $('#pic').html(dataTmp);
                $('.carousel-inner').slideDown('slow');
                site_content_is_visible = true;
            }});
        }); 
}

function loadApiPic(id) {
    var dataTmp;
    $.get('./api.php?call=img&id='+id, function (data) {
        dataTmp = data;
        bodyelem = $("html,body");
        bodyelem.animate();
    }).complete(function() { 
        
    });
}