function initLB()
	{
	d = document.createElement("div");
	d.id = "LB_overlay";
	document.body.appendChild(d);
	
	frame = document.createElement("div");
	frame.id = "LB_frame";

	lbhead = document.createElement("div");
	lbhead.className = "head";

		ht = document.createElement("span");
		lbhead.appendChild(ht);
		frame.appendChild(lbhead);

	body = document.createElement("div");
	body.className = "body";
		
	frame.appendChild(body);
		
	document.body.appendChild(frame);
	}


function showLB()
	{
	p = getPageSize();
	s = getPageScroll();
	ol = document.getElementById("LB_overlay");
	ol.style.display = "block";
	ol.style.height = p.pHeight+"px";
	ol.onclick = function()
		{
		window.onresize = "";
		document.getElementById("LB_overlay").style.display = "none";
		document.getElementById("LB_frame").style.display = "none";
		return false;
		};

	window.onresize = function()
		{
		p = getPageSize();
		document.getElementById("LB_overlay").style.height = p.pHeight+"px";
		document.getElementById("LB_overlay").style.width = p.pWidth+"px";
		};

	sendRequest("GET",this.getAttribute("href"),gotPage,false);
	return false;
	}
		
function gotPage(req)
	{
	fr = document.getElementById("LB_frame");
	fr.style.visibility = "hidden";

	lbhead = fr.childNodes[0].firstChild;
	head_txt = req.responseXML.getElementsByTagName('h1')[0].firstChild.data;
	lbhead.innerHTML = head_txt;
	lbhead.style.float = "left";

	body = fr.childNodes[1];
	body.innerHTML = req.responseText;
	body.style.float = "left";

	fr.style.display = "block";		
	fr.style.top = ((p.pHeight/2)-(parseInt(fr.offsetHeight)/2))+"px";
	fr.style.left = ((p.pWidth/2)-(parseInt(fr.offsetWidth)/2))+"px";
	fr.style.visibility = "visible";
	initForms();
	}

function lightBox()
	{
	initLB();
	var as = document.getElementsByTagName("A");
	for(var i = 0; i<as.length; i++)
		{
		if (as[i].getAttribute("rel") == "lightbox")
			{
			as[i].onclick = showLB;
			}
		}
	}