// Code by M@GiK

    function switchln(ln,page) {
	if (parseInt(navigator.appVersion)>3) {
	    if (navigator.appName=="Netscape") winW = window.innerWidth-50;
	    if (navigator.appName.indexOf("Microsoft")!=-1) winW = document.body.offsetWidth-50;
	}
	$("#lang img").animate({ width: winW, opacity: "0.2" }, 700, 'expoin');
	$("#lang img").animate({ opacity: "1" },500);
	$("#lang").animate({ left: winW-60 },0);
	$("#lang").animate({ left: "0px" },700, 'expoin');
	$("#container").animate({ opacity: "0.1" }, 700, 'expoin');

	setTimeout(function(){ window.location.href="?page="+page+"&l="+ln; }, 1000);
    }
    var nr=1;
    function movebg() {
	nr++;
	if (nr>3) { nr=1; }
	$("#napis").animate({ opacity: "0.0" }, 250, 'easeIn');
	$("#baner").animate({ opacity: "0.0" }, 500, 'easeIn', function(){
	    $("#baner").css({background: "url(images/banino"+nr+".jpg)"});
	    $("#baner").animate({ opacity: "0.75" }, 500, 'easeOut', function(){ 
		setTimeout(function(){ movebg() }, 15000);
		$("#napis").animate({ opacity: "1.0" }, 250, 'easeOut');
	    });
            
	    

	});
    }

$(document).ready(function(){
    $("#napis").mouseenter(function(){ 
	$("#napis").css({ opacity: "0.2"});
    }).mouseleave(function(){
	$("#napis").css({ opacity: "1.0"}); 
    });
    setTimeout(function(){ movebg() }, 15000);
});

