 //Check to ensure that only numbers can be entered
    function validNumber(event)
    {
        // internet explorer
        if (navigator.appName == "Microsoft Internet Explorer")
        {
            if (event.keyCode < 32 || event.keyCode > 57)
            {
                alert("Only numbers are allowed!");
                return false;
            }
            else
            {
                return true;
            }
        }
        else
        {
            // netscape
            if (event.which < 32 || event.which > 57)
            {
                alert("Only numbers are allowed!");
                return false;
            }
            else
            {
                return true;
            }
        }
    }

    //required the fields
	function requiredFields()
	{
        var valid = true;
        var valElement1;
        var valElement2;

		//check to make sure at lease one field on the form has information in it
        //valElement1 = document.search.lastname.value.length;
		//valElement2 = document.search.firstname.value.length;
		valElement1 = document.getElementById('lastname').length;
		valElement2 = document.getElementById('firstname').length;
		if (valElement2 == 0 && valElement1 == 0)
		{
            valid = false;
			//document.search.title.selectedIndex = 0;
            document.getElementById('title').selectedIndex = 0;
			alert("You must enter your search criteria!");
			return valid;
		}

	}


    //validate the fields
    function validFields()
    {
        var valid = true;
        var valElement;
        var date = new Date();
        var currentYear = date.getFullYear();

        //check to ensure a lastname was entered
       // valElement = document.search.lastname;
		
	
		valElement = document.getElementById('lastname');
		
        if (valElement.value == "")
        {
            valid = false;
            //document.search.lastname.focus();
			document.getElementById('lastname').focus;
            alert("You must enter a Surname.");
            return valid;
        }


        //check to ensure a date was entered if not enter the default year
        //valElement = document.search.from;
		valElement = document.getElementById('from');
		
        if (valElement.value == "")
        {
            //document.search.from.value = 1852;
            document.getElementById('from').value = 1852;
        }

        //check to ensure the from date is not less then the default year
        //valElement = document.search.from;
		valElement = document.getElementById('from');
		
        if (valElement.value < 1852)
        {
            valid = false;
            //document.search.from.focus();
			document.getElementById('from').focus;
            //document.search.from.value = "";
            document.getElementById('from').value = "";
            alert("The from date must be greater than 1852!");
            return valid;
        }

        //check to see if a to date was entered if not send the default
        //valElement = document.search.to;
		valElement = document.getElementById('to');
        if (valElement.value == "")
        {
            //document.search.to.value = currentYear;
			document.getElementById('to').value = currentYear;
        }

        //check to ensure the to date is not greater then the current year
        //valElement = document.search.to;
		valElement = document.getElementById('to');
        if (valElement.value > currentYear)
        {
            valid = true;
            //document.search.to.focus();			
			document.getElementById('from').focus;
            //document.search.to.value = "";
            document.getElementById('from').value = "";
            alert("The to date cannot be greater then the current year!");
            return valid;
        }

    }