function popUp(URL, width, height) {
  window.open(URL, '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+width+',height='+height+'');
}


// Phone Number Formatter

function mask(f){ 
f.maxLength = 14;
tel='('; 
var val =f.value.split(''); 
for(var i=0;i<val.length;i++){ 
if(i==2){val[i]=val[i]+') '} 
if(i==5){val[i]=val[i]+'-'} 
tel=tel+val[i] 
} 
    if (tel != '('){
f.value=tel; 
    }
    else {
    f.value = "";
    }
} 
function unMask(f){
 f.value = f.value.replace("(","");
 f.value = f.value.replace("-","");
 f.value = f.value.replace(")","");
 f.value = f.value.replace(" ","");
}
function noAlpha(obj){
	reg = /[^0-9]/g;
	obj.value =  obj.value.replace(reg,"");
 }




// Validiator 

function validateForm() {
  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, notqualified = 0, msg = "";
  if (document.taxlawForm.FirstName.value == "") {
    incomplete = 1;
    msg = " - First Name" + vbCRLF;
  }
  if (document.taxlawForm.LastName.value == "") {
    incomplete = 1;
    msg += " - Last Name" + vbCRLF;
  }
  if ((document.taxlawForm.ZIPCode.value == "") || isNaN(document.taxlawForm.ZIPCode.value)) {
    incomplete = 1;
    msg += " - ZIP Code" + vbCRLF;
  }  
  if ((document.taxlawForm.HomePhone.value == "") || (document.taxlawForm.HomePhone.value.length<14)) {
    incomplete = 1;
    msg += " - Home Phone" + vbCRLF;
  }
  if (document.taxlawForm.Email.value == "" || document.taxlawForm.Email.value.indexOf("@")==-1 || document.taxlawForm.Email.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg += " - Email Address" + vbCRLF;
  }
  
  if (incomplete == 1) {
    alert("Please complete the following fields before proceeding:" + vbCRLF + msg);
  }
  else {
    document.taxlawForm.submit();
  }
}






