// drop-down menu for main left-hand navigation

function showMenu(subMenu)
{

if(document.getElementById)
{
var menuID = document.getElementById(subMenu).style;

if(menuID.display == 'block')
{
menuID.display = 'none';
}
else
{
menuID.display = 'block';
}

return false;
}   
else
{
return true;
}
    
}

function load()
{
document.feedback_form.fullname.focus();
}
function clear_form()
{
document.feedback_form.fullname.focus();
}
function check_fullname()
{
var fullnameRegEx = /^[a-z\s]+$/i;

if (document.feedback_form.fullname.value=="")
{
alert ("Please enter your fullname");

document.feedback_form.fullname.value="";
document.feedback_form.fullname.focus();
return false;
}
else if (document.feedback_form.fullname.value.search(fullnameRegEx) !== -1)
{
email();
return false;
}
else
{
alert ("Please enter a valid name which contains just letters");
document.feedback_form.fullname.value="";
document.feedback_form.fullname.focus();
return false;
}
}
function email()
{

var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;

if (document.feedback_form.email.value=="")
{
alert ("Please enter an email address");
document.feedback_form.email.focus();
return false;
}
else if (document.feedback_form.email.value.match(emailExp))
{
comment();
return false;
}
else
{
alert ("Email address is invalid");
document.feedback_form.email.value="";
document.feedback_form.email.focus();
return false;
}
}

function comment()
{
var commentRegEx = /^[a-z\s]+$/i;

if (document.feedback_form.message.value=="")
{
alert ("Please enter a comment");
document.feedback_form.message.focus();
return false;
}
else if (document.feedback_form.message.value.search(commentRegEx) !== -1)
{
alert ("Thank you for your comment");
document.feedback_form.submitbutton.disabled=false;
open_win("contact.php");



return true;
}
else
{
alert ("Please enter a valid comment which contains just letters");
document.feedback_form.message.value="";
document.feedback_form.message.focus();
return false;
}
}
function set_focus()
{
document.feedback_form.fullname.focus();
}






