// HWT Popup

var hwt_popuplist = new Array();

	


function hwtPopupAdd (id, title, width, height, bgcolor, bodycb, lck, sty) {

	hwt_popuplist[id]=[title, width, height, bgcolor, bodycb, lck, null, sty];
	return;
}


function hwtPopupSetSize (id, width, height) {

	hwt_popuplist[id][1] = width;
	hwt_popuplist[id][2] = height;

	return;
}

function hwtPopupSetTitle (id, title) {

	hwt_popuplist[id][0] = title;
	
	return;
}



function hwtPopupOpen (id) {

	if (hwt_popuplist[id][5]) {

		hwt_popuplist[id][6] = window.open("", "__hwtPopup" + id, "status=no, toolbar=no, resizable=no, scrollbars=no, directories=no, width=" + hwt_popuplist[id][1] + ", height=" + hwt_popuplist[id][2]); 

	} else {

		hwt_popuplist[id][6] = window.open("", "__hwtPopup" + id, "status=no, toolbar=no, directories=no, resizable=yes, scrollbars=yes, width=" + hwt_popuplist[id][1] + ", height=" + hwt_popuplist[id][2]);		

	}

	hwt_popuplist[id][6].document.open();
	hwt_popuplist[id][6].document.write('<HTML><HEAD><TITLE>' + hwt_popuplist[id][0] + '</TITLE><link href="' + hwt_popuplist[id][7] + '" rel="stylesheet" type="text/css"></HEAD>\n');
	hwt_popuplist[id][6].document.write('<BODY');
	
	if (hwt_popuplist[id][7]=="") {

		 hwt_popuplist[id][6].document.write(' style="margin: 0px" bgcolor="' + hwt_popuplist[id][3] + '"');

	}

	hwt_popuplist[id][6].document.write('>\n');
	hwt_popuplist[id][6].document.write(eval(hwt_popuplist[id][4]));
	hwt_popuplist[id][6].document.write('</BODY></HTML>\n');
	hwt_popuplist[id][6].document.close();
//	hwt_popuplist[id][6].document.focus();

	return;
}


function hwtPopupClose (id) {

	if (hwt_popuplist[id][6]!=null) {

		hwt_popuplist[id][6].close();
		hwt_popuplist[id][6]=null;
	}

	return;
}


function hwtPopupIsActive (id) {

	if (hwt_popuplist[id][6]!=null) {

		if (typeof(hwt_popuplist[id][6].document) != "object") {

			hwt_popuplist[id][6]=null;
		
		}
	}

	return (hwt_popuplist[id][6]!=null);
}


function hwtPopupGetWindow (id) {

	return(hwt_popuplist[id][6]);
}

