$(document).ready(function(){
		
		
		/***
		First | Last class for inline lists
		***/
		$('.inline li:first-child').addClass("first");
		$('.inline li:last-child').addClass("last");
		
		
		/***
		Even Odd table rows
		***/
		$('table tr:even td').addClass("even");
		$('table tr:odd td').addClass("odd");
		$('.evenodd .item:even').addClass("even");
		$('.evenodd .item:odd').addClass("odd");
		$('.evenodd .item:nth-child(2n+2)').after('<div class="clr"></div>');

		/***
		Empty search form on click
		***/
		$('#q_search').click(function(){

			a = $(this).val();
			if ( a == "vyhľadávanie" )
			{
				$(this).val("");
			}
			
		});
		
		
		/***
		External links
		***/
		$("a[rel='external']").attr({target:"_blank"});
		
		
		/***
		External links
		***/
		$(".transp").fadeTo(0, 0.5);
		
		// text page images
		$("#textpage a[href*=/userfile/image/]:has(img)").addClass("fancybox").attr("rel", "text_gallery");

		
		/***
		Fire Fancybox for Images
		***/
		$("a.fancybox").fancybox({
			'zoomSpeedIn': 0,
			'zoomSpeedOut': 0,
			'zoomOpacity': false,
			'zoomSpeedChange': 0,
			'overlayShow': false,
			'overlayOpacity': 0.2,
			'hideOnContentClick': true,
			'centerOnScroll': false,
			'imageScale': false
		}); 

		
		/***
		Equal Height Columns by Rob Glazebrook
		http://www.cssnewbie.com/equal-height-columns-with-jquery/
		***/
		function equalHeight(group) {
			var tallest = 0;
			group.each(function() {
				var thisHeight = $(this).height();
				if(thisHeight > tallest) {
					tallest = thisHeight;
				}
			});
			group.height(tallest);
		}
		
		equalHeight($("#aside .content"));
		
	});
	

