//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.TLclickMenu = function() {	var getEls = document.getElementById("tl_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 tl_views list and when the link is activated calls the TLshowPic function.function prepare_TLGallery() {	if (!document.getElementsByTagName) return false;	if (!document.getElementById) return false;	if (!document.getElementById("tl_views")) return false;	var tl_views = document.getElementById("tl_views");	var links = tl_views.getElementsByTagName("a");	for ( var i=0; i < links.length; i++) {		links[i].onclick = function() {		return TLshowPic(this);		}	links[i].onkeypress = links[i].onclick; 	} }//Swaps out the tl_gallery image for an image in the linked from the tl_views list.function TLshowPic(TLwhichpic) {	if(!document.getElementById("tl_gallery")) return true;	var source = TLwhichpic.getAttribute("href");	var tl_gallery = document.getElementById("tl_gallery");	tl_gallery.setAttribute("src", source);	if (!document.getElementById("description")) return false;	if (TLwhichpic.getAttribute("title")) {		var text = TLwhichpic.getAttribute("title");	} else {		var text = "";	}	return false;}// Load functions when the page loads.addLoadEvent(prepare_TLGallery);addLoadEvent(TLclickMenu);