var GalleryText = new Array();
GalleryText[0]="Item 1";
GalleryText[1]="Item 2";
GalleryText[2]="Item 3";
GalleryText[3]="Item 4";
GalleryText[4]="Item 5";
GalleryText[5]="Item 6";
GalleryText[6]="Item 7";
GalleryText[7]="Item 8";

var TwillText = new Array();
TwillText[0] = "navy";
TwillText[1] = "gold";
TwillText[2] = "red";
TwillText[3] = "sky blue";
TwillText[4] = "shamrock green";
TwillText[5] = "";
TwillText[6] = "";
TwillText[7] = "";
TwillText[8] = "";
TwillText[9] = "";
TwillText[10] = "";
TwillText[11] = "";
TwillText[12] = "";
TwillText[13] = "";
TwillText[14] = "";
TwillText[15] = "";
TwillText[16] = "";
TwillText[17] = "";
TwillText[18] = "";
TwillText[19] = "";
TwillText[20] = "";

function DoSwap(TheImage,TextIndex){
	document.images["detailimage"].src = "media/"+TheImage+".jpg";
	document.getElementById("ImageDetails").innerHTML = GalleryText[TextIndex];
}

function DoTwill(TwillIndex){
	document.images["TwillDetail"].src = "media/twill"+TwillIndex+".jpg";
	document.getElementById("TwillName").innerHTML = TwillText[TwillIndex];
}

function DoFont(FontName,FontText){
	 document.images["FontDetail"].src = "media/embfonts/"+FontName+".jpg";
	 document.getElementById("FontName").innerHTML = FontText;
}

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('container').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}
window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}
