var banServerFile = 'http://adp.adview.pl/ad/';
var banServerJS = 'http://ad.adview.pl/';


var banViewedXxByPoz = ''; 
var xxyEcom = '';
var typyPutBan=new Array();

function putBan(typR){
	var typ=typR;
	if (typR==481) typ=48;
	
	var isRotType = false;
	if (typeof banRotXxByPoz != "undefined") {
                if (typeof banRotXxByPoz[typ] != "undefined") {
                        isRotType = true;
                }
        }
	
	if (!isRotType) {
		
		if (typeof banXxByPoz[typ] != "undefined"){
			document.write('<scr'+'ipt type="text/javascript" src="'+banServerFile+'GetBanFile?bxx='+banXxByPoz[typ]+'"><\/script>');
			banViewedXxByPoz+=banXxByPoz[typ]+',';
		} else if(typR==48) {
			document.write('<div class="bb2" align="right"><a class="bb48r" href="http://serwisy.gazeta.pl/linki/0,52960.html" >+ dodaj swoją reklamę </a></div>');
		}
	} else {
	            if (getBanObj("banP" + typ)) getBanObj("banP" + typ).style.display="block";  

                document.write('<div id="rot' + banXxByPoz[typ] + '"></div>'); 
                document.write('<div id="rotBottom' + banXxByPoz[typ] + '" style="text-align:right; margin-bottom:5px; "><img src="http://bi.gazeta.pl/i/reklama/rot/strzalki_napis.gif" style="border:0;vertical-align:middle;padding-right:5px;"/><a href="javascript:backBan(' + typ + ');"><img src="http://bi.gazeta.pl/i/reklama/rot/strzalki_left.gif" style="border:0;vertical-align:middle;"/></a><a href="javascript:forwardBan(' + typ + ')"><img src="http://bi.gazeta.pl/i/reklama/rot/strzalki_right.gif" style="border:0;vertical-align:middle;"/></a></div>');
                if (banXxByPoz[typ]){
                        banViewedXxByPoz+=banXxByPoz[typ]+',';
                }
                drawBanner(typ);
                startRotate(typ); 
	}
	
	typyPutBan.push(typR);
}


function countBan(dx){
	var typyWspolne='';
	if(typeof typyMakieta!="undefined"){
		for(var i=0;i<typyPutBan.length;++i){
			if(typyMakieta.indexOf(','+typyPutBan[i]+',')!=-1){
				typyWspolne+=typyPutBan[i]+',';
			}
		}
	}
	
	var slowo='';
	if(typeof slowa!="undefined"){
		slowo=slowa;
	}
	
	var instancja='';
	if(typeof adInst!="undefined"){
		instancja=adInst;
	}
	
	if(typeof dx!="undefined"){
		document.write('<scr'+'ipt type="text/javascript" src="'+banServer+'CountBan?dx='+dx+'&bxx='+banViewedXxByPoz+'&banKey='+banKey+'&xxyEcom='+xxyEcom+'&jsp='+ban_jsp+'&typyWspolne='+typyWspolne+'&slowo='+slowo+'&dir='+ban_dir+'&adInst='+instancja+'"><\/script>');
	}
}

function getBanObj(obj) {
if (document.all) return eval('document.all.'+obj); else if (document.getElementById) return eval("document.getElementById('"+obj+"')"); 
}

function banDoIt(txt) { 
eval(unescape(eval(txt))); 
	// eval(unescape(txt)); 
}

if (typeof banRotXxByPoz != "undefined") {
    document.write('<scr'+'ipt type="text/javascript" src="'+banServerJS+'info/ban/silnikRot.js"><\/script>');
}



function putBanGM(typR){
	
	putBan(typR)
	
}


function countBanGM(dx){ 
	countBan(dx);
}
