function textCounter(field, maxlimit) { if (field.value == 'max 500 characters' || field.value == 'Describe Your Needs (max 500 characters)'){ field.value =''; } if (field.value.length > maxlimit) { field.value = field.value.substring(0, maxlimit); } }
function nb_loadJS(inc) { var o='<'+'script src="'+inc+'"'+' type="text/javascript"><'+'/script>'; document.write(o); }
if (typeof nb_lead_form_cnt == "undefined"){ nb_lead_form_cnt = 0; }
document.write('<div id="leadFormDiv_'+nb_lead_form_cnt+'" class="adTagFormContainer" ></div>');
mp_adtag = new Object();
if(typeof nb_alias_host != "undefined" && nb_alias_host != null && nb_alias_host != "") {mp_adtag.impressionHost= 'http://'+nb_alias_host} else {mp_adtag.impressionHost='http://www.matchpoint.com'}; mp_adtag.clickHost = ''; mp_adtag.impressionQuery = ""; mp_adtag.clickQuery = ""; mp_adtag.ad_cat = null; mp_adtag.ad_tag_id = null; mp_adtag.use_flash = null; mp_adtag.textLink = null; mp_adtag.escapeUri = function(val){ if(typeof encodeURIComponent=="function"){ return encodeURIComponent(val); } else{ return escape(val); } }
mp_adtag.getDQuoteString = function(val){ return val!=null?'"'+val+'"':'""'; }
mp_adtag.appendClickTimeStamp = function(){ mp_adtag.clickQuery += "ts="+mp_adtag.ts; mp_adtag.impressionQuery += "ts="+mp_adtag.ts; }
mp_adtag.reset = function() { mp_adtag.impressionQuery = ""; mp_adtag.clickQuery = ""; mp_adtag.ad_cat = null; mp_adtag.use_flash = null; mp_adtag.ad_tag_id = null; mp_adtag.textLink = null; }
mp_adtag.addImpressionParamValue = function(iName, iValue) { if(mp_adtag.impressionQuery.indexOf("?") < 0) { mp_adtag.impressionQuery += "?"; } mp_adtag.impressionQuery += iName + "=" + iValue + "&" ; }
mp_adtag.addImpressionPath = function(iValue) { mp_adtag.impressionQuery += iValue; }
mp_adtag.addClickParamValue = function(iName, iValue) { if(mp_adtag.clickQuery.indexOf("?") < 0) { mp_adtag.clickQuery += "?"; } mp_adtag.clickQuery += iName + "=" + iValue + "&" ; }
mp_adtag.addClickPath = function(iValue) { mp_adtag.clickQuery += iValue; }
mp_adtag.render = function() { var impUrl = mp_adtag.getDQuoteString(mp_adtag.impressionHost+mp_adtag.impressionQuery); document.write ("<" + "script language='JavaScript' type='text/javascript' src="); document.write (impUrl); document.write ("><" + "/script>");	}
mp_adtag.paramExist = function(param) { return (typeof param != "undefined" && param != null && param != ""); }
mp_adtag.setUpHostUrl = function(tid) { if(document.getElementById(tid)) { var libSrcUrl = document.getElementById(tid).src; var str = libSrcUrl.split("/"); var hostname = str[0] + "//" + str[2]; mp_adtag.impressionHost = hostname + "/i"; mp_adtag.clickHost = hostname + "/r"; } }
mp_adtag.collectAdParams = function(ad) { mp_adtag.addImpressionPath("/fa"); mp_adtag.addImpressionParamValue("state", "cff"); if(typeof ad.nb_tag_id != "undefined" && ad.nb_tag_id != null) { mp_adtag.ad_tag_id = ad.nb_tag_id; var temp = ad.nb_tag_id.split("_"); if(temp.length >= 2) { mp_adtag.addImpressionParamValue("tagid", temp[0]); mp_adtag.addClickPath("/" + temp[0]); mp_adtag.ad_cat = temp[1]; } if(temp.length == 3) { mp_adtag.use_flash = temp[2]; } }
 mp_default_style='<style> .adTagFormContainer { border: 1px solid #000; position: relative; font-family: Arial, Helvetica, sans-serif; font-size: 12px; overflow: hidden; color:#000 } div.adTagHeadline { font-size: 16px; text-align: center; background-color: #eee; border-bottom: 1px dashed #99f; border-top:1px solid #eee;} h4.adTagHeadlineText { margin: 5px; color:#000; } .adTagFormContainer input { width: 200px; margin: 0 auto 10px auto; font-size: 12px; } .adTagFormContainer select { width: 204px; margin: 0 auto 10px auto; font-size: 12px; } .adTagFormContainer td.requiredIndicator { visibility: visible; padding: 0 5px 0 0; width: 45px; text-align:right; color: #000; vertical-align:top;} .adTagFormContainer td.requiredLabel { font-size:10px; color: #000; padding-top:5px; } .adTagFormContainer td.required { visibility:visible; color: #000; font-weight: bold;} .adTagFormContainer td.optional { visibility:visible; font-weight: bold; } .adTagFormContainer td.privatePolicy { font-size: 10px; padding: 10px 12px 10px 0; } .adTagFormContainer label.error { font-weight: bold; font-style:italic; color: #000; display:block; text-align:center; margin:10px 0 0 0;} .adTagFormContainer form { margin: 0; padding-top: 0; } .adTagFormContainer input { color: #000; } .adTagFormContainer .submitted { text-align: center; margin: 10px; } .adTagFormContainer .submitButton, .adTagFormContainer .submitButtonDisabled { width: 119px; height: 22px; } .adTagFormContainer .submitButtonDisabled { background-color: #ccc; clear: both; color: #666; font-size: 10px; font-weight: bold; font-family: verdana; border: 2px #9cf inset; } .adTagForm { position: relative; top: 10px; font-size:12px; width: 100%; } .adTagFormContainer a { color: #36c; } .adTagFormContainer .adTagMessage { padding: 0; margin:0; font-size:9px; font-weight:normal;} .adTagFormContainer #emailAddress { margin-bottom:0; } .adTagFormContainer .adTagMessageProvider { padding: 0 0px 35px 20px; margin:0; font-size:10px; text-align: left; } .adTagFormContainer .adTagInstructions { padding-left: 10px; } .adTagFormContainer .adTagInstructions p { margin: 0; font-size: 12px; } .adTagFormContainer .adTagInstructions ul { margin-top: 0; margin-bottom: 5px; } .adTagFormContainer .submitButton { cursor: pointer; background: #ff9; clear: both; color: #036; font-size: 10px;font-weight: bold; font-family: verdana; } .adTagFormContainer #adTagPoweredBy { font-size: 10px; border-top: 1px dashed #99f; text-align:center; padding: 0; background-color:#eeeeee; position:absolute; bottom:0;} .adTagFormContainer #adTagPoweredBy img { border:0; } .adTagFormContainer #adTagPoweredBy .mpLogo { border-left: 1px dashed #99f; } .adTagFormContainer #adTagPoweredBy .mpLinks { text-align:left; } .adTagFormContainer #adTagPoweredBy .mpLinks a { } .adTagFormContainer #adTagPoweredBy td { padding: 4px; } </style> ';

 if (typeof ad.mp_no_def_style == 'undefined' || ad.mp_no_def_style == null || ad.mp_no_def_style == 'f'){
 document.write(mp_default_style); } 
 if(mp_adtag.paramExist(ad.nb_pp)) { mp_adtag.addImpressionParamValue("pp", ad.nb_pp); mp_adtag.addClickParamValue("pp", ad.nb_pp); } if(mp_adtag.paramExist(ad.nb_x1)) { mp_adtag.addImpressionParamValue("x1", mp_adtag.escapeUri(ad.nb_x1)); mp_adtag.addClickParamValue("x1", mp_adtag.escapeUri(ad.nb_x1)); } if(mp_adtag.paramExist(ad.nb_x2)) { mp_adtag.addImpressionParamValue("x2", mp_adtag.escapeUri(ad.nb_x2)); mp_adtag.addClickParamValue("x2", mp_adtag.escapeUri(ad.nb_x2)); } if(mp_adtag.paramExist(ad.nb_x3)) { mp_adtag.addImpressionParamValue("x3", mp_adtag.escapeUri(ad.nb_x3)); mp_adtag.addClickParamValue("x3", mp_adtag.escapeUri(ad.nb_x3)); } if(mp_adtag.paramExist(ad.nb_x4)) { mp_adtag.addImpressionParamValue("x4", mp_adtag.escapeUri(ad.nb_x4)); mp_adtag.addClickParamValue("x4", mp_adtag.escapeUri(ad.nb_x4)); } if(mp_adtag.paramExist(ad.nb_domain)) { mp_adtag.addImpressionParamValue("domain", ad.nb_domain); mp_adtag.addClickParamValue("domain", ad.nb_domain); } if(mp_adtag.paramExist(ad.nb_site_section)) { mp_adtag.addImpressionParamValue("site_section", ad.nb_site_section); mp_adtag.addClickParamValue("site_section", ad.nb_site_section); } if(mp_adtag.paramExist(ad.nb_page_placement)) { mp_adtag.addImpressionParamValue("page_placement", mp_adtag.escapeUri(ad.nb_page_placement)); mp_adtag.addClickParamValue("page_placement", mp_adtag.escapeUri(ad.nb_page_placement)); } if(mp_adtag.paramExist(ad.nb_optInfo)) { mp_adtag.addImpressionParamValue("optInfo", mp_adtag.escapeUri(ad.nb_optInfo)); mp_adtag.addClickParamValue("optInfo", mp_adtag.escapeUri(ad.nb_optInfo)); } mp_adtag.addImpressionParamValue("useWrapperTemplate", "false"); if(mp_adtag.paramExist(ad.textLink)) { mp_adtag.textLink = ad.textLink; } else { mp_adtag.textLink = "Click me!";	} if(mp_adtag.paramExist(ad.mp_head_line)) { mp_adtag.addImpressionParamValue("head_line", escape(ad.mp_head_line)); } if(mp_adtag.paramExist(ad.mp_x)) { mp_adtag.addImpressionParamValue("mp_x", escape(ad.mp_x)); } if(mp_adtag.paramExist(ad.mp_search_term)) { ad.mp_search_term = ad.mp_search_term.replace(/ +/g, " "); ad.mp_search_term = ad.mp_search_term.replace(/^ +| +$/g,"").toLowerCase(); mp_adtag.addImpressionParamValue("searchTerm", escape(ad.mp_search_term)); } mp_adtag.addImpressionParamValue("nb_lead_form_cnt", ad.nb_lead_form_cnt); ad.nb_lead_form_cnt = ad.nb_lead_form_cnt +1; mp_adtag.addImpressionParamValue("divIdRandNum", Math.floor(Math.random()*1000)); if(mp_adtag.paramExist(ad.mp_desc_loc)) { mp_adtag.addImpressionParamValue("mp_desc_loc", ad.mp_desc_loc); } if(mp_adtag.paramExist(ad.mp_form_type)) { mp_adtag.addImpressionParamValue("mp_form_type", ad.mp_form_type); } if(mp_adtag.paramExist(ad.mp_prop_group)) { mp_adtag.addImpressionParamValue("mp_prop_group", ad.mp_prop_group); } if(mp_adtag.paramExist(ad.mp_min_question)) { mp_adtag.addImpressionParamValue("mp_min_question", ad.mp_min_question); } if(mp_adtag.paramExist(ad.mp_max_question)) { mp_adtag.addImpressionParamValue("mp_max_question", ad.mp_max_question); } if(mp_adtag.paramExist(ad.mp_field_column_num)) { mp_adtag.addImpressionParamValue("mp_field_column_num", ad.mp_field_column_num); } if(mp_adtag.paramExist(ad.mp_req_field_label_loc)) { mp_adtag.addImpressionParamValue("mp_req_field_label_loc", ad.mp_req_field_label_loc); } if(mp_adtag.paramExist(ad.mp_opt_field_label_loc)) { mp_adtag.addImpressionParamValue("mp_opt_field_label_loc", ad.mp_opt_field_label_loc); } if(mp_adtag.paramExist(ad.mp_optional_field_loc)) { mp_adtag.addImpressionParamValue("mp_optional_field_loc", ad.mp_optional_label_loc); } if(mp_adtag.paramExist(ad.mp_desc_loc)) { mp_adtag.addImpressionParamValue("mp_desc_loc", ad.mp_desc_loc); } if(mp_adtag.paramExist(ad.mp_err_msg_type)) { mp_adtag.addImpressionParamValue("mp_err_msg_type", ad.mp_err_msg_type); } if(mp_adtag.paramExist(ad.mp_css)) { mp_adtag.addImpressionParamValue("mp_css", ad.mp_css); } if(mp_adtag.paramExist(ad.mp_submit_btn_txt)) { mp_adtag.addImpressionParamValue("mpsbt", escape(ad.mp_submit_btn_txt)); } if(mp_adtag.paramExist(ad.mp_sub_target)) { mp_adtag.addImpressionParamValue("mp_sub_target", escape(ad.mp_sub_target)); } if(mp_adtag.paramExist(ad.mp_color_border)){ mp_adtag.addImpressionParamValue("mp_color_border", escape(ad.mp_color_border)); } if(mp_adtag.paramExist(ad.mp_color_bg)){ mp_adtag.addImpressionParamValue("mp_color_bg", escape(ad.mp_color_bg)); } if(mp_adtag.paramExist(ad.mp_color_link)){ mp_adtag.addImpressionParamValue("mp_color_link", escape(ad.mp_color_link)); } if(mp_adtag.paramExist(ad.mp_color_text)){ mp_adtag.addImpressionParamValue("mp_color_text", escape(ad.mp_color_text)); } if(mp_adtag.paramExist(ad.mp_color_field_bg)){ mp_adtag.addImpressionParamValue("mp_color_field_bg", escape(ad.mp_color_field_bg)); } if(mp_adtag.paramExist(ad.mp_color_head_line)){ mp_adtag.addImpressionParamValue("mp_color_head_line", escape(ad.mp_color_head_line)); } if(mp_adtag.paramExist(ad.mp_color_head_line_bg)){ mp_adtag.addImpressionParamValue("mp_color_head_line_bg", escape(ad.mp_color_head_line_bg)); } if(mp_adtag.paramExist(ad.mp_color_sub_button)){ mp_adtag.addImpressionParamValue("mp_color_sub_button", escape(ad.mp_color_sub_button)); } if(mp_adtag.paramExist(ad.mp_color_sub_button_bg)){ mp_adtag.addImpressionParamValue("mp_color_sub_button_bg", escape(ad.mp_color_sub_button_bg)); } if(mp_adtag.paramExist(ad.mp_color_sub_button_dis)){ mp_adtag.addImpressionParamValue("mp_color_sub_button_dis", escape(ad.mp_color_sub_button_dis)); } if(mp_adtag.paramExist(ad.mp_color_sub_button_dis_bg)){ mp_adtag.addImpressionParamValue("mp_color_sub_button_dis_bg", escape(ad.mp_color_sub_button_dis_bg)); } if(mp_adtag.paramExist(ad.mp_color_err_msg)){ mp_adtag.addImpressionParamValue("mp_color_err_msg", escape(ad.mp_color_err_msg)); } }

mp_adtag.resetAll = function(ad) { var nulVal = null; ad.nb_tag_id = nulVal; ad.nb_pp = nulVal; ad.nb_x2 = nulVal; ad.nb_x3 = nulVal; ad.nb_x4 = nulVal; ad.nb_domain = nulVal; ad.nb_site_section = nulVal; ad.nb_page_placement = nulVal; ad.optInfo = nulVal; mp_adtag.reset(); } 
mp_adtag.collectAdParams(window);
mp_adtag.render();
mp_adtag.resetAll(window);


function showErrorMsg(msg){  if (msg != null && msg != undefined && msg != ''){  alert(msg);  }  }  function trimLeading(str) {  return str.replace(/^\s+/g, ''); }  function trimTrailing(str) {  return str.replace(/\s+$/g, ''); }  function trimAll(str) {  return str.replace(/^\s+/g, '').replace(/\s+$/g, ''); }  function removeSpace(str){  return str.replace(/\s+/g, ''); }   function trim(str) {  return str.replace(/^\s*|\s*$/g,""); }   function validateRegexp(field, regexp, msg) {  var fieldval = trimAll(field);  var arr = fieldval.match(new RegExp(regexp)); 	result = eval(arr != null); 	if (!result){ 	 showErrorMsg(msg); 	}  return result;	 }  function controlSubmitButton(flag, formName){  if (flag){	 	 document.forms[formName].submitButton.disabled = false;  document.forms[formName].submitButton.className='submitButton';  }else{ 	 document.forms[formName].submitButton.disabled = true;  document.forms[formName].submitButton.className='submitButtonDisabled';   } }  function validateEmailAndButton(field, suffix){  validationResult = validateEmail(field.value);  var formName = "default"+suffix;   controlSubmitButton(validationResult, formName);  return validationResult; }  function validateEmail(fieldvalue, msg) {  var fieldval = trimAll(fieldvalue);  var arr = fieldval.match(/^([a-zA-Z0-9_.+\-])+@(([a-zA-Z0-9_+\-])+\.)+([a-zA-Z])+$/); 	result = eval(arr != null); 	if (!result){ 	 showErrorMsg(msg); 	}  return result;	 }  function validateNameAndButton(field, suffix){  field.value = removeSpace(field.value);  validationResult = validateAlpha(field.value);  if ('not valid'==field.value || 'required'==field.value){  validationResult = false;  }  var formName = "default"+suffix;   controlSubmitButton(validationResult, formName);  return validationResult; }  function validateAlpha(field, msg) {  var fieldval = trimAll(field);  var arr = fieldval.match(/^[a-z A-Z]+$/);  result = eval(arr != null);  if (!result){  showErrorMsg(msg);  }  return result; }  function validatePhoneAndButton(field, suffix){  validationResult = validatePhone(field.value);  var formName = "default"+suffix;   controlSubmitButton(validationResult, formName);  return validationResult; }  function validatePhone(field, msg) {  var fieldval = trimAll(field);  var arr = fieldval.match(/^[0-9]{10}$/);  result = eval(arr != null);  if (!result){  showErrorMsg(msg);  }  return result; }  function notvalid() {  return false; }  function validateZipAndButton(field, suffix){  validationResult = validateZip(field.value);  var formName = "default"+suffix;   controlSubmitButton(validationResult, formName);  return validationResult; }  function validateZip(zip, plus4, msg) {  var result; 	if(plus4 != undefined && plus4 != '') { 		result = validateRegexp(zip, "^\\d\\d\\d\\d\\d$") && 			validateRegexp(plus4, "^\\d\\d\\d\\d$") 	} else { 		result = validateRegexp(zip, "^\\d\\d\\d\\d\\d$") 	} 	if (!result){ 	 showErrorMsg(msg); 	}  return result;  }    var tempDiv;      function createForm(divId, htmlformCode, suffix){ 	 var formdivObj = document.getElementById('leadFormDiv' + suffix); 	 formdivObj.innerHTML = htmlformCode;  }    function getParameters(formobj) {  var getstr = "formName=" + formobj.name + "&";  for (i=0; i< formobj.elements.length; i++) {   if (formobj.elements[i].tagName == "INPUT") {   if (formobj.elements[i].type == "text") {  getstr += formobj.elements[i].name + "=" + formobj.elements[i].value + "&";  }else if (formobj.elements[i].type == "checkbox") {  if (formobj.elements[i].checked) {  getstr += formobj.elements[i].name + "=" + formobj.elements[i].value + "&";  } else {  getstr += formobj.elements[i].name + "=&";  }  }else if (formobj.elements[i].type == "radio") {  if (formobj.elements[i].checked) {  getstr += formobj.elements[i].name + "=" + formobj.elements[i].value + "&";  }  }else{  getstr += formobj.elements[i].name + "=" + formobj.elements[i].value + "&";  }  }   if (formobj.elements[i].tagName == "SELECT") {  var sel = formobj.elements[i]; 	 if (sel.options.length > 0 ){ 	 if (sel.selectedIndex == -1){ 	 sel.selectedIndex = 0; 	 } 	 getstr += sel.name + "=" + sel.options[sel.selectedIndex].value + "&";  }  }   }   return getstr;  }    function clearErrorMsgLine(formName, objectId, suffix){  var warningtr = document.getElementById(objectId+suffix); 		while (warningtr != null){ 			warningtr.parentNode.removeChild(warningtr); 			warningtr = document.getElementById(objectId+suffix); 		}   }    function clearMsg(field){  if (field.value == 'not valid' || field.value == 'required' || field.value == 'please enter a valid email address'){  field.value = "";  }  }   function doAjax(url, field, form, callback, reqType, dataType, suffix) {  	var query = getParameters(form);	  	clearErrorMsgLine(form.name, 'warningtr', suffix); 	tempDiv = document.getElementById('nb_tempDiv'+suffix); 	if (tempDiv == null){  tempDiv = document.createElement('div');  tempDiv.id = 'nb_tempDiv'+suffix; 	}  form.appendChild(tempDiv);  s = document.createElement('script');  if ( url.indexOf('?') != -1){  	 s.src = url + '&'+query + '&cbFunction=' + callback;   }else{  	 s.src = url + '?'+query + '&cbFunction=' + callback;  } 	if (tempDiv.hasChildNodes()){ 	 tempDiv.replaceChild(s, tempDiv.firstChild); 	}else{  	 tempDiv.appendChild(s); 	}   }   function doCallback(callback, data) {  	eval(callback + '(data)');  }   function showProxyEmail(proxyEmailData, suffix){   var fieldLine = document.getElementById(proxyEmailData.mpResponse.proxyEleId+'Row'+suffix);  fieldLine.style.visibility = 'visible';  var formName = proxyEmailData.mpResponse.formName;  document.forms[formName].submitButton.disabled = false;  document.forms[formName].submitButton.className='submitButton';  }   function appendErrorInLine(errorData, suffix){  if (errorData.mpResponse.errorField != null && trim(errorData.mpResponse.errorField) != ''){  var field;  var formName = errorData.mpResponse.formName;  var fieldObj;  fieldObj = document.getElementById(errorData.mpResponse.errorField + suffix);  errMsgColor = eval('document.forms[\''+formName+'\'].mp_color_err_msg.value');  fieldObj.style.color= errMsgColor;  if (fieldObj.value != ''){  if (errorData.mpResponse.errorField.indexOf('email') != -1 ){  fieldObj.value = 'please enter a valid email address';  }else{  fieldObj.value = 'not valid'  }   } else{  fieldObj.value = 'required';  }  document.forms[formName].submitButton.disabled = true;   document.forms[formName].submitButton.className='submitButtonDisabled';  } else{  var formName = errorData.mpResponse.formName;  document.forms[formName].submitButton.disabled = false;  document.forms[formName].submitButton.className='submitButton';  }   }    function appendErrorNewLine(errorData, suffix){   if (errorData.mpResponse.errorField != null && trim(errorData.mpResponse.errorField) != ''){  var field;  var formName = errorData.mpResponse.formName;  var fieldLine;  field = eval('document.forms[\'' + formName + '\'].elements[\''+ errorData.mpResponse.errorField+'\']');  fieldLine = document.getElementById(errorData.mpResponse.errorField+'Row'+suffix);  clearErrorMsgLine(formName, 'warningtr', suffix);   var line = document.createElement('tr');  line.id='warningtr'+suffix;  var cell = document.createElement('td');  if (window.ActiveXObject){  cell = document.createElement("<td colspan='3'>");  }else{  cell.setAttribute('colspan','3');  }  cell.innerHTML='<label class=error>' + errorData.mpResponse.errorMsg + '</label>';  line.appendChild(cell);  fieldLine.parentNode.insertBefore(line, fieldLine);  document.forms[formName].submitButton.disabled = true;   document.forms[formName].submitButton.className='submitButtonDisabled';  } else{  var formName = errorData.mpResponse.formName;  document.forms[formName].submitButton.disabled = false;  document.forms[formName].submitButton.className='submitButton';  }   }      function clientValidate(field, form, isRequired, jsFunctionName, errorMsg, suffix){  if (isRequired){  if (field.value == ''){  return false;  }  }  if (jsFunctionName == null || jsFunctionName == ''){  return true;  }  validationResult = eval(jsFunctionName);  if (!validationResult){  if (form.mp_err_msg_type.value == 'inline'){ 	 appendErrorInLine(eval('({"mpResponse": {"formName":"'+ form.name +'", "leadFormTableId":"defaulttable' + suffix +'", "errorField":"' + field.name +'","errorMsg":"'+ errorMsg +'"}})'), suffix);  }else{ 	 appendErrorNewLine(eval('({"mpResponse": {"formName":"'+ form.name +'", "leadFormTableId":"defaulttable' + suffix +'", "errorField":"' + field.name +'","errorMsg":"'+ errorMsg +'"}})'), suffix);  }  }  return validationResult;  }  function serverValidate(hostName, serviceName, field, form){  var url = hostName + serviceName;  doAjax(url, field, form, null, 'get', 1);  }   function validate(hostName, serviceName, field, form, isRequired, isServerValidationOnly, jsFunctionName, errorMsg, suffix){  field.style.color='';  if (!isServerValidationOnly) {    if(! clientValidate(field, form, isRequired, jsFunctionName, errorMsg, suffix) ){  return false;  }  }  if (isRequired && (field.value == null || trim(field.value) == '')){  if (document.getElementById('warningtr'+suffix)!= null){  return false;  }  if (form.mp_err_msg_type.value == 'inline'){ 	 	appendErrorInLine(eval('({"mpResponse": {"formName":"'+ form.name +'", "leadFormTableId":"defaulttable'+ suffix +'", "errorField":"' + field.name +'","errorMsg":"'+ field.name +' is a required field."}})'), suffix);  }else{ 	 	appendErrorNewLine(eval('({"mpResponse": {"formName":"'+ form.name +'", "leadFormTableId":"defaulttable'+ suffix +'", "errorField":"' + field.name +'","errorMsg":"'+ field.name +' is a required field."}})'), suffix);  } 	 return false; 	}     return serverValidate(hostName, serviceName, field, form); }  function enableEdit(formName, fieldNames){  var fieldsArray = fieldNames.split(',');  for (var i = 0; i < fieldsArray.length; i++){  var field = document.getElementsByName(fieldsArray[i])[0];  field.disabled = false;  } }  function checkRequiredFields(formName, disabledFieldNames, requiredFieldNames, suffix, requiredFieldLabels){  var thisForm = document.forms[formName];  var fieldsArray = requiredFieldNames.split(',');  var fieldLabelsArray = requiredFieldLabels.split(',');  for (var i = 0; i < fieldsArray.length; i++){  if (fieldsArray[i]==''){  continue;  }  var field = document.getElementsByName(fieldsArray[i])[0];  if (field.value == null || field.value == ''){  if (thisForm.mp_err_msg_type.value == 'inline'){  	 appendErrorInLine(eval('({"mpResponse": {"formName":"'+ formName +'", "leadFormTableId":"defaulttable'+ suffix +'", "errorField":"' + field.name +'","errorMsg":"'+ fieldLabelsArray[i] +' is a required field."}})'), suffix);  } else {  	 appendErrorNewLine(eval('({"mpResponse": {"formName":"'+ formName +'", "leadFormTableId":"defaulttable'+ suffix +'", "errorField":"' + field.name +'","errorMsg":"'+ fieldLabelsArray[i] +' is a required field."}})'), suffix);  }  return false;  } else {  if (field.name.indexOf('email')!=-1){  validationResult = validateEmailAndButton(field, suffix);  }else if(field.name.indexOf('zipcode')!=-1){  validationResult = validateZipAndButton(field, suffix);  }else if(field.name.indexOf('firstName')!=-1){  validationResult = validateNameAndButton(field, suffix);  }else if(field.name.indexOf('lastName')!=-1){  validationResult = validateNameAndButton(field, suffix);  }  if (!validationResult){  return false;  }  }  }  fieldsArray = disabledFieldNames.split(',');  for (var i = 0; i < fieldsArray.length; i++){  if (fieldsArray[i]==''){  continue;  }   var field = document.getElementsByName(fieldsArray[i])[0];  field.disabled = false;  }   thisForm.submit(); }     
