// mouseovers ----------------------------------------------------

function lit( box, pic ){
	lnk = document.getElementById(pic);
	if( box.className == 'itemOFF' ){
		box.className = 'itemON';
		lnk.style.color = 'white';	
	} else {
		box.className = 'itemOFF';
		lnk.style.color = 'black';
	}
} // lit

//  random image ---------------------------------------------------
// NB: This function should be called early in the file or the images are not retrieved in time.
var imagesArray = new Array(); // images get stored here
for( var  i=0; i<4; i++ )imagesArray[i] = new Image();  // Src's will be added during the randImages() http_request (below)

function randImages(){
	if(document.getElementById('img0') == null) return;
	if (window.XMLHttpRequest) { // Mozilla, Safari, ...
		 http_request = new XMLHttpRequest();
	} else if (window.ActiveXObject) { // IE
		 http_request = new ActiveXObject("Microsoft.XMLHTTP");
	}
		//http_request.overrideMimeType('text/html');
			    http_request.onreadystatechange = function() {
			        if (http_request.readyState == 4) {
			            if (http_request.status == 200){
			              eval( unescape(http_request.responseText ));
			              for( i=0; i<4; i++ ){
			              		document.getElementById('img'+i).src = imagesArray[i].src;
			              } // for 4
			           } else{
			                target.submit();
			        }
	    			} //if
	    		}; //onreadystate	
//		http_request.open('GET', 'http://www.abdn.ac.uk/~com168/projects/Museum/site/includes/randPic.php', true);
		http_request.open('GET', 'http://www.abdn.ac.uk/~nph126/includes/randPic.php', true);
		http_request.send(null); //OR..  where you want to use POST instead
}// makeRequest

randImages();   // Get the images immediately.

function listCategory(txt,type){
	location.href = '?mode='+type+'&category='+txt;
}// listCategory

function doubleCat( mode,data ){
	location.href = '?mode='+mode+'&data='+data;
} //doubleCat

