<!--

function isNumeric(val)
{
    	return(parseFloat(val,10)==(val*1));
}
    
function checknumber(value) 
{
	if (!isNumeric(value))
		return 0;
	else
		return value;
}

function isAlphaNumeric(val)
{
	if (val.match(/^[a-zA-Z0-9/ /-]+$/))
	{		
		return true;
	}
	else
	{
		//alert("Invalid Entry.\nOnly numbers and alphabets are accepted.");
		return false;
	}
}

// check to see if input is whitespace only or empty
function isEmpty(val)
{
	if (val.match(/^s+$/) || val == "")
	{
		return true;
	}
	else
	{
		return false;
	}
}

// check to see if input is number
function isNumber(val)
{
	if (isNaN(val))
	{
		alert("Invalid Number");				
		return 0;
	}
	else
	{
		return val;
	}
	
}

function isNumberRange(val, min, max)
{
	if (isNaN(val))
	{
		alert("Invalid Number");				
		return "";
	}
	else
	{
		if (val >= min && val <= max)
		{
			return val;
		}
		else
		{
			alert("Number out of range");
			return "";
		}
	}
	
}

// check to see if input is alphabetic
function isAlphabetic(val)
{
	if (val.match(/^[a-zA-Z]+$/))
	{
		return true;
	}
	else
	{
		return false;
	}
}


// check to see if value is within range
function isWithinRange(val, min, max)
{
	if (val >= min && val <= max)
	{
		return true;
	}
	else
	{
		return false;
	}
}

// check to see if input is a valid email address
function isEmailAddress(email)
{
	if(email.length<5)	
		return false;
			
	if (email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
	    return true;
	else
		return false;		
}

// check to see if form value is checked
function isChecked(obj)
{
	if (obj.checked)
	{
		return true;
	}
	else
	{
		return false;
	}
}


// display all errors
// iterate through error array and print each item
function displayErrors()
{
	for (x=0; x<this.errorList.length; x++)
	{
		alert("Error: " + this.errorList[x]);
	}
}

// add an error to error list
function raiseError(msg)
{
	this.errorList[this.errorList.length] = msg;
}

// return number of errors in error array
function numErrors()
{
	return this.errorList.length;
}

function chkfileext(filename)
{	
	var ext = filename;	
	ext = ext.substring(ext.length-4,ext.length);
	ext = ext.toLowerCase();	
	if(ext != '.jpg' && ext != 'jpeg')
	{
	   //alert("You have selected an unauthorised file. \nPlease choose .jpg file ONLY.");	    
	   return false;
	}	
	
	return true;
}
// end object
//-->