/*********************************************************
Filename		: 	menu.js 
Purpose			: 	Contains functions that are used to make
					the mouseover & mouseout effect on the
					topmenu 
Created			: 	18-SEP-2003
Created by		: 	Uffe Iversen, UIVE

Change log:
Version		Date			Author	Comments

Notes:
***********************************************************/

function setActiveTop() {
	if (pageActiveTop == 0)
		pageActiveTop = -1;

	if (pageActiveTop || pageActiveTop >= 0) {
		if (document.images['tm' + (pageActiveTop-1)])
			document.images['tm' + (pageActiveTop-1)].src = imgOver.src;
		if (document.images['tm' + pageActiveTop])
			document.images['tm' + pageActiveTop].src = imgOver.src;
	}
}

function topMenuOver(thisObj, totalObj) {
	if (pageActiveTop != thisObj) {
		if (thisObj == totalObj)
			document.images['tm' + (thisObj-1)].src = imgOver.src;
		else {
			if (thisObj != (pageActiveTop - 1))
				document.images['tm' + thisObj].src = imgOver.src;
			if (thisObj != (pageActiveTop + 1))
				document.images['tm' + (thisObj-1)].src = imgOver.src;
		}
	}
}

function topMenuOut(thisObj, totalObj) {
	var objImg;
	if (pageActiveTop != thisObj) {
		if (thisObj == totalObj) {
			if ((pageActiveTop + 1) < thisObj) {
				objImg	=	getId('tm' + (thisObj-1));
				objImg.src = imgOut.src;
				objImg.height 	= 29;
				objImg.width 	= 24;
				//document.images['tm' + (thisObj-1)].src = imgOut.src;
			}
		}
		else {
			if (thisObj != (pageActiveTop - 1)) {
				objImg	=	getId('tm' + thisObj);
				objImg.src = imgOut.src;
				objImg.height 	= 29;
				objImg.width 	= 24;
			}
				//document.images['tm' + thisObj].src = imgOut.src;
				//getId('tm' + thisObj).src = imgOut.src;
			if (thisObj != (pageActiveTop + 1)) {
				objImg	=	getId('tm' + (thisObj-1));
				objImg.src = imgOut.src;
				objImg.height 	= 29;
				objImg.width 	= 24;
				//document.images['tm' + (thisObj-1)].src = imgOut.src;
				//getId('tm' + (thisObj-1)).src = imgOut.src;
			}
		}
		
	}
}

function getId(element) { // return object reference
	//if (document.all) return document.all[element];
	//else return document.getElementById(element);
	if (document.getElementById) {
		return document.getElementById(element);
    }
	else{
        if (document.layers) {
			return document.images[element];
        }
		else{
            if (document.all){
				return document.all[element];
            }
        }
    }
}
