function popImage(imageURL,title) {
   var imgWin = window.open('about:blank','imgWin','scrollbars=no','width=200, height=200, left=100, top=100');

   with (imgWin.document) {
      writeln('<html><head><title>Molim pricekajte...</title>');
      writeln('<style type="text/css">body { margin: 0px; padding: 0px } </style></head>');
      writeln('<body onload="self.focus();"><img alt="Click to close!" style="cursor: pointer"  onClick="window.close()" window.close() id="pic" /></body></html>');
      close();      
      }
   var img = new Image();
        img.onload = function() { sizeImgWin(imgWin, img) };
   img.src = imageURL;
}
   
function sizeImgWin(win, img) {
      var new_w = img.width;
   var new_h = img.height;
   var old_w = win.innerWidth || win.document.body.offsetWidth;
   var old_h = win.innerHeight || win.document.body.offsetHeight;
   if (!new_w) { new_w = old_w; }
   if (!new_h) { new_h = old_h; }
   new_w -= old_w; new_h -= old_h;
   win.resizeBy(new_w,new_h);
   win.document.title = "Pregled slike";
   var pic = win.document.getElementById('pic');
   pic.src = img.src;
   pic.style.display = 'block';
}

function dropdownmenu(popup) {
	  				if (popup.options[popup.selectedIndex].value != "")
	  				{
	   		 			window.open(popup.options[popup.selectedIndex].value,"_top");
	    				popup.selectedIndex=0;
	  				}
				}


function prikazi(){
document.getElementById("kom").style.display="block";
document.getElementById("komentarilink").style.display="none";
}


function komentari () {
var errorMsg = "";

if (document.kom.ime.value==""){
errorMsg += "\nIme \t- Unesite ime";
}

if (document.kom.securityCode.value==""){
errorMsg += "\nKod \t- Prepišite kod sa slike";
}

if (document.kom.Komentar.value==""){
errorMsg += "\nKomentar\t- Unesite Komentar";
}


//If there is a problem with the form then display an error
if (errorMsg != ""){
msg = "Greška\n";
msg += "_________________________\n\n";
msg += "Morate popuniti sljedeća polja: \n";

		
 errorMsg += alert(msg + errorMsg + "\n");
		return false;
			}
		return true;
			}


function mail () {
var errorMsg = "";

if (document.m.ime.value==""){
errorMsg += "\nIme \t\t- Unesite ime";
}

if (document.m.ime2.value==""){
errorMsg += "\nIme Prijatelja \t- Unesite ime prijatelja";
}

if (document.m.Email.value==""){
errorMsg += "\nEmail \t\t- Unesite mail prijatelja";
}

if (document.m.Poruka.value==""){
errorMsg += "\nPoruka\t\t- Unesite poruku";
}


//If there is a problem with the form then display an error
if (errorMsg != ""){
msg = "Greška\n";
msg += "_________________________\n\n";
msg += "Morate popuniti sljedeća polja: \n";

		
 errorMsg += alert(msg + errorMsg + "\n");
		return false;
			}
		return true;
			}

function ispis(url,title,sirina,visina) 
{  window.open(""+ url + "", "", "resizable=no,scrollbars=yes,width=" + sirina + ",height=" + visina + ""); }