//ssPop1.js 4/29/02 3/26/03
//std windows
//re-tweaked 2/6/04 tc
//
// windows in 'popWrk'
function PopStdAll(popPage){
	return Pop2( popPage, 500, 600, 1);
}
function Pop53(popPage){
	return Pop2(popPage, 500, 300);
}
function Pop66(popPage){
	return Pop2(popPage, 600, 600);
}
function Pop67(popPage){
	return Pop2(popPage, 600, 700);
}
function Pop2(popPage, wness, hness)
{
	return Pop1(popPage,'popWrk', wness, hness, 1, 1, 1, 0);
}
function PopDtr(popPage){
	return PopFull(popPage, 400, 700, 1, 1, 1, 1);
}

//
// the PopFull family, opening in 'lvl2'
//
function PopSmall(popPage){
	return PopCenter( popPage, 400, 200);
}
function PopSmall2(popPage){
	return PopCenter( popPage, 400, 220);
}
function PopTiny(popPage){
	return PopCenter( popPage, 200, 100);
}

function PopStd(popPage){
	return PopCenter( popPage, 400, 400);
}
function PopCenter(popPage, wness, hness){
	return PopFull(popPage, wness, hness, 0);
}
function PopSqr(popPage){
	return PopFull( popPage, 300, 300, 1);
}
function PopStdL(popPage){
	return PopFull( popPage, 400, 400, 1);
}
function PopStdScr(popPage){
	return PopFull( popPage, 500, 600, 1);
}
function PopStd2(popPage){
	return PopFull( popPage, 500, 600, 0);
}
// at last, PopFull, with window pop1
function PopFull(popPage, wness, hness, scrlbr){
	return Pop0(popPage, 'lvl2', wness, hness, scrlbr,0);
}
function PopRpt3(popPage){
	return Pop0(popPage, 'lvl2', 600, 200, 1,1);
}
function PopRpt4(popPage){
	return Pop0(popPage, 'lvl2', 600, 400, 1,1);
}
function PopRpt5(popPage){
	return Pop0(popPage, 'lvl2', 700, 400, 1,1);
}

//window config - pop1
function PopRpt1(popPage){
	return PopStat( popPage, 600, 400, 1);
}
function PopRptN(popPage){
	return PopStat( popPage, 400, 400, 1);
}
function PopLong(popPage, wness, hness){
	return PopStat(popPage, wness, hness, 1);
}
function PopStat(popPage, wness, hness, scrlbr){
	return Pop0(popPage, 'lvl1', wness, hness, scrlbr,1);
}
function PopRpt(popPage){
	return Pop0(popPage, 'lvl1', 700, 400, 1,0);
}
//
//window config -- pop1

//
function PopBat(batFile){
	return Pop0(batFile+'.cfm?m=i','BatWin',500,600,1,0);
}
///

function Pop0(popPage, popObject, wness, hness, scrlbr, stat){
	return Pop1(popPage, popObject, wness, hness, scrlbr, stat, 1, 0);
}

// the basic poppers
function PopDoc(popPage)
{
//	alert('PopDoc: '+popPage);
	return Pop1(popPage,'DocWin', 700, 500, 1, 1, 1, 1);
}
function PopCal( aFld)
{
	pPage = "$calends.htm?"+aFld;
	wid=200;
	ht=200;
	lf = ((screen.width-wid)/2);
	tp = ((screen.height-ht)/2);
	opts = "width="+wid+",height="+ht+",left="+lf+",top="+tp;
	if (PopWindow = window.open (pPage,"CalBox",opts))
		return PopWindow.focus();
//	Pop1("$calends.htm?"+aFld,"CalBox",180,400,0,1,1,0);
}

//
// all other poppers call pop1
//
function Pop1(popPage, popObject, wness, hness, scrlbr, stat, adj, menu)
{
	var leftPos, topPos, altw, alth;
	var opts, sizes;
	wrkWin = popObject;
//	alert('Popping ' + popPage + ' in ' + wrkWin);
	opts = ',scrollbars=' + scrlbr
			+ ',resizable=' + adj
			+ ',status=' + stat
			+ ',menubar=' + menu;
	altw = wness; alth = hness;	leftPos = 5; topPos = 5;
	if (adj){
		if (screen){
			if (wness < 800) altw = altw * screen.width / 800;
			if (hness < 600) alth = alth * screen.height / 600;
			leftPos = ((screen.width-altw)/2);
			topPos = ((screen.height-alth)/2);
		}
	}
	sizes = 'width='+altw+',height='+alth+',left='+leftPos+',top='+topPos;
	if (PopWindow = window.open (popPage, wrkWin, sizes + opts))
		return PopWindow.focus();
	else
		return nothing;
}
// finis
