function zoom(url, w, h, title, alt)
{
	l = screen.width/2-w/2;
	t = screen.height/2-h/2-50;
	if (l<0) l = 0;
	if (t<0) t = 0;
	if(h>600 && w>850) { 
		heightwin = 600; 
		widthwin = 800; 
	} else if(h>600 && w<850) { 
		heightwin = 600; 
		widthwin = w+16; 
	} else if(h<600 && w>850) { 
		heightwin = h+16; 
		widthwin = 800; 
	} else {  
		heightwin = h; 
		widthwin = w; 
	}
	o = window.open('','fotka','status=no,width='+widthwin+',height='+heightwin+',resizable=no,menubar=no,location=no,scrollbars=yes,toolbar=no,left='+l+',top='+t+'');
//	o = window.open('','fotka','status=no,width='+w+',height='+h+',resizable=no,menubar=no,location=no,scrollbars=no,toolbar=no,left='+l+',top='+t+'');
	d = o.document;
	d.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
	d.writeln('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">');
	d.writeln('<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1250"/>');
	d.writeln('<title>'+title+'</title>');
	d.writeln('<style type="text/css" media="screen">');
	d.writeln('BODY{margin: 0px; padding: 0px;}');
	d.writeln('IMG{margin: 0px; padding: 0px; border: 0px solid black; display:block;}');
	d.writeln('</style>');
	d.write('<body >');
	d.write  ('<a href="javascript:close()">');
	d.write  ('<img src="'+url+'" width="'+w+'" height="'+h+'" border="0" hspace="0" vspace="0" alt="" title="'+alt+'">');
	d.write('</a>');
	d.write('</body>')
	d.writeln('</html>');
	d.close();
	d.title = title;
}
function zoom2(url, w, h, title, alt)
{
	l = screen.width/2-w/2;
	t = screen.height/2-h/2-50;
	if (l<0) l = 0;
	if (t<0) t = 0;
	if(h>600) { 
		heightwin = 600; 
		widthwin = w+16; 
	} else {  
		heightwin = h; 
		widthwin = w; 
	}
	o = window.open('','fotka','status=no,width='+widthwin+',height='+heightwin+',resizable=no,menubar=no,location=no,scrollbars=yes,toolbar=no,left='+l+',top='+t+'');
	d = o.document;
	d.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
	d.writeln('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">');
	d.writeln('<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1250"/>');
	d.writeln('<title>'+title+'</title>');
	d.writeln('<style type="text/css" media="screen">');
	d.writeln('BODY{margin: 0px; padding: 0px;}');
	d.writeln('IMG{margin: 0px; padding: 0px; border: 0px solid black; display:block;}');
	d.writeln('</style>');
	d.write('<body >');
	d.write  ('<a href="javascript:close()">');
	d.write  ('<img src="'+url+'" width="'+w+'" height="'+h+'" border="0" hspace="0" vspace="0" alt="" title="'+alt+'">');
	d.write('</a>');
	d.write('</body>')
	d.writeln('</html>');
	d.close();
	d.title = title;
}
// SHOW/HIDE FCE:
function switchlayer(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
		style2.position = style2.position? "":"absolute";
		style2.left = style2.left? "":"0px";
		style2.top = style2.top? "":"15px";
		style2.width = style2.width? "":"211px";
		style2.height = style2.height? "":"40px";
		style2.backgroundColor = style2.backgroundColor? "":"#ff7f00";
		style2.zIndex = style2.zIndex? "":"999";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
		style2.position = style2.position? "":"absolute";
		style2.left = style2.left? "":"0px";
		style2.top = style2.top? "":"15px";
		style2.width = style2.width? "":"211px";
		style2.height = style2.height? "":"40px";
		style2.backgroundColor = style2.backgroundColor? "":"#ff7f00";
		style2.zIndex = style2.zIndex? "":"999";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
		style2.position = style2.position? "":"absolute";
		style2.left = style2.left? "":"0px";
		style2.top = style2.top? "":"15px";
		style2.width = style2.width? "":"211px";
		style2.height = style2.height? "":"40px";
		style2.backgroundColor = style2.backgroundColor? "":"#ff7f00";
		style2.zIndex = style2.zIndex? "":"999";
	}
}

// TARGET FCE:
function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

function removeEvent( obj, type, fn )
{
	if (obj.removeEventListener)
		obj.removeEventListener( type, fn, false );
	else if (obj.detachEvent)
	{
		obj.detachEvent( "on"+type, obj[type+fn] );
		obj[type+fn] = null;
		obj["e"+type+fn] = null;
	}
}

/* Create the new window */
function openInNewWindow(e) {
	var event;
	if (!e) event = window.event;
	else event = e;
	// Abort if a modifier key is pressed
	if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
		return true;
	}
	else {
		// Change "_blank" to something like "newWindow" to load all links in the same new window
	    var newWindow = window.open(this.getAttribute('href'), '_blank');
		if (newWindow) {
			if (newWindow.focus) {
				newWindow.focus();
			}
			return false;
		}
		return true;
	}
}

/*
Add the openInNewWindow function to the onclick event of links with a class name of "new-window"
*/
function getNewWindowLinks() {
	// Check that the browser is DOM compliant
	if (document.getElementById && document.createElement && document.appendChild) {
		// Change this to the text you want to use to alert the user that a new window will be opened
//		var strNewWindowAlert = " (opens in a new window)";
		var strNewWindowAlert = "";
// Find all links
		var links = document.getElementsByTagName('a');
		var objWarningText;
		var link;
		for (var i = 0; i < links.length; i++) {
			link = links[i];
			// Find all links with a class name of "non-html"
			if (/\bout\b/.test(link.className)) {
				// Create an em element containing the new window warning text and insert it after the link text
				objWarningText = document.createElement("em");
				objWarningText.appendChild(document.createTextNode(strNewWindowAlert));
				link.appendChild(objWarningText);
				link.onclick = openInNewWindow;
			}
		}
		objWarningText = null;
	}
}

addEvent(window, 'load', getNewWindowLinks);