alertstring=''
correct=true

function provjera_forme(){
f=" field"
if(document.getElementById('formamain').elements[0].value=='') {alertstring="name";correct=false}

if(document.getElementById('formamain').elements[1].value=='') {
	correct=false
	if(document.getElementById('formamain').elements[0].value=='') {alertstring+=" and e-mail"; f+="s"}
	else alertstring="e-mail"
}

if(correct) document.getElementById('formamain').submit()
else alert("Please complete the "+alertstring+f)
}
