/* Ready */

$(document).ready(function() {

	$("a.fancybox").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	300, 
		'speedOut'		:	200,
		'titleShow'		:	true,
		'titlePosition' :	'inside'
	});

	$('#map_canvas1').googleMaps({
				latitude: 50.079090,
				longitude: 14.422093,
				depth:16,
				markers: {
					latitude: 50.079090,
					longitude: 14.422093
				}	
			}); 
			
	$('#map_canvas2').googleMaps({
				latitude: 50.075110,
				longitude: 14.431918,
				depth:16,
				markers: {
					latitude: 50.075110,
					longitude: 14.431918
				}	
			}); 			


	//menu
	var pgSeg1 = $.url(window.location.href).segment(1)

	//menu-1st
	$('.menu-1st > div > a').each(function(){
	 	var aSeg = $.url($(this).attr('href')).segment(1)
	  	if (pgSeg1 == aSeg) {
	   		$(this).children('img').attr("src",$(this).children('img').attr('src').replace('_0','_1')); 
	  	}
	  	else { 
	  		$(this).children('img').hover(function(){ this.src = this.src.replace('_0','_1'); },
									  	  function(){ this.src = this.src.replace('_1','_0'); }	);
	  	}
	 });

})



/* Rollover jpg images */
jQuery(function( $ ){			
	$.preload( 'div.menu img, div.vicezde img', {
	    find:'_0',
	    replace:'_1'
	});
/*	
	$('div.menu img, div.vicezde img').hover(function(){
		this.src = this.src.replace('_0','_1');	
	},function(){ 
		if ($(this).attr("class") != "act") { this.src = this.src.replace('_1','_0'); }
	}); */
});
