var adsImg="http://www.polcreate.pl/viversum/scroller/banner.gif"; 
var adsImg_stop="http://www.polcreate.pl/viversum/scroller/banner.gif"; 
var adsImg_close="http://www.polcreate.pl/viversum/scroller/close.gif"; 
var adsHref="http://www.viversum.pl/?pid=11178";
var adHeight= 30;
var adsWidth= 450;
var adSpeed= 1;

var adContent='<img width='+adsWidth+' height='+adHeight+' src='+adsImg+' border=0>';
var adContent_st='<img width='+adsWidth+' height='+adHeight+' src='+adsImg_stop+' border=0>';
var iedom=document.all||document.getElementById;
var agt=navigator.userAgent.toLowerCase();
var ie=(agt.indexOf("msie")!=-1)?true:false;
var actualWidth='';
var sfContainer;
var ile = 0;
var divs = new Array();
if (iedom) {
actualWidth=document.documentElement.clientWidth;
ile = parseInt(actualWidth/adsWidth)+1;
adW = ile*adsWidth;
sfContainer=document.getElementById?document.getElementById("adContainer") : document.all.adContainer;
document.write('<div id="adContainer" style="visibility:hidden;overflow: hidden; position:absolute; width:'+actualWidth+'px; height:'+eval(adHeight+15)+'px">');
document.write('<div align=right><img src="'+adsImg_close+'" width="14" height="14" border="0" onclick="hide()"></div>');
document.write('<div id="clickin" style="margin-top:15px; position:absolute; left:0; top:0; width:'+actualWidth+'px; height:'+adHeight+'px; z-index:99; background-image: url(\'http://www.polcreate.pl/viversum/scroller/px.gif\'); cursor: pointer;" onClick="window.open(\''+adsHref+'\')" onMouseOver="Stopp();" onMouseOut="Startp()"></div>');
document.write('<div id=adLayer0 style="z-index:1; position:absolute; left:0; margin-top:15px; top:0; white-space:nowrap;"></div>');
document.write('<div id=adLayer1 style="z-index:1; position:absolute; left:0; margin-top:15px; top:0; white-space:nowrap;"></div>');
document.write('</div>');
}

function ScrollAd() {
if (iedom) {
for (i=0;i<=1;i++){
sfLayerPos = parseInt(divs[i].style.left);
divs[i].style.left=sfLayerPos-adSpeed;
if (Math.abs(sfLayerPos)>=adW) divs[i].style.left=adW-adSpeed;
}}}

function FixPositionAd(){
	actualWidth=document.documentElement.clientWidth;
	sfContainer.style.width=actualWidth;
	sfContainer.style.top=document.documentElement.scrollTop+document.documentElement.clientHeight-adHeight-15;
}

function Stopp(){
	adSpeed=0;divs[0].innerHTML='';divs[1].innerHTML='';
	for (i=0;i<=ile;i++){
	divs[0].innerHTML+=adContent_st;
	divs[1].innerHTML+=adContent_st;
	}
}

function Startp(){
	adSpeed=1;divs[0].innerHTML='';divs[1].innerHTML='';
	for (i=0;i<=ile;i++){
	divs[0].innerHTML+=adContent;
	divs[1].innerHTML+=adContent;
	}
}
function InitializeAd() {
if (iedom) {
	sfContainer=document.getElementById?document.getElementById("adContainer") : document.all.adContainer;
	sfContainer.style.left=0;
	sfContainer.style.top=document.documentElement.scrollTop+document.documentElement.clientHeight-adHeight-15;
	for (i=0;i<=1;i++){
	divs[i]=document.getElementById?eval("document.getElementById('adLayer"+i+"')") : eval("document.all.adLayer"+i);
	divs[i].style.left=i*adW;
	for (x=0;x<=ile;x++){divs[i].innerHTML+=adContent};
	}
	sfContainer.style.visibility='visible';
	}
	setInterval("ScrollAd()",3);
}
function hide(){
	if (sfContainer) sfContainer.style.visibility='hidden';
}


function ff(){
  tresc0 = '<div style="left:0; bottom:0; width:'+actualWidth+'px;  z-index:99;  position:fixed;">';
  tresc1 = '<div align=right><img src="'+adsImg_close+'" width="14" height="14" border="0" onclick="hide()"></div>';
  tresc2 = '<div style="height:'+adHeight+'px; cursor: pointer; background-image: url(http://www.polcreate.pl/viversum/scroller/banner.gif)" onClick="window.open(\''+adsHref+'\')"></div>';
  tresc3 = '</div>'
  document.getElementById('adContainer').innerHTML = tresc0+tresc1+tresc2+tresc3;
}



if (window.attachEvent) {
	window.attachEvent("onscroll",FixPositionAd);
	window.attachEvent("onresize",FixPositionAd);
	window.attachEvent("onload",InitializeAd);
} else {
  	window.onload=InitializeAd;
  	window.onscroll=ff;
  	window.onresize=ff;
  	
	
}
