function fnPopup(sFile, sName, sSize) {
	return window.open(sFile, sName, sSize + 'left=20,top=20,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1');
}

function fnPopup_desc(sFile) {
	var winDesc = fnPopup(sFile, 'DescWindow', 'width=650,height=350');
	winDesc.focus();
}

function fnPopup_lgpic(sFile) {
	var winLgPic = fnPopup(sFile, 'LargePic', 'width=650,height=350');
	winLgPic.focus();
}

function fnPopup_updateOption(sFile) {
	var winUpdateOption = fnPopup(sFile, 'UpdateOption', 'width=750,height=900');
	winUpdateOption.focus();
}

function fnPopup_updateColor(sFile) {
	var winUpdateColor = fnPopup(sFile, 'UpdateColor', 'width=750,height=900');
	winUpdateColor.focus();
}

function fnPopup_updateSize(sFile) {
	var winUpdateSize = fnPopup(sFile, 'UpdateSize', 'width=750,height=900');
	winUpdateSize.focus();
}

function fnPopup_colorDetails(sFile) {
	var winColorDetails = fnPopup(sFile, 'ColorDetailsWindow', 'width=700,height=800');
	winColorDetails.focus();
}
/************************************************************************************************************************************************/
/* whenever a FORM select field is changed this function evaluates all FORM select fields and sets the FORM checkbox for changes accordingly	*/
/* arguments[0] is the checkbox FORM field to check if there are any changes in the other FORM fields											*/
/* arguments[1] thru arguments.length-1 are FORM select elements to check for changes															*/
/************************************************************************************************************************************************/
function fnFeatureChg() {
	var iArgLen = fnFeatureChg.arguments.length;
	var bCheck = false;												// if there are no changes then bCheck = false
	if(iArgLen > 1) {
		for(i = 1; i < iArgLen; i++) {
			var ele = fnFeatureChg.arguments[i];
			if(ele.type == 'select-one' || ele.type == 'select-multiple') {
				var bFound = false;
				var bNoDefault = true;
				for(e = 0; e < ele.length; e++) {						// if [the defaultSelected is not selected] then bCheck = true 
					if(ele.options[e].defaultSelected) {
						if(ele.options[e].selected != ele.options[e].defaultSelected) bFound = true;
						bNoDefault = false;
					}
				}
				if(bNoDefault && ele.selectedIndex != 0) bFound = true;	// if [there is no defaultSelected and selectedIndex is not 0] then bCheck = true 
				if(bFound) bCheck = bFound;
			} else if(ele.type == 'checkbox' || ele.type == 'radio') {
				if(ele.checked != ele.defaultChecked) bCheck = true;
			} else if(ele.type == 'text' || ele.type == 'textarea') {
				if(ele.value != ele.defaultValue) bCheck = true;
			}
		}
	}
	fnFeatureChg.arguments[0].checked = bCheck;
}
/****************************************************************************************************************/
/* if the checkbox is de-selected it will change the other FORM fields for this record to their default values	*/
/* arguments[0] is the checkbox FORM field																		*/
/* arguments[1] thru arguments.length-1 are FORM select elements												*/
/****************************************************************************************************************/
function fnFeatureNoChg() {
	var iArgLen = fnFeatureNoChg.arguments.length;
	if(!fnFeatureNoChg.arguments[0].checked) {
		if(iArgLen > 1) {
			for(i = 1; i < iArgLen; i++) {
				var ele = fnFeatureNoChg.arguments[i];
				if(ele.type == 'select-one' || ele.type == 'select-multiple') {
					var bNotFound = true;												// if there is no default option then select the first option
					for(e = 0; e < ele.length; e++) {
						ele.options[e].selected = ele.options[e].defaultSelected;		// set the FORM options to their default values
						if(ele.options[e].defaultSelected) bNotFound = false;			// if a default option is found don't select the first option
					}
					ele.options[0].selected = bNotFound;
				} else if(ele.type == 'checkbox' || ele.type == 'radio') {
					ele.checked = ele.defaultChecked;
				} else if(ele.type == 'text' || ele.type == 'textarea') {
					ele.value = ele.defaultValue;
				}
			}
		}
	}
}