//Written by Bogdan Blaszczak/BlaTek

function preloadMenu(I,i){
  for(I=[],i=0;i<28;i++)I[i]=new Image()
  I[0].src='img/menu_about.gif'
  I[1].src='img/menu_about_on.gif'
  I[2].src='img/menu_photographs.gif'
  I[3].src='img/menu_photographs_on.gif'
  I[4].src='img/menu_portfolios.gif'
  I[5].src='img/menu_portfolios_on.gif'
  I[6].src='img/menu_special.gif'
  I[7].src='img/menu_special_on.gif'
  I[8].src='img/menu_books.gif'
  I[9].src='img/menu_books_on.gif'
  I[10].src='img/menu_collectibles.gif'
  I[11].src='img/menu_collectibles_on.gif'
  I[12].src='img/menu_contact.gif'
  I[13].src='img/menu_contact_on.gif'

  I[14].src='img/menu_i_about.gif'
  I[15].src='img/menu_i_about_on.gif'
  I[16].src='img/menu_i_photographs.gif'
  I[17].src='img/menu_i_photographs_on.gif'
  I[18].src='img/menu_i_portfolios.gif'
  I[19].src='img/menu_i_portfolios_on.gif'
  I[20].src='img/menu_i_special.gif'
  I[21].src='img/menu_i_special_on.gif'
  I[22].src='img/menu_i_books.gif'
  I[23].src='img/menu_i_books_on.gif'
  I[24].src='img/menu_i_collectibles.gif'
  I[25].src='img/menu_i_collectibles_on.gif'
  I[26].src='img/menu_i_contact.gif'
  I[27].src='img/menu_i_contact_on.gif'
}
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-intro')
 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
  }
 }

 t=document.getElementById('gallery-content1')
 if(t){
  t=t.getElementsByTagName('img')
  for(i=0;i<t.length;i++)t[i].ondragstart=function(){return!1}
 }

 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){}')
}
