<!--
	function openPopupWindow(URLtoOpen) {
		bName = navigator.appName;
		bVer = parseInt(navigator.appVersion);
		if((bName == "Netscape" && bVer >= 3) || (bName == "Microsoft Internet Explorer" && bVer >= 4))
			br = "n3";
		else
			br = "n2";
		
		if(br == "n3") {
			newWindow=window.open(URLtoOpen, 'lilone','toolbar=yes,width=300,height=350,left=500,top=300,directories=0,status=0,scrollbars=1,resizable=yes,menubar=0,location=0,copyhistory=0');
		}
	}
	
	/**
	*
	* Closes any existing popups before opening a new one
	* Any new windows will always have focus and you won't "loose" any existing windows
	*
	* Takes url for content and height and width for size of new window
	*/ 
	function popup( URL, width, height )
	{
		try
		{
			popup_window.close();
		}
		catch(e)
		{
					
		}
		
		popup_window=window.open( URL,"_popover","status=no,location=no,menubar=no,toolbar=no,directories=no,resizable=yes,scrollbars=yes,width=430,height=500,screenX=100,screenY=100");	
		window.onerror = null;
}

function parseNumeric(theField) {
	var i = 0;
	var returnString = '';
	var c = '';
	var charsToKeep = '0123456789';
	var s = theField.value;
	while (s.charAt(i) == '-1' || charsToKeep.indexOf(i) == -1)	 i++;
	for (i; i < s.length; i++) {
		c = s.charAt(i);
		if (charsToKeep.indexOf(c) >= 0) returnString += c;
	}
	theField.value = returnString;
	document.forms[0].WP.value = document.forms[0].phone1.value + document.forms[0].phone2.value + document.forms[0].phone3.value;
	focusNextElement(theField);
}

function focusNextElement(theField){

	// automatically tab to the next field
	var el = 0, f = theField.form;
	while (f.elements[el]) {
		if (f.elements[el++] == theField) break; //find current field
	}
	if ((theField.value.length == theField.maxLength) && f.elements[el]) {
		f.elements[el].focus();
		return false;
	}

	return true;

}
function nextElement(theField){

	// automatically tab to the next field
	var el = 0, f = theField.form;
	while (f.elements[el]) {
		if (f.elements[el++] == theField) break; //find current field
	}
	if (f.elements[el]) {
		f.elements[el].focus();
		return false;
	}

	return true;

}
//-->
