function waitPopup(thisWindow, strPageTitle, strPageText, iWidth, iHeight)
{
var sPageTitle = 'Processing Query';
var sPageText = 'Please Wait';
var iW = 300;
var iH = 100; 
var w = 480;
var h = 340;
var l = 0;
var t = 0;

	if (strPageTitle) {
		sPageTitle = strPageTitle;
	}
	if (strPageText) {
		sPageText = strPageText;
	}
	if (iWidth) {
		iW = iWidth;
	}
	if (iHeight) {
		iH = iHeight;
	}			
 	if (thisWindow.document.all) {
	   /* the following is only available after onLoad */
		w = thisWindow.document.body.clientWidth;
		h = thisWindow.document.body.clientHeight;
		l = thisWindow.screenLeft;
		t = thisWindow.screenTop;
	}
	else if (thisWindow.document.layers) {
		w = thisWindow.innerWidth;
		h = thisWindow.innerHeight;
		l = thisWindow.left + thisWindow.innerLeft;
		t = thisWindow.top + thisWindow.innerTop;
	}

	var leftPos = (w-iW)/2;
	var topPos = (h-iH)/2;

    popupWin = window.open('', 'waitWin', 'width=' + iW + ',height=' + iH + ',top=' + (t + topPos) + ',left=' + (l + leftPos));
               
    popupWin.document.write("<html><head><meta name=VI60_defaultClientscript content=Javascript><meta http-equiv='Content-Type content=text/html; charset=1252'><link id=cssDefault title=Default href='../Styles/cssGreenvilleCountyMain.css' type='text/css' rel='stylesheet'><title>" + sPageTitle + "</title></head><body onblur='self.close();' bgcolor='#333366'><div class='CalloutHeader' align='center'>" + sPageText + "</div><div width='80%' style='background-color:#FFFFFF;border:0.1cm inset grey'><img src='wait.gif'></img></div></body></html>");
    popupWin.document.close();
}

function waitPopupClose()
{
	popupWin = window.open('', 'waitWin')
	//if (!popupWin.closed){
		popupWin.close();
	//}
}

function getPrinterFriendlyVer(thisWindow, iWidth, iHeight)
{
var sLocation;
var pattern;
var w = 480;
var h = 340;
var l = 0;
var t = 0;

	sLocation = new String(thisWindow.location);
 	
 	//sLocation = sLocation.toLowerCase();
 	
 	if (thisWindow.document.all) {
	   /* the following is only available after onLoad */
		w = thisWindow.document.body.clientWidth;
		h = thisWindow.document.body.clientHeight;
		l = thisWindow.screenLeft;
		t = thisWindow.screenTop;
	}
	else if (thisWindow.document.layers) {
		w = thisWindow.innerWidth;
		h = thisWindow.innerHeight;
		l = thisWindow.left + thisWindow.innerLeft;
		t = thisWindow.top + thisWindow.innerTop;
	}

	iW = w * 0.8;
	iH = h * 0.75;

	if (iWidth) {
		iW = iWidth;
	}
	if (iHeight) {
		iH = iHeight;
	}			

	var leftPos = (w-iW)/2;
	var topPos = (h-iH)/2;


	pattern = /.asp/ig;
	sLocation = sLocation.replace(pattern,"pf.asp");

	pattern = /.htm/ig;
	sLocation = sLocation.replace(pattern,"pf.htm");

	//sLocation = sLocation.replace(".asp","pf.asp");
	//sLocation = sLocation.replace(".htm","pf.htm");

    printerWin = window.open('', 'printerWin', 'width=' + iW + ',height=' + iH + ',top=' + (t + topPos) + ',left=' + (l + leftPos)+',toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');

	waitPopup(thisWindow);
	
    printerWin.location = sLocation;
    printerWin.document.close();
}

//***************************************************
//
//***************************************************
function ShowAgencies(strCode,strCourtType) {
var RetVal='';
var intWinWidth=0;
var intWinHeight=0;
var intLeft=0;
var intTop=0;
var intWidth=0;
var intHeight=0;
var strRet='';

intWinWidth=window.screen.width;
intWinHeight=window.screen.height;

intWidth=630;
intHeight=470;
intLeft=(intWinWidth-intWidth)/2;
intTop=(intWinHeight-intHeight)/2;

window.open('./SelectAgencies.asp?CountyCode=' + strCode + '&CourtType=' + strCourtType,'_blank',
	'alwaysRaised=yes,toolbar=no,status=no,resizable=yes,' + 
	'dependent=yes,height=' + intHeight + ',width=' + intWidth + ',' +
	'screenX=' + intLeft + ',screenY=' + intTop + ',' +
	'left=' + intLeft + ',top=' + intTop + ',scrollbars=yes');
}
//***************************************************
//
//***************************************************
function ShowHelp(strHelpFile) {
var RetVal='';
var intWinWidth=0;
var intWinHeight=0;
var intLeft=0;
var intTop=0;
var intWidth=0;
var intHeight=0;
var strRet='';

intWinWidth=window.screen.width;
intWinHeight=window.screen.height;

intWidth=630;
intHeight=470;
intLeft=(intWinWidth-intWidth)/2;
intTop=(intWinHeight-intHeight)/2;

window.open(strHelpFile,'_blank',
	'alwaysRaised=yes,toolbar=no,status=no,resizable=yes,' + 
	'dependent=yes,height=' + intHeight + ',width=' + intWidth + ',' +
	'screenX=' + intLeft + ',screenY=' + intTop + ',' +
	'left=' + intLeft + ',top=' + intTop + ',scrollbars=yes');
}
//***************************************************
//
//***************************************************
function ShowStates() {
var RetVal='';
var intWinWidth=0;
var intWinHeight=0;
var intLeft=0;
var intTop=0;
var intWidth=0;
var intHeight=0;

intWinWidth=window.screen.width;
intWinHeight=window.screen.height;

intWidth=620;
intHeight=460;
intLeft=(intWinWidth-intWidth)/2;
intTop=(intWinHeight-intHeight)/2;

window.open('./SelectState.asp','_blank',
	'alwaysRaised=yes,toolbar=no,status=no,resizable=yes,' + 
	'dependent=yes,height=' + intHeight + ',width=' + intWidth + ',' +
	'screenX=' + intLeft + ',screenY=' + intTop + ',' +
	'left=' + intLeft + ',top=' + intTop + ',scrollbars=yes');

}

//***************************************************
//
//***************************************************
function ShowTypes(strCourtType, strAgencies) {
var RetVal='';
var intWinWidth=0;
var intWinHeight=0;
var intLeft=0;
var intTop=0;
var intWidth=0;
var intHeight=0;

intWinWidth=window.screen.width;
intWinHeight=window.screen.height;

intWidth=620;
intHeight=460;
intLeft=(intWinWidth-intWidth)/2;
intTop=(intWinHeight-intHeight)/2;

window.open('./SelectCaseTypes.asp?CourtType=' + strCourtType + '&Agencies=' + strAgencies,'_blank',
	'alwaysRaised=yes,toolbar=no,status=no,resizable=yes,' + 
	'dependent=yes,height=' + intHeight + ',width=' + intWidth + ',' +
	'screenX=' + intLeft + ',screenY=' + intTop + ',' +
	'left=' + intLeft + ',top=' + intTop + ',scrollbars=yes');

}
//***************************************************
//
//***************************************************
function ShowPartyTypes(strCourtAgencies) {
var RetVal='';
var intWinWidth=0;
var intWinHeight=0;
var intLeft=0;
var intTop=0;
var intWidth=0;
var intHeight=0;

intWinWidth=window.screen.width;
intWinHeight=window.screen.height;

intWidth=620;
intHeight=460;
intLeft=(intWinWidth-intWidth)/2;
intTop=(intWinHeight-intHeight)/2;

window.open('./SelectCasePtyTypes.asp?Agencies=' + strCourtAgencies,'_blank',
	'alwaysRaised=yes,toolbar=no,status=no,resizable=yes,' + 
	'dependent=yes,height=' + intHeight + ',width=' + intWidth + ',' +
	'screenX=' + intLeft + ',screenY=' + intTop + ',' +
	'left=' + intLeft + ',top=' + intTop + ',scrollbars=yes');

}