if(!($)){var $=function(el){if(typeof(el)=='string') el=document.getElementById(el)||false;return el;}} if(!(Class)){var Class={create:function(inheritFrom){if(typeof inheritFrom=='object'){Object.extend(this,inheritFrom);} return function(){this.initialize.apply(this,arguments);}}}} if(!window.event) var Event={};Event.observe=function(element,eventname,handler){el=$(element);if(!el){throw('Event.observe(): object does not exist');return;} if(el.addEventListener){el.addEventListener(eventname,handler,false);} else if(el.attachEvent){el.attachEvent("on"+eventname,handler);} else{var e="on"+eventname;el.e=handler;}} var Cookie={set:function(name,value,daysToExpire){var expire='';if(daysToExpire!=undefined){var d=new Date();d.setTime(d.getTime()+(86400000*parseFloat(daysToExpire)));expire='; expires='+d.toGMTString();} return(document.cookie=escape(name)+'='+escape(value||'')+expire);},get:function(name){var cookie=document.cookie.match(new RegExp('(^|;)\\s*'+escape(name)+'=([^;\\s]*)'));return(cookie?unescape(cookie[2]):null);},erase:function(name){var cookie=Cookie.get(name)||true;Cookie.set(name,'',-1);return cookie;},accept:function(){if(typeof navigator.cookieEnabled=='boolean'){return navigator.cookieEnabled;} Cookie.set('_test','1');return(Cookie.erase('_test')==='1');}};Object.extend=function(destination,source){for(var property in source) destination[property]=source[property];return destination;};window.scrollToAnimated=function(x,y){var initY=stepY=window.scrollY;var step=30;var interval=setInterval(function(){if(y>stepY+step){stepY+=step;window.scrollTo(x,stepY);} else{window.scrollTo(x,y);clearInterval(interval)}},25);} var Registry={objects:{},getObject:function(id){if(this.objects[id]) return this.objects[id] return;},setObject:function(id,content){this.objects[id]=content;}} tokens={singular:"chiropractor",plural:"chiropractors",host:"chiropractor-pages.com",base:"chiromatrixbase2.com",googlemaps_key:"ABQIAAAAUrStScXKmUlvLkdlj_ttQRTGizq1t3vWnjW4EeIJKUJQ_CWPsxSLX8Fk7WVrLP6-MhoDJYIozfjAGQ"} Registry.setObject('tokens',tokens);var TabsFactory=Class.create();TabsFactory.prototype={name:null,tabPersistence:true,tabs:[],activeClass:'activeClass',inactiveClass:'inactiveClass',activeTab:null,initialize:function(name){this.tabPersistence=true;this.name=name;this.tabs=new Array();this.activeTab=null;},addTab:function(tabSwitch,tabContent){if(typeof(tabSwitch)==='object'){tabContent=tabSwitch[1];tabSwitch=tabSwitch[0];} var tab=new Tab(tabSwitch,tabContent);if(!tab.tabSwitch)return;tab.activeClass=this.activeClass;tab.inactiveClass=this.inactiveClass;this.tabs.push(tab);var that=this;Event.observe(tab['tabSwitch'].id,'mousedown',function(){that.activateTab(tab['tabSwitch'].id);})},activateTab:function(tab){for(i=0;i'+from+' to '+to+'';directionsControls.appendChild(directionsTitle);directionsControls.appendChild(closeBtn);directionsControls.appendChild(printBtn);directionsControls.appendChild(getReverseBtn);directionsControls.appendChild(drivingDirections);that.directionsContainer.appendChild(directionsControls);that.directionsContainer.style.display="block";} this.directions.load('from: '+from+' to: '+to);} return true;},initialize:function(mapId){if(!GBrowserIsCompatible()){throw('GMapper: initialize(): Your browser is not compatible with googlemaps');return;} this.updated=false;var reasons=this.GErrorReasons=[];reasons[G_GEO_SUCCESS]="Success";reasons[G_GEO_MISSING_ADDRESS]="Missing Address: The address was either missing or had no value.";reasons[G_GEO_UNKNOWN_ADDRESS]="Unknown Address: No corresponding geographic location could be found for the specified address.";reasons[G_GEO_UNAVAILABLE_ADDRESS]="Unavailable Address: The geocode for the given address cannot be returned due to legal or contractual reasons.";reasons[G_GEO_BAD_KEY]="Bad Key: The API key is either invalid or does not match the domain for which it was given";reasons[G_GEO_TOO_MANY_QUERIES]="Too Many Queries: The daily geocoding quota for this site has been exceeded.";reasons[G_GEO_SERVER_ERROR]="Server error: The geocoding request could not be successfully processed.";this.bounds=new GLatLngBounds();this.markerCount=0;this.markerIconsPath='images/markers/' this.markerIconsImages=['iconA.png','iconB.png','iconC.png','iconD.png','iconE.png','iconF.png','iconG.png','iconH.png','iconI.png','iconJ.png','iconK.png','iconL.png','iconM.png','iconN.png','iconO.png'];this.compatible=true;this.controls=[];this.listings=[];this.loadingControl=null;this.map=null;this.zoomLevel=3;this.feedUrl=null;this.markers=new Array();this.setMap(mapId);},openDirectionsBox:function(marker){var that=this;var directionsBox=document.createElement('div');directionsBox.appendChild(marker['info']);var GDForm=document.createElement('form');var GDInput=document.createElement('input');GDInput.type='text';GDInput.name=GDInput.id=marker['point'].lat()+marker['point'].lng();directionsBox.innerHTML+='From: ';GDForm.appendChild(GDInput);var GDButton=document.createElement('input');GDButton.type='submit';GDButton.value='Get Directions';GDForm.appendChild(GDButton);Event.observe(GDForm,'submit',function(){that.map.closeInfoWindow();that.getDirections($(GDInput).value,marker['fulladdress']);return false;});directionsBox.appendChild(GDForm);marker['GMarker'].openInfoWindow(directionsBox);return true;},panTo:function(fulladdress,zoomLevel){var that=this;zoomLevel=parseInt(zoomLevel);if(!zoomLevel)zoomLevel=this.zoomLevel;else this.zoomLevel=zoomLevel;this.geocoder.getLocations(fulladdress,function(result){if(result.Status.code==G_GEO_SUCCESS){that.map.setZoom(zoomLevel);that.map.panTo(new GLatLng(result.Placemark[0].Point.coordinates[1],result.Placemark[0].Point.coordinates[0]));return true;} else{throw('GMapper: panTo(): Address ( '+fulladdress+' ) could not be found. Error code: '+result.Status.code);return false;}});},setDirectionsContainer:function(container){this.directions=new GDirections(this.map,$(container));this.directionsContainer=$(container);var that=this;GEvent.addListener(this.directions,"error",function(){if(that.directionsContainer){that.directionsContainer.innerHTML='';that.directionsContainer.style.display='none';that.directionsContainer.style.padding='0px';} alert("Sorry, failed to obtain directions");return false;});GEvent.addListener(this.directions,"addoverlay",function(){if(that.directionsContainer){window.scrollToAnimated(that.directionsContainer.offsetLeft,that.directionsContainer.offsetTop);} return true;});},setLoadingControl:function(loadingControl){this.loadingControl=$(loadingControl);},setMap:function(mapId){mapId=$(mapId);if(!mapId){throw('GMapper: setMap(): Map element could not be found');return false;} var map=new GMap2(mapId);this.map=map;map.setCenter(new GLatLng(37,-100),3);map.addControl(new GSmallMapControl());map.disableDoubleClickZoom();this.geocoder=new GClientGeocoder();return true;},update:function(feedUrl,attrs,page){if(!attrs||attrs=='undefined') return false;if(!page) page=1;if((feedUrl+'?'+attrs+'&page='+page)==(this.feedUrl+'?'+this.attrs+'&page='+this.page)) return false;if(this.loadingControl){this.loadingControl.start();} this.page=page;this.attrs=attrs;if(this.listings) this.listings.innerHTML='';if(this.directionsContainer){this.directionsContainer.innerHTML='';this.directionsContainer.style.display='none';this.directionsContainer.style.padding='0px';} this.markers=[];this.map.clearOverlays();this.feed=null;this.feedUrl=feedUrl;var that=this;var url=feedUrl+'?'+attrs+'&page='+page;var opt={url:url,generateUniqueUrl:true,onSuccess:function(req){var res=eval('('+req.responseText+')');if(typeof res=='object'){that._parseFeed(res);if(that.loadingControl){that.loadingControl.end();} hashListener.setHash(attrs);return true;} else{throw('GMapper: _getFeed(): FeedObject from '+feedUrl+' is corrupted');$('loading').style.display='none';return false;}}} AjaxRequest.get(opt);this.updated=true;},_generateFullAddress:function(country,state,city,address){if(state=='Washington')state='WA';var fulladdress='';if(country)fulladdress=country;if(state)fulladdress=state+', '+fulladdress;if(city)fulladdress=city+', '+fulladdress;if(address)fulladdress=address+', '+fulladdress;return fulladdress;},_generateAttrsUrl:function(country,state,city){var attrsUrl='';if(country)attrsUrl+='country='+country;if(state)attrsUrl+='&state='+state;if(city)attrsUrl+='&city='+city;return attrsUrl;},_generateInfoBox:function(profile){var infoBox=document.createElement('div');infoBox.className='mapBalloon';var practiceName=document.createElement('h3');var profileLink=document.createElement('a');var link='';if(profile['country']||profile['state']||profile['city']){if(profile['country']) link+='/'+profile['country'];if(profile['state']) link+='/'+profile['state'];if(profile['city']) link+='/'+profile['city'];link+='/'+profile['label']+'/'} else link='/directory.php?client='+profile['label'];link=link.replace(/\s/g,'_').replace(/&/g,"'n'").toLowerCase();profileLink.href=link;profileLink.innerHTML=profile['label'];practiceName.appendChild(profileLink);var profAddr=document.createElement('p');profAddr.innerHTML=profile['address']+'
'+profile['city']+', '+(profile['state']?profile['state']:'')+' '+profile['zip']+'
'+profile['phone'];infoBox.appendChild(practiceName);infoBox.appendChild(profAddr);return infoBox;},_parseFeed:function(feed){this.feed=feed;var fulladdress=this._generateFullAddress(feed.location.country,feed.location.state,feed.location.city,feed.location.address);if(!fulladdress){this.map.setCenter(new GLatLng(0,0),1);} else{this.panTo(fulladdress,feed.zoomLevel);} for(var i=0;ithis.totalCount)last=this.totalCount;if(this.currentPage>1){var previousLink=new PaginationNumber('Prev','a','pagination_prev',this.handler,parseInt(this.currentPage)-1);} else{var previousLink=new PaginationNumber('Prev','a','pagination_prev_faded');} wrapper.appendChild(previousLink.getPaginationNumber());for(var i=first;i<=last;i++){if(i==this.currentPage){var eLink=new PaginationNumber(i,'span');} else{var eLink=new PaginationNumber(i,'a','pagination_number',this.handler,i);} wrapper.appendChild(eLink.getPaginationNumber());} if(this.currentPagewindow._hash = '"+s+"';parent.hashListener.syncHash();<\/script>");d.close();},syncHash:function(){var s=this._hash;if(s!=document.location.hash){document.location.hash=s;}},onHashChanged:function(){}};var LoadingControl=Class.create();LoadingControl.prototype={container:null,initialize:function(container){container=$(container);if(container) this.container=container;else throw('LoadingControl: initialize(): Container not found');},start:function(){this.container.style.display='block';},end:function(){this.container.style.display='none';}};var GMapperControl=Class.create();GMapperControl.prototype={GMapper:{},tokens:{},initialize:function(container){this.container=$(container);this.tokens=Registry.getObject('tokens');},feed:function(){throw('GMapperControl: feed(): Function not implemented in the Control')}} var BreadCrumbsGMapperControl=Class.create();BreadCrumbsGMapperControl.prototype=Object.extend(new GMapperControl,{feed:function(feed){var location=feed.location;var that=this;this.container.innerHTML='';var tw=document.createElement('a');tw.innerHTML='The World';tw.id='theWorldLink';tw.href='javascript:void(0)';tw.title=this.tokens.plural+' around the world';this.container.appendChild(tw);Event.observe(tw,'click',function(){that.GMapper.update(that.GMapper.feedUrl,'country=all')});var arr=['country','state','city'];for(var i=0;i '));var aL=document.createElement('a');aL.innerHTML=location[arr[i]];aL.id=arr[i]+'BreadCrumbs';aL.href='javascript:void(0)';this.container.appendChild(aL);if(arr[i]=='country'){aL.title=this.tokens.plural+' in '+location.country;Event.observe(aL,'click',function(){that.GMapper.update(that.GMapper.feedUrl,that.GMapper._generateAttrsUrl(location.country))});} else if(arr[i]=='state'){aL.title=this.tokens.plural+' in '+location.state;Event.observe(aL,'click',function(){that.GMapper.update(that.GMapper.feedUrl,that.GMapper._generateAttrsUrl(location.country,location.state))});} else if(arr[i]=='city'){aL.title=this.tokens.plural+' in '+location.city;Event.observe(aL,'click',function(){that.GMapper.update(that.GMapper.feedUrl,that.GMapper._generateAttrsUrl(location.country,location.state,location.city))});}}};return true;}});var HistoryGMapperControl=Class.create();HistoryGMapperControl.prototype=Object.extend(new GMapperControl,{className:'go_back',feed:function(feed){var location=feed.location;var that=this;this.container.innerHTML='';var aLink=document.createElement('a');aLink.href='javascript:void(0)';aLink.className=this.className;if(location.city){aLink.title='Back to '+location.city;aLink.innerHTML=location.state||location.country;Event.observe(aLink,'click',function(){that.GMapper.update(that.GMapper.feedUrl,that.GMapper._generateAttrsUrl(location.country,location.state))});} else if(location.state){aLink.title='Back to '+location.state;aLink.innerHTML=location.country;Event.observe(aLink,'click',function(){that.GMapper.update(that.GMapper.feedUrl,that.GMapper._generateAttrsUrl(location.country))});} else if(location.country){aLink.title='Back to '+location.country;aLink.innerHTML='The World';Event.observe(aLink,'click',function(){that.GMapper.update(that.GMapper.feedUrl,'country=all')});} this.container.appendChild(aLink);}});var CurrentGMapperControl=Class.create();CurrentGMapperControl.prototype=Object.extend(new GMapperControl,{feed:function(feed){var location=feed.location this.container.innerHTML='';var dCurrent='';var arr=['country','state','city'];for(var i=0;i0){var first=((feed.childrenCurrentPage-1)*feed.childrenPerPage)+1;var last=Math.min(feed.childrenCount,feed.childrenCurrentPage*feed.childrenPerPage);this.container.innerHTML='Results '+first+'-'+last+' of '+feed.childrenCount+' '+this.tokens.singular+' near '+this.GMapper._generateFullAddress(feed.location.country,feed.location.state,feed.location.city)+'';} else{if(feed.location.state) var sel='city' else if(feed.location.country){if(feed.location.country=='USA'||feed.location.country=='Canada') var sel='state';else var sel='city';} else var sel='country';this.container.innerHTML="

Please select a "+sel+" from the listing on the right to find a "+this.tokens.singular+" in that area.

"}}});var GMapperListing=Class.create();GMapperListing.prototype={GMapper:{},paginationContainer:null,tokens:{},initialize:function(container,paginationContainer){this.container=$(container);this.paginationContainer=paginationContainer;this.paginator=new Paginator();var that=this;this.paginator.setHandler(function(page){that.GMapper.update(that.GMapper.feedUrl,that.GMapper.attrs,page)});this.tokens=Registry.getObject('tokens');},feed:function(){throw('GMapperListing: feed(): Function not implemented in the Listing')}} var VerticalGMapperListing=Class.create();VerticalGMapperListing.prototype=Object.extend(new GMapperListing,{feed:function(markers){this.container.innerHTML='';var ul=document.createElement('ul');var premium_classname='premium_even';if(markers[0]['last']){marker=markers[0];var link='';var aExpandedListings=document.createElement('a');var location=this.GMapper.feed.location;if(location.country) link+='/'+location.country;if(location.state) link+='/'+location.state;if(location.city) link+='/'+location.city;aExpandedListings.title="Expanded "+this.tokens.singular+" listing for "+marker.city;aExpandedListings.href=link.replace(/\s/g,'_').toLowerCase()+'/';aExpandedListings.innerHTML='Expanded Listings';aExpandedListings.className='expandedListings';this.container.appendChild(aExpandedListings);} var premiumClass='premium_even';var listingClasses=['listing_a','listing_b','listing_c','listing_d','listing_e','listing_f','listing_g','listing_h','listing_i','listing_j','listing_k','listing_l','listing_m','listing_n','listing_o'];for(var i in markers)if(typeof markers[i]=='object'||typeof markers[i]=='array'){var marker=markers[i];var li=document.createElement('li');var listing=new Listing(marker);if(!(marker['premium']==1)){var aLabel=listing.getProperty('label','a');aLabel.href='javascript:void(0)';if(!marker['last']){aLabel.title=this.tokens.singular+' in '+listing.marker.profile.label;li.appendChild(aLabel);} else{li.className=listingClasses[i];var h4label=document.createElement('h4');h4label.appendChild(aLabel);var p=document.createElement('p');p.appendChild(h4label);p=listing.getProperty('address',p);p.appendChild(document.createElement('br'));p=listing.getProperty('city',p);p.appendChild(document.createTextNode(', '));p=listing.getProperty('zip',p);p.appendChild(document.createElement('br'));p=listing.getProperty('phone',p);li.appendChild(p);var controls=listing.getProfileControls(['ViewProfileControl']);li.appendChild(controls);}} else{var premiumClass=('premium_even'==premiumClass)?'premium_odd':'premium_even';if(marker['last'])li.className=premiumClass;li.appendChild(listing.getPicture());var h4label=document.createElement('h4');var aLabel=listing.getProperty('label','a');aLabel.href='javascript:void(0)';h4label.appendChild(aLabel);li.appendChild(h4label);var p=document.createElement('p');p=listing.getProperty('address',p);p.appendChild(document.createElement('br'));p=listing.getProperty('city',p);p.appendChild(document.createTextNode(', '));p=listing.getProperty('zip',p);p.appendChild(document.createElement('br'));p=listing.getProperty('phone',p);li.appendChild(p);if(marker['last']){listing.GMapper=this.GMapper;var controls=listing.getProfileControls();li.appendChild(controls);}} listing.setClickEvent(aLabel,marker,this.GMapper);ul.appendChild(li);} this.container.appendChild(ul);this.paginator.getPagination(this.paginationContainer);}});var Listing=Class.create();Listing.prototype={marker:{},GMapper:{},htmlElement:{},controls:[],initialize:function(marker){if(!marker.profile){this.marker=Object.extend(this.marker,marker);this.marker.profile={label:marker['label']}} else this.marker=marker;if(marker.premium) marker.profile.premium=1;this.controls=['WebsiteProfileControl','ClickToCallProfileControl','EmailProfileControl','SendSMSProfileControl','SendToFriendProfileControl','ViewProfileControl'];},getProfileControls:function(controls,wrapper){if(!controls)controls=this.controls;if(!wrapper)wrapper='div';var wrapperEl=document.createElement(wrapper);for(var i=0;i0){req.queryString+="&";}req.queryString+=encodeURIComponent(i)+"="+encodeURIComponent(req.parameters[i]);}if(req.method=="GET"){if(req.queryString.length>0){req.url+=((req.url.indexOf("?")>-1)?"&":"?")+req.queryString;}}req.xmlHttpRequest.open(req.method,req.url,req.async,req.username,req.password);if(req.method=="POST"){if(typeof(req.xmlHttpRequest.setRequestHeader)!="undefined"){req.xmlHttpRequest.setRequestHeader('Content-type','application/x-www-form-urlencoded');}content=req.queryString;}if(req.timeout>0){setTimeout(req.onTimeoutInternal,req.timeout);}req.xmlHttpRequest.send(content);}};req.handleArguments=function(args){for(var i in args){if(typeof(req[i])=="undefined"){req.parameters[i]=args[i];}else{req[i]=args[i];}}};req.getAllResponseHeaders=function(){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getAllResponseHeaders();}alert("Cannot getAllResponseHeaders because a response has not yet been received");}};req.getResponseHeader=function(headerName){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getResponseHeader(headerName);}alert("Cannot getResponseHeader because a response has not yet been received");}};return req;}AjaxRequest.getXmlHttpRequest=function(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else if(window.ActiveXObject){}else{return null;}};AjaxRequest.isActive=function(){return(AjaxRequest.numActiveAjaxRequests>0);};AjaxRequest.get=function(args){AjaxRequest.doRequest("GET",args);};AjaxRequest.post=function(args){AjaxRequest.doRequest("POST",args);};AjaxRequest.doRequest=function(method,args){if(typeof(args)!="undefined"&&args!=null){var myRequest=new AjaxRequest();myRequest.method=method;myRequest.handleArguments(args);myRequest.process();}};AjaxRequest.submit=function(theform,args){var myRequest=new AjaxRequest();if(myRequest==null){return false;}var serializedForm=AjaxRequest.serializeForm(theform);myRequest.method=theform.method.toUpperCase();myRequest.url=theform.action;myRequest.handleArguments(args);myRequest.queryString=serializedForm;myRequest.process();return true;};AjaxRequest.serializeForm=function(theform){var els=theform.elements;var len=els.length;var queryString="";this.addField=function(name,value){if(queryString.length>0){queryString+="&";}queryString+=encodeURIComponent(name)+"="+encodeURIComponent(value);};for(var i=0;i=0){this.addField(el.name,el.options[el.selectedIndex].value);}break;case'select-multiple':for(var j=0;jwindow._hash = '"+s+"';parent.hashListener.syncHash();<\/script>");d.close();},syncHash:function(){var s=this._hash;if(s!=document.location.hash){document.location.hash=s;}},onHashChanged:function(){}};var bustcachevar=1 var loadedobjects="" var rootdomain="http://"+window.location.hostname var bustcacheparameter="" function ajaxpage(url,containerid,oncomplete){var page_request=false if(!oncomplete)oncomplete=false;if(window.XMLHttpRequest) page_request=new XMLHttpRequest() else if(window.ActiveXObject){try{page_request=new ActiveXObject("Msxml2.XMLHTTP")} catch(e){try{page_request=new ActiveXObject("Microsoft.XMLHTTP")} catch(e){}}} else return false page_request.onreadystatechange=function(){loadpage(page_request,containerid) if(page_request.readyState==4&&oncomplete){oncomplete.apply(this,arguments);}} if(bustcachevar) bustcacheparameter=(url.indexOf("?")!=-1)?"&"+new Date().getTime():"?"+new Date().getTime() page_request.open('GET',url+bustcacheparameter,true) page_request.send(null)} function loadpage(page_request,containerid){if(page_request.readyState==4&&(page_request.status==200||window.location.href.indexOf("http")==-1)) document.getElementById(containerid).innerHTML=page_request.responseText} function loadobjs(){if(!document.getElementById) return for(i=0;i