//Written by Bogdan Blaszczak/BlaTek

function preloadMenu(I,i){
  for(I=[],i=0;i<11;i++)I[i]=new Image()
  I[0].src='img/menu_company_on.gif'
  I[1].src='img/menu_product_on.gif'
  I[2].src='img/menu_gallery_on.gif'
  I[3].src='img/menu_get_on.gif'
  I[4].src='img/menu_contact_on.gif'
  I[5].src='img/menu_feedback_on.gif'
  I[6].src='img/menu_favourites_on.gif'
  I[7].src='img/menu_recommend_on.gif'

  I[8].src='img/doors/american_oak.jpg'
  I[9].src='img/doors/meranti.jpg'
  I[10].src='img/doors/douglas_fir.jpg'
}
preloadMenu()

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('menu-bottom1')
 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
  }
 }
 
 if(l=document.getElementById('suggest'))l.checked=!0
 if(document.getElementById('conf-lay'))setPrice()
// if(document.getElementById('install-lay'))setPrice2()
 if(document.getElementById('wood-img'))setMaterial()
 if(window.initGallery)window.initGallery()

 l=document.links
 for(i=0;i<l.length;i++)
  l[i].onfocus=lFocus
}

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 bookmarkit(){
 if(!window.external&&!window.sidebar){
  alert('Your browser doesn\'t support this feature. Please go to Bookmarks menu and add the site manually.')
  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=100,top=120,width=400,height=200')
 return O.opener&&O.opener==self
}
