/* ====================================================
Lightbox: remove extra image from lightbox array
==================================================== */

function lighboxswap() {  

if (!document.getElementsByTagName)
{
alert("element by name doesn't exist");
return;
}

var anchors = document.getElementsByTagName("a");  
if(document.getElementById("LBIMG") != null)
{

var sp = document.createElement("span");
sp.setAttribute("id", "lbzoom");
var eblight = document.getElementById("LBIMG");
eblight.appendChild(sp);

var lbimgatt = document.getElementById("mainlb").offsetWidth;

if(lbimgatt == "0")
{
	phwidth = "0";
}
else
{
	phwidth = 323;
}

var zoomwidth = phwidth-lbimgatt;

//document.getElementById("lbzoom").style.right = zoomwidth+"px";
document.getElementById("lbzoom").style.right = "25px";


	for (var i=0; i<anchors.length; i++) 
	{   
		var anchor = anchors[i];  

		thisREV = anchor.getAttribute("rev");
		thisHREF = anchor.getAttribute("href");

		mainHREF = document.getElementById("LBIMG").getAttribute("href");


		if(thisREV == "lbthumb" && mainHREF == thisHREF)
		{ 
			anchors.item(i).setAttribute("rel","nolb");
			return;  
		}

	} 
	
}

}  
lighboxswap();








