<!--

// Open Window
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function validateContactForm() {
	msg = ""
	if(!document.myform.txtName.value) msg += "* Your Name is a required field.\n\n"
	if(!document.myform.txtEmail.value) msg += "* Your E-mail Address is a required field.\n\n"
	else if(!(document.myform.txtEmail.value.match(/\@/))) msg += "* Include the @ symbol in your E-mail Address.\n\n"
	else if(!(document.myform.txtEmail.value.match(/\S+\@\S+\.\S+/))) msg += "* Your E-mail Address must be in the format xxx@xxx.xxx\n\n"
	if(!document.myform.txtQuestion.value) msg += "* Please enter your question.\n\n"
	if (msg == ""){
	return true;
	}
	else
	{
	msg = "We Found The Following Omissions In Your Form: \n\n" + msg;
	alert(msg);
	return false;
	}
}

function validateLinkExchangeForm() {
		msg = ""
		if(!document.myform.selCategory.value) msg += "* Pick one Category for your link.\n"
		if(!document.myform.txtYourUrl.value) msg += "* Enter your website URL.\n"
		if(!document.myform.txtTitle.value) msg += "* Enter your website title.\n"
		if(!document.myform.txtDescription.value) msg += "* Enter your website description.\n"
		if(!document.myform.txtEmail.value) msg += "* Enter your E-mail address.\n"
		else if(!(document.myform.txtEmail.value.match(/\@/))) msg += "* Include the @ symbol in your E-mail Address.\n"
		else if(!(document.myform.txtEmail.value.match(/\S+\@\S+\.\S+/))) msg += "* Your E-mail Address must be in the format xxx@xxx.xxx\n"
	
		if (msg == ""){
		return true;
		}
		else
		{
		msg = "We Found The Following Problems With Your Form: \n\n" + msg;
		alert(msg);
		return false;
		}
	}

function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}
// validate emailquote
function validateEmailQuote(form){
	var Email = "";
	// check txtEmailTo for email validity

	for (var i = 0; i <= form.txtEmailTo.length-1;i++){
		Email = form.txtEmailTo[i].value;
		if (Email != ""){
			if ((Email.indexOf("@") != -1) && (Email.indexOf(".") != -1)){
				return true;
			}
		}
	}
	return false;
}
//--------------------------------
// This code compares two fields in a form and submit it
// if they're the same, or not if they're different.
//--------------------------------
function checkEmail(theForm) {
    if (theForm.txtEmail.value != theForm.txtEmail2.value)
    {
        alert('Your email addresses don\'t match! \n\n Please ensure that your email addresses are correct so we can get back to you.');
        return false;
    } else {
        return true;
    }
}
//-->

