<!--
//Requires mootools.js
/********Main Objects********/

/****Popup Manager****/
function PopupDivsMan()
{
	/**Manager Variables**/
	this.NumPopups = 0;
	this.BorderOffset = 12;
	this.NewPopupOffset = 20;
	this.RoundedWinOffset = 0;
	this.baseColors = {
		title: '#0077a2',
		content: '#f36523',
		footer: '#f36523'
	};
	this.colors = {
		title: {
			border: '#000044',
			dark: '#4444ff',
			hilite: '#8888ff',
			body: '#000066',
			font: '#ffffff'
		},
		content: {
			border: '#888888',
			dark: '#dddddd',
			hilite: '#eeeeee',
			body: '#bbbbbb',
			font: '#000000'
		},
		footer: {
			border: '#888888',
			dark: '#dddddd',
			hilite: '#bbbbbb',
			body: '#bbbbbb',
			font: '#000000'
		}
	};

	/**Window Types**/
	this.GetNormal = GetNormalFunction;
	this.GetRounded = GetRoundedFunction;

	/**Manager Functions**/
	this.CreatePopup = CreatePopupFunction;
	this.ClosePopup = ClosePopupFunction;
	this.PopBack = PopBackFunction;
	this.ToTop = ToTopFunction;

	/** Palette Functions**/
	this.AutoSetColors = AutoSetColorsFunction;
	this.AutoSetColor = AutoSetColorFunction;
	this.SetColors = SetColorsFunction;
	this.GetMedianColorValue = GetMedianColorValueFunction;

	this.HexToInt = HexToIntFunction;
	this.IntToHex = IntToHexFunction;

	/**Manager Objects**/
	this.PopupDivList = Array();
};

/****Popup Window****/
function PopupWindow(iNewId)
{
	/**Popup Variables**/
	this.options = {
		mins: {x: 200, y: 20}, //Minimum shrink size
		size: {x: 150, y: 100}, //Size
		maxs: {x: 1600, y: 1200}, //Maximum grow size
		resizable: true,
		movable: true,
		footer: true,
		dragContainer: Class.empty,
		loc:  {x: 0, y: 0},
		unit: 'px',
		contentType: 'normal', //normal, ajax or iframe
		title: '&nbsp;',
		source: '&nbsp;',
		statusText: '&nbsp;',
		onAjaxComplete: Class.empty,
		type: 'normal' //'rounded'
	};

	this.PopupId = iNewId;
	this.Div = document.createElement("div");

	/**Popup Functions**/
	this.LoadMe = LoadMeFunction;
	this.CloseMe = CloseMeFunction;

	/**Popup Objects**/
};

/********Popup Manager Functions********/

/**** ****/
function CreatePopupFunction(NewOptions)
{
	var PopupObj;
	var sPopupSrc = "";
	var iOffset = 0;

	if (navigator.appName == "Microsoft Internet Explorer") {
		this.BorderOffset = 0;
		this.RoundedWinOffset = -10;
	}

	this.PopupDivList[this.NumPopups] = new PopupWindow(this.NumPopups);

	//PopupObj = $(this.PopupDivList[this.NumPopups]);

	with (this.PopupDivList[this.NumPopups]) {
		//Load options
		$extend(options, NewOptions);

		iOffset = (PopupId % 6) * this.NewPopupOffset;

		with (options) {
			Div.id = "PopupDiv_"+PopupId;
			Div.className = "AllEdge";
			$(Div).setStyle('width', (size.x + this.BorderOffset)+unit);
			$(Div).setStyle('height', (size.y + this.BorderOffset)+unit);
			$(Div).setStyle('position', 'Absolute');
			$(Div).setStyle('left', (loc.x + iOffset)+unit);
			$(Div).setStyle('top', (loc.y + iOffset)+unit);
		}

		if (options.type == 'rounded') {
			sPopupSrc += this.GetRounded(PopupId, options, this.colors);
			Div.className = "";
		}
		else {
			sPopupSrc += this.GetNormal(PopupId, options, this.colors);
		}

		Div.innerHTML = sPopupSrc;

		document.body.appendChild(Div);

		//Load content the way specified
		if (options.contentType == "normal") {
			$('Content_'+PopupId).setHTML(options.source);
		}
		else {
			//Add in popup id
			if (options.source.indexOf("?") > 0) {
				options.source += "&popup="+this.NumPopups;
			}
			else {
				options.source += "?popup="+this.NumPopups;
			}

			if (options.contentType == "ajax") {
				var Source = options.source;
				new Ajax(Source, {
					method: 'get',
					update: $('Content_'+PopupId),
					onComplete: function() { IsDone(PopupId); }
				}).request();
			}
			else if (options.contentType == "iframe") {
				var sFrame = "<iframe id=\"ContentFrame_" + PopupId + "\" width=\""+(options.size.x - 4)+"\" height=\""+(options.size.y - 4)+"\"></iframe>";
				$('Content_'+PopupId).setHTML(sFrame);
				document.getElementById("ContentFrame_"+PopupId).src = options.source;
			}
		}

		if (options.movable) {
			new Drag.Move('PopupDiv_'+PopupId, {
				'handle': 'TitlePart_'+PopupId,
				onStart: function() {
					PopupManager.ToTop("PopupDiv_"+PopupId);
				},
				container: options.dragContainer
			});
			$('TitlePart_'+PopupId).setStyle('cursor', 'move');
		}
		else {
			$('TitlePart_'+PopupId).setStyle('cursor', 'auto');
		}

		if (options.footer) {
			if (options.resizable) {
				$('WinResize_'+PopupId).setStyle('cursor', 'nw-resize');
				if (options.type == 'rounded') {
					with (options) {
						$('Content_'+PopupId).makeResizable({
							limit: {x: [mins.x, maxs.x], y: [mins.y, maxs.y]},
							'handle': 'WinResize_'+PopupId
						});
						$('PopupDiv_'+PopupId).makeResizable({
							limit: {x: [(mins.x - this.RoundedWinOffset), (maxs.x - this.RoundedWinOffset)], y: [(mins.y + this.BorderOffset), (maxs.y + this.BorderOffset)]},
							'handle': 'WinResize_'+PopupId
						});
					}
				}
				else {
					with (options) {
						$('Content_'+PopupId).makeResizable({
							limit: {x: [mins.x, maxs.x], y: [mins.y, maxs.y]},
							'handle': 'WinResize_'+PopupId
						});
						$('PopupDiv_'+PopupId).makeResizable({
							limit: {x: [(mins.x + this.BorderOffset), (maxs.x + this.BorderOffset)], y: [(mins.y + this.BorderOffset), (maxs.y + this.BorderOffset)]},
							'handle': 'WinResize_'+PopupId
						});
					}
				}
			}
			else {
				$('WinResize_'+PopupId).setStyle('cursor', 'auto');
				$('WinResize_'+PopupId).setStyle('border', '0px none transparent');
				$('WinResize_'+PopupId).setHTML('&nbsp;');
			}
		}
		else {
			$('WinFooter_'+PopupId).setStyle('display', 'none');
		}
		
		this.ToTop(Div.id);
	}

	return this.NumPopups++;
};

function HexToIntFunction(sHex)
{
	var iVal = 0;
	var sValues = "0123456789abcdef";

	if (sHex.length == 2) {
		iVal = (sValues.indexOf(sHex.substr(0,1)) * 16);
		iVal += sValues.indexOf(sHex.substr(1));
	}

	return iVal;
};

function IntToHexFunction(iInt)
{
	var iVal = 0;
	var sVal = "";
	var sValues = "0123456789abcdef";

	iVal = (iInt - (iInt % 16)) /16;
	sVal = "" + sValues.substr(iVal, 1) + "";
	iVal = (iInt % 16);
	sVal += "" + sValues.substr(iVal, 1) + "";

	return sVal;
};

function AutoSetColorFunction(part, sColor)
{
	var iColor = 0;

	part.body = sColor;
	part.border = "#";
	part.dark = "#";
	part.hilite = "#";

	for (var i = 1; i < 7; i += 2) {
		iColor = this.HexToInt(sColor.substr(i, 2));

		//Border: Darkest
		if ((iColor - 80) < 0) {
			part.border += this.IntToHex(0);
		}
		else {
			part.border += this.IntToHex((iColor - 80));
		}

		//Dark: Darker
		if ((iColor - 40) < 0) {
			part.dark += this.IntToHex(0);
		}
		else {
			part.dark += this.IntToHex((iColor - 40));
		}

		//Hilite: Brightest
		if ((iColor + 40) > 255) {
			part.hilite += this.IntToHex(255);
		}
		else {
			part.hilite += this.IntToHex((iColor + 40));
		}
	}
	
	//Font: White or Black
	if (this.GetMedianColorValue(part.body) > 96) {
		part.font = '#000000';
	}
	else {
		part.font = '#ffffff';
	}

	return part;
};

function GetMedianColorValueFunction(sColor)
{
	var iValue = 0;

	for (var i = 1; i < 7; i += 2) {
		iValue += this.HexToInt(sColor.substr(i, (i+2)));
	}

	iValue = (iValue - (iValue % 3)) / 3;
	return iValue;
}

function AutoSetColorsFunction(NewColors)
{
	$extend(this.baseColors, NewColors);

	if (this.baseColors.title != this.colors.title.body) {
		this.colors.title = this.AutoSetColor(this.colors.title, this.baseColors.title);
		
	}
	if (this.baseColors.content != this.colors.content.body) {
		this.colors.content = this.AutoSetColor(this.colors.content, this.baseColors.content);
	}
	if (this.baseColors.footer != this.colors.footer.body) {
		this.colors.footer = this.AutoSetColor(this.colors.footer, this.baseColors.footer);
	}
};

function SetColorsFunction(NewColors)
{
	$extend(this.colors, NewColors);
};

function GetNormalFunction(FrameId, options, colors)
{
	var sFrame = "";

	sFrame = "<div id=\"OutBorder\" style=\"border-width:1px;border-style:solid;border-color:"+colors.content.hilite+" "+colors.content.dark+" "+colors.content.border+" "+colors.content.border+";padding:2px;background-color:"+colors.content.body+";border-collapse:collapse;\">";
		sFrame += "<div id=\"PopWinInside_"+FrameId+"\">";
			sFrame += "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" height=\"100%\">";
				sFrame += "<tr>";
					sFrame += "<td width=\"98%\"><div id=\"TitlePart_"+FrameId+"\" style=\"font-weight:bold;font-size:12pt;color:"+colors.title.font+";background-color:"+colors.title.body+";height:20px;margin: 0px 0px 2px;border-width:1px;border-style:solid;border-color:"+colors.title.hilite+" "+colors.title.dark+" "+colors.title.border+" "+colors.title.border+";border-collapse:collapse;\">"+options.title+"</div></td>";
					sFrame += "<td width=\"20\"><div id=\"CloseButton\" style=\"font-weight:bold;font-size:12pt;color:"+colors.content.font+";text-align:center;vertical-align:middle;background-color:"+colors.content.body+";height:20px;width:20px;margin: 0px 0px 2px;padding:2px;cursor:pointer;border-width:1px;border-style:solid;border-color:"+colors.content.hilite+" "+colors.content.dark+" "+colors.content.border+" "+colors.content.border+";border-collapse:collapse;\" OnClick=\"PopupManager.ClosePopup("+FrameId+");\">X</div></td>";
				sFrame += "</tr>";
				sFrame += "<tr>";
					sFrame += "<td colspan=\"2\" style=\"border-width:1px;border-style:solid;border-color:"+colors.content.border+" "+colors.content.border+" "+colors.content.hilite+" "+colors.content.dark+";border-collapse:collapse;\" OnClick=\"PopupManager.ToTop('PopupDiv_"+FrameId+"');\" align=\"left\" valign=\"top\">";
						sFrame += "<div id=\"Content_"+FrameId+"\" style=\"border: 1px solid black;background:"+colors.content.body+";overflow:auto;border-collapse:collapse;width:"+options.size.x+options.unit+";height:"+options.size.y+options.unit+";\">";
						sFrame += "</div></td>";
				sFrame += "</tr>";
				sFrame += "<tr id=\"WinFooter_"+FrameId+"\">";
					sFrame += "<td><div id=\"FooterPart_"+FrameId+"\" style=\"border-width:1px;border-style:solid;border-color:"+colors.footer.border+" "+colors.footer.border+" "+colors.footer.hilite+" "+colors.footer.dark+";margin: 2px 0px 0px;border-collapse:collapse;\" OnClick=\"PopupManager.ToTop('PopupDiv_"+FrameId+"');\">"+options.statusText+"</div></td>";
					sFrame += "<td><div id=\"WinResize_"+FrameId+"\" style=\"color:"+colors.footer.border+";text-align:right;vertical-align:bottom;margin: 2px 0px 0px;border-width:1px;border-style:solid;border-color:"+colors.footer.border+" "+colors.footer.border+" "+colors.footer.hilite+" "+colors.footer.dark+";border-collapse:collapse;\">//</div></td>";
				sFrame += "</tr>";
			sFrame += "</table>";
		sFrame += "</div>";
	sFrame += "</div>";

	return sFrame;
};

function GetRoundedFunction(FrameId, options, colors)
{
	var sFrame = "";

	sFrame += "<div style=\"background-color:transparent;display:block;\" onclick=\"PopupManager.ToTop('PopupDiv_"+FrameId+"');\">";
		sFrame += "<div>";
			sFrame += "<div OnClick=\"PopupManager.ClosePopup("+FrameId+");\" style=\"display:block;width:30px;float:right;cursor:pointer;\">";
				sFrame += "<b style=\"background-color:"+colors.title.border+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:5px;margin-right:5px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.border+";border-left:2px solid "+colors.title.border+";border-right:2px solid "+colors.title.border+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.border+";border-right:2px solid "+colors.title.border+";margin-left:3px;margin-right:3px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.dark+";border-right:2px solid "+colors.title.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.hilite+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:2px;margin-right:2px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.hilite+";border-left:2px solid "+colors.title.dark+";border-right:2px solid "+colors.title.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.hilite+";border-right:2px solid "+colors.title.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.hilite+";border-right:1px solid "+colors.title.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.body+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b></b>";
					sFrame += "<div style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin:0px;\"><div style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.hilite+";border-right:1px solid "+colors.title.hilite+";margin-left:1px;margin-right:1px;\">";
						sFrame += "<div style=\"color:"+colors.title.font+";background-color:"+colors.title.body+";border:0px none transparent;margin-left:1px;margin-right:1px;font-size:12pt;overflow:auto;text-align:center;\">X</div>";
					sFrame += "</div></div>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.hilite+";border-right:1px solid "+colors.title.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.body+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.hilite+";border-right:2px solid "+colors.title.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.hilite+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:2px;margin-right:2px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.hilite+";border-left:2px solid "+colors.title.dark+";border-right:2px solid "+colors.title.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.border+";border-right:2px solid "+colors.title.border+";margin-left:3px;margin-right:3px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.dark+";border-right:2px solid "+colors.title.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.border+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:5px;margin-right:5px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.border+";border-left:2px solid "+colors.title.border+";border-right:2px solid "+colors.title.border+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "</div>";
			sFrame += "<div id=\"TitlePart_"+FrameId+"\" style=\"display:block;\">";
				sFrame += "<b style=\"background-color:"+colors.title.border+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:5px;margin-right:5px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.border+";border-left:2px solid "+colors.title.border+";border-right:2px solid "+colors.title.border+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.border+";border-right:2px solid "+colors.title.border+";margin-left:3px;margin-right:3px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.dark+";border-right:2px solid "+colors.title.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.hilite+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:2px;margin-right:2px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.hilite+";border-left:2px solid "+colors.title.dark+";border-right:2px solid "+colors.title.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.hilite+";border-right:2px solid "+colors.title.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.hilite+";border-right:1px solid "+colors.title.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.body+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b></b>";
				sFrame += "<div style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin:0px;\"><div style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.hilite+";border-right:1px solid "+colors.title.hilite+";margin-left:1px;margin-right:1px;\">";
						sFrame += "<div style=\"color:"+colors.title.font+";background-color:"+colors.title.body+";border:0px none transparent;margin-left:1px;margin-right:1px;font-size:12pt;overflow:auto;\">"+options.title+"</div>";
				sFrame += "</div></div>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.hilite+";border-right:1px solid "+colors.title.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.body+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.hilite+";border-right:2px solid "+colors.title.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.hilite+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:2px;margin-right:2px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.hilite+";border-left:2px solid "+colors.title.dark+";border-right:2px solid "+colors.title.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.border+";border-right:2px solid "+colors.title.border+";margin-left:3px;margin-right:3px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.dark+";border-left:2px solid "+colors.title.dark+";border-right:2px solid "+colors.title.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.title.border+";border-left:1px solid "+colors.title.border+";border-right:1px solid "+colors.title.border+";margin-left:5px;margin-right:5px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.title.border+";border-left:2px solid "+colors.title.border+";border-right:2px solid "+colors.title.border+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "</div>";
		sFrame += "</div>";
		sFrame += "<div>";
			sFrame += "<b style=\"background-color:"+colors.content.border+";border-left:1px solid "+colors.content.border+";border-right:1px solid "+colors.content.border+";margin-left:5px;margin-right:5px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.border+";border-left:2px solid "+colors.content.border+";border-right:2px solid "+colors.content.border+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "<b style=\"background-color:"+colors.content.dark+";border-left:2px solid "+colors.content.border+";border-right:2px solid "+colors.content.border+";margin-left:3px;margin-right:3px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.dark+";border-left:2px solid "+colors.content.dark+";border-right:2px solid "+colors.content.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "<b style=\"background-color:"+colors.content.hilite+";border-left:1px solid "+colors.content.border+";border-right:1px solid "+colors.content.border+";margin-left:2px;margin-right:2px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.hilite+";border-left:2px solid "+colors.content.dark+";border-right:2px solid "+colors.content.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "<b style=\"background-color:"+colors.content.dark+";border-left:1px solid "+colors.content.border+";border-right:1px solid "+colors.content.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.dark+";border-left:2px solid "+colors.content.hilite+";border-right:2px solid "+colors.content.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "<b style=\"background-color:"+colors.content.dark+";border-left:1px solid "+colors.content.border+";border-right:1px solid "+colors.content.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.dark+";border-left:1px solid "+colors.content.hilite+";border-right:1px solid "+colors.content.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.body+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b></b>";
				sFrame += "<div style=\"background-color:"+colors.content.dark+";border-left:1px solid "+colors.content.border+";border-right:1px solid "+colors.content.border+";margin:0px;\"><div style=\"background-color:"+colors.content.dark+";border-left:1px solid "+colors.content.hilite+";border-right:1px solid "+colors.content.hilite+";margin-left:1px;margin-right:1px;\">";
					sFrame += "<div id=\"Content_"+FrameId+"\" style=\"color:"+colors.content.font+";background-color:"+colors.content.body+";border:0px none transparent;margin-left:1px;margin-right:1px;font-size:12pt;overflow:auto;width:"+(options.size.x + this.RoundedWinOffset)+options.unit+";height:"+options.size.y+options.unit+";\">&nbsp;</div>";
				sFrame += "</div></div>";
			sFrame += "<b style=\"background-color:"+colors.content.dark+";border-left:1px solid "+colors.content.border+";border-right:1px solid "+colors.content.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.dark+";border-left:1px solid "+colors.content.hilite+";border-right:1px solid "+colors.content.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.body+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b></b>";
			sFrame += "<b style=\"background-color:"+colors.content.dark+";border-left:1px solid "+colors.content.border+";border-right:1px solid "+colors.content.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.dark+";border-left:2px solid "+colors.content.hilite+";border-right:2px solid "+colors.content.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "<b style=\"background-color:"+colors.content.hilite+";border-left:1px solid "+colors.content.border+";border-right:1px solid "+colors.content.border+";margin-left:2px;margin-right:2px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.hilite+";border-left:2px solid "+colors.content.dark+";border-right:2px solid "+colors.content.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "<b style=\"background-color:"+colors.content.dark+";border-left:2px solid "+colors.content.border+";border-right:2px solid "+colors.content.border+";margin-left:3px;margin-right:3px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.dark+";border-left:2px solid "+colors.content.dark+";border-right:2px solid "+colors.content.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "<b style=\"background-color:"+colors.content.border+";border-left:1px solid "+colors.content.border+";border-right:1px solid "+colors.content.border+";margin-left:5px;margin-right:5px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.content.border+";border-left:2px solid "+colors.content.border+";border-right:2px solid "+colors.content.border+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
		sFrame += "</div>";
		sFrame += "<div id=\"WinFooter_"+FrameId+"\">";
			sFrame += "<div style=\"display:block;width:30px;float:right;\">";
				sFrame += "<b style=\"background-color:"+colors.footer.border+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:5px;margin-right:5px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.border+";border-left:2px solid "+colors.footer.border+";border-right:2px solid "+colors.footer.border+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.border+";border-right:2px solid "+colors.footer.border+";margin-left:3px;margin-right:3px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.dark+";border-right:2px solid "+colors.footer.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.hilite+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:2px;margin-right:2px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.hilite+";border-left:2px solid "+colors.footer.dark+";border-right:2px solid "+colors.footer.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.hilite+";border-right:2px solid "+colors.footer.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.hilite+";border-right:1px solid "+colors.footer.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.body+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b></b>";
					sFrame += "<div style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin:0px;\"><div style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.hilite+";border-right:1px solid "+colors.footer.hilite+";margin-left:1px;margin-right:1px;\">";
						sFrame += "<div id=\"WinResize_"+FrameId+"\" style=\"color:"+colors.footer.font+";background-color:"+colors.footer.body+";border:0px none transparent;margin-left:1px;margin-right:1px;font-size:12pt;overflow:auto;text-align:right;\">///</div>";
					sFrame += "</div></div>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.hilite+";border-right:1px solid "+colors.footer.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.body+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.hilite+";border-right:2px solid "+colors.footer.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.hilite+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:2px;margin-right:2px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.hilite+";border-left:2px solid "+colors.footer.dark+";border-right:2px solid "+colors.footer.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.border+";border-right:2px solid "+colors.footer.border+";margin-left:3px;margin-right:3px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.dark+";border-right:2px solid "+colors.footer.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.border+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:5px;margin-right:5px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.border+";border-left:2px solid "+colors.footer.border+";border-right:2px solid "+colors.footer.border+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "</div>";
			sFrame += "<div>";
				sFrame += "<b style=\"background-color:"+colors.footer.border+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:5px;margin-right:5px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.border+";border-left:2px solid "+colors.footer.border+";border-right:2px solid "+colors.footer.border+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.border+";border-right:2px solid "+colors.footer.border+";margin-left:3px;margin-right:3px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.dark+";border-right:2px solid "+colors.footer.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.hilite+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:2px;margin-right:2px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.hilite+";border-left:2px solid "+colors.footer.dark+";border-right:2px solid "+colors.footer.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.hilite+";border-right:2px solid "+colors.footer.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.hilite+";border-right:1px solid "+colors.footer.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.body+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b></b>";
					sFrame += "<div style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin:0px;\"><div style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.hilite+";border-right:1px solid "+colors.footer.hilite+";margin-left:1px;margin-right:1px;\">";
						sFrame += "<div id=\"FooterPart_"+FrameId+"\" style=\"color:"+colors.footer.font+";background-color:"+colors.footer.body+";border:0px none transparent;margin-left:1px;margin-right:1px;font-size:12pt;overflow:auto;\">"+options.statusText+"</div>";
					sFrame += "</div></div>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.hilite+";border-right:1px solid "+colors.footer.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.body+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.hilite+";border-right:2px solid "+colors.footer.hilite+";margin-left:1px;margin-right:1px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.hilite+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:2px;margin-right:2px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.hilite+";border-left:2px solid "+colors.footer.dark+";border-right:2px solid "+colors.footer.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.border+";border-right:2px solid "+colors.footer.border+";margin-left:3px;margin-right:3px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.dark+";border-left:2px solid "+colors.footer.dark+";border-right:2px solid "+colors.footer.dark+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
				sFrame += "<b style=\"background-color:"+colors.footer.border+";border-left:1px solid "+colors.footer.border+";border-right:1px solid "+colors.footer.border+";margin-left:5px;margin-right:5px;display:block;height:1px;overflow:hidden;font-size:.01em;\"><b style=\"background-color:"+colors.footer.border+";border-left:2px solid "+colors.footer.border+";border-right:2px solid "+colors.footer.border+";margin-left:0px;margin-right:0px;display:block;height:1px;overflow:hidden;font-size:.01em;\"></b></b>";
			sFrame += "</div>";
		sFrame += "</div>";
	sFrame += "</div>";

	return sFrame;
};

function PopBackFunction()
{
	for (var i = 0; i < this.NumPopups; i++) {
		if (document.getElementById("PopupDiv_"+i)) {
			document.getElementById("PopupDiv_"+i).style.zIndex = 0;
		}
	}
};

function ToTopFunction(PopupId)
{
	this.PopBack();
	if (document.getElementById(PopupId)) {
		document.getElementById(PopupId).style.zIndex = this.NumPopups;
	}
};

function ClosePopupFunction(iPopupId)
{
	oTmpDiv = document.getElementById("PopupDiv_"+iPopupId);
	document.body.removeChild(oTmpDiv);
	this.PopupDivList[iPopupId] = null;
};

/********Popup Window Functions********/

/**** ****/
function LoadMeFunction()
{
};

function CloseMeFunction()
{
	oTmpDiv = document.getElementById("PopupDiv_"+this.PopupId);
	document.body.removeChild(oTmpDiv);
}

/********Popup Manager Declaration********/
var PopupManager;

window.addEvent('domready', StartPopupManager);

function StartPopupManager()
{
	PopupManager = new PopupDivsMan();
}
//-->