function onLoad() {
	//Break out of the function if there are no stylesheets
	if (document.styleSheets.length == 0) return;

	//Place text in text-shadow/text-highlight from text
	var xulHeaderText = document.getElementById("header-text");	
	var xulHeaderTextHighlight = document.getElementById("header-text-highlight");
	var xulHeaderTextShadow = document.getElementById("header-text-shadow");	
	if (xulHeaderText) {
		xulHeaderTextHighlight.innerHTML = xulHeaderText.innerHTML;
		xulHeaderTextShadow.innerHTML = xulHeaderText.innerHTML;
	}



	//Make the columns the same height
	var xulLinks = document.getElementById("links");	
	var xulWords = document.getElementById("words");	
	if (xulLinks && xulWords) {
		var linksStyle = document.defaultView.getComputedStyle(xulLinks, "");
		var wordsStyle = document.defaultView.getComputedStyle(xulWords, "");
		var linksHeight = parseInt(linksStyle.height);
		var wordsHeight = parseInt(wordsStyle.height);
		if (linksHeight > wordsHeight) {
			xulWords.style.minHeight = linksHeight + "px";
			xulLinks.style.minHeight = linksHeight + "px";
		}
		else if (linksHeight < wordsHeight) {
			xulLinks.style.minHeight = wordsHeight + "px";
			xulWords.style.minHeight = wordsHeight + "px";
		}
	}

	//Set the onclick method of the images
	var images = document.getElementsByTagName("IMG");
	for (var i = 0; i < images.length; i++) {
		if (images[i].getAttribute("class") == "screenshot")
			images[i].addEventListener('click', showScreenshot, true);
	}
}

function showScreenshot(event) {
	var source = this.getAttribute("src");
	var previewbox = document.getElementById("previewbox");
	var preview = document.getElementById("preview");
	if (preview) {
		if (preview.getAttribute("src") != source) {
			preview.setAttribute("src", source);
		}
	}
	else {
		var preview = document.createElement("img");
		preview.setAttribute("id", "preview");
		preview.addEventListener("click", hideScreenshot, false);
		preview.setAttribute("src", source);
		previewbox.appendChild(preview);
		previewbox.style.display = "inline";
	}
}

function hideScreenshot() {
	this.removeEventListener("click", hideScreenshot, false);

	var previewbox = document.getElementById("previewbox");
	var preview = document.getElementById("preview");
	
	previewbox.removeChild(preview);
	previewbox.style.display = "none";
	
}


