//window.onload = all;
function all()
{
         new_window_link();
         targetBlank();
         fixFlash();
         showIframes();
       
}




       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('content')) return;

        var text = document.getElementById('content');
        var linx = text.getElementsByTagName('a');
       
				for (var i = 0; i < linx.length; i++) {

					// just for off-site links
					
			    if((linx[i].protocol == 'http:')||(linx[i].protocol == 'https:')){
					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 targetBlank(){
            var left = document.getElementById('left');
            var spans = left.getElementsByTagName('span');
       
				    for (var i = 0; i < spans.length; i++) {
				    
				    spans[i].parentNode.setAttribute('target', '_blank');
				    
				    }
}

function fixFlash(){
          var aXobjects = new Array("object","embed","applet");
          for (var x=0; x<aXobjects.length; x++) {
	        var objects = document.getElementsByTagName(aXobjects[x]);
	        for (var i=0; i<objects.length; i++) {
	        objects[i].outerHTML = objects[i].outerHTML;
	}
}
}
function showIframes(){
         //alert('okk');
         var iframefirst = document.getElementById('iframefirst');
         if(iframefirst){

         iframefirst.innerHTML = "test";
         }



}



