$(document).ready( function(){
	/** glumimo tabele divovima ( sto jednostavno kad moze komplikovano :) )**/


	// apply to all png images 
	//$('img[@src$=.png]').ifixpng(); 
	/** i jos malo**/
	if($.cookie('pregledFS') != null ){
		$('#middle').css('font-size', Math.max( parseInt($.cookie('pregledFS'), 10 ) ) );
	}
});

$(window).load( function(){
		if( $('.logolevo li').length > 0 ){
			$('.logolevo li').css('margin-top', ( $('.logolevo').height() - $('.logolevo li').height() ) / 2);
		}
		if( $('.logodesno li').length > 0 ){
			//			alert( $('.logodesno').height() +'-'+ $('.logodesno li').height() );
			$('.logodesno li').css('padding-top', ( $('.logodesno').height() - $('.logodesno li').height() ) / 2);
		}
});
$(window).bind('load', function() {
	layout();
});
function layout(){
	$('#left').height( $('#outer').height() );
	$('#middle').height( $('#outer').height() );
	$('#infoBox').height( $('#outer').height()-10 );
	if($('.mainsections').length > 0 ){
		max = Math.max( $('#asection12').height(), $('#asection15').height() );
		$('#asection12').height(max);
		$('#asection15').height(max);

		max = Math.max( $('#asection3').height(), $('#asection13').height() );
		$('#asection3').height(max);
		$('#asection13').height(max);
	}
}

function enlarge_font(){
	var currentSize = $('#middle').css('font-size');
	var num = parseFloat(currentSize, 10);
	// make sure current size is 2 digit number, save as var called 'unit'
	var unit = currentSize.slice(-2);
	num = num * 1.2;
	$('#middle').css('font-size', num + unit);
	$.cookie('pregledFS', parseInt(num+unit));
	$('#user3 .enlarge').blur();
	return false;
}
function shrink_font(){
	var currentSize = $('#middle').css('font-size');
	var num = parseFloat(currentSize, 10);
	// make sure current size is 2 digit number, save as var called 'unit'
	var unit = currentSize.slice(-2);
	num = num / 1.2
	$('#middle').css('font-size', num + unit);
	$.cookie('pregledFS', parseInt(num+unit));
	$('#user3 .shrink').blur();
	return false;
}

