function loadFAQ(id){
	obj=document.getElementById("faq_"+id);
	if(obj.style.display=='none' || obj.style.display=='')
		obj.style.display='block';
	else
		obj.style.display='none';
}

var n;
var p;
function ValidatePhone(p1){
  p1.value=ParseUSNumber(p1.value);
}

function checkEmail(str){
 var filter=/^.+@.+\..{2,4}$/

 if (filter.test(str))
    return true;
 else 
 	return false;
}

function checkForm(theform){
	if(theform.name.value.length<=0){
		alert("Please enter your name.");
		theform.name.focus();
		return false;
	}
	if(theform.email.value.length<=0){
		alert("Please enter your e-mail address.");
		theform.email.focus();
		return false;
	}
	if(!checkEmail(theform.email.value)){
		alert("Please enter a valid e-mail address.");
		theform.email.focus();
		return false;
	}
	if(theform.phone.value.length<=9){
		alert("Please enter your phone number.");
		theform.phone.focus();
		return false;
	}
	if(theform.message.value.length<=0){
		alert("Please enter a message or details.");
		theform.message.focus();
		return false;
	}
	theform.action.value=unescape("%73%65%6E%64");
	return true;
}

function ParseUSNumber(PhoneNumberInitialString)
  {
    var FmtStr="";
    var index = 0;
    var LimitCheck;

    LimitCheck = PhoneNumberInitialString.length;
    while (index != LimitCheck)
      {
        if (isNaN(parseInt(PhoneNumberInitialString.charAt(index))))
          { }
        else
          { FmtStr = FmtStr + PhoneNumberInitialString.charAt(index); }
        index = index + 1;
      }
    if (FmtStr.length == 10)
      {
        FmtStr = "(" + FmtStr.substring(0,3) + ") " + FmtStr.substring(3,6) + "-" + FmtStr.substring(6,10);
      }
    else
      {
        FmtStr=PhoneNumberInitialString;
        alert("United States phone numbers must have exactly ten digits.");
      }
    return FmtStr;
  }