(function($) {
	$(window).load(function(){
	
	});
})(jQuery);

(function($) {
	$(document).ready( function() {

		/* 1a - float clearing such as <div style="clear:both"> */
/*		$('article.category,article.item').setAllToMaxHeight();*/

		/* 2 - form placeholder support for old browsers */
		if(!Modernizr.input.placeholder){
		
			$('[placeholder]').focus(function() {
			  var input = $(this);
			  if (input.val() == input.attr('placeholder')) {
				input.val('');
				input.removeClass('placeholder');
			  }
			}).blur(function() {
			  var input = $(this);
			  if (input.val() == '' || input.val() == input.attr('placeholder')) {
				input.addClass('placeholder');
				input.val(input.attr('placeholder'));
			  }
			}).blur();
			$('[placeholder]').parents('form').submit(function() {
			  $(this).find('[placeholder]').each(function() {
				var input = $(this);
				if (input.val() == input.attr('placeholder')) {
				  input.val('');
				}
			  })
			});
		
		}

		/* 3 - smooth navi item shifting */
		$('#main-nav li').mouseover(function() {
			$("a",this).stop().animate({
			  top: "5px"
			}, 400);
		})
		.mouseout(function() {
			$("a", this).stop().animate({
			  top: "0"
			}, 150);
		});

		/* 4 - smooth scroll to top */
		$('.back-top').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});

		/* 5 - fancybox */
		$(".item-image a,.jTscroller a").attr("rel","photo").fancybox({
			'overlayColor'	: '#000',
			'overlayOpacity': 0.2,
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'titlePosition'	: 'over',
			'titleFormat'	: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">Obrázek ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &ndash; ' + title : '') + '</span>';
			}
		});
	
/*		$("a[href$=pdf]").attr("href", function() {	return this.href + "#zoom=100" }).fancybox({
			'type'			: 'iframe',
			'margin'		: 0,
			'width'			: 980,
			'height'		: '80%',
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'titlePosition'	: 'inside'
		});*/

	});
})(jQuery);

/* 1b */
/*$.fn.setAllToMaxHeight = function(){
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
}*/
