<!-- Invisible to Non-JavaScript Browers

// Copyrighted 2005 By Boulevard Group, LLC.  All Rights Reserved

var DebugWindow;
var AppWindow;

function PMISWin(URL, DNAME)
{
	if (document.MyForm.ALTKEYCACHE.value == "ALT") {
		PMISWin2(URL, DNAME, 0, 0);
	}
	else if (document.MyForm.ALTKEYCACHE.value == "CTL") {
		PMISWin3(URL, DNAME, 0, 0);
	} else {
		PMISWin1(URL);
	}
	document.MyForm.ALTKEYCACHE.value = "OFF"; // Just in case
	//document.location.href = URL;
	
} // End of PMISWin

function PMISWin1(URL)
{
	document.MyForm.ALTKEYCACHE.value = "OFF"; // To be safe
	document.location.href = URL;

} // End of PMISWin1

function PMISWin2(URL, DNAME, X, Y)
{
document.MyForm.ALTKEYCACHE.value = "OFF"; // To be safe

var winParms = new String("");

//var calcWidth = screen.width - (.15 * screen.width); // Depreciated
//var calcHeight = screen.height - (.15 * screen.height); // Depreciated
var calcWidth = screen.availWidth - (.01 * screen.availWidth);
var calcHeight = screen.availHeight - (.01 * screen.availHeight); 

	// Format WinParms
	
	winParms += "height=" + calcHeight.toString() + ",";
	winParms += "width=" + calcWidth.toString() + ",";
	winParms += "location=yes,"; // no
	winParms += "menubar=yes,"; // no
	winParms += "resizable=yes,";
	winParms += "scrollbars=yes,";
	winParms += "titlebar=yes,"; //no
	winParms += "dependent=yes,";
	winParms += "directories=yes,"; // no
	winParms += "status=yes,";
	winParms += "toolbar=yes"; // no
	
	// Pop Window
	
	var PMISWindow = window.open('', DNAME, winParms);
	
	// Test for Popup Blocker
	
	if (IsPopupBlocker(PMISWindow)) {
		alert("The PMISWin Function was unable to open a window.  Please check if you have your browser has the popup blocker turned on.  If so please turn it off to use the PMISWin Function.  If this is not the case, please call us at support.  Thank you.");
	}
	
	// Window Fixup
	
	if (PMISWindow.opener == null) {
		PMISWindow.opener = self;
	}
	
	PMISWindow.moveTo(X, Y);
	PMISWindow.location.href = URL;
	
	PMISWindow.focus();

} // End of PMISWin2

function PMISWin3(URL, DNAME, X, Y)
{
document.MyForm.ALTKEYCACHE.value = "OFF"; // To be safe

var winParms = new String("");

//var calcWidth = screen.width - (.15 * screen.width); // Depreciated
//var calcHeight = screen.height - (.15 * screen.height); // Depreciated
var calcWidth = screen.availWidth - (.01 * screen.availWidth);
var calcHeight = screen.availHeight - (.01 * screen.availHeight); 

	// Format WinParms
	
	winParms += "height=" + calcHeight.toString() + ",";
	winParms += "width=" + calcWidth.toString() + ",";
	winParms += "location=no,";
	winParms += "menubar=no,";
	winParms += "resizable=yes,";
	winParms += "scrollbars=yes,";
	winParms += "titlebar=no,";
	winParms += "dependent=yes,";
	winParms += "directories=no,";
	winParms += "status=yes,";
	winParms += "toolbar=no";
	
	// Pop Window
	
	var PMISWindow = window.open('', DNAME, winParms);
	
	// Test for Popup Blocker
	
	if (IsPopupBlocker(PMISWindow)) {
		alert("The PMISWin Function was unable to open a window.  Please check if you have your browser has the popup blocker turned on.  If so please turn it off to use the PMISWin Function.  If this is not the case, please call us at support.  Thank you.");
	}
	
	// Window Fixup
	
	if (PMISWindow.opener == null) {
		PMISWindow.opener = self;
	}
	
	PMISWindow.moveTo(X, Y);
	PMISWindow.location.href = URL;

	PMISWindow.focus();

} // End of PMISWin3

function IsPopupBlocker(oWin)
{
	if (oWin == null || typeof(oWin) == "undefined") {
		return true;
	} else {
		return false;
	}
	
} // End of IsPopupBlocker

function initWin(LinkTo) {
	
	// Full Screen
	
	window.moveTo(0, 0);
	window.resizeTo(window.screen.availWidth - (.10 * window.screen.availWidth), window.screen.availHeight - (.10 * window.screen.availHeight));
	
	if (LinkTo != "") {
		window.location.href = LinkTo
	}
	
	// Show SESSION Variables
	
	//ShowSV();
	
}  // End of initWin

function ShowSV(AppID)
{
	// Open DisplaySV.asp Window
	
	DebugWindow = window.open("PMISDisplaySV.asp", AppID, "directories=no,height=300,width=450,resizeable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no"); 

	return false;
	
} // End of ShowSV

function popAppWin(appURL, appCaption)
{

	// Open Application Window
	
	AppWindow = window.open(appURL, appCaption, "directories=no,height=500,width=650,resizeable=yes,scrollbars=yes,status=yes,toolbar=yes,menubar=yes"); 

	//return false;
	
} // End of popAppWin

/* Save as Sample Select
function selectStatus() {

	var bIndx = document.ProjectSelect.StatusCode.selectedIndex; // Selected Index
	
	var holdstatuscode = document.ProjectSelect.StatusCode.options[bIndx].value; 
	var holdstatusdescription = document.ProjectSelect.StatusCode.options[bIndx].text; 
	
	document.ProjectSelect.holdstatuscode.value = holdstatuscode;
	document.ProjectSelect.holdstatusdescription.value = holdstatusdescription;

}  // End of selectStatus
End of Sample */

function getSelectedButton(buttonGroup) 
{
	for (var i = 0; i < buttonGroup.length; i++) {
		if (buttonGroup[i].checked) {
			return i;
		}
	}
	return -1;		

} // End of getSelectedButton

function getGroupValue(form, buttonGroup)  
{
var i;
var selectedOption;

	// Get Option
	
	i = getSelectedButton(buttonGroup);
	if (i < 0) {
		//alert("System Error: Please Call Support.  Thanks.");
		selectedOption = "";
	} else {
		selectedOption = form.buttonGroup[i].value;
	}
	
	// Outa Here
	
	return selectedOption;
	
} // End of getGroupValue

// Misc

function autoselect(a,b,c,d) {
	document.ProjectSelect[a].selectedIndex = b;
	document.ProjectSelect[c].selectedIndex = d;
}

function showalert(msg)
{
	alert(msg);
	
} // End of showalert

function FlipMR(ctl, form)
{
	if (ctl.checked) {
		document.forms[0].MR.value = "MR";
	} else {
		document.forms[0].MR.value = "NO";
	}

} // End of FlipMR

function ClearFilterFields()
{
	document.MyForm.MULTIFILTERSTRING.value = "";
	document.MyForm.MULTIFILTERXML.value = "";
	
	var i = 0;
	for (i = 0; i < 100; i++) {
		try {
			SQLWB_RemoveButton_Click('wcb1', i);
		}
		catch(err) {
			break;
		}
	}
	
	wcb1.UpdateConditionsDisplay();
	
	DoSort2(); 
	 
} // End of ClearFilterFields

// Parse Querystring Variables

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

// Make Visible -->

