/*function foto(id, width, winheight, description){
	fotowin = window.open("", "foto", "width =" +width +",height =" + winheight +",location=no,menubar=no,directories=no,toolbar=no,scrollbars=no,resizable=no,status=no");
	if(description != 'default'){
		description = '<div onclick="changeToOriginalImmage('+id+')">original</div>';
	}
	fotowin.document.write("<html><head><title>foto</title>");
	fotowin.document.write('<script src="/js/funkcije.js" type="text/javascript"></script>');
	fotowin.document.write("</head><body leftmargin=\"0\" topmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\" marginwidth=\"0\"><img src=\"/mma_bin.php?src=mid&amp;id=" + id + "\"/><br clear=\"all\"><div style=\"color: #333333; font-size:60%; margin-left :10px; margin-right :10px; margin-top :5px; font-family: Arial;\"  align=\"justify\">"+ description +"</div></boby></html>");
	fotowin.document.close();
	document.body.onfocus = closeFotoWin;
}*/

function foto(id, width, winheight, description){

	fotowin = window.open("", "foto", "width =" +width +",height =" + winheight +",location=no,menubar=no,directories=no,toolbar=no,scrollbars=no,resizable=no,status=no");
	/*if(description == 'reference_window'){
		description = '<div onclick="changeToOriginalImmage('+id+')">original</div>';
	}*/
	fotowin.document.write("<html><head><title>foto</title></head><body style=\"background-color:#F4F4F4;\" leftmargin=\"0\" topmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\" marginwidth=\"0\"><img src=\"/mma_bin.php?src=mid&amp;id=" + id + "\"/><br clear=\"all\"><div style=\"color: #333333; font-size:60%; margin-left :10px; margin-right :10px; margin-top :5px; font-family: Arial;  align=\"justify\">"+ description +"</div>");
	fotowin.document.write("<script src=\"/js/funkcije.js\" type=\"text/javascript\"></script></boby></html>");

	fotowin.document.close();

	document.body.onfocus = closeFotoWin;

}

function changeToOriginalImmage(id){
	resizeTo(1024,768);
	/*window.scrollbars.visible=true;*/
	/*window.resizable = 'yes';*/
	window.location='/mma_bin.php?src=org&id=' + id;
	
}

function closeFotoWin() {
	if(fotowin != null && !(fotowin.closed)) {
		fotowin.close();
	}
}

//mail decode
function mDec(ensl, enlsShow, addToHref, firstPartHrefOnly) {
	if ((enlsShow == undefined || enlsShow == "") && (firstPartHrefOnly == undefined || firstPartHrefOnly == "")) {
		enlsShow = ensl;
	}
	
	if (addToHref == undefined) {
		addToHref = "";
	}

	s="";
	for(i=0; i<enlsShow.length; i++) {
		n=enlsShow.charCodeAt(i);
		if (n >= 35 && n <= 126) {
			s+=String.fromCharCode((n-3));
		} else {
			s+=enlsShow.charAt(i);
		}
	}
	nslvShow = s;
	
	a="pdlowr="+ensl; 
	nslv = "";
	for(i=0; i<a.length; i++) {
		n=a.charCodeAt(i)-3;
		nslv+=String.fromCharCode(n);
	}
	if (firstPartHrefOnly == true) {
		document.write("<a class=\"email\" href=\"" + nslv + addToHref + "\">");		
	} else {
		document.write("<a class=\"email\" href=\"" + nslv + addToHref + "\">"+nslvShow+"</a>");		
	}
}

function mDecEnd(){
	document.write("</a>");
	
}


function decodeAward(str) {
		
	decodedStr = '<br /><b>&nbsp;&nbsp;Z klikom na spodnji link si <br />&nbsp;&nbsp;lahko pridobite nagrado!</b><br /><br />&nbsp;&nbsp;Zapišite si skriti ključ : <b>'+decode(str);
	
	return overlib(decodedStr,CAPTION,'Nagradna igra!',STICKY, MOUSEOFF);
}

function decode(str) {
	a=str; 
	decoded = "";
	for(i=0; i<a.length; i++) {
		n=a.charCodeAt(i)-3;
		decoded+=String.fromCharCode(n);
	}
	return decoded;  
}

function printWindow(lng) {
	window.open("?vie=print&lng="+lng, "print", "width=620,height=550,location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes, resizable=no,status=no");
}

function switchOver(num) {
	document['image'+num].src = eval("image" + num + "over.src");
}

function switchOff(num) {
	document['image'+num].src = eval("image" + num + "off.src");
}

function displayResult(contents, elementId) {
	
	//alert(elementId);
	
	var abc = document.getElementById(elementId);
	abc.innerHTML = contents;		
}

function displayProcessing(processingPhase, elementId) {
	
	//alert(elementId);
	
	var abc = document.getElementById(elementId);
	switch (processingPhase) {
	case 0:
		abc.innerHTML = '.';
		break;
	case 1:
		abc.innerHTML = '..';
		break;
	case 2:
		abc.innerHTML = '...';
		break;
	case 3:
		abc.innerHTML = '.....';
		break;
	}
}

function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
		}
	}
}

function submitForm(id){
	var form = document.getElementById(id);
	form.submit();
}