$().ready(function() {
									 
	var defaults = { //defaults, can be overidden
			xOffset : 20,
			yOffset : 150
	}
	var options =  $.extend(defaults, options);
	
	$("#preview").hover(function(e){
		var o = options; 
		myTitle = this.title;
		this.title = "";	
		var c = (myTitle != "") ? "<br/>" + myTitle : "";
		$("body").append("<p id='previewBox'><img src='"+ this.rel +"' alt='Image preview' />"+ c +"</p>");								 
		$("#previewBox")
			.css("top",(e.pageY - o.yOffset) + "px")
			.css("left",(e.pageX + o.xOffset) + "px")
			.fadeIn("fast");						
	},
	function(){
		this.title = myTitle;	
		$("#previewBox").remove();
	});	

	$("#preview").mousemove(function(e){
		var o = options; 
		$("#previewBox")
			.css("top",(e.pageY - o.yOffset) + "px")
			.css("left",(e.pageX + o.xOffset) + "px");
	});		


	$('.odkazy a').animate({ opacity: 0.3 }, 500);
	
	$('.odkazy a').each(function() {
			$(this).hover(function() {
					$(this).stop().animate({ opacity: 1.0 }, 500);
			},
		 function() {
				 $(this).stop().animate({ opacity: 0.3 }, 500);
		 });
	});
	$('#miniObr a').mouseover(function(){
		var rel = $(this).attr("rel");
		$('#imgDetail img').attr("src", rel).css({opacity: 0}).stop().animate({opacity:1}, 1000 );
		return false;
	});
	$('#miniObr a').mouseout(function(){
		var rel = $('#miniObr a').attr("rel");
		$('#imgDetail img').attr("src", rel).css({opacity: 0}).stop().animate({opacity:1}, 1000 );
		return false;
	});
	$('#miniBigObr a').mouseover(function(){
		var rel = $(this).attr("rel");
		$('#imgBigDetail img').attr("src", rel).css({opacity: 0}).stop().animate({opacity:1}, 400 );
		return false;
	});
		
});

