// Rough code taken from:
// http://www.elated.com/articles/form-validation-with-javascript/

function validate_form_ping ( )
{
    valid = true;

    if ( document.dns_ping.address.value == "" )
    {
        alert ( "Please populate the 'Address' field." );
        valid = false;
    }

    return valid;
}
function validate_form_tracert ( )
{
    valid = true;

    if ( document.dns_traceroute.address.value == "" )
    {
        alert ( "Please populate the 'Address' field." );
        valid = false;
    }

    return valid;
}
function validate_form_dns ( )
{
    valid = true;

    if ( document.dns_dns.address.value == "" )
    {
        alert ( "Please populate the 'Address' field." );
        valid = false;
    }
   if ( document.dns_dns.type.value == "" )
    {
        alert ( "Please select a 'Type'." );
        valid = false;
    }

    return valid;
}
function validate_form_crawler ( )
{
    valid = true;

    if ( document.dns_crawler.address.value == "" )
    {
        alert ( "Please populate the 'Address' field." );
        valid = false;
    }
   if ( document.dns_crawler.host.value == "" )
    {
        alert ( "Please select a 'host'." );
        valid = false;
    }
   if ( document.dns_crawler.type.value == "" )
    {
        alert ( "Please select a 'Type'." );
        valid = false;
    }

    return valid;
}
function validate_form_geolocate ( )
{
    valid = true;

    if ( document.dns_geolocate.address.value == "" )
    {
        alert ( "Please populate the 'Address' field." );
        valid = false;
    }

    return valid;
}
function validate_form_whois ( )
{
    valid = true;

    if ( document.dns_whois.address.value == "" )
    {
        alert ( "Please populate the 'Address' field." );
        valid = false;
    }
   if ( document.dns_whois.type.value == "" )
    {
        alert ( "Please select a 'Type'." );
        valid = false;
    }

    return valid;
}
function validate_form_online ( )
{
    valid = true;

    if ( document.dns_online.address.value == "" )
    {
        alert ( "Please populate the 'Address' field." );
        valid = false;
    }
   if ( document.dns_online.type.value == "" )
    {
        alert ( "Please enter a 'port'." );
        valid = false;
    }

    return valid;
}