//Creates a queue of functions to be executed when the page loads using addLoadEvent(functionName);function addLoadEvent(func) {	var oldonload = window.onload;	if (typeof window.onload != 'function') {		window.onload = func;		} else {			window.onload = function() {				oldonload();				func();			}		}	}//Creates a "selected" class when the thumbnail is clicked.tleclickMenu = function() {	var getEls = document.getElementById("tle_views").getElementsByTagName("li");	var getAgn = getEls; 	for (var i=0; i<getEls.length; i++) {			getEls[i].onclick=function() {				for (var x=0; x<getAgn.length; x++) {				getAgn[x].className=getAgn[x].className.replace("selected", "");				}				this.className+=" selected";				}			}		}//Loops through all the links in the image tle_views list and when the link is activated calls the tleshowPic function.function prepare_tleGallery() {	if (!document.getElementsByTagName) return false;	if (!document.getElementById) return false;	if (!document.getElementById("tle_views")) return false;	var tle_views = document.getElementById("tle_views");	var links = tle_views.getElementsByTagName("a");	for ( var i=0; i < links.length; i++) {		links[i].onclick = function() {		return tleshowPic(this);		}	links[i].onkeypress = links[i].onclick; 	} }//Swaps out the tle_gallery image for an image in the linked from the tle_views list.function tleshowPic(tlewhichpic) {	if(!document.getElementById("tle_gallery")) return true;	var source = tlewhichpic.getAttribute("href");	var tle_gallery = document.getElementById("tle_gallery");	tle_gallery.setAttribute("src", source);	if (!document.getElementById("description")) return false;	if (tlewhichpic.getAttribute("title")) {		var text = tlewhichpic.getAttribute("title");	} else {		var text = "";	}	return false;}// Load functions when the page loads.addLoadEvent(prepare_tleGallery);addLoadEvent(tleclickMenu);