/*
* COPYRIGHT 2011 Jobvite, Inc. All rights reserved. This copyright notice is Copyright Management 
* Information under 17 USC 1202 and is included to protect this work and deter copyright infringement.  
* Removal or alteration of this Copyright Management Information without the express written permission 
* of Jobvite, Inc. is prohibited, and any such unauthorized removal or alteration will be a violation of 
* federal law.
*/
function intInputLen(o,l)
{
	var s = o.value;
	var n = '';
	var i;
	for (i = 0; i < s.length && i < l; i++)
	{
		var c = s.charAt(i);
		if (c >= '0' && c <= '9')
			n += c;
	}
	if (o.value != n)
	{
		o.value = n;
		if (n.length == l)
		{
			var p = o.parentNode;
			while (p && p.tagName != 'FORM')
				p = p.parentNode;
			if (p)
			{
				for (i = 0; i < p.elements.length; i++)
				{
					if (o == p.elements[i])
					{
						if (i < p.elements.length - 1 && p.elements[i + 1].type != 'hidden')
							p.elements[i + 1].focus();
						else if (p.elements[0].type != 'hidden')
							p.elements[0].focus();
						break;
					}
				}
			}
		}
	}
}

function intInput(o) {
    intInputLen(o, o.size);
}

function phoneInput(o)
{
	return;
	var s = o.value;
	var n = '';
	var i;
	for (i = 0; i < s.length && i < o.size; i++)
	{
		var c = s.charAt(i);
		if ((c >= '0' && c <= '9') || c == '+' || c == '(' || c == ')' || c == ' ' || c == '-' || c == '.')
			n += c;
	}
	if (o.value != n)
		o.value = n;
}

function amountInput(o)
{
	var s = o.value;
	var n = '';
	var i;
	for (i = 0; i < s.length && i < o.size; i++)
	{
		var c = s.charAt(i);
		if ((c >= '0' && c <= '9') || c == '$' || c == ',' || c == '.')
			n += c;
	}
	if (o.value != n)
	{
		o.value = n;
		if (n.length == o.size)
		{
			var p = o.parentNode;
			while (p && p.tagName != 'FORM')
				p = p.parentNode;
			if (p)
			{
				for (i = 0; i < p.elements.length; i++)
				{
					if (o == p.elements[i])
					{
						if (i < p.elements.length - 1)
							p.elements[i + 1].focus();
						else
							p.elements[0].focus();
						break;
					}
				}
			}
		}
	}
}

function isAlphaNumeric(s)
{
	var re = /^[\w ]*$/;
	return re.test(s)
}
