function formCheck(){
	fali = "";
	
	if (document.obrazac.ime.value == "") fali = fali + "\n- Ime";
	if (document.obrazac.tvrtka.value == "") fali = fali + "\n- Tvrtku";
	if (document.obrazac.brtel.value == "") fali = fali + "\n- Broj telefona";
	if (document.obrazac.poruka.value == "") fali = fali + "\n- Poruku";
	if (fali != "")
	   alert("Niste upisali sve potrebne podatke!" + "\n\n" + "Molimo upišite:" + fali)
	else
	 document.obrazac.submit();
}

function formCheckeb(){
	fali = "";
	
	if (document.obrazac.ime.value == "") fali = fali + "\n- Ime, prezime člana EDZ e-biblioteke";
	if (document.obrazac.tvrtka.value == "") fali = fali + "\n- Naziv poduzeća i adresa poduzeća (ulica i mjesto)";
	if (document.obrazac.adresa.value == "") fali = fali + "\n- Kućna adresa (ulica i mjesto)";
	if (document.obrazac.oib.value == "") fali = fali + "\n- OIB";
	if (document.obrazac.mail.value == "") fali = fali + "\n- e-adresa";
	if (fali != "")
	   alert("Niste upisali sve potrebne podatke!" + "\n\n" + "Molimo upišite:" + fali)
	else
	 document.obrazac.submit();
}

function noviProzor(ime,x,y) {
  eval("window.open('slika.asp?s=" + ime + "','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+ x +",height="+ y +"')")
 }
 
function openImg( sVar, idColor )
{
  eval("var f=window.open('picture.asp?id=" + sVar + "','gallery','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300 ,height=300');f.focus();");
}

function openImg2( sVar, idColor )
{
  eval("var f=window.open('slika.php?s=" + sVar + "','gallery','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300 ,height=300');f.focus();");
}

function Reseteb()
  {
    document.form1.ime.value = "";
		document.form1.tvrtka.value = "";
    document.form1.adresa.value = "";
    document.form1.oib.value = "";
    document.form1.tel.value = "";
    document.form1.mail.value = "";
  }

function Reset()
  {
    document.form1.ime.value = "";
		document.form1.prezime.value = "";
    document.form1.adresa.value = "";
    document.form1.mjesto.value = "";
    document.form1.telefon.value = "";
    document.form1.email.value = "";
    document.form1.poruka.value = "";
  }
	
	
function brojkef( myfield, e ) {
  var key, keychar;
  if( window.event ) {
    key = window.event.keyCode;
    if( key == ','.charCodeAt( 0 ) ) { window.event.keyCode = key = '.'.charCodeAt( 0 ); }
  } 
  else if( e ) {
    key = e.which;
  } 
  else {
    return true;
  }
  keychar = String.fromCharCode( key );
  return ((("0123456789").indexOf( keychar ) > -1) || (key==0) || ((keychar=='.') && myfield.value.indexOf('.') < 0));
}

function seminarCheck(){
	fali = "";
	
	if (document.obrazac.ime.value == "") fali = fali + "\n- Ime";
	if (document.obrazac.datumrd.value == "") fali = fali + "\n- Datum rođenja";
	if (document.obrazac.tel.value == "") fali = fali + "\n- Broj telefona";
	if (document.obrazac.grad.value == "") fali = fali + "\n- Grad";
	if (document.obrazac.zaposlen.value == "") fali = fali + "\n- Zaposlen u:";
	if (fali != "")
	   alert("Niste upisali sve potrebne podatke!" + "\n\n" + "Molimo upišite:" + fali)
	else
	 document.obrazac.submit();
}
