//Written by Bogdan Blaszczak/BlaTek
/*
function preloadMenu(I,i){
  for(I=[],i=0;i<3;i++)I[i]=new Image()
  I[0].src='img/menu_mr_business.gif'
  I[1].src='img/menu_mr_business_on.gif'
}
preloadMenu()
*/

onload=function(i,l,e,d){
 if(!document.getElementById)return

 l=document.links
 for(i=0;i<l.length;i++)
  l[i].onfocus=lFocus

 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()

 window.name='itsdonewin';
}

function lFocus(){if(window.aFocus)this.blur()}
document.onmousedown=function(){aFocus=1;setTimeout('aFocus=0',10)}




// 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++)if(e[i].className!='here')e[i].className='fold'

 e=t.parentNode.className='unfold'
}





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;
}

 
}
