if( decrement == 1 )
{
 i = first + 1;
}

else
{
 i = first - 1;
}

function chng()
{
  if( rnd == 1 )
  { 
    i = Math.floor ( Math.random ( ) * m_num + 1 ) ;
  }

  else if( decrement == 1 ){
    if(i > 1){
      i--;
    }
    else {
      i = m_num;
    }
  }

  else{
    if( i < m_num ){
      i++;
    }
    else {
      i = 1;
    }
  }
  parent.sponsorss.location.href = "http://www.roltamax.de//sponsorss.php?p="+i;
}

k = null;

function start_stop()
{
 if(st==1){
   k=setInterval('chng()',time_interval);
   st = 0;
   document.frm.stp.value="Stop";
 }
 else if(st==0){
   if(k!=null)
   { 
     clearInterval(k);
   }
   st = 1;
   document.frm.stp.value="Start";
 }
}

