<!-- Begin validation script
//----------------------------------------
// Clears field if the default value is there.
//----------------------------------------
function clear_field(field)
{
    if (field.value==field.defaultValue)
    {
        field.value=''
    }
}

//----------------------------------------
// Checks field to see if any information
// was entered. If not, the default value
// is reentered.
//----------------------------------------
function check_field(field)
{
    if (field.value=='' ||
    field.value==' ')
    {
        field.value=field.defaultValue
    }
}

//----------------------------------------
// Validates the form. If a field fails the
// validation, The form is not submitted.
//----------------------------------------
function validate_form()
{
//----------------------------------------
// Validates the name field.
//----------------------------------------
    if (document.bok.Name.value==document.bok.Name.defaultValue ||
    document.bok.Name.value.indexOf(' ',0)==0)
    {
        alert('\n請輸入您的姓名.')
        document.bok.Name.select()
        document.bok.Name.focus()
        return false
    }
   if (document.bok.Sex[0].checked!=true && document.bok.Sex[1].checked!=true)
    {

        alert('\n 請選擇您的性別 !!')
        return false
    }

//----------------------------------------
// Validates the phone field.
//----------------------------------------
    if (document.bok.Phone.value==document.bok.Phone.defaultValue ||
    document.bok.Phone.value.indexOf(' ',0)==0)
    {
        alert('\n請輸入您的電話號碼.')
        document.bok.Phone.select()
        document.bok.Phone.focus()
        return false
    }

//----------------------------------------
// Validates the comments field.
//----------------------------------------
    if (document.bok.Comments.value==document.bok.Comments.defaultValue ||
    document.bok.Comments.value.indexOf(' ',0)==0)
    {
        alert('\n請輸入您的意見內容.')
        document.bok.Comments.select()
        document.bok.Comments.focus()
        return false
    }

//----------------------------------------
// Validates the email field.
//----------------------------------------
    if (document.bok._to.value==document.bok._to.defaultValue)
    {
        alert('\n請輸入您的 Email Address.')
        document.bok._to.select()
        document.bok._to.focus()
        return false
    }
        if (document.bok._to.value.indexOf('@',0)==-1 ||
        document.bok._to.value.indexOf('.',0)==-1)
        {
            alert('\n請輸入正確的 Email Address.')
            document.bok._to.select()
            document.bok._to.focus()
            return false
        }
    else
    {
        if(confirm('\n感謝您的意見.請按確定鍵發送您的意見'))
        {
            return true
        }
        else
        {
            return false
        }
    }
}

//----------------------------------------
// End of validation script -->