<!--
//nacitanie obrazkov pri spusteni
function preload() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preload.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

//obrazok v novom okne
function zoom(URL,winName,features,popis) { 
	okno=window.open('',winName,features);
	okno.document.write('<html><title>'+popis+' FOTOGALÉRIA </title><body style="margin-top:10px; padding:0; font-family: Arial, Helvetica, sans-serif; color: #FFFFFF; background: url(images/foto_bg.jpg);">');
	okno.document.write('<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" style="font-size: 12px; font-weight: bold;">');
	okno.document.write('<a href="javascript:window.close()"><IMG SRC="'+URL+'" border="0" alt="&raquo; zatvoriť okno &laquo;" title="&raquo; zatvoriť okno &laquo;" style="border: 1px solid #FFFFFF;"></a><br /><font-size: 12px; color: #000000;>'+popis+'</font>');
	okno.document.write('<td><tr></table></body></html>');
	okno.document.close();
	okno.focus();
}

//video v novom okne
function video(URL,winName,features,popis) { 
	okno=window.open('',winName,features);
	okno.document.write('<html><title>'+popis+' VIDEOGALÉRIA </title><body style="margin-top:10px; padding:0; font-family:Arial,Helvetica,sans-serif; color:#FFFFFF; background-color:#3C2B68;">');
	okno.document.write('<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" style="font-size: 12px; font-weight: bold; background: url(w_images/loading_vid.jpg) no-repeat center center;">');
	okno.document.write('<embed object src="'+URL+'" width="320" height="240" style="border: 3px solid #FFFFFF;" /><br /><br /><font-size: 12px; color: #000000;>'+popis+'<br /><a style="text-decoration:none; color:yellow;" href="javascript:window.close()">&laquo; zatvoriť okno &raquo</a></font><br />');
	okno.document.write('<td><tr></table></body></html>');
	okno.document.close();
	okno.focus();
}

// hlavne menu
(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);

$(function(){
	$('.menu a')
		.css( {backgroundPosition: "0px -120px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0px -60px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0px -120px)"}, {duration:500})
		})
});

//lightbox
$(document).ready(function(){
	$(".lightbox").lightbox();
});

// prechod v menu
$(document).ready(function () {
	//Append a div with hover class to all the LI
	$('#navMenu li').append('<div class="hover"><\/div>');
	$('#navMenu li').hover(
		//Mouseover, fadeIn the hidden hover class	
		function() {
			$(this).children('div').fadeIn('1000');	
		}, 
		//Mouseout, fadeOut the hover class
		function() {
			$(this).children('div').fadeOut('1000');	
	}).click (function () {
		//Add selected class if user clicked on it
		$(this).addClass('selected');
	});
});

$(document).ready(function(){
	// =PHOTOS
	$('.photos h3').css('opacity', 0.8);
	$('.photos li').hover(
		function(){
			$(this).find('h3').fadeIn(400);
			$(this).find('img').fadeTo(300, 0.6).fadeTo(300, 1);
		},
		function(){
			$(this).find('h3').fadeOut(10);
		}
	);
});


//-->
