function ProveriUnose(){
	
	// global variable
	var Ok=true;
	
	// custom variables
	var name = window.document.getElementById('txtIme');
	var firmName = window.document.getElementById('txtNazivFirme');
	var mail = window.document.getElementById('txtEmail');
		var mailError = window.document.getElementById('mailError');		
	var txtPitanje = window.document.getElementById('txtPitanje');
	var idea = window.document.getElementById('txtMojaZamisao');
	var grForm = window.document.getElementById('grForm');
	var grPitanje = window.document.getElementById('grPitanje');
	
	// defalut CSS classes and states
	name.className="textbox";
	firmName.className="textbox";
	mail.className="textbox";
		mailError.innerHTML = "";
	txtPitanje.className="textbox";
	idea.className="textarea";
	grForm.style.display='none';
	grPitanje.style.display="none";

	// antispam check
	var antiSpam = window.document.getElementById('txtPitanje').value;
	if(
	      antiSpam!='Да'
	   && antiSpam!='дА'
	   && antiSpam!='ДА'
	   && antiSpam!='да'
	   && antiSpam!='Da'
	   && antiSpam!='dA'
	   && antiSpam!='DA'
	   && antiSpam!='da'
	   ){
		txtPitanje.className = 'box-error';
		grPitanje.style.display = "";
		Ok=false;
		}
	
	// validate empty fields (name, firmName, mail)
	var required = new Array(name,firmName,mail);	
	for (i=0;i<required.length;i++) {
		if (required[i].value == ""){
			required[i].className = "box-error";
			Ok = false;
		}
	}
	
	// textarea validation
	if(idea.value == ""){
		idea.className='textarea-error';
		Ok=false;
	}
	
	// mail pattern
	var mailFileter = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	if (!mailFileter.test(mail.value)){			
		mail.className = "box-error";
		//alert("Upisite validnu email adresu!");
		mailError.innerHTML = "Upišite validnu email adresu";
		Ok = false;
		}
	
	// main error message
	if(!Ok){
		grForm.style.display='';

		}
return Ok;
}