function keys( evt )
{
	return ( code = ( ( evt = ( evt ) ? evt : window.event ).which ) ? evt.which : evt.keyCode ) < 32 || ( code >= 37 && code <= 40 ) || ( code >= 48 && code <= 57 ) || code == 46
}

/*
function checkForm()
{
	this.error = function( message, id )
	{
		return eval( 'document.forms.invoiceForm.' + id ).focus() != window.alert( message )
	}
	this.isValidDate = function( value )
	{
		if( value.substr( 2, 1 ) != '.' || value.substr( 5, 1 ) != '.' )
			return false;
		var maxDays = new Array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
		var year = parseInt( value.substr( 6, 4 ), 10 );
		if ( !( year % 4 ) && ( year % 100 ) || !( year % 400 ) )
			maxDays[1] = 29;
		return ( month = parseInt( value.substr( 3, 2 ), 10 ) - 1 ) >= 0 && month <= 11 && year >= 1900 && year <= 2050 && ( day = parseInt( value.substr( 0, 2 ), 10 ) ) > 0 && day <= maxDays[month]
	}
	this.formatDate = function( value )
	{
		return value.substr( 6, 4 ) + value.substr( 3, 2 ) + value.substr( 0, 2 )
	}
	if( ( no = isNaN( no = parseInt( document.forms.invoiceForm.no.value ) ) ? -1 : no ) < 1 || no > 9999999 )
		return this.error( 'Невалиден абонатен номер.', 'no' );
	if( ( fromDate = document.forms.invoiceForm.fromDate.value ).length != 10 || !this.isValidDate( fromDate ) )
		return this.error( 'Невалиднa начална дата.', 'fromDate' );
	if( ( toDate = document.forms.invoiceForm.toDate.value ).length != 10 || !this.isValidDate( toDate ) )
		return this.error( 'Невалиднa крайна дата.', 'toDate' );
	if( this.formatDate( toDate ) < this.formatDate( fromDate ) )
		return this.error( 'Крайната дата предхожда началната.', 'toDate' );
	if( !document.forms.invoiceForm.pay.checked && !document.forms.invoiceForm.notPay.checked && !document.forms.invoiceForm.paritalPay.checked && !document.forms.invoiceForm.court.checked )
		return this.error( 'Моля изберете поне един вид сметка, за който искате да направите справка', 'notPay' );
	return true;
}
*/

function checkForm()
{
  this.error = function( message, id )
  {
    return eval( 'document.forms.invoiceForm.' + id ).focus() != window.alert( message )
  }
  if( ( no = isNaN( no = parseInt( document.forms.invoiceForm.no.value ) ) ? -1 : no ) < 1 || no > 9999999 )
    return this.error( 'Невалиден абонатен номер.', 'no' );
  if( document.forms.invoiceForm.cs.value.length < 9 )
    return this.error( 'Невалиден ЕГН или Булстат', 'cs' );
  return true;
}
