/*
 @author pwagner
 Creates photo click effects
 */
function photoclick() {
	var thisimage = this;
	var photonode = this.parentNode;
	if (photonode.style.position == "absolute"){
		var photoup = 1;
	}
	var caps = photonode.getElementsByTagName("p");
	var wrap = document.getElementById("photowrapper");
	picnodes = wrap.getElementsByTagName("div");
	for (var t=0; t<picnodes.length; t++){
		var picnode = picnodes[t];
		var pcaps = picnode.getElementsByTagName("p");
		var theimage = picnode.getElementsByTagName("img");
		picnode.style.width = "20em";
		picnode.style.padding = "0px";
		picnode.style.border = "none";
		if (theimage[0]){
			if (photonode.className=="mug"){
			theimage[0].style.width = "100px";
			theimage[0].style.minWidth = "100px";
			}
			else if (photonode.className=="photo"){
			theimage[0].style.width = "150px";
			theimage[0].style.minWidth = "150px";
			}
		}
		for (var z=0; z<pcaps.length; z++){
			pcaps[z].style.display = "none";
		}
		picnode.style.position = "";
		picnode.style.zIndex = "1"
		}

	if (photoup != 1){
		if (photonode.className=="mug"){
			photonode.style.left = "1";
			photonode.style.position = "absolute";
			photonode.style.width = "195px";
			photonode.style.padding = "7px";
			photonode.style.border = "1px solid";
			photonode.style.zIndex = "2"
			thisimage.style.width = "180px";
			thisimage.style.minWidth = "180px";
			for (var i=0; i<caps.length; i++){
			caps[i].style.display = "block";
			}
		}
		else if (photonode.className=="photo"){
			photonode.style.left = "1";
			photonode.style.position = "absolute";
			photonode.style.width = "450px";
			photonode.style.padding = "7px";
			photonode.style.border = "1px solid";
			photonode.style.zIndex = "2"
			thisimage.style.width = "435px";
			thisimage.style.minWidth = "435px";
			for (var i=0; i<caps.length; i++){
			caps[i].style.display = "block";
			}
			}
	}
	else{
		if (photonode.className=="mug"){
		photonode.style.width = "20em";
		photonode.style.padding = "0px";
		photonode.style.border = "none";
		thisimage.style.width = "100px";
		thisimage.style.minWidth = "100px";
		for (var i=0; i<caps.length; i++){
			caps[i].style.display = "none";
		}
		photonode.style.position = "";
		photonode.style.zIndex = "1"
		}
		else{
		photonode.style.width = "20em";
		photonode.style.padding = "0px";
		photonode.style.border = "none";
		thisimage.style.width = "150px";
		thisimage.style.minWidth = "150px";
		for (var i=0; i<caps.length; i++){
			caps[i].style.display = "none";
		}
		photonode.style.position = "";
		photonode.style.zIndex = "1"
		}
	}


}