/*
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() {
//	$(".zbozibox a.zboziboximg").css("color","");
    $(".zboziboximg").unbind();
    $(".zboziboximg").hover( function() { GT_show(this.id) }, function() { $('#GT').remove() } )
}

function GT_show(ID) {
	$("body").prepend("<div id='GT'><div id='GT_CONTENT'><img src='/gfx/loading.gif' alt='LOADING'></div></div>");
	// var NewX = getLeftOffset(ID) - 0;
	// var NewY = getTopOffset(ID) + getHeight(ID) + 0;
	var NewX = getLeftOffset(ID) + 80;
	var NewY = getTopOffset(ID) - 90;
	$('#GT').css("left", NewX + "px");
	$('#GT').css("top", NewY + "px");
	$('#GT').css("width", "300px");
	$('#GT').css("height", "360px");	
	$('#GT_CONTENT').load("/hodinky/ajax_detail_simple.aspx?id="+$('#' + ID).attr("rel"));
	//$('#GT_CONTENT').html($('#' + ID).attr("rel"));
	$('#GT').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;
}
