<!--
/********Main Objects********/

/****Popup Manager****/
function PopupDivsMan() {
	/**Manager Variables**/
	this.NumPopups = 0;

	/**Manager Functions**/
	this.CreatePopup = CreatePopupFunction;
	this.ClosePopup = ClosePopupFunction;

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

/****Popup Window****/
function PopupWindow(iNewId) {
	/**Popup Variables**/
	this.PopupId = iNewId;
	this.Width = 0;
	this.Height = 0;
	this.Left = 0;
	this.Top = 0;
	this.Title = "";
	this.Source = "";
	this.Div = document.createElement("div");

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

	/**Popup Objects**/
};

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

/**** ****/
function CreatePopupFunction(iWidth, iHeight, iX, iY, sTitle, sSrc) {
	var iOffset = 0;
	var sPopupSrc = "";
	this.PopupDivList[this.NumPopups] = new PopupWindow(this.NumPopups);

	if (sSrc.indexOf("?") > 0) {
		sSrc += "&popup="+this.NumPopups;
	}
	else {
		sSrc += "?popup="+this.NumPopups;
	}

	with (this.PopupDivList[this.NumPopups]) {
		Width = iWidth;
		Height = iHeight;
		Left = iX;
		Top = iY;
		Title = sTitle;
		Source = sSrc;

		iOffset = (PopupId % 6) * 10;
		Div.id = "PopupDiv_"+PopupId;
		Div.style.width = Width+"px";
		Div.style.height = Height+"px";
		Div.style.position = "Absolute";
		Div.style.left = (Left + iOffset)+"px";
		Div.style.top = (Top + iOffset)+"px";
		Div.style.border = "2px solid black";

		sPopupSrc = "<table border='0' cellpadding='0' bgcolor='white' cellspacing='0' width='100%' height='100%'>";
			sPopupSrc += "<tr>";
				sPopupSrc += "<td height='18' style='background-color:#ffffc0;border:1px solid black;'>";
					sPopupSrc += "<table border='0' cellpadding='0' cellspacing='0' width='100%' height='18' style='background-color:#ffffc0;border:1px solid black;'>";
						sPopupSrc += "<tr>";
						sPopupSrc += "<td height='18' align='left'>&nbsp;&nbsp;<b>"+Title+"</b></td>";
							sPopupSrc += "<td width='18' height='18'><div Class='Button' OnClick='PopupManager.ClosePopup("+PopupId+");' Style='cursor:pointer; border-width:2px; border-style:solid; border-color:#000000; background-color:d0d0d0;'><b Style=\"color:#800000\">X</b></div></td>";
						sPopupSrc += "</tr>";
					sPopupSrc += "</table>";
				sPopupSrc += "</td>";
			sPopupSrc += "</tr>";
			sPopupSrc += "<tr>";
				sPopupSrc += "<td ColSpan='2' Style=\"BackGroud-Color:#000000;\">";
					sPopupSrc += "<iframe id='PopupFrame_"+PopupId+"' height='"+(Height - 24)+"' width='"+Width+"' frameborder='no' scrolling='auto' src='"+Source+"'></iframe>";
				sPopupSrc += "</td>";
			sPopupSrc += "</tr>";
		sPopupSrc += "</table>";

		Div.innerHTML = sPopupSrc;

		document.body.appendChild(Div);
		document.getElementById("PopupFrame_"+PopupId).src = Source;
	}
	this.NumPopups += 1;
};
 
function ClosePopupFunction(iPopupId) {
	oTmpDiv = document.getElementById("PopupDiv_"+iPopupId);
	document.body.removeChild(oTmpDiv);
	//this.PopupDivList[this.NumPopups] = null;
};

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

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

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

/********Popup Manager Declaration********/
var PopupManager = new PopupDivsMan();
//-->