function showContent(vThis)
{
// http://www.javascriptjunkie.com/?p=9
// alert(vSibling.className + " " + vDef_Key);
vParent = vThis.parentNode;
vSibling = vParent.nextSibling;
while (vSibling.nodeType==3) { // Fix for Mozilla/FireFox Empty Space becomes a TextNode or Something
vSibling = vSibling.nextSibling;
};
if(vSibling.style.display == "none")
{
vThis.alt = "Hide Div";
vSibling.style.display = "block";
} else {
vSibling.style.display = "none";
vThis.alt = "Show Div";
}
return;
}

function check_required_fields() {
var error_message = "You are required to complete the following fields: ";
if (document.mainform.realname.value=="") {error_message = error_message + "\n - Name"; document.mainform.realname.style.backgroundColor='pink'; } else { document.mainform.realname.style.backgroundColor=''; }

if (document.mainform.email.value=="") {error_message = error_message + "\n - E-mail"; document.mainform.email.style.backgroundColor='pink'; } else { document.mainform.email.style.backgroundColor=''; }

if (document.mainform.affiliation.value=="") {error_message = error_message + "\n - Affiliation"; document.mainform.affiliation.style.backgroundColor='pink'; } else { document.mainform.affiliation.style.backgroundColor=''; }

if (document.mainform.address.value=="") {error_message = error_message + "\n - Address"; document.mainform.address.style.backgroundColor='pink'; } else { document.mainform.address.style.backgroundColor=''; }

if (document.mainform.city.value=="") {error_message = error_message + "\n - City "; document.mainform.city.style.backgroundColor='pink'; } else { document.mainform.city.style.backgroundColor=''; }

if (document.mainform.state.value=="") {error_message = error_message + "\n - State"; document.mainform.state.style.backgroundColor='pink'; } else { document.mainform.state.style.backgroundColor=''; }

if (document.mainform.country.value=="") {error_message = error_message + "\n - Country"; document.mainform.country.style.backgroundColor='pink'; } else { document.mainform.country.style.backgroundColor=''; }

if (document.mainform.usage[0].checked==false && document.mainform.usage[1].checked==false) {error_message = error_message + "\n - Commercial or Academic"; document.mainform.usage[0].style.backgroundColor='pink'; document.mainform.usage[1].style.backgroundColor='pink';} else { document.mainform.usage[0].style.backgroundColor=''; document.mainform.usage[1].style.backgroundColor='';}

if (document.mainform.for_whom[0].checked==false && document.mainform.for_whom[1].checked==false && document.mainform.for_whom[2].checked==false && document.mainform.for_whom[3].checked==false) {error_message = error_message + "\n - For whom"; document.mainform.for_whom[0].style.backgroundColor='pink'; document.mainform.for_whom[1].style.backgroundColor='pink'; document.mainform.for_whom[2].style.backgroundColor='pink'; document.mainform.for_whom[3].style.backgroundColor='pink';} else { document.mainform.for_whom[0].style.backgroundColor=''; document.mainform.for_whom[1].style.backgroundColor=''; document.mainform.for_whom[2].style.backgroundColor=''; document.mainform.for_whom[3].style.backgroundColor='';}

//alert if fields are empty and cancel form submit
if (error_message == "You are required to complete the following fields: ") {
document.mainform.submit();
}
else {
alert(error_message);
return false;
   }
}

function RemoveContent(d) {

document.getElementById(d).style.display = "none";

}

function InsertContent(d) {

document.getElementById(d).style.display = "";

}

