function newImgTrium(imgId, srcOff, srcHil, srcOn) {
    this.imgId = imgId;
    this.off = new Image();
    this.off.src = srcOff;
    this.hil = new Image();
    this.hil.src = srcHil;
    this.on = new Image();
    this.on.src = srcOn;
}

function newSelected() {
    this.idx = -1;
}

var imgList = new Array();

imgList[20] = new newImgTrium('dnimg0', 'img/idx-menu-hu-1.gif', 'img/idx-menu-hu-1-hil.gif', 'img/idx-menu-hu-1-on.gif');
imgList[21] = new newImgTrium('dnimg1', 'img/idx-menu-en-2.gif', 'img/idx-menu-en-2-hil.gif', 'img/idx-menu-en-2-on.gif');
imgList[22] = new newImgTrium('dnimg2', 'img/idx-menu-de-3.gif', 'img/idx-menu-de-3-hil.gif', 'img/idx-menu-de-3-on.gif');
imgList[23] = new newImgTrium('dnimg3', 'img/idx-menu-fr-4.gif', 'img/idx-menu-fr-4-hil.gif', 'img/idx-menu-fr-4-on.gif');
imgList[24] = new newImgTrium('dnimg4', 'img/idx-menu-sp-5.gif', 'img/idx-menu-sp-5-hil.gif', 'img/idx-menu-sp-5-on.gif');
imgList[25] = new newImgTrium('dnimg5', 'img/idx-menu-ru-6.gif', 'img/idx-menu-ru-6-hil.gif', 'img/idx-menu-ru-6-on.gif');
imgList[26] = new newImgTrium('dnimg6', 'img/idx-menu-cn-7.gif', 'img/idx-menu-cn-7-hil.gif', 'img/idx-menu-cn-7-on.gif');
imgList[27] = new newImgTrium('dnimg7', 'img/idx-menu-ar-8.gif', 'img/idx-menu-ar-8-hil.gif', 'img/idx-menu-ar-8-on.gif');

var selected0 = new newSelected();
var selected1 = new newSelected();
var selected2 = new newSelected();

function changeImage(imgName, newImg) {
    document.images[imgName].src = newImg.src;
}

function eventOver(idx, sel) {
    if(sel.idx == idx) return;
    changeImage(imgList[idx].imgId, imgList[idx].hil);
}

function eventOut(idx, sel) {
    if(sel.idx == idx) return;
    changeImage(imgList[idx].imgId, imgList[idx].off);
}

function eventClick(idx, sel) {
    if(sel.idx != -1) changeImage(imgList[sel.idx].imgId, imgList[sel.idx].off);
    sel.idx = idx;
    changeImage(imgList[idx].imgId, imgList[idx].on);
}


