var akt=1;
var secs;
var timerID = null;
var timerRunning = false;
var delay = 1000;

function IdozitoBeallit()
	{
	cikk_kep_valt(cikk_kepek[akt],cikk_idek[akt]); 
 
  secs = 4;

  oramegall();
  oraindul();
	}

function oramegall()
	{
  if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
	}

function oraindul()
	{
  timerRunning = true;
  
  if(secs==0)
   	{
    secs=4;
		
		akt=akt+1;
		
		if(akt>3)
			{
			akt=1;
			}
		
		cikk_kep_valt(cikk_kepek[akt],cikk_idek[akt]);
		
		timerID = self.setTimeout("oraindul()", delay);
		}
	else
  	{
		self.status = secs;
    secs = secs - 1;
    timerID = self.setTimeout("oraindul()", delay);
    }
	}

function cikk_kep_valt(kep,hol)
	{
	document.getElementById('kepvalto_kep').src=kep;
	document.getElementById('top_kepvalto_nev1').style.fontWeight = '200';
	document.getElementById('top_kepvalto_nev2').style.fontWeight = '200';
	document.getElementById('top_kepvalto_nev3').style.fontWeight = '200';
	
	document.getElementById(hol).style.fontWeight = '700';
	
	aktualis=hol;
	}


	

