$(document).ready(function() { 
    if ( (document.referrer.match(/bankier\.pl/) || document.referrer.match(/google/)) && document.referrer.match(/http/) ) { 

        // enable transparent overlay on FF/Linux 
        $.blockUI.defaults.applyPlatformOpacityRules = false;
        $.blockUI.defaults.css = {
                  padding: '10px',
                  textAlign: 'center',
                  border: '3px solid #E1D058',
                  cursor: 'normal',
                  top: '20%',
                  left: '23%',
                  backgroundColor:'#FFF6B7',
                  width: '50%',
        };

        $.blockUI({ message: $('#topLayerForm') }); 
        $('#topLayerClose').click($.unblockUI);


        //setTimeout($.unblockUI, 0); 
    }; 
    //r = $("div#recInner").height()
    //   if (r == 0) {
    //     $("div#recInner").load('/wiadomosci/ #polecamy');
    //   }
});

function emcode (user,domain,str,st,subject) {
   var re = /\//g ;
   user = user.replace(re,'.') ;
   domain = domain.replace(re,'.') ;
   if(str.length < 1) {
      str = user + '&#64;' + domain ;
   }
   document.write('<a ') ;
   if(st.length > 0) {
      document.write(st + ' ') ;
   }

   if(typeof varName == 'undefined')
      subject=''; 
   if(subject.length > 0) {
      subject = '?subject=' + subject ;
   }
   
   if(typeof message_body == 'undefined' )
      message_body='';
   if(message_body) {
      body = '&body=' + message_body;
   } else {
      body = '';
   }

   document.write('href="ma' + 'ilto:' + user + '&#64;' + domain + subject + body + '">' + str + '</a>') ;
}


function emailVerify0() {
   var f = document.emailForm;
   if ( ! f.email.value.match(/^([\w-]+(?:[\.\+][\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i)) {
      alert('Proszę podać prawidłowy adres e-mail.');
      f.email.focus();
      return false ;
   }
   return true;
}

function emailVerify() {
   var f = document.newsletterForm;
   if ( ! f.email1.value.match(/^([\w-]+(?:[\.\+][\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i)) {
      alert('Proszę podać prawidłowy adres e-mail.');
      f.email1.focus();
      return false ;
   } else if (f.email1.value !== f.email2.value) {
      alert('Podane adresy nie zgadzają się!');
      f.email2.focus();
      return false ;
   }
   if ( ( ! f.agree.checked ) && ( ! f.unsubscribe.checked) ) {
      alert('Konieczne jest wyrażenie zgody na otrzymywanie pocztą elektroniczną publikacji i informacji zawierających reklamy.');
      f.agree.focus()
      return false;
   }
   return true;
}




