function Popup(sName, sContent) {
	this.name = sName;
	this.content = sContent;
}

function Catalog($name) {
	this.name = $name;
	this.Popups = new Array();
}

function initPopups() {
	for (i=0; i<this.Popups.length; i++) {
		this.Popups[i].popup = new Layer("popWin"+i);
	}
}

function writePopups() {
	for (i=0; i<this.Popups.length; i++) {
		document.write(this.getHTML(i));
	}
}

function openPopup(iIndex) {
	if (isReady) {
		for (i=0; i<this.Popups.length; i++) {
			this.Popups[i].popup.hide();
		}
		this.Popups[iIndex].popup.show();
	}
}

function closePopup(iIndex) {
	this.Popups[iIndex].popup.hide();
}

function getHTML(iIndex) {
	oWin = this.Popups[iIndex];
	sHead = '<div id="popWin'+iIndex+'" class="popup"><table cellpadding="0" cellspacing="0" border="0" width="400"><tr><td rowspan="100%" class="c1"><img src="/images/1x1.gif" width="1" height="1" alt="" border="0"></td><td class="c1" rowspan="2"><img src="/images/1x1.gif" width="14" height="1" alt="" border="0"></td><td class="c1"><img src="/images/1x1.gif" width="175" height="2" alt="" border="0"></td><td class="c1"><img src="/images/1x1.gif" width="35" height="2" alt="" border="0"></td><td class="c1"><img src="/images/1x1.gif" width="14" height="2" alt="" border="0"></td><td rowspan="100%" class="c1"><img src="/images/1x1.gif" width="1" height="1" alt="" border="0"></td></tr><tr><td class="c1">';			
	sBody = '</td><td class="c1" align="right"><a href="javascript:'+this.name+'.close('+iIndex+')" onmouseover="ro.on(\'close'+iIndex+'\')" onmouseout="ro.off(\'close'+iIndex+'\')" class="a4">Close</a></td><td class="c1"><a href="javascript:'+this.name+'.close('+iIndex+')" onmouseover="ro.on(\'close'+iIndex+'\')" onmouseout="ro.off(\'close'+iIndex+'\')"><img name="close'+iIndex+'" src="/images/cls1.gif" width="13" height="13" alt="" border="0"></a></td></tr><tr><td class="c1" colspan="4"><img src="/images/1x1.gif" width="1" height="2" alt="" border="0"></td></tr><tr><td colspan="4"><img src="/images/1x1.gif" width="1" height="14" alt="" border="0"></td></tr><tr><td>&nbsp;</td><td colspan="2">';		
	sFoot = '</td><td>&nbsp;</td></tr><tr><td colspan="4"><img src="/images/1x1.gif" width="1" height="14" alt="" border="0"></td></tr><tr><td class="c1" colspan="4"><img src="/images/1x1.gif" width="1" height="1" alt="" border="0"></td></tr></table></div>';	
	return (sHead + oWin.name + sBody + oWin.content + sFoot);
}

Catalog.prototype.getHTML = getHTML;
Catalog.prototype.init = initPopups;
Catalog.prototype.open = openPopup;
Catalog.prototype.close = closePopup;
Catalog.prototype.write = writePopups;
