function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		company_over = newImage("images/company-over.gif");
		approach_over = newImage("images/approach-over.gif");
		products_over = newImage("images/products-over.gif");
		services_over = newImage("images/services-over.gif");
		customers_over = newImage("images/customers-over.gif");
		contacts_over = newImage("images/contacts-over.gif");
		home_over = newImage("images/home-over.gif");
		preloadFlag = true;
	}
}
function trim(str) {
	var whitespace = new String(" \t\n\r");
	var s = new String(" " + str + " ");
	if (whitespace.indexOf(s.charAt(0)) != -1) {
		var j=0, i = s.length;
            while (j < i && whitespace.indexOf(s.charAt(j)) != -1) {
			j++;
		}
            s = s.substring(j, i);
	}

	if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
		var i = s.length - 1;       
            while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) {
			i--;
		}
            s = s.substring(0, i+1);
	}
	return s;
}
function win(URL, iwidth, iheight) { 
	atop = (screen.width-iwidth)/2;
	aleft = (screen.availHeight-iheight)/2
	atts = 'width=' + iwidth + ',height=' + iheight + ',top=' + atop + ',left=' + aleft + ',resizable=yes,scrollbars=yes';
	var win = window.open(URL,'win',atts);
	win.focus();
}
//Below is the code that pre-loads the graphics 
{

//These are the large images
alt0 = new Image();
alt0.src = "img/white.gif";

alt1 = new Image();
alt1.src = "img/case_open.gif";

alt2 = new Image();
alt2.src = "img/case_open.gif";

alt3 = new Image();
alt3.src = "img/case_open.gif";

alt4 = new Image();
alt4.src = "img/case_open.gif";

//These are the first button graphics

graphic1= new Image();
graphic1.src = "img/but1.gif";
graphic1on = new Image();
graphic1on.src = "img/but1b.gif";

//These are the second button graphics 

graphic2= new Image();
graphic2.src = "img/but2.gif";
graphic2on = new Image();
graphic2on.src = "img/but2b.gif";

graphic3= new Image();
graphic3.src = "img/but3.gif";
graphic3on = new Image();
graphic3on.src = "img/but3b.gif";

graphic4= new Image();
graphic4.src = "img/but4.gif";
graphic4on = new Image();
graphic4on.src = "img/but4b.gif";

//This is the function that calls for
//the change in the buttons 

}
function imageChange(imageID,imageName,imageID2,imageName2) { 

{
document.images[imageID].src = eval(imageName + ".src");
document.images[imageID2].src = eval(imageName2 + ".src");
}

}
