//Written by Bogdan Blaszczak/BlaTek

function preloadMenu(I,i){
  for(I=[],i=0;i<6;i++)I[i]=new Image()
  I[0].src='img/menu_home_construction_on.jpg'
  I[1].src='img/menu_home_kitchens_on.jpg'
  I[2].src='img/menu_home_property_on.jpg.jpg'
  I[3].src='img/menu_home_bathrooms_on.jpg'
  I[4].src='img/menu_home_gardens_on.jpg'
  I[5].src='img/menu_home_energy_on.jpg'
}
preloadMenu()


onload=function(i,l,e,d,t,T,I){
 if(!document.getElementById)return
 if(window.initLightbox) startLightbox()

 T=[]
 t=document.getElementById('mlm')
 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(I){
    if(document.all)I.style.filter='blendTrans(duration=0.3)'
    I.onmouseover=I.onmouseout=rollMe
   }
  }
 }

 d='CUTthisBe'
 i='4eSeeendING'
 d=new RegExp(e=d+i)
 l=document.links
 for(i=0;i<l.length;i++){
  if(~l[i].href.indexOf(e)){
   l[i].innerHTML=l[i].innerHTML.replace(d,'')
   l[i].href=l[i].href.replace(d,'')
  }
  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\.jpg/i,'.jpg'):this.src.replace(/.jpg/i,'_on.jpg')
 if(f)eval('try{f[0].Play()}catch(Er){}')
}


function startLightbox(){
 initLightbox()

if((query={})&&location.search)
 eval("query={'"+location.search.substr(1).replace(/=/g,"':unescape('").replace(/&/g,"'),'").replace(/\+/g,' ')+"')}")
var numpic,linkpic;
 if(query['pic']){
  numpic=query['pic'].replace(/\D/g,'')-1
  if(numpic>=0)linkpic=document.getElementById('miniatures').getElementsByTagName('a')[numpic]
  if(linkpic)myLightbox.start(linkpic)
 }

 var l=document.getElementById('gallery-loading')
 if(l)l.style.display='none'
 l=document.getElementById('miniatures')
 if(l)l.style.visibility='visible'
}
document.write("<style>#miniatures {visibility:hidden}</style>");



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 popup(x,s,w,h,l,t,n,O){
s=s?'yes':'no';w=w?w:'430';h=h?h:'370';l=l?l:'50';t=t?t:'50';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
}
function recommend(x,O){
 O=window.open(x,'recWin','left=100,top=120,width=400,height=220')
 return O.opener&&O.opener==self
}
