var REFERRER_URL_PLACE_HOLDER=":referrerUrl";var EVENT_TYPE_PLACE_HOLDER=":eventType";var PAGE_ID_PLACE_HOLDER=":pageId";var FROM_ADDRESS_PLACE_HOLDER=":fromAddress";var TO_ADDRESS_PLACE_HOLDER=":toAddress";var BODY_PLACE_HOLDER=":body";var FROM_NAME_PLACE_HOLDER=":name";var DETAIL_PLACE_HOLDER=":detail";var LANG_PLACE_HOLDER=":language";var MICROSITE_EVENT_PATH="eventaction?referrer="+REFERRER_URL_PLACE_HOLDER+"&eventType="+EVENT_TYPE_PLACE_HOLDER+"&pageId="+PAGE_ID_PLACE_HOLDER+"&detail="+DETAIL_PLACE_HOLDER;var MICROSITE_EMAIL_PATH="emailaction?referrer="+REFERRER_URL_PLACE_HOLDER+"&eventType="+EVENT_TYPE_PLACE_HOLDER+"&pageId="+PAGE_ID_PLACE_HOLDER+"&toAddress="+TO_ADDRESS_PLACE_HOLDER+"&fromAddress="+FROM_ADDRESS_PLACE_HOLDER+"&body="+BODY_PLACE_HOLDER+"&fromName="+FROM_NAME_PLACE_HOLDER+"&detail="+DETAIL_PLACE_HOLDER+"&language="+LANG_PLACE_HOLDER;var YAHOO_DIRECTIONS_URL="http://maps.yahoo.com/?q2="+TO_ADDRESS_PLACE_HOLDER+"&q1="+FROM_ADDRESS_PLACE_HOLDER;var MAP_DIRECTIONS_URL="http://maps.google.com/?daddr="+TO_ADDRESS_PLACE_HOLDER+"&saddr="+FROM_ADDRESS_PLACE_HOLDER;var EVENT_TYPE_VISIT_WEB_SITE="EVENT_TYPE_VISIT_WEB_SITE";var EVENT_TYPE_EMAIL_US="EVENT_TYPE_EMAIL_US";var EVENT_TYPE_SEND_TO_FRIEND="EVENT_TYPE_SEND_TO_A_FRIEND";var EVENT_TYPE_ADD_TO_BOOKMARKS="EVENT_TYPE_ADD_TO_BOOKMARKS";var EVENT_TYPE_PRINT="EVENT_TYPE_PRINT";var EVENT_TYPE_GET_DIRECTIONS="EVENT_TYPE_GET_DIRECTIONS";var EVENT_TYPE_MAP_INTERACTION="EVENT_TYPE_MAP_INTERACTION";var EVENT_TYPE_PAGE_VIEW="EVENT_TYPE_PAGE_VIEW";var EVENT_TYPE_CLICK_THROUGH="EVENT_TYPE_CLICK_THROUGH";var EVENT_TYPE_COUPON_CLICK="EVENT_TYPE_COUPON_CLICK";var EVENT_TYPE_LINK_FOLLOWED="EVENT_TYPE_LINK_FOLLOWED";var EVENT_TYPE_MAILTO="EVENT_TYPE_MAILTO";var EVENT_TYPE_COUPON_PRINT="EVENT_TYPE_COUPON_PRINT";var EVENT_TYPE_FORM="EVENT_TYPE_FORM";var MAP_CONTAINER_ELEMENT_ID="mapContainer";var MAP_SHOW_ZOOM_CONTROLS=true;var MAP_SHOW_PAN_CONTROLS=true;var IE="browser.type.ie";var FIREFOX="browser.type.firefox";var UNKNOWN="browser.typer.unknown";function MicrositeClient(k,c,o,q,l,j,e){this.micrositeServiceRootUrl=k;this.referrerUrl=c;this.pageId=o;this.mapLatitude=q;this.mapLongitude=l;this.singletonMapInteraction=false;this.lastPrintedId=null;this.openInSameWindow=j;this.trans=e;this.micrositeEvent=function(u,t){this.micrositeEventForSpecifiedPageId(u,t,this.pageId)};this.micrositeEventForSpecifiedPageId=function(u,t,v){if(!t){t=""}if(!v||v==""){specifiedpageId=this.pageId}var w=this.micrositeServiceRootUrl+MICROSITE_EVENT_PATH;w=w.replace(REFERRER_URL_PLACE_HOLDER,escape(this.referrerUrl));w=w.replace(EVENT_TYPE_PLACE_HOLDER,escape(u));w=w.replace(PAGE_ID_PLACE_HOLDER,escape(v));w=w.replace(DETAIL_PLACE_HOLDER,escape(t));f(w)};this.micrositeEventWithTargetPage=function(v,t,u){var w=this.micrositeServiceRootUrl+MICROSITE_EVENT_PATH;w=w.replace(REFERRER_URL_PLACE_HOLDER,escape(u));w=w.replace(EVENT_TYPE_PLACE_HOLDER,escape(v));w=w.replace(PAGE_ID_PLACE_HOLDER,escape(this.pageId));f(w+"&targetPageId="+t)};this.micrositeEventCoupon=function(t){this.micrositeEvent(EVENT_TYPE_COUPON_CLICK);if(this.openInSameWindow){location.href=t}else{newWindow=window.open(t,"Coupon","toolbar=yes, location=yes,directories=yes,status=yes, menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes")}};this.micrositeGetDirections=function(t,u){if(t&&u){drivingDirectionsUrl=m(t,u);if(this.openInSameWindow){location.href=drivingDirectionsUrl}else{newWindow=window.open(drivingDirectionsUrl,"Directions","width=700,height=500")}this.micrositeEvent(EVENT_TYPE_GET_DIRECTIONS)}};this.micrositeTrackPageView=function(t){this.micrositeEvent(EVENT_TYPE_PAGE_VIEW,t)};this.micrositePrintPage=function(){p(document.getElementById("doc4"),"coupon_print_mode");window.print();this.micrositeEvent(EVENT_TYPE_PRINT)};this.micrositeViewWebSite=function(t){this.micrositeEvent(EVENT_TYPE_VISIT_WEB_SITE);if(this.openInSameWindow){location.href=t}else{window.open(t,"viewWebSiteWindow","toolbar=yes, location=yes,directories=yes,status=yes, menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes")}};this.micrositeEmailUs=function(w,v,t,u){if(!u||u==""){u=this.pageId}s(this.micrositeServiceRootUrl,this.referrerUrl,u,EVENT_TYPE_EMAIL_US,w,"",t,v)};this.micrositeSendToFriend=function(w,u,v,t){s(this.micrositeServiceRootUrl,this.referrerUrl,this.pageId,EVENT_TYPE_SEND_TO_FRIEND,v,w,"",u)};this.formEventWithEmail=function(t){linefeedPlaceholder="|linefeed|";if(t.type=="submit"){var u=t;do{u=u.parentNode}while(u.nodeName!="FORM");formString=YAHOO.util.Connect.setForm(u);body=this.trans.youRecieved+" "+document.location+"."+linefeedPlaceholder+linefeedPlaceholder;body+=this.trans.formName+": "+u.name+linefeedPlaceholder+linefeedPlaceholder;fields=formString.split("&");for(i=0;i<fields.length;i++){field=fields[i].split("=");if(field[0]!="submit"){body+=field[0]+": "+unescape(YAHOO.lang.trim(field[1]))+linefeedPlaceholder+linefeedPlaceholder}}alert(self.trans.thankContact);u.reset();body+=linefeedPlaceholder+this.trans.dontReply;s(this.micrositeServiceRootUrl,this.referrerUrl,this.pageId,EVENT_TYPE_FORM,"no-reply@marchex.com","",body,"",formString);return false}return true};this.micrositeMailTo=function(u,t){if(!t){t=u}s(this.micrositeServiceRootUrl,this.referrerUrl,this.pageId,EVENT_TYPE_MAILTO,"",u,"","")};this.micrositeBookMark=function(t,u){r(t,u);this.micrositeEvent(EVENT_TYPE_ADD_TO_BOOKMARKS)};this.micrositePrintCoupon=function(t){window.print();this.micrositeEvent(EVENT_TYPE_COUPON_PRINT,t)};this.micrositePrintCouponOnly=function(t,u){n(document.getElementById("doc4"),"coupon_print_mode");if(this.lastPrintedId){p(document.getElementById(this.lastPrintedId),"to_print")}n(document.getElementById(t),"to_print");this.micrositePrintCoupon(u);this.lastPrintedId=t};this.micrositeTrackLinkSmart=function(t){this.micrositeTrackLinkFollowed(t.href,t.innerHTML,true)};this.micrositeTrackLinkFollowed=function(v,u,t){if(!u){u=v}this.micrositeEvent(EVENT_TYPE_LINK_FOLLOWED,u);if(t){if(this.openInSameWindow){location.href=v}else{newWindow=window.open(v,"Coupon","toolbar=yes, location=yes,directories=yes,status=yes, menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes")}}else{setTimeout('location.href = "'+v+'"',500)}};this.micrositeTrackForm=function(u,t){if(!t){t=u}this.micrositeEvent(EVENT_TYPE_FORM,t);setTimeout('document.getElementById("'+u+'").submit()',500)};this.renderMap=function(w){var z=null;var y=new google.maps.LatLng(OUR_LATITUDE,OUR_LONGITUDE);var v={zoom:15,center:y,mapTypeId:google.maps.MapTypeId.ROADMAP};z=new google.maps.Map(document.getElementById(MAP_CONTAINER_ELEMENT_ID),v);var u;if(MAP_MARKER_IMAGE!=null){var x=new google.maps.MarkerImage(MAP_MARKER_IMAGE,new google.maps.Size(40,40));u={position:y,visible:true,icon:x,map:z}}else{u={position:y,visible:true,map:z}}var t=new google.maps.Marker(u);return z};this.isIE6=function(){var u="MSIE 6";var t=navigator.userAgent;return t.indexOf(u)>0};this.setStyle=function(v,u,t){v.style[u]=t};function h(v,u){if(v.currentStyle){var t=v.currentStyle[u]}else{if(window.getComputedStyle){var t=document.defaultView.getComputedStyle(v,null).getPropertyValue(u)}}return t}this.yahooMapInteractionCallBack=function(){if(this.singletonMapInteraction!=true){this.micrositeEvent(EVENT_TYPE_MAP_INTERACTION)}this.singletonMapInteraction=true};this.googleMapInteractionCallBack=function(){if(this.singletonMapInteraction!=true){this.micrositeEvent(EVENT_TYPE_MAP_INTERACTION)}this.singletonMapInteraction=true};function b(){var t=UNKNOWN;if(document.all){t=IE}else{if(Array.every){t=FIREFOX}}return t}function r(t,u){var v=b();if(v==IE){window.external.AddFavorite(u,t)}else{if(v==FIREFOX){window.sidebar.addPanel(t,u,"")}else{alert("Please press Ctrl+D to bookmark this site.")}}}function s(z,w,x,u,t,C,A,B,y){var v=z+MICROSITE_EMAIL_PATH;v=v.replace(REFERRER_URL_PLACE_HOLDER,escape(w));v=v.replace(EVENT_TYPE_PLACE_HOLDER,escape(u));v=v.replace(PAGE_ID_PLACE_HOLDER,escape(x));v=v.replace(FROM_ADDRESS_PLACE_HOLDER,escape(t));v=v.replace(TO_ADDRESS_PLACE_HOLDER,escape(C));v=v.replace(BODY_PLACE_HOLDER,escape(A));v=v.replace(FROM_NAME_PLACE_HOLDER,escape(B));v=v.replace(DETAIL_PLACE_HOLDER,escape(y));language=this.language;if(language==null){language=""}v=v.replace(LANG_PLACE_HOLDER,escape(this.trans.language));f(v)}function m(u,v){var t=MAP_DIRECTIONS_URL;t=t.replace(FROM_ADDRESS_PLACE_HOLDER,escape(u));t=t.replace(TO_ADDRESS_PLACE_HOLDER,escape(v));return t}var d;function f(t){if(!d){g(t)}else{iframe=document.getElementById("RSIFrame");iframe.src=t+"&rd="+Math.random()}return false}function g(u){if(!document.createElement){return true}var w;if(!d&&document.createElement){try{var t=document.createElement("iframe");t.setAttribute("id","RSIFrame");t.style.border="0px";t.style.width="0px";t.style.height="0px";d=document.body.appendChild(t);if(document.frames){d=document.frames.RSIFrame}}catch(v){iframeHTML='<iframe id="RSIFrame" style="';iframeHTML+="border:0px;";iframeHTML+="width:0px;";iframeHTML+="height:0px;";iframeHTML+='"></iframe>';document.body.innerHTML+=iframeHTML;d=new Object();d.document=new Object();d.document.location=new Object();d.document.location.iframe=document.getElementById("RSIFrame");d.document.location.replace=function(x){this.iframe.src=x}}}if(navigator.userAgent.indexOf("Gecko")!=-1&&!d.contentDocument){setTimeout("callToServer("+u+")",10);return false}if(d.contentDocument){w=d.contentDocument}else{if(d.contentWindow){w=d.contentWindow.document}else{if(d.document){w=d.document}else{return true}}}w.location.replace(u);return false}function a(u,t){return u.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function n(u,t){if(!a(u,t)){u.className+=" "+t}}function p(v,t){if(a(v,t)){var u=new RegExp("(\\s|^)"+t+"(\\s|$)");v.className=v.className.replace(u," ")}}};