function enterField(f1)
{
   if (f1 && f1.style)
   {
     f1.style.background='#FEFDE0';
   }
}

function exitField(f1)
{
   if (f1 && f1.style)
   {
     f1.style.background='#FFFFFF'
   }
}

function changeValue(f1, f2, f3, f4)
{
	f1.getElementById('f2').value = f1.getElementById('f3').value * f4;	
	return true;
}

function checkForm(f1)
{
	if (f1.nazwa.value == ""){
		alert("Proszę wypełnic wymagane pola!!!");
		f1.nazwa.focus();
		return false;
	}
	if (f1.adres.value == ""){
		alert("Proszę wypełnic wymagane pola!!!");
		f1.adres.focus();
		return false;
	}
	if (f1.kod.value == ""){
		alert("Proszę wypełnic wymagane pola!!!");
		f1.kod.focus();
		return false;
	}
	if (f1.poczta.value == ""){
		alert("Proszę wypełnic wymagane pola!!!");
		f1.poczta.focus();
		return false;
	}
	if (f1.mail.value == ""){
		alert("Proszę wypełnic wymagane pola!!!");
		f1.mail.focus();
		return false;
	}
	if (f1.telefon.value == ""){
		alert("Proszę wypełnic wymagane pola!!!");
		f1.telefon.focus();
		return false;
	}
	if (f1.kontakt.value == ""){
		alert("Proszę wypełnic wymagane pola!!!");
		f1.kontakt.focus();
		return false;
	}
	if (f1.regulamin.checked == false){
		alert("Proszę zapoznać się z regulaminem!!!");
	  return false;
	}
	return true;
}

function checkAdv(f1)
{
	if (f1.words.value == "") {
		return false;
	}
	return true;
}

function checkOn(obj){
  $(obj).css('background-color', '#B3C3E5');
}

function checkOff(obj){
  $(obj).css('background-color', '');
}

function waliduj_change_pass(form){
  if(form.pass_old.value == ''){
    alert('Prosze wpisać stare hasło!');
    return false;
  }
  if(form.pass_new.value == ''){
    alert('Prosze podać nowe hasło!');
    return false;
  }
  if(form.pass_new2.value == ''){
    alert('Proszę powtórzyć nowe hasło!');
    return false;
  }
  if(form.pass_new.value != form.pass_new2.value){
    alert('Wpisane Nowe hasło różni się od Powtórz hasło!');
    return false;
  }
  return true;
}
