function Lightbox(title)
	{
	
	this.lightbox = document.createElement('div');
	this.lightbox.setAttribute('id', 'lightbox');
	
	var menubar = document.createElement('div');
	menubar.setAttribute('id', 'menubar');
	
	var titlebar = document.createElement('span');
	titlebar.innerHTML = title;
	titlebar.setAttribute('id', 'title');
	
	divClose  = "survey.lightboxClose();";
	
	var closebutton = document.createElement('span');
	closebutton.setAttribute('id', 'close');
	closebutton.setAttribute('onclick', divClose);
	
	menubar.appendChild(titlebar);
	menubar.appendChild(closebutton);
	
	this.lightbox.appendChild(menubar);
	
	this.content = document.createElement('div');
	this.content.setAttribute('id', 'lightboxContent');
    this.content.style.width = 'auto';
	
	this.lightbox.appendChild(this.content);
	}

Lightbox.prototype.display = function()
	{
	document.getElementById('content').appendChild(this.lightbox);
	blackout = document.createElement('div');
	blackout.setAttribute('id', 'blackout');
	document.getElementById('content').appendChild(blackout);
	}

Lightbox.prototype.lightboxClose = function()
	{
	document.getElementById('content').removeChild(this.lightbox);
	document.getElementById('blackout').parentNode.removeChild(document.getElementById('blackout'));
	}

function lightboxClose(element)
	{
	element.parentNode.parentNode.parentNode.removeChild(element.parentNode.parentNode);
	document.getElementById('blackout').parentNode.removeChild(document.getElementById('blackout'));
	}

Lightbox.prototype.setContent = function(newContent)
	{
	this.content.innerHTML = newContent;
	}
