var act_pos=0;
var act_posr=0;

var lch;
var rch; 
var doc;
var scroller;
var scroller_r;

function scroll_right(n){
        if (window.parent.frames['right']) {
                if (gordul==1)window.parent.frames['right'].scrollBy(0,n);
                if((act_posr+window.parent.frames['right'].document.body.clientHeight)>=rch) {
                        clearInterval(scroller_r);
                        scroller_r=setInterval('scroll_right(1)',50);
                }
                if((act_posr+window.parent.frames['right'].document.body.clientHeight)>=rch+20) {
                        clearInterval(scroller_r);
                        scroller_r=setInterval('scroll_right_up(2)',50);
                        //window.parent.frames['right'].scrollTo(0,0);act_posr=0;
                }
                if (gordul==1)act_posr+=n;
        }
}

function scroll_right_up(n){
        if (window.parent.frames['right']) {
                if (gordul==1)window.parent.frames['right'].scrollBy(0,-n);
                //window.status=rch+' '+n+' '+act_posr;
                if((act_posr<20)) {
                        clearInterval(scroller_r);
                        scroller_r=setInterval('scroll_right_up(1)',50);
                }
                if((act_posr<0)) {
                        //window.parent.frames['right'].scrollTo(0,0);act_posr=0; 
                        clearInterval(scroller_r);
                        scroller_r=setInterval('scroll_right(2)',50);
                }
                if (gordul==1)act_posr-=n;
        }
}

function startscrollr(){
doc = document.getElementById("right").contentDocument; 
if (doc == undefined) // Internet Explorer
doc = document.getElementById("right").contentWindow.document;

rch=doc.getElementById('akciok').offsetHeight;
scroller_r=setInterval('scroll_right(2)',50);

}

function startManualScrollUpRight(){
clearInterval(scroller_r);
scroll_right_up(50);
}

function startManualScrollDownRight(){
clearInterval(scroller_r);
scroll_right(50);
//scroller_r=setInterval('scroll_right(2)',50);
}

