function ClosePopup() {
	HideSection('PopUpContainer');
	HideSection('PopupBackground');
}
function OpenPopup() {
	ShowSection('PopupBackground');
	ShowSection('PopUpContainer');
}

function HideSection(whichLayer) {
	if(whichLayer.length < 1) { return; }
	document.getElementById(whichLayer).style.display = "none";
}
function ShowSection(whichLayer) {
	if(whichLayer.length < 1) { return; }
	document.getElementById(whichLayer).style.display = "block";
}
function Toggle(whichLayer) {
	if(whichLayer.length < 1) { return; }
	document.getElementById(whichLayer).style.display = (document.getElementById(whichLayer).style.display == "none")?'block':'none';
}
function SetOpacity(opacity, whichLayer) {
	var object = document.getElementById(whichLayer).style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}
function Opacity(whichLayer, StartOpacity, EndOpacity, Milliseconds) {
	var speed = Math.round(Milliseconds / 100);
	var timer = 0;
	if(StartOpacity > EndOpacity) {
		for(i = StartOpacity; i >= EndOpacity; i--) {
			setTimeout("SetOpacity(" + i + ",'" + whichLayer + "')",(timer * speed));
			timer++;
		}
	} else if(StartOpacity < EndOpacity) {
		for(i = StartOpacity; i <= EndOpacity; i++) {
			setTimeout("SetOpacity(" + i + ",'" + whichLayer + "')",(timer * speed));
			timer++;
		}
	}
}

