function target_new(pag){
 if (typeof pag!='string') pag = pag.href;
 window.open(pag,'new','menubar=yes, location=yes, resizable=yes, scrollbars=yes, status=yes, toolbar=yes, directories=yes').focus()
 return false;
}

function show_picture_scroll(pag,pic_w,pic_h){
  if (typeof pag != 'string') pag=pag.href;
  pic_l=(screen.width)?(screen.width-pic_w)/2:0;
  pic_t=(screen.height)?(screen.height-pic_h)/2:0;
  window.open(pag,'new','menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=no, status=no,width='+(pic_w+20)+', height='+(pic_h+20)+', left='+pic_l+', top='+pic_t).focus()
  return false;
}


function sprawdz_formularz() {

  if (document.getElementById('imie').value == '') {
    alert('Proszę uzupełnić polę Imię i Nazwisko');
    return false;
  }

  if (document.getElementById('stanowisko').value == '') {
    alert('Proszę uzupełnić polę Stanowisko');
    return false;
  }

  if (document.getElementById('firma').value == '') {
    alert('Proszę uzupełnić polę Firma');
    return false;
  }
  
  if (document.getElementById('telefon').value == '') {
    alert('Proszę uzupełnić polę Telefon');
    return false;
  }

  if (document.getElementById('email').value == '') {
    alert('Proszę uzupełnić polę E-mail');
    return false;
  }  
  
  var field1 = document.getElementById('etap');
  var etapik = field1.options[field1.selectedIndex].value;
  if (etapik == '') {
    alert("Proszę wybrać na jakim etapie planowania wdrożenia jest Państwa firma?");
    return false;
  } else {
    return true;
  }  
}

var top1=-50
var inter
inter=setInterval("rotate()",50)

function rotate(){
 if (document.getElementById('nap1') && top1<0){
  top1=top1+2
  $('nap1').style.marginTop=top1+'px'
 }
 else{
  clearInterval(inter)
  top1=-40
  inter=setInterval("rotate2()",50)
 }
}

function rotate2(){
 if (document.getElementById('nap2') && top1<34){
  top1=top1+2
  $('nap2').style.marginTop=top1+'px'
 }
 else clearInterval(inter)
}

function $(el){return document.getElementById(el)}


var opac=0

function sss(plus){
 if($('nap3').filters)
  $('nap3').filters.alpha.opacity=opac
 if($('nap3').style.MozOpacity) 
  $('nap3').style.MozOpacity=opac/100
 opac+=10
 if(opac!=100){ 
  setTimeout("sss("+plus+")",100)
 }
 else{
  opac=0
  sss2(1000)
 }
}

function sss2(plus){
 if($('nap4').filters)
  $('nap4').filters.alpha.opacity=opac
 if($('nap4').style.MozOpacity) 
  $('nap4').style.MozOpacity=opac/100
 opac+=10
 if(opac!=100){ 
  setTimeout("sss2("+plus+")",100)
 }
}

