function localFilename(url)	// creating a counter file
{
	var x = url.lastIndexOf("/");
	url = url.slice(x + 1);
	return url;		
}

function NewWindow(element)
{ 
	var d = element.getAttribute("src");
	v = localFilename(d);   // for a local filename
	d = '/okno.asp?cesta='+d+'&file='+v;
	winprops = 'height=0,width=0,top=0,left=0, toolbar=no, location=no, scrollbars=no, resizable=no, menubar=no';
	win = window.open(d, '', winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }	
}

function setSize(width,height) {
	var winl = (screen.width - width) / 2;
	var wint = (screen.height - height) / 2 - 38;		
	
	if (window.outerWidth) {
		window.outerWidth = width;
		window.outerHeight = height;
	}
	else if (window.resizeTo) {
		window.resizeTo(width,height);
		self.moveTo(winl,wint);
	}
	else {
		alert("Not supported.");
	}
}