$("document").ready(function()
{
    
    
    //get_rss_feed();
    $("#bookmarkServices").hide();
    $("#followServices").hide();
    $("#recommendServices").hide();
    $("#shareServices").hide();
    //$("#buttonOne").click(function(e) { e.preventDefault(); alert("test"); });
    $('a[rel=browserBookmarks]').mouseover(function(e) { closeSharingOverlay(); });
    $('a[rel=browserBookmarks]').jFav();
    
    // Tell - A - Friend ausblenden
    $("a[rel='recommendServices']").parent().hide();    
    
    $("#share_buttons_list a[rel=bookmarkServices]").mousemove(function(e) { loadSharingOverlay(this.rel, 183,125,-127,132); });    
    $("#share_buttons_list a[rel=followServices]").mousemove(function(e) { loadSharingOverlay(this.rel, 120,85,-87,277); });
    $("#share_buttons_list a[rel=recommendServices]").mousemove(function(e) { loadSharingOverlay(this.rel, 200,170,-172,385); });
    
    // weil Tell - A - Friend ausgeblendet neue Koordinaten (alt: 185,85,-87,473)
    $("#share_buttons_list a[rel=shareServices]").mousemove(function(e) { loadSharingOverlay(this.rel, 185,85,-87,408); });
    
    //$("#wrapper").mousemove(function(e) { closeSharingOverlay(); });
    $("#content, #header, .main_menu").mouseover(function(e) { closeSharingOverlay(); })
    //$("#share_buttons_overlay").mouseout(function(e) { alert("test"); });
    
    $("#share_buttons_close").click(function(e){ e.preventDefault(); closeSharingOverlay(); });
});

var qtype;   
function loadSharingOverlay(type,width,height,top,left)
{
    $(".jScrollPaneContainer").css("z-index", "-1");
    
    $("#share_buttons_overlay").css("width", width);
    $("#share_buttons_overlay").css("height", height);
    $("#share_buttons_overlay").css("top", top);
    $("#share_buttons_overlay").css("left", left);
    
    if(qtype == type)
    {
        $("#share_buttons_overlay_html").html($("#"+type).html());
        $("#share_buttons_overlay").show();
    }else{
        qtype = type;
        $("#share_buttons_overlay_html").html($("#"+type).html());
        $("#share_buttons_overlay").hide();
    }
}

function closeSharingOverlay()
{
    $(".jScrollPaneContainer").css("z-index", "1");
    $("#share_buttons_overlay").fadeOut();
}