function checkToxicitySearch(){
	var msg = "";
	var toxTypeSelected = false;
	var validRange = false;

	if (document.getElementById('toxType').value != 'None'){
		toxTypeSelected = true;
	}
	else {
		msg = "Please select a Type of Toxicity Value.";
	}

	if (minValue() && maxValue()){
		minVal = document.getElementById('toxMin').value * 10^document.getElementById('measureType').value;
		maxVal = document.getElementById('toxMax').value * 10^document.getElementById('measureType2').value;
		if (minVal <= maxVal){
			validRange = true;
		}
		else {
			txt = "The minimum value entered is greater than the maximum value.  Please enter a valid range.";
			if (msg == ''){
				msg = txt;
			}
			else {
				msg = msg + "\n\n" + txt;
			}
		}
	}
	else {
		txt = "Please enter a valid minimum to maximum range of Toxicity Values.";
		if (msg == ''){
			msg = txt;
		}
		else {
			msg = msg + "\n\n" + txt;
		}
	}

	if (toxTypeSelected && validRange){
		return true;
	}
	else {
		alert(msg);
		return false;
	}
}

function minValue(){
	isValid = true;
	toxVal = document.getElementById('toxMin').value;
	if (toxVal == '' || !(isNumeric(toxVal))){
		isValid = false;
	}
	if (document.getElementById('measureType').value == ''){
		isValid = false;
	}

	return isValid;
}

function maxValue(){
	isValid = true;
	toxVal = document.getElementById('toxMin').value
	if (toxVal == '' || !(isNumeric(toxVal))){
		isValid = false;
	}
	if (document.getElementById('measureType2').value == ''){
		isValid = false;
	}

	return isValid;
}

function isNumeric(sText){
	var ValidChars = "0123456789.";
	var IsNumber=true;
	var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++){
		Char = sText.charAt(i);
		if (ValidChars.indexOf(Char) == -1){
			IsNumber = false;
		}
	}
	return IsNumber;
}