function checkformpretraga ( form )
{
	
  if (form.tip.value == "0") {
    alert( "Molimo Vas izaberite tip!" );
    form.tip.focus();
    return false ;
  }

  return true ;
}



function checkformformular ( form )
{
	
  if (form.naziv.value == "") {
    alert( "Molimo Vas unesite naziv agencije !" );
    form.naziv.focus();
    return false ;
  }
  
  
  if (form.adresa.value == "") {
    alert( "Molimo Vas unesite adresu !" );
    form.adresa.focus();
    return false ;
  }
  
  if (form.email.value == "") {
    alert( "Molimo Vas unesite e-mail !" );
    form.email.focus();
    return false ;
  }
  
  
    if (form.email.value != "") {
    var x = form.email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(x))
	{ alert("Molimo Vas unesite ispravnu e-mail adresu!");
    form.email.focus();
    return false ;
	}
  }
  
  return true ;
}

function checkformninteresanja ( form )
{
	
  if (form.email.value == "") {
    alert( "Molimo Vas unesite e-mail !" );
    form.email.focus();
    return false ;
  }
  
  
    if (form.email.value != "") {
    var x = form.email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(x))
	{ alert("Molimo Vas unesite ispravnu e-mail adresu!");
    form.email.focus();
    return false ;
	}
  }
  
  
  if (form.tip.value == "0") {
    alert( "Molimo Vas izaberite tip!" );
    form.tip.focus();
    return false ;
  }
  
  if (form.grad.value == "0") {
    alert( "Molimo Vas izaberite grad!" );
    form.grad.focus();
    return false ;
  }  
  

  return true ;
}



function Disable(tip1) {

var tip = tip1.options[tip1.selectedIndex].value;

if(tip == 1){
  document.getElementById("povrsina1").style.backgroundColor = "#5E5B4E";
  document.getElementById("povrsina2").style.backgroundColor = "#5E5B4E";
  document.getElementById("povrsina1").disabled=true; 
  document.getElementById("povrsina2").disabled=true; 
  document.getElementById("kvadratura1").disabled=false;
  document.getElementById("kvadratura2").disabled=false; 
  document.getElementById("kvadratura1").style.backgroundColor = "#F5F6EE";
  document.getElementById("kvadratura2").style.backgroundColor = "#F5F6EE"; 
}



if(tip == 4){
  document.getElementById("kvadratura1").style.backgroundColor = "#5E5B4E";
  document.getElementById("kvadratura2").style.backgroundColor = "#5E5B4E";
  document.getElementById("kvadratura1").disabled=true;
  document.getElementById("kvadratura2").disabled=true; 
  document.getElementById("povrsina1").disabled=false;
  document.getElementById("povrsina2").disabled=false; 
  document.getElementById("povrsina1").style.backgroundColor = "#F5F6EE";
  document.getElementById("povrsina2").style.backgroundColor = "#F5F6EE";
  
    }

if(tip == 2 || tip == 3 || tip == 5) {
  document.getElementById("kvadratura1").disabled=false;
  document.getElementById("kvadratura2").disabled=false; 
  document.getElementById("povrsina1").disabled=false;
  document.getElementById("povrsina2").disabled=false; 
  document.getElementById("povrsina1").style.backgroundColor = "#F5F6EE";
  document.getElementById("povrsina2").style.backgroundColor = "#F5F6EE";
  document.getElementById("kvadratura1").style.backgroundColor = "#F5F6EE";
  document.getElementById("kvadratura2").style.backgroundColor = "#F5F6EE";
}

}






