    function CreateNewMoznost(divName,divID,value) {
        if(value != ''){
        	document.getElementById(divName+""+divID).innerHTML += 
    	    "<input type=\"file\" name=\"dokument["+pocet2+"]\" value=\"\" size=\"50\" class=\"fileinput\" onchange=\"CreateNewMoznost('"+divName+"',"+(pocet2+1)+",this.value);\"><div id=\""+divName+""+(pocet2+1)+"\"></div>";
    	    pocet2++;
        }
    }

    NewWindow=null;
	function ShowItem(src, w, h, title){
		if(NewWindow){NewWindow.close();}
		if(NewWindow==null || NewWindow.closed){
		if (typeof(title)=="undefined") title="Gal�ria";
			var top = screen.height/2 - h/2;
			var left = screen.width/2 - w/2;
			settings=
				 "left=" + left + "px,"
				 +"top=" + top + "px,"
				 +"width=" + w + "px,"
				 +"height=" + h + "px,"
				 +"toolbar=no,"
				 +"location=no,"
				 +"directories=no,"
				 +"status=no,"
				 +"menubar=no,"
				 +"scrollbars=no,"
				 +"resizable=no";
			NewWindow = window.open("",'Klose',settings);
		}
		NewWindow.document.open();
		NewWindow.document.clear();
		NewWindow.document.write(
			"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
			+"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><title>"
			+ title +"</title></head>\n"
			+"<body topmargin=0 leftmargin=0 onclick=window.close(); onblur=\"window.close();\" bgcolor=#FFFFFF>\n"
			+"<table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=0><tr><td align=\"center\" valign=\"middle\"><img src=" + src + " border=1></td></tr></table>\n"
			+"</body>\n"
			+"</html>"
		);
		NewWindow.document.close();
		NewWindow.focus();
	}

	NewWindow1 = null;
	function ShowWin(href, w, h){
		if(NewWindow1){ NewWindow1.close(); }
		if(NewWindow1==null || NewWindow1.closed){
			var top = screen.height/2 - h/2;
			var left = screen.width/2 - w/2;
			var settings =
		 		"left=" + left + "px,"
				+"top=" + top + "px,"
				+"width=" + w + "px,"
				+"height=" + h + "px,"
				+"toolbar=no,"
				+"location=no,"
				+"directories=no,"
				+"status=yes,"
				+"menubar=yes,"
				+"scrollbars=yes,"
				+"resizable=yes";
			NewWindow1 = window.open(href,'okno',settings);
		}
		NewWindow1.focus();
	}
	
	NewWindow2 = null;
	function PrintDetails(content,w,h) {
		if(NewWindow2){NewWindow2.close();}
		if(NewWindow2==null || NewWindow2.closed){
			var top = screen.height/2 - h/2;
			var left = screen.width/2 - w/2;
		 	settings = "left="+left+",top="+top+",width="+w+"px,height="+h+"px,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes"
	 		NewWindow2 = window.open("",'Detaily',settings);
		}
		NewWindow2.document.open();
		NewWindow2.document.clear();
		NewWindow2.document.write(
			"<html><head><title>Tla�</title></head><style>table {font-size:11px;}</style>\n"
			+"<body topmargin=10 leftmargin=10 onload=\"window.print();\" bgcolor=#FFFFFF style=\"font-family:Verdana,Arial;font-size:10px;\">\n"
			+ content
			+"</body>\n"
			+"</html>"
		);
		NewWindow2.document.close();
		NewWindow2.focus();
	}

	timer = null;
	IMG = null;
	NewWindow3 = null;           
	function ViewImage(Isrc,title) {
		IMG = new Image;
		IMG.src = Isrc;
		if (typeof(title)=="undefined" || title=="") title="Gallery";
		if (NewWindow3) { NewWindow3.close(); }
		if (NewWindow3==null || NewWindow3.closed) {
			settings=
			 "left="+50+","
			 +"top="+50+","
			 +"width="+640+","
			 +"height="+480+","
			 +"toolbar=no,"
			 +"location=no,"
			 +"directories=no,"
			 +"status=no,"
			 +"menubar=no,"
			 +"scrollbars=no,"
			 +"resizable=yes"
			 NewWindow3 = window.open("",'Gallery',settings);
		}
		NewWindow3.document.open();
		NewWindow3.document.clear();
		NewWindow3.document.write(
		 	"<html><head><title>"+ title +"</title>"
			+"</head>\n"
			+"<body topmargin=0 leftmargin=0 bgcolor=\"#FFFFFF\" onclick=\"window.close();\">\n"
			+"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:10px;\"><tr><td align=\"center\" valign=\"middle\"><img src=" + IMG.src + " border=0 alt=\""+title+"\" /></td></tr></table>\n"
			+"</body>\n"
			+"</html>"
		);
		NewWindow3.document.close();
		NewWindow3.focus();
		timer = setInterval("resize()",250);
	}

	function resize() {
    	if(!IMG.complete){ return; }
	    clearInterval(timer);
		resizeWindowTo(NewWindow3,(IMG.width-18+80),(IMG.height-18+100));
		IMG = null;
	}

	function resizeWindowTo(WindowObject,w,h) {
		if (parseInt(navigator.appVersion)>3) {
			if (navigator.appName=="Netscape") {
				WindowObject.outerWidth=w;
				WindowObject.outerHeight=h;
			}
			else WindowObject.resizeTo(w,h);
		}
	}
