﻿
	jQuery(document).ready(function () {
		var form = jQuery('#form');
		var link = jQuery('#show_form');
		var link2 = jQuery('#hide_form');
		form.hide();
		link.show().click(function(){
			link.hide();
			link2.show();
			form.show();
			jQuery('#form INPUT').get(0).focus();
		});
		link2.hide().click(function(){
			link2.hide();
			link.show();
			form.hide();
		});
	});

	

			function sprawdz_formularz()
			{
    		// przypisanie obiektu formularza do zmiennej
    		var f = document.forms['formularz'];
    		// sprawdzenie nazwy firmy
    			if (f.vNowinex_form_nazwa.value == '')
    			{
        			alert('You must enter a company name!');
        			f.vNowinex_form_nazwa.focus();
        			return false;
    			}
    		// sprawdzenie nipu
    		//	if (f.vNowinex_form_nip.value == '')
    		//	{
        	//		alert('Musisz wpisać NIP!');
        	//		f.vNowinex_form_nip.focus();
        	//		return false;
    		//	}
    			
    			
       		// sprawdzenie adresu ulica
    			if (f.vNowinex_form_adres_ulica.value == '')
    			{
        			alert('You must enter a street name!');
        			f.vNowinex_form_adres_ulica.focus();
        			return false;
    			}
    			
          		// sprawdzenie adresu miasto
    			if (f.vNowinex_form_adres_miasto.value == '')
    			{
        			alert('You must enter a city name!');
        			f.vNowinex_form_adres_miasto.focus();
        			return false;
    			} 			
    			
          		// sprawdzenie adresu kod
    			if (f.vNowinex_form_adres_kod.value == '')
    			{
        			alert('You must enter a zip code!');
        			f.vNowinex_form_adres_kod.focus();
        			return false;
    			}
    			
    			
      		// sprawdzenie maila
    			if (f.vNowinex_form_email.value == '')
    			{
        			alert('You must enter email adress!');
        			f.vNowinex_form_email.focus();
        			return false;
    			}
    		// sprawdzenie telefonu
    	//		if (f.vNowinex_form_tel.value == '')
    	//		{
        //			alert('Musisz wpisać numer telefonu!');
        //			f.vNowinex_form_tel.focus();
        //			return false;
    	//		}    					
    		// formularz jest wypelniony poprawnie
    				return true;
			}

