
function ButtonSwap(ButtonName,Position) {
	if (Position == "Flat") {
		eval (ButtonName + ".src = 'http://www.knowgeeks.net/images/" + ButtonName + ".jpg'");
	}
	if (Position == "Down") {
		eval (ButtonName + ".src = 'http://www.knowgeeks.net/images/" + ButtonName + "r.jpg'");
	}
}

function moveFooter(bool) {
	if (bool == true) {
		// Resize the left bar if it exists
		var left3Top = (stripPX(left1a.style.height)-0)+(left2b.offsetHeight-0);

		left3a.style.height = stripPX(left3b.style.height)+"px";
		left3a.style.top = left3Top+"px";

		left3b.style.top = left3Top+"px";
		left3c.style.height = stripPX(left3b.style.height)+"px";
		left3c.style.top = left3Top+"px";

		img1.style.height = left2b.offsetHeight;
		img2.style.height = left2b.offsetHeight;
	
	// Position Main Bar
	
		if (main2b.offsetHeight > left3Top) {
			// Make it bigger
			var main3Top = (stripPX(main1a.style.height)-0)+(main2b.offsetHeight-0);
			main3a.style.height = stripPX(main3b.style.height)+"px";
			main3a.style.top = main3Top+"px";
			
			main3b.style.top = main3Top+"px";
			main3c.style.height = stripPX(main3b.style.height)+"px";
			main3c.style.top = main3Top+"px";
			
			img3.style.height = main2b.offsetHeight;
			img4.style.height = main2b.offsetHeight;
		} else {
			// Use existing values
			main3a.style.height = stripPX(left3b.style.height)+"px";
			main3a.style.top = left3Top+"px";
			
			main2b.style.height = left2b.offsetHeight+"px";
			main3b.style.top = left3Top+"px";
			main3c.style.height = stripPX(left3b.style.height)+"px";
			main3c.style.top = left3Top+"px";

			img3.style.height = left2b.offsetHeight;
			img4.style.height = left2b.offsetHeight;
		}	

	}

	// Position Bottom of Link Bar
	var calHeight = document.getElementById('main1b').offsetHeight + document.getElementById('main2b').offsetHeight + document.getElementById('main3b').offsetHeight;
	//footer.style.top = calHeight + main_header.offsetTop + 5;
}

function stripPX(val2chk) {
	var a = val2chk.split("");
	var b = "";
	for (var i in a) {
		if (a[i].match(/\d/)) {
			b += a[i];
		}
	}
	while (b.length>1 && b.charAt(0) == "0") b=b.substr(1,b.length);

	return b;
}

