function getWindowHeight()
{
var windowHeight=0;
 if (typeof(window.innerHeight)=='number')
 {
 windowHeight=window.innerHeight;
 }else {
       if (document.documentElement&& document.documentElement.clientHeight)
	   {
	   windowHeight=document.documentElement.clientHeight;
	   }else {
             if (document.body&&document.body.clientHeight) { windowHeight=document.body.clientHeight; }
             }
  }
return windowHeight;
}






function getWindowWidth()
{
var windowWidth=0;
 if (typeof(window.innerWidth)=='number')
 {
 windowWidth=window.innerWidth;
 }else {
       if (document.documentElement&& document.documentElement.clientWidth)
	   {
	   windowWidth=document.documentElement.clientWidth;
	   }else {
             if (document.body&&document.body.clientWidth) { windowHeight=document.body.clientWidth; }
             }
  }
return windowWidth;
}



//--------------------------
function SetHeight()
{
var H=0;

H=getWindowHeight();

$('#ReadPaper').height(H-20);
}





//--------------------------
function  ShowList()
{
 $('#HomeIntro').hide(1000);
 $('#HomeIntroText').hide();
 //$('#container').css({'background-color' : '#141110'});
 $('body').css({'background-color' : '#141110'});

 $('#ListaPCh').show(1000);
}







//--------------------------
function  ShowPaper()
{
$(document).ready(function () {
   $('#ReadPaper').show();
});


}








//--------------------------
function ShowIntro()
{
 setTimeout("$('#HomeIntro').show(800)",100);
 setTimeout("$('#HomeIntroText').show(1400)",700);

 setTimeout("ShowList()",4000);
}




//----
function platnosci_submit() {
err=0;



komunikat='proszę wypełnić formularz';
 if($('#imie').val()=='' || $('#nazwisko').val()=='' ) { err=1;  }

 if($('#email').val()=='' ) { err=1;  }
 if($('#kod_pocztowy').val()=='' ) { err=1;  }
 if($('#miejscowosc').val()=='' ) { err=1;  }
 if($('#ulica').val()=='' ) { err=1;  }
 if($('#telefon').val()=='' ) { err=1;  }



 if($('#ok:checked').val()!=1)
 {
 err=1;
 komunikat='Prosimy o wyrażenie zgody na przetwarzanie danych';
 }



  if(err==0)
  {
  $('#formularz').submit()
  }else{
       alert(komunikat);
       }
}

//-------------------------------------------------------








//sprawdz kod
function CheckCode(typplatnosci,nrgazety)
{
$('#KomunikatTyp'+typplatnosci).text('proszę czekać...').show();



$.post("checker.php", { smsPhone: $('#smsPhone').val(), smsCode: $('#smsCode').val(), eCode: $('#eCode').val(), issue:nrgazety, TypPlatnosci: typplatnosci },
    function(data)
    {

    var tab = data.split("&");


    resultCode=tab[0].split("=");

    if(resultCode[1]==99)
    {
    //$('#KomunikatTyp'+typplatnosci).text('');
    location.href = "http://www.epch.poloniachristiana.pl/czytaj,"+nrgazety+"?konw=1";
    }else{
         resultError=tab[1].split("=");
         $('#KomunikatTyp'+typplatnosci).text(resultError[1]);
         }


    }
  );


}
//-----


