$(function() {
	$('.gallery_preview a').lightBox({
  	overlayBgColor: '#FFFFFF',
  	overlayOpacity: 0.6,
  	imageLoading: 'image/loading_image.gif',
  	imageBtnClose: 'image/close_image.gif',
  	imageBtnPrev: 'image/previous_image.gif',
  	imageBtnNext: 'image/next_image.gif',
  	containerResizeSpeed: 350,
  	txtImage: 'Obrázek',
  	txtOf: 'z'
   });
});

this.screenshotPreview = function(){	
	xOffset = 10;
	yOffset = 10;

	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='NĂˇhled' />"+ c +"</p>");								 
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });	
	$("a.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

$(document).ready(function() {
  $(".menu ul ul").css({display: "none"}); // Opera Fix
  $(".menu ul li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(700);
		},function(){
		  $(this).find('ul:first').css({visibility: "hidden",display: "none"});
		});
});

function add_text(target, text) {
  target.value = (target.value + text + " ");
  target.focus();
}

