names = new Array("about", "investment", "wellbeing", "asset", "relationships", "discussion");

count=0;
ready=0;
textlabel = "text";

function preLoad(){
if (document.images) {
imagepath = "/sl/images/";

	count = names.length;
	buttons = new Array(count*2);
	buttonsloaded = new Array(count*2);
	texts = new Array(count*2);
	textloaded = new Array(count*2);
	
	
	for (n = 0; n < count; n++) {
				buttons[n] = new Image;
				buttons[n + count] = new Image;
				texts[n] = new Image;
				texts[n+count] = new Image;
				offsrc = imagepath + "orange-off.gif";
				onsrc = imagepath + "orange.gif";
				textsrc = imagepath + names[n] + "-t" + ".gif";
				buttons[n].src = offsrc;
				buttons[n + count].src = onsrc;
				texts[n].src = "/sl/images/0.gif";
				texts[n + count].src = textsrc;
				buttons[n].onLoad = (buttonsloaded[n] = "true");
				buttons[n + count].onLoad = (buttonsloaded[n + count] = "true");
				texts[n].onLoad = (textloaded[n] = "true");
				texts[n + count].onLoad = (textloaded[n + count] = "true");
				}
	ready = 1;
}

}

function swap(ImgID) {
	if ((document.images) && (ready == 1)) {
		if (ImgID < count) {
			currentimg = names[ImgID];
		}
		else {
			currentimg = names[ImgID - count];
		}		
		((buttonsloaded[ImgID] == "true") && (textloaded[ImgID] == "true")) 
		{
			document.images[currentimg].src = buttons[ImgID].src;
			document.images[textlabel].src = texts[ImgID].src;
		}
	}
}







	



