	var minZoom = 45;
	var maxZoom = 128;
	var zoomQty = 3;

	function dock(branch) {
		branch.lastChild.style.width = maxZoom +"px";
		branch.lastChild.style.height = maxZoom +"px";

		var p = branch;
		var n = branch;
			for(var k=1; k<zoomQty; k++) {
				var dockSize = minZoom+(minZoom/k);
					//style the previous icon
				if(p.style && p.previousSibling) {
					p = p.previousSibling;
					p.lastChild.style.width = dockSize +"px";
					p.lastChild.style.height = dockSize +"px";
					} else {
						p = "";
					}
					//style the next icon
				if(n.style && n.nextSibling) {
					n = n.nextSibling;
					n.lastChild.style.width = dockSize +"px";
					n.lastChild.style.height = dockSize +"px";
					} else {
						n = "";
					}
			}
		}


	function unzoominate(huh) {
			curZoom = huh.style.width.slice(0, -2);
			var zoomInt = (curZoom - minZoom)/2;
			while(curZoom > minZoom) {
					huh.style.width = curZoom - zoomInt + "px";
					huh.style.height = curZoom - zoomInt + "px";
					curZoom = huh.style.width.slice(0, -2);
					//alert(curZoom);
					for(cpu=0; cpu<10000; cpu++) ; //waste time and energy
					}
	}


	function dockreset(branch) {
		var ditems = branch.getElementsByTagName('img');
			for (var i = 0; i < ditems.length; i++) {
			//	unzoominate(ditems[i]);
				ditems[i].style.width = minZoom +"px";
				ditems[i].style.height = minZoom +"px";
				}
		}

	function hoverText(branch) {
			var s = document.createElement('span');
			s.setAttribute("class","desc");
			var t = document.createTextNode(branch.getAttribute('title'));
			s.appendChild(t);
			branch.insertBefore(s, branch.lastChild);
		}



//ensure that all onload events are executed
function addEvent(obj, evType, fn){
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, true);
		return true;
		} else if (obj.attachEvent){
			var r = obj.attachEvent('on'+evType, fn);
			return r;
			} else {
			return false;
			}
	}
//write up attachments
function prepEvents() {
	var di = document.getElementById('dock');
	if(!di) return;
	var dockItems = di.getElementsByTagName('a');
		for (var i=0; i<dockItems.length; i++) {
	 		dockItems[i].setAttribute("onmouseover", "dock(this)");
	 		//set images to min zoom
	 		dockItems[i].lastChild.style.width = minZoom + "px";	 		
	 		dockItems[i].lastChild.style.height = minZoom + "px";
	 		hoverText(dockItems[i]);
			}
 	di.setAttribute("onmouseout", "dockreset(this)");
	}
	
//load up the onload events
addEvent(window, 'load', prepEvents);

