var W3CDOM = (document.createElement && document.getElementsByTagName);
window.onload = init;
function init()
{
	       if (!W3CDOM) return;
	       new_window_link();
	       //targetBlank();
	       //table();      
}
function targetBlank(){
      
             //var openew = document.getElementById('openew');
				    //openew.setAttribute('target', '_blank');
}
       var path_to_icon 		= 'http://www.nemoletenky.cz/images/icon.gif';
			 var link_alt_text 		= 'Otevřít odkaz v novém okně';
			 var link_title_text 	= 'Otevřít odkaz v novém okně';

function new_window_link() {
			  
				if (!document.getElementById || !document.createTextNode || !document.domain || !document.getElementById('rightmenu')) return;
        var text = document.getElementById('rightmenu');
        var linx = text.getElementsByTagName('a');
				for (var i = 0; i < linx.length; i++) {
					// just for off-site links
			    if(linx[i].protocol == 'http:'){
					if (linx[i].href.split('/')[2].replace(/www\./, '') != document.domain.replace(/www\./, '')
						&& !linx[i].getAttribute('target')
						&& !linx[i].parentNode.id.match(/^copy/)) {

						// create new elements
						var nwl = document.createElement('a');
						var nwl_image = document.createElement('img');
						var space = document.createTextNode(' ');

						// setup image attributes
						nwl_image.setAttribute('src', path_to_icon);
						nwl_image.setAttribute('alt', link_alt_text);
						nwl_image.setAttribute('title', link_title_text);

						// set link attributes
						nwl.setAttribute('href', linx[i].getAttribute('href'));
						nwl.setAttribute('target', '_blank');
						nwl.setAttribute('title', link_title_text);
						nwl.className = 'new_window_link';

						// append new elements
						nwl.appendChild(nwl_image);
						linx[i].parentNode.insertBefore(space, linx[i].nextSibling);
						linx[i].parentNode.insertBefore(nwl, linx[i].nextSibling.nextSibling);
					}
				}
				}
			}

function showArchiv(){
    if(document.getElementById('archiv')){
    if( document.getElementById('archiv').style.display == 'block')
   {
    document.getElementById('archiv').style.display = 'none';   
   }
   else{
    document.getElementById('archiv').style.display = 'block';
    }
}
}