

function zmienLogo(nr)
{
    $('logo').src=$('logo2').src;
    $('logo').style.opacity=1.0;
    var a = $('menuLogo').getElementsByTagName('img');   
    var k;
    for (var i = 0; a.length > i; i++)
    {
        if(a[i].className == 'active')
        {
            a[i].style.opacity=0.4;
            a[i].className="";
            k=i;
        }
    }
    if(nr=='n')
    {
        if(k <3)
        {
            nr=k+2;
        }
        else
        {
            nr=1;
        }
    }
    else
    {
        clearInterval(inter);
        inter = setInterval('zmienLogo("n");', 5000);
    }
    a[nr-1].className='active';
    a[nr-1].style.opacity=1;
    $('logo2').src="gfx/logo"+nr+".png";
    new Fx.Tween('logo', {transition: 'linear', duration: 2000}).start('opacity', 1, 0);
}
function hover3(obj)
{
    $(obj).set('tween',{
	duration: 100});
    if (obj.className != "active")
        $(obj).tween('text-indent', 35);
}
function mOut3(obj)
{
    $(obj).tween('text-indent', 15);
}
function hover4(obj)
{
    $(obj).tween('opacity', 0.5);
}
function mOut4(obj)
{
    $(obj).tween('opacity', 1);
}
function hover(nr)
{
    clearInterval(document.interw);
    document.interw = setInterval('mOut();', 10000);
    var distance = 15 + (nr-1)*140;
    new Fx.Tween('borderActive', {transition: 'quart:out', duration: 500}).start('left', distance);
}
function mOut()
{
    var a = $('menu').getElementsByTagName('li');    
    for (var i = 0; a.length > i; i++)
    {
        if(a[i].className == 'active')
        {
            var k=i;
        }
    }
    var distance = 15 + k*140;
    new Fx.Tween('borderActive', {transition: 'quart:out', duration: 500}).start('left', distance);
}
function hover2(obj)
{
    obj.style.opacity=1;
}
function mOut2(obj)
{
    if(obj.className !== 'active')
    {
        obj.style.opacity=0.4;
    }
}
function nload()
{
    // JavaScript Document\
window.addEvent('domready', function() {
			
			/* implement flashing */
			Element.implement({
				flash: function(to,from,reps,prop,dur) {
					
					//defaults
					if(!reps) { reps = 1; }
					if(!prop) { prop = 'color'; }
					if(!dur) { dur = 400; }
					
					//create effect
					var effect = new Fx.Tween(this, {
							duration: dur,
							link: 'chain'
						})
					
					//do it!
					for(x = 1; x <= reps; x++)
					{
						effect.start(prop,to,from).start(prop,from,to);
					}
				}
			});
		});
				
	var a = $('menuLogo').getElementsByTagName('img');    
    for (var i = 0; a.length > i; i++)
    {
        if(a[i].className !== 'active')
        {
            a[i].style.opacity=0.4;
        }
    }
    inter = setInterval('zmienLogo("n");',5000);
    mOut();
    document.interw = setInterval('mOut();', 2000);
    $('promocja').flash('#FFAAAA','#FF0000',10000);
}
function show(nazwa)
{
    $('zdjecie').src="big/"+nazwa;
    $('gallery').style.opacity=0;
    $('gallery').style.display = 'block';
    document.getElementsByTagName('body')[0].style.overflow='hidden';
    $('site').style.overflow='hidden';
    $('gallery').tween('opacity',0,1);

}
function hide()
{
    document.getElementsByTagName('body')[0].style.overflow='visible';
    $('gallery').style.overflow='visible';
    $('gallery').tween('opacity',1,0);
}