function closePopup(){
	document.getElementById("popupContainer").style.display = "none";
}


//This function accepts a message, a width, an xRatio (horizontal position: 2=half, 3=one third, etc.), yRatio (vertical position), & whether the vertical is from the top or the bottom of the page.
function displayPopupMessage(title,message,messageBoxWidth,xRatio,yRatio,topOrBottom) {
	
	if (xRatio == null) xRatio=1;
	if (yRatio == null) yRatio=1;
	
//	document.body.style.cursor = 'wait';

	var newDiv = document.createElement('div');
	var newSpan = document.createElement('span');
	newDiv.appendChild(newSpan);
	var newH1 = document.createElement('h1');
	var newH1Text = document.createTextNode(title);
	newH1.appendChild(newH1Text);
	var newInnerSpan = document.createElement('span');
	newInnerSpan.innerHTML = message;
	newSpan.appendChild(newH1);
	newH1.innerHTML = "<img src='/eng/images/exclamation.gif' style='left:0.8em;position:absolute;top:0.42em;' /> " + newH1.innerHTML + "<a id='closePopup' href='javascript:closePopup();'><img src='/eng/images/close.gif' border='0' style='height:20px;width:20px;' /></a>";
	newSpan.appendChild(newInnerSpan);
	document.body.appendChild(newDiv);

	newDiv.setAttribute('id','popupContainer');
	newDiv.style.background = "url(/eng/images/semitranstan.gif) repeat";
	newDiv.style.display = "block";
	newDiv.style.fontSize = "20px";
	newDiv.style.fontFamily = "'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'Bitstream Vera Sans', Verdana, Helvetica, Arial, sans-serif";
	newDiv.style.height = document.body.scrollHeight + "px";
	newDiv.style.left = "0";
	newDiv.style.position = "absolute";
	newDiv.style.top = "0";
	newDiv.style.width = "102%";

	newSpan.setAttribute('id','popup');
	newSpan.style.display = "block";
	newSpan.style.fontSize = "66%";
	newSpan.style.position = "absolute";
	newSpan.style.width = ""+messageBoxWidth+"px";
	
	newSpan.style.backgroundColor = "#fefee1";
	newSpan.style.borderTop = "3px solid #cccccc";
	newSpan.style.borderRight = "3px solid #000000";
	newSpan.style.borderBottom = "3px solid #000000";
	newSpan.style.borderLeft = "3px solid #cccccc";
	newSpan.style.padding = "0";
	newSpan.style.position = "relative";
	
	newH1.style.backgroundColor = "#465A82";
	newH1.style.color = "#fff";
	newH1.style.fontSize = "1.3em";
	newH1.style.margin = "0";
	newH1.style.padding = "0.4em 1em 0.4em 2.8em";

	closePopupLink = document.getElementById("closePopup");
	closePopupLink.style.position = "absolute";
	closePopupLink.style.right = "0.3em";
	closePopupLink.style.top = "0.5em";

	newInnerSpan.style.display = "block";
	newInnerSpan.style.fontSize = "1.1em";
	newInnerSpan.style.padding = "0em 1em 0.4em 1em";

	if (self.innerWidth)
	{
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}
	else return;

	newSpan.style.left = ""+((frameWidth-messageBoxWidth)/xRatio)+"px";
	
	var verticalDistance = ""+(((frameHeight-newSpan.clientHeight)/yRatio))+"px";
	
	topOrBottom = topOrBottom.toLowerCase();
	
	if (topOrBottom == "top") {
		newSpan.style.top = verticalDistance;
	}

	if (topOrBottom == "bottom") {
		newSpan.style.bottom = verticalDistance;
	}

}

function setCookieVariable(varName, varValue){
//	alert("/eng/includes/setcookievariable.asp?varName=" + varName + "&varValue=" + varValue);
	document.getElementById("setSessionIFrame").src = "/eng/includes/setcookievariable.asp?varName=" + varName + "&varValue=" + varValue;
}
