var W3CDOM = document.createElement && document.getElementsByTagName;

// Begin generic popup window
function winPop(uri, name, width, height, location, resizable, scrollbar, toolbar, menubar, status, centered) {
    var top;
    var left;
    if(centered == 'yes') {
        top = (screen.height - height)/2;
        left = (screen.width - width)/2;
    } else {
        top = 10;
        left = 10;
    }
    var position = 'width=' + width +',height=' + height + ',top=' + top + ',left=' + left;
    var winControl = 'location=' + location + ',resizable=' + resizable + ',scrollbars=' + scrollbar + ',toolbar=' + toolbar + ',menubar=' + menubar + ',status=' + status;
    var win = window.open(uri, name, position + ',' + winControl);
    win.focus();

    return false;
}
// End generic popup

function checkForm() {
    var str = '';

    if(this.txt_fname.value == '' || this.txt_fname.value == null) {
        str += ' - First Name\n';
    }

    if(this.txt_lname.value == '' || this.txt_lname.value == null) {
        str += ' - Last Name\n';
    }

    if(this.txt_email.value == '' || this.txt_email.value == null) {
        str += ' - Email\n';
    }

    if(this.txt_comments.value == '' || this.txt_comments.value == null) {
        str += ' - Comment(s)\n';
    }

    if(str != '' && str != null) {
        alert('Please fill out the following field(s):\n' + str);
        return false;
    }
    return true;
}