$(document).ready(function() {

//change backgroun on startbar
$(".bottomBox").mouseenter(function() {
$(this).css("background-color","#EEEEEE");
});

$(".bottomBox").mouseleave(function() {
$(this).css("background-color","#FFFFFF");
});

//////////////////////////////////////////

// show bottom bar
$("#bottomContainer").delay(700).fadeIn("fast","swing");

////////////////////////////////////////


//hide overlay
$("#shadow").click(function() {
$("body").scrollTop(currentScrollPos);
$("#overlayContainer").hide("puff", {}, 200);
$("#shadow").fadeOut("fast","swing");
$("#overlayContainer").html('');
});

});

//show overlay
function showOverlay(getId) {
currentScrollPos = $("body").scrollTop();
$("#overlayContainer").css("padding-top",currentScrollPos+30+"px");
$("#overlayContainer").css("height","");

$("#overlayContainer").load('index.php?id=13&ajaxId='+getId,function() {
overlayHeight = $("#overlayContainer").innerHeight();
documentHeight = $(document).height();

if(overlayHeight-currentScrollPos>=documentHeight) {
$("#overlayContainer").css("height",overlayHeight-currentScrollPos-60+"px");
} else {
$("#overlayContainer").css("height",documentHeight-currentScrollPos-60+"px");
}

$("#overlayContainer").show("puff", {}, 200);

});

$("#shadow").fadeIn("fast","swing");
};
