//Written by Bogdan Blaszczak/BlaTek

function preloadMenu(I,i){
  for(I=[],i=0;i<12;i++)I[i]=new Image()
  I[0].src='img/menu_about_on.gif'
  I[1].src='img/menu_o_nas_on.gif'
  I[2].src='img/menu_gallery_on.gif'
  I[3].src='img/menu_galeria_on.gif'
  I[4].src='img/menu_staff_on.gif'
  I[5].src='img/menu_pracownicy_on.gif'
  I[6].src='img/menu_customer_on.gif'
  I[7].src='img/menu_klienci_on.gif'
  I[8].src='img/menu_contact_on.gif'
  I[9].src='img/menu_kontakt_on.gif'
  I[10].src='gallery/arrow_top_on.gif'
  I[11].src='gallery/arrow_bottom_on.gif'
}
preloadMenu()

onload=function(t,T,i,I,l){
 if(!document.getElementById)return
 t=[]
 T=document.getElementById('left-menu').getElementsByTagName('ul')[0]
 if(T){
  T=T.getElementsByTagName('a')
  for(i=0;i<T.length;i++)t[t.length]=T[i]
 }
 T=document.getElementById('arrow-top')
 if(T)t[t.length]=T.getElementsByTagName('a')[0]
 T=document.getElementById('arrow-bottom')
 if(T)t[t.length]=T.getElementsByTagName('a')[0]

 for(i=0;i<t.length;i++){
  I=t[i].getElementsByTagName('img')[0]
  if(document.body.filters){I.n=i;glN=-1}
  I.onmouseover=I.onmouseout=rollMe
 }

 l=document.links
 for(i=0;i<l.length;i++)l[i].onfocus=lFocus

 if(window.loadGallery)window.loadGallery()

 if(window.BlaTekCSMenu)BlaTekCSMenu()
}

function lFocus(){if(window.aFocus)this.blur()}
document.onmousedown=function(){aFocus=1;setTimeout('aFocus=0',10)}
function rollMe(e,f){
   e=e||event;e=e.type=='mouseout'
   if(document.body.filters){
    this.style.filter=''
    if(this.parentNode.parentNode.id=='arrow-top'||this.parentNode.parentNode.id=='arrow-bottom')
     this.style.filter='blendTrans(duration=0.3)'
    else{
     this.style.filter=glN<this.n?'revealTrans(duration=0.2,transition=5)':'revealTrans(duration=0.2,transition=4)'
     if(e)glN=this.n
    }
   }
   eval('try{f=this.filters}catch(Er){}')
   if(f)eval('try{f[0].Apply()}catch(Er){}')
   this.src=e?this.src.replace(/_on\.gif/i,'.gif'):this.src.replace(/.gif/i,'_on.gif')
   if(f)eval('try{f[0].Play()}catch(Er){}')
}

function bookmarkit(pl,l){
 if(pl)l='Twoja przeglądarka nie obsługuje tej funkcji. Przejdź do menu "Ulubione" i dodaj stronę ręcznie.'
 else l='Your browser doesn\'t support this feature. Please go to Bookmarks menu and add the site manually.'
 if(!window.external&&!window.sidebar){alert(l);return!1}
 if(window.sidebar&&window.sidebar.addPanel){window.sidebar.addPanel(document.title, location.href,"");return!1}
 window.external.addFavorite(location.href,document.title);return!1
}
function recommend(x,O){
 O=window.open(x,'recWin','left=50,top=50,width=380,height=260')
 return O.opener&&O.opener==self
}


function popup(x,s,w,h,l,t,n,O){
s=s?'no':'yes';w=w?w:'500';h=h?h:'500';l=l?l:'80';t=t?t:'120';n=n?n:'popWin'
 O=window.open(x,n,'left='+l+',top='+t+',width='+w+',height='+h+',scrollbars='+s)
 return O&&O.opener&&O.opener==self
}
