var W3CDOM = (document.createElement && document.getElementsByTagName);
var posuv = 450; 
window.onload = all;
var timerID;
var tempdir = "";

function all()
{
	if (!W3CDOM) return;
  //Cufon.replace('menu');	
  //Cufon.replace('h2');
  //Cufon.replace('h3');  
	new_window_link();
	
	  	   if(document.getElementById('back2')){   
         var back2 = document.getElementById('back2');
         back2.onclick = moveback2;
          back2.style.display = 'none';
         }
	  	   if(document.getElementById('ffwd2')){
         var ffwd2 = document.getElementById('ffwd2');
         ffwd2.onclick = moveffwd2;
         checkEnds2();
         } 
	
}

 
var path_to_icon 		= '/_devel/culinaria/images/exlink.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].href.length > 0)
		{
			if((linx[i].protocol == 'http:')||(linx[i].protocol == 'https:'))
			{
 
      	if ((linx[i].href.split('/')[2].replace(/www\./, '') != document.domain.replace(/www\./, '')||(linx[i].href.split('out.php')[1]))
				&& !linx[i].getAttribute('target')
				&& !linx[i].parentNode.id.match(/^copy/)
        && (linx[i].childNodes[0].tagName != 'IMG')
				&& linx[i].className.match(/^nonww/)
        )
				{
				linx[i].setAttribute('target', '_blank');
				// 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);
				nwl_image.style.border = 'none';
				// 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);
				}
			}
		}
	}
}
 
  

