function bookmarksite(title, url) {
if (window.sidebar) {
window.sidebar.addPanel(title, url,"")
} else if( window.external ) {
window.external.AddFavorite(url, title); 
} else if(window.opera && window.print) {
return true; 
}
}

function nospam(name, domain) {
location.href="mailto:" + name+"@" + domain;
}

function smail(name) {
location.href="mailto:" + name+"@sajam.net";
}

function openWin(url,win,w,h) {
window.open(url,'win',"status=no,toolbar=no,location=no,menubar=no,directories=no,height="+h+",width="+w);
}

function hideShow(toHide, toShow, imageCurrent, imageNext ) {
document.getElementById(toHide).style.display='none';
if (imageCurrent != "no_image") {
	document.getElementById(imageCurrent).src='/res/nav/expand.gif';
}
	document.getElementById(toShow).style.display='block';
	document.getElementById(imageNext).src='/res/nav/colapse.gif';
}

function hideShowOne(section,image) {
sectionEl = document.getElementById(section);
imageEl = document.getElementById(image);


if (sectionEl.style.display=='none') {
	sectionEl.style.display='block';
	imageEl.src='/res/nav/colapse.gif';
}else{
	sectionEl.style.display='none';
	imageEl.src='/res/nav/expand.gif';
}
}

function goTo(selectBox) {
if (selectBox.selectedIndex != -1)  {
var boxUrl = selectBox.options[selectBox.selectedIndex].value;
if (boxUrl != "-1") {
location.href=boxUrl;
}
}
}

function formValidation(form){
	var ok = true;
	var size = form.elements.length;
		for (i=0;i<size;i++) {
			var name = form.elements[i].name;
			if (name.indexOf('notEmpty') != -1) {
				if (form.elements[i].type == "checkbox"){
					if(notEmptyCBox(form.elements[i]) == false) ok = false;
				}else{
					if(notEmpty(form.elements[i]) == false) ok = false;
				}
			}
		}
       if (ok == false) alert("Morate popuniti polja označena zvezdicom (*)");
       return ok;
}

function formValidationAndSet(form){
	var ok = true;
	var size = form.elements.length;
		for (i=0;i<size;i++) {
			var name = form.elements[i].name;
			if (name.indexOf('notEmpty') != -1) {
				if (form.elements[i].type == "checkbox"){
					if(notEmptyCBox(form.elements[i]) == false) ok = false;
				}else{
					if(notEmpty(form.elements[i]) == false) ok = false;
				}
			}
		}
       form.link.value = window.opener.document.URL;
       if (ok == false) alert("Morate popuniti polja označena zvezdicom (*)");
       return ok;
}

function notEmpty(elem){
	var str = elem.value;
	if(str.length == 0){
		return false;
	}else{
		return true;
	}		
}

function notEmptyCBox(elem){
	var str = elem.checked;
	if(str == true){
		return true;
	}else{
		return false;
	}		
}

