//function to validate format and area code of phone field
function isPhoneFormatValid(phoneValue){
var phoneDigits = "";
var fakeAreaCodes = "";

//compiling the list of fake area codes to validate against
fakeAreaCodes = "222,333,444,555,666,777,999,211,311,411,511,611,711,811,911";

//extracting only the digits out of the phone field
for(i=0; i < phoneValue.length; i++){
	if (isNumeric(phoneValue.charAt(i))){
		phoneDigits = phoneDigits + phoneValue.charAt(i);
	}
}

//extracting the area code
var areaCode = "0";
if (phoneDigits.length >= 3){
	areaCode = phoneDigits.substring(0,3);
}
if (phoneDigits.length != 10 || fakeAreaCodes.indexOf(areaCode) != -1 || parseInt(areaCode) <= 200){
	return false;
}

return true;

}