
function openImage(imageName, imageUrl, width, height){
	var wnd_hndlr;
	var wnd_width = 530;
	var wnd_height = 485;
	var mainStyle = 'main3';
	var contentStyle = 'content3';

	if(width != null){
		wnd_width = width;
	}

	if(height != null){
		wnd_height = height;
	}

	if(wnd_width != 530 || wnd_height != 485){
		mainStyle = 'main3v';
		contentStyle = 'content3v';
	}

	wnd_hndlr = window.open("", "viewImage", 'height=' + wnd_height + ', width=' + wnd_width + ' , location=no, scrollbars=no, menubars=no, toolbars=no, resizable=yes');

	wnd_hndlr.document.write("<html>\n");
	wnd_hndlr.document.write("<head>\n");
	wnd_hndlr.document.write("<link rel=\"stylesheet\" href=\"css/general.css\" type=\"text/css\">");
	wnd_hndlr.document.write("<link rel=\"stylesheet\" href=\"css/style.css\" type=\"text/css\">");
	wnd_hndlr.document.write("</head>\n");
	wnd_hndlr.document.write("<body>\n");
	wnd_hndlr.document.write("<div id=\"" + mainStyle + "\">\n");
	wnd_hndlr.document.write("<div id=\"controls\">\n");
	wnd_hndlr.document.write("<a href=\"javascript:window.print();\"><img src=\"images/isprintajte.gif\" width=68 height=10 border=0></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:window.close();\"><img src=\"images/zatvorite.gif\" width=68 height=10 border=0></a>\n");
	wnd_hndlr.document.write("</div>\n");
	wnd_hndlr.document.write("<div id=\"popup_title\">\n");
	wnd_hndlr.document.write("<h1>" + imageName + "</h1>\n");
	wnd_hndlr.document.write("</div>\n");
	wnd_hndlr.document.write("<div id=\"" + contentStyle + "\">\n");
	wnd_hndlr.document.write("<img src=\"" + imageUrl + "\"/>\n");
	wnd_hndlr.document.write("</div>\n");
	wnd_hndlr.document.write("</div>\n");
	wnd_hndlr.document.write("</body>\n");
	wnd_hndlr.document.write("</html>\n");
	wnd_hndlr.document.close();
}

function printPage(){
	var prnwnd_hndlr;
	var prnwndHTML;

	prnwnd_hndlr = window.open("", "printPage", 'height=388, width=590, location=no, scrollbars=yes, menubars=no, toolbars=no, resizable=no');

	prnwnd_hndlr.document.write("<html>\n");
	prnwnd_hndlr.document.write("<head>\n");
	prnwnd_hndlr.document.write("<link rel=\"stylesheet\" href=\"css/general.css\" type=\"text/css\"/>");
	prnwnd_hndlr.document.write("<link rel=\"stylesheet\" href=\"css/style.css\" type=\"text/css\"/>");
	prnwnd_hndlr.document.write("</head>\n");
	prnwnd_hndlr.document.write("<body>\n");
	prnwnd_hndlr.document.write("<div id=\"main2\">\n");
	prnwnd_hndlr.document.write("<div id=\"controls\">\n");
	prnwnd_hndlr.document.write("<a href=\"javascript:window.print();\"><img src=\"images/isprintajte.gif\" width=68 height=10 border=0></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:window.close();\"><img src=\"images/zatvorite.gif\" width=68 height=10 border=0></a>&nbsp;&nbsp;\n");
	prnwnd_hndlr.document.write("</div>\n");
	prnwnd_hndlr.document.write("<div id=\"content2\">\n");
	prnwndHTML = document.getElementById('content').innerHTML;
	prnwnd_hndlr.document.write(prnwndHTML);
	prnwnd_hndlr.document.write("</div>\n");
	prnwnd_hndlr.document.write("</div>\n");
	prnwnd_hndlr.document.write("</body>\n");
	prnwnd_hndlr.document.write("</html>\n");
	prnwnd_hndlr.document.close();
}

function emailPage(imageName, imageUrl){
	alert("Ova funkcionalnost jos uvek nije dostupna.");
}