function openWindow(link) // inspired by porneL - http://pornel.net/pups/
{
  try
  {
    var new_window = window.open(link, '_blank');
    if(new_window) return false;
  }
  catch(e){}
  return true;
}

function cherPoberi(){
    var myScreenW = document.body.clientWidth;
    if(myScreenW<1200){
        document.getElementById('spcImg').style.width=myScreenW+'px';
        var wsp = myScreenW/1200;
        document.getElementById('enter').style.width=(500*wsp)+'px';
        document.getElementById('o1').style.width=(481*wsp)+'px';
        document.getElementById('o2').style.width=(155*wsp)+'px';
        document.getElementById('o3').style.width=(50*wsp)+'px';
        document.getElementById('o4').style.width=(282*wsp)+'px';
    }
}

function checkRequiredFields(form_id)
{
  ok = true;
  fields = document.getElementsByTagName('input');
  for(var i in fields) if(fields[i].className=='text required')
  {
    if(fields[i].parentNode.parentNode.parentNode.id==form_id && !fields[i].value) ok = false;
  }
  fields = document.getElementsByTagName('textarea');
  for(var i in fields) if(fields[i].className=='required')
  {
    if(fields[i].parentNode.parentNode.parentNode.id==form_id && !fields[i].value) ok = false;
  }
  if(ok)
  {
    //document.getElementById('submit_'+form_id).disabled = 'disabled';
    return true;
  }
  alert('You have to fill all the required fields (marked with asterisk).');
  return false;
}

function addMenuHover()
{
  m = document.getElementsByTagName('li');
  for(var i in m) if(m[i].innerHTML && m[i].parentNode.parentNode.id=='header' && m[i].className=='pierwsze')
  {
    id = m[i].id;
    m[i].onmouseover = function()
    {
      document.getElementById('s'+id).style.display = 'block';
    }
    m[i].onmouseout = function()
    {
      document.getElementById('s'+id).style.display = 'none';
    }
  }
}



function testEmail(adres) {
     if (adres != "") {
          var re = new RegExp("[^@]{1,}[@]{1}[^@.]{1,}[.]{1}[^@]{1,}","gi");
          var wynik = re.test(adres);
          if (wynik == true) {
               return true;
          }
          if (wynik == false) {
              // alert("Nieprawidlowy adres e-mail.");
               return false;
          }}}




function check(t){
 go = false;
  if(t.email.value.length==0){
  alert('Wpisz e-mail');
  }else if(!testEmail(t.email.value)) {go = false; alert('nieprawidlowy adres e-mail');}
  else go = true;
 return(go);
}


/*function zmienFilm(numer){
      var film = numer;
    
      var kod = "<object><embed src='http://aperitif.eurohost.com.pl/files/panorama/aperitif"+ film +".mov' width='400' height='300' quality='high' /></object>";
      
      document.getElementById('blokFilmy').style.display = '';
      document.getElementById('blokFilmy').innerHTML = kod;
    }
*/


  
//--><!]]></script>


/*onload = function()

<object><embed src='http://aperitif.eurohost.com.pl/files/panorama/aperitif"+ film +".mov' width='400' height='300' quality='high' /></object>

{
  a = document.getElementsByTagName('a');
  for(var i in a) if(a[i].innerHTML && (a[i].className=='nw' || a[i].className=='photo nw'))
  {
    a[i].target = '_blank';
  }
}*/
