//Field Check
function checkFields() {
var emptyString = /^\s*$/;
missinginfo = "";
if ( (document.frm_project.firstname.value == "")  || (emptyString.test(document.frm_project.firstname.value))  ) {
missinginfo += "\n     -  First Name";
}

if ( (document.frm_project.lastname.value == "")  || (emptyString.test(document.frm_project.lastname.value))  ) {
missinginfo += "\n     -  Last Name";
}

if ( (document.frm_project.company.value == "")  || (emptyString.test(document.frm_project.company.value))  ) {
missinginfo += "\n     -  Company";
}

if ((document.frm_project.email.value != document.frm_project.email_again.value) ||
(document.frm_project.email.value == "") || 
(document.frm_project.email.value.indexOf('@') == -1) || 
(document.frm_project.email.value.indexOf('.') == -1) ||
(emptyString.test(document.frm_project.email.value)) ||
(document.frm_project.email_again.value == "") || 
(document.frm_project.email_again.value.indexOf('@') == -1) || 
(document.frm_project.email_again.value.indexOf('.') == -1) ||
(emptyString.test(document.frm_project.email_again.value)) ) {
missinginfo += "\n     -  Email Address / Confirmation";
}

if ( (document.frm_project.description.value == "")  || (emptyString.test(document.frm_project.description.value))  ) {
missinginfo += "\n     -  What Best Describes You?";
}

if ( (document.frm_project.referral.value == "")  || (emptyString.test(document.frm_project.referral.value))  ) {
missinginfo += "\n     -  How Did You Hear About Us?";
}

if ( (document.frm_project.project_city.value == "")  || (emptyString.test(document.frm_project.project_city.value))  ) {
missinginfo += "\n     -  Program City?";
}

if ( (document.frm_project.project_state.value == "")  || (emptyString.test(document.frm_project.project_state.value))  ) {
missinginfo += "\n     -  Program State?";
}

if ( (document.frm_project.comments.value == "")  || (emptyString.test(document.frm_project.comments.value))  ) {
missinginfo += "\n     -  Program Description?";
}


if (missinginfo != "") {
missinginfo ="_____________________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}

//Hidden Text Boxes
function show_Otherdiv01(v){
var d=document.getElementById('Otherdiv01'), k;
k=v=='Other'?['block',false]:['none',true];
d.getElementsByTagName('textarea')[0].disabled=k[1];
d.style.display=k[0];
}
function show_Otherdiv02(v){
var d=document.getElementById('Otherdiv02'), k;
k=v=='Other'?['block',false]:['none',true];
d.getElementsByTagName('textarea')[0].disabled=k[1];
d.style.display=k[0];
}
function show_Otherdiv03(v){
var d=document.getElementById('Otherdiv03'), k;
k=v=='Yes'?['block',false]:['none',true];
d.getElementsByTagName('select')[0].disabled=k[1];
d.style.display=k[0];
}
function show_Otherdiv04(v){
var d=document.getElementById('Otherdiv04'), k;
k=v=='Other'?['block',false]:['none',true];
d.getElementsByTagName('textarea')[0].disabled=k[1];
d.style.display=k[0];
}