function thumbail_pos() {

	eleOffset = $('#thumbail').offset();

	$('a#image_hack').css("left", eleOffset.left+"px");
	
	$('a#image_hack').css("top", eleOffset.top+"px");

};

 

var resizeTimer = null;

$(window).bind('resize', function() {

if (resizeTimer) clearTimeout(resizeTimer);

resizeTimer = setTimeout(thumbail_pos, 10);

});


$(document).ready( function() {
	
	if($('#thumbail').length > 0){

		var myImage = document.getElementById('thumbail');
	
		var x = document.getElementById("image_hack");
	
		var newImage = document.createElement('img');

		newImage.src = myImage.src;
	
		$("a#image_hack").css("position","absolute");
		$("a#image_hack").css("display","block");
	
		$('a#image_hack').attr("href", $('#link').attr('href'));
		$('a#image_hack').attr("title", $('#link').attr('title'));
	
		x.appendChild(newImage);
	
		eleOffset = $('#thumbail').offset();

		$('a#image_hack').css("left", eleOffset.left+"px");
		$('a#image_hack').css("top", eleOffset.top+"px");
		$('a#image_hack').css("z-index", "2");
		
		if($('a.shadow').length > 0) {
			
			$('a#image_hack,a.shadow').attr('rel','shadowbox[gal]');		
			Shadowbox.setup($('a.shadow, a#image_hack'));	
		
		} else {
			
			$('a#image_hack').attr('rel','shadowbox[gal]');		
			Shadowbox.setup($('a#image_hack'));
			
		} 
	
	} else if($('a.shadow').length > 0){
		
		$('a.shadow').attr('rel','shadowbox[gal]');		
		Shadowbox.setup($('a.shadow'));
		
	}

})

Shadowbox.init({
    language:   "cs"
});

