function imageItem(image_location) 
{
    this.image_item = new Image();
    this.image_item.src = image_location;
}
        
function get_ImageItemLocation(imageObj) 
{
    return(imageObj.image_item.src)
}

function randNum(x, y) 
{
    var range = y - x + 1;
    return Math.floor(Math.random() * range) + x;
}

function getNextImage() 
{
    if (random_display) 
    {
	    imageNum = randNum(0, totalImages-1);
    }
    else 
    {
	    imageNum = (imageNum+1) % totalImages;
    }
    var new_image = get_ImageItemLocation(imageArray[imageNum]);
    return(new_image);
}


function getPrevImage() 
{
    if (random_display) 
    {
	    imageNum = randNum(0, totalImages-1);
    }
    else if (imageNum == 0)
    {
        imageNum = totalImages-1;
    }
    else 
    {
	    imageNum = (imageNum-1) % totalImages;
    }   
    var new_image = get_ImageItemLocation(imageArray[imageNum]);
    return(new_image);
}

function prevImage(place) 
{
    var new_image = getPrevImage();
    document[place].src = new_image;
    var recur_call = "switchImage('"+place+"')";
    timerID = setTimeout(recur_call, interval);
}

function switchImage(place) 
{
    var new_image = getNextImage();
    document[place].src = new_image;
    var recur_call = "switchImage('"+place+"')";
    timerID = setTimeout(recur_call, interval);
}

function runSlideShow() 
{
    if (document.all) 
    {
        document.images.SlideShow.style.filter="blendTrans(duration=2)";
        document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
        document.images.SlideShow.filters.blendTrans.Apply();
    }
    document.images.SlideShow.src = preLoad[j].src;
    if (document.all)
    {
        document.images.SlideShow.filters.blendTrans.Play();
    }
    j = j + 1;
    if (j > (p - 1)) j = 0;
    t = setTimeout('runSlideShow()', slideShowSpeed);
}

function runSlideShow2() 
{
    if (document.all) 
    {
        document.images.SlideShow2.style.filter="blendTrans(duration=2)";
        document.images.SlideShow2.style.filter="blendTrans(duration=crossFadeDuration2)";
        document.images.SlideShow2.filters.blendTrans.Apply();
    }
    document.images.SlideShow2.src = preLoad2[j2].src;
    if (document.all)
    {
        document.images.SlideShow2.filters.blendTrans.Play();
    }
    j2 = j2 + 1;
    if (j2 > (p2 - 1)) j2 = 0;
    t2 = setTimeout('runSlideShow2()', slideShowSpeed2);
}


//Seulement en attendant que le statique deviennent dynamique

//el_cameleon
function getNextImage_el_cameleon() 
{
    if (random_display_el_cameleon) 
    {
	    imageNum_el_cameleon = randNum(0, totalImages_el_cameleon-1);
    }
    else 
    {
	    imageNum_el_cameleon = (imageNum_el_cameleon+1) % totalImages_el_cameleon;
    }
    var new_image_el_cameleon = get_ImageItemLocation(imageArray_el_cameleon[imageNum_el_cameleon]);
    return(new_image_el_cameleon);
}


function getPrevImage_el_cameleon() 
{
    if (random_display_el_cameleon) 
    {
	    imageNum_el_cameleon = randNum(0, totalImages_el_cameleon-1);
    }
    else if (imageNum_el_cameleon == 0)
    {
        imageNum_el_cameleon = totalImages_el_cameleon-1;
    }
    else 
    {
	    imageNum_el_cameleon = (imageNum_el_cameleon-1) % totalImages_el_cameleon;
    }   
    var new_image = get_ImageItemLocation(imageArray_el_cameleon[imageNum_el_cameleon]);
    return(new_image);
}

function prevImage_el_cameleon(place) 
{
    var new_image_el_cameleon = getPrevImage_el_cameleon();
    document[place].src = new_image_el_cameleon;
    var recur_call_el_cameleon = "switchImage('"+place+"')";
    timerID_el_cameleon = setTimeout(recur_call_el_cameleon, interval_el_cameleon);
}

function switchImage_el_cameleon(place) 
{
    var new_image_el_cameleon = getNextImage_el_cameleon();
    document[place].src = new_image_el_cameleon;
    var recur_call_el_cameleon = "switchImage('"+place+"')";
    timerID_el_cameleon = setTimeout(recur_call_el_cameleon, interval_el_cameleon);
}


//chopper springer
function getNextImage_chopper_springer() 
{
    if (random_display_chopper_springer) 
    {
	    imageNum_chopper_springer = randNum(0, totalImages_chopper_springer-1);
    }
    else 
    {
	    imageNum_chopper_springer = (imageNum_chopper_springer+1) % totalImages_chopper_springer;
    }
    var new_image_chopper_springer = get_ImageItemLocation(imageArray_chopper_springer[imageNum_chopper_springer]);
    return(new_image_chopper_springer);
}


function getPrevImage_chopper_springer() 
{
    if (random_display_chopper_springer) 
    {
	    imageNum_chopper_springer = randNum(0, totalImages_chopper_springer-1);
    }
    else if (imageNum_chopper_springer == 0)
    {
        imageNum_chopper_springer = totalImages_chopper_springer-1;
    }
    else 
    {
	    imageNum_chopper_springer = (imageNum_chopper_springer-1) % totalImages_chopper_springer;
    }   
    var new_image = get_ImageItemLocation(imageArray_chopper_springer[imageNum_chopper_springer]);
    return(new_image);
}

function prevImage_chopper_springer(place) 
{
    var new_image_chopper_springer = getPrevImage_chopper_springer();
    document[place].src = new_image_chopper_springer;
    var recur_call_chopper_springer = "switchImage('"+place+"')";
    timerID_chopper_springer = setTimeout(recur_call_chopper_springer, interval_chopper_springer);
}

function switchImage_chopper_springer(place) 
{
    var new_image_chopper_springer = getNextImage_chopper_springer();
    document[place].src = new_image_chopper_springer;
    var recur_call_chopper_springer = "switchImage('"+place+"')";
    timerID_chopper_springer = setTimeout(recur_call_chopper_springer, interval_chopper_springer);
}

//prostreet07
function getNextImage_prostreet07() 
{
    if (random_display_prostreet07) 
    {
	    imageNum_prostreet07 = randNum(0, totalImages_prostreet07-1);
    }
    else 
    {
	    imageNum_prostreet07 = (imageNum_prostreet07+1) % totalImages_prostreet07;
    }
    var new_image_prostreet07 = get_ImageItemLocation(imageArray_prostreet07[imageNum_prostreet07]);
    return(new_image_prostreet07);
}


function getPrevImage_prostreet07() 
{
    if (random_display_prostreet07) 
    {
	    imageNum_prostreet07 = randNum(0, totalImages_prostreet07-1);
    }
    else if (imageNum_prostreet07 == 0)
    {
        imageNum_prostreet07 = totalImages_prostreet07-1;
    }
    else 
    {
	    imageNum_prostreet07 = (imageNum_prostreet07-1) % totalImages_prostreet07;
    }   
    var new_image = get_ImageItemLocation(imageArray_prostreet07[imageNum_prostreet07]);
    return(new_image);
}

function prevImage_prostreet07(place) 
{
    var new_image_prostreet07 = getPrevImage_prostreet07();
    document[place].src = new_image_prostreet07;
    var recur_call_prostreet07 = "switchImage('"+place+"')";
    timerID_prostreet07 = setTimeout(recur_call_prostreet07, interval_prostreet07);
}

function switchImage_prostreet07(place) 
{
    var new_image_prostreet07 = getNextImage_prostreet07();
    document[place].src = new_image_prostreet07;
    var recur_call_prostreet07 = "switchImage('"+place+"')";
    timerID_prostreet07 = setTimeout(recur_call_prostreet07, interval_prostreet07);
}

//dyna monoshock
function getNextImage_dyna_monoshock() 
{
    if (random_display_dyna_monoshock) 
    {
	    imageNum_dyna_monoshock = randNum(0, totalImages_dyna_monoshock-1);
    }
    else 
    {
	    imageNum_dyna_monoshock = (imageNum_dyna_monoshock+1) % totalImages_dyna_monoshock;
    }
    var new_image_dyna_monoshock = get_ImageItemLocation(imageArray_dyna_monoshock[imageNum_dyna_monoshock]);
    return(new_image_dyna_monoshock);
}


function getPrevImage_dyna_monoshock() 
{
    if (random_display_dyna_monoshock) 
    {
	    imageNum_dyna_monoshock = randNum(0, totalImages_dyna_monoshock-1);
    }
    else if (imageNum_dyna_monoshock == 0)
    {
        imageNum_dyna_monoshock = totalImages_dyna_monoshock-1;
    }
    else 
    {
	    imageNum_dyna_monoshock = (imageNum_dyna_monoshock-1) % totalImages_dyna_monoshock;
    }   
    var new_image = get_ImageItemLocation(imageArray_dyna_monoshock[imageNum_dyna_monoshock]);
    return(new_image);
}

function prevImage_dyna_monoshock(place) 
{
    var new_image_dyna_monoshock = getPrevImage_dyna_monoshock();
    document[place].src = new_image_dyna_monoshock;
    var recur_call_dyna_monoshock = "switchImage('"+place+"')";
    timerID_dyna_monoshock = setTimeout(recur_call_dyna_monoshock, interval_dyna_monoshock);
}

function switchImage_dyna_monoshock(place) 
{
    var new_image_dyna_monoshock = getNextImage_dyna_monoshock();
    document[place].src = new_image_dyna_monoshock;
    var recur_call_dyna_monoshock = "switchImage('"+place+"')";
    timerID_dyna_monoshock = setTimeout(recur_call_dyna_monoshock, interval_dyna_monoshock);
}

//prostreet05
function getNextImage_prostreet05() 
{
    if (random_display_prostreet05) 
    {
	    imageNum_prostreet05 = randNum(0, totalImages_prostreet05-1);
    }
    else 
    {
	    imageNum_prostreet05 = (imageNum_prostreet05+1) % totalImages_prostreet05;
    }
    var new_image_prostreet05 = get_ImageItemLocation(imageArray_prostreet05[imageNum_prostreet05]);
    return(new_image_prostreet05);
}


function getPrevImage_prostreet05() 
{
    if (random_display_prostreet05) 
    {
	    imageNum_prostreet05 = randNum(0, totalImages_prostreet05-1);
    }
    else if (imageNum_prostreet05 == 0)
    {
        imageNum_prostreet05 = totalImages_prostreet05-1;
    }
    else 
    {
	    imageNum_prostreet05 = (imageNum_prostreet05-1) % totalImages_prostreet05;
    }   
    var new_image = get_ImageItemLocation(imageArray_prostreet05[imageNum_prostreet05]);
    return(new_image);
}

function prevImage_prostreet05(place) 
{
    var new_image_prostreet05 = getPrevImage_prostreet05();
    document[place].src = new_image_prostreet05;
    var recur_call_prostreet05 = "switchImage('"+place+"')";
    timerID_prostreet05 = setTimeout(recur_call_prostreet05, interval_prostreet05);
}

function switchImage_prostreet05(place) 
{
    var new_image_prostreet05 = getNextImage_prostreet05();
    document[place].src = new_image_prostreet05;
    var recur_call_prostreet05 = "switchImage('"+place+"')";
    timerID_prostreet05 = setTimeout(recur_call_prostreet05, interval_prostreet05);
}


//flh04
function getNextImage_flh04() 
{
    if (random_display_flh04) 
    {
	    imageNum_flh04 = randNum(0, totalImages_flh04-1);
    }
    else 
    {
	    imageNum_flh04 = (imageNum_flh04+1) % totalImages_flh04;
    }
    var new_image_flh04 = get_ImageItemLocation(imageArray_flh04[imageNum_flh04]);
    return(new_image_flh04);
}


function getPrevImage_flh04() 
{
    if (random_display_flh04) 
    {
	    imageNum_flh04 = randNum(0, totalImages_flh04-1);
    }
    else if (imageNum_flh04 == 0)
    {
        imageNum_flh04 = totalImages_flh04-1;
    }
    else 
    {
	    imageNum_flh04 = (imageNum_flh04-1) % totalImages_flh04;
    }   
    var new_image = get_ImageItemLocation(imageArray_flh04[imageNum_flh04]);
    return(new_image);
}

function prevImage_flh04(place) 
{
    var new_image_flh04 = getPrevImage_flh04();
    document[place].src = new_image_flh04;
    var recur_call_flh04 = "switchImage('"+place+"')";
    timerID_flh04 = setTimeout(recur_call_flh04, interval_flh04);
}

function switchImage_flh04(place) 
{
    var new_image_flh04 = getNextImage_flh04();
    document[place].src = new_image_flh04;
    var recur_call_flh04 = "switchImage('"+place+"')";
    timerID_flh04 = setTimeout(recur_call_flh04, interval_flh04);
}

//prostreet05-orange
function getNextImage_prostreet05_orange() 
{
    if (random_display_prostreet05_orange) 
    {
	    imageNum_prostreet05_orange = randNum(0, totalImages_prostreet05_orange-1);
    }
    else 
    {
	    imageNum_prostreet05_orange = (imageNum_prostreet05_orange+1) % totalImages_prostreet05_orange;
    }
    var new_image_prostreet05_orange = get_ImageItemLocation(imageArray_prostreet05_orange[imageNum_prostreet05_orange]);
    return(new_image_prostreet05_orange);
}


function getPrevImage_prostreet05_orange() 
{
    if (random_display_prostreet05_orange) 
    {
	    imageNum_prostreet05_orange = randNum(0, totalImages_prostreet05_orange-1);
    }
    else if (imageNum_prostreet05_orange == 0)
    {
        imageNum_prostreet05_orange = totalImages_prostreet05_orange-1;
    }
    else 
    {
	    imageNum_prostreet05_orange = (imageNum_prostreet05_orange-1) % totalImages_prostreet05_orange;
    }   
    var new_image = get_ImageItemLocation(imageArray_prostreet05_orange[imageNum_prostreet05_orange]);
    return(new_image);
}

function prevImage_prostreet05_orange(place) 
{
    var new_image_prostreet05_orange = getPrevImage_prostreet05_orange();
    document[place].src = new_image_prostreet05_orange;
    var recur_call_prostreet05_orange = "switchImage('"+place+"')";
    timerID_prostreet05_orange = setTimeout(recur_call_prostreet05_orange, interval_prostreet05_orange);
}

function switchImage_prostreet05_orange(place) 
{
    var new_image_prostreet05_orange = getNextImage_prostreet05_orange();
    document[place].src = new_image_prostreet05_orange;
    var recur_call_prostreet05_orange = "switchImage('"+place+"')";
    timerID_prostreet05_orange = setTimeout(recur_call_prostreet05_orange, interval_prostreet05_orange);
}

//fatboy 2005
function getNextImage_fatboy2005() 
{
    if (random_display_fatboy2005) 
    {
	    imageNum_fatboy2005 = randNum(0, totalImages_fatboy2005-1);
    }
    else 
    {
	    imageNum_fatboy2005 = (imageNum_fatboy2005+1) % totalImages_fatboy2005;
    }
    var new_image_fatboy2005 = get_ImageItemLocation(imageArray_fatboy2005[imageNum_fatboy2005]);
    return(new_image_fatboy2005);
}


function getPrevImage_fatboy2005() 
{
    if (random_display_fatboy2005) 
    {
	    imageNum_fatboy2005 = randNum(0, totalImages_fatboy2005-1);
    }
    else if (imageNum_fatboy2005 == 0)
    {
        imageNum_fatboy2005 = totalImages_fatboy2005-1;
    }
    else 
    {
	    imageNum_fatboy2005 = (imageNum_fatboy2005-1) % totalImages_fatboy2005;
    }   
    var new_image = get_ImageItemLocation(imageArray_fatboy2005[imageNum_fatboy2005]);
    return(new_image);
}

function prevImage_fatboy2005(place) 
{
    var new_image_fatboy2005 = getPrevImage_fatboy2005();
    document[place].src = new_image_fatboy2005;
    var recur_call_fatboy2005 = "switchImage('"+place+"')";
    timerID_fatboy2005 = setTimeout(recur_call_fatboy2005, interval_fatboy2005);
}

function switchImage_fatboy2005(place) 
{
    var new_image_fatboy2005 = getNextImage_fatboy2005();
    document[place].src = new_image_fatboy2005;
    var recur_call_fatboy2005 = "switchImage('"+place+"')";
    timerID_fatboy2005 = setTimeout(recur_call_fatboy2005, interval_fatboy2005);
}