function DoRelocationSearch(D){var B=D.zipcode.value;var A=10;if(B==""){SetInnerHtml("officesearchresults","<i>Please enter your zip code to find local offices that are in, or serve, your area.</i>");return }onChange="DoRelocationSearch(this.form);";var C=obj("officesearchresults");SetInnerHtml("officesearchresults",'<div style="border:1px solid #4f779e;padding:4px;background:#eee;"><img src="/images/search/loading.gif" alt="loading..."> Locating your local offices...</div>');var E="/ajaxservlet/search/officesearch?rpp=50&z="+escape(B)+"&r="+A;
g_CyberAjaxQueue.schedule("officesearch",E,onCompleteRelocationSearch,onErrorRelocationSearch,true,true,null)}function onCompleteRelocationSearch(C){var J="";try{var A=C.responseXML.getElementsByTagName("officesearchresults");if(!A||A.length!=1){onErrorRelocationSearch(C);return }var G=A[0];var D=G.getElementsByTagName("office");if(D&&D.length>=1){var J='<table class="datatable" width="100%" style="font-size:0.9em">';var I=new Date();var F=I.getTime();var B=(F%D.length);for(var E=0;E<D.length;E++){strClass="odd";
if((E%2)==0){strClass="even"}officekey=CyberGetNodeValue(D[E],"officekey");officename=CyberGetNodeValue(D[E],"officename");address=CyberGetNodeValue(D[E],"address");city=CyberGetNodeValue(D[E],"city");state=CyberGetNodeValue(D[E],"state");zipcode=CyberGetNodeValue(D[E],"zipcode");phonenumber=CyberGetNodeValue(D[E],"phonenumber");weburl=CyberGetNodeValue(D[E],"weburl");J+="<tr>";if(B==E){J+='<td class="'+strClass+'"><input type=checkbox name="officekey" value="'+officekey+'" checked=checked></td>'}else{J+='<td class="'+strClass+'"><input type=checkbox name="officekey" value="'+officekey+'"></td>'
}J+='<td class="'+strClass+'">'+officename+"</td>";J+='<td class="'+strClass+'">'+address+"</td>";J+='<td class="'+strClass+'">'+city+", "+state+" "+zipcode+"</td>";J+='<td class="'+strClass+'">'+phonenumber+"</td>";J+="</tr>"}J+="</table>";SetInnerHtml("officesearchresults",J)}else{SetInnerHtml("officesearchresults",'<div style="border:1px solid #cc0000;padding:4px;background:#eee;"><b>No offices serving your selected area</b><br>There are currently no ERA offices near or that serve in this zip code with the radius that is specified. Please try your search again with a different zip code or radius range to view a list of offices. You may choose to click the "Submit" button, which will send your information directly to ERA corporate headquarters instead of to a specific office. If you have any questions, please contact the ERA Referrals Center at 1-800-798-8900. </div>')
}}catch(H){alert(H.message)}}function onErrorRelocationSearch(A){SetInnerHtml("officesearchresults",'<div style="border:1px solid #cc0000;padding:4px;background:#eee;"><b>Could not complete office search'+A.responseText+"</b></div>")};
