function IFrame(obiektRamka, obiektSuwak, obiektTrasa, nazwaZmiennej) {
  ramka = obiektRamka;
	interwal=null;
	suwak = obiektSuwak;
	trasa = obiektTrasa;
	suwak.unselectable='on';
	trzymany=false;
	nazwa = nazwaZmiennej;
	ramka.style.overflow='hidden';
	y=0;
	offset=222;
	function chwyc(){trzymany=true;}
	this.chwyc = chwyc;
	
	function pusc(){trzymany=false;}
	this.pusc = pusc;
	
	function zwolnij()
	{
		pusc();
		zakonczPrzesuwanie();
	}
	this.zwolnij = zwolnij;
	
	function przesunDo(evt)
	{
		if(evt.pageY) {odGory = evt.pageY - trasa.offsetTop-offset-70;}
		else { odGory = evt.y -offset-70;}
		
		maxPrzesuniecie = ramka.scrollHeight-ramka.offsetHeight;
		maxSuwak = trasa.offsetHeight - suwak.offsetHeight-12;
		odGory = Math.round((maxPrzesuniecie*odGory)/maxSuwak);
		odleglosc = Math.max(0,Math.min(maxPrzesuniecie,odGory));
		ramka.scrollTop = odleglosc;
		suwak.style.marginTop = Math.round((odleglosc*maxSuwak)/maxPrzesuniecie)+'px';
	}
	this.przesunDo = przesunDo;
	
	function dragDrop(evt)
	{	
		if(trzymany) przesunDo(evt);
	}
	this.dragDrop = dragDrop;
	
	function przesun(dx)
	{
		maxPrzesuniecie = ramka.scrollHeight-ramka.offsetHeight;
		maxSuwak = trasa.offsetHeight - suwak.offsetHeight-12;
		odleglosc = Math.max(0,Math.min(maxPrzesuniecie,ramka.scrollTop+dx));
		ramka.scrollTop = odleglosc;

		suwak.style.marginTop = Math.round((odleglosc*maxSuwak)/maxPrzesuniecie)+'px';
	}
	this.przesun = przesun;
	
	function przesuwaj(dx){
		przesun(dx);
		if(interwal==null) interwal = window.setInterval(nazwa+'.przesun('+dx+')',50);
	}
	this.przesuwaj = przesuwaj;
	
	function zakonczPrzesuwanie(){
		if(interwal!=null) clearInterval(interwal);
		interwal=null;
	}
	this.zakonczPrzesuwanie = zakonczPrzesuwanie;
	if(ramka.scrollHeight>ramka.offsetHeight)
	{
		var height=Math.round(ramka.offsetHeight*379/ramka.scrollHeight);
		offset=100+(height/2)
		suwak.style.height=height+'px';
		document.getElementById('content').className='showScroll'
	}
}