if (document.images) {
  img01on = new Image();
  img01on.src  = "imgs/mnu_01_on.png";
  img01off = new Image();
  img01off.src = "imgs/mnu_01_off.png";

  img02on = new Image();
  img02on.src  = "imgs/mnu_02_on.png";
  img02off = new Image();
  img02off.src = "imgs/mnu_02_off.png";

  img03on = new Image();
  img03on.src  = "imgs/mnu_03_on.png";
  img03off = new Image();
  img03off.src = "imgs/mnu_03_off.png";

  img04on = new Image();
  img04on.src  = "imgs/mnu_04_on.png";
  img04off = new Image();
  img04off.src = "imgs/mnu_04_off.png";

  img05on = new Image();
  img05on.src  = "imgs/mnu_05_on.png";
  img05off = new Image();
  img05off.src = "imgs/mnu_05_off.png";

  img06on = new Image();
  img06on.src  = "imgs/mnu_06_on.png";
  img06off = new Image();
  img06off.src = "imgs/mnu_06_off.png";

}

function fade(obj) {
			obj.filters.alpha.opacity=95;
  			obj.filters.enabled=false;
				}
function unfade(obj) {
			obj.filters.alpha.opacity=50;
			obj.filters.enabled=true;
				}


function turnOn(imageName) {
  if (document.images) {
    document["img"+imageName].src = eval("img" + imageName + "on.src");
  }
}

function turnOff(imageName) {
  if (document.images) {
     document["img"+imageName].src = eval("img" + imageName + "off.src");
  }
}



function isArray(obj) {
	//returns true is it is an array
	if (obj.constructor.toString().indexOf('Array') == -1) return false;
	else return true;
} 

// concurrent xmlhttprequest loader modified by RASTA

function loadDoc(evt, urls, outputs) {
    
	if (!isArray(urls) && !isArray(outputs)) {
		tmp = urls;
		urls = new Array(urls);
		tmp = outputs;
		outputs = new Array(outputs);
	}
	
    try {
        ConcurrentDocumentLoader.loadAll( urls, outputs, function( reqArray ) {
             if ( reqArray.length != urls.length ) {
                 alert( "Error: expected " + urls.length + " docs, got: " + reqArray.length );
             } else {
				 //DEBUG
                 //alert( "Sucess!");
             }
        } );
    } catch ( e ) {
        alert( "loadAll error: " + e );
    }
}

var ConcurrentDocumentLoader = new function() {
    // public
    this.loadAll = function( urls, outputs, callback ) {
        var outstanding = urls.length;
        var results = [];
        for ( var i = 0; i < urls.length; i++ ) {
             asyncLoadDocument( urls[i], outputs[i], function( req ) {
                outstanding--;
                results.push( req );
                if ( outstanding == 0 ) {
                    callback.call( null, results );
                }
            } );
        }
    }
    // private
    function asyncLoadDocument( url, output, callback ) {
        var xmlhttp = getXmlHttpRequest();
        // This is needed for testing locally in Mozilla
        if ( window.netscape && netscape.security.PrivilegeManager.enablePrivilege) {
            //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
        }

        xmlhttp.open("GET", url, true);
        xmlhttp.onreadystatechange=function() {
            if (xmlhttp.readyState == 4 ) {
				if (xmlhttp.status == 200) {
					document.getElementById(output).innerHTML = xmlhttp.responseText;
					callback.call( xmlhttp );
				}
            }
        };
        xmlhttp.send(null);
    }

    function getXmlHttpRequest() {
        try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
        try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
        if ( typeof XMLHttpRequest!='undefined') {
            try { return new XMLHttpRequest(); } catch (e) {}
        }
        if ( window.createRequest) { return window.createRequest(); }
        throw "Can't create XMLHttpRequest!";
    }
}


function flashTOP(arg)
{
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="766" height="263" id="header" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="header.swf" /><param name="quality" value="high" /><param name="wmode" /><param name="bgcolor" value="#000000" /><embed src="header.swf" quality="high" bgcolor="#d0d0d0" width="766" height="263" name="header" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}


function mapa(arg)
{
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="457" height="265" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="mapa6.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="mapa6.swf" quality="high" wmode="transparent" width="457" height="265" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- neplatný '+nm+'\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+'=> NEPLATNÉ ZADÁNÍ.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if ((num<min || max<num)) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+'=> NEZADÁNO!\n'; }
  } if (errors) alert('CHYBA!\n'+errors);
  document.MM_returnValue = (errors == '');
}

function imgs(FileName)
{
        var wnd = window.open("", "newWindow", "alwaysraised=no,dependent=no,hotkeys=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,width=640,height=480");
        wnd.document.open("text/html", "replace");
        wnd.document.writeln("<HTML>");
        wnd.document.writeln("<HEAD>");
        wnd.document.writeln("<TITLE>ELPEKO:galerie</TITLE>");
        wnd.document.writeln("<SCRIPT>");
        wnd.document.writeln("function setSize()");
        wnd.document.writeln("{");
        wnd.document.writeln("var img = window.document.images[0];");
        wnd.document.writeln("window.resizeTo(img.width+10, img.height+30);");
        wnd.document.writeln("}");
        wnd.document.writeln("<\/SCRIPT>");
  

        wnd.document.writeln('<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">');
        wnd.document.writeln('<meta name="resource-type" content="document">');
        wnd.document.writeln("</HEAD>");
        wnd.document.writeln('<BODY bgcolor="#000000" marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 text="#FFFFFF" link="#FFFF00" vlink="#FFFF00" alink="#00FF00" onBlur="window.close()" onLoad="setSize();">');
        wnd.document.writeln('<IMG SRC="'+FileName+'" BORDER=0>');
        wnd.document.writeln("</BODY>");
        wnd.document.writeln("</HTML>");
        wnd.document.close();
        wnd.onBlur = "window.close();";
        wnd.focus();
}
