function heightAdjust(selectors, suffix)
{
	var height = {};
	var maxheight = -1;

	for(var i = 0; i < selectors.length; i++)
	{
		height[i] = 0;
		for(var j = 0; j < selectors[i].length; j++)
			if ($(selectors[i][j]) != null)
				height[i] += (height[i] > 0 ? 15 : 0) + $(selectors[i][j]).height();

		if (maxheight < height[i])
			maxheight = height[i];
	}

	for(var i = 0; i < selectors.length; i++)
		if (height[i] > 0)
		{
			var outobj = $(selectors[i][selectors[i].length - 1]);
			var inobj = $(selectors[i][selectors[i].length - 1] + (suffix.length > 0 ? ' ' : '') + suffix);
	
			if (maxheight > height[i])
				inobj.height(inobj.height() + maxheight - height[i]);
		}

}

function KuvasNKPInit()
{

	$('h1').each(function() {
		this.title = this.innerHTML;
		$(this).css('font-size', '11px');
		$(this).html($(this).html().replace(/([0-9A-ZÀ-ß])/g, '<span>$1</span>').toUpperCase());
	});

	heightAdjust([['#menu', '#partners'], ['#sitebody'], ['#president', '#clubnews', '#clubadv'], ['#president', '#clubnews', '#clubevents']], '.body');

	$('.photogallery a').attr('rel', 'photoset');

	$('.photogallery a').fancybox({
	        titleShow: false
	});
    

	$('.menu > .item > li').each(function() {
		var li = this;
		$('a', li).hover(function() { $(li).toggleClass('selected'); } );
	});

}

