// JScript source code
function isValidEmail(str) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){
		return true;
	}
	else {
		return false;
	}
}

function checkenquiry(){
	var ftxt = '';

	if (document.enquiry.Name.value==''){
		ftxt += '\n- Please enter your Name.';
	}
	
	if (document.enquiry.Company.value==''){
		ftxt += '\n- Please enter your Company.';
	}
	
	if (document.enquiry.Telephone.value==''){
		ftxt += '\n- Please enter your Telephone Number.';
	}
	
	if (isValidEmail(document.enquiry.Email.value)==false){
		ftxt += '\n- Please enter your Email Address.';
	}
	
	if (document.enquiry.Message.value==''){
		ftxt += '\n- Please enter your Message.';
	}
	
	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

function checkcallform(){
	var ftxt = '';
	
	if (document.callform.Name.value==''){
		ftxt += '\n- Please enter your Name.';
	}
	
	if (document.callform.Company.value==''){
		ftxt += '\n- Please enter your Company Name.';
	}
	
	if (document.callform.Telephone.value==''){
		ftxt += '\n- Please enter your Telephone Number.';
	}	
	
	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

function checknewsletterform(){
	if (isValidEmail(document.newsletterform.email.value)==false){
		alert('Please enter your Email Address.');
		return false;
	}
	else {
		return true;
	}
}

function clearemailfield(fieldVal){
	if (isValidEmail(fieldVal)==false){
		document.newsletterform.email.value='';
	}
}

/*
function mainmenu() {
    
	$(" #navlist ul ").css({display: "none"}); // Opera Fix
	$(" #navlist li").hover(function(){
			$(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown(0);
			},function(){
			$(this).find('ul:first').css({visibility: "hidden"});
			});
	}
	

 $(document).ready(function(){					
	mainmenu()
});
*/
