

		
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(Form,ControlName) {

	
	
	var Selected = Form[ControlName].selectedIndex;
	var strResult = Form[ControlName].options.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;
}
