//Written by Bogdan Blaszczak/BlaTek

function preloadMenu(I,i){
  for(I=[],i=0;i<20;i++)I[i]=new Image()
  I[0].src='img/callback.gif'
  I[1].src='img/callback_on.gif'
  I[2].src='img/callback_pl.gif'
  I[3].src='img/callback_pl_on.gif'

  I[4].src='img/menu_mr_business.gif'
  I[5].src='img/menu_mr_business_on.gif'
  I[6].src='img/menu_mr_local.gif'
  I[7].src='img/menu_mr_local_on.gif'
  I[8].src='img/menu_mr_individual.gif'
  I[9].src='img/menu_mr_individual_on.gif'
  I[10].src='img/menu_mr_agency.gif'
  I[11].src='img/menu_mr_agency_on.gif'

  I[12].src='img/menu_mr_biznes.gif'
  I[13].src='img/menu_mr_biznes_on.gif'
  I[14].src='img/menu_mr_wladze.gif'
  I[15].src='img/menu_mr_wladze_on.gif'
  I[16].src='img/menu_mr_osoba.gif'
  I[17].src='img/menu_mr_osoba_on.gif'
  I[18].src='img/menu_mr_firma.gif'
  I[19].src='img/menu_mr_firma_on.gif'
}
//preloadMenu()

onload=function(t,i,l,I,T,e,d){
 if(!document.getElementById)return

 T=[]
 t=document.getElementById('callback')
 if(t){
  t=t.getElementsByTagName('a')
  for(i=0;i<t.length;i++)T[T.length]=t[i]
 }

 t=document.getElementById('who-are-you')
 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='CUTthis'
 i='StaFF'
 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].style.display="inline"
  }
  l[i].onfocus=lFocus
 }

 setBlBoxOverlay()
// if(window.setForm)setForm()
 if(window.setEnquiryServices)setEnquiryServices(document.forms[0])

 l=document.getElementById('menu-textsize')
	if(l){
		l.style.display='block'
		l=l.getElementsByTagName('ul')[0].getElementsByTagName('li')
		for(i=0;i<l.length;i++)
		l[i].getElementsByTagName('a')[0].onclick=new Function('setTextSize('+i+');return false')
	}
}

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){}')
}

// bl-box
function setBlBoxOverlay(e,dH,wH){
 if(!document.getElementById)return
 e=document.getElementById('bl-box-overlay')
 if(!e)return
 dH=document.body.offsetHeight
 wH=self.innerHeight||document.documentElement.clientHeight
 if(dH<wH)e.style.height=wH+ 'px'
 else e.style.height=dH+ 'px'

// e.style.height=document.documentElement.scrollHeight+ 'px'
}
onresize=setBlBoxOverlay

function closeBlBox(nr){
 var e,i;
 if(!document.getElementById)return
 e=document.getElementById('bl-box-overlay')
 if(e)e.style.display='none'
 e=document.getElementById('bl-box')
 if(e)e.style.display='none'
 e=e.getElementsByTagName('div')
 for(i=0;i<e.length;i++)
  if(e[i].className=='bl-box-content') {
   e[i].style.visibility='hidden'
   e[i].style.display='none'
  }
 if(!nr) {
  e=document.getElementById('bl-box').getElementsByTagName('div')
  for(i=0;i<e.length;i++)if(e[i].className=='bbc-in bbc-in2')location.replace(location.href)
 }
}
function openBlBox(id,e){
 if(!document.getElementById)return
 closeBlBox(true)
 e=document.getElementById('bl-box-overlay')
 if(e)e.style.display='block'

 e=document.getElementById('bl-box')
 if(e)e.style.display='block'
 e=document.getElementById(id)
 if(e)e.style.visibility='visible'
 if(e)e.style.display='block'
}


// Menu Tree
function taggleTree(t,i,e){
 if(!document.getElementById)return
 e=t.parentNode.parentNode

 //hide all
 e=e.getElementsByTagName('li')
 for(i=0;i<e.length;i++)e[i].className='fold'

 e=t.parentNode.className='unfold'
}




function setTextSize(s){
 document.getElementById('top').className='cb'+s
}

function popup(x,s,w,h,l,t,n,O){
s=s?'yes':'no';w=w?w:'640';h=h?h:'560';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
}


// Form(s)
function trim(x){return x.replace(/\s+$|^\s+/g,'')}
function isPhone(x){return /^[0-9+\-() ]{8,}$/i.test(x)}
function isEmail(x){return /^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(x)}


function recommendForm(t,e){
 e=t.fromname
 e.value=trim(e.value)
 if(e.value==''){e.focus();alert('Write Your Name!');return!1}
 e=t.fromemail
 e.value=trim(e.value)
 if(!isEmail(e.value)){e.focus();alert('Your E-mail address is not correct!');return!1}
 e=t.toname
 e.value=trim(e.value)
 if(e.value==''){e.focus();alert('Write Your Friend\'s Name!');return!1}
 e=t.toemail
 e.value=trim(e.value)
 if(!isEmail(e.value)){e.focus();alert('Your Friend\'s E-mail is not correct!');return!1}
 return!0
}


/*
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=220')
 return O.opener&&O.opener==self
}
*/
