<!--
//Check Values
function trim(str) {
   return( (""+str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') );
}

function noWhiteSpace(s){
	if((s==null)||(typeof(s)!='string')||!s.length)
		return'';return s.replace(/\s+/g,'')
}

function isEmailAddress(email) {
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0) {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function isInteger(s) {
	var i;
    for (i = 0; i < s.length; i++) {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function isNumeric(s) {
	var ValidChars = "0123456789.";
	var IsNumber=true;
	var Char;

	for (i = 0; i < s.length && IsNumber == true; i++) { 
		Char = s.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
			IsNumber = false;
		}
	}
	return IsNumber;
}

function ACT_formFieldDecimalConvertor()
{
	var args = ACT_formFieldDecimalConvertor.arguments;
	var input = args[0];
	var value = input.value;
	value = trim(value);
	input.value = ACT_decimalConvertor(value);
}

function ACT_decimalConvertor(value)
{

	if(value.length==0){
		value = "0.00";
	}	else{	
			var value_array = value.split(".");
			
			if(value_array.length == 1){
				value = noWhiteSpace(value);
				value = parseFloat(value);
				
				if(isNaN(value))
					value = "0";
				
				value = value+".00";
			}
			else if(value_array.length >= 2) {

				value_array[0] = noWhiteSpace(value_array[0]);
				value_array[0] = parseFloat(value_array[0]);
				
				if(isNaN(value_array[0]))
					value_array[0] = "0";				
				
				if(value_array[0].length==0){
					value_array[0] = "0";
				}

				if(!isNumeric(value_array[0]))
					value_array[0]="0";
					
				if(!isNumeric(value_array[1]))
					value_array[1]="0";				

				
					if(value_array[1].length > 2)
						value = parseFloat(value_array[0])+"."+value_array[1].substr(0,2);
					else if(value_array[1].length == 1)
						value = parseFloat(value_array[0])+"."+value_array[1]+"0";
					else if(value_array[1].length == 0)
						value = parseFloat(value_array[0])+"."+value_array[1]+"00";
					else
						value = parseFloat(value_array[0])+"."+value_array[1];
					
			}
		}
	return value;
}

function daysInFebruary (year){
	var day = 28;
	if((year % 4 == 0) && (!(year % 100 == 0) || (year % 400 == 0)))
		day = 29;
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return day;
}
function DaysArray(n) {
	var arr = new Array();
	for (var i = 1; i <= n; i++) {
		arr[i] = 31;
		if (i==4 || i==6 || i==9 || i==11) 
		{
			arr[i] = 30;
		}
		if (i==2) 
		{
			arr[i] = 29;
		}
   } 
   return arr;
}

function isDateBeforeToday(dtStr){
	if(dtStr.length != 10)
		return false;
	
	var date_arr = new Array();
	date_arr = dtStr.split("/");
	if(date_arr.length != 3)
		return false;
	
	var strDay = date_arr[0];
	var strMonth = date_arr[1];
	var strYear = date_arr[2];
	//alert(strDay)
	if(strDay.length != 2 || !isNumeric(strDay))
		return false;
	else {
		if (strDay.charAt(0)=="0") 
			strDay=strDay.substring(1);
	}
	
	if(strMonth.length != 2 || !isNumeric(strMonth))
		return false;
	else {
		if (strMonth.charAt(0)=="0") 
			strMonth=strMonth.substring(1);
	}
	
	if(strYear.length != 4  || !isNumeric(strYear))
		return false;
	
	var daysInMonth = DaysArray(12);
	
	month=parseInt(strMonth);
	day=parseInt(strDay);
	year=parseInt(strYear);
	//alert(month);
	if (month<1 || month>12){
		return false;
	}
	
	if (day<1 || day>31 || day > daysInMonth[month] || (month==2 && day>daysInFebruary(year))){
		return false;
	}
	if (year==0){
		return false;
	}
	var today = new Date();
	var date = new Date();
	date.setFullYear( year, month - 1, day );
	if(date > today)
		return false;
	
	return true;
}

function isDate(dtStr){
	if(dtStr.length != 10)
		return false;
	
	var date_arr = new Array();
	date_arr = dtStr.split("-");
	if(date_arr.length != 3)
		return false;
	
	var strDay = date_arr[0];
	var strMonth = date_arr[1];
	var strYear = date_arr[2];
	
	if(strDay.length != 2 || !isNumeric(strDay))
		return false;
	else {
		if (strDay.charAt(0)=="0") 
			strDay=strDay.substring(1);
	}
	
	if(strMonth.length != 2 || !isNumeric(strMonth))
		return false;
	else {
		if (strMonth.charAt(0)=="0") 
			strMonth=strMonth.substring(1);
	}
	
	if(strYear.length != 4  || !isNumeric(strYear))
		return false;
	
	var daysInMonth = DaysArray(12);
	
	month=parseInt(strMonth);
	day=parseInt(strDay);
	year=parseInt(strYear);
	
	if (month<1 || month>12){
		return false;
	}
	
	if (day<1 || day>31 || day > daysInMonth[month] || (month==2 && day>daysInFebruary(year))){
		return false;
	}
	if (year==0){
		return false;
	}
	
	return true;
}

function isAlphanumerical(s) {
	// allow ONLY alphanumeric keys, no symbols or punctuation
	// this can be altered for any "checkOK" string you desire
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	var checkStr = s;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
	}
	return allValid;
}
   
function resetForm(url) {
	window.location = url;
}
//-->