/*
		VALIDATION FUNCTIONS
*/
var mychar = "" ;

function notNull(str) {
        if (str.length == 0 )
                return false;
        else ;
                return true;
}

// checks if string is all digits
function isDigits(str) 
{
	var i;
	var boolIsDigits = true;
	var decimalCount = 0;
	for (i = 0; i < str.length && boolIsDigits; i++) 
	{
		mychar = str.charAt(i);
		// If the character is not numeric...
        if (mychar < "0" || mychar > "9")
        {
			// Check to see if it is the first character
			// and a "negative" sign
			if (i > 0 || mychar != "-")
			{
				// Check to see whether this is a decimal
				if(mychar != ".") 
				{
					boolIsDigits = false;
				}
				else
				{
					decimalCount++;
					//Check to make sure we don't have more than one decimal
					if (decimalCount > 1) boolIsDigits = false;
				}//End check for decimal
			}//End check for "-" sign
		}//End check for digit
	}// End for loop -- done with string
    return boolIsDigits;
}

// strips non digits from a string
function stripNonDigits(str) {
        var i;
        var newstring = "";
        for (i = 0;  i < str.length; i++) {
                mychar = str.charAt(i);
                if (isDigits(mychar))
                        newstring += mychar;
        }
        return newstring;
}
