function proveriformu(){
if (document.pitanje.ime.value == '' || document.pitanje.ime.value == "Vaše ime i prezime"){
alert('Unesite Vaše ime!');
document.pitanje.ime.focus();
document.pitanje.ime.select();
return false}
if (document.pitanje.email.value == '' || document.pitanje.email.value == "Vaša e-mail"){
alert('Unesite Vaš e-mail');
document.pitanje.email.focus();
document.pitanje.email.select();
return false}
if (document.pitanje.poruka.value == ''){
alert('Niste uneli poruku!');
document.pitanje.poruka.focus();
document.pitanje.poruka.select();
return false}
if(!valid(document.pitanje.email)) {
return false;
}
alert('Vaša poruka je poslata!');
}
function valid(field2){
var str = field2.value;
if (window.RegExp){
var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
var reg1 = new RegExp(reg1str);
var reg2 = new RegExp(reg2str);
if (!reg1.test(str) && reg2.test(str))
return true;
alert('Unesite Vaš e-mail');
field2.focus();
field2.select();
return false;
}else{
if(str.indexOf("@") >= 0)
return true;
alert('Unesite Vaš e-mail');
field2.focus();
field2.select();
return false;
}
}
sfHover = function() {
var sfEls = document.getElementById("meni").getElementsByTagName("li");
for (var i=0; i<sfEls.length; ++i) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
