//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){
 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
   }
  }
 }

 l=document.links
 for(i=0;i<l.length;i++)
  l[i].onfocus=lFocus

 setBlBoxOverlay()
 if(window.setForm)setForm()
 if(window.setFeedbackForm)setFeedbackForm()

 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')
	}

 window.name='itsdonewin';
}

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(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'
  }
}
function openBlBox(id,e){
 if(!document.getElementById)return
 closeBlBox()
 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,O){
s=s?'no':'yes';w=w?w:'640';h=h?h:'560';l=l?l:'30';t=t?t:'30'
 O=window.open(x,'popWin','left='+l+',top='+t+',width='+w+',height='+h+',scrollbars='+s)
 return O.opener&&O.opener==self
}


// Request Callback Form
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 requestCallback(t,l,e){
 e=t.Name
 e.value=trim(e.value)
 if(e.value==''){e.focus();alert(l=='pl'?'Wpisz imię i nazwisko!':'Write Your Name!');return!1}

 e=t.Tel
 e.value=trim(e.value)
 if(e.value==''){e.focus();alert(l=='pl'?'Podaj numer telefonu!':'Complete telephone number!');return!1}
 if(!isPhone(e.value)){e.focus();alert(l=='pl'?'Nieprawidłowy numer telefonu!':'Telephone is not correct!');return!1}

 return!0
}

function contactForm(t,l,e){
 e=t.Name
 e.value=trim(e.value)
 if(e.value==''){e.focus();alert(l=='pl'?'Wpisz imię i nazwisko!':'Write Your Name!');return!1}

 e=t.Email
 e.value=trim(e.value)
 if(e.value>''&&!isEmail(e.value)){e.focus();alert(l=='pl'?'Nieprawidłowy adres E-mail!':'E-mail is not correct!');return!1}

 e=t.Tel
 e.value=trim(e.value)
 if(e.value>''&&!isPhone(e.value)){e.focus();alert(l=='pl'?'Nieprawidłowy numer telefonu!':'Telephone is not correct!');return!1}

 if(!t.Email.value&&!t.Tel.value)
  {t.Email.focus();alert(l=='pl'?'Podaj co najmniej jeden rodzaj kontaktu: E-mail lub Telefon!':'You must specify at least one contact form: Email or Telephone!');return!1}

 e=t.Message
 e.value=trim(e.value)
 if(~e.value.toLowerCase().indexOf('http://')){e.focus();alert(l=='pl'?'Nie wpisuj "http://" w pole tekstowe!':'Don\'t type "http://" in textarea!');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
}
*/



function validateDelete( l, url )
{
 
var answer = confirm ("Are you sure to remove?")

if (!answer)
{
	window.location=url;
}

 
}