//==========================================================================================================
//  COMMON_SCRIPTS.JS
//	Generic Javascript functions and subroutines used in all NSS web applications
//==========================================================================================================

function CheckBox(strFORM, intID) {
	window.document.forms[strFORM].elements[intID].checked=true;
}
function UnCheckBox(strFORM, intID) {
	window.document.forms[strFORM].elements[intID].checked=false;
}
function SetSort(strFIELD, strORDER) {
	window.document.navigate_listing.elements["SORT_FIELD"].value=strFIELD;
	window.document.navigate_listing.elements["SORT_ORDER"].value=strORDER;
}
function NewWindowForm(strFORM, strACTION_URL, strWIN_NAME, strFEATURES){
	window.open("", strWIN_NAME, strFEATURES);
    document.forms[strFORM].action = strACTION_URL;
    document.forms[strFORM].target = strWIN_NAME;
    document.forms[strFORM].submit()
}

function genericPopup(nom,w,h,windowName)
{
	var url = nom;
	if(w=="")
		w = 425;
	if(h=="")
		h=500;

	if(windowName=="")
		windowName = "POPUP1";
			
	var newWin = window.open(url,windowName,'width=' + w + ', height=' + h + ',resizable,menubar=0,status,toolbar0,scrollbars');	
	newWin.focus();
}

// Inputs: strURL - absolute/relative path to file
//		   strName - window name 
//		   intWidth - window width
//         intHeight - window height
//		   strFeatures - toolbars=yes,status=no, etc....
// Outputs: browser window "pop-up" instantiated w/ formatting and content sent in parameters
function NewWindow(strURL, strName, intWidth, intHeight, strFeatures) {
	window.open(strURL, strName, strFeatures + ',height=' + intHeight + ',width=' + intWidth, true);
}

