function chk_komentar(form) {
	if(form.autor_ime.value.length<1) {
		alert('Niste unijeli Vaše ime !');
		return false;
	}
	if(form.komentar.value.length<1) {
		alert('Niste unijeli komentar !');
		return false;
	}

	return true;
}

function chk_kontakt_bh(form) {
	if(form.ime_prez.value.length<1) {
		alert('Niste unijeli Vaše ime !');
		return false;
	}
	if(form.email.value.length<1) {
		alert('Niste unijeli Vašu E-mail adresu !');
		return false;
	}
	if(form.poruka.value.length<1) {
		alert('Niste unijeli poruku kontakta !');
		return false;
	}

	return true;
}

function chk_kontakt_de(form) {
	if(form.ime_prez.value.length<1) {
		alert('Bitte geben Sie Ihren Namen !');
		return false;
	}
	if(form.email.value.length<1) {
		alert('itte geben Sie Ihre E-Mail Adresse !');
		return false;
	}
	if(form.poruka.value.length<1) {
		alert('itte geben Sie Ihre Nachricht !');
		return false;
	}

	return true;
}

function chk_kontakt_en(form) {
	if(form.ime_prez.value.length<1) {
		alert('Please enter your name !');
		return false;
	}
	if(form.email.value.length<1) {
		alert('Please enter your E-mail address !');
		return false;
	}
	if(form.poruka.value.length<1) {
		alert('Please enter your message !');
		return false;
	}

	return true;
}

function setuj_sliku() {
	var indeks = document.frmMain.grupa.selectedIndex;
	if(document.frmMain.grupa.options[indeks].value == 0) {
		document.frmMain.imgPreview.src='./images/spacer.gif';
	}
	else {
		document.frmMain.imgPreview.src='./images/savjet_icon/'+document.frmMain.grupa.options[indeks].value;
	}
}

function komentar_zatvori(idnews)
{
	if(idnews != '')
		opener.document.location.href = "index.php?w=n&s=o&id="+idnews;
	window.close();
}

function komentar(idnews)
{
	window.open('komentar.php?id='+idnews, '_komentar', 'HEIGHT=305,resizable=no,WIDTH=400');
}

function spisakstranica()
{
	window.open('spisakstranica.php', '_spisakstranica', 'HEIGHT=345,scrollbars=1,resizable=yes,WIDTH=400');
}

function hopni(objekt,grupa) {
	var myindex=objekt.selectedIndex
	if (objekt.options[myindex].value == 0) return;

	if (objekt.options[myindex].value == 1) //zadnjih x
	{
		location.href='index.php?w=n&s=&h=5&g='+grupa;
	}
	if (objekt.options[myindex].value == 2) //cijela arhiva
	{
		location.href='index.php?w=n&s=&h=&g='+grupa;
	}
}
