var h=null;
(function(){function k(a,b){var c=this.a=new i;this.e=a;this.options=z(b,A);this.f=new p.InfoWindow;this.build();c.setCenterPoint(a);this.options.resultSetSize&&c.setResultSetSize(this.options.resultSetSize);c.setSearchCompleteCallback(this,k.prototype.searchCompleteCallback);typeof this.options.buildCompleteCallback=="function"&&this.options.buildCompleteCallback.apply(this,[])}function i(){this.options={v:"1.0",callback:"window.jeremy.gLocalSearch.callback",context:i.searchers.length};i.searchers.push(this)}
function m(a,b,c){c=this.options=z(c,{buttonText:"Search",hintString:"Search the map!"});var d=this;a=d.form=e("form","gsc-search-box",[e("table","gsc-search-box",[e("tbody",h,[e("tr",h,[e("td","gsc-input",[d.input=e("input","gsc-input",h,{type:"text",autocomplete:"off",size:10,name:"search",title:"search",value:c.hintString,onfocus:s(d,m.prototype.i),onblur:s(d,m.prototype.i)})]),e("td","gsc-search-button",[d.button=e("input","gsc-search-button",h,{type:"submit",value:c.buttonText,title:"search"})]),
d.m=a?e("td","gsc-clear-button",[e("div","gsc-clear-button",[" "],{title:"clear results",onclick:function(){d.form.clearResults()}})]):h])])],{cellspacing:0,cellpadding:0}),e("table","gsc-branding",[e("tbody",h,[e("tr",h,[e("td","gsc-branding-user-defined"),e("td","gsc-branding-text",[e("div","gsc-branding-text",["powered by"])]),e("gsc-branding-img-noclear",[e("img","gsc-branding-img-noclear",h,{src:"http://www.google.com/uds/css/small-logo.png"})])])])])],{"accept-charset":"utf-8"});b&&b.appendChild(a)}
function e(a,b,c,d,j){a=document.createElement(a||"div");if(b)a.className=b;if(c)for(var g=0;g<c.length;g++){b=c[g];if(typeof b=="string"||typeof b=="number")a.innerHTML+=b;else try{a.appendChild(c[g])}catch(t){}}if(d)for(g in d)if(g.match(/^on/)&&n(d[g],"function"))a[g]=d[g];else a.setAttribute(g,d[g]);if(j)for(g in j)a.style[g]=j[g];return a}function f(a,b,c,d){return e("div",a,b,c,d)}function s(a,b,c){return function(){return b.apply(a,c?c:arguments)}}function x(a){for(;a.firstChild;)a.removeChild(a.firstChild)}
function z(){for(var a={},b=arguments||[],c=0;c<b.length;c++){var d=b[c],j;for(j in d)if(typeof a[j]=="undefined")a[j]=d[j]}return a}function n(a,b){return typeof a==b}for(var p=google.maps,A={resultSetSize:8,clearResultsString:"X",minimizeResultsString:"_",maximizeResultsString:"^",icons:[],shadow:new p.MarkerImage("http://www.google.com/mapfiles/gadget/shadow50Small80.png",h,h,new p.Point(8,28)),showResultsList:true,showResultsMarkers:true,searchFormOptions:{}},u=0;u<8;u++)A.icons.push(google.loader.ServiceBase+
"/solutions/localsearch/img/pin_metalred_"+String.fromCharCode(65+u)+".png");if(!window.noGBarCSS){u=e("link",h,h,{href:"http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css",rel:"stylesheet",type:"text/css"});var C=e("link",h,h,{href:"/default.css",rel:"stylesheet",type:"text/css"}),B=document.getElementsByTagName("head")[0];B.appendChild(u);B.appendChild(C)}k.prototype.build=function(){function a(){b.c.className=b.c.className.replace(/\bgmls-search-form-idle\b/,"gmls-search-form-active")}
var b=this,c=b.options;b.container=f("gmls",[b.innerContainer=f("gmls-app gmls-idle gmls-app-full-mode gmls-std-mode",[b.resultsDiv=f("gmls-results-popup gmls-results-popup-maximized",[f("gmls-results-list",[f("gmls-results-table",[e("table","gmls-results-table",[b.resultsTable=e("tbody")])]),f("gmls-results-controls",[e("table","gmls-results-controls",[e("tbody",h,[e("tr",h,[e("td","gmls-more-results gsc-results",[f("gsc-cursor-box",[b.pageDiv=f("gsc-cursor")])]),e("td","gmls-prev-next"),e("td",
"gmls-clear-results",[f("gmls-minimize-results gmls-control-button",[b.options.minimizeResultsString],{onclick:function(){b.minimizeResults()}}),f("gmls-maximize-results gmls-control-button",[b.options.maximizeResultsString],{onclick:function(){b.maximizeResults()}}),f("gmls-clear-results gmls-control-button",[b.options.clearResultsString],{onclick:function(){b.form.clearResults()}})])])])])]),b.attributionDiv=f("gmls-attribution")])]),b.c=f("gmls-search-form gmls-search-form-idle")])]);var d=b.form=
new m(0,b.c,c.p);b.input=d.input;if(c.resultList){x(c.resultList);c.resultList.appendChild(b.c);c.resultList.appendChild(b.resultsDiv)}d.setOnFocusListener(b,a);d.setOnBlurListener(b,a);d.setOnSubmitCallback(b,k.prototype.execute);d.setOnClearCallback(b,k.prototype.clearResults)};k.prototype.execute=function(a){var b=this.a,c=this.input;this.clearResults();if(typeof a=="string")c.value=a;b.execute(c.value);return false};k.prototype.clearResults=function(){var a=this.resultsTable,b=this.innerContainer,
c=this.a.results,d=this.pageDiv;this.f.close();b.className=b.className.replace(/\bgmls-active\b/,"gmls-idle");if(c){x(a);x(d);for(a=0;a<c.length;a++)c[a].marker.setMap(h)}};k.prototype.minimizeResults=function(){var a=this.resultsDiv;a.className=a.className.replace(/\b(gmls-results-popup-)maximized\b/g,"$1minimized")};k.prototype.maximizeResults=function(){var a=this.resultsDiv;a.className=a.className.replace(/\b(gmls-results-popup-)minimized\b/g,"$1maximized")};k.prototype.searchCompleteCallback=
function(){function a(y){return function(){c.gotoPage(y)}}function b(y){return function(){k.prototype.selectResult.apply(c,[y])}}var c=this,d=c.a,j=d.results,g=d.cursor,t=c.pageDiv,w=c.resultsTable;d.getAttribution();var q=c.e,r=c.options;d=d.resultViewport;var l=new p.LatLngBounds(new p.LatLng(parseFloat(d.sw.lat),parseFloat(d.sw.lng)),new p.LatLng(parseFloat(d.ne.lat),parseFloat(d.ne.lng)));d=c.innerContainer;r.suppressCenterAndZoom||q.fitBounds(l);for(l=0;l<j.length;l++){var o=j[l],v=String.fromCharCode(65+
l);v=o.listHtml=e("tr",h,[e("td",h,[f("gmls-result-list-item",[f("gmls-result-list-item-key gmls-result-list-item-key-"+v+" gmls-result-list-item-key-local-"+v+" gmls-result-list-item-key-keymode",["&nbsp;"]),f("gs-title",[o.title]),f("gs-street",["&nbsp;-&nbsp;"+o.streetAddress])])])]);var D=o.marker=new p.Marker({map:r.showResultsMarkers?q:h,position:new p.LatLng(parseFloat(o.lat),parseFloat(o.lng)),title:o.title,icon:typeof r.icons=="string"?r.icons:r.icons[l],shadow:r.shadow,shape:r.markerShape});
o=b(o);p.event.addDomListener(v,"click",o);p.event.addListener(D,"click",o);r.showResultsList&&w.appendChild(v)}for(l=0;g.pages&&l<g.pages.length;l++)t.appendChild(f("gsc-cursor-page"+(l==g.currentPageIndex?" gsc-cursor-current-page":""),[g.pages[l].label],{onclick:a(l)}));d.className=d.className.replace(/\bgmls-idle\b/,"gmls-active")};k.prototype.setResultSetSize=function(a){this.a.setResultSetSize(a)};k.prototype.selectResult=function(a){for(var b=this.a,c=b.results,d=this.e,j=this.f,g=a.marker,
t=0;t<b.results.length;t++){var w=c[t],q=w.listHtml.firstChild.firstChild;if(w===a){if(!q.className.match(/\bgmls-selected\b/))q.className=q.className+=" gmls-selected"}else q.className=q.className.replace(/ gmls-selected/g,"")}j.close();j.setContent(a.html);j.open(d,g)};k.prototype.gotoPage=function(a){var b=this.a;this.clearResults();b.gotoPage(a)};k.prototype.setQueryAddition=function(a){this.a.setQueryAddition(a)};i.prototype.setCenterPoint=function(a){var b=this.options;if(n(a.lat,"function")&&
n(a.lng,"function")&&n(a.toUrlValue,"function"))b.sll=a.toUrlValue(6);else if(n(a.getCenter,"function")&&n(a.getBounds,"function")){b.sll=function(){return a.getCenter().toUrlValue(6)};b.gll=function(){return a.getBounds().toUrlValue(7).replace(/\./g,"")};b.sspn=function(){return a.getBounds().toSpan().toUrlValue(6)}}else if(n(a,"string"))b.sll=a};i.prototype.setResultSetSize=function(a){this.options.rsz=a};i.prototype.execute=function(a,b){var c=this.options,d=this.j,j=this.l;if(!n(b,"number")||
!d){d=[];for(var g in c)d.push([g,encodeURIComponent(n(c[g],"function")?c[g]():c[g])].join("="))}b&&d.push(["start",encodeURIComponent(b)].join("="));d.push(["q",encodeURIComponent((a?a:this.b)+(j?" "+j:""))].join("="));if(a||b&&this.b){this.b=a||this.b;c=e("script",h,h,{type:"text/javascript",src:i.k+d.join("&")});document.getElementsByTagName("head")[0].appendChild(c)}this.j=d.slice(0,d.length-(b?2:1))};i.prototype.setSearchCompleteCallback=function(a,b,c){this.h=s(a,b,c)};i.prototype.gotoPage=
function(a){var b=this.options.rsz;n(b,"number")||(b=n(b,"string")&&b.match(/^large$/)?8:4);this.execute(this.b,b*a)};i.prototype.RAWcallback=function(a){var b=this.results=a.results;this.cursor=a.cursor;this.resultViewport=a.viewport;this.d=a.attribution;for(a=0;a<b.length;a++)this.createResultHtml(b[a]);n(this.h,"function")&&this.h()};i.prototype.getAttribution=function(){if(!this.d)return false;return f("gs-results-attribution",[this.d])};i.prototype.createResultHtml=function(a){a.html=f("gs-result gs-localResult",
[f("gs-title",[e("a","gs-title",[a.title],{href:a.url})]),f("gs-snippet",[a.snippet]),f("gs-address",[f("gs-street gs-addressLine",[a.streetAddress]),f("gs-city gs-addressLine",[a.city+", "+a.region]),f("gs-country",[a.country])]),f("gs-phone",[a.phoneNumbers&&a.phoneNumbers[0]?a.phoneNumbers[0].number:h]),f("gs-directions")])};i.prototype.setQueryAddition=function(a){this.l=a};i.searchers=[];i.callback=function(a,b){i.searchers[a].RAWcallback(b)};i.k="http://ajax.googleapis.com/ajax/services/search/local?";
m.prototype.setOnSubmitCallback=function(a,b,c){var d=this.form;c||(c=[]);c.splice(0,0,this);d.onsubmit=s(a,b,c)};m.prototype.setOnClearCallback=function(a,b,c){c||(c=[]);c.splice(0,0,this);this.g=s(a,b,c)};m.prototype.execute=function(a){var b=this.form;this.input.value=a;b.submit()};m.prototype.setOnFocusListener=function(a,b,c){this.o=s(a,b,c)};m.prototype.setOnBlurListener=function(a,b,c){this.n=s(a,b,c)};m.prototype.i=function(a){var b=this.input,c=this.options.hintString;if(!a)a=window.event;
if(a.type=="focus"){if(b.value==c)b.value="";if(this.onfocuslistener)return this.onfocuslistener()}else if(a.type=="blur"){if(b.value=="")b.value=c;if(this.onblurlistener)return this.onblurlistener()}};m.prototype.clearResults=function(){this.form.reset();if(this.g)return this.g()};window.jeremy||(window.jeremy={});window.jeremy.jGoogleBar=k;window.jeremy.jGoogleBar.prototype=k.prototype;window.jeremy.gLocalSearch=i;window.jeremy.gLocalSearch.prototype=i.prototype;window.jeremy.SearchForm=m;window.jeremy.SearchForm.prototype=
m.prototype})();

