// JavaScript Document

function verify(ID, Forma) {
	var sMsg = "";
	var sN = "\r\n";
	var sHeader = "Niste podesili sledeca polja:" + sN + sN;
	
	if (ID == 2000) {
		if (Forma.Ime.value == "") { sMsg += " - Ime i prezime" + sN; Forma.Ime.style.backgroundColor = '#ffccff'; } else { Forma.Ime.style.backgroundColor = 'white'; }
		if (Forma.Poruka.value == "") { sMsg += " - Poruka" + sN; Forma.Poruka.style.backgroundColor = '#ffccff'; } else { Forma.Poruka.style.backgroundColor = 'white'; }
		
		
	} else if (ID == 1800){
		if (Forma.Ime.value == "") { sMsg += " - Ime i prezime" + sN; Forma.Ime.style.backgroundColor = '#ffccff'; } else { Forma.Ime.style.backgroundColor = 'white'; }
		var b = true;
		if (Forma.b1.value == "") { b = false; Forma.b1.style.backgroundColor = '#ffccff'; } else { Forma.b1.style.backgroundColor = 'white'; }
		if (Forma.b2.value == "") { b = false; Forma.b2.style.backgroundColor = '#ffccff'; } else { Forma.b2.style.backgroundColor = 'white'; }
		if (Forma.b3.value == "") { b = false; Forma.b3.style.backgroundColor = '#ffccff'; } else { Forma.b3.style.backgroundColor = 'white'; }
		if (Forma.b4.value == "") { b = false; Forma.b4.style.backgroundColor = '#ffccff'; } else { Forma.b4.style.backgroundColor = 'white'; }
		if (Forma.b5.value == "") { b = false; Forma.b5.style.backgroundColor = '#ffccff'; } else { Forma.b5.style.backgroundColor = 'white'; }
		if (Forma.b6.value == "") { b = false; Forma.b6.style.backgroundColor = '#ffccff'; } else { Forma.b6.style.backgroundColor = 'white'; }
		if (Forma.b7.value == "") { b = false; Forma.b7.style.backgroundColor = '#ffccff'; } else { Forma.b7.style.backgroundColor = 'white'; }
		if (Forma.b8.value == "") { b = false; Forma.b8.style.backgroundColor = '#ffccff'; } else { Forma.b8.style.backgroundColor = 'white'; }
		if (Forma.b9.value == "") { b = false; Forma.b9.style.backgroundColor = '#ffccff'; } else { Forma.b9.style.backgroundColor = 'white'; }
		if (Forma.b10.value == "") { b = false; Forma.b10.style.backgroundColor = '#ffccff'; } else { Forma.b10.style.backgroundColor = 'white'; }
		if (Forma.b11.value == "") { b = false; Forma.b11.style.backgroundColor = '#ffccff'; } else { Forma.b11.style.backgroundColor = 'white'; }
		if (Forma.b12.value == "") { b = false; Forma.b12.style.backgroundColor = '#ffccff'; } else { Forma.b12.style.backgroundColor = 'white'; }
		if (Forma.b13.value == "") { b = false; Forma.b13.style.backgroundColor = '#ffccff'; } else { Forma.b13.style.backgroundColor = 'white'; }
		if (b == false) sMsg += " - JMBG" + sN;
		if (Forma.Adresa.value == "") { sMsg += " - Adresa" + sN; Forma.Adresa.style.backgroundColor = '#ffccff'; } else { Forma.Adresa.style.backgroundColor = 'white'; }
		if (Forma.Grad.value == "") { sMsg += " - Grad" + sN; Forma.Grad.style.backgroundColor = '#ffccff'; } else { Forma.Grad.style.backgroundColor = 'white'; }
		if (Forma.Telefon1.value == "") { sMsg += " - Telefon" + sN; Forma.Telefon1.style.backgroundColor = '#ffccff'; } else { Forma.Telefon1.style.backgroundColor = 'white'; }
		if (Forma.Prijemnik2Kom2.value == "") { sMsg += " - Broj prijemnika" + sN; Forma.Prijemnik2Kom2.style.backgroundColor = '#ffccff'; } else { Forma.Prijemnik2Kom2.style.backgroundColor = 'white'; }
		if (Forma.Prijemnik2[0].checked == false && Forma.Prijemnik2[1].checked == false) { sMsg += " - Nacin placanja dodatnog prijemnika" + sN; document.getElementById("Prijemnik2d1").style.backgroundColor = '#ffccff';  document.getElementById("Prijemnik2d2").style.backgroundColor = '#ffccff'; } else { document.getElementById("Prijemnik2d1").style.backgroundColor = '#ebebed'; document.getElementById("Prijemnik2d2").style.backgroundColor = '#ebebed'; }
	} else if (ID == 1700){
		if (Forma.Ime.value == "") { sMsg += " - Ime i prezime" + sN; Forma.Ime.style.backgroundColor = '#ffccff'; } else { Forma.Ime.style.backgroundColor = 'white'; }
		var b = true;
		if (Forma.b1.value == "") { b = false; Forma.b1.style.backgroundColor = '#ffccff'; } else { Forma.b1.style.backgroundColor = 'white'; }
		if (Forma.b2.value == "") { b = false; Forma.b2.style.backgroundColor = '#ffccff'; } else { Forma.b2.style.backgroundColor = 'white'; }
		if (Forma.b3.value == "") { b = false; Forma.b3.style.backgroundColor = '#ffccff'; } else { Forma.b3.style.backgroundColor = 'white'; }
		if (Forma.b4.value == "") { b = false; Forma.b4.style.backgroundColor = '#ffccff'; } else { Forma.b4.style.backgroundColor = 'white'; }
		if (Forma.b5.value == "") { b = false; Forma.b5.style.backgroundColor = '#ffccff'; } else { Forma.b5.style.backgroundColor = 'white'; }
		if (Forma.b6.value == "") { b = false; Forma.b6.style.backgroundColor = '#ffccff'; } else { Forma.b6.style.backgroundColor = 'white'; }
		if (Forma.b7.value == "") { b = false; Forma.b7.style.backgroundColor = '#ffccff'; } else { Forma.b7.style.backgroundColor = 'white'; }
		if (Forma.b8.value == "") { b = false; Forma.b8.style.backgroundColor = '#ffccff'; } else { Forma.b8.style.backgroundColor = 'white'; }
		if (Forma.b9.value == "") { b = false; Forma.b9.style.backgroundColor = '#ffccff'; } else { Forma.b9.style.backgroundColor = 'white'; }
		if (Forma.b10.value == "") { b = false; Forma.b10.style.backgroundColor = '#ffccff'; } else { Forma.b10.style.backgroundColor = 'white'; }
		if (Forma.b11.value == "") { b = false; Forma.b11.style.backgroundColor = '#ffccff'; } else { Forma.b11.style.backgroundColor = 'white'; }
		if (Forma.b12.value == "") { b = false; Forma.b12.style.backgroundColor = '#ffccff'; } else { Forma.b12.style.backgroundColor = 'white'; }
		if (Forma.b13.value == "") { b = false; Forma.b13.style.backgroundColor = '#ffccff'; } else { Forma.b13.style.backgroundColor = 'white'; }
		if (b == false) sMsg += " - JMBG" + sN;
		if (vKvar == false) { sMsg += " - Vrsta kvara" + sN; document.getElementById("dKvar").style.backgroundColor = '#ffccff'; } else { document.getElementById("dKvar").style.backgroundColor = '#ebebed'; }
		if (Forma.Opis.value == "") { sMsg += " - Detaljan opis kvara" + sN; Forma.Opis.style.backgroundColor = '#ffccff'; } else { Forma.Opis.style.backgroundColor = 'white'; }
	} else if (ID == 1600){
		if (Forma.Ime.value == "") { sMsg += " - Ime i prezime" + sN; Forma.Ime.style.backgroundColor = '#ffccff'; } else { Forma.Ime.style.backgroundColor = 'white'; }
		var b = true;
		if (Forma.b1.value == "") { b = false; Forma.b1.style.backgroundColor = '#ffccff'; } else { Forma.b1.style.backgroundColor = 'white'; }
		if (Forma.b2.value == "") { b = false; Forma.b2.style.backgroundColor = '#ffccff'; } else { Forma.b2.style.backgroundColor = 'white'; }
		if (Forma.b3.value == "") { b = false; Forma.b3.style.backgroundColor = '#ffccff'; } else { Forma.b3.style.backgroundColor = 'white'; }
		if (Forma.b4.value == "") { b = false; Forma.b4.style.backgroundColor = '#ffccff'; } else { Forma.b4.style.backgroundColor = 'white'; }
		if (Forma.b5.value == "") { b = false; Forma.b5.style.backgroundColor = '#ffccff'; } else { Forma.b5.style.backgroundColor = 'white'; }
		if (Forma.b6.value == "") { b = false; Forma.b6.style.backgroundColor = '#ffccff'; } else { Forma.b6.style.backgroundColor = 'white'; }
		if (Forma.b7.value == "") { b = false; Forma.b7.style.backgroundColor = '#ffccff'; } else { Forma.b7.style.backgroundColor = 'white'; }
		if (Forma.b8.value == "") { b = false; Forma.b8.style.backgroundColor = '#ffccff'; } else { Forma.b8.style.backgroundColor = 'white'; }
		if (Forma.b9.value == "") { b = false; Forma.b9.style.backgroundColor = '#ffccff'; } else { Forma.b9.style.backgroundColor = 'white'; }
		if (Forma.b10.value == "") { b = false; Forma.b10.style.backgroundColor = '#ffccff'; } else { Forma.b10.style.backgroundColor = 'white'; }
		if (Forma.b11.value == "") { b = false; Forma.b11.style.backgroundColor = '#ffccff'; } else { Forma.b11.style.backgroundColor = 'white'; }
		if (Forma.b12.value == "") { b = false; Forma.b12.style.backgroundColor = '#ffccff'; } else { Forma.b12.style.backgroundColor = 'white'; }
		if (Forma.b13.value == "") { b = false; Forma.b13.style.backgroundColor = '#ffccff'; } else { Forma.b13.style.backgroundColor = 'white'; }
		if (b == false) sMsg += " - JMBG" + sN;
		if (Forma.Paket1.checked == false && Forma.Paket2.checked == false && Forma.Paket3.checked == false) { sMsg += " - Neki od paketa" + sN;  document.getElementById("dPaketi").style.backgroundColor = '#ffccff'; } else {  document.getElementById("dPaketi").style.backgroundColor = '#ebebed'; }
	} else if (ID == 1900){
		if (Forma.Ime.value == "") { sMsg += " - Ime i prezime" + sN; Forma.Ime.style.backgroundColor = '#ffccff'; } else { Forma.Ime.style.backgroundColor = 'white'; }
		var b = true;
		if (Forma.b1.value == "") { b = false; Forma.b1.style.backgroundColor = '#ffccff'; } else { Forma.b1.style.backgroundColor = 'white'; }
		if (Forma.b2.value == "") { b = false; Forma.b2.style.backgroundColor = '#ffccff'; } else { Forma.b2.style.backgroundColor = 'white'; }
		if (Forma.b3.value == "") { b = false; Forma.b3.style.backgroundColor = '#ffccff'; } else { Forma.b3.style.backgroundColor = 'white'; }
		if (Forma.b4.value == "") { b = false; Forma.b4.style.backgroundColor = '#ffccff'; } else { Forma.b4.style.backgroundColor = 'white'; }
		if (Forma.b5.value == "") { b = false; Forma.b5.style.backgroundColor = '#ffccff'; } else { Forma.b5.style.backgroundColor = 'white'; }
		if (Forma.b6.value == "") { b = false; Forma.b6.style.backgroundColor = '#ffccff'; } else { Forma.b6.style.backgroundColor = 'white'; }
		if (Forma.b7.value == "") { b = false; Forma.b7.style.backgroundColor = '#ffccff'; } else { Forma.b7.style.backgroundColor = 'white'; }
		if (Forma.b8.value == "") { b = false; Forma.b8.style.backgroundColor = '#ffccff'; } else { Forma.b8.style.backgroundColor = 'white'; }
		if (Forma.b9.value == "") { b = false; Forma.b9.style.backgroundColor = '#ffccff'; } else { Forma.b9.style.backgroundColor = 'white'; }
		if (Forma.b10.value == "") { b = false; Forma.b10.style.backgroundColor = '#ffccff'; } else { Forma.b10.style.backgroundColor = 'white'; }
		if (Forma.b11.value == "") { b = false; Forma.b11.style.backgroundColor = '#ffccff'; } else { Forma.b11.style.backgroundColor = 'white'; }
		if (Forma.b12.value == "") { b = false; Forma.b12.style.backgroundColor = '#ffccff'; } else { Forma.b12.style.backgroundColor = 'white'; }
		if (Forma.b13.value == "") { b = false; Forma.b13.style.backgroundColor = '#ffccff'; } else { Forma.b13.style.backgroundColor = 'white'; }
		if (b == false) sMsg += " - JMBG" + sN;
		if (Forma.Paket1.checked == false && Forma.Paket2.checked == false && Forma.Paket3.checked == false) { sMsg += " - Neki od paketa" + sN;  document.getElementById("dPaketi").style.backgroundColor = '#ffccff'; } else {  document.getElementById("dPaketi").style.backgroundColor = '#ebebed'; }
		if (Forma.m.value == "") { sMsg += " - Mjesec" + sN; Forma.m.style.backgroundColor = '#ffccff'; } else { Forma.m.style.backgroundColor = 'white'; }
		if (Forma.d.value == "") { sMsg += " - Dan" + sN; Forma.d.style.backgroundColor = '#ffccff'; } else { Forma.d.style.backgroundColor = 'white'; }
		if (Forma.y.value == "") { sMsg += " - Godina" + sN; Forma.y.style.backgroundColor = '#ffccff'; } else { Forma.y.style.backgroundColor = 'white'; }
	} else if (ID == 1300) {
		if (Forma.Firma.value == "") { sMsg += " - Naziv firme" + sN; Forma.Firma.style.backgroundColor = '#ffccff'; } else { Forma.Firma.style.backgroundColor = 'white'; }
		if (Forma.PIB.value == "") { sMsg += " - PIB" + sN; Forma.PIB.style.backgroundColor = '#ffccff'; } else { Forma.PIB.style.backgroundColor = 'white'; }
		var p = true;
		if (Forma.p1.value == "") { b = false; Forma.p1.style.backgroundColor = '#ffccff'; } else { Forma.p1.style.backgroundColor = 'white'; }
		if (Forma.p2.value == "") { b = false; Forma.p2.style.backgroundColor = '#ffccff'; } else { Forma.p2.style.backgroundColor = 'white'; }
		if (Forma.p3.value == "") { b = false; Forma.p3.style.backgroundColor = '#ffccff'; } else { Forma.p3.style.backgroundColor = 'white'; }
		if (Forma.p4.value == "") { b = false; Forma.p4.style.backgroundColor = '#ffccff'; } else { Forma.p4.style.backgroundColor = 'white'; }
		if (Forma.p5.value == "") { b = false; Forma.p5.style.backgroundColor = '#ffccff'; } else { Forma.p5.style.backgroundColor = 'white'; }
		if (Forma.p6.value == "") { b = false; Forma.p6.style.backgroundColor = '#ffccff'; } else { Forma.p6.style.backgroundColor = 'white'; }
		if (Forma.p7.value == "") { b = false; Forma.p7.style.backgroundColor = '#ffccff'; } else { Forma.p7.style.backgroundColor = 'white'; }
		if (Forma.p8.value == "") { b = false; Forma.p8.style.backgroundColor = '#ffccff'; } else { Forma.p8.style.backgroundColor = 'white'; }
		if (Forma.p9.value == "") { b = false; Forma.p9.style.backgroundColor = '#ffccff'; } else { Forma.p9.style.backgroundColor = 'white'; }
		if (Forma.p10.value == "") { b = false; Forma.p10.style.backgroundColor = '#ffccff'; } else { Forma.p10.style.backgroundColor = 'white'; }
		if (p == false) sMsg += " - PDV" + sN;
		if (Forma.Adresa.value == "") { sMsg += " - Adresa" + sN; Forma.Adresa.style.backgroundColor = '#ffccff'; } else { Forma.Adresa.style.backgroundColor = 'white'; }
		if (Forma.Grad.value == "") { sMsg += " - Grad" + sN; Forma.Grad.style.backgroundColor = '#ffccff'; } else { Forma.Grad.style.backgroundColor = 'white'; }
		if (Forma.KontaktOsoba.value == "") { sMsg += " - Kontakt osoba" + sN; Forma.KontaktOsoba.style.backgroundColor = '#ffccff'; } else { Forma.KontaktOsoba.style.backgroundColor = 'white'; }
		if (Forma.Telefon.value == "") { sMsg += " - Telefon" + sN; Forma.Telefon.style.backgroundColor = '#ffccff'; } else { Forma.Telefon.style.backgroundColor = 'white'; }
		if (Forma.Prijemnik1[0].checked == false && Forma.Prijemnik1[1].checked == false) { sMsg += " - Nacin placanja prijemnika" + sN; document.getElementById("Prijemnik1d1").style.backgroundColor = '#ffccff';  document.getElementById("Prijemnik1d2").style.backgroundColor = '#ffccff'; } else { document.getElementById("Prijemnik1d1").style.backgroundColor = '#ebebed'; document.getElementById("Prijemnik1d2").style.backgroundColor = '#ebebed'; }
		if (Forma.Prijemnik2Kom.value != "" && Forma.Prijemnik2[0].checked == false && Forma.Prijemnik2[1].checked == false) { sMsg += " - Odabrali ste broj dodatnih prijemnika ali niste odabrali nacin placanja" + sN; document.getElementById("Prijemnik2d1").style.backgroundColor = '#ffccff';  document.getElementById("Prijemnik2d2").style.backgroundColor = '#ffccff'; } else { document.getElementById("Prijemnik2d1").style.backgroundColor = '#ebebed'; document.getElementById("Prijemnik2d2").style.backgroundColor = '#ebebed'; }
		if (Forma.Prijemnik2Kom.value == "" && (Forma.Prijemnik2[0].checked == true || Forma.Prijemnik2[1].checked == true)) { sMsg += " - Odabrali nacin placanja dodatnog prijemnika ali niste odredili broj prijemnika" + sN; Forma.Prijemnik2Kom.style.backgroundColor = '#ffccff'; } else { Forma.Prijemnik2Kom.style.backgroundColor = 'white'; }
	} else if (ID == 1200) {
		if (Forma.Ime.value == "") { sMsg += " - Ime i prezime" + sN; Forma.Ime.style.backgroundColor = '#ffccff'; } else { Forma.Ime.style.backgroundColor = 'white'; }
		var b = true;
		if (Forma.b1.value == "") { b = false; Forma.b1.style.backgroundColor = '#ffccff'; } else { Forma.b1.style.backgroundColor = 'white'; }
		if (Forma.b2.value == "") { b = false; Forma.b2.style.backgroundColor = '#ffccff'; } else { Forma.b2.style.backgroundColor = 'white'; }
		if (Forma.b3.value == "") { b = false; Forma.b3.style.backgroundColor = '#ffccff'; } else { Forma.b3.style.backgroundColor = 'white'; }
		if (Forma.b4.value == "") { b = false; Forma.b4.style.backgroundColor = '#ffccff'; } else { Forma.b4.style.backgroundColor = 'white'; }
		if (Forma.b5.value == "") { b = false; Forma.b5.style.backgroundColor = '#ffccff'; } else { Forma.b5.style.backgroundColor = 'white'; }
		if (Forma.b6.value == "") { b = false; Forma.b6.style.backgroundColor = '#ffccff'; } else { Forma.b6.style.backgroundColor = 'white'; }
		if (Forma.b7.value == "") { b = false; Forma.b7.style.backgroundColor = '#ffccff'; } else { Forma.b7.style.backgroundColor = 'white'; }
		if (Forma.b8.value == "") { b = false; Forma.b8.style.backgroundColor = '#ffccff'; } else { Forma.b8.style.backgroundColor = 'white'; }
		if (Forma.b9.value == "") { b = false; Forma.b9.style.backgroundColor = '#ffccff'; } else { Forma.b9.style.backgroundColor = 'white'; }
		if (Forma.b10.value == "") { b = false; Forma.b10.style.backgroundColor = '#ffccff'; } else { Forma.b10.style.backgroundColor = 'white'; }
		if (Forma.b11.value == "") { b = false; Forma.b11.style.backgroundColor = '#ffccff'; } else { Forma.b11.style.backgroundColor = 'white'; }
		if (Forma.b12.value == "") { b = false; Forma.b12.style.backgroundColor = '#ffccff'; } else { Forma.b12.style.backgroundColor = 'white'; }
		if (Forma.b13.value == "") { b = false; Forma.b13.style.backgroundColor = '#ffccff'; } else { Forma.b13.style.backgroundColor = 'white'; }
		if (b == false) sMsg += " - JMBG" + sN;
		if (Forma.Adresa.value == "") { sMsg += " - Adresa" + sN; Forma.Adresa.style.backgroundColor = '#ffccff'; } else { Forma.Adresa.style.backgroundColor = 'white'; }
		if (Forma.Grad.value == "") { sMsg += " - Grad" + sN; Forma.Grad.style.backgroundColor = '#ffccff'; } else { Forma.Grad.style.backgroundColor = 'white'; }
		if (Forma.Telefon1.value == "") { sMsg += " - Telefon" + sN; Forma.Telefon1.style.backgroundColor = '#ffccff'; } else { Forma.Telefon1.style.backgroundColor = 'white'; }
		if (Forma.VrstaPlacanja[0].checked == false && Forma.VrstaPlacanja[1].checked == false) { sMsg += " - Vrsta placanja" + sN; document.getElementById("dVrstaPlacanja").style.backgroundColor = '#ffccff'; } else { document.getElementById("dVrstaPlacanja").style.backgroundColor = '#ebebed'; }
		if (Forma.VrstaPlacanja[1].checked == true && Forma.Banka.value == 0)  { sMsg += " - Banka" + sN; Forma.Banka.style.backgroundColor = '#ffccff'; } else { Forma.Banka.style.backgroundColor = 'white'; }
		if (Forma.VrstaPlacanja[1].checked == true && Forma.RacunBr.value == "")  { sMsg += " - Broj racuna u banci" + sN; Forma.RacunBr.style.backgroundColor = '#ffccff'; } else { Forma.RacunBr.style.backgroundColor = 'white'; }
		if (Forma.Prijemnik1[0].checked == false && Forma.Prijemnik1[1].checked == false) { sMsg += " - Nacin placanja prijemnika" + sN; document.getElementById("Prijemnik1d1").style.backgroundColor = '#ffccff';  document.getElementById("Prijemnik1d2").style.backgroundColor = '#ffccff'; } else { document.getElementById("Prijemnik1d1").style.backgroundColor = '#ebebed'; document.getElementById("Prijemnik1d2").style.backgroundColor = '#ebebed'; }
		if (Forma.Prijemnik2Kom.value != "" && Forma.Prijemnik2[0].checked == false && Forma.Prijemnik2[1].checked == false) { sMsg += " - Odabrali ste broj dodatnih prijemnika ali niste odabrali nacin placanja" + sN; document.getElementById("Prijemnik2d1").style.backgroundColor = '#ffccff';  document.getElementById("Prijemnik2d2").style.backgroundColor = '#ffccff'; } else { document.getElementById("Prijemnik2d1").style.backgroundColor = '#ebebed'; document.getElementById("Prijemnik2d2").style.backgroundColor = '#ebebed'; }
		if (Forma.Prijemnik2Kom.value == "" && (Forma.Prijemnik2[0].checked == true || Forma.Prijemnik2[1].checked == true)) { sMsg += " - Odabrali nacin placanja dodatnog prijemnika ali niste odredili broj prijemnika" + sN; Forma.Prijemnik2Kom.style.backgroundColor = '#ffccff'; } else { Forma.Prijemnik2Kom.style.backgroundColor = 'white'; }
		
	} else if (ID == 1170) {
		if (Forma.Ime.value == "") { sMsg += " - Ime i prezime" + sN; Forma.Ime.style.backgroundColor = '#ffccff'; } else { Forma.Ime.style.backgroundColor = 'white'; }
		if (Forma.Email.value == "") { sMsg += " - Email" + sN; Forma.Email.style.backgroundColor = '#ffccff'; } else { Forma.Ime.Email.backgroundColor = 'white'; }
		if (Forma.Pitanje.value == "") { sMsg += " - Poruka" + sN; Forma.Pitanje.style.backgroundColor = '#ffccff'; } else { Forma.Pitanje.style.backgroundColor = 'white'; }
	}
	
	if (sMsg != "") {
		alert(sHeader + sMsg);
		return false;
	} else {
		return true;
	}
}
