function showContactForm(state) {
    if (typeof state != 'boolean') state=true;

    document.getElementById('contactBox').style.display=(state ? 'block' : 'none');
    document.getElementById('contactBoxLink').style.display=(state ? 'none' : 'block');
    return true;
}

function autoShowContactForm() {
    var f=document.getElementById('contactBox');
    while(f && typeof f.action == 'undefined') {
        f=f.parentNode;
    }
    if (!f) return false;

    for(var i=0; i < f.elements.length; i++) {
        if (f.elements[i].parentNode.className.match(/error/)) {
            showContactForm(true);
            return true;
        }
    }
    showContactForm(false);    
    return true;
}

