
mondatok = []
mIndex = 0
ttout=0

function prev_item(e) {
    clearTimeout(ttout)
    mondatok[mIndex--].className = "tudtae lathatatlan";
    if (mIndex<0) mIndex = mondatok.length-1;
    mondatok[mIndex].className = "tudtae lathato";
    ttout = setTimeout("valtogat()", 5000)    
}

function next_item(e) {
    clearTimeout(ttout)
    mondatok[mIndex++].className = "tudtae lathatatlan";
    if (mIndex>=mondatok.length) mIndex = 0;
    mondatok[mIndex].className = "tudtae lathato";
    ttout = setTimeout("valtogat()", 5000)    
}


function valtogat() {
    mondatok[mIndex++].className = "tudtae lathatatlan";
    if (mIndex>=mondatok.length) mIndex = 0;
    mondatok[mIndex].className = "tudtae lathato";
    ttout=setTimeout("valtogat()", 5000)
}

function tudtaeStart(e) {
    mondatok = getElementsByClassName("tudtae", "P")
    ttout=setTimeout("valtogat()", 5000)
    document.getElementById('tudta_e_nav').innerHTML = '<a href="javascript:;" onclick="prev_item();">&lt;&lt;</a>&nbsp;&nbsp;&nbsp;<a href="javascript:;" onclick="next_item();">&gt;&gt;</a>';
    
}

setEvent(window, "load", tudtaeStart) 

