//Written by Bogdan Blaszczak/BlaTek

function preloadMenu(I,i){
  for(I=[],i=0;i<16;i++)I[i]=new Image()
  I[0].src='img/menu_home.gif'
  I[1].src='img/menu_home_on.gif'
  I[2].src='img/menu_about.gif'
  I[3].src='img/menu_about_on.gif'
  I[4].src='img/menu_kitchen.gif'
  I[5].src='img/menu_kitchen_on.gif'
  I[6].src='img/menu_kitcheness.gif'
  I[7].src='img/menu_kitcheness_on.gif'
  I[8].src='img/menu_appliances.gif'
  I[9].src='img/menu_appliances_on.gif'
  I[10].src='img/menu_standard.gif'
  I[11].src='img/menu_standard_on.gif'
  I[12].src='img/menu_contact.gif'
  I[13].src='img/menu_contact_on.gif'
  I[14].src='img/show_wish_button.gif'
  I[15].src='img/show_wish_button_on.gif'
  I[14].src='img/bath_button.gif'
  I[15].src='img/bath_button_on.gif'
}
preloadMenu()
var mBox

onload=function(t,i,l,I,T){
 if(!document.getElementById)return

 T=[]
 t=document.getElementById('menu')
 if(t){
  t=t.getElementsByTagName('a')
  for(i=0;i<t.length;i++)T[T.length]=t[i]
 }
 t=document.getElementById('m-show-wish')
 if(t){
  t=t.getElementsByTagName('a')
  for(i=0;i<t.length;i++)T[T.length]=t[i]
 }
 t=document.getElementById('m-bath')
 if(t){
  t=t.getElementsByTagName('a')
  for(i=0;i<t.length;i++)T[T.length]=t[i]
 }
 if(T.length){
  for(i=0;i<T.length;i++){
   I=T[i].getElementsByTagName('img')[0]
   if(document.all)I.style.filter='blendTrans(duration=0.3)'
   I.onmouseover=I.onmouseout=rollMe
  }
 }
 
 l=document.links
 for(i=0;i<l.length;i++)
  l[i].onfocus=lFocus

 l=document.getElementById('info').cloneNode(true)
 l.className='spod'
 document.getElementById('logo').appendChild(l)

 if(window.pseudotitles)pseudotitles()

 mBox=document.getElementById('menu')
 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'
 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 pseudotitles(e,i,a,h){
 e=document.getElementsByTagName('span')
 for(i=0,h=e.length;i<e.length;i++)if(~e[i].className.indexOf('title')){
  a=e[i].previousSibling
  e[i].style.zIndex=h--;a.title=''
  a.onmouseover=function(){this.nextSibling.style.visibility='visible'}
  a.onmouseout=function(){this.nextSibling.style.visibility='hidden'}
 }
}
