function s_Launch(url) {openWin=window.open(url, "launchWin", "width=800,height=600,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");}
function s_LaunchCustom(url, winName, features) {window.open(url, winName, features);}
function s_ToggleDisplay(ToggleElementId){
	var oToggleElement = document.getElementById(ToggleElementId);
	if (oToggleElement.style.display == "block") {
		oToggleElement.style.display = "none"
		if (arguments.length == 4) arguments[1].innerHTML = arguments[2]
	} else {
		oToggleElement.style.display = "block"
		if (arguments.length == 4) arguments[1].innerHTML = arguments[3]
	}
	return false;
} 
/******************* TEXT FIELD VALIDATION *******************/
function s_IsInvalid(field,description,minLen,maxLen) { //Checks if field is between minLen and maxLen; 
	//-1 for minLen will prompt to fill in, but not require a min length.
	//-1 for maxLen allow unlimited characters to be entered.
	if (!field) //If field does not exist, exit
		return false;
    if (minLen==-1 && field.value=="") { alert("Please enter " + description + " before proceeding."); field.focus(); return true; }
  	if (minLen>0 && field.value.length<minLen) { alert("Please enter at least " + minLen + " characters for " + description +"."); field.focus(); return true; }
	if (maxLen>0 && field.value.length>maxLen) { alert("Please enter at most " + maxLen + " characters for " + description +"."); field.focus(); return true; }
	return false;
}
/******************* MENU VALIDATION *******************/
function s_NotSelected(field,description) {
	if (field) {
		if (field.selectedIndex<1) { alert ("Please select one of the \"" + description + "\" options."); field.focus(); return true; }
	}
	return false;
}
/******************* CHECKBOX VALIDATION *******************/
function s_AnyCheck(field,description) {
	if (field){
		var total = 0;
		for (var i = 0; i < field.length; i++) {if (eval(field[i].checked) == true) {total += 1;}}
		if (total==0) {alert("Please choose at least one of the "+ description +" options."); field[0].focus(); return true;}
	}
	return false;
}
/******************** EMAIL VALIDATION ********************/
function isEmpty(s)	// Returns true if string s is Empty
	{ return ( (s == null) || (s.length == 0)) }
function isEmail(s) { // Returns true if string s meets the basic format of an email address
	if (isEmpty(s))
		return false;
	var i = 1;											// Look for @ starting with the second character in s												
	var sLen = s.length;
	while( (i < sLen ) && ( s.charAt(i) != "@" ) ) { i++; }
	if( ( i >= sLen ) || (s.charAt(i) != "@")) 
		return false;
    else 
		i += 2;
	while ((i < sLen) && (s.charAt(i) != ".")) { i++; }	// Look for a dot starting with the second character after the @
	if ((i >= sLen - 1) || (s.charAt(i) != "."))		// There must be at least one character after the dot
		return false;
	else 
		return true;
}
/******************* RETURNS RADIO BUTTON VALUE *******************/
function s_GetRadioButtonValue(radio) { 
	var Value = ""
	if (isNaN(radio.length)) {
		if (radio.checked) Value = radio.value;
	}
	else {
		for (var i = 0; i < radio.length; i++){
			if (radio[i].checked) Value = radio[i].value;
		}
	}
	return Value
}
/******************** RADIO BUTTON VALIDATION ********************/
function s_NoRadioButton(field, description){
	if (isEmpty(getRadioButtonValue(field))) {
		alert("Please choose at least one of the "+ description +" options."); 
		if (isNaN(field.length))
			field.focus(); 
		else 
			field[0].focus(); 
		return true;
	}
	else
		return false;
}
/******************* NUMERIC VALUE VALIDATION *******************/
function s_CheckNumber(Field, Description, MinValue, MaxValue) { // Checks a field to make sure it is numerical and b/t Min and Max values
	if (Field){
		floatValue = parseFloat(Field.value)
		// Min and Max value have been specified
		if ((MinValue > -1 && MaxValue > -1) && (isNaN(floatValue) || (eval(Field.value) < MinValue || eval(Field.value) > MaxValue)))
			{alert("Please enter a numerical value between "+ MinValue +" and "+ MaxValue +" for "+ Description +"."); Field.focus(); Field.select(); return true;}
		// Min value has been set but Max value is null (-1)
		if ((MinValue > -1 && MaxValue == -1) && (isNaN(floatValue) || Field.value < MinValue))
			{alert("Please enter a numerical value greater than "+ MinValue +" for "+ Description +"."); Field.focus(); Field.select(); return true;}
		// Max value has been set but Min value is null (-1)
		if ((MinValue == -1 && MaxValue > -1) && (isNaN(floatValue) || Field.value > MaxValue))
			{alert("Please enter a numerical value less than "+ MaxValue +" for "+ Description +"."); Field.focus(); Field.select(); return true;}
	}
	return false;
}
/******************* CHECK FOR CHECKBOX/RADIO BUTTON SELECTION *******************/
function s_NoSelections(theForm) { // Insures that at least one checkbox or radio button has been selected
	var blnSelection = false
	for (xx=0; xx < theForm.elements.length; xx++){
		if (theForm.elements[xx].checked == true)
			{blnSelection = true; break;}
	}
	if (blnSelection == false) 
		{alert("Please make a selection before proceeding."); return true;}
	return false;
}

