﻿function ChkFrmKontakt(aLang) 
{
    var pMsg = "";
    var pErr = 0;
    var pFrmName = "KontaktFrm";
	
    if (!(trim(document.forms[pFrmName].nazwa.value).length > 0)) 
	{

        pErr = 1;

        if (aLang == 0) {

            pMsg = pMsg + "Proszę wpisać imię i nazwisko!\n\n";

        }

    }
	if(pErr==0)
	{

		if ((document.forms[pFrmName].nazwa.value=='imię nazwisko' )) 
		{

			pErr = 1;

			if (aLang == 0) 
			{

				pMsg = pMsg + "Proszę wpisać imię i nazwisko!\n\n";

			}
		}
	}
    
    if (!(trim(document.forms[pFrmName].email.value).length > 0)) 
	{

        pErr = 1;

        if (aLang == 0) {

            pMsg = pMsg + "Proszę wpisać email!\n\n";

        }

    }
    
    
    if ((document.forms[pFrmName].email.value=='email' )) 
	{

        pErr = 1;

        if (aLang == 0) {

            pMsg = pMsg + "Proszę wpisać email!\n\n";

        }
	}	
        
   if (!(trim(document.forms[pFrmName].tresc.value).length > 0)) {

        pErr = 1;

        if (aLang == 0) {

            pMsg = pMsg + "Proszę wpisać treść pytania!\n\n";

        }

    }
        

    if (pErr == 1) {

        if (aLang == 0) {

            pMsg = pMsg + "Proszę uzupełnić brakujące informacje.";

        }

        alert(pMsg);
        

    }
    else {

        document.forms[pFrmName].submit();

    }
    
}




function ChkFrm(aLang) {

    var pMsg = "";
    var pErr = 0;
    var pFrmName = "datform";
    

    if (!(trim(document.forms[pFrmName].nazw.value).length > 0)) {

        pErr = 1;
        
        if (aLang == 0) {

            pMsg = pMsg + "Nie wprowadzono imienia, nazwiska lub nazwy!\n\n";
        
        }

    }

    if (!(trim(document.forms[pFrmName].kodp.value).length > 0)) {

        pErr = 1;

        if (aLang == 0) {

            pMsg = pMsg + "Nie wprowadzono kodu pocztowego!\n\n";

        }

    }


    if (!(trim(document.forms[pFrmName].miej.value).length > 0)) {

        pErr = 1;

        if (aLang == 0) {

            pMsg = pMsg + "Nie wprowadzono miejscowowści!\n\n";

        }

    }

    if (!(trim(document.forms[pFrmName].adre.value).length > 0)) {

        pErr = 1;

        if (aLang == 0) {

            pMsg = pMsg + "Nie wprowadzono adresu!\n\n";

        }

    }
    

    if (!(trim(document.forms[pFrmName].mail.value).length > 0)) {

        pErr = 1;

        if (aLang == 0) {

            pMsg = pMsg + "Nie wprowadzono emaila!\n\n";

        }

    }

    if (!(trim(document.forms[pFrmName].telk.value).length > 0)) {

        pErr = 1;

        if (aLang == 0) {

            pMsg = pMsg + "Nie wprowadzono telefonu kontaktowego!\n\n";

        }

    }
    
    
    

    if (pErr == 1) {

        if (aLang == 0) {

            pMsg = pMsg + "\n\nProszę uzupełnić brakujące informacje.";
        
        }

        alert(pMsg);

    }
    else {

        document.forms[0].submit();
    
    }
}

function trim(aString) {
    return aString.replace(/^\s+|\s+$/g, "");
}


    function Pok(aI) {        
        if (aI >= 0) 
        {            
            var pT = "MENU" + aI;            
            document.getElementById(pT).style.backgroundImage = "url(./rys/menu_o.png)";            
            
        }
     }

     function Ukr(aI) {
         if (aI >= 0) {
                 var pT = 'MENU' + aI;
               document.getElementById(pT).style.backgroundImage = "url(./rys/menu.png)";
         }
     }

     function PoU(aN) {
         if (document.getElementById(aN)) {
             document.getElementById(aN).style.textDecoration = "underline";
         }
     }

     function UkU(aN) {
         if (document.getElementById(aN)) {
             document.getElementById(aN).style.textDecoration = "none";
         }
     }

     function PoCC(aN) {
         if (document.getElementById(aN)) {
             document.getElementById(aN).style.visibility = "visible";
         }
     }

     function UkCC(aN) {
         if (document.getElementById(aN)) {
             document.getElementById(aN).style.visibility = "hidden";
         }
     }


            
    
    
    
