/*
Gallery Tip Engine | 2009 © FMM.CZ
-------------------------------
#GT {
position: absolute;
z-index:100;
background-color:#FFFFFF;
text-align:center;
font-size: 6.5pt;
padding: 3px;
border: 1px solid #CCCCCC;
border-top: none;
}
-------------------------------
$(document).ready(function() { GalleryTip_init(); });
*/

function GalleryTip_init() {
    $(".LoadedGalerie a").unbind();
    $(".LoadedGalerie a").hover(function() { GT_show(this.id, this.title) }, function() { $('#GT').remove() })
    $(".LoadedGalerieMini a").unbind();
    $(".LoadedGalerieMini a").hover(function() { GT_showMini(this.id, this.title) }, function() { $('#GTMini').remove() })
	
}

function GT_show(ID, title) {
    if (title) {
        $("body").prepend("<div id='GT'>" + title + "</div>");
        var NewX = getLeftOffset(ID) - 11;
        var NewY = getTopOffset(ID) + getHeight(ID) + 3;
        $('#GT').css("left", NewX + "px");
        $('#GT').css("top", NewY + "px");
        $('#GT').css("width", (getWidth(ID) + 14) + "px");
        $('#GT').show();
    }
}
function GT_showMini(ID, title) {
    if (title) {
        $("body").prepend("<div id='GTMini'>" + title + "</div>");
        var NewX = getLeftOffset(ID) - 4;
        var NewY = getTopOffset(ID) + getHeight(ID) + 4;
        $('#GTMini').css("left", NewX + "px");
        $('#GTMini').css("top", NewY + "px");
        $('#GTMini').css("width", (getWidth(ID) + 0) + "px");
        $('#GTMini').show();
    }
}
function getLeftOffset(ID) {
    var p = $('#' + ID);
    var offset = p.offset();
    return offset.left;
}

function getTopOffset(ID) {
    var p = $('#' + ID);
    var offset = p.offset();
    return offset.top;    
}
function getWidth(ID) {
    x = document.getElementById(ID);
    return x.offsetWidth;
}
function getHeight(ID) {
    x = document.getElementById(ID);
    return x.offsetWidth;
}