$(function(){

// Inicializace SuperFish menu
    $('ul.main-menu').superfish();
    

// Inicializace FancyBox
    $("a[rel^='lightbox']").fancybox();

// Ankety - zjisteni velikosti sloupce, PROVIZORNI RESENI
    $('.survey-box .item-voted').each(function(){
        var elementWidth = $(this).attr('rel');
        var elementStyle = 'width: ' +  elementWidth  + '%;';
        $(this).attr('style',elementStyle);
    });
    
    // Inicializace selektoru  vyhledavaciho INPUTu a napovedneho textu
    inputHelpText('#search-text', 'hledaný výraz');

	inputHelpText('#frmextranetbox__ar_left_3_loginform-login', 'Uživatelské jméno');
	inputHelpText('#frmextranetbox__ar_left_3_loginform-password', 'Heslo');

// Tisk stránky
$('.action-print').print();


// Poslední portlety ve sloupcích
$('#ar-left .portlet:has(div):last, #ar-right .portlet:has(div):last').addClass('last');
$('#ar-left .portlet:has(div.last), #ar-right .portlet:has(div.last)').addClass('last');
$('.form-row').append('<div class="cleaner" />');

$('.wysiwyg p.highlighted').wrap('<div class="highlighted-wrapper" />');


// Přepne na textovou verzi stránek - zakáže CSS styly
var headerVisual = $('#page').attr('style');

$('.action-txt-version').toggle(
	function(){
		$('link').attr('disabled', 'disabled');
		$('#page').removeAttr('style');
		$('#flash-homepage').hide();
		return false;
	},
	function(){
		$('link').removeAttr('disabled');
		$('#page').attr('style', headerVisual);
		$('#flash-homepage').show();
		return false;
	}	
);

// Označíme sudé řádky tabulky
	if($('.wysiwyg table').length){ $('.wysiwyg:not(.noodd) table tbody tr:even').addClass('odd'); }

// Animovaný kalendář
	if($('.adt-calendar-anime').length){
		adtStartInterval(5000);	// pole s indexy akcí; interval změny akce
	}




// Nabídka ubytování - přidávání / odebírání položek
	/*var counter = '#snippet--demand';
	var controler = '.accommodation-demand .ajax';
	
	$('.accommodation-demand .ajax').each(function(){
		$(this).toggle(
		function(){
			var counterValue = $(counter).text();
			counterValue = parseInt(counterValue) + 1;
			$(counter).text(counterValue);
		},
		function(){
			var counterValue = $(counter).text();
			counterValue = parseInt(counterValue) - 1;
			$(counter).text(counterValue);
		});
	});*/

//ukonceni fce document ready
});
function sendHandle(value) {
	  $.get(value);
	}
