var roundCounter = 0;

function loadFeaturedArticle(hpid, featurenr, Weekday, stopSlide)
{
    var url = 'featuredDiv.html';
    var pars = 'hpid=' + hpid + '&featurenr=' + featurenr + '&Weekday=' + Weekday;
    var myAjax = new Ajax.Updater('featbox', url, {method: 'get', parameters: pars});
    if (stopSlide == 1) {
        window.clearInterval(aktiv);
    }
    if (roundCounter == 2) {
        window.clearInterval(aktiv);
        roundCounter = 0;
    }
}

function startSlide(hpid, listlen, Weekday) 
{
        var currentid = 0;	
	aktiv = window.setInterval( function(){ 
						currentid = currentid + 1; 
						if (currentid >= listlen) {
						    currentid = 0;
                                                    roundCounter = roundCounter + 1;
						}
						loadFeaturedArticle(hpid, currentid, Weekday, stopSlide=0);  
						}, 8000 );
}