                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
var pasek_wys, pasek_div;
var pasekID       = 'tvn24tickertape';
var pasek_swf     = '_d/wideo/flash/tvn-scroll.swf';
var pasek_height  = 23;

if (window.attachEvent)
{
	attachEvent('onload', PasekInit);
}
else if (window.addEventListener)
{
	addEventListener('load', PasekInit, false);
}

function PasekInit() 
{
	if (_GetCookie('pasek_off') || !document.getElementById("pasek_on")) return;
	
   file  = pasek_swf;
   h     = pasek_height;
	pasek_wys = h;

	var div = document.createElement('div');
	div.id = pasekID;
	div.style.visibility = 'hidden';
	div.style.position = 'absolute';
	div.style.top = '0px';
	div.style.left = '0px';
	div.style.width = '100%';
	div.style.height = '23px';
	div.style.zIndex = 10000;
	div.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="'+h+'" align="left">'
					  + '<param name="allowScriptAccess" value="sameDomain" />'
					  + '<param name="movie" value="'+file+'" />'
					  + '<param name="quality" value="high" />'
					  + '<param name="wmode" value="transparent" />'
					  + '<param name="salign" value="t" />'
					  + '<param name="menu" value="false" />'
					  + '<param name="scale" value="noscale" />'
					  + '<embed src="'+file+'" width="100%" height="'+h+'" salign="t" quality="high" align="left" wmode="transparent" menu="false" allowScriptAccess="sameDomain" scale="noscale"'
					  + ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
					  + '</object>';
	pasek_div = div;
   PasekStart();
	if (window.attachEvent)
	{
		attachEvent('onscroll', PasekTop);
	}
	else if (window.addEventListener)
	{
		addEventListener('scroll', PasekTop, false);
	}
}

function PasekStart()
{
	document.body.appendChild(pasek_div);
	PasekTop();
	var el = document.getElementById(pasekID);
	if (el) el.style.visibility = 'visible';
}

function PasekTop()
{
	var el = document.getElementById(pasekID);
	if (!el) return;
	var p = document.body.scrollTop + document.body.clientHeight - pasek_wys;
	el.style.top = (p > 0) ? p : document.body.clientHeight - pasek_wys;
}

function PasekStop()
{
	var el = document.getElementById(pasekID);
	el.style.visibility = 'hidden';
	var im = new Image(1,1);
	im.src = '/pasekoff.gif';
}

function _GetCookie(_n)
{
   var aCo = document.cookie.split('; ');
   for (var i = 0; i < aCo.length; i++)
   {
      var aC = aCo[i].split('=');
      if (aC[0] == _n)
         return unescape(aC[1]);
   }
   return '';
}

