function swapImg(oldImg, newImg) {
	if ( isNS4 || isIE4 || isIE5 || isNew || isNS6up){
		eval('document.images.' + oldImg +'.src=' + newImg +'.src');
	}
}

// Email Validation. Written by PerlScriptsJavaScripts.com

function check_email(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

	for(i=0; i < e.length ;i++){
		if(ok.indexOf(e.charAt(i))<0){
		return (false);
		}
	}

	if (document.images) {
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)) {
		return (-1);
		}
	}

}

function check_contact_form(f) { // f is the form (passed using the this keyword)
// check the first email address ( the exclamation means "not" )
    var message = 'Please Enter ';
/*
	for (i = 0; i < f.length; i++){
		alert(f[i].name);
	}
*/

	if( f.recaptcha_response_field.value == ''){
		alert(message+"recaptcha value");
		f.recaptcha_response_field.focus();
		return false;
	}

	if(!check_email(f.email.value)){
		alert(message+"a valid email address");
		f.email.focus();
	    return false;
	}

}
function menuDisplay(menu) {

	if (isIE4){
	 eval('document.all.'+menu+'.style.visibility = "visible";')
	}

	if (isNS6up){
	 eval('document.getElementById(menu).style.visibility = "visible";')
	}

	if (isNS4){
	 eval('document.'+menu+'.visibility = "show";')
	}

	stopTimer();
}

function startTimer()
{
	timer = setTimeout('close()', 500);
}

function stopTimer()
{
	try{
		clearTimeout(timer);
	}catch(e){
		//
	}
}


function menuClose()
{
	startTimer();
}

function close() {
	if (isIE4){
	 eval('document.all.about_lo.style.visibility= "hidden";')
	}

	if (isNS6up){
		document.getElementById('about_lo').style.visibility = "hidden";
	}

	if (isNS4){
	 eval('document.about_lo.visibility= "hidden";')
	}
}

function phone_number( value){
	if(value == 'yes'){
		if (isIE4){
		 eval('document.all.phone_number.style.visibility= "visible";')
		}

		if (isNS6up){
			document.getElementById('phone_number').style.visibility = "visible";
		}

		if (isNS4){
		 eval('document.phone_number.visibility= "visible";')
		}

	}else{
		if (isIE4){
		 eval('document.all.phone_number.style.visibility= "hidden";')
		}

		if (isNS6up){
			document.getElementById('phone_number').style.visibility = "hidden";
		}

		if (isNS4){
		 eval('document.phone_number.visibility= "hidden";')
		}
	}
}