<!--
function isFieldBlank(theField) {

	if (theField.value.length == 0)
		return true;
	else
		return false;
}

function isFieldExceed(theField,Size) {

	if (theField.value.length > Size)
		return true;
	else
		return false;
}

function checkDate(theDay,theMonth,theYear) {
   if((theMonth.selectedIndex == 1 || theMonth.selectedIndex == 3 || theMonth.selectedIndex == 5 || theMonth.selectedIndex == 8 || theMonth.selectedIndex == 10) && theDay.selectedIndex == 30)
   {alert("There is no 31th for this month. Please change the date.")
   theDay.focus()
   return false}

   if(theMonth.selectedIndex == 1 && (theDay.selectedIndex == 29 || theDay.selectedIndex == 28))
   {switch (theDay.selectedIndex){
		case 29 :
		{alert("There is no 30th of February. Please change the date.");break}
		case 28 :
		{if (parseInt(theYear[theYear.selectedIndex].value) % 4 == 0) return true
		 else {alert("There is no 29th of February this year. Please change the date.");break}
		}
   }	 
   theDay.focus()
   return false }

   return true
}

function checkDate2(theDay,theMonth,theYear) {
   if((theMonth.selectedIndex == 2 || theMonth.selectedIndex == 4 || theMonth.selectedIndex == 6 || theMonth.selectedIndex == 9 || theMonth.selectedIndex == 11) && theDay.selectedIndex == 31)
   {alert("There is no 31th for this month. Please change the date.")
   theDay.focus()
   return false}

   if(theMonth.selectedIndex == 2 && (theDay.selectedIndex == 30 || theDay.selectedIndex == 29))
   {switch (theDay.selectedIndex){
		case 30 :
		{alert("There is no 30th of February. Please change the date.");break}
		case 29 :
		{if (parseInt(theYear[theYear.selectedIndex].value) % 4 == 0) return true
		 else {alert("There is no 29th of February this year. Please change the date.");break}
		}
   }	 
   theDay.focus()
   return false }

   return true
}

function isFieldEmail(theField) {
    var re = /\w+@(\w+[-]*)+[.]\w+/;
    if (!isFieldBlank(theField)){
    if (!re.test(theField.value)){
        alert("Please enter your E-mail address in the format 'userid@address.domain' .");
         theField.focus()
         return false }       
    }    
    return true
}

function isFieldNumeric(theField) {
    if (!isFieldBlank(theField)){
    if (isNaN(theField.value)){
         {alert("This field accepts only numbers.")
         theField.focus()
         return false }       
        } 
    }    
    return true
}

function isFieldPhone(theField) {
    phone="1234567890- "
    if (!isFieldBlank(theField)){
    for (i=0;i<theField.value.length;i++) {
    if (phone.indexOf(theField.value.charAt(i)) == -1){
         {alert("This field accepts only phone numbers.")
         theField.focus()
         return false }       
        } 
    }}    
    return true
}

function isFieldNegative(theField) {
    if (Math.abs(theField.value) != theField.value){
         {alert("This field accepts only positive numbers.")
         theField.focus()
         return true }       
        }
    return false
}

function checkDecimal(theField,places,positive) {
    if (!isFieldBlank(theField)){
    if (isFieldNumeric(theField)){
       if (positive == "true") {if (isFieldNegative(theField)) return false}
       var decimal = theField.value.substr(theField.value.indexOf("."))
	   if ((decimal.length > places + 1) && decimal.length != theField.value.length)
			{alert ("This number allows up to " + places + " decimal places only.")
			theField.focus()
			return false 
       }
    }    
    else {return false}
    }    
    return true
}

function isFieldWhole(theField,positive) {
    if (!isFieldBlank(theField)){
	if (isFieldNumeric(theField)) {
        if (positive == "true") {if (isFieldNegative(theField)) return false}
		if (Math.round(theField.value) != parseFloat(theField.value))
		{alert("This field accepts whole numbers only.")
		 theField.focus()
		 return false
		}
	}
	else {return false}
	}
	return true
}

//-->