////////////////////////////////////////////////
// JS Script by Otto Kokstein //////////////////
// www.kranzle.cz //////////////////////////////
// copyright 2011 //////////////////////////////
////////////////////////////////////////////////


ddsmoothmenu.init({
 mainmenuid: "menu_horni", //menu DIV id
 orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
 classname: 'ddsmoothmenu', //class added to menu's outer DIV
 //customtheme: ["#1c5a80", "#18374a"],
 contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
});

	$(document).ready(function(){
	$("#menu_katalog").treeview({
		animated: "fast",
		unique: true,
		toggle: function() {
			window.console && console.log("%o was toggled", this);
			}
	});
	
	var div_zobrazeni = $.cookie('div_zobrazeni');
	
	if (div_zobrazeni == 'hide') {

				$('#form_zobrazit').hide();		
				$('#zobrazeni_ukaz').hide();
				$('#zobrazeni_skryj').show();					
	 
	} else { 
				$('#form_zobrazit').show();	
				$('#zobrazeni_ukaz').show();
				$('#zobrazeni_skryj').hide();	
	
	}
	 // toggles the slickbox on clicking the noted link  	 
	  $('#zobrazeni_ukaz').click(function() {
	
				$('#form_zobrazit').hide(400);			
				$('#zobrazeni_ukaz').hide();
				$('#zobrazeni_skryj').show();				
				$.cookie('div_zobrazeni', 'hide');
		
			return false;
		});
	  
	  $('#zobrazeni_skryj').click(function() {	
										
				$('#form_zobrazit').show(400);			
				$('#zobrazeni_ukaz').show();
				$('#zobrazeni_skryj').hide();	
				$.cookie('div_zobrazeni', 'show');
				

			return false;
		});
		
	});
// <![CDATA[
				
			$(document).ready(function () {
				$('#menu_kontakt').tabify();
			});
					
			// ]]>

$().ready(function() {

	$("#FindRemote").autocomplete("http://www.kranzle.cz/modul/search.php", {
		width: 170,
		selectFirst: false,
		matchContains: true,
		formatItem: formatItem		
	});
	$("#FindRemote").result(function(event, data, formatted) {
		var hidden = $(this).parent().next().find(">:input");
		hidden.val( (hidden.val() ? hidden.val() + ";" : hidden.val()) + data[1]);
	});	
	function formatItem(row) {
		return row[0] + " <span class=sedivy>" + row[1] + "</span>";
	}
	

});


	$(document).ready(function(){
		$("a[rel^='prettyPhoto']").prettyPhoto();
	});
