
function textBeGone(field, text) {
    if(field.value == text) {
        field.value = '';
    }
}

function validateGeneric(input, regexp) {
    var inputValue = input.value;
    var id         = input.id;
    document.getElementById(id+"Validate").style.display = "inline";
    
    img = document.getElementById(id+"Validate");
    if(inputValue.match(regexp)) {
        img.src = "/images/check.gif";
        img.alt = "Valid";
        return true;
    }
    else {
        img.src = "/images/x.gif";
        img.alt = "Not Valid";
        // form_obj.email.focus(); // user accessibility problem?
        return false;
    }  
}

function other(input) {
    var name = input.name;
    var form = input.form;
    if(input.options[input.selectedIndex].value == 'other') {
        form.elements[name+'_other'].style.display = "inline";
        form.elements[name+'_other'].disabled = false;
        form.elements[name+'_other'].focus();
    }
    else {
        form.elements[name+'_other'].style.display = "none";
        form.elements[name+'_other'].disabled = true;
    }
}

function init() {
    check_other();
}

function check_other() {
    //alert(document.getElementById["main_content"]);
    other(document.getElementById["partner_lang_1"]);
    other(document.getElementById["partner_lang_2"]);
    other(document.getElementById["partner_lang_3"]);
    other(document.getElementById["fluent_lang_1"]);
    other(document.getElementById["fluent_lang_2"]);
    other(document.getElementById["fluent_lang_3"]);    
}



// returns true if the first date is greater
// than the second date

function dateCompare(one,two) {
    alert(one+" "+two);
    if(one > two) {
        return true;
    }
    else {
        return false;
    }
}

//document.body.onload = check_other('');