// JavaScript Document

$(document).ready(function() {

				$("ul.sf-menu").superfish({ 
            animation: {height:'show'},   // slide-down effect without fade-in 
            delay:     1200               // 1.2 second delay on mouseout 
        });

//http://www.i-marco.nl/weblog/jquery-accordion-menu/
/*$('#menu li ul').hide();
$('#menu li ul:first').show();
$('#menu li a').click(function() {
	var checkElement = $(this).next();
	if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
		return false;
	}
	if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
	$('#menu li ul:visible').slideUp('normal');
		checkElement.slideDown('normal');
		return false;
	}
}
);*/

//http://qrayg.com/experiment/cssmenus/
//http://www.frebsite.nl/werk/scripts/jquery_dropmenu_plugin/index_en.php#voorbeelden
//http://www.emanuelblagonic.com/2006/10/11/create-your-own-drop-down-menu-with-nested-submenus-using-css-and-a-little-javascript/

	// velikost obrazku
	
		//$(".gallery img").aeImageResize({height: 50, width: 50});
		$(".gallery img").aeImageResize({height: 100, width: 250});		
		$(".lightbox img").aeImageResize({height: 400, width: 200});
		$(".lightbox600 img").aeImageResize({height: 800, width: 600});
		$(".projekce .lightbox img").aeImageResize({height: 150, width: 300});

	// lightbox
        $('.gallery a, a.lightbox600, a.lightbox').lightBox();
        
/*
		var textA = $('#topmenu li a').text();
		var novyTextA = "nový text li a";
		$('#topmenu li a').text(novyTextA); 
	*/	
	
	//	http://stackoverflow.com/questions/179713/how-to-change-the-href-for-a-hyperlink-using-jquery
	
		$('#kuk').load('kuk.html #odstavec');
	
		//$("#topmenu a").attr("href", "index.php")
		$("#bottommenu a[href='#']").attr('href', 'index.php')
		$("#bottommenu a[href='']").attr('href', 'index.php')
		
		//$("a[href='#']").addClass("blind");
		
		
		//prid class poslednimu li v danem ul
		$('ul li:last-child').addClass("last");
			//prid class poslednimu li v danem ul
		$('table tr td:last-child').addClass("last");
		
		//prvnimu odstavci z a nadpisem h1 pridal class
		//$('h1 + p').addClass("inline");
		
		//www.profimagazin.cz/jquery/jquery-graficke-oznaceni-externich-odkazu-a-jejich-otevreni-v-novem-okne
	  /*$('a').filter(function() { 
	    return this.hostname && this.hostname !== location.hostname; 
	  }).addClass('external') 
	  .click(function() { 
	    window.open(this.href); 
	    return false; 
	  });  
		*/
		//www.karbusicka.cz/blog/Zvyrazneni-externich-odkazu.aspx
		
		$('a[href^="http:"]').each(function() {
			$(this).addClass("external");
		});
		
		$('a[href^="/"], a[href^="http://vasweb.cz"], a[href^="http://www.vasweb.cz"]').each(function() {
			$(this).addClass("internal");
		});
		
		$('a[href^=".pdf"]').each(function() {
			$(this).addClass("pdf");
		});
		
		$('a[href^="mailto"]').each(function() {
			$(this).addClass("mailto");
		});
		
		
		//stridani barvy v radcich tabulky
		$('.table tr:even').addClass('tr2');
		
		//onmouseover
		$(".table tr").mouseover(function() {
			$(this).addClass("over");
		});
		$(".table tr").mouseout(function() {
			$(this).removeClass("over");
		});		
		
		//lightbox
		
		$('a[rel*=lbox]').lightBox(); // Select all links that contains lightbox in the attribute rel

});	


