var flg1=0; var flg2=0; var flg3=0; var flg4=0;
function clrfld (fld) {
	if (fld==1) {if (flg1==0) {document.odform.ime.value=''; flg1=1; document.odform.ime.focus();} }
	if (fld==2) {if (flg2==0) {document.odform.email.value=''; flg2=1; document.odform.email.focus();} }
	if (fld==3) {if (flg3==0) {document.odform.mesto.value=''; flg3=1; document.odform.mesto.focus();} }
	if (fld==4) {if (flg4==0) {document.odform.telefon.value=''; flg4=1; document.odform.telefon.focus();} }
}

var flg1a=0; var flg2a=0;
function clrfld2 (fld) {
	if (fld==1) {if (flg1a==0) {document.odform2.username.value=''; flg1a=1; document.odform2.username.focus();} }
	if (fld==2) {if (flg2a==0) {document.odform2.password.value=''; flg2a=1; document.odform2.password.focus();} }
}

function dopost() {
	if (document.odform.ime.value.length < 3) {document.odform.ime.focus(); alert ("Molimo Vas unesite Vaše ime"); return;}
	if (document.odform.email.value.length < 7) {document.odform.email.focus(); alert ("Molimo Vas unesite Vaš e-mail"); return;}
	if (document.odform.mesto.value.length < 2) {document.odform.mesto.focus(); alert ("Molimo Vas unesite Vaše mesto prebivališta"); return;}
	if (flg1 && flg2 && flg3) {
        upb = document.getElementById('upButton');
        upb.value = "procesiram ...";
        upb.disabled = true;

	   document.odform.submit()
	} else {alert ("Molimo Vas unesite sva tražena polja");};
}

function dopost2() {
	if (document.odform2.username.value.length < 3) {document.odform2.username.focus(); alert ("Molimo Vas unesite Vaše korisnicko ime"); return;}
	if (document.odform2.password.value.length < 5) {document.odform2.password.focus(); alert ("Molimo Vas unesite Vašu šifru"); return;}
	if (flg1a && flg2a) {
        upb = document.getElementById('upButton2');
        upb.value = "procesiram ...";
        upb.disabled = true;

	   document.odform2.submit()
	} else {alert ("Molimo Vas unesite sva tražena polja");};
}

var bl_flg1=0; var bl_flg2=0; var bl_flg3=0; var bl_flg4=0;
function bl_clrfld (bl_fld) {
	if (bl_fld==1) {if (bl_flg1==0) {document.bl_form.bime.value=''; bl_flg1=1;document.bl_form.bime.focus();} }
	if (bl_fld==2) {if (bl_flg2==0) {document.bl_form.bemail.value=''; bl_flg2=1;document.bl_form.bemail.focus();} }
	if (bl_fld==3) {if (bl_flg3==0) {document.bl_form.bporuka.value=''; bl_flg3=1;document.bl_form.bporuka.focus();} }
}
function bl_dopost() {
	if (document.bl_form.bime.value.length < 3) {document.bl_form.bime.focus(); alert ("Molimo Vas unesite Vaše ime"); return;}
	if (document.bl_form.bemail.value.length < 7) {document.bl_form.bemail.focus(); alert ("Molimo Vas unesite Vaš e-mail"); return;}
	if (document.bl_form.bporuka.value.length < 3) {document.bl_form.bporuka.focus(); alert ("Molimo Vas unesite Vašu poruku"); return;}
	if (bl_flg1 && bl_flg2 && bl_flg3) {
        upb = document.getElementById('bl_upButton');
        upb.value = "procesiram ...";
        upb.disabled = true;

	   document.bl_form.submit()
	} else {alert ("Molimo Vas unesite sva tražena polja");};
}

function shd(x) {
    var whichLayer='bl_form_div';
    
    document.getElementById('bid').value = x;
    
    if (document.getElementById) {
        // this is the way the standards work
        var style2 = document.getElementById(whichLayer).style;
        style2.display = style2.display? "":"block";
    } else if (document.all) {
        // this is the way old msie versions work
        var style2 = document.all[whichLayer].style;
        style2.display = style2.display? "":"block";
    } else if (document.layers) {
        // this is the way nn4 works
        var style2 = document.layers[whichLayer].style;
        style2.display = style2.display? "":"block";
    }
}
