var stan=0;
var menu_list= new Array(poligrafia,oreklamowa,gadgety,www,multimedia,wydawnictwa,foto,klienci);
var speed=2;
var cszer=326; //szerokosc containera
function srodkowanie(lay)
{
srX=document.body.clientWidth/2;
srY=document.body.clientHeight/2;
srX=Math.round(srX)-400;
srY=Math.round(srY)-250;
x=$(lay);
x.style.left='50%';
x.style.top='50%';
x.style.margin_left='-400px';
x.style.margin_top='-250px';
}

var myMenu ={
        lista: function () {return $('txt1');},
       hide: function (){
       u=new Effect.Fade(myMenu.lista(),{duration:1});
       },
       show: function (){
       d=new Effect.Appear(myMenu.lista(),{duration:2,delay:1.5});
       },
       change: function (m_id){
       setTimeout("myMenu.lista().innerHTML=menu_list["+m_id+"]",1000);
       }
       };


function menu(m_id){
    myMenu.hide();
    myMenu.change(m_id);
    myMenu.show();
    imgset(m_id);
    $('metka_img').src='img/n'+m_id+'.gif';
}

function imgset(iid){

    e1=new Effect.Fade('oferta_img',{duration:0.5,afterFinish:function (){setsrc(iid);}});
    Reflection.remove($('oferta_img'));
    switch (iid){
    case 1:
    $('cback').src='img/cbackg.gif';
    break;
    case 2:
    $('cback').src='img/cbackc.gif';
    break;
    case 3:
    $('cback').src='img/cbackw.gif';
    break;
    case 4:
    $('cback').src='img/blank.gif';
    break;
    case 5:
    $('cback').src='img/blank.gif';
    break;
    case 6:
    $('cback').src='img/cbacko.gif';
    break;
    case 7:
    $('cback').src='img/cbackk.gif';
    break;
    default:
    $('cback').src='img/cback.jpg';
    }
    Reflection.add($('cback'),{height: 0.5, opacity: 0.1});
    }

function setsrc(obj)
    {
    $('oferta_img').src=img_list[obj].src;
    $('oferta_foto').setStyle({left: 0, top: 0});
    e2=new Effect.Appear('oferta_img',{duration:0.5,afterFinish:addref});
    }

function addref(obj){
    Reflection.add($('oferta_img'),{height: 0.5, opacity: 0.4});
    }

function mshow(ids){
 new Effect.Opacity(ids,{duration:0,to:0.8});
}
function mhide(ids){
 new Effect.Opacity(ids,{duration:0,to: 0.3});
}

function mleft(){
image=$('oferta_foto');
x=image.getStyle('left');
if(parseInt(x)==0) return false;
y=parseInt(x) + speed + 'px';
image.setStyle({ left: y});
}

function mright(){
image=$('oferta_foto');
x=image.getStyle('left');
if(parseInt(x)<(cszer-$('oferta_img').width)) return false;
y=parseInt(x) - speed + 'px';
image.setStyle({ left: y});
}

