/*
 * tento skript slouzi k napozicovani obrazkovych priznaku do obrazku polozky
 **/
	
$(document).ready(function(){

	mezera = 3; /* mezera mezi priznaky */
	
	$(".dalsipriznaky").each(function(){
		$(this).show();
		cont = $(this).prev();
		img = $(cont).children("img");
		
		if (img.length)
			cont = img;

		if (cont.length)
		{
			offset = cont.offset();

			pleft = offset.left;
			$(this).children(".bottomleft").each(function(){
				$(this).offset({
					left: pleft,
					top: offset.top + cont.height() - $(this).height()
				});
				pleft += $(this).width() + mezera;
			});

			ptop = offset.top + cont.height();
			$(this).children(".bottomright").each(function(){
				$(this).offset({
					left: offset.left + cont.width() - $(this).width(),
					top: ptop - $(this).height()
				});
				ptop -= $(this).height() + mezera;
			});

			pleft = offset.left + cont.width();
			$(this).children(".topright").each(function(){
				$(this).offset({
					left: pleft - $(this).width(),
					top: offset.top
				});
				pleft -= $(this).width() + mezera;
			});

			ptop = offset.top;
			$(this).children(".topleft").each(function(){
				$(this).offset({
					left: offset.left,
					top: ptop
				});
				ptop += $(this).height() + mezera;
			});
		}

	});
});

