function setDimLights(){	if(document.getElementById && document.createTextNode)	{		var imagesdiv = document.getElementById("postimages");		if(imagesdiv)		{			var images = imagesdiv.getElementsByTagName("a");			for(var i=0; i < images.length; ++i)			{				//images[i].onclick = function(){dimTheLights(this.getAttribute("src")); return false;};				//images[i].onmouseover = function() {dimLightsHover(this);};				//images[i].onmouseout = function() {dimLightsOff();};			}		}	}}function dimTheLights(imageSrc, caption, imagewidth){	if(document.getElementById && document.createTextNode && imageSrc != "")	{		div = document.createElement("div");		div.setAttribute("class", "dimthelights");		image = document.createElement("img");		image.setAttribute("src", imageSrc);		if(caption != "")		{			captionpar = document.createElement("p");			captionpar.setAttribute("class", "dimthelightscaption");			widthval = "width: " + (imagewidth).toString() + "px;";			captionpar.setAttribute("style", widthval);			captionpar.appendChild(document.createTextNode(caption));		}		td = document.createElement("td");		td.setAttribute("width", "100%");		td.setAttribute("height", "100%");		td.setAttribute("align", "center");		td.setAttribute("valign", "middle");		td.appendChild(image);		if(caption != "")			td.appendChild(captionpar);		imgdiv = document.createElement("table");		imgdiv.setAttribute("class", "dimthelights");		imgdiv.setAttribute("width", "100%");		imgdiv.setAttribute("height", "100%");		imgdiv.appendChild(td);		document.getElementsByTagName("body")[0].appendChild(div);		document.getElementsByTagName("body")[0].appendChild(imgdiv);				div.onclick = function(){document.getElementsByTagName("body")[0].removeChild(div); document.getElementsByTagName("body")[0].removeChild(imgdiv);};		imgdiv.onclick = function(){document.getElementsByTagName("body")[0].removeChild(div); document.getElementsByTagName("body")[0].removeChild(imgdiv);};				return false;	}}function dimLightsHover(anchor){	if(document.getElementById && document.createTextNode)	{		span = document.createElement("span");		span.setAttribute("id", "dimlightsspan");		span.setValue = "Dim the lights";		anchor.appendChild(span);	}}function dimLightsOff(){	if(document.getElementById && document.createTextNode)	{		span = document.getElementById("dimlightsspan");		span.parentNode.removeChild(span);	}}window.onload = function(){	setDimLights();}