

function check_wiadomosc()
{
if(document.mes.imie.value=="")
{
alert("Proszę wpisać imię");
return false;
	}

	
if(document.mes.email.value=="" && document.mes.tel.value=="")
{
alert("Proszę wpisać nr telefonu lub adres e-mail");
return false;
	}


if(document.mes.email.value!="" )
{
if(!email_validate(document.mes.email.value)){
alert("Nieprawidłowy adres e-mail");
		return false;
	}
	}


if(document.mes.wiadomosc.value=="" )
{
alert("Proszę wpisać treść wiadomości");
return false;
	}
	
return true;
}



function check_kient()
{
if(document.zgloszenie.imie.value=="")
{
error_nul('imie');
scrollTo(0,0);	
alert("Proszę wpisać imię");
return false;
	}
ok_elemnt('imie');	
	
if(document.zgloszenie.nazwisko.value=="")
{
error_nul('nazwisko');
scrollTo(0,0);	
alert("Proszę wpisać nazwisko");
return false;
	}
	ok_elemnt('nazwisko');	
	
		
if(document.zgloszenie.tel.value=="")
{
error_nul('tel');
scrollTo(0,200);
alert("Proszę wpisać nr telefonu");
return false;
	}
	ok_elemnt('tel');	
	

		
if(document.zgloszenie.city.value=="" && document.zgloszenie.othercity.value=="")
{
alert("Proszę wybrać miejscowość lub wspisać");
return false;
	}

return true;
}



function email_validate(src) 
{
  var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
  return regex.test(src);
}

// menu
var menuOtw=false;
function close_menu(num)
{
	if (document.getElementById('menu_cat_'+num))
		document.getElementById('menu_cat_'+num).className='menu1_off';
}

function menu_cat_change(num) {
	if (menuOtw==num){
    close_menu(menuOtw);
    menuOtw=false;
  } else {  
    if (menuOtw!=false) close_menu(menuOtw);			
   
    if (document.getElementById('menu_cat_'+num))
      document.getElementById('menu_cat_'+num).className='menu1_on';      
	menuOtw=num;
  }
  return false;  
}

function MenuStart(dId) {
  menu_cat_change(dId);
}


function error_nul(element) {
	
document.getElementById(element).className = 'error_null';

        }

function ok_elemnt(element) {
	
document.getElementById(element).className = 'SELECT';

        } 
 function liczby(x){
x.value=x.value.replace(/\D/g,'')
}       
