// Preloader and rollover script.
// Written on the 12 September 2000 by Richard Marr
// Copyright (C) 2000 On Board Info ltd.
//
// HACKLIST:
// *********
// 1. Contains hard-coded paths


// Get browser version;
iAppVersion = parseInt(navigator.appVersion);


// ICON PRELOADER
// If supported, load specified icon into cache.
// It will load the default,current and highlighted versions of each image specified.
function iconLoad(){
	if (iAppVersion > 2){
	    var iconArray = iconLoad.arguments;
	    for ( i=0 ; i < iconArray.length ; i=i+3 ){
			var j = i;
			iconArray[j] = new Image();
			iconArray[j].src = '/images/icons/' + iconArray[i] + '.gif';
			j++;
			iconArray[j] = new Image();
			iconArray[j].src = '/images/icons/' + iconArray[i] + '_current.gif';
			j++;
			iconArray[j] = new Image();
			iconArray[j].src = '/images/icons/' + iconArray[i] + '_hi.gif';
			j=0;
	    }
	    i=0;
	}
	return;
}


// IMAGE PRELOADER
// This is a more generic version of the above, requiring each seperate image to be 
// specified along with it's directory from the root of /images
function imgLoad(){
	if (iAppVersion > 2){
	    var imgArray = imgLoad.arguments;
	    for ( i=0 ; i < imgArray.length ; i++ ){
			imgArray[i] = new Image();
			imgArray[i].src = '/images/' + imgArray[i] + '.gif';
	    }
	    i=0
	}
	return;
}

function iconOver(target,imageName) {
	if (iAppVersion > 2){
		if(document.all != null){					//ie version
			allImgs = target.all.tags("img");
			for (i=0; i<(allImgs.length); i++){
				if (allImgs[i].src.search('icons') != -1){ 
					allImgs[i].src = '/images/icons/'+imageName+'_hi.gif';
				}
 			}
 		}
 		else{					//ns version
 			return;
 		}
	}
}

function iconOut(target,imageName) {
	if (iAppVersion > 2){
		if(document.all != null){					//ie version
			allImgs = target.all.tags("img");
			for (i=0; i<(allImgs.length); i++){
				if (allImgs[i].src.search('icons') != -1){ 
					allImgs[i].src = '/images/icons/'+imageName+'.gif';
				}
 			}
 		}
 		else{					//ns version
 			return;
 		}
	}
}

function tabOver(img) {
	if (iAppVersion > 2){
 		document.images[img].src = "/images/tabbar/"+img+"_hi.gif";
	}
}
function tabOut(img) {
	if (iAppVersion > 2){
		document.images[img].src = "/images/tabbar/"+img+".gif";
	}
};