var imageDir;
var imageDirMain = "/images/";
var imageNames = new Array("home/hb_aboutpb", "home/hb_products", "home/hb_whatsnew", "home/hb_offerings", "b_aboutpb", "aboutpbase/sb_ourprofile", "aboutpbase/sb_ourservices", "aboutpbase/sb_video", "aboutpbase/sb_regionalcov", "aboutpbase/sb_vtour", "b_products","products/sb_colocation", "products/sb_networkser", "products/sb_managedser", "products/sb_customized", "products/sb_pbengines",
"b_whatsnew", "whatsnew/sb_pressrel", "whatsnew/sb_eventsup", "b_offerings","offerings/sb_stdofferings", "offerings/sb_promotion", "offerings/sb_freetrial", "offerings/sb_ipass",
"b_sitemap","b_legalstate","b_contact","home/b_customerlog", "arrowl01", "arrowl02", "arrowr01", "arrowr02", "b_close")

//define new arrays
var onImg = new Array();
var offImg = new Array();

//this is to trace the exact pathname for the image
//return imageDir and refName
for (var i = 0; i < imageNames.length; i++) {
	if (imageNames[i].indexOf('/')) {
		imageDir = imageDirMain+imageNames[i].substr(0,(imageNames[i].indexOf('/')+1));
		refName = imageNames[i].substr(imageNames[i].indexOf('/')+1);
	} else {
		imageDir=imageDirMain;
		refName = imageNames[i];
	}

//this handles particularly for the arrow buttons(image appears twice) use name attribute to differentiate these images 
	if (refName.substr(0,5)=='arrow') {
		imgName = imageDir + refName.substr(0,refName.length-2) + ".gif";
		imgHLName = imageDir +refName.substr(0,refName.length-2) + "_r.gif";
	} else {
		imgName = imageDir + refName + ".gif";
		imgHLName = imageDir + refName + "_r.gif";
	}
//define new images
	onImg[refName] = new Image();
	offImg[refName] = new Image();
	onImg[refName].src = imgHLName;
	offImg[refName].src = imgName;
}

// image swaper
function on(imgName) {if (initialised) {document[imgName].src = onImg[imgName].src}}
function off(imgName) {if (initialised) {document[imgName].src = offImg[imgName].src}}