// Please note, this is "no loop" version!
// means i.e. aMenuImagesLeft.length=aMenuImagesRight.length=itemsCount-1! 

//TODO pre-loading "text images"

var aTextImgSrc = new Array("/jsp/clipart/history/text_1992.gif","/jsp/clipart/history/text_1993.gif","/jsp/clipart/history/text_1994.gif","/jsp/clipart/history/text_1997.gif","/jsp/clipart/history/text_1998.gif","/jsp/clipart/history/text_2000.gif","/jsp/clipart/history/text_2001.gif","/jsp/clipart/history/text_2002.gif","/jsp/clipart/history/text_2003.gif","/jsp/clipart/history/text_2004.gif","/jsp/clipart/history/text_2005.gif","/jsp/clipart/history/text_2006.gif","/jsp/clipart/history/text_2007.gif","/jsp/clipart/history/text_2008.gif","/jsp/clipart/history/text_2009.gif","/jsp/clipart/history/text_2010.gif","/jsp/clipart/history/text_2011.gif","/jsp/clipart/history/text_plans.gif");
var aTextImages = new Array();
//var currIdx = 0; important! must be set manually on all pages with new menu! and customized ie currIdx=1 for CRT
var itemsCount = 18;

var ARROW_LEFT_OFF = 0;
var ARROW_LEFT_OVER = 1;
var ARROW_RIGHT_OFF = 2;
var ARROW_RIGHT_OVER = 3;

// pre-loading images
var aMenuImagesRight = new Array("/jsp/clipart/history/1993.gif","/jsp/clipart/history/1994.gif","/jsp/clipart/history/1997.gif","/jsp/clipart/history/1998.gif","/jsp/clipart/history/2000.gif","/jsp/clipart/history/2001.gif","/jsp/clipart/history/2002.gif","/jsp/clipart/history/2003.gif","/jsp/clipart/history/2004.gif","/jsp/clipart/history/2005.gif","/jsp/clipart/history/2006.gif","/jsp/clipart/history/2007.gif","/jsp/clipart/history/2008.gif","/jsp/clipart/history/2009.gif","/jsp/clipart/history/2010.gif","/jsp/clipart/history/2011.gif","/jsp/clipart/history/nav_about_us.gif");
var aMenuImagesLeft = new Array("/jsp/clipart/history/1987.gif","/jsp/clipart/history/1993.gif","/jsp/clipart/history/1994.gif","/jsp/clipart/history/1997.gif","/jsp/clipart/history/1998.gif","/jsp/clipart/history/2000.gif","/jsp/clipart/history/2001.gif","/jsp/clipart/history/2002.gif","/jsp/clipart/history/2003.gif","/jsp/clipart/history/2004.gif","/jsp/clipart/history/2005.gif","/jsp/clipart/history/2006.gif","/jsp/clipart/history/2007.gif","/jsp/clipart/history/2008.gif","/jsp/clipart/history/2009.gif","/jsp/clipart/history/2010.gif","/jsp/clipart/history/2011.gif");
var aaImages = new Array();
aaImages[0] = new Array(); //left
aaImages[1] = new Array(); //center
var aImagesArrow = new Array();
aImagesArrow[0] = new Image();
aImagesArrow[0].src = '/jsp/clipart/history/arrow_L_off.gif';
aImagesArrow[1] = new Image();
aImagesArrow[1].src = '/jsp/clipart/history/arrow_L_over.gif';
aImagesArrow[2] = new Image();
aImagesArrow[2].src = '/jsp/clipart/history/arrow_R_off.gif';
aImagesArrow[3] = new Image();
aImagesArrow[3].src = '/jsp/clipart/history/arrow_R_over.gif';
 
for (i = 0; i < itemsCount-1; i++) {
    aaImages[0][i] = new Image();
    aaImages[1][i] = new Image();
    aaImages[0][i].src = aMenuImagesLeft[i];
    aaImages[1][i].src = aMenuImagesRight[i];
}

for (j = 0; j < itemsCount; j++) {
    aTextImages[j] = new Image();
    aTextImages[j].src = aTextImgSrc[j];
}

//pre-loading images - END

function arrowOnOff(imgId, imgIdx)
{
   document.getElementById(imgId).src = aImagesArrow[imgIdx].src;
}

function menuPrev()
{
    if (currIdx == 0) {
        return;
    }
    currIdx--;
    document.getElementById("idBanner").src = aaImages[0][currIdx].src;
    changeContent();
}

function menuNext()
{
    currIdx++;
    if (currIdx == itemsCount) {
        currIdx = itemsCount-1;
        return;
    }
    document.getElementById("idBanner").src = aaImages[1][currIdx-1].src;
    changeContent();
}

function changeContent()
{
    document.getElementById("text_img").src = aTextImages[currIdx].src;
}

