var helper=new Class({Implements:Options,options:{},initialize:function(a){this.setOptions(a)},is_numeric:function(a){return !isNaN(a)},toNumber:function(b){var d="";var c=0;var a=b.length;for(c=0;c<=a;c++){if(!isNaN(b[c]*1)&&b[c]!=" "){d=d+b[c]}}return d},printpage:function(){if(window.print){window.print()}else{alert("Sorry, your browser doesn't support this feature. Please print from your browser's \"Print...\" menu.")}},drawScrollbar:function(){var a=$("results-list");var g=$("scrollbar");if($chk(g)){g.destroy();a.setStyle("width","255px").removeClass("scroll")}var d=$("results-list").getSize();var f=d.y-440;if(f>0){a.setStyle("width","243px").addClass("scroll");$$("sms-link").setStyle("background-positoin","183px 12px");var g=new Element("div",{id:"scrollbar"}).inject($("results"));var c=(440/d.y)*440;var b=new Element("div",{id:"handle",styles:{height:c+"px"},events:{mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject(g);var e=new Slider($("scrollbar"),$("handle"),{steps:f,mode:"vertical",wheel:"true",onChange:function(h){a.setStyle("top",-h)}}).set(0);$$(a,g).addEvent("mousewheel",function(j){j=new Event(j).stop();var h=e.step-j.wheel*30;e.set(h)});$(document.body).addEvent("mouseleave",function(){e.drag.stop()})}}});var resultList=new Class({Implements:helper,options:{message:"Enter starting address",street:null,address:null},initialize:function(a){this.setOptions(a)},createHeader:function(){var a=new Element("h4",{id:"results-header"}).inject($("results"));new Element("p",{id:"results-links"}).inject($("results"))},createList:function(){var b=new Element("div",{id:"results-container"}).inject($("results"));new Element("p",{id:"results-count"}).inject($("results-header"),"after");new Element("ol",{id:"results-list"}).inject(b);var a=new Element("li",{id:"loading"}).inject($("results-list"));var c=new Element("p",{}).inject(a);new Element("span",{"class":"loading",html:"Retrieving data&hellip;"}).inject(c);$("results-list").addClass("details")},updateHeader:function(b,c,d,a){$("results-header").empty();$("results-links").empty();switch(b){case"error":$("results-header").setProperty("html","Error");break;case"showDetails":$("results-header").setProperty("html","Details");$("results-count").setProperty("html",c).addClass("details");new Element("p",{id:"results-links"}).inject($("results"));new Element("a",{href:"#results",html:"Back to results",id:"back-to-results","class":"results-link",events:{click:function(f){f.stop();this.updateHeader("findNearbyStores",d.length);this.updateList("findNearbyStores",d,map,a)}.bind(this)}}).inject($("results-links"));break;case"findNearbyStores":case"findNearbyStoresFiltered":if(c=="search"){$("results-header").setProperty("html","Results")}else{if(c>0){$("results-header").setProperty("html","Results");$("results-count").setProperty("html",c).removeClass("details")}else{$("results-header").setProperty("html","No Results")}}break}},drawForm:function(b,d){var g=this.options.message;var h=this.options.street;var f=this.options.address;var c=g;if(d!=g&&d!=""){var c=d}$("results-container").removeClass("activeForm");if($chk($("dir-form"))){$("dir-form").destroy()}var a=new Element("li",{id:"dir-form","class":"last"}).inject($("results-list"));var e=new Element("p").inject(a);new Element("span",{"class":"driving",html:"Driving Directions"}).inject(e);new Element("a",{href:"#reverse",html:"Reverse Route",id:"reverse-route",events:{click:function(j){j.stop();if(b=="end"){this.drawForm("start",$("dir1").getProperty("value"))}else{this.drawForm("end",$("dir1").getProperty("value"))}}.bind(this)}}).inject(e);var e=new Element("p").inject(a);if(b=="end"){new Element("span",{html:"Start:"}).inject(e);new Element("span",{"class":"end",html:" <strong>"+h+"</strong>"}).inject(e);new Element("span",{"class":"end",html:" <strong>"+f+"</strong>"}).inject(e);var e=new Element("p").inject(a);new Element("span",{"class":"dir-end",html:"End:"}).inject(e);var e=new Element("p",{"class":"input"}).inject(a);new Element("input",{id:"dir1",name:"a1",type:"text",value:c,maxlength:"255",tabindex:"1",events:{click:function(){this.addClass("focus");$("results-container").addClass("activeForm");if(this.getProperty("value")==g){this.setProperty("value","")}},focus:function(){this.addClass("focus");$("results-container").addClass("activeForm");if(this.getProperty("value")==g){this.setProperty("value","")}},blur:function(){this.removeClass("focus");$("results-container").removeClass("activeForm");if(this.getProperty("value")==""){this.setProperty("value",g)}},mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject(e);new Element("button",{id:"dir-submit",type:"submit",html:"GO",tabindex:"2",events:{click:function(k){k.stop();$("dir-submit").addClass("focus");var j=$("dir1").getProperty("value");if(j!=g&&j!=""){new route().getDirections(h+" "+f,j,false,false,false,false)}}.bind(this),focus:function(){this.addClass("focus")},blur:function(){this.removeClass("focus")},mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject(e);new Element("span",{"class":"spacer"}).inject(e)}else{new Element("span",{html:"Start:"}).inject(e);var e=new Element("p",{"class":"input"}).inject(a);new Element("input",{id:"dir1",name:"a1",type:"text",value:c,maxlength:"255",tabindex:"1",events:{click:function(){this.addClass("focus");$("results-container").addClass("activeForm");if(this.getProperty("value")==g){this.setProperty("value","")}},focus:function(){this.addClass("focus");$("results-container").addClass("activeForm");if(this.getProperty("value")==g){this.setProperty("value","")}},blur:function(){this.removeClass("focus");$("results-container").removeClass("activeForm");if(this.getProperty("value")==""){this.setProperty("value",g)}},mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject(e);new Element("button",{id:"dir-submit",type:"submit",html:"GO",tabindex:"2",events:{click:function(k){k.stop();$("dir-submit").addClass("focus");var j=$("dir1").getProperty("value");if(j!=g&&j!=""){new route().getDirections(j,h+" "+f,false,false,false,false)}}.bind(this),focus:function(){this.addClass("focus")},blur:function(){this.removeClass("focus")},mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject(e);new Element("span",{"class":"spacer"}).inject(e);var e=new Element("p").inject(a);new Element("span",{"class":"dir-end",html:"End:"}).inject(e);new Element("span",{"class":"end",html:" <strong>"+h+"</strong>"}).inject(e);new Element("span",{"class":"end",html:" <strong>"+f+"</strong>"}).inject(e)}},updateList:function(k,z,y,a,q){$("results-list").empty();$("results-container").removeClass("evenTotal").removeClass("activeForm");y.HideInfoBox();y.SetCenterAndZoom(a,12);storeLocator.adjustSlider();switch(k){case"error":$("results-list").addClass("details").setStyle("top","0");var m=new Element("li",{id:"s0"}).inject($("results-list"));var o=new Element("p").inject(m);new Element("span",{html:"<strong>Sorry, there was an error processing your&nbsp;request.</strong>"}).inject(o);var m=new Element("li",{id:"s1"}).inject($("results-list"));var o=new Element("p").inject(m);new Element("span",{html:"<strong>Error message:</strong> "+z.message}).inject(o);break;case"showDetails":this.options.street=z[q].streetAddress;this.options.address=z[q].city+" "+z[q].state+" "+z[q].postalCode;$("results-list").addClass("details").setStyle("top","0");var m=new Element("li",{id:"s0"}).inject($("results-list"));var o=new Element("p").inject(m);new Element("span",{html:" "+z[q].streetAddress}).inject(o);new Element("span",{html:" "+z[q].city+" "+z[q].state+" "+z[q].postalCode}).inject(o);new Element("span",{html:" "+z[q].businessPhone}).inject(o);var n=new Element("span",{"class":"amenities"}).inject(o);if(z[q].driveThru==true){var j=new Element("img",{src:"./img/ico-drive-thru.png",alt:"Drive Thru",title:"Drive Thru Available",width:"16",height:"16","class":"drivethru"}).inject(n)}if(z[q].lateNightHours==true){var f=new Element("img",{src:"./img/ico-late-night-hours.png",alt:"Late Night Hours",title:"Late Night Hours Available",width:"16",height:"16","class":"latenight"}).inject(n)}if(z[q].totalSeats>z[q].interiorSeats){var l=new Element("img",{src:"./img/ico-outdoor-seating.png",alt:"Outdoor Seating",title:"Outdoor Seating Available",width:"16",height:"16","class":"outdoor"}).inject(n)}if(z[q].multibrandConfiguration=="KT"){var v=new Element("img",{src:"./img/ico-kfc.png",alt:"KFC",title:"KFC Available",width:"16",height:"16","class":"kfc"}).inject(n)}if((z[q].mondayStart!=""&&z[q].mondayEnd!="")||(z[q].tuesdayStart!=""&&z[q].tuesdayEnd!="")||(z[q].wednesdayStart!=""&&z[q].wednesdayEnd!="")||(z[q].thursdayStart!=""&&z[q].thursdayEnd!="")||(z[q].fridayStart!=""&&z[q].fridayEnd!="")||(z[q].saturdayStart!=""&&z[q].saturdayEnd!="")||(z[q].sundayStart!=""&&z[q].sundayEnd!="")){var s=z[q].mondayStart+"&#8211;"+z[q].mondayEnd;var w=z[q].tuesdayStart+"&#8211;"+z[q].tuesdayEnd;var d=z[q].wednesdayStart+"&#8211;"+z[q].wednesdayEnd;var c=z[q].thursdayStart+"&#8211;"+z[q].thursdayEnd;var A=z[q].fridayStart+"&#8211;"+z[q].fridayEnd;var g=z[q].saturdayStart+"&#8211;"+z[q].saturdayEnd;var e=z[q].sundayStart+"&#8211;"+z[q].sundayEnd;var m=new Element("li",{iclass:"store-hours"}).inject($("results-list"));var o=new Element("p").inject(m);new Element("span",{html:"Store Hours:","class":"hours"}).inject(o);if(s==w&&s==d&&s==c&&s==A){if(s!="&#8211;"){new Element("span",{html:'<acronym title="Monday">M</acronym>&#8211;<acronym title="Friday">F</acronym>: '+s}).inject(o)}if(g==e){if(g!="&#8211;"){new Element("span",{html:'<acronym title="Saturday">Sat</acronym> &amp; <acronym title="Sunday">Sun</acronym>: '+g}).inject(o)}}else{if(g!="&#8211;"){new Element("span",{html:'<acronym title="Saturday">Sat</acronym>: '+g}).inject(o)}if(e!="&#8211;"){new Element("span",{html:'<acronym title="Sunday">Sun</acronym>: '+e}).inject(o)}}}else{if(e==s&&e==w&&e==d&&e==c){if(e!="&#8211;"){new Element("span",{html:'<acronym title="Sunday">Sun</acronym>&#8211;<acronym title="Thursday">Th</acronym>: '+e}).inject(o)}if(A==g){if(A!="&#8211;"){new Element("span",{html:'<acronym title="Friday">F</acronym> &amp; <acronym title="Saturday">Sat</acronym>: '+g}).inject(o)}}else{if(A!="&#8211;"){new Element("span",{html:'<acronym title="Friday">F</acronym>: '+A}).inject(o)}if(g!="&#8211;"){new Element("span",{html:'<acronym title="Saturday">Sat</acronym>: '+g}).inject(o)}}}else{if(s!="&#8211;"){new Element("span",{html:'<acronym title="Monday">M</acronym>: '+s}).inject(o)}if(w!="&#8211;"){new Element("span",{html:'<acronym title="Tuesday">Tu</acronym>: '+w}).inject(o)}if(d!="&#8211;"){new Element("span",{html:'<acronym title="Wednesday">W</acronym>: '+d}).inject(o)}if(c!="&#8211;"){new Element("span",{html:'<acronym title="Thursday">Th</acronym>: '+c}).inject(o)}if(A!="&#8211;"){new Element("span",{html:'<acronym title="Friday">F</acronym>: '+A}).inject(o)}if(g!="&#8211;"){new Element("span",{html:'<acronym title="Saturday">Sat</acronym>: '+g}).inject(o)}if(e!="&#8211;"){new Element("span",{html:'<acronym title="Sunday">Sun</acronym>: '+e}).inject(o)}}}}var m=new Element("li",{"class":"sms-link",events:{click:function(){new sms().popup("location",z[q].streetAddress,z[q].city+" "+z[q].state+" "+z[q].postalCode+"<br />"+z[q].businessPhone)},mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject($("results-list"));var o=new Element("p").inject(m);new Element("span",{html:"<strong>Send to Phone</strong>"}).inject(o);this.drawForm("start","");break;case"findNearbyStores":case"findNearbyStoresFiltered":$("results-list").removeClass("details").setStyle("top","0");if(z.length==0){$("results-list").addClass("details");var m=new Element("li",{id:"s0","class":"summary"}).inject($("results-list"));var o=new Element("p").inject(m);new Element("span",{html:"<strong>Sorry, no results&nbsp;found.</strong>"}).inject(o);var m=new Element("li",{id:"s1"}).inject($("results-list"));var o=new Element("p").inject(m);new Element("span",{html:"Are the city and state spelled correctly?"}).inject(o);var m=new Element("li",{id:"s2"}).inject($("results-list"));var o=new Element("p").inject(m);new Element("span",{html:'Did you use a valid <acronym title="Zone Improvement Plan">ZIP</acronym>&nbsp;code?'}).inject(o);var m=new Element("li",{id:"s3"}).inject($("results-list"));var o=new Element("p").inject(m);new Element("span",{html:"Have you tried unchecking the &#8220;show only&#8221;&nbsp;filters?"}).inject(o);return false}for(i=0;i<z.length;i++){if(!(z.length%2)){$("results-container").addClass("evenTotal")}else{$("results-container").removeClass("evenTotal").removeClass("activeForm")}if(!(i%2)){liClass="even"}else{liClass="odd"}var m=new Element("li",{id:"s"+i,"class":liClass,latitude:z[i].latitude,longitude:z[i].longitude}).inject($("results-list"));if(i==z.length-1){m.addClass("last")}var o=new Element("p").inject(m);var u=new Element("span",{html:" "+z[i].streetAddress}).inject(o);var t=new Element("span",{html:" "+z[i].city+" "+z[i].state+" "+z[i].postalCode}).inject(o);var x=new Element("span",{html:" "+z[i].businessPhone}).inject(o);var h=new Element("span",{html:" "+z[i].distance.toFixed(1)+" miles ","class":"distance"}).inject(o);var b=new Element("span",{html:i+1,id:"r"+i,"class":"number"}).inject(o);var n=new Element("span",{"class":"amenities"}).inject(o);if(z[i].driveThru==true){var j=new Element("img",{src:"./img/ico-drive-thru.png",alt:"Drive Thru",title:"Drive Thru Available",width:"16",height:"16","class":"drivethru"}).inject(n)}if(z[i].lateNightHours==true){var f=new Element("img",{src:"./img/ico-late-night-hours.png",alt:"Late Night Hours",title:"Late Night Hours Available",width:"16",height:"16","class":"latenight"}).inject(n)}if(z[i].totalSeats>z[i].interiorSeats){var l=new Element("img",{src:"./img/ico-outdoor-seating.png",alt:"Outdoor Seating",title:"Outdoor Seating Available",width:"16",height:"16","class":"outdoor"}).inject(n)}if(z[i].multibrandConfiguration=="KT"){var v=new Element("img",{src:"./img/ico-kfc.png",alt:"KFC",title:"KFC Available",width:"16",height:"16","class":"kfc"}).inject(n)}}$$("ol#results-list li").each(function(p){p.addEvents({mouseover:function(B){this.addClass("hover");targetPin=this.id;targetPin=targetPin.substring(1);height=216;y.ShowInfoBox(shapes[targetPin],new VEPixel(20,height));if($chk($("pin"+targetPin))){$("pin"+targetPin).addClass("pin-hover")}},mouseout:function(){this.removeClass("hover");if($chk($("pin"+targetPin))){$("pin"+targetPin).removeClass("pin-hover")}},click:function(B){targetPin=this.id;targetPin=targetPin.substring(1);targetPin=parseInt(targetPin);if($chk($("pin"+targetPin))){$("pin"+targetPin).removeClass("pin-hover")}new resultList().updateHeader("showDetails",targetPin+1,z,a);new resultList().updateList("showDetails",z,y,a,targetPin);centerLat=this.getProperty("latitude");centerLong=this.getProperty("longitude");y.SetCenterAndZoom(new VELatLong(centerLat,centerLong),14);storeLocator.adjustSlider()}})});break}this.drawScrollbar()}});var sms=new Class({Implements:helper,options:{inputMessage:"enter a mobile phone number"},initialize:function(b,a){this.setOptions(a)},popup:function(j,m,n,e,g,d,f){this.createLightbox();var h=new Element("div",{"class":"large-popup",id:"lightbox-popup"}).inject("wrapper","after");var o=new Element("div",{"class":"popup-top"}).inject(h,"top");var a=new Element("div",{"class":"popup"}).inject(o,"after");var l=new Element("div",{"class":"popup-bot"}).inject(h,"bottom");new Element("img",{"class":"logo",src:"./img/logo-small-taco-bell.png",alt:"Taco Bell",title:"",width:"33",height:"42"}).inject(a,"top");new Element("h5",{html:m}).inject(a);new Element("a",{href:"#close","class":"close-link",title:"Close",events:{click:function(p){p.stop();this.destroyLightbox()}.bind(this)}}).inject(a);new Element("p",{"class":"address",html:n}).inject(a);var b=new Element("form",{action:"/TacoBellMobile/MobileHandler.ashx",method:"post"}).inject(a);var k=new Element("p",{"class":"input",id:"sms-input"}).inject(b);msg=this.options.inputMessage;new Element("input",{id:"sms-phone",name:"phone",type:"text",value:msg,maxlength:"14",tabindex:"1",events:{click:function(){this.addClass("focus");if(this.getProperty("value")==msg){this.setProperty("value","")}},focus:function(){this.addClass("focus");if(this.getProperty("value")==msg){this.setProperty("value","")}},blur:function(){$("sms-phone").removeClass("focus");if($("sms-phone").getProperty("value")==""){$("sms-phone").setProperty("value",msg)}else{var q=this.toNumber($("sms-phone").getProperty("value"));if(q.length==10||this.is_numeric(q)){var p="("+q.substr(0,3)+") "+q.substr(3,3)+"-"+q.substr(6,4);$("sms-phone").setProperty("value",p)}}}.bind(this),mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject(k);new Element("button",{id:"sms-submit",type:"submit",html:"GO",tabindex:"3",events:{click:function(s){s.stop();$("sms-submit").addClass("focus");var q=this.toNumber($("sms-phone").getProperty("value"));if(q.length==10||this.is_numeric(q)){var p="("+q.substr(0,3)+") "+q.substr(3,3)+"-"+q.substr(6,4);$("sms-phone").setProperty("value",p)}this.processSMS();$("sms-submit").blur()}.bind(this),focus:function(){this.addClass("focus")},blur:function(){this.removeClass("focus")},mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject(k);switch(j){case"location":new Element("input",{type:"hidden",name:"message",id:"sms-message",value:m+" "+n.replace("<br />"," ")}).inject(k);new Element("input",{type:"hidden",name:"querytype",id:"sms-querytype",value:"storelocation"}).inject(k);break;case"directions":new Element("input",{type:"hidden",name:"lat1",id:"sms-lat1",value:e}).inject(k);new Element("input",{type:"hidden",name:"lon1",id:"sms-lon1",value:g}).inject(k);new Element("input",{type:"hidden",name:"lat2",id:"sms-lat2",value:d}).inject(k);new Element("input",{type:"hidden",name:"lon2",id:"sms-lon2",value:f}).inject(k);new Element("input",{type:"hidden",name:"querytype",id:"sms-querytype",value:"driving"}).inject(k);break}new Element("input",{type:"hidden",id:"agree",name:"agree",value:"no"}).inject(k);new Element("span",{"class":"spacer"}).inject(k);var c=new Element("p",{"class":"legal",html:'By clicking here and pressing submit, I represent and warrant that this is my current and accurate cell phone number, and I agree that Taco Bell may use my cell phone number to send me the directions I have just created on this page. I understand that standard text message rates may apply for me to receive this message. To learn more about how we use information submitted on this page, please read our <a href="http://www.tacobell.com/legal/privacypolicy.html" target="_blank">Privacy Policy</a>. Use of this feature is subject to Taco Bell&#8217;s <a href="http://www.tacobell.com/legal/legal.html" target="_blank">Terms and&nbsp;Conditions</a>.',events:{click:function(){if($("agree").getProperty("value")=="no"){this.addClass("checked");$("agree").setProperty("value","yes")}else{this.removeClass("checked");$("agree").setProperty("value","no")}},mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject(b);this.positionPopup()},processSMS:function(){if($chk($("sms-process"))){$("sms-process").destroy()}if($("agree").getProperty("value")!="yes"){new Element("p",{"class":"error",id:"sms-process",html:"You must agree to the terms and&nbsp;conditions."}).inject($("sms-input"),"before");return false}switch($("sms-querytype").getProperty("value")){case"storelocation":if(!this.validate("phone",$("sms-phone").getProperty("value"))){new Element("p",{"class":"error",id:"sms-process",html:"Please enter a valid 10-digit phone&nbsp;number."}).inject($("sms-input"),"before");return false}new Request({method:"get",url:"/sms/MobileHandler.ashx",data:{phone:encodeURIComponent(this.toNumber($("sms-phone").getProperty("value"))),message:encodeURIComponent($("sms-message").getProperty("value")),querytype:"storelocation"},onRequest:function(){new Element("p",{"class":"processing",id:"sms-process",html:"Sending&hellip;"}).inject($("sms-input"),"before")},onComplete:function(a){if(a.contains("Success")){$("sms-process").setProperty("class","success").setProperty("html","Message sent!")}else{if(a=="Token was unable to be generated"){$("sms-process").setProperty("class","failure").setProperty("html","<strong>Error:</strong> Unable to generate a&nbsp;token.")}else{$("sms-process").setProperty("class","failure").setProperty("html","<strong>Error:</strong> Something unexpected&nbsp;happened.")}}}}).send();break;case"driving":if(!this.validate("phone",$("sms-phone").getProperty("value"))){new Element("p",{"class":"error",id:"sms-process",html:"Please enter a valid 10-digit phone&nbsp;number."}).inject($("sms-input"),"before");return false}new Request({method:"get",url:"/sms/MobileHandler.ashx",data:{phone:encodeURIComponent(this.toNumber($("sms-phone").getProperty("value"))),lat1:encodeURIComponent($("sms-lat1").getProperty("value")),lon1:encodeURIComponent($("sms-lon1").getProperty("value")),lat2:encodeURIComponent($("sms-lat2").getProperty("value")),lon2:encodeURIComponent($("sms-lon2").getProperty("value")),querytype:"driving"},onRequest:function(){new Element("p",{"class":"processing",id:"sms-process",html:"Sending&hellip;"}).inject($("sms-input"),"before")},onComplete:function(a){if(a.contains("Success")){$("sms-process").setProperty("class","success").setProperty("html","Message sent!")}else{if(a=="Token was unable to be generated"){$("sms-process").setProperty("class","failure").setProperty("html","<strong>Error:</strong> Unable to generate a&nbsp;token.")}else{$("sms-process").setProperty("class","failure").setProperty("html","<strong>Error:</strong> Something unexpected&nbsp;happened.")}}}}).send();break}},validate:function(a,c){switch(a){case"phone":var b=this.toNumber(c);if(b.length!=10||!this.is_numeric(b)){return false}else{return true}break;default:return false;break}},createLightbox:function(){map.HideInfoBox();var b=$("taco-bell-store-locator").getScrollSize();var a=b.x;var c=b.y;var d=new Element("div",{id:"lightbox",styles:{width:a+"px",height:c+"px",background:"#000"},events:{click:function(){this.destroyLightbox()}.bind(this)}}).inject("taco-bell-store-locator","bottom");this.positionLightbox()},destroyLightbox:function(){$("lightbox").destroy();$("lightbox-popup").destroy()},positionLightbox:function(){$("lightbox").setStyles({width:"0",height:"0"});var b=$("taco-bell-store-locator").getScrollSize();var a=b.x;var c=b.y;$("lightbox").setStyles({width:a+"px",height:c+"px"})},positionPopup:function(){var e=window.getSize();var d=window.getScrollSize();var c=$("lightbox-popup").getSize();var b=312;var a=0;if(e.x>c.x){var a=(e.x/2)-(c.x/2)}$("lightbox-popup").setStyle("top",b+"px").setStyle("left",a+"px")}});var route=new Class({Implements:helper,options:{address1:null,address2:null,filterRT:false,filterDT:false,filterLN:false,filterOS:false},initialize:function(a){this.setOptions(a)},getDirections:function(f,d,h,b,c,g){this.options.address1=f;this.options.address2=d;this.options.filterRT=h;this.options.filterDT=b;this.options.filterDT=c;this.options.filterOS=g;this.createHeader();this.createList();new controls().showDirections(f,d);var l=new Element("li",{id:"loading"}).inject($("results-list"));var a=new Element("p",{}).inject(l);new Element("span",{"class":"loading",html:"Calculating route&hellip;"}).inject(a);$("results-list").addClass("details");var k=new VEColor(45,49,146,0.9);var j=new VEColor(221,17,122,0.9);var e=new VERouteOptions();e.RouteColor=j;e.UseTraffic=true;e.RouteCallback=this.updateDirections.bind(this);map.GetDirections([f,d],e);$("reverse-directions").addEvents({click:function(m){m.stop();this.getDirections(d,f,false,false,false);m.target.blur()}.bind(this)})},createHeader:function(){$("ve").setStyle("width","508px");if(!$chk($("results"))){var b=new Element("div",{id:"results"});b.inject($("map"),"top");map.Resize()}$("results").empty();var a=new Element("h4",{id:"results-header",html:"Directions"}).inject($("results"));new Element("p",{id:"results-links"}).inject($("results"));new Element("a",{href:"#print",html:"Print",id:"print",events:{click:function(c){c.stop();this.printpage();c.target.blur()}.bind(this)},"class":"results-link",styles:{display:"none"}}).inject($("results-links"));new Element("a",{href:"#reverse",html:"Reverse",id:"reverse-directions","class":"results-link",styles:{display:"none"}}).inject($("results-links"))},createList:function(){var a=new Element("div",{id:"results-container"}).inject($("results"));new Element("ol",{id:"results-list","class":"directions-list"}).inject(a)},updateHeader:function(){$("print").setStyle("display","block");$("reverse-directions").setStyle("display","block")},updateDirections:function(B){var g=this.options.filterRT;var m=this.options.filterDT;var h=this.options.filterLN;var f=this.options.filterOS;this.updateHeader();$("results-list").empty().removeClass("details");$("results-container").removeClass("evenTotal").removeClass("activeForm");map.DeleteAllShapes();if(B.Distance.toFixed(1)<=1&&B.Distance.toFixed(1)>0){var b="mile"}else{var b="miles"}var u=Math.round(B.Time/60);if(u<=1){u=1;var k="minute"}else{var k="minutes"}var s=B.RouteLegs;var c="Distance: <strong>"+B.Distance.toFixed(1)+" "+b+"</strong>";var l="About <strong>"+u+" "+k+"</strong> from the food you&nbsp;crave";var a=0;var A=null;var o=new Element("li",{"class":"summary"}).inject($("results-list"));var t=new Element("p").inject(o);new Element("span",{html:c}).inject(t);new Element("span",{html:l}).inject(t);for(var w=0;w<s.length;w++){A=s[w];var n=null;for(var v=0;v<A.Itinerary.Items.length;v++){n=A.Itinerary.Items[v];var e=new VEShape(VEShapeType.Pushpin,n.LatLong);e.SetTitle("");e.SetDescription("");if(a==0){var x='<div class="pin-start" id="pin-start" latitude = "'+n.LatLong.Latitude+'" longitude = "'+n.LatLong.Longitude+'"></div>'}else{if(a+1==A.Itinerary.Items.length){var x='<div class="pin-stop" id="pin-end" latitude = "'+n.LatLong.Latitude+'" longitude = "'+n.LatLong.Longitude+'"></div>'}else{var x='<div class="pin-turn" id="pin'+v+'">'+a+"</div>"}}e.SetCustomIcon(x);map.AddShape(e);if(!(v%2)){liClass=""}else{liClass=""}if(n.Distance.toFixed(1)<=1&&n.Distance.toFixed(1)>0){var y="mile"}else{var y="miles"}var o=new Element("li",{"class":liClass}).inject($("results-list"));var t=new Element("p").inject(o);if(a>0&&a+1<A.Itinerary.Items.length){var d=new Element("span",{html:a+".","class":"number"}).inject(t)}if(n.Text=="Arrive"||n.Text=="Arrive on the left"||n.Text=="Arrive on the right"){var q=": "+this.options.address2}else{var q=""}new Element("span",{html:n.Text+q+" "}).inject(t);if(n.Distance.toFixed(1)>0){var d=new Element("span",{html:"["+n.Distance.toFixed(1)+" "+y+"] ","class":"distance"}).inject(t)}a++}var o=new Element("li",{"class":"sms-link last",events:{click:function(){new sms().popup("directions","Directions to:",this.options.address2,$("pin-start").getProperty("latitude"),$("pin-start").getProperty("longitude"),$("pin-end").getProperty("latitude"),$("pin-end").getProperty("longitude"))}.bind(this),mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject($("results-list"));var t=new Element("p").inject(o);new Element("span",{html:"<strong>Send to Phone</strong>"}).inject(t)}this.drawScrollbar(o);if(g){var z='{ "startLat" : '+$("pin-start").getProperty("latitude")+', "startLong" : '+$("pin-start").getProperty("longitude")+', "endLat" : '+$("pin-end").getProperty("latitude")+', "endLong" : '+$("pin-end").getProperty("longitude")+', "routeType" : "Quickest", "distance" : 10, "driveThruOnly" : '+m+', "outdoorOnly" : '+f+', "lateNightOnly" : '+h+" }";storeLocator.getData(0,"findStoresNearRoute",z,null)}}});var controls=new Class({Implements:helper,options:{inputMessage:"Enter Address or ZIP Code"},initialize:function(a){this.setOptions(a)},showTacoBells:function(a){$$("#mainnav a").removeClass("selected");$$("#mainnav00 a").addClass("selected");$("search-form").removeClass("double");$$("#search-parameters h3").destroy();$("submit1").setProperty("tabindex","4");if($chk($("address2"))){$("address2").destroy()}if($chk($("big-filter"))){$("big-filter").destroy()}new Element("h3",{html:"show only:"}).inject($("search-parameters"),"top");$("drive-thru").setProperty("tabindex","2");$("drive-thru-label").setProperty("html",'&nbsp;<img src="./img/ico-drive-thru.png" alt="" title="" width="16" height="16" />&nbsp;Drive Thru');if($chk($("late-night-hours"))){$("late-night-hours").setProperty("tabindex","3");$("late-night-hours-label").setProperty("html",'&nbsp;<img src="./img/ico-late-night-hours.png" alt="" title="" width="16" height="16" />&nbsp;Late Night Hours')}$("outdoor-seating").setProperty("tabindex","4");$("outdoor-seating-label").setProperty("html",'&nbsp;<img src="./img/ico-outdoor-seating.png" alt="" title="" width="16" height="16" />&nbsp;Outdoor Seating')},showDirections:function(b,a){$$("#mainnav a").removeClass("selected");$$("#mainnav01 a").addClass("selected");$("search-form").addClass("double");$$("#search-parameters h3").destroy();$("submit1").setProperty("tabindex","6");var c=this.options.inputMessage;if(!$chk($("address2"))){new Element("input",{type:"text",id:"address2",name:"a2",value:c,maxlength:"255",tabindex:"2",events:{click:function(){this.addClass("focus");if(this.getProperty("value")==c){this.setProperty("value","")}},focus:function(){this.addClass("focus");if(this.getProperty("value")==c){this.setProperty("value","")}},blur:function(){this.removeClass("focus");if(this.getProperty("value")==""){this.setProperty("value",c)}},mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}}).inject($("address1"),"after")}if(!$chk($("big-filter"))){new Element("p",{id:"big-filter"}).inject($("search-parameters"),"top");new Element("input",{type:"checkbox",id:"on-route",name:"onroute",value:"true",tabindex:"3"}).inject($("big-filter"));new Element("label",{"for":"on-route",html:"&nbsp;Show Taco Bell locations on&nbsp;route:"}).inject($("big-filter"));storeLocator.createSearchParameters()}$("address1").setProperty("value",b);$("address2").setProperty("value",a);$("drive-thru").setProperty("tabindex","4");$("drive-thru-label").setProperty("html",'&nbsp;<img src="./img/ico-drive-thru.png" alt="" title="" width="16" height="16" />&nbsp;with Drive Thru');if($chk($("late-night-hours"))){$("late-night-hours").setProperty("tabindex","5");$("late-night-hours-label").setProperty("html",'&nbsp;<img src="./img/ico-late-night-hours.png" alt="" title="" width="16" height="16" />&nbsp;with Late Night Hours')}$("outdoor-seating").setProperty("tabindex","6");$("outdoor-seating-label").setProperty("html",'&nbsp;<img src="./img/ico-outdoor-seating.png" alt="" title="" width="16" height="16" />&nbsp;with Outdoor Seating')}});var mapObject=new Class({Implements:helper,options:{map:null,term:null,inputMessage:"Enter Address or ZIP Code",datasource:"PizzaHut134600.134600.AllBrands",entityName:"AllBrands",searchRadius:10,jsonURL:"./JSONHandler.ashx",filterDT:false,filterLN:false,filterOS:false,mySlider:null},initialize:function(b,a){this.setOptions(a);this.options.map=b},resetform:function(){var b=this.options.map;var c=this.options.inputMessage;new controls().showTacoBells(c);var a=$("results");if($chk(a)){a.destroy()}$("ve").setStyle("width","764px");b.Clear();b.Resize();b.SetCenterAndZoom(new VELatLong(38,-97),4);this.adjustSlider();$("address1").setProperty("value",c);$$("#search-parameters input").each(function(d){d.checked=false;var e=d.getProperty("id");$$("label").each(function(f){if(f.getProperty("for")==e){f.removeClass("checked")}})})},findLocation:function(d){var g=this.options.map;var h=this.options.inputMessage;if($chk(d)){var a=decodeURIComponent(d);$("address1").value=decodeURIComponent(d)}else{var a=$("address1").value}try{if(a!=h&&a!=""){this.options.term=a;var b=$("results");if($chk(b)){b.empty()}g.Clear();this.options.filterDT=$("drive-thru").checked;if($chk($("late-night-hours"))){this.options.filterLN=$("late-night-hours").checked}else{this.options.filterLN=false}this.options.filterOS=$("outdoor-seating").checked;$("ve").setStyle("width","508px");var c=new resultList();if(!$chk($("results"))){var b=new Element("div",{id:"results"});b.inject($("map"),"top");g.Resize()}if(!$chk($("results-header"))){c.createHeader()}if(!$chk($("results-list"))){c.createList()}if(this.options.filterDT==false&&this.options.filterLN==false&&this.options.filterOS==false){var j="findNearbyStores"}else{var j="findNearbyStoresFiltered"}c.updateHeader(j,"search");g.Find(null,a,null,null,0,1,true,true,true,false,this.callback.bind(this))}}catch(f){alert(f.message)}},callback:function(g,f,k,j,h){this.findNearbyStores(k[0].LatLong)},findNearbyStores:function(b){var e=this.options.map;var a=this.options.searchRadius;var h=0;if(this.options.filterDT==false&&this.options.filterLN==false&&this.options.filterOS==false){var g="findNearbyStores";var f='{ "latitude" : "'+b.Latitude+'", "longitude" : "'+b.Longitude+'", "distance" : '+a+" }"}else{var g="findNearbyStoresFiltered";var f='{ "latitude" : "'+b.Latitude+'", "longitude" : "'+b.Longitude+'", "distance" : '+a+', "driveThruOnly" : '+this.options.filterDT+', "outdoorOnly" : '+this.options.filterOS+', "lateNightOnly" : '+this.options.filterLN+" }"}e.DeleteAllShapes();e.SetCenterAndZoom(b,12);this.adjustSlider();var c=new VEShape(VEShapeType.Pushpin,b);c.SetTitle("");c.SetDescription("");var d='<div class="pin-home"></div>';c.SetCustomIcon(d);e.AddShape(c);this.getData(h,g,f,b)},getData:function(c,a,h,m){var b=this.options.map;var g=this.options.term;var d=this.options.jsonURL;var l=this.options.filterDT;var f=this.options.filterLN;var n=this.options.filterOS;var e=this;var k='{"id":'+c+',"method":"'+a+'","params":'+h+"}";var j=new Request.JSON({url:d,method:"post",data:k,onRequest:function(){switch(a){case"findNearbyStores":case"findNearbyStoresFiltered":$("ve").setStyle("width","508px");var p=new resultList();if(!$chk($("results"))){var o=new Element("div",{id:"results"});o.inject($("map"),"top");b.Resize()}if(!$chk($("results-header"))){p.createHeader()}if(!$chk($("results-list"))){p.createList()}p.updateHeader(a,"search");break;case"findStoresNearRoute":break}},onComplete:function(A,z){var p=new resultList();if(A.error){a="error"}switch(a){case"error":p.updateHeader(a);p.updateList(a,A.error,b,m);break;case"findNearbyStores":case"findNearbyStoresFiltered":shapes=new Array();p.updateHeader(a,A.result.length);p.updateList(a,A.result,b,m);for(r=0;r<A.result.length;r++){var t=A.result[r].latitude;var o=A.result[r].longitude;var u=new VELatLong(t,o);var w=A.result[r].streetAddress;var x=A.result[r].city+" "+A.result[r].state+" "+A.result[r].postalCode+"<br />"+A.result[r].businessPhone;var y='<div class="popup-top"></div>\n<div class="popup">\n<img class="logo" src="./img/logo-small-taco-bell.png" alt="Taco Bell" title="" width="33" height="42" />\n<h5>'+w+'</h5>\n<p class="address">'+x+'</p>\n<p class="actions"><a href="#driveto" onclick="javascript: new route().getDirections(\''+g+"', '"+A.result[r].streetAddress+", "+A.result[r].city+" "+A.result[r].state+'\', false, false, false, false); return false;">Drive To</a> &nbsp;|&nbsp; <a href="#drivefrom" onclick="javascript: new route().getDirections(\''+A.result[r].streetAddress+", "+A.result[r].city+" "+A.result[r].state+"', '"+g+'\', false, false, false, false); return false;">Drive From</a> &nbsp;|&nbsp; <span class="distance">'+A.result[r].distance.toFixed(1)+" miles</span><br /><a href=\"#phone\" onclick=\"javascript: new sms().popup('location', '"+w+"', '"+x+'\'); return false;">Send to Phone</a></p>\n<p class="amenities">';if(A.result[r].driveThru==true){y=y+'<img src="./img/ico-drive-thru.png" alt="Drive Thru" title="Drive Thru Available" width="16" height="16" />'}if(A.result[r].lateNightHours==true){y=y+'<img src="./img/ico-late-night-hours.png" alt="Late Night Hours" title="Late Night Hours Available" width="16" height="16" />'}if(A.result[r].totalSeats>A.result[r].interiorSeats){y=y+'<img src="./img/ico-outdoor-seating.png" alt="Outdoor Seating" title="Outdoor Seating Available" width="16" height="16" />'}if(A.result[r].multibrandConfiguration=="KT"){y=y+'<img src="./img/ico-kfc.png" alt="KFC" title="KFC Available" width="16" height="16" />'}y=y+'</p>\n</div>\n<div class="popup-bot"></div>\n';var s=r+1;var q=new VEShape(VEShapeType.Pushpin,u);q.SetTitle("");q.SetDescription(y);if(A.result[r].multibrandConfiguration=="KT"){var v='<div class="pin-taco-bell-kfc" id="pin'+r+'">'+s+"</div>"}else{var v='<div class="pin-taco-bell" id="pin'+r+'">'+s+"</div>"}q.SetCustomIcon(v);shapes.push(q)}b.AddShape(shapes);break;case"findStoresNearRoute":shapes=new Array();for(r=0;r<A.result.length;r++){var t=A.result[r].latitude;var o=A.result[r].longitude;var u=new VELatLong(t,o);var w=A.result[r].streetAddress;var x=A.result[r].city+" "+A.result[r].state+" "+A.result[r].postalCode+"<br />"+A.result[r].businessPhone;var y='<div class="popup-top"></div>\n<div class="popup">\n<img class="logo" src="./img/logo-small-taco-bell.png" alt="Taco Bell" title="" width="33" height="42" />\n<h5>'+w+'</h5>\n<p class="address">'+x+'</p>\n<p class="actions"><a href="#driveto" onclick="javascript: new route().getDirections(\''+g+"', '"+A.result[r].streetAddress+", "+A.result[r].city+" "+A.result[r].state+'\', false, false, false); return false;">Drive To</a> &nbsp;|&nbsp; <a href="#drivefrom" onclick="javascript: new route().getRoute(\''+A.result[r].streetAddress+", "+A.result[r].city+" "+A.result[r].state+"', '"+g+'\'); return false;">Drive From</a> &nbsp;|&nbsp; <span class="distance">'+A.result[r].distance.toFixed(1)+" miles</span><br /><a href=\"#phone\" onclick=\"javascript: new sms().popup('location', '"+w+"', '"+x+'\'); return false;">Send to Phone</a></p>\n<p class="amenities">';if(A.result[r].driveThru==true){y=y+'<img src="./img/ico-drive-thru.png" alt="Drive Thru" title="Drive Thru Available" width="16" height="16" />'}if(A.result[r].lateNightHours==true){y=y+'<img src="./img/ico-late-night-hours.png" alt="Late Night Hours" title="Late Night Hours Available" width="16" height="16" />'}if(A.result[r].totalSeats>A.result[r].interiorSeats){y=y+'<img src="./img/ico-outdoor-seating.png" alt="Outdoor Seating" title="Outdoor Seating Available" width="16" height="16" />'}if(A.result[r].multibrandConfiguration=="KT"){y=y+'<img src="./img/ico-kfc.png" alt="KFC" title="KFC Available" width="16" height="16" />'}y=y+'</p>\n</div>\n<div class="popup-bot"></div>\n';var s=r+1;var q=new VEShape(VEShapeType.Pushpin,u);q.SetTitle("");q.SetDescription(y);if(A.result[r].multibrandConfiguration=="KT"){var v='<div class="pin-taco-bell-kfc" id="pin'+r+'">'+s+"</div>"}else{var v='<div class="pin-taco-bell" id="pin'+r+'">'+s+"</div>"}q.SetCustomIcon(v);shapes.push(q)}b.AddShape(shapes);break}}}).setHeader("Content-Type","text/plain; charset=utf-8").setHeader("X-JSON-RPC",a).send()},addPin:function(e,g,f,c){var d=this.options.map;try{var a=new VEShape(VEShapeType.Pushpin,new VELatLong(e,g));a.SetTitle(f);a.SetDescription(c);d.AddShape(a)}catch(b){alert(b)}},createControls:function(){var b=this.options.map;var a=new Element("div",{id:"map-controls"});a.style.top="10px";a.style.left="10px";b.AddControl(a);this.createZoomSlider();this.createZoomInButton();this.createZoomOutButton();this.createPanUpButton();this.createPanDownButton();this.createPanLeftButton();this.createPanRightButton();this.createRoadButton();this.createAerialButton()},adjustSlider:function(){this.options.mySlider.set(map.GetZoomLevel())},createZoomSlider:function(){var d=this.options.map;var b=new Element("div",{id:"slider"});b.style.top="39px";b.style.left="87px";d.AddControl(b);var a=new Element("div",{id:"knob"}).inject(b);var c=new Slider(b,a,{range:[1,19],steps:19,wheel:false,snap:true,onChange:function(e){d.SetZoomLevel(e)},onTick:function(e){this.knob.setStyle("left",e)}}).set(4);this.options.mySlider=c},createZoomInButton:function(){var b=this.options.map;var a=new Element("div",{id:"zoomin",events:{click:function(){b.ZoomIn();this.adjustSlider()}.bind(this)}});a.style.top="32px";a.style.left="204px";b.AddControl(a)},createZoomOutButton:function(){var b=this.options.map;var a=new Element("div",{id:"zoomout",events:{click:function(){b.ZoomOut();this.adjustSlider()}.bind(this)}});a.style.top="32px";a.style.left="68px";b.AddControl(a)},createPanUpButton:function(){var b=this.options.map;var a=new Element("div",{id:"panup",events:{mousedown:function(){b.StartContinuousPan(0,-33)},mouseup:function(){b.EndContinuousPan()}}});a.style.top="25px";a.style.left="30px";b.AddControl(a)},createPanDownButton:function(){var b=this.options.map;var a=new Element("div",{id:"pandown",events:{mousedown:function(){b.StartContinuousPan(0,33)},mouseup:function(){b.EndContinuousPan()}}});a.style.top="50px";a.style.left="30px";b.AddControl(a)},createPanLeftButton:function(){var a=this.options.map;var b=new Element("div",{id:"panleft",events:{mousedown:function(){a.StartContinuousPan(-33,0)},mouseup:function(){a.EndContinuousPan()}}});b.style.top="38px";b.style.left="17px";a.AddControl(b)},createPanRightButton:function(){var b=this.options.map;var a=new Element("div",{id:"panright",events:{mousedown:function(){b.StartContinuousPan(33,0)},mouseup:function(){b.EndContinuousPan()}}});a.style.top="38px";a.style.left="42px";b.AddControl(a)},createRoadButton:function(){var b=this.options.map;var a=new Element("div",{id:"road",events:{click:function(){b.SetMapStyle(VEMapStyle.Road)}}});a.style.top="11px";a.style.left="64px";b.AddControl(a)},createAerialButton:function(){var a=this.options.map;var b=new Element("div",{id:"aerial",events:{click:function(){a.SetMapStyle(VEMapStyle.Aerial)}}});b.style.top="11px";b.style.left="109px";a.AddControl(b)},createMainnavButtons:function(){var a=this.options.map;var b=this.options.inputMessage;$$("#mainnav a").each(function(c){switch(c.getProperty("href")){case"#locations":c.addEvent("click",function(d){d.stop();new controls().showTacoBells(b)});break;case"#directions":c.addEvent("click",function(d){d.stop();new controls().showDirections(b,b)});break}})},createSubnavButtons:function(){var a=this.options.map;var b=this.options.inputMessage;$$("#subnav a").each(function(c){switch(c.getProperty("href")){case"#reset":c.addEvent("click",function(d){d.stop();this.resetform();c.blur()}.bind(this));break;case"#print":c.addEvent("click",function(d){d.stop();this.printpage();c.blur()}.bind(this));break}},this)},createSearchParameters:function(){$$("#search-parameters input").each(function(a){a.addClass("skipnav");if(a.checked){var b=a.getProperty("id");$$("label").each(function(c){if(c.getProperty("for")==b){c.addClass("checked")}})}});$$("#search-parameters label").each(function(a){var b=a.getProperty("for");a.addClass("checkbox").removeProperty("checked").addEvent("click",function(){if($(b).checked){a.removeClass("checked-hover").removeClass("checked").addClass("hover")}else{a.removeClass("hover").addClass("checked").addClass("checked-hover")}}).addEvent("mouseover",function(){if($(b).checked){a.addClass("checked-hover")}else{a.addClass("hover")}}).addEvent("mouseout",function(){a.removeClass("hover").removeClass("checked-hover")})})},createAddressField:function(){var a=this.options.inputMessage;$("address1").set({events:{click:function(){this.addClass("focus");if(this.getProperty("value")==a){this.setProperty("value","")}},focus:function(){this.addClass("focus");if(this.getProperty("value")==a){this.setProperty("value","")}},blur:function(){this.removeClass("focus");if(this.getProperty("value")==""){this.setProperty("value",a)}},mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}})},createSubmitButton:function(){var a=this.options.map;var b=this.options.inputMessage;$("search-form").addEvents({submit:function(f){if($chk(f)){f.stop()}if($chk($("on-route"))){var c=$("on-route").checked;var e=$("drive-thru").checked;if($chk($("late-night-hours"))){var d=$("late-night-hours").checked}else{var d=false}var g=$("outdoor-seating").checked;new route().getDirections($("address1").getProperty("value"),$("address2").getProperty("value"),c,e,d,g)}else{this.findLocation()}}.bind(this)});$("submit1").set({events:{click:function(c){c.stop();$("submit1").addClass("focus");$("search-form").fireEvent("submit");$("submit1").blur()},focus:function(){this.addClass("focus")},blur:function(){this.removeClass("focus")},mouseover:function(){this.addClass("hover")},mouseout:function(){this.removeClass("hover")}}})}});var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(d){for(var a=0;a<d.length;a++){var b=d[a].string;var c=d[a].prop;this.versionSearchString=d[a].versionSearch||d[a].identity;if(b){if(b.indexOf(d[a].subString)!=-1){return d[a].identity}}else{if(c){return d[a].identity}}}},searchVersion:function(b){var a=b.indexOf(this.versionSearchString);if(a==-1){return}return parseFloat(b.substring(a+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();var map=null;map=new VEMap("ve");map.HideDashboard();map.LoadMap();map.SetCenterAndZoom(new VELatLong(38,-97),4);map.ClearInfoBoxStyles();map.ShowScalebar();var storeLocator=new mapObject(map);function EventMouseDown(){return false}function EventMouseWheel(a){if(a.mouseWheelChange>0){map.ZoomIn()}else{map.ZoomOut()}storeLocator.adjustSlider();return true}map.AttachEvent("onmousedown",EventMouseDown);map.AttachEvent("onmousewheel",EventMouseWheel);window.addEvents({domready:function(){storeLocator.createControls();storeLocator.createMainnavButtons();storeLocator.createSubnavButtons();storeLocator.createAddressField();storeLocator.createSearchParameters();storeLocator.createSubmitButton();var b=new URI(window.location);if($chk(b.getData("q"))){storeLocator.findLocation(b.getData("q"))}var a="In order to ensure the best possible experience, please consider upgrading to the ";if(Browser.Engine.trident){if(Browser.Engine.version<5){new Element("p",{id:"upgrade-notice",html:a+'<a href="http://www.microsoft.com/windows/internet-explorer/">latest&nbsp;version of Internet&nbsp;Explorer</a>.'}).inject($("wrapper"),"before")}else{if(Browser.Engine.version==5&&!window.XDomainRequest){new Element("p",{id:"upgrade-notice",html:a+'<a href="http://www.microsoft.com/windows/internet-explorer/">latest&nbsp;version of Internet&nbsp;Explorer</a>.'}).inject($("wrapper"),"before")}}}else{if(Browser.Engine.gecko){if(Browser.Engine.version<19&&BrowserDetect.browser=="Firefox"){new Element("p",{id:"upgrade-notice",html:a+'<a href="http://www.getfirefox.com/">latest&nbsp;version of&nbsp;Firefox</a>.'}).inject($("wrapper"),"before")}else{if(Browser.Engine.version<19){new Element("p",{id:"upgrade-notice",html:a+"latest version of your&nbsp;browser."}).inject($("wrapper"),"before")}}}else{if(Browser.Engine.webkit){if(Browser.Engine.version<525&&BrowserDetect.browser=="Chrome"){new Element("p",{id:"upgrade-notice",html:a+'<a href="http://www.google.com/chrome/">latest&nbsp;version of&nbsp;Chrome</a>.'}).inject($("wrapper"),"before")}else{if(Browser.Engine.version<525&&BrowserDetect.browser=="Safari"){new Element("p",{id:"upgrade-notice",html:a+'<a href="http://www.apple.com/safari/">latest&nbsp;version of&nbsp;Safari</a>.'}).inject($("wrapper"),"before")}else{if(Browser.Engine.version<525){new Element("p",{id:"upgrade-notice",html:a+"latest version of your&nbsp;browser."}).inject($("wrapper"),"before")}}}}else{if(Browser.Engine.presto){if(Browser.Engine.version<960){new Element("p",{id:"upgrade-notice",html:a+'<a href="http://www.opera.com/browser/download/">latest&nbsp;version of&nbsp;Opera</a>.'}).inject($("wrapper"),"before")}}}}}},resize:function(){map.Resize();if($chk($("lightbox"))){var a=new sms();a.positionLightbox();a.positionPopup()}}});