function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

/* You can get more specific with version information by using 
	parseInt(navigator.appVersion)
	Which will extract an integer value containing the version 
	of the browser being used.
*/

var http = createRequestObject(); 

/* Function called to get the text */
function getText(pageID,thisText){
	/* Create the request. The first argument to the open function is the method (POST/GET), and the second argument is the url... */
	http.open('get', 'includes/php/header_text.inc.php?action=getText&id=' + thisText + '&pageID=' + pageID);
	http.onreadystatechange = handleText; 
	http.send(null);
}

/* Function called to handle the list that was returned from the getPageText.inc.php file.. */
function handleText(){
	if(http.readyState == 4){
		var response = http.responseText;
		document.getElementById('header_text').innerHTML = response;
	}
}

var aryImages = new Array(4);

aryImages[0] = "images/about.jpg";
aryImages[1] = "images/about1.jpg";
aryImages[2] = "images/about2.jpg";
aryImages[3] = "images/about3.jpg";

for (i=0; i < aryImages.length; i++) {
    var preload = new Image();
    preload.src = aryImages[i];
}

function swap(imgIndex) {
    document.getElementById('imgMain').src = aryImages[imgIndex];
}