
// zakaldka strona główna

        function zakladka(num){
        
                switch(num){
                        case 1:
                        document.getElementById("zh1").className = 'zactv';
                        document.getElementById("zh2").className = 'zkl';
                        document.getElementById("ztxt1").className = 'odkryj';
                        document.getElementById("ztxt2").className = 'ukryj';
                        break;
                        case 2:
                        document.getElementById("zh2").className = 'zactv';
                        document.getElementById("zh1").className = 'zkl';
                        document.getElementById("ztxt2").className = 'odkryj';
                        document.getElementById("ztxt1").className = 'ukryj';
                        break;
                        default:
                        document.getElementById("zh1").className = 'zactv';
                        document.getElementById("zh2").className = 'zkl';
                        document.getElementById("ztxt1").className = 'odkryj';
                        document.getElementById("ztxt2").className = 'ukryj';
                        break;
                }
        }
        
        // submenu
        var time = 0;
        function submenu(men){
        clearTimeout(time);
        //document.rel.submenu.style.display = 'none';
        document.getElementById("menu_"+men).className = 'aktiw';
        document.getElementById(men).style.display = 'block';
        }
        
        function ukryj(men){
        document.getElementById("menu_"+men).className = '';
                document.getElementById(men).style.display = 'none';
        }
        
        function usunSubmenu(men){
                time = setTimeout("ukryj("+men+")",300);
        }
        function zmienstyl(men){
                document.getElementById("menu_"+men).className = 'aktiw';
        }
        function ukryjstyl(men){
                document.getElementById("menu_"+men).className = '';
        }
        
        // funkcja wywolujaca pliki pdf
        function dokpdf(num,adr){
        window.location="/generate_pdf.php?id="+num+"&adr="+adr;
                        //   window.open("/generate_pdf.php?id="+num,"okno","scrollbars=1,left=10,top=10,screenX=10,screenY=10,width=600,height=400,");
        }
        
      
        
         // funkcja wydruk z modulu aktualnosci
        
        function drukNews(num){
                window.open("/print_news.php?id="+num,"_blank","scrollbars=1,centerscreen=1,toolbar=no,screenX=10,screenY=10,width=600,height=400,");
        }
        
        // funkcja wydruk z modulu edytor html
        
        function drukHtml(num){

                window.open("/print_html.php?id="+num,"_blank","scrollbars=1,centerscreen=1,toolbar=no,screenX=10,screenY=10,width=600,height=400,");
        }
         function drukOsrodek(num){
                window.open("/print_osrodek.php?id="+num,"_blank","scrollbars=1,centerscreen=1,toolbar=no,screenX=10,screenY=10,width=600,height=400,");
        }
        
        function checkform(){
        if (document.getElementById("f1").value == "") {
              alert("Proszę podać nazwę firmy.");
              document.getElementById('f1').style.borderColor='red';
              document.getElementById("f1").focus();
        return false;
        }
        else{
        document.getElementById('f1').style.borderColor='';
        }
        if (document.getElementById("f2").value == "") {
              alert("Proszę podać numer NIP, prawidłowy format to: 1234567890.");
              document.getElementById('f2').style.borderColor='red';
              document.getElementById("f2").focus();
        return false;
        }
        else{
        document.getElementById('f2').style.borderColor='';
        }
       
        if (document.getElementById("f4").value == "") {
              alert("Proszę podać nazwę miasta w którym siedzibę ma Państwa firma.");
              document.getElementById('f4').style.borderColor='red';
              document.getElementById("f4").focus();
        return false;
        }
        else{
        document.getElementById('f4').style.borderColor='';
        }
        if (document.getElementById("f5").value == "") {
              alert("Proszę podać nazwę ulicy i nr przy jakiej znajduję się Państwa firma.");
              document.getElementById('f5').style.borderColor='red';
              document.getElementById("f5").focus();
        return false;
        }
        else{
        document.getElementById('f5').style.borderColor='';
        }
        if (document.getElementById("f6").value == "") {
              alert("Proszę podać kod pocztowy.");
              document.getElementById('f6').style.borderColor='red';
              document.getElementById("f6").focus();
        return false;
        }
        else{
        document.getElementById('f6').style.borderColor='';
        }
    
       
       
        if (document.getElementById("f11").value == "") {
              alert("Proszę podać imię i nazwisko osoby kontaktowej.");
              document.getElementById('f11').style.borderColor='red';
              document.getElementById("f11").focus();
        return false;
        }
        else{
        document.getElementById('f11').style.borderColor='';
        }
        if (document.getElementById("f12").value == "") {
              alert("Proszę podać adres e-mail osoby kontaktowej.");
              document.getElementById('f12').style.borderColor='red';
              document.getElementById("f12").focus();
        return false;
        }
        else{
        document.getElementById('f12').style.borderColor='';
        }
        if (document.getElementById("f13").value == "") {
              alert("Proszę podać nr telefonu osoby kontaktowej.");
              document.getElementById('f13').style.borderColor='red';
              document.getElementById("f13").focus();
        return false;
        }
        else{
        document.getElementById('f13').style.borderColor='';
        }
        }
        
        function otworz(url, w, h){
        window.open(url,"okno","scrollbars=1,left=10,top=10,screenX=10,screenY=10,width="+w+",height="+h+",");
        }
        
        function rezerwacjaSzkolenia(idsz,nip,os){
      
        window.open("/rezerwacja.php?id="+idsz+"&nip="+nip+"&os="+os,"okno","scrollbars=1,left=10,top=10,screenX=10,screenY=10,width=500,height=600,");
        }
