// Standard boonfellow scripts that may be useful for sts project		function ConditionalString(Html,WriteType) {	var Result             = "";	var IsNavFour          = IsNavigatorFour();	if ((IsNavFour==true) && (WriteType=="NN4")) {		Result = Html;	} else {		if ((IsNavFour==false) && (WriteType!="NN4")) {			Result = Html;		}	}	return Result;}function IsNavigatorFour() {		var Result = false;	if (parseInt(navigator.appVersion.charAt(0)) < 5) {	   if (navigator.appVersion.indexOf("MSIE") < 0) {		Result=true;	   }	}		return Result;	}function VerifyDelete(FormName) {	if (confirm('Are you sure you want to DELETE this record?')) {		document.forms[FormName].action = document.forms[FormName].action + '&del=1';		document.forms[FormName].submit();    } else {		return 0;    }}function ValidateForm(FormName) {	var ErrorMessage = '';	var ErrorFlag = false;			var ManFld = eval('document.' + FormName + '.MANDATORYFIELDS.value') ;				if (ManFld != '') {		var arrManFld = ManFld.split(",");		var ItemCount = arrManFld.length			for (var i = 0; i < ItemCount; i++) {			var Test = eval('document' + '.' + FormName + '.' + arrManFld[i] + '.value') ;			if (Test=="") {				ErrorMessage = ErrorMessage + '\n' + arrManFld[i] + ' is a mandatory field';				ErrorFlag = true;			}					}	}				if (ErrorFlag == true) {		ErrorMessage = 'Your information contains the following errors:' +  ErrorMessage;		alert(ErrorMessage);		return 0;	} else {		document.forms[FormName].submit();	}}function SwapImage(TargetName,ArrayName,Index) {	var Img = eval(ArrayName + '[' + Index + '].src'); 	document.images[TargetName].src = Img;}function ComboOnChangeGo(FormName,ControlName) {		// Following doesnt work under Netscape, with Form being a form object, changed to FormName as literal	//var Selected = Form[ControlName].selectedIndex;	//var strResult = Form[ControlName].options.value;		var control = eval('document.forms.' + FormName + '.' + ControlName);	var strResult = control[control.selectedIndex].value;					if (strResult != '') {		location.href = strResult;	} else {		return false;	}}function ComboOnChangeShowDiv(Form,ControlName) {		var ThisDiv = eval('document.' + Form + '.' + ControlName + '.options.value');			if (ThisDiv != '') {				ShowDiv(ThisDiv);	}}function HideDiv(DivId) {	 var ThisDiv = eval(DivId)	 ThisDiv.style.visibility = 'hidden';	 ThisDiv.style.display = 'none';}function ShowDiv(DivId) {	var ThisDiv = eval(DivId)	ThisDiv.style.visibility = 'visible';	ThisDiv.style.display = 'block';}function GoUrl(Url) {	location.href = Url;}//---------------------------------------------------------------------------------------------------// Special scripts for sts for showing of images and textfunction ShowCurrentImage(ImageArray,MetaphorImageName,Type) {// show extended img tag with surrounding a-ref, based on current image, using calls to ShowDetail to get// the parts of the html we are generating// type can be// image - show the medium size image, and build a link to the large-image if it exists// caption - show the caption of the image// text    - show the associated text of the image// other   - any other properties that get developed				var strImageLg			= '';	var strImageMed			= '';	var strImageSm			= '';	var strImageTitle		= '';	var strResult			= '';	var strClass			= '';	var strCaption			= '';	var strTmp				= '';	var strMediaFile		= '';	var strMediaCaption     = '';		var UrlImageName    = GetUrlProperty('id');			CurrentImageName = UrlImageName; // from the url	if (CurrentImageName == '') {		CurrentImageName = MetaphorImageName; // default to the main 'metaphor' image for the page	}		var CurrentImagePos     = FindImage(ImageArray,CurrentImageName);		if (Type=='image') {				strImageLg	= GetImageProperty(ImageArray,CurrentImagePos,'lg');		strImageMed = GetImageProperty(ImageArray,CurrentImagePos,'med');		strImageTitle = GetImageProperty(ImageArray,CurrentImagePos,'caption');		if (strImageLg != '') {			strImageTitle = strImageTitle + '\nClick for a larger image';		}		strResult = '<img src="images/' + strImageMed + '" ' + ' title="' + strImageTitle + '" border=0 class=normal>';			if (strImageLg == '') {		} else {			// strResult = '<a href="images/' + strImageLg + '" target=_blank class=normal>' + strResult + '</a>';					//strResult = '<a href=\'Javascript: void window.open("ShowImage.htm?img=' + strImageLg + '", "", "width=600,height=500,toolbar=0,status=no,scrollbars=yes,resizable=yes")\'>' + strResult + '</a>';			strResult = '<a href="ShowImage.htm?img=' + strImageLg + '" class=normal>' + strResult + '</a>';					}	} else {				strResult = GetImageProperty(ImageArray,CurrentImagePos,Type);							if (Type=='text') {			strMediaFile = GetImageProperty(ImageArray,CurrentImagePos,"mediafile");			strMediaCaption = GetImageProperty(ImageArray,CurrentImagePos,"mediacaption");			if (strMediaFile != '') {				if (strMediaCaption == '') {					strMediaCaption = strMediaFile;				}				strResult = strResult + '<p><img src="images/sound.jpg" border=0>&nbsp;<a href=\'Javascript: void window.open("media.htm?id=' + strMediaFile + '","","width=300,height=200,toolbar=0,status=no,scrollbars=no,resizable=no")\' class=thumbcaption>' + strMediaCaption + '</a>';			}			if (strResult !='') {				strResult = "<blockquote class=textbox>" + strResult + '</blockquote>';			}		}		strResult = '<font class=' + Type + '>' + strResult + '</font>';			}		return strResult;}function Thumbnail(PageId,ImageArray,MetaphorImageName,ActiveImagePos) {	var strResult = '';	var strClass  = '';		var UrlImageName    = GetUrlProperty('id');	if (ActiveImagePos != '') {			var ActiveImageName = GetImageProperty(ImageArray,ActiveImagePos,'name');		// alert('active='+ActiveImageName+', meta='+MetaphorImageName);		if ((ActiveImageName == UrlImageName) || ((ActiveImageName == MetaphorImageName) && (UrlImageName ==''))) {			strClass='thumbactive';		} else {			strClass='thumbnormal';		}						var strImageSm = GetImageProperty(ImageArray,ActiveImagePos,'sm');		var strCaption = GetImageProperty(ImageArray,ActiveImagePos,'caption');		strResult  = '<img src="images/' + strImageSm + '" border=0 class=' + strClass + ' title="Show detail">';		if (PageId != '') {			var strLink = '<a href="' + PageId + '.htm?id=' + ActiveImageName + '">';			strResult = strLink + strResult + '</a>';		}		strResult = strResult + '<br><center><font class=thumbcaption>' + strCaption + '</font></center>'			}		return strResult;}function GetImageProperty(ImageArray,CurrentImagePos,Property) {// Property can be:// sm (ie 'sm'all image)// med (ie 'med'ium image)// lg (large image)// caption// text			var strResult = '';		strResult = eval('ImageArray[' + CurrentImagePos + '].' + Property);	return strResult;	}function FindImage(ImageArray,CurrentImageName) {// Find a named image in ImageArray// Note that ImageArray is always dimensioned as one-larger than the number of images, and element[0] is// left blank. This allows us to reference images in javascript using the logical number (eg first image is '1' not '0')// Therefore in this loop, we use "i=1"  not "i=0"	var strResult = "";		for (var i = 1; i < ImageArray.length; i++) {			if (ImageArray[i].name == CurrentImageName) {						strResult = i;					}	}	return strResult;}function GetUrlProperty(Token) {			var Pos = 0;	var TokenValue = '';	var tmpString = new String('&' + location.href + '&');		tmpString = tmpString.replace('?','&');	Token = '&' + Token + '=';	var Pos = tmpString.indexOf(Token,0);		if (Pos >= 0) {		Pos = Pos + Token.length;		var Pos2 = tmpString.indexOf('&',Pos+1);		if (Pos2 >=0) {			TokenValue = tmpString.substring(Pos,Pos2);		}	}		return TokenValue;}