<!--
//This file is used to contain common validation routines

//NPL - July 22, 2002 The following line is placed here to determine if the current form as passed FDA permission checks
var blnPassedFDACheck=false;


//DJS - Jan 22, 2004: formatting to decimal places
//Taken from JavaScript Bible (p.569)
function numberFormat(numValue, decPlaces){
	if (numValue != '')
	{
		var strValue = "" + Math.round(eval(numValue) * Math.pow(10, decPlaces))
			
		while (strValue.length <= decPlaces){
			strValue = "0" + strValue;
		}
	
		var decPoint = strValue.length - decPlaces;
		return strValue.substring(0, decPoint) + "." + strValue.substring(decPoint, strValue.length);
	}
	return 0;	
}
	

	
//DJS - January 24, 2002: Added here as every page needs it
//Check maxlength of Description TEXTAREA Fields and eliminating hard returns
function Entering(event, strField, strErrorDescription){	
	var strValue
	var charKeyCode = (navigator.appName == "Netscape") ? event.which : event.keyCode
	
	//Only allowing 255 characters to be entered in Description fields
	strValue = strField.value;
	if (strValue.length > 255){	
		strField.value=strValue.slice(0,-(strValue.length-255));
		
		//DHemeon - Bug #DFT00007751 - Feb.05, 2002
		//Set background color to red
		document.frmFields.txtDisplay.style.backgroundColor='#C00000';
		//Set font to be bold
		document.frmFields.txtDisplay.style.fontWeight='bold';
		//Set forecolor to white
		document.frmFields.txtDisplay.style.color='#FFFFFF';
		//On error move focus to the txtDisplay
		onMainTabClick("status");
		//Display message
		window.document.frmFields.txtDisplay.value=strErrorDescription;
			
	}

	//Trapping for Enter key...not allowed in Description fields		
	switch(charKeyCode){
		case 13:	//Enter key
			strField.value = strField.value.replace(/\r\n/g, "");
				
			return false;
			break
		default:
			return true;
	}	
				
	return true;
}

function CurrencyCheck(strNumber, strBeforeLength, strAfterLength, strAllowNegative, strError, strDollarSign){
	// DECRIPTION:		This function checks to make sure number entered meets business rules for currency
	// AUTHOR:			David Snook
	// DATE:			July 30, 2001
	// PARAMETERS:		strNumber - the number to validate
	//					strBeforeLength - the number of places allowed before the decimal
	//					strAfterLength - the number of places allowed before the decimal
	//					strAllowNegative - whether or not negatives are allowed/present
	//					strError - an error to display if function fails
	// RETURN			true = passed; false = failed
	// COMMENTS:	

	var strBefore
	var strAfter
	var strDecimalLocation
	var strSecondDecimalLocation
	
	//These will have to be changed based on User Profile settings
	var strDecimalSeparator = ".";
	var strDigitSeparator = ",";
	var temp
	var pos
	var out
	var add
	
	if(strDollarSign==""){
		strDollarSign = "$";
	}
		
	//Strip out all digit separators!!!!
	out = strDigitSeparator; // replace this
	add = ""; // with empty string
	temp = "" + strNumber; // temporary holder
	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}
	strNumber = temp;
	//strNumber should now have all digit separators stripped off...SQL Server would do this anyway with decimal datatypes!
	
	//Now get rid of dollar sign...have no idea where it might be so strip it off it anywhere...may have to revisit
	out = strDollarSign; // replace this
	add = ""; // with empty string
	temp = "" + strNumber; // temporary holder
	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}
	strNumber = temp;
	
	//Now see if the vlaue that is left is a number
	//DJS - Oct 30, 2007: CAS-37929 - russian decimal sep causes isNaN check to fail so we had to rewrite this
	var num = "";
	for (x = 0; x < strNumber.length; x++){
		num = strNumber.substring(x, x + 1);
		if (num != strDecimalSeparator && isNaN(num)){
			DisplayError(strError);
			return false;
		}			
	}
	
	//see if minus sign is present when business say not to allow it
	if (strAllowNegative == "false"){
		if (strNumber.indexOf("-") != -1){
			//negative sign was found and business rules do not allow it!
			DisplayError(strError);
			return false;
		}
	}
	
	//Get position of decimal
	strDecimalLocation = strNumber.indexOf(strDecimalSeparator);
	if (strDecimalLocation > -1){
		//One decimal is allowed but 2 are not so check to see if a second one is present
		//strSecondDecimalStartPosition = strDecimalLocation + 1;
		strSecondDecimalLocation = strNumber.indexOf(strDecimalSeparator, strDecimalLocation + 1);
		if (strSecondDecimalLocation > -1){
			//A second decimal was found!
			DisplayError(strError);
			return false;
		}
	
		//Store strings into variables
		if (strAllowNegative == "true"){
			if (strNumber.charAt(0) == "-"){
				if (strDecimalLocation != -1){
					strBefore = strNumber.slice(1, strDecimalLocation);
					strAfter = strNumber.slice(strDecimalLocation + 1);	
				}else{
					strBefore = strNumber.slice(1);
					strAfter = "";	
				}
			}else{
				if (strDecimalLocation != -1){
					strBefore = strNumber.slice(0, strDecimalLocation);
					strAfter = strNumber.slice(strDecimalLocation + 1);	
				}else{
					strBefore = strNumber.slice(0);
					strAfter = "";	
				}
			}
		}else{
			if  (strDecimalLocation != -1){
				strBefore = strNumber.slice(0, strDecimalLocation);
				strAfter = strNumber.slice(strDecimalLocation + 1);	
			}else{
				strBefore = strNumber.slice(0);
				strAfter = "";	
			}
		}
		
		//Now make sure decimal place is OK with number of places before the decimal
		if (strBefore.length > strBeforeLength){
			//Too many characters before the decimal
			DisplayError(strError);
			return false;
		}
		
		//Now make sure decimal place is OK with number of places after the decimal
		if (strAfter.length > strAfterLength){
			//Too many characters after the decimal
			DisplayError(strError);
			return false;
		}
		
	}else{
		//If we get here then no decimal was present so we only need to check character length before 
		//Now make sure decimal place is OK with number of places before the decimal
		if (strAllowNegative == "true"){
			if (strNumber.charAt(0) == "-"){
				if (strDecimalLocation != -1){ 
					strBefore = strNumber.slice(1, strDecimalLocation);
					strAfter = strNumber.slice(strDecimalLocation + 1);	
				}else{
					strBefore = strNumber.slice(1);
					strAfter = "";	
				}
			}else{
				if (strDecimalLocation != -1){
					strBefore = strNumber.slice(0, strDecimalLocation);
					strAfter = strNumber.slice(strDecimalLocation + 1);	
				}else{
					strBefore = strNumber.slice(0);
					strAfter = "";
				}
			}
		}else{
			if (strDecimalLocation != -1){
				strBefore = strNumber.slice(0, strDecimalLocation);
				strAfter = strNumber.slice(strDecimalLocation + 1);	
			}else{
				strBefore = strNumber.slice(0);
				strAfter = "";	
			}
		}

		if (strBefore.length > strBeforeLength){
			//Too many characters
			DisplayError(strError); 
			return false;
		}
	}
		
	return true;



}


function NumericCheck(strNumber, strBeforeLength, strAfterLength, strAllowNegative, strError){
	// DECRIPTION:		This function checks to make sure number entered meets business rules
	// AUTHOR:			David Snook
	// DATE:			July 4, 2001
	// PARAMETERS:		strNumber - the number to validate
	//					strBeforeLength - the number of places allowed before the decimal
	//					strAfterLength - the number of places allowed before the decimal
	//					strAllowNegative - whether or not negatives are allowed/present
	//					strError - an error to display if function fails
	// RETURN			true = passed; false = failed
	// COMMENTS:	

	var strBefore
	var strAfter
	var strDecimalLocation
	var strSecondDecimalLocation
	
	//These two will have to be changed based on User Profile settings
	var strDecimalSeparator = ".";
	var strDigitSeparator = ",";
	var temp
	var pos
	var out
	var add
	//Strip out all digit separators!!!!
	out = strDigitSeparator; // replace this
	add = ""; // with empty string
	temp = "" + strNumber; // temporary holder
	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}
	strNumber = temp;
	//strNumber should now have all digit separators stripped off...SQL Server would do this anyway with decimal datatypes!
	
	//Now see if the value that is left is a number
	//DJS - Oct 30, 2007: CAS-37929 - russian decimal sep causes isNaN check to fail so we had to rewrite this
	var num = "";
	for (x = 0; x < strNumber.length; x++){
		num = strNumber.substring(x, x + 1);
		if (num != strDecimalSeparator && isNaN(num)){
			DisplayError(strError);
			return false;
		}			
	}
	
	//see if minus sign is present when business say not to allow it
	if (strAllowNegative == "false"){
		//if (strNumber.charAt(0) == "-"){
		if (strNumber.indexOf("-") != -1){
			//negative sign was found and business rules do not allow it!
			DisplayError(strError);
			return false;
		}
	}
	
	//Get position of decimal
	strDecimalLocation = strNumber.indexOf(strDecimalSeparator);
	if (strDecimalLocation > -1){
		//One decimal is allowed but 2 are not so check to see if a second one is present
		//strSecondDecimalStartPosition = strDecimalLocation + 1;
		strSecondDecimalLocation = strNumber.indexOf(strDecimalSeparator, strDecimalLocation + 1);
		if (strSecondDecimalLocation > -1){
			//A second decimal was found!
			DisplayError(strError);
			return false;
		}
	
		//Store strings into variables
		if (strAllowNegative == "true"){
			if (strNumber.charAt(0) == "-"){
				if (strDecimalLocation != -1){
					strBefore = strNumber.slice(1, strDecimalLocation);
					strAfter = strNumber.slice(strDecimalLocation + 1);	
				}else{
					strBefore = strNumber.slice(1);
					strAfter = "";	
				}
			}else{
				if (strDecimalLocation != -1){
					strBefore = strNumber.slice(0, strDecimalLocation);
					strAfter = strNumber.slice(strDecimalLocation + 1);	
				}else{
					strBefore = strNumber.slice(0);
					strAfter = "";	
				}
			}
		}else{
			if  (strDecimalLocation != -1){
				strBefore = strNumber.slice(0, strDecimalLocation);
				strAfter = strNumber.slice(strDecimalLocation + 1);	
			}else{
				strBefore = strNumber.slice(0);
				strAfter = "";	
			}
		}
		
		//Now make sure decimal place is OK with number of places before the decimal
		if (strBefore.length > strBeforeLength){
			//Too many characters before the decimal
			DisplayError(strError);
			return false;
		}
		
		//Now make sure decimal place is OK with number of places after the decimal
		if (strAfter.length > strAfterLength){
			//Too many characters after the decimal
			DisplayError(strError);
			return false;
		}
		
	}else{
		//If we get here then no decimal was present so we only need to check character length before 
		//Now make sure decimal place is OK with number of places before the decimal
		if (strAllowNegative == "true"){
			if (strNumber.charAt(0) == "-"){
				if (strDecimalLocation != -1){ 
					strBefore = strNumber.slice(1, strDecimalLocation);
					strAfter = strNumber.slice(strDecimalLocation + 1);	
				}else{
					strBefore = strNumber.slice(1);
					strAfter = "";	
				}
			}else{
				if (strDecimalLocation != -1){
					strBefore = strNumber.slice(0, strDecimalLocation);
					strAfter = strNumber.slice(strDecimalLocation + 1);	
				}else{
					strBefore = strNumber.slice(0);
					strAfter = "";
				}
			}
		}else{
			if (strDecimalLocation != -1){
				strBefore = strNumber.slice(0, strDecimalLocation);
				strAfter = strNumber.slice(strDecimalLocation + 1);	
			}else{
				strBefore = strNumber.slice(0);
				strAfter = "";	
			}
		}

		if (strBefore.length > strBeforeLength){
			//Too many characters
			DisplayError(strError); 
			return false;
		}
	}
		
	return true;
}


//To display error message in Status Caption
//David Snook
//July 24, 2001
function DisplayError(strError){	
	document.forms[0].txtDisplay.style.backgroundColor='#C00000';
	document.forms[0].txtDisplay.style.fontWeight='bold';
	document.forms[0].txtDisplay.style.color='#FFFFFF';
	onMainTabClick("status"); 
	document.forms[0].txtDisplay.value = ""+strError+"";
	return false;
}

//Move to the Status Caption field
//David Snook
//July 24, 2001
function onMainTabClick(strHash){	
	var strTitle 
	strTitle = document.title;
	window.location.hash = strHash;
	document.title=""+strTitle+"";
	return false;
}



//For number validation --- called from onSave()
//Pete Sibley
//function checkNumeric(frmForm,fldField,strMsg,allowNegative){
//	if (document.forms[frmForm].elements[fldField].value != "") {
//		if (isNaN(document.forms[frmForm].elements[fldField].value * 1)) {
//			//Set background color to red
//			document.frmFields.txtDisplay.style.backgroundColor='#C00000';
//			//Set font to be bold
//			document.frmFields.txtDisplay.style.fontWeight='bold';
//			//Set forecolor to white
//			document.frmFields.txtDisplay.style.color='#FFFFFF';
//			//Display message
//			onMainTabClick("status");
//			document.frmFields.txtDisplay.value=strMsg + "<%=Session("strMessage")(1,1)%>";
//			return false;
//		}else{
//			if(allowNegative==false){
//				if ((document.forms[frmForm].elements[fldField].value * 1) < 0){
//					//Set background color to red
//					document.frmFields.txtDisplay.style.backgroundColor='#C00000';
//					//Set font to be bold
//					document.frmFields.txtDisplay.style.fontWeight='bold';
//					//Set forecolor to white
//					document.frmFields.txtDisplay.style.color='#FFFFFF';
//					//Display message
//					onMainTabClick("status");
//					document.frmFields.txtDisplay.value=strMsg + "<%=Session("strMessage")(1,330)%>";
//					return false;
//				}
//			}
//		}
//	}
//	return true;
//}

//check for empty required fields
//Pete Sibley
function checkEmpty(frmForm,fldField,strMsg){	
	if (document.forms[frmForm].elements[fldField].value == "") {
		//Set background color to red
		document.frmFields.txtDisplay.style.backgroundColor='#C00000';
		//Set font to be bold
		document.frmFields.txtDisplay.style.fontWeight='bold';
		//Set forecolor to white
		document.frmFields.txtDisplay.style.color='#FFFFFF';
		//Display message
		onMainTabClick("status");
		document.frmFields.txtDisplay.value=strMsg;
		return false;
	}
	return true;
}

function refreshSubtab(strStatus){
// DECRIPTION:		This function checks to see if close status is Y and 
//					if a subtab opener window exists before refreshing the subtab
//					and closing the window.
// AUTHOR:			Pete Sibley
// DATE:			Aug 8 2001
// PARAMETERS:		strStatus = the status value passed from checkCloseStatus function

	//This is a workaround for IE 5.0 and earlier
	//Without this, app will crash when checking value of opener.closed below
	var openerClosed;
		if ((opener != null) && (opener.closed)) {
			openerClosed = true;
		} else {
			openerClosed = false;
		}
		
	if (strStatus=="Y"){
		if (window.document.frmFields.txtDisplay.value == ""){
			if (opener && !openerClosed){
				window.opener.focus();
				window.opener.document.frmHidden.submit();
			}
			self.close();
		}
	}
	return;
}


/*
function isNumeric(varInput){
// DECRIPTION:		This function checks to see if an incoming is numeric
// AUTHOR:			Carolyn Norberg
// DATE:			Feb 15th 2000
// PARAMETERS:		varInput = the value you wish to check
// RETURN			true means value is numeric  false means it is not a number
// COMMENTS:	

oneDecimal=false;
strInput=varInput.toString();
	for (var i=0; i<strInput.length; i++){
		var oneChar=strInput.charAt(i);
			if (i == 0 && oneChar == "-"){
				continue;
			}
			
			if (oneChar=="." && !oneDecimal){
				oneDecimal=true;
				continue;
			}
			
			if (oneChar< "0" || oneChar >"9"){
				return false;
			}
	
	return true;
	} 
	return false;
}
*/

function openConnectToSite(){


		
		var strSites=window.document.frmFields.txtHiddenSites.value;
		var strCurrentlyLoggedInSite = window.document.frmFields.txtHiddenLoggedSite.value;
		//DJS - October 25, 2001: If no sites other than Currently logged in site is selected, then no need to go to "Connect To Site" page
		if (strSites == strCurrentlyLoggedInSite){
			//Need to trigger submit instead of going to other window first
			window.document.frmFields.submit();
			return true;
		}
		
		window.open("ConnectToSite.asp?Sites="+strSites+"","wndConnectToSite","Height=360,Width=600,scrollbars, status")
		return true;	
}

function ProhibitCharCheck(strString, strProhibitedChar, strError){
// DECRIPTION:		This function checks to see if the string contains any prohibited characters
// AUTHOR:			Neil Locke
// DATE:			Jan 21, 2002
// PARAMETERS:	
	
	var strCharacter;
	
	//if value is empty then exit sub
	if (strString==""){
		return true;
	}
	
	strProhibitedChar = strProhibitedChar.replace("&quot;","\"");
	
	for (var lngCount = 0; lngCount < (strProhibitedChar.length); lngCount++){	
		strCharacter = strProhibitedChar.charAt(lngCount);
		if (strString.indexOf(strCharacter)!=-1){
			DisplayError(strError);
			return false;
		}
	}
	return true;
}

function CheckSpecialCharacters(strString){
// DECRIPTION:		This function checks to see if the string contains any special characters.
// AUTHOR:			Dwayne Hemeon
// DATE:			Jan 29, 2002
// PARAMETERS:	    strString - String value.
// RETURNS:			Manipulated string with the proper special characters.
//Check for special characters for the value passed in.
		//Do not change the order of validation - Very Important.
		//Check for "%".
		strString=strString.replace(/\%/g,"%25");   
		//Check for "&".
		strString=strString.replace(/\&/g,"%26");
		//Check for "#".
		strString=strString.replace(/\#/g,"%23"); 
		//Check for """.
		strString=strString.replace(/\"/g,"&quot;");  
		//Check for "'".
		strString=strString.replace(/\'/g,"%27");
return strString;
}		


//Form Navigation
//Move First
function OnMoveFirst(strMessage){
	if (window.document.frmFields.txtPKEY.value == ""){
		document.frmFields.txtToolbar.focus();
		return false;
	}
	
	if (window.document.frmFields.txtRecordNumber.value=="1"){
		window.document.frmFields.txtDisplay.value=strMessage;
		onMainTabClick("status"); 
		return false;
	}

	window.document.frmFields.txtMoveToAP.value = "1";
	window.document.frmFields.txtHiddenNav.value = "F";
	window.document.frmFields.submit();
	return false;
}

//Move Previous
function OnMovePrevious(strMessage){
	var lngAP
	if (window.document.frmFields.txtPKEY.value == ""){
		document.frmFields.txtToolbar.focus();
		return false;
	}
	
	if (window.document.frmFields.txtRecordNumber.value=="1"){
		window.document.frmFields.txtDisplay.value=strMessage;
		onMainTabClick("status"); 
		return false;
	}

	lngAP=(window.document.frmFields.txtRecordNumber.value * 1) - 1;
	if (lngAP < 1){
		lngAP = 1;
	}
		
	window.document.frmFields.txtMoveToAP.value = lngAP;
	window.document.frmFields.txtHiddenNav.value = "P";
	window.document.frmFields.submit();
	return false;
}

//Move Next
function OnMoveNext(strMessage){
	var lngAP
	if (window.document.frmFields.txtPKEY.value == ""){
		document.frmFields.txtToolbar.focus();
		return false;
	}

	lngAP=(window.document.frmFields.txtRecordNumber.value * 1) + 1;
	if (lngAP > (window.document.frmFields.txtLastAP.value * 1)){
		lngAP = (window.document.frmFields.txtLastAP.value * 1);
		window.document.frmFields.txtDisplay.value=strMessage;
		onMainTabClick("status"); 
		return false;
	}
		
	window.document.frmFields.txtMoveToAP.value = lngAP;
	window.document.frmFields.txtHiddenNav.value = "N";
	window.document.frmFields.submit();
	return false;
}

//Move Last
function OnMoveLast(strMessage){
	var lngAP
	if (window.document.frmFields.txtPKEY.value == ""){
		document.frmFields.txtToolbar.focus();
		return false;
	}
	
	if (window.document.frmFields.txtRecordNumber.value==window.document.frmFields.txtLastAP.value){
		window.document.frmFields.txtDisplay.value=strMessage;
		onMainTabClick("status"); 
		return false;
	}
	
	lngAP = (window.document.frmFields.txtLastAP.value * 1);
	window.document.frmFields.txtMoveToAP.value = lngAP;
	window.document.frmFields.txtHiddenNav.value = "L";
	window.document.frmFields.submit();
	return false;
}

//The following is Filter validation
//Validate the filter 
//DJS - Jan 28, 2004: added strCont param
function ValidFilterCheck(strGenError, strOpToPropError, strValToPropError, strValToOpError, strCont){

	//Get all values currently selected on form
	var strProperty;
	var strDatatype;
	var strOperator;
	var strValue;
	
	//First Row
	strProperty = window.document.forms[0].cboFieldName1.value.substr(0,window.document.forms[0].cboFieldName1.value.indexOf("/"));
	strDatatype = window.document.forms[0].cboFieldName1.value.substr(window.document.forms[0].cboFieldName1.value.indexOf("/")+1);
	strOperator = window.document.forms[0].cboOperator1.value;
	strValue = window.document.forms[0].txtValue1.value;
	
	if (strProperty != ""){
		if (! CheckFilterRow(" 1", strDatatype, strOperator, strValue, strGenError, strOpToPropError, strValToPropError, strValToOpError, strCont, strProperty)){
			return false;
		}
	}
	
	//Second Row
	strProperty = window.document.forms[0].cboFieldName2.value.substr(0,window.document.forms[0].cboFieldName2.value.indexOf("/"));
	strDatatype = window.document.forms[0].cboFieldName2.value.substr(window.document.forms[0].cboFieldName2.value.indexOf("/")+1);
	strOperator = window.document.forms[0].cboOperator2.value;
	strValue = window.document.forms[0].txtValue2.value;
	
	if (strProperty != ""){
		if (! CheckFilterRow(" 2", strDatatype, strOperator, strValue, strGenError, strOpToPropError, strValToPropError, strValToOpError, strCont, strProperty)){
			return false;
		}
	}
	
	//Third Row
	strProperty = window.document.forms[0].cboFieldName3.value.substr(0,window.document.forms[0].cboFieldName3.value.indexOf("/"));
	strDatatype = window.document.forms[0].cboFieldName3.value.substr(window.document.forms[0].cboFieldName3.value.indexOf("/")+1);
	strOperator = window.document.forms[0].cboOperator3.value;
	strValue = window.document.forms[0].txtValue3.value;
	
	if (strProperty != ""){
		if (! CheckFilterRow(" 3", strDatatype, strOperator, strValue, strGenError, strOpToPropError, strValToPropError, strValToOpError, strCont, strProperty)){
			return false;
		}
	}
	
	return true;
}

//Check the filter row
//DJS - Jan 28, 2004: added strCont & strProperty params
function CheckFilterRow(strRowNumber, strDatatype, strOperator, strValue, strGenError, strOpToPropError, strValToPropError, strValToOpError, strCont, strProperty){
		
	//Boolean datatype allows only "Equals" operator
	//value must be 0 or 1
	if (strDatatype=="11"){
		//if the operator is ""
		if (strOperator==""){
			DisplayError(strGenError+strRowNumber+"\r\n"+strOpToPropError); 
			return false;
		}
		else if (strOperator!="0"){
			DisplayError(strGenError+strRowNumber+"\r\n"+strValToOpError); 
			return false;
		}
		else{
			if (strValue!="0" && strValue!="1"){
				DisplayError(strGenError+strRowNumber+"\r\n"+strValToOpError); 
				return false;
			}
		}
	}
		
	//String datatype allows all operators
	//Must contain a value unless operator is "Is Blank" - 6 or "Is Not Blank" - 7
	if (strDatatype=="8"){
		//The only error that can occur as a result of the operator is if it is ""
		if (strOperator==""){
			DisplayError(strGenError+strRowNumber+"\r\n"+strOpToPropError); 
			return false;
		}
		else if ((strOperator=="6")||(strOperator=="7")){
			if (strValue!=""){
				DisplayError(strGenError+strRowNumber+"\r\n"+strValToOpError); 
				return false;
			}
		}
		else{
			if (strValue==""){
				DisplayError(strGenError+strRowNumber+"\r\n"+strValToOpError); 
				return false;
			}
		}
	}
	
	
	//Date datatype allows all operators except "Begins With", "Contains", "Does Not Contain"
	//Must contain a value unless operator is "Is Blank" - 6 or "Is Not Blank" - 7
	else if (strDatatype=="7"){
		//The only error that can occur as a result of the operator is if it is ""
		if ((strOperator=="")||(strOperator=="10")||(strOperator=="11")||(strOperator=="8")||(strOperator=="9")){
			DisplayError(strGenError+strRowNumber+"\r\n"+strOpToPropError); 
			return false;
		}
		else if ((strOperator=="6")||(strOperator=="7")){
			if (strValue!=""){
				DisplayError(strGenError+strRowNumber+"\r\n"+strValToOpError); 
				return false;
			}
		}
		else{
			if (strValue==""){
				DisplayError(strGenError+strRowNumber+"\r\n"+strValToOpError); 
				return false;
			}
		}
		//if (! isDate(strValue){
		//	DisplayError(strGenError+strRowNumber+"\r\n"+strValToPropError);
		//	return false;
		//}
	}
	
	
	//Numeric datatype allows all operators except "Begins With", "Contains", "Does Not Contain"
	//Must contain a value unless operator is "Is Blank" - 6 or "Is Not Blank" - 7
	else if ((strDatatype=="6")||(strDatatype=="14")||(strDatatype=="5")||(strDatatype=="2")||(strDatatype=="3")||(strDatatype=="4")){
		//DJS - Jan 28, 2004
		if (strCont.toUpperCase() == "WORK_REQUESTS_DISPLAY_CONTAINER" && strProperty.toUpperCase() == "status".toUpperCase()){
			var strOutstanding = window.document.forms[0].txtHiddenOutstandingRequest.value;
			var strWorkOrderCreated = window.document.forms[0].txtHiddenWorkOrderCreated.value;
			var strWorkOrderDuplicate = window.document.forms[0].txtHiddenWorkOrderDuplicate.value;
			var strNotApproved = window.document.forms[0].txtHiddenNotApproved.value;
			var strResolved = window.document.forms[0].txtHiddenResolved.value;
					
			if ((strValue.toUpperCase()!=strOutstanding.toUpperCase()) && (strValue.toUpperCase()!=strWorkOrderCreated.toUpperCase()) && (strValue.toUpperCase()!=strWorkOrderDuplicate.toUpperCase()) && (strValue.toUpperCase()!=strNotApproved.toUpperCase()) && (strValue.toUpperCase()!=strResolved.toUpperCase())){
				DisplayError(strGenError+strRowNumber+"\r\n"+strValToPropError);
				return false;
			}
		
		}else{
			//The only error that can occur as a result of the operator is if it is ""
			if ((strOperator=="")||(strOperator=="10")||(strOperator=="11")||(strOperator=="8")||(strOperator=="9")){
				DisplayError(strGenError+strRowNumber+"\r\n"+strOpToPropError); 
				return false;
			}
			else if ((strOperator=="6")||(strOperator=="7")){
				if (strValue!=""){
					DisplayError(strGenError+strRowNumber+"\r\n"+strValToOpError); 
					return false;
				}
			}
			else{
				if (strValue==""){
					DisplayError(strGenError+strRowNumber+"\r\n"+strValToOpError); 
					return false;
				}
			}
			
			if (isNaN(strValue)){
				DisplayError(strGenError+strRowNumber+"\r\n"+strValToPropError);
				return false;
			}
		
		}
	}
	
	return true;
}


//-->