	// UPDATE MENU FUNCTION	
	function updateMiddleBox(icon) {
	aLeftIcons = new Array(7);
	aLeftIcons[0] = "mybooks";
	aLeftIcons[1] = "myquestions";
	aLeftIcons[2] = "myslides";
	aLeftIcons[3] = "recentpages";
	aLeftIcons[4] = "recentupdates";
		// update background colour to indicated selected menu item
	
		document.getElementById(icon).style.background="##DBF7DB";
		
		// grab data and populate content area
		xmlhttp.open("GET","/mylibrary/" + icon + ".cfm?hash" + Math.random(),true);
		xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
 		xmlhttp.onreadystatechange=function() {
  			if (xmlhttp.readyState==4) {
  				document.getElementById("MiddleContent").innerHTML = xmlhttp.responseText;
			}
 		}
		xmlhttp.send(null);
		
		// set cookie to remember where we are in the menu between page requests
		document.cookie = "LIBMENU=" + icon;
		
	}
	

//Get cookie routine by Shelley Powers 
function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}
