var HD={};HD.init=function(){};HD.register=function(E,B){var D=HD.env.modules;B=B||"1.0";D[E]={name:E,version:B};var A=HD.env.listeners;for(var C=0;C<A.length;C=C+1){A[C](m)}};HD.env=HD.env||{modules:[],listeners:[]};HD.init();HD.register("HD","1.0");if(typeof HD.util=="undefined"){HD.util={};HD.register("util","1.0")}if(typeof HD.ui=="undefined"){HD.ui={};HD.register("ui","1.0")}if(typeof HD.constants=="undefined"){HD.constants={};HD.register("constants","1.0")}HD.constants.JSP_PATH=window.JSP_PATH||"";HD.constants.HELP_PATH=window.HELP_PATH||"";HD.constants.CURSOR_PATH=window.CURSOR_PATH||"";HD.constants.IMAGE_PATH=window.IMAGE_PATH||"";HD.constants.PHOTO_PATH=window.PHOTO_PATH||"";HD.constants.DEFAULT_LOCALE=window.DEFAULT_LOCALE||"";HD.constants.LOCALE=window.LOCALE||"";HD.DWR={formatPoint:function(A){return A.latitude+" "+A.longitude},formatPoints:function(D){var B=D.length;var C=new Array(B);for(var A=0;A<B;A++){C[A]=this.formatPoint(D[A])}return C},formatVELatLong:function(A){return A.Latitude+" "+A.Longitude},parsePoint:function(A,D){if(D==null){D={}}var B=/(-?\d+\.\d+) (-?\d+\.\d+)/;var C=B.exec(A);if(C!=null){D.latitude=C[1];D.longitude=C[2];return D}else{return null}},parseVELatLong:function(A){var B=A.split(" ");return new VELatLong(parseFloat(B[0]),parseFloat(B[1]))}};HD.RequestChain=function(){this.index=0;this.busy=false;this.chain=new Array();this.checkpoints=new Array()};HD.RequestChain.prototype.add=function(A){this.chain.push(A)};HD.RequestChain.prototype.clear=function(){if(!this.busy){this.index=0;this.busy=false;this.chain=new Array();this.checkpoints=new Array()}};HD.RequestChain.prototype.execute=function(){this.checkpoints.push(this.chain.length);if(this.busy){return }this.index=0;if(this.chain.length==0){this.checkpoints.shift();this.busy=false;if(this.success!=null){this.success()}return }var A=this.chain[this.index++];this.busy=true;A.execute.call(A,this)};HD.RequestChain.prototype.requestFailed=function(){this.busy=false;if(this.failure!=null){this.failure(this.chain[this.index-1])}};HD.RequestChain.prototype.requestSucceeded=function(){var B=this.chain.length;var A;if(this.index==this.checkpoints[0]){this.checkpoints.shift();if(this.index==B){this.busy=false;if(this.success!=null){this.success()}}if(this.init!=null){this.init()}}if(this.busy&&this.index!=B){A=this.chain[this.index++];this.busy=true;A.execute.call(A,this)}};HD.content={};HD.content.Text={cancel:"Cancel",char_left_eval:function(A){return(A==1)?"character left":"characters left"},char_limit_eval:function(A){return(A==1)?"character":"characters"},clear:"Clear",close:"Close",defaultErrorMessage:"There was a problem with your request.<br />Please try again later.",edit_note:"Edit Note",errorDialogHeader:"Error occurred ...",limit:"Limit",loading:"Loading",next:"next",ok:"Ok",prev:"prev",save_note:"Save Note",title_note:"Note",states:[{name:"Alabama",code:"AL"},{name:"Alaska",code:"AK"},{name:"Arizona",code:"AZ"},{name:"Arkansas",code:"AR"},{name:"California",code:"CA"},{name:"Colorado",code:"CO"},{name:"Connecticut",code:"CT"},{name:"Delaware",code:"DE"},{name:"District Of Columbia",code:"DC"},{name:"Florida",code:"FL"},{name:"Georgia",code:"GA"},{name:"Hawaii",code:"HI"},{name:"Idaho",code:"ID"},{name:"Illinois",code:"IL"},{name:"Indiana",code:"IN"},{name:"Iowa",code:"IA"},{name:"Kansas",code:"KS"},{name:"Kentucky",code:"KY"},{name:"Louisiana",code:"LA"},{name:"Maine",code:"ME"},{name:"Maryland",code:"MD"},{name:"Massachusetts",code:"MA"},{name:"Michigan",code:"MI"},{name:"Minnesota",code:"MN"},{name:"Mississippi",code:"MS"},{name:"Missouri",code:"MO"},{name:"Montana",code:"MT"},{name:"Nebraska",code:"NE"},{name:"Nevada",code:"NV"},{name:"New Hampshire",code:"NH"},{name:"New Jersey",code:"NJ"},{name:"New Mexico",code:"NM"},{name:"New York",code:"NY"},{name:"North Carolina",code:"NC"},{name:"North Dakota",code:"ND"},{name:"Ohio",code:"OH"},{name:"Oklahoma",code:"OK"},{name:"Oregon",code:"OR"},{name:"Pennsylvania",code:"PA"},{name:"Puerto Rico",code:"PR"},{name:"Rhode Island",code:"RI"},{name:"South Carolina",code:"SC"},{name:"South Dakota",code:"SD"},{name:"Tennessee",code:"TN"},{name:"Texas",code:"TX"},{name:"Utah",code:"UT"},{name:"Vermont",code:"VT"},{name:"Virgin Islands",code:"VI"},{name:"Virginia",code:"VA"},{name:"Washington",code:"WA"},{name:"West Virginia",code:"WV"},{name:"Wisconsin",code:"WI"},{name:"Wyoming",code:"WY"}]};HD.content.Date={init:function(){this.FORMAT.CONFIG.SETTINGS.format=this.FORMAT.CONFIG.SETTINGS.format();this.FORMAT.CONFIG.SETTINGS.parse=this.FORMAT.CONFIG.SETTINGS.parse()},FORMAT:{CONFIG:{SETTINGS:{delimiter:{mask:"\\/",string:"/"},format:function(){return HD.content.Date.FORMAT.MDY},parse:function(){return HD.content.Date.FORMAT.MMDDYYYY}},NUMERIC:{month:{mask:"([01]?[0-9])",string:"m"},day:{mask:"([0-3]?[0-9])",string:"d"},year:{mask:"([0-9]{4})",string:"y"}},VERBOSE:{month:{mask:"([0-9a-zA-Z]+?)",string:"M"},day:{mask:"([0-3]?[0-9])",string:"D"},weekday:{mask:"([a-zA-Z]+?)",string:"W"},year:{mask:"([0-9]{2,4})",string:"Y"}}},HD:{mask:function(A){var B=HD.content.Date.FORMAT;A=A||"-";return new RegExp("^"+B.CONFIG.VERBOSE.year.mask+A+B.CONFIG.VERBOSE.month.mask+A+B.CONFIG.VERBOSE.day.mask+"$")},positions:{month:1,day:2,year:3},string:function(A){A=A||"-";return"YYYY"+A+"MM"+A+"DD"}},MY:{mask:function(A){var B=HD.content.Date.FORMAT;A=A||B.CONFIG.SETTINGS.delimiter.mask;return new RegExp("^"+B.CONFIG.NUMERIC.month.mask+A+B.CONFIG.NUMERIC.year.mask+"$")},positions:{month:1,year:2},string:function(A){A=A||HD.content.Date.FORMAT.CONFIG.SETTINGS.delimiter.string;return"mm"+A+"yyyy"}},MDY:{mask:function(A){var B=HD.content.Date.FORMAT;A=A||B.CONFIG.SETTINGS.delimiter.mask;return new RegExp("^"+B.CONFIG.NUMERIC.month.mask+A+B.CONFIG.NUMERIC.day.mask+A+B.CONFIG.NUMERIC.year.mask+"$")},positions:{month:1,day:2,year:3},string:function(A){A=A||HD.content.Date.FORMAT.CONFIG.SETTINGS.delimiter.string;return"mm"+A+"dd"+A+"yyyy"}},MMDDYYYY:{mask:function(A){var B=HD.content.Date.FORMAT;A=A||B.CONFIG.SETTINGS.delimiter.mask;return new RegExp("^"+B.CONFIG.VERBOSE.month.mask+A+B.CONFIG.VERBOSE.day.mask+A+B.CONFIG.VERBOSE.year.mask+"$")},positions:{month:1,day:2,year:3},string:function(A){A=A||HD.content.Date.FORMAT.CONFIG.SETTINGS.delimiter.string;return"MM"+A+"DD"+A+"YYYY"}},MDYlong:{mask:function(){var A=HD.content.Date.FORMAT;return new RegExp("^"+A.CONFIG.VERBOSE.month.mask+" "+A.CONFIG.VERBOSE.day.mask+", "+A.CONFIG.VERBOSE.year.mask+"$")},positions:{month:1,day:2,year:3},string:function(){return"MMMM D, YYYY"}},WMDYlong:{mask:function(){var A=HD.content.Date.FORMAT;return new RegExp("^"+A.CONFIG.VERBOSE.weekday.mask+" "+A.CONFIG.VERBOSE.month.mask+" "+A.CONFIG.VERBOSE.day.mask+", "+A.CONFIG.VERBOSE.year.mask+"$")},positions:{month:2,day:3,weekday:1,year:4},string:function(){return"WWWW, MMMM D, YYYY"}},WMDYshort:{mask:function(){var A=HD.content.Date.FORMAT;return new RegExp("^"+A.CONFIG.VERBOSE.weekday.mask+" "+A.CONFIG.VERBOSE.month.mask+" "+A.CONFIG.VERBOSE.day.mask+", "+A.CONFIG.VERBOSE.year.mask+"$")},positions:{month:2,day:3,weekday:1,year:4},string:function(){return"WWW, MMM D, YYYY"}}},CONSTANTS:{MILLISECONDS_PER_DAY:24*60*60*1000,WEEKDAY_START:0},DAYS:[{c:"S",s:"Su",m:"Sun",l:"Sunday"},{c:"M",s:"Mo",m:"Mon",l:"Monday"},{c:"T",s:"Tu",m:"Tue",l:"Tuesday"},{c:"W",s:"We",m:"Wed",l:"Wednesday"},{c:"T",s:"Th",m:"Thu",l:"Thursday"},{c:"F",s:"Fr",m:"Fri",l:"Friday"},{c:"S",s:"Sa",m:"Sat",l:"Saturday"}],MONTHS:[{s:"Jan",l:"January"},{s:"Feb",l:"February"},{s:"Mar",l:"March"},{s:"Apr",l:"April"},{s:"May",l:"May"},{s:"Jun",l:"June"},{s:"Jul",l:"July"},{s:"Aug",l:"August"},{s:"Sep",l:"September"},{s:"Oct",l:"October"},{s:"Nov",l:"November"},{s:"Dec",l:"December"}],LABELS:{year:function(A){A=Math.floor(A);if(A==1){return{s:"y",m:"yr",l:"year"}}else{return{s:"y",m:"yrs",l:"years"}}},month:function(A){A=Math.floor(A);if(A==1){return{s:"m",m:"mon",l:"month"}}else{return{s:"m",m:"mos",l:"months"}}},day:function(A){A=Math.floor(A);if(A==1){return{s:"d",m:"day",l:"day"}}else{return{s:"d",m:"days",l:"days"}}},hour:function(A){A=Math.floor(A);if(A==1){return{s:"h",m:"hr",l:"hour"}}else{return{s:"h",m:"hrs",l:"hours"}}},minute:function(A){A=Math.floor(A);if(A==1){return{s:"m",m:"min",l:"minute"}}else{return{s:"m",m:"mins",l:"minutes"}}}}};HD.content.Date.init();HD.content.URL={cursors:{grab:"/media/cursors/grab.cur",grabbing:"/media/cursors/grabbing.cur",grabTarget:"/media/cursors/target.cur"}};HD.content.HTML={errorDialog:'<div class="wrapper"><div class="dialogErrorHeader">'+HD.content.Text.errorDialogHeader+'</div><br /><p>_ERROR_TEXT</p><br /><div style="text-align:center;"><a href="javascript:void(0)" class="btn" onclick="HD.ui.Dialog.hide();">'+HD.content.Text.ok+"</a></div></div>",confirmDialog:'<p class="confirm">_CONFIRM_TEXT</p><br /><div style="text-align:center;"><a href="javascript:void(0)" class="btn" onclick="HD.ui.Dialog.hide();HD.ui.Dialog.confirmCallback();">'+HD.content.Text.ok+'</a><a href="javascript:void(0)" class="btn" onclick="HD.ui.Dialog.hide();">'+HD.content.Text.cancel+"</a></div>",noticeDialog:'<p class="notice">_NOTICE_TEXT</p><br /><div style="text-align:center;"><a href="javascript:void(0)" class="btn" onclick="HD.ui.Dialog.hide();HD.ui.Dialog.noticeCallback();">'+HD.content.Text.ok+"</a></div>"};function $(A){return YAHOO.util.Dom.get(A)}function log(A){if(!!window.showDebug){YAHOO.log(A,"HD :")}}HD.util={template:function(C,A){for(var B in A){C=C.replace(new RegExp(B,"g"),(A[B]!=null?A[B]:"").toString())}return C},hasValue:function(A){return A!=null&&typeof (A)!="undefined"&&A!=""},cloneObject:function(B,A){if(B==null){return null}else{if(B instanceof String){return new String(B)}else{if(typeof (B.clone)=="function"){return B.clone()}else{var C=new B.constructor();return this.copyObject(B,C,A)}}}},copyObject:function(B,D,A){var C;for(var E in B){C=B[E];D[E]=((A)&&(typeof (C)=="object"))?this.cloneObject(C,true):C}return D},indexOf:function(C,B){for(var A=0;A<C.length;A++){if(C[A]==B){return A}}return -1},getRelativeScroll:function(B){var A=(isNaN(B.scrollLeft))?0:B.scrollLeft;var C=(isNaN(B.scrollTop))?0:B.scrollTop;while(B.parentNode){A+=(isNaN(B.parentNode.scrollLeft))?0:B.parentNode.scrollLeft;C+=(isNaN(B.parentNode.scrollTop))?0:B.parentNode.scrollTop;B=B.parentNode}return[A,C]},getBoundingBox:function(C){var F=YAHOO.util.Dom.getXY(C);if(!F){return false}var B=F[0];var A=F[0]+C.offsetWidth;var E=F[1];var D=F[1]+C.offsetHeight;return[B,A,E,D]},getPageOverlap:function(B,D,C){if(D==null||C==null){var E=YAHOO.util.Dom.getXY(B);C=E[0];D=E[1]}var A={overTop:(D<this.getPageScrollTop())?true:false,overBottom:((D+B.offsetHeight)>(this.getPageHeight()+this.getPageScrollTop()))?true:false,overLeft:(C<this.getPageScrollLeft())?true:false,overRight:((C+B.offsetWidth)>(this.getPageWidth()+this.getPageScrollLeft()))?true:false};return A},getInnerText:function(A){if(A.innerText){return A.innerText||""}else{return this.getHTMLFreeText(A)}},getInnerNumber:function(B){var A="";if(B.innerText){A=B.innerText}else{A=this.getHTMLFreeText(B)}A=A.replace(/\(/g,"-");A=A.replace(/\)/g,"");A=A.replace(/[^0-9.\-]/g,"");A=parseFloat(A);if(isNaN(A)){A=0}return A},getHTMLFreeText:function(C){var E="";var D=C.childNodes;var A=D.length;for(var B=0;B<A;B++){switch(D[B].nodeType){case 1:E=E+this.getHTMLFreeText(D[B]);break;case 3:E=E+D[B].nodeValue;break;default:break}}return E},rtrim:function(A){A=!!A?A.toString()||"":"";return A.replace(/\s+$/,"")},rtrimObject:function(B){var A;for(var C in B){A=B[C];if((typeof A=="string")||(A instanceof String)){B[C]=HD.util.rtrim(A)}}},capitalize:function(A){return A.replace(/\w+/g,function(B){return B.charAt(0).toUpperCase()+B.substr(1).toLowerCase()})},pointOutsideBounds:function(J,D,I,F,C,K){I=I||0;F=F||0;C=C||0;K=K||0;var E=this.getBoundingBox(D);var B=E[0]+I;var A=E[1]-F;var H=E[2]+C;var G=E[3]-K;if(B<J[0]&&J[0]<A&&H<J[1]&&J[1]<G){return false}else{return true}},elementsOverlap:function(D,C){if(!D||!C){return }var H=HD.util.getBoundingBox(D);var E=HD.util.getBoundingBox(C);var L=H[0];var K=H[1];var G=H[2];var F=H[3];var B=E[0];var A=E[1];var J=E[2];var I=E[3];if(!(L>A||K<B||G>I||F<J)){return true}return false},elementViewContainsElement:function(C,D){if(!C||!potentialWrapper){return }var A=HD.util.getBoundingBox(C);var B=HD.util.getBoundingBox(D);if(B[0]<=A[0]&&B[1]>=A[1]&&B[2]<=A[2]&&B[3]<=A[3]){return true}return false},shapeInsideView:function(B){var A=HD.rp.hdMap.map.LatLongToPixel(new VELatLong(B.Latitude,B.Longitude));A=[A.x+HD.rp.hdMap.map.GetLeft(),A.y+HD.rp.hdMap.map.GetTop()];return !HD.util.pointOutsideBounds(A,HD.rp.hdMap.map.mapelement)},isIE:(navigator.userAgent.indexOf("MSIE")>=0)?true:false,isIE7:((navigator.userAgent.indexOf("MSIE")>=0)?true:false)&&!!window.XMLHttpRequest,getPageDimensions:function(){var A=[0,0];A[0]=(document.documentElement.offsetWidth||document.body.offsetWidth);A[1]=(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);return A},getPageWidth:function(){return(document.documentElement.offsetWidth||document.body.offsetWidth)},getPageHeight:function(){return(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)},getPageScroll:function(){var A=(document.documentElement.scrollTop||document.body.scrollTop);var B=(document.documentElement.scrollLeft||document.body.scrollLeft);return[B,A]},getPageScrollTop:function(){var A=(document.documentElement.scrollTop||document.body.scrollTop);return A},getPageScrollLeft:function(){var A=(document.documentElement.scrollLeft||document.body.scrollLeft);return A},setPageScroll:function(A){if(document.documentElement.scrollLeft){document.documentElement.scrollLeft=A[0];document.documentElement.scrollTop=A[1]}else{document.body.scrollLeft=A[0];document.body.scrollTop=A[1]}},getDistance:function(B,A){var F=HD.util.Math.toRadians(parseFloat(HD.util.hasValue(B.latitude)?B.latitude:B.Latitude));var D=HD.util.Math.toRadians(parseFloat(HD.util.hasValue(B.longitude)?B.longitude:B.Longitude));var E=HD.util.Math.toRadians(parseFloat(HD.util.hasValue(A.latitude)?A.latitude:A.Latitude));var C=HD.util.Math.toRadians(parseFloat(HD.util.hasValue(A.longitude)?A.longitude:A.Longitude));return Math.acos((Math.sin(F)*Math.sin(E))+(Math.cos(F)*Math.cos(E)*Math.cos(D-C)))},getMouseXY:function(B){var A=(B.pageX)?B.pageX:B.clientX+document.body.scrollLeft;var C=(B.pageY)?B.pageY:B.clientY+document.body.scrollTop;return[A,C]},getRequestParam:function(B){if(!B){return }B=B.replace(/\[/g,"[").replace(/\]/g,"]");var A="[\\?&]"+B+"=([^&#]*)";var E=new RegExp(A);var D=E.exec(window.location.href);var C=D==null?null:D[1];return !!C&&C.match(/^(true|1)$/)?true:(!!C&&C.match(/^(false|0)$/)?false:(!!C&&C.match(/^(null|undefined)$/)?null:C))},convertToJSSafeHTMLString:function(C){C=C||"";var B=new Array();B[B.length]={from:/&/g,to:"&amp;"};B[B.length]={from:/'/g,to:"&#39;"};B[B.length]={from:/"/g,to:"&quot;"};for(var A=0;A<B.length;A++){C=C.replace(B[A].from,B[A].to)}return C},isHTMLElement:function(B,C){if(B==null||typeof B!="object"||B.nodeName==null){return false}if(!C){return true}if(typeof C=="string"&&C.toLowerCase()==B.nodeName.toLowerCase()){return true}if(this.isArray(C)){for(var A=0;A<C.length;A++){if(this.isHTMLElement(B,C[A])){return true}}}return false},isArray:function(A){return(A!=null&&typeof (A)=="object"&&typeof (A.length)=="number"&&(A.length==0||typeof ((A[0]))!="undefined"))},convertToStateCode:function(C){if(!C){return null}C=C.toLowerCase();var A=HD.content.Text.states;for(var B=0;B<A.length;B++){if(C==A[B].name.toLowerCase()){return A[B].code}}return null},binarySearch:function(G,E,F,D){var A=0,C=G.length-1;F=F||function(I,H){return I==H?0:I<H?-1:1};while(A<C){var B=Math.floor((A+C)/2);if(F(G[B],E)==-1){A=B+1}else{C=B}}if(A<G.length&&(F(G[A],E)==0||(!!D&&F(G[A],E)==1))){return A}else{return null}},debugObject:function(B){var A="";for(a in B){try{A+=a+" ["+B[a]+"]\n"}catch(C){continue}}return A},setClassName:function(A,C){var B=$(A);if(B==null){return }B.className=C},hideShowSection:function(E,D,B){var A=$(B);D=$(D);var C=this.getDisplayValue(D);D.style.display=E?C:"none";if(A!=null){A.checked=E}},getDisplayValue:function(B){var A="block";switch(B.nodeName.toLowerCase()){case"table":A="table";break;case"td":A=HD.util.isIE?"block":"table-cell";break;case"tr":A=HD.util.isIE?"block":"table-row";break;case"span":A="inline";break;default:A="block"}return A},disableElement:function(A){var B=$(A);if(B==null){return }B.disabled=true},uncheckAndDisable:function(A){this.uncheckElement(A);this.disableElement(A)},checkElement:function(A){var B=$(A);if(B==null){return }B.checked=true},uncheckElement:function(A){var B=$(A);if(B==null){return }B.checked=false},setVisible:function(A){var B=$(A);if(B==null){return }B.style.display=this.getDisplayValue(B)},setInvisible:function(A){var B=$(A);if(B==null){return }B.style.display="none"},setSectionContent:function(A,D){var C=$(A);var B=C.parentNode;var E=document.createElement("div");E.innerHTML=D;B.insertBefore(E,C);B.removeChild(C);return E},createXMLDoc:function(A){var B;if(window.ActiveXObject){B=new ActiveXObject("Microsoft.XMLDOM");B.async="false";if(A!=null){B.loadXML(A)}}else{if(A!=null){B=new DOMParser().parseFromString(A,"text/xml")}else{B=document.implementation.createDocument("","",null)}}return B},getXMLNodeValue:function(A){var B="";if(A.firstChild){B=A.firstChild.nodeValue}return B},createElement:function(A){var B=document.createElement("div");B.innerHTML=A;return(B.childNodes.length==1)?B.firstChild:B},getDimensions:function(C){var F=$(C);var H=F.style.display;if(H!="none"&&H!=null){return{width:F.offsetWidth,height:F.offsetHeight}}var D=F.style;var I=D.visibility;var G=D.position;var B=D.display;D.visibility="hidden";D.position="absolute";D.display="block";var A=F.clientWidth;var E=F.clientHeight;D.display=B;D.position=G;D.visibility=I;return{width:A,height:E}},isVisible:function(A){return $(A).style.display!="none"},cumulativeOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent}while(B);return[C,A]}};HD.util.IdGenerator={counter:1,generateId:function(){return this.counter++}};HD.util.Math={toDegrees:function(A){return(180/Math.PI)*A},toRadians:function(A){return A*Math.PI/180},toKilometers:function(A){return A*1.609344},latLngToRadians:function(B){if(!isNaN(B)){return this.toRadians(B)}B=B.replace(/[\s]*$/,"");var A=B.slice(-1).toUpperCase();var C;if(!A.match(/[NSEW]/)){return NaN}B=B.slice(0,-1);var D=B.split(/[\s:,??'\'"\"]/);switch(D.length){case 3:C=D[0]/1+D[1]/60+D[2]/3600;break;case 2:C=D[0]/1+D[1]/60;break;case 1:if(/[NS]/.test(A)){B="0"+B}C=B.slice(0,3)/1+B.slice(3,5)/60+B.slice(5)/3600;break;default:return NaN}if(/[WS]/.test(A)){C=-C}return this.toRadians(C)},getDistanceBetweenLatLng:function(G,E,D){D=D||"km";G={lat:this.latLngToRadians(G.Latitude||G.latitude||0),lng:this.latLngToRadians(G.Longitude||G.longitude||0)};E={lat:this.latLngToRadians(E.Latitude||E.latitude||0),lng:this.latLngToRadians(E.Longitude||E.longitude||0)};R=(D=="km")?6371:3959;var C=E.lat-G.lat;var A=E.lng-G.lng;var B=Math.sin(C/2)*Math.sin(C/2)+Math.cos(G.lat)*Math.cos(E.lat)*Math.sin(A/2)*Math.sin(A/2);var H=2*Math.atan2(Math.sqrt(B),Math.sqrt(1-B));var F=R*H;return F},pointInsideMap:function(B,E){var C=E.GetMapView();var A=E.GetCenter();var F={y:Math.abs(C.TopLeftLatLong.Latitude-C.BottomRightLatLong.Latitude)/2,x:Math.abs(C.TopLeftLatLong.Longitude-C.BottomRightLatLong.Longitude)/2};var D={y:Math.abs(B.Latitude-A.Latitude),x:Math.abs(B.Longitude-A.Longitude)};return D.y<=F.y&&D.y<=F.y&&D.x<=F.x&&D.x<=F.x},round:function(B,C){if(!HD.util.hasValue(C)){C=0}var A=Math.pow(10,C);return Math.round(B*A)/A}};HD.register("util","1.0");HD.util.Class={create:function(C){var B=typeof C=="function"?C.prototype:C||{};var A=function(){var E=arguments.callee.prototype;for(var H in E){if(typeof E[H]=="object"&&!(E[H] instanceof Array)&&E[H]!=null){var G=E[H];this[H]={};for(var F in G){this[H][F]=G[F]}}else{if(typeof E[H]!="function"){this[H]=E[H]}}}this.initialize.apply(this,arguments)};for(var D in B){A.prototype[D]=B[D]}if(!A.prototype.initialize){A.prototype.initialize=typeof C=="function"?C:function(){}}return A},extend:function(A,E,D){A=typeof A=="function"?A.prototype:A||{};if(!(E instanceof Array)){E=[E]}for(var B=0;B<E.length;B++){var C=typeof E[B]=="function"?E[B].prototype:E[B]||{};for(var F in C){if(!A[F]||!!D){A[F]=C[F]}}}return A},inherit:function(B,D){var A=HD.util.Class.create(D);HD.util.Class.extend(A,B);var E=A.prototype.initialize;var C=B.prototype.initialize||B;A.prototype.initialize=function(){E.apply(this,arguments);C.apply(this,arguments)};A.prototype.base=B;return A}};HD.util.Cookie={set:function(B,E,A,G,D,F){var C=B+"="+escape(E)+((A)?"; expires="+A:"")+((G)?"; path="+G:"")+((D)?"; domain="+D:"")+((F)?"; secure":"");document.cookie=C},get:function(A){var C=(document.cookie)?document.cookie:"";var D=null;var B=C.split(/\s*[;=]\s*/);for(i=0;i<B.length;i=i+2){if(B[i]==A){D=B[i+1];break}}return D},remove:function(B,D,C){if(this.get(B)){var A=new Date(new Date().setTime(new Date().getTime()-(1000*60*60*24*365)));this.set(B,"",A)}}};YAHOO.Debugger=function(B,A){this.init(B,A)};YAHOO.Debugger.prototype={init:function(D,A){YAHOO.Debugger.debug=this;var C=new YAHOO.widget.LogReader();C._elContainer.style.position="absolute";C._elContainer.style.bottom="15px";C._elContainer.style.right="15px";C.formatMsg=function(H){var I=H.category;var P=I.substring(0,4).toUpperCase();var M=H.time;if(M.toLocaleTimeString){var N=M.toLocaleTimeString()}else{N=M.toString()}var F=M.getTime();var J=YAHOO.widget.Logger.getStartTime();var G=F-J;var S=F-this.getLastTime();var E=H.source;var Q=H.sourceDetail;var O=(Q)?E+" "+Q:E;var L=H.msg;var K=(this.verboseOutput)?['<pre class="yui-log-verbose"><p><span class=\'',I,"'>",P,"</span> ",G,"ms (+",S,") ",N,": ","</p><p>",O,": </p><p>",L,"</p></pre>"]:["<pre><p><span class='",I,"'>",P,"</span> ",G,"ms (+",S,") ",N,": ",O,": ",L,"</p></pre>"];return K.join("")};YAHOO.widget.Logger.reset();var B=document.createElement("div");C._elContainer.appendChild(B);B.innerHTML='<form onsubmit="YAHOO.Debugger.debug.evalit();return false;"><input style="width:330px;font-size:122%" type="text" id="jsinput"/><input type="button" value="OK" style="margin-left:10px;" onclick="YAHOO.Debugger.debug.evalit()"/></form>'},evalit:function(A){if(!A){var B=YAHOO.util.Dom.get("jsinput");A=B.value;B.value=""}try{YAHOO.log(YAHOO.Debugger.debug.globaleval(A))}catch(C){YAHOO.log(C)}return false},globaleval:function(evalStr){YAHOO.log(evalStr);var result=window.eval(evalStr);if(typeof (result)=="object"){var props="<p>{</p>";for(prop in result){if(typeof (result[prop])!="function"){if(typeof (result[prop])=="object"){props+='<p><a href="#" onclick="YAHOO.Debugger.debug.evalit(\''+evalStr+"."+prop+"')\">"+prop+"</a>:"+result[prop]+"</p>"}else{props+="<p><strong>"+prop+"</strong>:"+result[prop]+"</p>"}}}props+="<p>}</p>";return props}else{if(typeof (result)=="undefined"){return""}else{return result}}}};HD.util.Date={areEqual:function(B,A){return !(B<A)&&!(B>A)},getNumDaysInMonth:function(A){if(!A){return }if(typeof A=="string"){A=new Date(this.getJSDateString(A))}return new Date(A.getFullYear(),A.getMonth()+1,0).getDate()},isLeapYear:function(A){return new Date(A,2,0).getDate()==29},formatDate:function(D,H,A){if(!D||(typeof D!="string"&&!D instanceof Date)){return null}if(typeof D=="string"){D=this.parseDate(D,H)}H=H||HD.content.Date.FORMAT.CONFIG.SETTINGS.format;A=A||HD.content.Date.FORMAT.CONFIG.SETTINGS.delimiter.string;var J=function(K){return((K>10)?"":"0")+K};var E=HD.content.Date.FORMAT.CONFIG;var I=HD.content.Date.DAYS;var B=HD.content.Date.MONTHS;var F=H.string(A);var G=function(K,L,M){return K.replace(new RegExp("("+L+"{"+M+"})(?!("+L+"|_))","g"),"_$1_")};F=G(F,E.VERBOSE.year.string,4);F=G(F,E.VERBOSE.year.string,2);F=G(F,E.VERBOSE.year.string,1);F=G(F,E.VERBOSE.weekday.string,4);F=G(F,E.VERBOSE.weekday.string,3);F=G(F,E.VERBOSE.weekday.string,2);F=G(F,E.VERBOSE.weekday.string,1);F=G(F,E.VERBOSE.month.string,4);F=G(F,E.VERBOSE.month.string,3);F=G(F,E.VERBOSE.month.string,2);F=G(F,E.VERBOSE.month.string,1);F=G(F,E.VERBOSE.day.string,2);F=G(F,E.VERBOSE.day.string,1);F=G(F,E.NUMERIC.year.string,4);F=G(F,E.NUMERIC.month.string,2);F=G(F,E.NUMERIC.day.string,2);var C=function(K,M,N,L){return K.replace(new RegExp("_"+M+"{"+N+"}_","g"),L)};F=C(F,E.VERBOSE.year.string,4,D.getFullYear());F=C(F,E.VERBOSE.year.string,2,D.getFullYear().toString().substr(2,2));F=C(F,E.VERBOSE.year.string,1,D.getFullYear());F=C(F,E.VERBOSE.weekday.string,4,I[D.getDay()].l);F=C(F,E.VERBOSE.weekday.string,3,I[D.getDay()].m);F=C(F,E.VERBOSE.weekday.string,2,I[D.getDay()].s);F=C(F,E.VERBOSE.weekday.string,1,I[D.getDay()].c);F=C(F,E.VERBOSE.month.string,4,B[D.getMonth()].l);F=C(F,E.VERBOSE.month.string,3,B[D.getMonth()].s);F=C(F,E.VERBOSE.month.string,2,J(1+D.getMonth()));F=C(F,E.VERBOSE.month.string,1,1+D.getMonth());F=C(F,E.VERBOSE.day.string,2,J(D.getDate()));F=C(F,E.VERBOSE.day.string,1,D.getDate());F=C(F,E.NUMERIC.year.string,4,D.getFullYear());F=C(F,E.NUMERIC.month.string,2,1+D.getMonth());F=C(F,E.NUMERIC.day.string,2,D.getDate());return F},formatDateHD:function(A){return this.formatDate(A,HD.content.Date.FORMAT.HD,"-")},formatDateSpan:function(C,A,B){B=B||HD.content.Date.FORMAT.CONFIG.SETTINGS.format;return !!C&&!!A?(HD.util.Date.areEqual(C,A)?HD.util.Date.formatDate(C,B):HD.util.Date.formatDate(C,B)+" &ndash; "+HD.util.Date.formatDate(A,B)):""},parseDate:function(B,D,A){if(!B||typeof B!="string"){return null}D=D||HD.content.Date.FORMAT.CONFIG.SETTINGS.parse;A=A||HD.content.Date.FORMAT.CONFIG.SETTINGS.delimiter.mask;var C=B.match(D.mask(A));if(C){return new Date(!!D.positions.year?parseInt(C[D.positions.year],10):new Date().getFullYear(),!!D.positions.month?-1+parseInt(C[D.positions.month],10):0,!!D.positions.day?parseInt(C[D.positions.day],10):1)}else{return null}},parseDateHD:function(A){return this.parseDate(dt,HD.content.Date.FORMAT.HD)},getVerboseDateString:function(A){return this.formatDate(A,HD.content.Date.FORMAT.MDYlong)},getJSDateString:function(A){return this.formatDate(A,HD.content.Date.FORMAT.MMDDYYYY)},getFullTextDate:function(A){return this.formatDate(A,HD.content.Date.FORMAT.WMDYlong)},getShortTextDate:function(A){return this.formatDate(A,HD.content.Date.FORMAT.WMDYshort)},getDayOfWeekFromDate:function(A,B){if(!A||(typeof A!="string"&&!A instanceof Date)){return null}if(typeof A=="string"){A=this.parseDate(A,B)}return HD.content.Date.DAYS[A.getDay()][B]},getMonthFromDate:function(A,B){if(!A||(typeof A!="string"&&!A instanceof Date)){return null}if(typeof A=="string"){A=this.parseDate(A,B)}return HD.content.Date.MONTHS[A.getMonth()][B]},getArmyTime:function(D){if(!D){return }var A=D.split(":");var C=parseInt(A[0]);var E=A[1].substring(0,2);var B=true;if(A[1].indexOf("p")>=0||A[1].indexOf("P")>=0){B=false}if(B&&C=="12"){C=0}else{if(!B&&C!="12"){C=parseInt(C)+12}}C=(C<10?"0":"")+C;return C+":"+E},getDifferenceInDays:function(A,B){return Math.round((A.getTime()-B.getTime())/HD.content.Date.CONSTANTS.MILLISECONDS_PER_DAY)},parseMinutes:function(A){return this.parseMilliseconds(A*60*1000)},parseMilliseconds:function(C){if(C==null){return }var E=Math.floor(C/1000);C=C%1000;var D=Math.floor(E/60);E=E%60;var A=Math.floor(D/60);D=D%60;var F=Math.floor(A/24);A=A%24;var B=new Array();if(F!=null&&F!=0){B.push(F+" "+HD.content.Date.LABELS.day(F).s)}if(A!=null&&A!=0){B.push(A+" "+HD.content.Date.LABELS.hour(A).s)}if(D!=null&&D!=0){B.push(D+" "+HD.content.Date.LABELS.minute(D).m)}return B.join(" ")}};HD.util.PageResizeHandler={pageWidth:-1,pageHeight:-1,elementResizers:[],init:function(){for(var A=0;A<HD.util.PageResizeHandler.elementResizers.length;A++){HD.util.PageResizeHandler.elementResizers[A].init()}HD.util.PageResizeHandler.handlePageResize();YAHOO.util.Event.addListener(window,"resize",HD.util.PageResizeHandler.handlePageResize)},handlePageResize:function(){var A=HD.util.PageResizeHandler.updateProperties();if(A){HD.util.PageResizeHandler.resizePageElements()}},preResizeListener:null,postResizeListener:null,resizePageElements:function(){if(this.preResizeListener){this.preResizeListener()}for(var A=0;A<HD.util.PageResizeHandler.elementResizers.length;A++){HD.util.PageResizeHandler.elementResizers[A].resize(HD.util.PageResizeHandler.pageWidth,HD.util.PageResizeHandler.pageHeight)}if(this.postResizeListener){this.postResizeListener()}},updateProperties:function(){var A=false;if(this.pageWidth!=HD.util.getPageWidth()||this.pageHeight!=HD.util.getPageHeight()){this.pageWidth=HD.util.getPageWidth();this.pageHeight=HD.util.getPageHeight();A=true}return A},addElementToResize:function(A,D,B){var C=new HD.util.ElementResizer(A,D,B);HD.util.PageResizeHandler.elementResizers.push(C);return C},clearPageResizer:function(){HD.util.PageResizeHandler.elementResizers=new Array()},resizeElement:function(A,D,C){var B=$(A).style;if(D){B.width=(this.pageWidth-D)+"px"}if(C){B.height=(this.pageHeight-C)+"px"}}};HD.util.ElementResizer=function(A,C,B){this.elementID=A||"";this.widthOffset=C||0;this.heightOffset=B||0;this.element=null;this.elementStyle=null;this.resizeListener=null};HD.util.ElementResizer.prototype.init=function(){this.element=$(this.elementID);if(this.element){this.elementStyle=this.element.style}};HD.util.ElementResizer.prototype.resize=function(A,B){if(!this.element){return }A=A||HD.util.PageResizeHandler.pageWidth;B=B||HD.util.PageResizeHandler.pageHeight;if(this.widthOffset&&this.widthOffset<A){this.elementStyle.width=(A-this.widthOffset)+"px"}if(this.heightOffset&&this.heightOffset<B){this.elementStyle.height=(B-this.heightOffset)+"px"}if(this.resizeListener){this.resizeListener()}};HD.util.FormUtil={dataStructureIndicator:"/",getElements:function(A){var B=document.getElementsByName(A);return(B&&B.length>0)?B:[$(A)]},getElementName:function(A){if(A.name!=null&&A.name!=""){return A.name}if(A.id!=null&&A.id!=""){return A.id}return null},isValidFormElement:function(A){if(HD.util.isHTMLElement(A,["select","textarea"])){return true}if(HD.util.isHTMLElement(A,"input")&&!(A.type=="button"||A.type=="submit")){return true}return false},getSelectValue:function(A){var B="";if(A.selectedIndex!=-1){B=A.options[A.selectedIndex].value}return B||""},setSelectValue:function(B,C){if(!C||C==""){return }for(var A=0;A<B.options.length;A++){v=B.options[A].value;v=(v==null||C=="")?B.options[A].text:v;if(v==C){B.options[A].selected=true;return }}},getInputValue:function(A){switch(A.type){case"checkbox":case"check-box":case"radio":return(A.checked)?A.value:"";default:return A.value||""}},setInputValue:function(A,B){if(!B||B==""){return }switch(A.type){case"checkbox":case"check-box":A.checked=((B==A.value)||((HD.util.isArray(B))&&(HD.util.indexOf(B,A.value)>=0)))?true:false;break;case"radio":A.checked=(A.value==B)?true:false;break;default:A.value=(B)?B:A.value;break}},getTextAreaValue:function(A){return A.value||""},setTextAreaValue:function(A,B){A.value=(B)?B:A.value},getValue:function(C){var B=this.getElements(C);if(!B){return }C=B[0];var D="";if(B.length>1){for(var A=0;A<B.length;A++){D=this.getValue(B[A]);if(D!=""){break}}return D||""}if(HD.util.isHTMLElement(C,"select")){D=this.getSelectValue(C)}if(HD.util.isHTMLElement(C,"input")){D=this.getInputValue(C)}if(HD.util.isHTMLElement(C,"textarea")){D=this.getTextAreaValue(C)}return D||""},setValue:function(C,D){var B=this.getElements(C);if(!B){return }C=B[0];if(B.length>1){for(var A=0;A<B.length;A++){this.setValue(B[A])}return }if(HD.util.isHTMLElement(C,"select")){this.setSelectValue(C,D)}if(HD.util.isHTMLElement(C,"input")){this.setInputValue(C,D)}if(HD.util.isHTMLElement(C,"textarea")){this.setTextAreaValue(C,D)}},getValues:function(B){var D=$(B);if(!D||!HD.util.isHTMLElement(D)||D.elements==null){return null}var J,K,L,M,I,A,F;var H={};for(var G=0;G<D.elements.length;G++){var C=D.elements[G];if(!this.isValidFormElement(C)){continue}J=this.getValue(C);if((L=this.getElementName(C))==null){L="element"+G}M=L.split(this.dataStructureIndicator);A=H;if(M.length>1){I=M.length-1;for(var E=0;E<I;++E){L=M[E];F=A[L];if(F==null){F={};A[L]=F}A=F}L=M[I]}K=A[L];if(K!=null&&K!=""){if(J!=""){if(!(HD.util.isArray(K))){K=new Array(K);A[L]=K}if(J!=""){K.push(J)}}}else{A[L]=J}}return H},setValues:function(B,H){var D=$(B);if(!D||!HD.util.isHTMLElement(D)||D.elements==null){return null}var J,K,L,I,A,F;for(var G=0;G<D.elements.length;G++){var C=D.elements[G];if(!this.isValidFormElement(C)){continue}if((K=this.getElementName(C))==null){K="element"+G}L=K.split(this.dataStructureIndicator);A=H;if(L.length>1){I=L.length-1;for(var E=0;E<L.length;++E){K=L[E];J=A[K];if(J==null){break}A=F}}else{J=A[K]}if(J&&J!=""){this.setValue(C,J)}}},markErrors:function(I,B,J,G){if(!I&&!B){return }G=G||"formError";B=B||document.body;var D=YAHOO.util.Dom.getElementsByClassName(G,null,$(B));for(var E=0;E<D.length;E++){YAHOO.util.Dom.removeClass(D[E],G)}var H,A,F="";for(var C=0;C<I.length;C++){F+=I[C].msg+"<br/>";A=this.getElements(I[C].property);if(HD.util.isArray(A)){A=A[0]}YAHOO.util.Dom.addClass(A.parentNode.parentNode,G)}if(J){$(J).innerHTML=F;$(J).className=G}}};HD.util.RenderFactory=function(){this.renderers=[];this.add=function(B,A,C){this.renderers[this.renderers.length]={renderer:B,renderFor:A,params:C}};this.render=function(E,D,B){var A=[D||E];if(!!B){for(var C=0;C<B.length;C++){A.push(B[C])}}for(var F=0;F<this.renderers.length;F++){try{if(E instanceof this.renderers[F].renderFor){if(!B){A[1]=this.renderers[F].params}this.renderers[F].renderer.render.apply(this.renderers[F].renderer,A)}}catch(G){log("RenderFactory.render() exception: "+(G?G.message:G))}}};this.clear=function(B){for(var A=0;A<this.renderers.length;A++){if(B instanceof this.renderers[A].renderFor){this.renderers[A].renderer.clear(B,this.renderers[A].params)}}};this.rerender=function(B){for(var A=0;A<this.renderers.length;A++){try{if(B instanceof this.renderers[A].renderFor){this.renderers[A].renderer.rerender(B,this.renderers[A].params)}}catch(C){log("RenderFactory.render() exception: "+(C?C.message:C))}}}};HD.util.EventController={cache:[],create:function(D,A,E){var C=this.getCache(A);if(!C.events[D]){C.events[D]=new YAHOO.util.CustomEvent(D,E);var B=this;C.events[D].inject=function(F,G){return B.inject.call(B,D,A,F,G)}}return C.events[D]},events:function(A){var C=this.getCache(A);var B=this;C.create=function(D,E){return B.create.call(B,D,A,E)};C.inject=function(D,E,F){return B.inject.call(B,D,A,E,F)};C.get=function(D,E,F){return B.get.call(B,D,A,E,F)};return C},inject:function(C,A,D,E){var B=this.get(C,A);if(!!B){if(!!E){return function(){B.fire();return D.apply(D,arguments)}}else{return function(){var F=D.apply(D,arguments);B.fire();return F}}}},getCache:function(A){for(var B=0;B<this.cache.length;B++){if(this.cache[B].owner==A){return this.cache[B]}}this.cache.push({owner:A,events:{}});return this.cache[this.cache.length-1]},get:function(C,A){var B=this.getCache(A);return B.events[C]||null},clean:function(){for(var B=0;B<this.cache.length;B++){if(this.cache[B].owner==null){for(var A in this.cache[B].events){this.cache[B].events[A].unsubscribeAll();delete this.cache[B].events[A]}}}}};HD.util.DWRMonitor=function(A){this.monitor=A;this.cache=[];var C=this;var D=dwr.engine._sendData;var B=function(E){D(E);if(!!E&&!!E.req&&!!C.monitor[E.map["c0-scriptName"]]){for(var F=0;F<C.monitor[E.map["c0-scriptName"]].length;F++){if(C.monitor[E.map["c0-scriptName"]][F]==E.map["c0-methodName"]){C.cache.push({batch:E,req:E.req,script:E.map["c0-scriptName"],method:E.map["c0-methodName"]});break}}}};dwr.engine._sendData=B;this.kill=function(E){E=E||null;var F=function(K){if(!!E){for(var I in E){if(I==K.script){for(var J=0;J<E[I].length;J++){if(E[I][J]==K.method){return true}}}}return false}else{return true}};for(var G=C.cache.length-1;G>=0;G--){if(!C.cache[G].batch.completed){if(F(C.cache[G])){try{clearInterval(C.cache[G].batch.interval);dwr.engine._clearUp(C.cache[G].batch);C.cache[G].req.onreadystatechange=function(){};C.cache[G].req.abort()}catch(H){}C.cache.splice(G,1)}}else{C.cache.splice(G,1)}}}};HD.util.Hitbox=function(A){A=A||{};this.accounts=A.accounts||{};this.categories=A.categories||{};for(var B in this.accounts){this.categories[B]=this.categories[B]||""}if(!!A.rules){this.rules=A.rules instanceof HD.util.Hitbox.Rule?A.rules:new HD.util.Hitbox.Rule(A.rules)}else{this.rules=new HD.util.Hitbox.Rule()}if(!!HD.util.Hitbox.Settings.debug){window._hbPageView=(function(C,D){if(!!window.console&&!!window.console.log){return function(E,F){console.log(hbx.acct,"   ",F,"   ",E)}}else{if(!!window.log){return function(E,F){log(hbx.acct+"   "+F+"   "+E)}}else{return function(E,F){}}}})();window._SV=function(){}}};HD.util.Hitbox.prototype.track=function(I,E,D){if(!!HD.util.Hitbox.Settings.enabled&&!!window._hbPageView&&!!window._SV){var A=I instanceof HD.util.Hitbox.Rule?I:this.select(I);if(!!A){var L=!!window._hbq?_hbq:"";var H=[];for(var F in this.accounts){H.push(this.accounts[F])}H=H.join(";");var K=[];for(var J in this.categories){var G=A.resolve(E,J);K.push((this.categories[J]+G.category).substr(0,100))}K=K.join(";");var C=[];for(var B in this.accounts){C.push(G.pagename)}C=C.join(";");_SV("hb",H);_hbPageView(C,K);if(!!D){D()}_hbq=L}else{if(!!I&&typeof I=="string"){if(typeof log=="function"){log("Unable to select rule: "+I.toString())}}}if(!A&&!!D){D()}}else{if(!!D){D()}}};HD.util.Hitbox.prototype.add=function(){return this.rules.add.apply(this.rules,arguments)};HD.util.Hitbox.prototype.remove=function(){return this.rules.remove.apply(this.rules,arguments)};HD.util.Hitbox.prototype.select=function(){return this.rules.select.apply(this.rules,arguments)};HD.util.Hitbox.Settings={enabled:true,debug:false};HD.util.Hitbox.Rule=function(B){this.parent=null;B=B||{};this.exclude=B.exclude||B.x||[];this.category=B.category||B.c||"";this.pagename=B.pagename||B.p||"";this.rules=[];var C=B.rules||B.r||[];for(var A=0;A<C.length;A++){this.add(C[A] instanceof HD.util.Hitbox.Rule?C[A]:new HD.util.Hitbox.Rule(C[A]))}};HD.util.Hitbox.Rule.prototype.add=function(A){if(!(A instanceof HD.util.Hitbox.Rule)){A=new HD.util.Hitbox.Rule(A)}A.parent=this;this.rules.push(A);return A};HD.util.Hitbox.Rule.prototype.remove=function(B){for(var A=0;A<this.rules.length;A++){if(this.rules[A]==B||this.rules[A].category==B){return this.rules.splice(A,1)[0]}}return null};HD.util.Hitbox.Rule.prototype.resolve=function(F,E){var C={category:[],pagename:this.pagename};var G=this;while(!!G){var A=false;if(!!E){for(var B=0;B<G.exclude.length;B++){if(G.exclude[B]==E){A=true;break}}}if(!A){C.category.push(G.category)}else{C.category=[]}G=G.parent}C.category.reverse();C.category=(!!C.category[0]?"/":"")+C.category.join("/");if(!!F){for(var H in F){F[H]=F[H].toString().replace(/\//g,"+")}}C.category=HD.util.template(C.category,F||{});C.pagename=HD.util.template(C.pagename,F||{});var D=/['"&<>]/g;C.category=C.category.replace(D,"").substr(0,100).replace(/\s/g,"+");C.pagename=C.pagename.replace(D,"").substr(0,100).replace(/\s/g,"+");return C};HD.util.Hitbox.Rule.prototype.select=function(C){if(C instanceof HD.util.Hitbox.Rule){return C}var B=C.split("/");if(B.length>0){for(var A=0;A<this.rules.length;A++){if(this.rules[A].category==B[0]){if(B.length>1){return this.rules[A].select(B.slice(1).join("/"))}else{return this.rules[A]}}}return null}else{return null}};HD.User={data:{},isLoggedIn:false,promptLogin:function(A){if(this.isLoggedIn){return true}if(A!=null){this.onLoginCallback=A}this.showLogin();return false},keepAliveTimeoutId:null,keepAliveTimeoutLength:3000000,defaultKeepAliveLength:3000000,showLogin:function(){},setUser:function(A){if(A){setTimeout(function(){HD.User.setUser(false)},10);return }var B=this;UserService.getCurrentUser(function(C){B.handleGetCurrentUser.call(B,C)})},handleGetCurrentUser:function(A){if(A.user!=null){this.data=A.user;this.data.fullName=this.data.firstName;this.data.fullName+=(this.data.lastName!=null)?" "+this.data.lastName:"";this.isLoggedIn=true;if(this.keepAliveTimeoutId){clearTimeout(this.keepAliveTimeoutId);this.keepAliveTimeoutId=null}this.keepAliveTimeoutLength=(this.data.timeout)?(this.data.timeout*1000*60)-3000:this.defaultKeepAliveLength;this.keepAliveTimeoutId=setTimeout(function(){HD.User.keepAlive()},this.keepAliveTimeoutLength);if(this.onLoginCallback!=null){this.onLoginCallback()}}else{this.data={};this.isLoggedIn=false}if(!!this.setUserListener){this.setUserListener()}},keepAlive:function(){UserService.isUserLoggedIn(function(B){var A=HD.User;A.isLoggedIn=B;if(A.keepAliveTimeoutId){clearTimeout(A.keepAliveTimeoutId)}A.keepAliveTimeoutId=setTimeout(function(){HD.User.keepAlive()},A.keepAliveTimeoutLength)})},checkLogin:function(A,C){this.isLoggedInFunction=A||function(){};this.notLoggedInFunction=C||function(){};var B=this;UserService.isUserLoggedIn(function(D){B.handleCheckLogin(D)})},handleCheckLogin:function(A){this.isLoggedIn=A;if(this.isLoggedIn){this.isLoggedInFunction()}else{this.notLoggedInFunction()}},userReconnect:function(){this.isLoggedIn=false;HD.rp.WelcomeBox.setMessage(null);HD.ui.Dialog.hide();HD.ui.Dialog.showError(HD.rp.text.sessionTimeOut,300,125);this.promptLogin()}};HD.ui.Accordian=function(A,B,C){this.acc=A;this.tEls=[];this.cEls=[];this.stEls=[];this.selectedTabIndex=null;this.lastSelectedIndex=null;this.tabsHeight=0;this.staticTabsHeight=0;this.contentHeight=B|0;this.minContentHeight=0;this.accordianBorderHeight=2;this.slideRate=10;this.slideIncrement=80;this.intervalID=null;this.initOnOpenIndex=C;this.allowCloseAll=false;this.attachTabEvents=true;this.animationsToRun=new Array();this.tabsToHide=new Array();this.tabClass="t";this.tabSelectedClass="selected";this.contentClass="c";this.staticTabClass="st";this.onOpenListener=null;this.onResizeListener=null};HD.ui.Accordian.prototype.init=function(){this.acc=$(this.acc);var A=this.acc.childNodes;this.tEls=[];this.cEls=[];this.stEls=[];for(var B=0;B<A.length;B++){var C=A[B];if(!C.className){continue}if(YAHOO.util.Dom.hasClass(C,this.tabClass)||YAHOO.util.Dom.hasClass(C,this.tabSelectedClass)){this.tEls.push(C);if(this.attachTabEvents){this.addTabEvents(C,this.tEls.length-1)}if(YAHOO.util.Dom.hasClass(C,this.tabSelectedClass)){this.selectedTabIndex=this.tEls.length-1}this.tabsHeight+=C.offsetHeight}if(YAHOO.util.Dom.hasClass(C,this.contentClass)){this.cEls.push(C);if(isNaN(parseInt(C.style.height,10))){C.style.display="none";C.style.height="0px"}}if(YAHOO.util.Dom.hasClass(C,this.staticTabClass)){this.stEls.push(C);this.staticTabsHeight+=C.offsetHeight}}this.updateContentHeight();this.animationsToRun.length=this.tEls.length;if(this.initOnOpenIndex!=null&&this.initOnOpenIndex>=0){this.cEls[this.initOnOpenIndex].style.height=this.contentHeight+"px";this.cEls[this.initOnOpenIndex].style.display="block"}};HD.ui.Accordian.prototype.addTabEvents=function(C,A){if(C.getAttribute("disabled")){return }var B=this;YAHOO.util.Event.addListener(C,"click",function(D){B.selectTab(A,D)})};HD.ui.Accordian.prototype.updateContentHeight=function(){this.tabsHeight=0;for(var C=0;C<this.tEls.length;C++){this.tabsHeight+=this.tEls[C].offsetHeight}this.staticTabsHeight=0;for(var B=0;B<this.stEls.length;B++){this.staticTabsHeight+=this.stEls[B].offsetHeight}var E=this.tEls.length>0?Math.floor(this.tabsHeight/this.tEls[0].offsetHeight):0;var A=0;if(!HD.util.isIE&&E>=4){A++}var D=parseInt(this.acc.style.height)-A-this.tabsHeight-this.staticTabsHeight;this.contentHeight=(D>this.minContentHeight)?D:this.minContentHeight;this.cEls[this.selectedTabIndex].style.height=this.contentHeight+"px"};HD.ui.Accordian.prototype.selectTab=function(A,E){if(E){var F=(E.target)?E.target:E.srcElement;if(YAHOO.util.Dom.hasClass(F,"close")){return }}this.showTab(A);if(A==this.selectedTabIndex&&!this.allowCloseAll){return }this.stopAllAnimations();for(var B=0;B<this.cEls.length;B++){this.animationsToRun[B]="none";if(parseInt(this.cEls[B].style.height)>0){if(this.lastSelectedIndex!=B||this.lastSelectedIndex!=A){this.animationsToRun[B]="close";YAHOO.util.Dom.removeClass(this.tEls[B],this.tabSelectedClass)}}}var D;if(A==this.selectedTabIndex){if(this.allowCloseAll){this.animationsToRun[A]="close";this.selectedTabIndex=null;D=this.tEls[A];D.className=this.tabClass;YAHOO.util.Dom.removeClass(D,this.tabSelectedClass)}}else{this.animationsToRun[A]="open";this.selectedTabIndex=A;D=this.tEls[A];YAHOO.util.Dom.addClass(D,this.tabSelectedClass)}var C=this;this.intervalId=setInterval(function(){C.animateAccordian()},this.slideRate);this.lastSelectedIndex=A};HD.ui.Accordian.prototype.animateAccordian=function(){var B,A=0;for(A=0;A<this.animationsToRun.length;A++){if(this.animationsToRun[A]=="close"){this.slideClose(A);B++}if(this.animationsToRun[A]=="open"){this.slideOpen(A);B++}}if(B==0){clearInterval(this.intervalId);if(this.tabsToHide.length>0){for(A=0;A<this.tabsToHide.length;A++){this.hideTab(this.tabsToHide[A])}this.tabsToHide=new Array()}}};HD.ui.Accordian.prototype.slideOpen=function(A){var C=this.cEls[A].style;if((this.contentHeight-parseInt(C.height))>=this.slideIncrement){C.display="block";C.height=(parseInt(C.height)+this.slideIncrement)+"px"}else{var B=parseInt(C.height);C.display="block";C.height=this.contentHeight+"px";this.animationsToRun[A]=null;if(this.onOpenListener!=null){this.onOpenListener(A)}}};HD.ui.Accordian.prototype.slideClose=function(A){var B=this.cEls[A].style;if(parseInt(B.height)>=this.slideIncrement){B.height=(parseInt(B.height)-this.slideIncrement)+"px"}else{B.height="0px";B.display="none";this.animationsToRun[A]=null}this.updateContentHeight()};HD.ui.Accordian.prototype.stopAllAnimations=function(){if(this.intervalId!=null){clearInterval(this.intervalId)}this.animationsToRun=new Array(this.tEls.length)};HD.ui.Accordian.prototype.showTab=function(A){if(!YAHOO.util.Dom.hasClass(this.tEls[A],"closed")){return }var B=this.tEls[A];YAHOO.util.Dom.removeClass(B,"closed");var C=B.offsetHeight;this.tabsHeight+=C;this.updateContentHeight()};HD.ui.Accordian.prototype.hideTab=function(A){if(YAHOO.util.Dom.hasClass(this.tEls[A],"closed")){return }var B=this.tEls[A];var C=B.offsetHeight;YAHOO.util.Dom.addClass(B,"closed");this.tabsHeight-=C;this.updateContentHeight();if(A==this.selectedTabIndex){this.tabsToHide[this.tabsToHide.length]=A;this.selectTab(0);return }};HD.ui.Accordian.prototype.showStaticTab=function(A){var B=this.stEls[A];if(B.style.display&&B.style.display!="none"){return }B.style.display="block";var C=B.offsetHeight;this.staticTabsHeight+=C;this.updateContentHeight()};HD.ui.Accordian.prototype.hideStaticTab=function(A){var B=this.stEls[A];if(B.style.display=="none"){return }var C=B.offsetHeight;B.style.display="none";this.staticTabsHeight-=C;this.updateContentHeight()};HD.ui.Accordian.prototype.resize=function(){this.updateContentHeight();if(this.onResizeListener){this.onResizeListener()}};HD.ui.Dialog={TYPES:{STANDARD:"standard",ERROR:"error",CONFIRM:"confirm",ALERT:"alert"},dialogType:"standard",options:{wrapperElId:"hdDialogWrapper",contentElId:"hdDialogContent",headerElId:"hdDialogHeader",defaultWidth:670,defaultHeight:425},failureText:HD.content.Text.defaultErrorMessage,hdDialog:null,wrapperEl:null,contentEl:null,headerEl:null,isInit:false,callbackCache:{height:null,width:null,title:null},isShown:false,events:{beforeInit:{name:"beforeInit",event:null},afterInit:{name:"afterInit",event:null},beforeHide:{name:"beforeHide",event:null},afterHide:{name:"afterHide",event:null},beforeShow:{name:"beforeShow",event:null},afterShow:{name:"afterShow",event:null},beforeConfirm:{name:"beforeConfirm",event:null},beforeNotice:{name:"beforeNotice",event:null},beforeError:{name:"beforeError",event:null}},initEvents:function(){for(var A in this.events){this.events[A].event=new YAHOO.util.CustomEvent(this.events[A].name,this)}},init:function(){this.events.beforeInit.event.fire();this.wrapperEl=document.createElement("div");this.wrapperEl.id=this.options.wrapperElId;this.wrapperEl.style.height="auto";this.wrapperEl.style.width="auto";document.body.appendChild(this.wrapperEl);this.headerEl=document.createElement("div");this.headerEl.id=this.options.headerElId;this.headerEl.className="hd";this.wrapperEl.appendChild(this.headerEl);this.contentEl=document.createElement("div");this.contentEl.className="bd";this.contentEl.id=this.options.contentElId;this.wrapperEl.appendChild(this.contentEl);var A={fixedcenter:false,visible:false,modal:true,close:true,constraintoviewport:true};this.hdDialog=new YAHOO.widget.Dialog(this.options.wrapperElId,A);this.hdDialog.element.style.zIndex=999999999;this.hdDialog.beforeHideEvent.subscribe(function(){HD.ui.Dialog.events.beforeHide.event.fire();HD.ui.Dialog.contentEl.innerHTML="";HD.ui.Dialog.isShown=false;HD.ui.Dialog.events.afterHide.event.fire()});this.isInit=true;this.events.afterInit.event.fire()},load:function(C,F,E,B,D,A){var G=(E)?"POST":"GET";callback=B||HD.ui.Dialog.loadCallback;this.callbackCache.width=D||this.options.defaultWidth;this.callbackCache.height=A||this.options.defaultHeight;this.callbackCache.title=F||"";this.connectionRequest=YAHOO.util.Connect.asyncRequest(G,C,callback,null);return },loadCallback:{success:function(A){HD.ui.Dialog.show(HD.ui.Dialog.callbackCache.title,HD.ui.Dialog.callbackCache.width,HD.ui.Dialog.callbackCache.height,A.responseText)},failure:function(){HD.ui.Dialog.showError()},argument:null},show:function(F,B,I,D,E,C,H,A){if(!D){return }if(this.isInit){HD.ui.Dialog.hide()}this.events.beforeShow.event.fire();if(!this.isInit){this.init()}B=(B)?this.convertWidthHeight(B):this.convertWidthHeight(this.options.defaultWidth);I=(I)?this.convertWidthHeight(I):this.convertWidthHeight(this.options.defaultHeight);F=F||this.callbackTitle;this.contentEl=$(this.options.contentElId);this.contentEl.innerHTML="";this.contentEl.style.width=HD.ui.Dialog.convertWidthHeight(B);this.contentEl.style.height=HD.ui.Dialog.convertWidthHeight(I);this.hdDialog.render();this.hdDialog.element.marginTop="-10000px";this.headerEl.innerHTML=unescape(F);this.contentEl=$(this.options.contentElId);this.contentEl.style.display="none";if(D instanceof YAHOO.widget.TabView){D.appendTo(this.contentEl)}else{if(typeof D=="string"){this.contentEl.innerHTML=D}else{this.contentEl.appendChild(D)}}this.contentEl.style.display="block";var G=$("hdDialogWrapper");this.dialogType=E||this.TYPES.STANDARD;switch(this.dialogType){case this.TYPES.ERROR:YAHOO.util.Dom.addClass(G,"errorDialog");break;case this.TYPES.STANDARD:case this.TYPES.CONFIRM:case this.TYPES.ALERT:YAHOO.util.Dom.removeClass(G,"errorDialog");break;default:YAHOO.util.Dom.removeClass(G,"errorDialog");break}H=(H==false)?H:true;this.hdDialog.cfg.setProperty("modal",H);this.hdDialog.show();this.isShown=true;this.contentEl.style.height=HD.ui.Dialog.convertWidthHeight(I);this.wrapperEl.style.width=HD.ui.Dialog.convertWidthHeight(B);this.contentEl.style.overflowx=A||"auto";this.contentEl.style.overflowy="auto";if(!!C){this.position(C)}else{this.center()}this.events.afterShow.event.fire()},hide:function(){this.events.beforeHide.event.fire();this.contentEl.innerHTML="";this.hdDialog.hide();this.isShown=false;this.events.afterHide.event.fire()},showLoading:function(E,C,A,D){if(!this.isInit){this.init()}if(this.isShown){this.loading=new HD.ui.LoadingIndicator(this.options.contentElId,E);return }C=(C)?this.convertWidthHeight(C):this.convertWidthHeight(this.options.defaultWidth);A=(A)?this.convertWidthHeight(A):this.convertWidthHeight(this.options.defaultHeight);this.contentEl=$(this.options.contentElId);this.contentEl.innerHTML="";this.contentEl.style.width=HD.ui.Dialog.convertWidthHeight(C);this.contentEl.style.height=HD.ui.Dialog.convertWidthHeight(A);this.hdDialog.render();this.hdDialog.element.marginTop="-10000px";this.hdDialog.show();this.isShown=true;this.headerEl.innerHTML=unescape(E);this.contentEl=$(this.options.contentElId);this.contentEl.style.display="block";this.center();var B=new HD.ui.LoadingIndicator(this.contentEl,E,D)},showError:function(D,C,A){this.events.beforeError.event.fire();D=D||this.failureText;C=C||400;A=A||200;var B=HD.util.template(HD.content.HTML.errorDialog,{_ERROR_TEXT:D});HD.ui.Dialog.show("Error",C,A,B,this.TYPES.ERROR)},showConfirm:function(E,D,F,C,A){this.events.beforeConfirm.event.fire();if(!D){return }E=E||"";C=C||400;A=A||300;this.confirmCallback=F||function(){HD.ui.Dialog.hide()};var B=HD.util.template(HD.content.HTML.confirmDialog,{_CONFIRM_TEXT:D});HD.ui.Dialog.show(E,C,A,B)},confirmCallback:null,showNotice:function(F,B,E,D,A){this.events.beforeNotice.event.fire();if(!B){return }F=F||"";D=D||400;A=A||300;this.noticeCallback=E||function(){HD.ui.Dialog.hide()};var C=HD.util.template(HD.content.HTML.noticeDialog,{_NOTICE_TEXT:B});HD.ui.Dialog.show(F,D,A,C)},noticeCallback:null,convertWidthHeight:function(A){if(!isNaN(A)){A+="px"}return A},center:function(C,A){var B=this.hdDialog.element;B.style.top=HD.util.getPageScrollTop()+Math.round(HD.util.getPageHeight()/2)+"px";B.style.left=HD.util.getPageScrollLeft()+Math.round(HD.util.getPageWidth()/2)+"px";B.style.bottom="";B.style.right="";B.style.marginTop="-"+Math.floor((A||B.offsetHeight)/2)+"px";B.style.marginLeft="-"+Math.floor((C||B.offsetWidth)/2)+"px"},position:function(B){var A=this.hdDialog.element;var C=typeof B.element!="undefined"?$(B.element):null;if(!!C){var D=YAHOO.util.Dom.getXY(C);C={x1:D[0],y1:D[1],x2:D[0]+C.offsetWidth,y2:D[1]+C.offsetHeight}}A.style.top="";A.style.bottom="";A.style.left="";A.style.right="";if(typeof B.top!="undefined"){if(!!C){A.style.top=(C.y1-B.top-A.offsetHeight)+"px"}else{A.style.top=B.top+"px"}}else{if(typeof B.bottom!="undefined"){if(!!C){A.style.top=(C.y2+B.bottom)+"px"}else{A.style.bottom=B.bottom+"px"}}else{if(!!C){A.style.top=C.y1+"px"}else{A.style.top="0px"}}}if(typeof B.left!="undefined"){if(!!C){A.style.left=(C.x1-B.left-A.offsetWidth)+"px"}else{A.style.left=B.left+"px"}}else{if(typeof B.right!="undefined"){if(!!C){A.style.left=(C.x2+B.right)+"px"}else{A.style.right=B.right+"px"}}else{if(!!C){A.style.left=C.x1+"px"}else{A.style.left="0px"}}}A.style.marginTop="0px";A.style.marginBottom="0px";A.style.marginLeft="0px";A.style.marginRight="0px"},resize:function(B,A){this.center(B,A);B=HD.ui.Dialog.convertWidthHeight(B);A=HD.ui.Dialog.convertWidthHeight(B);this.contentEl.style.width=B;this.contentEl.style.height=A;this.wrapperEl.style.width=B}};HD.ui.Dialog.initEvents();HD.ui.MenuUtil={tagsIgnoringZIndex:["applet","iframe","select"],currentZIndex:1000,getNewPosition:function(A,K,G,M,B,F){var O=YAHOO.util.Dom.getXY(A);var C=HD.util.getRelativeScroll(A);var I=HD.util.getPageScroll(A);var E=O[0]-C[0]+I[0];var H=O[1]+I[1];if(!G){G="bl"}switch(G){case"mp":break;case"tr":H=H-K.offsetHeight;E=E-(K.offsetWidth-A.offsetWidth);break;case"tl":H=H-K.offsetHeight;break;case"rt":H=H;E=E+A.offsetWidth;break;case"rb":H=H+(A.offsetHeight-K.offsetHeight);E=E+A.offsetWidth;break;case"lt":H=H;E=E-K.offsetWidth;break;case"lb":H=H+(A.offsetHeight-K.offsetHeight);E=E-K.offsetWidth;break;case"br":H=H+A.offsetHeight+2;E=E-(K.offsetWidth-A.offsetWidth);break;case"bl":H=H+A.offsetHeight+2;break;default:H=H+A.offsetHeight+2}F=F||[0,0];E+=F[0];H+=F[1];if(HD.util.isIE){E=E-2;H=H-2}if(B==null||B){var D=HD.util.getPageOverlap(K,H,E);var L,J;switch(G.charAt(0)){case"t":L=(D.overTop)?"b":"t";break;case"b":L=(D.overBottom)?"t":"b";break;case"l":L=(D.overLeft)?"r":"l";break;case"r":L=(D.overRight)?"l":"r";break}switch(G.charAt(1)){case"t":J=(D.overTop)?"b":"t";break;case"b":J=(D.overBottom)?"t":"b";break;case"l":J=(D.overRight)?"r":"l";break;case"r":J=(D.overLeft)?"l":"r";break}var N=L+J;if(G!=N){return this.getNewPosition(A,K,N,M,false)}}return[E,H,G]},hideOverlappingElements:function(I){var A=new Array();var J=HD.util.getBoundingBox(I);var E=J[0];var D=J[1];var O=J[2];var M=J[3];for(var G=0;G<this.tagsIgnoringZIndex.length;G++){var Q=document.getElementsByTagName(this.tagsIgnoringZIndex[G]);var H,C,B,L,K,N=null;for(var F=0;F<Q.length;F++){H=Q[F];if(H.style.visibility!="hidden"){N=HD.util.getBoundingBox(H);C=N[0];B=N[1];L=N[2];K=N[3];if(!(E>B||D<C||O>K||M<L)){var P=H.style.visibility;H.style.visibility="hidden";A[A.length]=new Array(H,P)}}}}return A},showOverlappingElements:function(A){for(var B=0;B<A.length;B++){A[B][0].style.visibility=A[B][1]}A=new Array()},hideZIndexIgnoringElements:function(){var C=new Array();for(var B=0;B<this.tagsIgnoringZIndex.length;B++){var F=document.getElementsByTagName(this.tagsIgnoringZIndex[B]);var E=null;for(var A=0;A<F.length;A++){E=F[A];if(E.style.visibility!="hidden"){var D=E.style.visibility;E.style.visibility="hidden";C[C.length]=new Array(E,D)}}}return C},showZIndexIgnoringElements:function(A){for(var B=0;B<A.length;B++){A[B][0].style.visibility=A[B][1]}A=new Array()}};HD.ui.Menu={timeoutLength:"10",defaultMenuPosition:"bl",arrCurrentlyShowingMenus:[],isShowing:false,showingMenuId:null,arrHideTimeouts:[],hideTimeoutsRunning:0,onShowListener:null,tempClickedEl:null,tempMenuID:null,tempMenuPosition:null,tempEv:null,tempOnHide:null,show:function(F,A,I,G,J){var E={offset:[0,0],onHide:null,onShow:null};J=J||{};for(var B in J){E[B]=J[B]}if(this.hideTimeoutsRunning>0){this.tempClickedEl=F;this.tempMenuID=A;this.tempMenuPosition=I;this.tempEv=G;this.tempOnHide=E.onHide;setTimeout(HD.ui.Menu.showMenu,HD.ui.Menu.timeoutLength);return false}if((!F||F==null||F=="")&&this.tempClickedEl!=null){F=this.tempClickedEl;A=this.tempMenuID;I=this.tempMenuPosition;G=this.tempEv;this.tempClickedEl=null;this.tempMenuID=null;this.tempMenuPosition=null;this.tempEv=null;this.tempOnHide=null}var D=$(A);if(F&&F.blur){F.blur()}if(this.onShowListener){this.onShowListener(F,D)}D.style.display="block";document.body.appendChild(D);if(!I||I==""){I=this.defaultMenuPosition}var H=HD.ui.MenuUtil.getNewPosition(F,D,I,G,null,E.offset);D.style.left=H[0]+"px";D.style.top=H[1]+"px";D.style.visibility="visible";D.style.position="absolute";HD.ui.MenuUtil.currentZIndex++;D.style.zIndex=HD.ui.MenuUtil.currentZIndex;YAHOO.util.Event.addListener(document,"mousedown",HD.ui.Menu.checkMenu);var C=HD.ui.MenuUtil.hideOverlappingElements(D);this.arrCurrentlyShowingMenus[this.arrCurrentlyShowingMenus.length]=new Array(D,C,F,E);this.isShowing=true;this.isShowingId=D.id;if(!!E.onShow){E.onShow()}return false},showSubMenu:function(A,D,C,B){if(!C||C==null||C==""){C="rt"}return HD.ui.Menu.showMenu(A,D,C,B)},hide:function(B,C){if(!this.arrCurrentlyShowingMenus){return false}for(var A=this.arrCurrentlyShowingMenus.length-1;A>=0;A--){HD.ui.Menu.hideLastMenu()}this.isShowing=false;return false},hideLastMenu:function(){if(!this.arrCurrentlyShowingMenus||this.arrCurrentlyShowingMenus.length<=0){return false}var C=this.arrCurrentlyShowingMenus[this.arrCurrentlyShowingMenus.length-1][0];var A=this.arrCurrentlyShowingMenus[this.arrCurrentlyShowingMenus.length-1][1];C.style.display="none";C.style.visibility="hidden";C.style.top="0px";C.style.left="0px";var B=this.arrCurrentlyShowingMenus[this.arrCurrentlyShowingMenus.length-1][3];if(!!B.onHide){B.onHide()}HD.ui.MenuUtil.showOverlappingElements(A);if(this.arrCurrentlyShowingMenus.length>1){var D=this.arrCurrentlyShowingMenus.length-1;this.arrCurrentlyShowingMenus=this.arrCurrentlyShowingMenus.slice(0,D)}else{this.arrCurrentlyShowingMenus=new Array();YAHOO.util.Event.removeListener(document,"mousedown",HD.ui.Menu.checkMenu);this.clearHideTimeouts()}if(this.hideTimeoutsRunning>0){this.hideTimeoutsRunning--}return false},checkMenu:function(H){var K;var B=0;var A=0;if(HD.util.isIE){B=window.event.clientX+document.body.scrollLeft;A=window.event.clientY+document.body.scrollTop}else{B=H.pageX;A=H.pageY}for(var E=(HD.ui.Menu.arrCurrentlyShowingMenus.length-1);E>=0;E--){var C=HD.ui.Menu.arrCurrentlyShowingMenus[E][0];var D=HD.util.getBoundingBox(C);var J=D[0];var I=D[1];var G=D[2];var F=D[3];if(J<B&&B<I&&G<A&&A<F){K=false}else{K=true}if(K){HD.ui.Menu.arrHideTimeouts[HD.ui.Menu.arrHideTimeouts.length]=setTimeout("HD.ui.Menu.hideLastMenu()",HD.ui.Menu.timeoutLength);HD.ui.Menu.hideTimeoutsRunning++}else{return }}},clearHideTimeouts:function(){if(this.hideTimeoutsRunning>0){for(var A=0;A<HD.ui.Menu.arrHideTimeouts.length;A++){clearTimeout(HD.ui.Menu.arrHideTimeouts[A])}}HD.ui.Menu.hideTimeoutsRunning=0;HD.ui.Menu.arrHideTimeouts=new Array()}};HD.ui.ImageGallery=function(A){this.options={images:[],captions:[],credits:[],thumbs:[],fadeDuration:0.2,noscrollLimit:8,startIndex:0};A=A||{};for(var B in A){this.options[B]=A[B]}this.handle=document.createElement("div");this.handle.className="image-gallery nocaption";this.rendered=false;this.selectedIndex=-1;this.events={};this.events.indexChanged=new YAHOO.util.CustomEvent("indexChanged",this);HD.ui.ImageGallery.prototype.render.call(this)};HD.ui.ImageGallery.prototype.render=function(){var D=this.content.html;var H=this.content.htmlImage;var J=this.content.htmlCaption;var A=this.content.htmlCredit;var K=this.content.htmlThumbs;var C=this.content.htmlThumbFragment;D=HD.util.template(D,{_IMAGE:HD.util.template(H,{_DEFAULT:this.content.defaultImage}),_CAPTION:J,_CREDIT:A,_THUMBS:(function(){var S=[];for(var Q=0;Q<this.options.images.length;Q++){S.push(HD.util.template(C,{_SOURCE:!!this.options.thumbs[Q]?this.options.thumbs[Q]:this.options.images[Q],_TITLE:!!this.options.captions[Q]?this.options.captions[Q]:""}))}return HD.util.template(K,{_FRAGMENTS:S.join("")})}).call(this)});var M,I,P;var B,O,G,L;if(this.rendered){M=YAHOO.util.Dom.getElementsByClassName("image","div",this.handle)[0];I=YAHOO.util.Dom.getElementsByClassName("caption","div",this.handle)[0];P=YAHOO.util.Dom.getElementsByClassName("thumbs","div",this.handle)[0];B=M.getElementsByTagName("img")[0];O=I.getElementsByTagName("p")[0];G=P.getElementsByTagName("li");L=YAHOO.util.Dom.getElementsByClassName("arrow","div",M);YAHOO.util.Event.removeListener(M,"mouseover");YAHOO.util.Event.removeListener(M,"mouseout");for(i=0;i<G.length;i++){YAHOO.util.Event.removeListener(G[i],"click");YAHOO.util.Event.removeListener(G[i],"mouseover");YAHOO.util.Event.removeListener(G[i],"mouseout")}for(i=0;i<L.length;i++){YAHOO.util.Event.removeListener(L[i],"mouseover");YAHOO.util.Event.removeListener(L[i],"mouseout")}}this.handle.innerHTML=D;this.rendered=true;var N=this;if(!!this.options.images[this.options.startIndex]){this.setIndex(this.options.startIndex)}var F=YAHOO.util.Dom.getElementsByClassName("panel","div",this.handle);var E=YAHOO.util.Dom.getElementsByClassName("thumbslist","ul",this.handle)[0];if(this.options.images.length<=this.options.noscrollLimit){YAHOO.util.Dom.addClass(E,"noscroll")}else{YAHOO.util.Dom.removeClass(E,"noscroll")}M=YAHOO.util.Dom.getElementsByClassName("image","div",this.handle)[0];I=YAHOO.util.Dom.getElementsByClassName("caption","div",this.handle)[0];P=YAHOO.util.Dom.getElementsByClassName("thumbs","div",this.handle)[0];B=M.getElementsByTagName("img")[0];O=I.getElementsByTagName("p")[0];G=P.getElementsByTagName("li");L=YAHOO.util.Dom.getElementsByClassName("arrow","div",M);YAHOO.util.Event.addListener(M,"mouseover",function(Q){YAHOO.util.Dom.addClass(this,"hover")});YAHOO.util.Event.addListener(M,"mouseout",function(Q){YAHOO.util.Dom.removeClass(this,"hover")});for(i=0;i<G.length;i++){YAHOO.util.Event.addListener(G[i],"click",function(S,Q){this.blur();Q.self.setIndex(Q.index)},{self:N,index:i});YAHOO.util.Event.addListener(G[i],"mouseover",function(Q){YAHOO.util.Dom.addClass(this,"hover")});YAHOO.util.Event.addListener(G[i],"mouseout",function(Q){YAHOO.util.Dom.removeClass(this,"hover")})}for(i=0;i<L.length;i++){YAHOO.util.Event.addListener(L[i],"mouseover",function(Q){YAHOO.util.Dom.addClass(this,"hover");if(YAHOO.util.Dom.hasClass(this,"left")){YAHOO.util.Dom.addClass(this,"hoverLeft")}else{if(YAHOO.util.Dom.hasClass(this,"right")){YAHOO.util.Dom.addClass(this,"hoverRight")}}});YAHOO.util.Event.addListener(L[i],"mouseout",function(Q){YAHOO.util.Dom.removeClass(this,"hover");if(YAHOO.util.Dom.hasClass(this,"left")){YAHOO.util.Dom.removeClass(this,"hoverLeft")}else{if(YAHOO.util.Dom.hasClass(this,"right")){YAHOO.util.Dom.removeClass(this,"hoverRight")}}})}};HD.ui.ImageGallery.prototype.getIndex=function(){return this.selectedIndex};HD.ui.ImageGallery.prototype.setIndex=function(J){if(!this.rendered||!this.options.images[J]){return }this.selectedIndex=J;var F=YAHOO.util.Dom.getElementsByClassName("image","div",this.handle)[0];var I=YAHOO.util.Dom.getElementsByClassName("caption","div",this.handle)[0];var L=YAHOO.util.Dom.getElementsByClassName("credit","div",this.handle)[0];var T=YAHOO.util.Dom.getElementsByClassName("thumbs","div",this.handle)[0];var K=YAHOO.util.Dom.getElementsByClassName("thumbslist","ul",this.handle)[0];var G=YAHOO.util.Dom.getElementsByClassName("panel","div",this.handle);var N=this;var E,H;for(var Q=0;Q<G.length;Q++){if(YAHOO.util.Dom.hasClass(G[Q],"left")){E=G[Q]}else{if(YAHOO.util.Dom.hasClass(G[Q],"right")){H=G[Q]}}}var O=F.getElementsByTagName("img")[0];var S=I.getElementsByTagName("p")[0];var D=L.getElementsByTagName("p")[0];var C=T.getElementsByTagName("li");var P=YAHOO.util.Dom.getElementsByClassName("arrow","div",F);var M=!!this.options.captions[J]?this.options.captions[J]:"";var A=!!this.options.credits[J]?this.options.credits[J]:"";for(Q=0;Q<C.length;Q++){if(Q==J){YAHOO.util.Dom.addClass(C[Q],"active")}else{YAHOO.util.Dom.removeClass(C[Q],"active")}}var B=new YAHOO.util.Anim(O,{opacity:{from:O.getAttribute("src")?1:0,to:0}},this.options.fadeDuration);B.onComplete.subscribe(function(){if(!M){YAHOO.util.Dom.addClass(N.handle,"nocaption")}else{YAHOO.util.Dom.removeClass(N.handle,"nocaption")}if(!A){YAHOO.util.Dom.addClass(N.handle,"nocredit")}else{YAHOO.util.Dom.removeClass(N.handle,"nocredit")}if(!M&&!A){YAHOO.util.Dom.addClass(N.handle,"nodetail")}else{YAHOO.util.Dom.removeClass(N.handle,"nodetail")}O.onload=function(){O.onload=null;S.innerHTML=M;D.innerHTML=A;I.style.height=null;O.style.height=null;F.style.height=null;O.style.width=null;var V;for(V=0;V<P.length;V++){P[V].style.height=null}if(M&&I.scrollHeight>I.offsetHeight){var f=parseInt(YAHOO.util.Dom.getStyle(I,"paddingTop"),10)+parseInt(YAHOO.util.Dom.getStyle(I,"paddingBottom"),10);var d=I.scrollHeight-I.offsetHeight;var c=parseInt(YAHOO.util.Dom.getStyle(O,"height"),10);var b=parseInt(YAHOO.util.Dom.getStyle(O,"width"),10);var U=b/c;var W=c-d;I.style.height=(I.scrollHeight-f)+"px";O.style.height=W+"px";F.style.height=W+"px";O.style.width=Math.floor(W*U)+"px";for(V=0;V<P.length;V++){P[V].style.height=(parseInt(YAHOO.util.Dom.getStyle(P[V],"height"),10)-d)+"px"}}var Y=parseInt(YAHOO.util.Dom.getStyle(K,"marginBottom"),10);try{if(!!H&&(C[J].offsetTop+C[J].offsetHeight)>(H.scrollTop+H.offsetHeight)){H.scrollTop=C[J].offsetTop-C[J].parentNode.offsetTop+C[J].offsetHeight-H.offsetHeight+Y}else{if(!!H&&(C[J].offsetTop-Y)<H.scrollTop){H.scrollTop=C[J].offsetTop-C[J].parentNode.offsetTop-Y}}}catch(Z){}for(V=0;V<P.length;V++){YAHOO.util.Event.removeListener(P[V],"click");if(YAHOO.util.Dom.hasClass(P[V],"left")){if(J>0){YAHOO.util.Dom.removeClass(P[V],"hide");YAHOO.util.Event.addListener(P[V],"click",function(j,g){this.blur();g.self.setIndex(g.index)},{self:N,index:J-1})}else{YAHOO.util.Dom.addClass(P[V],"hide")}}else{if(YAHOO.util.Dom.hasClass(P[V],"right")){if(J<N.options.images.length-1){YAHOO.util.Dom.removeClass(P[V],"hide");YAHOO.util.Event.addListener(P[V],"click",function(j,g){this.blur();g.self.setIndex(g.index)},{self:N,index:J+1})}else{YAHOO.util.Dom.addClass(P[V],"hide")}}}}var X=new YAHOO.util.Anim(O,{opacity:{from:0,to:1}},N.options.fadeDuration);X.onComplete.subscribe(function(){O.onload=null});X.animate();N.events.indexChanged.fire(this)};O.setAttribute("src",N.options.images[J])});B.animate()};HD.ui.ImageGallery.prototype.content={defaultImage:"!pixel.gif",html:'<div class="panel left">_IMAGE_CAPTION_CREDIT</div><div class="panel right">_THUMBS</div>',htmlImage:'<div class="image"><img src="_DEFAULT"/><div class="arrow left"><a href="javascript:void(0)"></a></div><div class="arrow right"><a href="javascript:void(0)"></a></div></div>',htmlCaption:'<div class="caption"><p></p></div>',htmlCredit:'<div class="credit"><p></p></div>',htmlThumbs:'<div class="thumbs"><ul class="thumbslist">_FRAGMENTS</ul></div>',htmlThumbFragment:'<li class="thumb"><a href="javascript:void(0)"><img src="_SOURCE" title="_TITLE"/></a></li>'};HD.ui.StarRating=function(C,B,A){this.parentId=C;this.textId=B;this.clickCallback=A;this.star1=new HD.ui.StarRatingImage("star1",HD.rp.text.roadRatingText[1]);this.star2=new HD.ui.StarRatingImage("star2",HD.rp.text.roadRatingText[2]);this.star3=new HD.ui.StarRatingImage("star3",HD.rp.text.roadRatingText[3]);this.star4=new HD.ui.StarRatingImage("star4",HD.rp.text.roadRatingText[4]);this.star5=new HD.ui.StarRatingImage("star5",HD.rp.text.roadRatingText[5]);this.stars=[this.star1,this.star2,this.star3,this.star4,this.star5]};HD.ui.StarRating.prototype.render=function(B){this.selectedIndex=(B!=null)?B-1:-1;this.parentEl=$(this.parentId);this.textEl=$(this.textId);for(var A=0;A<this.stars.length;A++){var C=this.stars[A];this.attachEvents(C,A);C.out();this.parentEl.appendChild(C.image)}if(this.selectedIndex!=-1){this.over(this.selectedIndex)}};HD.ui.StarRating.prototype.attachEvents=function(B,A){var C=this;YAHOO.util.Event.addListener(B.image,"mouseover",function(){C.over(A)});YAHOO.util.Event.addListener(B.image,"mouseout",function(){C.out(A)});YAHOO.util.Event.addListener(B.image,"click",function(){C.click(A)})};HD.ui.StarRating.prototype.over=function(B){this.textEl.innerHTML=this.stars[B].caption;for(var C=0;C<=B;C++){this.stars[C].over()}for(var A=B+1;A<this.stars.length;A++){this.stars[A].out()}};HD.ui.StarRating.prototype.out=function(B){if(this.selectedIndex>=0){this.over(this.selectedIndex)}else{this.textEl.innerHTML=HD.rp.text.selectAStar;for(var A=0;A<=B;A++){this.stars[A].out()}}};HD.ui.StarRating.prototype.click=function(A){this.selectedIndex=A;this.out(A);if(this.clickCallback!=null){this.clickCallback()}};HD.ui.StarRating.prototype.getRating=function(){return this.selectedIndex+1};HD.ui.StarRatingImage=function(B,A){this.id=B;this.caption=A;this.image=document.createElement("span");this.image.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;";this.image.className="greyStar"};HD.ui.StarRatingImage.prototype.over=function(){this.image.className="orangeStar"};HD.ui.StarRatingImage.prototype.out=function(){this.image.className="greyStar"};HD.ui.NoteEditor=function(A){this.options={value:"",limit:500,linkLimit:35};A=A||{};for(var B in A){this.options[B]=A[B]}HD.ui.NoteEditor.prototype.trim.call(this);this.handle=$("noteEditor");if(this.handle==null){this.handle=document.createElement("div");this.handle.className="note-editor";this.handle.id="noteEditor"}this.events={};this.events.render=new YAHOO.util.CustomEvent("render",this);this.events.save=new YAHOO.util.CustomEvent("save",this);this.events.destroy=new YAHOO.util.CustomEvent("destroy",this);HD.ui.NoteEditor.prototype.render.call(this)};HD.ui.NoteEditor.prototype.url_extractor=/(http(s?):\/\/|www\.)[a-zA-Z0-9\/~\-]+\.[a-zA-Z0-9\/~\-_,&=\?\.;]+[^\.,\s<]/i;HD.ui.NoteEditor.prototype.trim=function(A){A=A||this.options.limit;this.options.value=this.options.value.substr(0,this.options.limit)};HD.ui.NoteEditor.prototype.encode=function(D,B){var A="";B=B||(!!this.options&&!!this.options.linkLimit?this.options.linkLimit:35);D=D.replace(/</g,"&lt;");D=D.replace(/>/g,"&gt;");D=D.replace(/\n\r?/g,"<br/>");while(!!HD.ui.NoteEditor.prototype.url_extractor.exec(D)){var E={left:RegExp.leftContext,match:RegExp.lastMatch,right:RegExp.rightContext};var C=E.match.replace(/&/g,"&amp;");if(C.length>B){C=C.substr(0,B)+"&hellip;"}A+=E.left.replace(/&/g,"&amp;");A+='<a href="'+(E.match.indexOf("http")>-1?"":"http://");A+=E.match+'" target="_blank">'+C+"</a>";D=E.right}A+=D.replace(/&/g,"&amp;");return A};HD.ui.NoteEditor.prototype.save=function(A){this.options.value=A;this.trim();this.render();this.events.save.fire(this)};HD.ui.NoteEditor.prototype.getMode=function(){if(YAHOO.util.Dom.hasClass(this.handle,"edit")){return"edit"}else{return"view"}};HD.ui.NoteEditor.prototype.setMode=function(A){if(A=="edit"){YAHOO.util.Dom.addClass(this.handle,"edit")}else{if(A=="view"){YAHOO.util.Dom.removeClass(this.handle,"edit")}}};HD.ui.NoteEditor.prototype.updateCharLeft=function(C){var B=YAHOO.util.Dom.getElementsByClassName("chars-left","span",this.handle)[0];var A=this.content.html_char_left;C=C!=null?C:this.options.limit-this.options.value.length;A=HD.util.template(A,{_CHAR_LEFT_EVAL:this.content.char_left_eval(Math.abs(C)),_CHAR_LEFT_COUNT:C});B.innerHTML=A;if(C<0){YAHOO.util.Dom.addClass(B,"error")}else{YAHOO.util.Dom.removeClass(B,"error")}};HD.ui.NoteEditor.prototype.destroy=function(){var B,C=["edit-note","save-note","cancel","clear","close"];for(var A=0;A<C.length;A++){B=YAHOO.util.Dom.getElementsByClassName(C[A],"a",this.handle)[0];YAHOO.util.Event.removeListener(B,"click")}B=this.handle.getElementsByTagName("textarea")[0];YAHOO.util.Event.removeListener(B,"keyup");YAHOO.util.Event.removeListener(B,"keydown");YAHOO.util.Event.removeListener(B,"change");if(!!this.handle.parentNode){this.handle.parentNode.removeChild(this.handle)}this.events.destroy.fire(this)};HD.ui.NoteEditor.prototype.render=function(){var E=this.content.html;var D=this.content.html_char_left;var A=this.options.limit-this.options.value.length;E=HD.util.template(E,{_EDIT_NOTE:this.content.edit_note,_SAVE_NOTE:this.content.save_note,_CANCEL:this.content.cancel,_CLEAR:this.content.clear,_TITLE:this.content.title,_CLOSE:this.content.close,_CHAR_LIMIT_EVAL:this.content.char_limit_eval(A),_CHAR_LIMIT:this.options.limit,_NOTE_LIMIT:this.content.limit,_RENDERED_DATA:this.encode(this.options.value),_RAW_DATA:this.options.value,_CHAR_LEFT:HD.util.template(D,{_CHAR_LEFT_COUNT:A,_CHAR_LEFT_EVAL:this.content.char_left_eval(A)})});var G;G=YAHOO.util.Dom.getElementsByClassName("edit-note","a",this.handle)[0];YAHOO.util.Event.removeListener(G,"click");G=YAHOO.util.Dom.getElementsByClassName("save-note","a",this.handle)[0];YAHOO.util.Event.removeListener(G,"click");G=YAHOO.util.Dom.getElementsByClassName("cancel","a",this.handle)[0];YAHOO.util.Event.removeListener(G,"click");G=YAHOO.util.Dom.getElementsByClassName("clear","a",this.handle)[0];YAHOO.util.Event.removeListener(G,"click");G=YAHOO.util.Dom.getElementsByClassName("close","a",this.handle)[0];YAHOO.util.Event.removeListener(G,"click");G=this.handle.getElementsByTagName("textarea")[0];YAHOO.util.Event.removeListener(G,"keyup");YAHOO.util.Event.removeListener(G,"keydown");YAHOO.util.Event.removeListener(G,"change");this.handle.innerHTML=E;YAHOO.util.Dom.removeClass(this.handle,"edit");var B=this;var H;H=YAHOO.util.Dom.getElementsByClassName("edit-note","a",this.handle)[0];YAHOO.util.Event.addListener(H,"click",function(J,I){YAHOO.util.Dom.addClass(I.self.handle,"edit")},{self:B});H=YAHOO.util.Dom.getElementsByClassName("save-note","a",this.handle)[0];YAHOO.util.Event.addListener(H,"click",function(J,I){I.self.save(I.text.value)},{self:B,text:this.handle.getElementsByTagName("textarea")[0]});H=YAHOO.util.Dom.getElementsByClassName("cancel","a",this.handle)[0];YAHOO.util.Event.addListener(H,"click",function(J,I){I.self.render()},{self:B});H=YAHOO.util.Dom.getElementsByClassName("clear","a",this.handle)[0];YAHOO.util.Event.addListener(H,"click",function(J,I){I.self.handle.getElementsByTagName("textarea")[0].value=""},{self:B});H=YAHOO.util.Dom.getElementsByClassName("close","a",this.handle)[0];YAHOO.util.Event.addListener(H,"click",function(J,I){I.self.destroy()},{self:B});H=this.handle.getElementsByTagName("textarea")[0];var F=function(J,I){B.updateCharLeft(I.self.options.limit-this.value.length)};var C={self:B};YAHOO.util.Event.addListener(H,"keyup",F,C);YAHOO.util.Event.addListener(H,"keydown",F,C);YAHOO.util.Event.addListener(H,"change",F,C);this.events.render.fire(this)};HD.ui.NoteEditor.prototype.content={edit_note:HD.content.Text.edit_note,save_note:HD.content.Text.save_note,cancel:HD.content.Text.cancel,clear:HD.content.Text.clear,close:HD.content.Text.close,limit:HD.content.Text.limit,title:HD.content.Text.title_note,char_left_eval:HD.content.Text.char_left_eval,char_limit_eval:HD.content.Text.char_limit_eval,html:'<div class="title"><p>_TITLE</p><a href="javascript:void(0)" class="close" title="_CLOSE"></a></div><div class="view"><p>_RENDERED_DATA</p><div class="actions"><a href="javascript:void(0)" class="edit-note">_EDIT_NOTE</a></div></div><div class="edit"><textarea>_RAW_DATA</textarea><div class="actions"><a href="javascript:void(0)" class="save-note">_SAVE_NOTE</a><a href="javascript:void(0)" class="cancel">_CANCEL</a><a href="javascript:void(0)" class="clear">_CLEAR</a></div></div><p class="limit">_NOTE_LIMIT _CHAR_LIMIT _CHAR_LIMIT_EVAL. <span class="chars-left">_CHAR_LEFT</span></p>',html_char_left:"<strong>_CHAR_LEFT_COUNT</strong> _CHAR_LEFT_EVAL."};HD.ui.DatePicker=function(A){this.options={selected:null,selected_month:null,selected_year:null,mindate:null,maxdate:null};A=A||{};var B,C;for(C in A){this.options[C]=A[C]}if(this.options.selected!=null){B=HD.util.Date.parseDate(this.options.selected);this.options.selected_month=HD.util.Date.formatDate(B,HD.content.Date.FORMAT.MY);this.options.selected_year=B.getFullYear()}if(this.options.selected_month==null){B=new Date();this.options.selected_month=HD.util.Date.formatDate(B,HD.content.Date.FORMAT.MY);this.options.selected_year=B.getFullYear()}if(this.options.selected_year==null){B=new Date();this.options.selected_year=B.getFullYear()}this.handle=document.createElement("div");this.handle.className="date-picker";this.events={};this.events.change=new YAHOO.util.CustomEvent("change",this);this.events.destroy=new YAHOO.util.CustomEvent("destroy",this);this.events.render=new YAHOO.util.CustomEvent("render",this);HD.ui.DatePicker.prototype.render.call(this)};HD.ui.DatePicker.prototype.destroy=function(){var B,A;B=YAHOO.util.Dom.getElementsByClassName("button","li",this.handle);for(A=0;A<B.length;A++){YAHOO.util.Event.removeListener(B[A],"click")}B=YAHOO.util.Dom.getElementsByClassName("day","li",this.handle);for(A=0;A<B.length;A++){YAHOO.util.Event.removeListener(B[A],"click")}B=YAHOO.util.Dom.getElementsByClassName("year","li",this.handle);for(A=0;A<B.length;A++){YAHOO.util.Event.removeListener(B[A],"click")}if(!!this.handle.parentNode){this.handle.parentNode.removeChild(this.handle)}this.events.destroy.fire(this)};HD.ui.DatePicker.prototype.render=function(){var L=this.content.html;var T,N,G,J,S,Q;var b=HD.util.Date;var e=HD.content.Date;var H=!!this.options.mindate||false;var M=!!this.options.maxdate||false;if(H){H=b.parseDate(this.options.mindate)}if(M){M=b.parseDate(this.options.maxdate)}var U=b.parseDate(this.options.selected_month,e.FORMAT.MY);J=this.checkLimits(new Date(U.getFullYear(),U.getMonth(),0),new Date(U.getFullYear(),U.getMonth()+1,1));L=HD.util.template(L,{_SELECTED_MONTH:b.getMonthFromDate(U,"l"),_SELECTED_DATA_MONTH:b.formatDate(U,e.FORMAT.MY,"-"),_MONTH_META_PREV:J.min?"invalid ":"",_MONTH_META_NEXT:J.max?"invalid ":"",_MONTH_PREV:!J.min?'<a href="javascript:void(0)">&lt;</a>':"&nbsp;",_MONTH_NEXT:!J.max?'<a href="javascript:void(0)">&gt;</a>':"&nbsp;"});var B=[0,1,2,3,4,5,6];for(T=0;T<B.length;T++){B[T]=e.CONSTANTS.WEEKDAY_START+T;if(B[T]>=B.length){B[T]-=B.length}}for(T=0;T<B.length;T++){var K={};K["_WEEKDAY_"+T]=e.DAYS[B[T]].c;K["_WEEKDAY_DATA_"+T]=B[T];L=HD.util.template(L,K)}var Z=new Date(0,0,0,0,0,0,0);Z.setDate(1);Z.setMonth(U.getMonth());Z.setFullYear(U.getFullYear());var P=Z.getDay()-e.CONSTANTS.WEEKDAY_START;if(P<0){P+=7}Z.setMonth(Z.getMonth()+1);Z.setDate(0);var E=P+Z.getDate();var I=!!this.options.selected?b.parseDate(this.options.selected):false;var X=function(d){return d<10?"0"+d:d};for(T=P;T<E;T++){Z.setDate(T-P+1);J=this.checkLimits(Z);var V={};V["_DAY_"+X(T)]=!(J.min||J.max)?'<a href="javascript:void(0)">'+Z.getDate()+"</a>":Z.getDate();V["_DAY_DATA_"+X(T)]=b.formatDate(Z,null,"-");N="";if(I&&I.getMonth()==Z.getMonth()&&I.getDate()==Z.getDate()&&I.getFullYear()==Z.getFullYear()){N+="active "}if(J.min||J.max){N+="invalid "}if(T%7==0){N+="clear "}V["_DAY_META_"+X(T)]=N;L=HD.util.template(L,V)}Z.setDate(0);P--;for(T=P;T>=0;T--){S=Z.getDate()-P+T;S=new Date(Z.getFullYear(),Z.getMonth(),S);J=this.checkLimits();var D={};D["_DAY_"+X(T)]=!(J.min||J.max)?'<a href="javascript:void(0)">'+S.getDate()+"</a>":S;D["_DAY_DATA_"+X(T)]=b.formatDate(S,null,"-");N="inactive "+((J.min||J.max)?"invalid ":"");D["_DAY_META_"+X(T)]=N;L=HD.util.template(L,D)}Z.setDate(1);Z.setMonth(Z.getMonth()+2);for(T=E;T<42;T++){S=Z.getDate()+T-E;S=new Date(Z.getFullYear(),Z.getMonth(),S);J=this.checkLimits(new Date(Z.getFullYear(),Z.getMonth(),S));var C={};C["_DAY_"+X(T)]=!(J.min||J.max)?'<a href="javascript:void(0)">'+S.getDate()+"</a>":S;C["_DAY_DATA_"+X(T)]=b.formatDate(S,null,"-");N="inactive "+((J.min||J.max)?"invalid ":"");C["_DAY_META_"+X(T)]=N;L=HD.util.template(L,C)}Z=new Date();J=this.checkLimits(new Date(this.options.selected_year,U.getMonth(),0),new Date(this.options.selected_year,U.getMonth()+1,1));L=HD.util.template(L,{_YEAR_META_PREV:J.min?"invalid ":"",_YEAR_META_NEXT:J.max?"invalid ":"",_YEAR_PREV:!J.min?'<a href="javascript:void(0)">&lt;</a>':"&nbsp;",_YEAR_NEXT:!J.max?'<a href="javascript:void(0)">&gt;</a>':"&nbsp;",_YEAR_ACTIVE:(!!I&&I.getFullYear()==this.options.selected_year)||Z.getFullYear()==this.options.selected_year?"active ":"",_YEAR_DATA:this.options.selected_year,_YEAR_CURRENT:this.options.selected_year});var Y;Y=YAHOO.util.Dom.getElementsByClassName("button","li",this.handle);for(T=0;T<Y.length;T++){YAHOO.util.Event.removeListener(Y[T],"click")}Y=YAHOO.util.Dom.getElementsByClassName("day","li",this.handle);for(T=0;T<Y.length;T++){YAHOO.util.Event.removeListener(Y[T],"click")}Y=YAHOO.util.Dom.getElementsByClassName("year","li",this.handle);for(T=0;T<Y.length;T++){YAHOO.util.Event.removeListener(Y[T],"click")}this.handle.innerHTML=L;var O=this;var F;F=YAHOO.util.Dom.getElementsByClassName("button","li",this.handle);var f=YAHOO.util.Dom.getElementsByClassName("month","li",this.handle)[0];var c=YAHOO.util.Dom.getElementsByClassName("year","li",this.handle)[0];var W=function(d,j,k){var g=HD.util.Date.parseDate(j.className.match(/month(\S+)/)[1],HD.content.Date.FORMAT.MY,"-");g.setMonth(g.getMonth()+k);d.setSelectedMonth(g.getMonth()+1,g.getFullYear())};var A=function(g,d,k){var j=parseInt(d.className.match(/year(\S+)/)[1],10);g.setSelectedYear(j+k)};for(T=0;T<F.length;T++){if(F[T].getElementsByTagName("a").length>0){if(F[T].className.match(/monthprev/)){YAHOO.util.Event.addListener(F[T],"click",function(g,d){d.monthChange.call(this,d.self,d.monthEl,-1)},{self:O,monthEl:f,monthChange:W})}else{if(F[T].className.match(/monthnext/)){YAHOO.util.Event.addListener(F[T],"click",function(g,d){d.monthChange.call(this,d.self,d.monthEl,1)},{self:O,monthEl:f,monthChange:W})}else{if(F[T].className.match(/yearprev/)){YAHOO.util.Event.addListener(F[T],"click",function(g,d){d.yearChange.call(this,d.self,d.yearEl,-1)},{self:O,yearEl:c,yearChange:A})}else{if(F[T].className.match(/yearnext/)){YAHOO.util.Event.addListener(F[T],"click",function(g,d){d.yearChange.call(this,d.self,d.yearEl,1)},{self:O,yearEl:c,yearChange:A})}}}}}}F=YAHOO.util.Dom.getElementsByClassName("day","li",this.handle);for(T=0;T<F.length;T++){if(F[T].getElementsByTagName("a").length>0){YAHOO.util.Event.addListener(F[T],"click",function(j,d){var g=HD.util.Date.parseDate(this.className.match(/day(\S+)/)[1],null,"-");d.setSelectedDate(g.getMonth()+1,g.getDate(),g.getFullYear())},O)}}this.events.render.fire(this)};HD.ui.DatePicker.prototype.getDate=function(){if(!!this.options.selected){return HD.util.Date.parseDate(this.options.selected)}else{return false}};HD.ui.DatePicker.prototype.getDateString=function(){if(!!this.options.selected){return this.options.selected}else{return false}};HD.ui.DatePicker.prototype.jumpToSelectedDate=function(){if(!!this.options.selected){var A=HD.util.Date.parseDate(this.options.selected);this.options.selected_month=HD.util.Date.formatDate(A,HD.content.Date.FORMAT.MY);this.options.selected_year=A.year;this.render()}};HD.ui.DatePicker.prototype.checkLimits=function(D,A){var C={min:false,max:false};if(!!this.options.mindate||!!this.options.maxdate){A=A||D;var B=HD.util.Date;var E=!!this.options.mindate?B.parseDate(this.options.mindate):false;var F=!!this.options.maxdate?B.parseDate(this.options.maxdate):false;C.min=E&&D<E;C.max=F&&A>F}return C};HD.ui.DatePicker.prototype.setSelectedDate=function(C,A,B){var D=new Date(B,C-1,A);this.options.selected=HD.util.Date.formatDate(D);this.options.selected_month=HD.util.Date.formatDate(D,HD.content.Date.FORMAT.MY);this.options.selected_year=B;this.render();this.events.change.fire(this)};HD.ui.DatePicker.prototype.setSelectedMonth=function(C,B){var A=this.checkLimits(new Date(B,C,0),new Date(B,C-1,1));if(!A.min&&!A.max){this.options.selected_month=HD.util.Date.formatDate(new Date(B,C-1,1),HD.content.Date.FORMAT.MY);this.options.selected_year=B}this.render()};HD.ui.DatePicker.prototype.setSelectedYear=function(E){var C=HD.util.Date;var F=C.parseDate(this.options.selected_month,HD.content.Date.FORMAT.MY).getMonth()+1;var B=this.checkLimits(new Date(E,F,0),new Date(E,F-1,1));if(B.min){var D=C.parseDate(this.options.mindate);this.options.selected_month=C.formatDate(D,HD.content.Date.FORMAT.MY);this.options.selected_year=D.getFullYear()}else{if(B.max){var A=C.parseDate(this.options.maxdate);this.options.selected_month=C.formatDate(A,HD.content.Date.FORMAT.MY);this.options.selected_year=A.getFullYear()}else{this.options.selected_month=C.formatDate(new Date(E,F-1,1),HD.content.Date.FORMAT.MY);this.options.selected_year=E}}this.render()};HD.ui.DatePicker.prototype.content={html:'<ul class="month"><li class="_MONTH_META_PREVbutton monthprev">_MONTH_PREV</li><li class="active month month_SELECTED_DATA_MONTH">_SELECTED_MONTH</li><li class="_MONTH_META_NEXTbutton monthnext">_MONTH_NEXT</li></ul><ul class="weekdays"><li class="wkd_WEEKDAY_DATA_0">_WEEKDAY_0</li><li class="wkd_WEEKDAY_DATA_1">_WEEKDAY_1</li><li class="wkd_WEEKDAY_DATA_2">_WEEKDAY_2</li><li class="wkd_WEEKDAY_DATA_3">_WEEKDAY_3</li><li class="wkd_WEEKDAY_DATA_4">_WEEKDAY_4</li><li class="wkd_WEEKDAY_DATA_5">_WEEKDAY_5</li><li class="wkd_WEEKDAY_DATA_6">_WEEKDAY_6</li></ul><ul class="days"><li class="_DAY_META_00day day_DAY_DATA_00">_DAY_00</li><li class="_DAY_META_01day day_DAY_DATA_01">_DAY_01</li><li class="_DAY_META_02day day_DAY_DATA_02">_DAY_02</li><li class="_DAY_META_03day day_DAY_DATA_03">_DAY_03</li><li class="_DAY_META_04day day_DAY_DATA_04">_DAY_04</li><li class="_DAY_META_05day day_DAY_DATA_05">_DAY_05</li><li class="_DAY_META_06day day_DAY_DATA_06">_DAY_06</li><li class="_DAY_META_07day day_DAY_DATA_07">_DAY_07</li><li class="_DAY_META_08day day_DAY_DATA_08">_DAY_08</li><li class="_DAY_META_09day day_DAY_DATA_09">_DAY_09</li><li class="_DAY_META_10day day_DAY_DATA_10">_DAY_10</li><li class="_DAY_META_11day day_DAY_DATA_11">_DAY_11</li><li class="_DAY_META_12day day_DAY_DATA_12">_DAY_12</li><li class="_DAY_META_13day day_DAY_DATA_13">_DAY_13</li><li class="_DAY_META_14day day_DAY_DATA_14">_DAY_14</li><li class="_DAY_META_15day day_DAY_DATA_15">_DAY_15</li><li class="_DAY_META_16day day_DAY_DATA_16">_DAY_16</li><li class="_DAY_META_17day day_DAY_DATA_17">_DAY_17</li><li class="_DAY_META_18day day_DAY_DATA_18">_DAY_18</li><li class="_DAY_META_19day day_DAY_DATA_19">_DAY_19</li><li class="_DAY_META_20day day_DAY_DATA_20">_DAY_20</li><li class="_DAY_META_21day day_DAY_DATA_21">_DAY_21</li><li class="_DAY_META_22day day_DAY_DATA_22">_DAY_22</li><li class="_DAY_META_23day day_DAY_DATA_23">_DAY_23</li><li class="_DAY_META_24day day_DAY_DATA_24">_DAY_24</li><li class="_DAY_META_25day day_DAY_DATA_25">_DAY_25</li><li class="_DAY_META_26day day_DAY_DATA_26">_DAY_26</li><li class="_DAY_META_27day day_DAY_DATA_27">_DAY_27</li><li class="_DAY_META_28day day_DAY_DATA_28">_DAY_28</li><li class="_DAY_META_29day day_DAY_DATA_29">_DAY_29</li><li class="_DAY_META_30day day_DAY_DATA_30">_DAY_30</li><li class="_DAY_META_31day day_DAY_DATA_31">_DAY_31</li><li class="_DAY_META_32day day_DAY_DATA_32">_DAY_32</li><li class="_DAY_META_33day day_DAY_DATA_33">_DAY_33</li><li class="_DAY_META_34day day_DAY_DATA_34">_DAY_34</li><li class="_DAY_META_35day day_DAY_DATA_35">_DAY_35</li><li class="_DAY_META_36day day_DAY_DATA_36">_DAY_36</li><li class="_DAY_META_37day day_DAY_DATA_37">_DAY_37</li><li class="_DAY_META_38day day_DAY_DATA_38">_DAY_38</li><li class="_DAY_META_39day day_DAY_DATA_39">_DAY_39</li><li class="_DAY_META_40day day_DAY_DATA_40">_DAY_40</li><li class="_DAY_META_41day day_DAY_DATA_41">_DAY_41</li></ul><ul class="years"><li class="_YEAR_META_PREVbutton yearprev">_YEAR_PREV</li><li class="_YEAR_ACTIVEyear year_YEAR_DATA">_YEAR_CURRENT</li><li class="_YEAR_META_NEXTbutton yearnext">_YEAR_NEXT</li></ul>'};HD.ui.DateSelector=function(B,D){this.options={};this.positionFn=D||function(){return 0};B=B||{};for(var E in B){this.options[E]=B[E]}this.picker=null;this.handles={};this.handles.entry=document.createElement("input");this.handles.entry.className="date-selector-entry";this.handles.entry.type="text";this.handles.entry.value=!!this.options.selected?this.options.selected:this.content.date_initial;this.handles.toggle=document.createElement("a");this.handles.toggle.className="date-selector-toggle";this.handles.toggle.href="javascript:void(0)";this.events={};this.events.change=new YAHOO.util.CustomEvent("change",this);this.events.destroy=new YAHOO.util.CustomEvent("destroy",this);this.events.render=new YAHOO.util.CustomEvent("render",this);this.events.toggle=new YAHOO.util.CustomEvent("toggle",this);var C=YAHOO.util.Event;C.addListener(this.handles.entry,"change",function(H,F){var G=F.handles.entry.value.match(F.content.date_mask);if(!F.handles.entry.value.match(F.content.date_mask)){F.handles.entry.value=HD.util.Date.formatDate(new Date())}F.events.change.fire(F,G)},this);var A=function(M,L){M=M||window.event;try{M.cancelBubble=true}catch(K){}var G=L.self;var J=!!L.toggleOn;var F=!!L.toggleOff;if(F&&!!G.picker){if(!!G.closeRequest){setTimeout(function(){if(!!G.picker&&!!G.closeRequest){A(M,{self:G})}},100)}return }G.closeRequest=false;if(!!G.picker&&((!J&&!F)||!!F)){G.picker.destroy();G.events.toggle.fire(G,false)}else{if(!G.picker&&(!F||!!J)){if(G.handles.entry.value.match(G.content.date_mask)){G.options.selected=G.handles.entry.value}else{G.options.selected=null}G.picker=new HD.ui.DatePicker(G.options);G.picker.events.change.subscribe(function(){G.handles.entry.value=G.picker.options.selected;G.picker.destroy();G.events.change.fire(G,true)});G.picker.events.render.subscribe(function(){G.closeRequest=false});G.handles.wrapper=document.createElement("div");G.handles.wrapper.className="date-picker-wrapper";G.handles.wrapper.appendChild(G.picker.handle);document.body.appendChild(G.handles.wrapper);if(HD.util.isIE&&navigator.userAgent.match(/6.0/)){var H=document.createElement("iframe");H.setAttribute("frameborder","0");H.setAttribute("tabindex","-1");H.setAttribute("src","javascript:false;");G.handles.wrapper.appendChild(H);H.style.height=G.handles.wrapper.offsetHeight+"px";H.style.width=G.handles.wrapper.offsetWidth+"px"}var I=HD.ui.MenuUtil.getNewPosition(G.handles.entry,G.handles.wrapper,"bl",M,true);G.handles.wrapper.style.left=(I[0]+(HD.util.isIE?-2:3)+G.positionFn())+"px";G.handles.wrapper.style.top=(I[1]+(HD.util.isIE?-2:3)+G.positionFn()+1)+"px";G.picker.events.destroy.subscribe(function(){if(!!G.picker){G.handles.wrapper.parentNode.removeChild(G.handles.wrapper);var N=YAHOO.util.Event;N.removeListener(G.handles.wrapper,"click",G.bodyClickCancel);N.removeListener(G.handles.entry,"click",G.bodyClickCancel);delete G.bodyClickCancel;G.handles.wrapper=null;N.removeListener(document.body,"click",G.bodyClick);delete G.bodyClick;G.picker=null}});setTimeout(function(){G.bodyClick=function(){G.picker.destroy()};C.addListener(document.body,"click",G.bodyClick);G.bodyClickCancel=function(N){N=N||window.event;N.cancelBubble=true};C.addListener(G.handles.wrapper,"click",G.bodyClickCancel);C.addListener(G.handles.entry,"click",G.bodyClickCancel)},5);G.events.toggle.fire(G,true)}}};C.addListener(this.handles.toggle,"click",A,{self:this});C.addListener(this.handles.entry,"focus",A,{self:this,toggleOn:true});C.addListener(this.handles.entry,"blur",function(I,H){var F=this;var G=arguments;H.self.closeRequest=true;setTimeout(function(){A.apply(F,G)},50)},{self:this,toggleOff:true});this.events.render.fire(this)};HD.ui.DateSelector.prototype.destroy=function(){var A=YAHOO.util.Event;A.removeListener(this.handles.toggle,"click");A.removeListener(this.handles.entry,"change");A.removeListener(this.handles.entry,"focus");A.removeListener(this.handles.entry,"blur");if(!!this.picker){this.picker.destroy()}this.events.destroy.fire(this)};HD.ui.DateSelector.prototype.content={month_char:"m",day_char:"d",year_char:"y",date_initial:HD.content.Date.FORMAT.MDY.string(),date_mask:HD.content.Date.FORMAT.MDY.mask()};HD.ui.DateRangeSelector=function(E,B,F){var A=this;this.options={};B=B||{};var H;for(H in B){this.options[H]=B[H]}this.rangeOptions={selected_start:null,selected_end:null,mindate:null,maxdate:null};E=E||{};for(H in E){this.rangeOptions[H]=E[H]}if(!!this.rangeOptions.mindate){this.options.mindate=this.rangeOptions.mindate}if(!!this.rangeOptions.maxdate){this.options.maxdate=this.rangeOptions.maxdate}var D=this.options.selected;if(!!this.rangeOptions.selected_start){this.options.selected=this.rangeOptions.selected_start}this.start=new HD.ui.DateSelector(this.options,F);if(!!this.rangeOptions.selected_end){this.options.selected=this.rangeOptions.selected_end}this.end=new HD.ui.DateSelector(this.options,F);this.options.selected=D;this.events={};this.events.change=new YAHOO.util.CustomEvent("change",this);this.events.destroy=new YAHOO.util.CustomEvent("destroy",this);this.events.render=new YAHOO.util.CustomEvent("render",this);var G=function(){if(A.start.handles.entry.value.match(HD.ui.DateSelector.prototype.content.date_mask)){var I=HD.util.Date.parseDate(A.start.handles.entry.value);var J=HD.util.Date.parseDate(A.end.handles.entry.value);if(I>J){A.end.handles.entry.value=A.start.handles.entry.value}}};var C=function(){if(A.end.handles.entry.value.match(HD.ui.DateSelector.prototype.content.date_mask)){var I=HD.util.Date.parseDate(A.start.handles.entry.value);var J=HD.util.Date.parseDate(A.end.handles.entry.value);if(I>J){A.start.handles.entry.value=A.end.handles.entry.value}}};this.start.events.change.subscribe(function(J,I){G();A.events.change.fire(A,"start",I[1])});this.end.events.change.subscribe(function(J,I){C();A.events.change.fire(A,"end",I[1])});G();C();this.start.events.toggle.subscribe(function(J,I){if(!!I[1]&&!!A.end.picker){A.end.picker.destroy()}});this.end.events.toggle.subscribe(function(J,I){if(!!I[1]&&!!A.start.picker){A.start.picker.destroy()}});this.events.render.fire(this)};HD.ui.DateRangeSelector.prototype.destroy=function(){this.start.destroy();this.end.destroy();this.events.destroy.fire(this)};HD.ui.LoadingIndicators={indicators:[],add:function(A){this.indicators[this.indicators.length]=A},remove:function(A){this.indicators=this.indicators.splice(A,1)},removeAll:function(){for(var A=this.indicators.length-1;A>=0;A--){this.indicators[A].remove()}}};HD.ui.LoadingIndicator=function(B,D,C,A){if(!B){return }this.defaultClass="loadingIndicator";this.defaultText=HD.content.Text.loading+" ...";B=$(B);D=D||this.defaultText;C=C||this.defaultClass;this.loadingEl=null;this.add($(B),D,C,A);this.index=HD.ui.LoadingIndicators.length;HD.ui.LoadingIndicators.add(this)};HD.ui.LoadingIndicator.prototype.add=function(B,D,C,A){A=A||{};if(this.loadingEl){this.remove()}this.loadingEl=document.createElement("div");this.loadingEl.className=C;this.loadingEl.style.position="absolute";this.loadingEl.style.visibility="hidden";this.loadingEl.innerHTML="<div>"+D+"</div>";B.appendChild(this.loadingEl);var E=YAHOO.util.Dom.getStyle(B,"position");if(!A.noPosition&&(E=="relative"||E=="absolute"||E=="static")){this.loadingEl.style.left=(B.offsetWidth/2)-(this.loadingEl.offsetWidth/2)+"px";this.loadingEl.style.top=(B.offsetHeight/3)+"px"}else{this.loadingEl.style.position="relative"}this.loadingEl.style.visibility="visible";this.loadingEl.style.zIndex="300"};HD.ui.LoadingIndicator.prototype.remove=function(){if(!this.loadingEl){return }if(this.index){HD.ui.LoadingIndicators.remove(this.index);this.index=null}try{this.loadingEl.parentNode.removeChild(this.loadingEl);this.loadingEl=null}catch(A){this.loadingEl.innerHTML="";this.loadingEl=null}};HD.ui.Paging=function(A,B){this.dataFunction=B;this.HTML={byPageHTML:{pagingWrap:'<div class="'+A+'">_CONTENT</div>',pagingLink:'<a href="javascript:void(0);" onclick="_PAGE_FUNCTION(_PAGE_INDEX);">_PAGE_NUMBER</a>',pagingSpan:"<em>_PAGE_NUMBER</em>",pagingNext:'<a class="_NEXT_CLASS" href="javascript:void(0);" onclick="_PAGE_FUNCTION(_PAGE_INDEX);" style="cursor:pointer" title="Next">_NEXT_TEXT</a>',pagingPrev:'<a class="_PREV_CLASS" href="javascript:void(0);" onclick="_PAGE_FUNCTION(_PAGE_INDEX);" style="cursor:pointer" title="Previous">_PREV_TEXT</a>',prevArrowClass:"prevArrow",nextArrowClass:"nextArrow",prevText:"&lt;",nextText:"&gt;",delimiter:"<span>|</span>"},byRecordHTML:{pagingWrap:'<table class="'+A+'"><tr><td class="_PREV_CLASS"><a href="javascript:void(0);" onclick="_PAGE_FUNCTION(_PREV_PAGE_INDEX, true);">'+HD.content.Text.prev+'</a></td><td class="pagingContent">_CONTENT</td><td class="_NEXT_CLASS"><a href="javascript:void(0);" onclick="_PAGE_FUNCTION(_NEXT_PAGE_INDEX, true);">'+HD.content.Text.next+"</a></td></tr></table>",prevArrowClass:"prevArrow",nextArrowClass:"nextArrow"}}};HD.ui.Paging.prototype.generateByPage=function(D,A,E){E=E||this.dataFunction;var C=new Array();if(A>1){C.push(HD.util.template(this.HTML.byPageHTML.pagingPrev,{_PAGE_FUNCTION:E,_PAGE_INDEX:A-1,_PREV_CLASS:this.HTML.byPageHTML.prevArrowClass,_PREV_TEXT:this.HTML.byPageHTML.prevText}))}for(var B=1;B<=D;B++){h="";if(B>1){C.push(this.HTML.byPageHTML.delimiter)}if(B==A){h=HD.util.template(this.HTML.byPageHTML.pagingSpan,{_PAGE_NUMBER:B})}else{h=HD.util.template(this.HTML.byPageHTML.pagingLink,{_PAGE_FUNCTION:E,_PAGE_INDEX:B,_PAGE_NUMBER:B})}C.push(h)}if(A<D){C.push(HD.util.template(this.HTML.byPageHTML.pagingNext,{_PAGE_FUNCTION:E,_PAGE_INDEX:A+1,_NEXT_CLASS:this.HTML.byPageHTML.nextArrowClass,_NEXT_TEXT:this.HTML.byPageHTML.nextText}))}return HD.util.template(this.HTML.byPageHTML.pagingWrap,{_CONTENT:C.join("")})};HD.ui.Paging.prototype.generateByRecord=function(F,C,B,D,A,H,E){if(!E&&F<2){return null}H=H||this.dataFunction;var G=this.HTML.byRecordHTML.pagingWrap;G=HD.util.template(G,{_PAGE_FUNCTION:H,_PREV_PAGE_INDEX:C-1,_NEXT_PAGE_INDEX:C+1,_PREV_CLASS:C>1?this.HTML.byRecordHTML.prevArrowClass:HD.rp.HTML.invisibleClass,_NEXT_CLASS:F==0||C==-1?HD.rp.HTML.invisibleClass:(C<F?this.HTML.byRecordHTML.nextArrowClass:HD.rp.HTML.invisibleClass),_CONTENT:(B+1)+" to "+(B+D)+" of "+A});return G};HD.road={};HD.register("road","1.0");HD.road.constants={_MAX_ZOOM_LEVEL:19,_POINT_SCALE:6,_DISTANCE_SCALE:1,_ROUTE_PREFERENCE_FASTEST:"Fastest",_ROUTE_PREFERENCE_SHORTEST:"Shortest",_STOP_TYPES:{STOP:1,VIA:2,HOTEL:3,DEALER:4,GREAT_ROAD:5,USER_ROAD:6,MY_RIDE:7,EVENT:8,FUEL:9,ANNIV105:10,FACILITY:11,1:"STOP",2:"VIA",3:"HOTEL",4:"DEALER",5:"GREAT_ROAD",6:"USER_ROAD",7:"MY_RIDE",8:"EVENT",9:"FUEL",10:"ANNIV105",11:"FACILITY"},_EVENT:{STOP_UPDATED:"stopUpdated",STOP_REMOVED:"stopRemoved",SEGMENT_UPDATED:"segmentUpdated",SEGMENT_REMOVED:"segmentRemoved",DIRECTIONS_UPDATED:"directionsUpdated",ROUTING_FAILED:"routingFailed"},_UP_DOWN:{UP:1,DOWN:2,1:"UP",2:"DOWN"}};HD.road.RouteContext={zoomIndexes:[1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0],zoomIndexCount:2,zoomLevel:0,routePreference:HD.road.constants._ROUTE_PREFERENCE_FASTEST,setZoomLevel:function(B){var A=(this.zoomIndexes[this.zoomLevel]!=this.zoomIndexes[B]);this.zoomLevel=B;return A},getZoomIndex:function(A){return this.zoomIndexes[(A!=null)?A:this.zoomLevel]},setAvoidHighways:function(A){this.routePreference=this.getRoutePreference(A)},isAvoidHighways:function(){return(this.routePreference==HD.road.constants._ROUTE_PREFERENCE_SHORTEST)},getRoutePreference:function(A){return A?HD.road.constants._ROUTE_PREFERENCE_SHORTEST:HD.road.constants._ROUTE_PREFERENCE_FASTEST}};HD.road.EventManager=function(){this.events={}};HD.road.EventManager.prototype.registerEvent=function(A,B){A=A.toLowerCase();this.events[A]=B};HD.road.EventManager.prototype.registerEvents=function(A){HD.util.copyObject(A.events,this.events)};HD.road.EventManager.prototype.unregisterEvents=function(){this.events={}};HD.road.EventManager.prototype.fireEvent=function(A,B){A=A.toLowerCase();var C=this.events[A];if(!C){return }C(B)};HD.road.GPX={MAXIMUM_ROUTE_POINTS:100,STATUS_ELEMENT:"gpxStatus",INPUT_ELEMENT:"gpxInput",NAME_ELEMENT:"gpxName",DEVICE_SELECT_ELEMENT:"gpxDeviceSelect",FORM_ELEMENT:"gpxForm",MANUAL_WRITE_ELEMENT:"gpxManualWrite",MANUAL_READ_ELEMENT:"gpxManualRead",MANUAL_WRITE_DIV:"gpxManualWriteDiv",MANUAL_WRITE_TEXT:"gpxManualWriteText",WRITE_ELEMENT:"gpxWrite",CANCEL_WRITE_ELEMENT:"gpxCancelWrite",READ_ELEMENT:"gpxRead",DEVICE_ELEMENT:"gpxDevices",ROUTE_ELEMENT:"gpxRoutes",ROUTE_SELECT_ELEMENT:"gpxRouteSelect",MANUAL_UPLOAD_ELEMENT:"gpxUpload",MANUAL_DOWNLOAD_ELEMENT:"gpxDownload",PATH_KEY_PAIRS:{},controller:null,route:null,routeToGPX:function(A){this.init();this.route=A},external:false,cancelImport:false,exportUsingRoute:true,exportUsingGuidepoints:false,exportUsingGeometry:true,init:function(B){this.route=null;try{this.external=B||null;if(!this.external){HD.ui.Dialog.show("GPS",350,200,this.template.gpxInterface)}this.controller=new Garmin.DeviceControl();return true}catch(A){log("No Garmin plugin detected");return false}},unlockGarminPlugin:function(){try{var A=this.getPathKeyPairsArray();this.controller.unlock(A);this.controller.register(this)}catch(B){log("Failed to unlock garmin device");return }},getPathKeyPairsArray:function(){return[GARMIN_PATH,GARMIN_KEY]},cancelFindDevices:function(){if(!!this.controller){this.controller.cancelFindDevices()}},cancelReadFromDevice:function(){this.controller.cancelReadFromDevice()},cancelWriteToDevice:function(){this.controller.cancelWriteToDevice()},findDevices:function(){this.unlockGarminPlugin();this.controller.findDevices()},writeRoute:function(B){var C=null;var D=this.route.data;if(!this.external){C=prompt("Enter route name",D.name||HD.road.GPX.template.text.defaultRideName)}else{C=D.name}D.name=C||HD.road.GPX.template.text.defaultRideName;var A=this;this.unlockGarminPlugin();this.convertToRoute(this.route,function(E){A.controller.writeToDevice(E,A.getFileName())})},exportRoute:function(B,A){this.route=A||this.route||null;if(!!this.external&&(!this.route||this.route.stopList.getStopCount()==0||!this.route.data.name)){this.external.exportError();return }this.writeRoute(B)},importRoute:function(D){if(!this.external){this.showStatusMessage("Importing route, this may take several minutes.");var B=$(this.ROUTE_SELECT_ELEMENT);var C=B.options[B.selectedIndex].value;this.route=this.routes[parseInt(C,10)]||null}else{this.route=this.routes[D]||null}if(!!this.external&&!this.route){this.external.importError();return }this.route.data.id=null;var A=this;this.cancelImport=false;this.route.attachEvent(HD.road.constants._EVENT.SEGMENT_UPDATED,function(E){if(!A.cancelImport){A.routeSegment.call(A,E.nextSegment())}});this.routeSegment(this.route.getStart().segmentOut)},routeSegment:function(A){if(A.end==null){this.route.detachEvents(HD.road.constants._EVENT.SEGMENT_UPDATED,function(B){cb.routeSegment.call(cb,B.nextSegment())});HD.rp.MyRide.setAsMyRide(this.route);if(!this.external){this.showStatusMessage("Route successfully imported.");setTimeout(function(){HD.ui.Dialog.hide()},"2000")}else{this.external.importComplete()}}else{A.reroute()}},readDevice:function(A){this.unlockGarminPlugin();if(!!this.external){this.controller.setDeviceNumber(A)}this.controller.readFromDevice("gpx")},manualWriteRoute:function(){HD.ui.Dialog.resize(400,600);this.setDisplayStyle(this.ROUTE_ELEMENT,"none");this.setDisplayStyle(this.MANUAL_WRITE_DIV,"block");this.setDisplayStyle(this.MANUAL_DOWNLOAD_ELEMENT,"inline");this.setDisplayStyle(this.MANUAL_UPLOAD_ELEMENT,"none");$(this.MANUAL_WRITE_TEXT).value=this.convertToRoute(this.route)},manualReadRoute:function(){HD.ui.Dialog.resize(400,600);this.setDisplayStyle(this.ROUTE_ELEMENT,"none");this.setDisplayStyle(this.MANUAL_WRITE_DIV,"block");this.setDisplayStyle(this.MANUAL_UPLOAD_ELEMENT,"inline");this.setDisplayStyle(this.MANUAL_DOWNLOAD_ELEMENT,"none");$(this.MANUAL_WRITE_TEXT).value=HD.road.GPX.template.text.copyAndPasteRoute},upload:function(C){if(!this.external){var H=$(this.MANUAL_WRITE_TEXT).value;var F=HD.util.createXMLDoc(H);var B=this;this.parseXML(F,function(I){B.showRouteSelection(I)})}else{if(!C){var A=document.createElement("div");A.style.display="none";A.innerHTML=this.template.gpxUploadForm;var E=A.getElementsByTagName("form")[0];return E}else{try{var D=this;this.parseXML(C,function(K){D.routes=K;var L=[];for(var J=0,I=D.routes.length;J<I;J++){L.push({name:D.routes[J].data.name,id:D.routes[J].data.id})}D.external.upload(L)})}catch(G){this.external.importError()}}}},download:function(D){this.route=D||this.route||null;if(!this.external){$(this.INPUT_ELEMENT).value=$(this.MANUAL_WRITE_TEXT).value;$(this.NAME_ELEMENT).value=this.route.data.name;document[this.FORM_ELEMENT].submit()}else{if(!this.route||this.route.stopList.getStopCount()==0||!this.route.data.name){this.external.exportError()}else{var B=document.createElement("div");B.style.display="none";B.innerHTML=this.template.gpxDownloadForm;var E=B.getElementsByTagName("form")[0];var C=E.getElementsByTagName("input")[0];var A=this;this.convertToRoute(this.route,function(G){C.value=G;var F=E.getElementsByTagName("input")[1];F.value=A.route.data.name||"";A.external.download(E)})}}},onStartFindDevices:function(A){if(!this.external){$(this.STATUS_ELEMENT).innerHTML="Searching for attached devices...";this.setDisplayStyle(this.MANUAL_WRITE_DIV,"none");this.setDisplayStyle(this.MANUAL_WRITE_ELEMENT,"none");this.setDisplayStyle(this.MANUAL_READ_ELEMENT,"none");this.setDisplayStyle(this.WRITE_ELEMENT,"none");this.setDisplayStyle(this.READ_ELEMENT,"none");this.setDisplayStyle(this.ROUTE_ELEMENT,"none");$(this.DEVICE_ELEMENT).innerHTML=""}else{this.external.onStartFindDevices(A)}},onFinishFindDevices:function(B){this.controller=B.controller;var G=this.controller.numDevices;if(!this.external){if(G>0){this.showStatusMessage("Found "+G+" device(s).");this.setDisplayStyle(this.WRITE_ELEMENT,"inline");this.setDisplayStyle(this.READ_ELEMENT,"inline");var K=new Array();var L=this.controller.getDevices();for(var I=0;I<G;I++){var A=L[I];var F=this.template.gpxDeviceOption;F=F.replace(/_KEY/,A.getDisplayName());F=F.replace(/_VALUE/,A.getNumber());K.push(F)}var C=this.template.gpxDeviceSelect;C=C.replace(/_OPTIONS/,K.join(""));$(this.DEVICE_ELEMENT).innerHTML=C;this.setDisplayStyle(this.MANUAL_WRITE_ELEMENT,"none");this.setDisplayStyle(this.MANUAL_READ_ELEMENT,"none")}else{this.showStatusMessage("No devices found.<br/>Try manual write, or search again.");this.setDisplayStyle(this.MANUAL_WRITE_ELEMENT,"inline");this.setDisplayStyle(this.MANUAL_READ_ELEMENT,"inline")}}else{var E=[];var D=this.controller.getDevices();for(var H=0;H<G;H++){var J=D[H].getSoftwareVersion();if(!!J&&J!="0"){E.push({name:D[H].getDisplayName(),number:D[H].getNumber()})}}this.external.onFinishFindDevices(B,E)}},onStartWriteToDevice:function(A){if(!this.external){this.showStatusMessage("Writing to device...")}else{this.external.onStartWriteToDevice(A)}},onFinishWriteToDevice:function(A){if(!this.external){this.showStatusMessage("Completed.<br/>Having problems? Try manual write.");this.setDisplayStyle(this.MANUAL_WRITE_ELEMENT,"inline");this.setDisplayStyle(this.MANUAL_READ_ELEMENT,"inline")}else{this.external.onFinishWriteToDevice(A)}},onStartReadFromDevice:function(A){if(!this.external){this.showStatusMessage("Reading device data...")}else{this.external.onStartReadFromDevice(A)}},onFinishReadFromDevice:function(B){if(!this.external){this.showStatusMessage("Processing received data...")}var C=B.controller.gpsData;var A=this;this.parseXML(C,function(F){if(!A.external){A.showRouteSelection(F);A.showStatusMessage("Import complete.")}else{A.routes=F;var G=[];for(var E=0,D=F.length;E<D;E++){G.push({name:F[E].data.name,id:F[E].data.id})}A.external.onFinishReadFromDevice(B,G)}})},onException:function(A){this.showStatusMessage("Error: "+A.msg)},showStatusMessage:function(A){if(!this.external){$(this.STATUS_ELEMENT).innerHTML=A}},showRouteSelection:function(C){this.routes=C;var E=new Array();for(var B=0,A=C.length;B<A;B++){var D=C[B];var G=this.template.gpxDeviceOption;G=G.replace(/_KEY/,D.data.name);G=G.replace(/_VALUE/,D.data.id);E.push(G)}var F=this.template.gpxRouteSelect;F=F.replace(/_OPTIONS/,E.join(""));this.setDisplayStyle(this.ROUTE_ELEMENT,"block");$(this.ROUTE_ELEMENT).innerHTML=F},getFileName:function(){return"hd_"+new Date().valueOf()+".gpx"},getRouteName:function(A){if(A.data==null||A.data.name==null){return"Ride Planner Route"}return A.data.name},parseXML:function(K,E){var B=K.getElementsByTagName("gpx")[0];var A=B.getElementsByTagName("trk");var J=B.getElementsByTagName("rte");var C=[];for(var F=0;F<A.length;F++){C.push(A[F])}for(var G=0;G<J.length;G++){C.push(J[G])}var D=0;var H=new Array();var I=this;(function(){if(C.length==0){E(H)}else{var N=C.shift();if(N.nodeName=="trk"){var w=new HD.road.Route();var x=N;var j=x.getElementsByTagName("name")[0];w.data.name=j.text||j.textContent||null;w.data.id=D++;var p=w.stopList;var g=x.getElementsByTagName("trkseg");for(var t=0,X=g.length;t<X;t++){var Y=g[t];var M=Y.getElementsByTagName("trkpt");var T=null;var S=new Array();var Q=null;for(var s=0,W=M.length;s<W;s++){var e=M[s];var V=e.getAttribute("lat");var P=e.getAttribute("lon");if(s==0){T=I.createStop(V,P,HD.road.constants._STOP_TYPES.STOP)}else{if(s==W-1){Q=I.createStop(V,P,HD.road.constants._STOP_TYPES.STOP)}else{S.push(I.createStop(V,P,HD.road.constants._STOP_TYPES.VIA))}}}p.addSegment(T,S,Q,null)}H.push(w)}else{if(N.nodeName=="rte"){var U=new HD.road.Route();var n=N;var r=n.getElementsByTagName("name")[0];U.data.name=r.text||r.textContent||null;U.data.id=D++;var d=U.stopList;var f=null;var u=new Array();var Z=null;var l=n.getElementsByTagName("rtept");for(var L=0,O=l.length;L<O;L++){var o=l[L];var q=o.getAttribute("lat");var k=o.getAttribute("lon");if(L==0){f=I.createStop(q,k,HD.road.constants._STOP_TYPES.STOP)}else{if(L==O-1){Z=I.createStop(q,k,HD.road.constants._STOP_TYPES.STOP)}else{u.push(I.createStop(q,k,HD.road.constants._STOP_TYPES.VIA))}}}d.addSegment(f,u,Z,null);H.push(U)}}setTimeout(arguments.callee,0)}})()},createStop:function(C,D,B){var A=new HD.road.Stop(B);A.setLocation(C,D,null);return A},convertToRoute:function(B,E){var A=this;var D=B;var C=E;A.handleSimplifyResponse(D,C)},handleSimplifyResponse:function(N,P){var I=N.getStops();var D=null;var B=null;var Q=null;var J=new Array();var A=null;var C=null;var M=new Array();var O=null;for(var L=0,E=I.length;L<E;L++){var O=I[L];M[0]=O.latitude;M[1]=O.longitude;if(O!=null){if(B!=null&&Q!=null){J.push(this.createGarminGpxSimpleSeg(Q,B,M,C))}B=new Array();Q=O;A=Q.nextStop();if(A!=null){C=this.ampersandCheck(A.getTitle())}else{C="Final Destination"}if(Q.isEnd()){J.push(this.createGarminGpxSimpleSeg(Q,B,M,C))}}else{B.push(this.createGarminSegmentPoint(M))}}var K=this.createGarminWaypoints(I);var H=this.template.garminGpxXml;var G="";var F=0;while((J[F]!=null)&&(J[F+1]!=null)){G+=this.createGarminRoute(J[F],N,(F+1));F++}H=H.replace(/_ROUTE/,G);H=H.replace(/_WAYPOINTS/,K);P(H)},createGarminSegmentPoint:function(A){return this.template.garminGpxSimpleSeg.replace(/_LAT/,A[0]).replace(/_LON/,A[1]).replace(/_NAME/,"Routing point")},createGarminGpxSimpleSeg:function(J,A,G,B){var F=this.template.garminGpxSimpleSeg;F=F.replace(/_LAT/,J.latitude);F=F.replace(/_LON/,J.longitude);F=F.replace(/_NAME/,this.ampersandCheck(J.getTitle()));var C=J.segmentOut.vias;var I=C.length;if(I>0){for(var H=0;H<I;H++){var E=this.template.garminGpxSimpleSeg;E=E.replace(/_LAT/,C[H].latitude);E=E.replace(/_LON/,C[H].longitude);E=E.replace(/_NAME/,"Via Point "+(H+1));F+=E}}var D=this.template.garminGpxSimpleSeg;D=D.replace(/_LAT/,G[0]);D=D.replace(/_LON/,G[1]);D=D.replace(/_NAME/,B);F+=D;return F},createGarminRoute:function(B,A,C){var D=this.template.garminGpxRoute;D=D.replace(/_SEGMENTS/,B);if(C>1){D=D.replace(/_NAME/,this.ampersandCheck(this.getRouteName(A))+" "+C)}else{D=D.replace(/_NAME/,this.ampersandCheck(this.getRouteName(A)))}return D},createGarminWaypoints:function(E){var F=new Array();for(var B=0,A=E.length;B<A;B++){var C=E[B];var D=this.template.garminGpxWaypoint;D=D.replace(/_LAT/,C.latitude);D=D.replace(/_LON/,C.longitude);D=D.replace(/_NAME/,this.ampersandCheck(C.getTitle()));D=D.replace(/_CMT/,this.ampersandCheck(C.getLocation()));D=D.replace(/_DESC/,this.ampersandCheck(C.getLocation()));F.push(D)}return F.join("")},getRouteCoordinates:function(D){var F=new Array();var E=D.getVELatLongs(HD.rp.constants._ZOOM_LEVEL_STREET,true);for(var C=0,B=E.length;C<B;C++){var A=E[C];F.push(A.Latitude);F.push(" ");F.push(A.Longitude);if(A.isSignificant){F.push(" ");F.push("sig")}F.push(",")}F.pop();return F.join("")},setDisplayStyle:function(B,A){$(B).style.display=A},ampersandCheck:function(A){return A.replace(/&/,"and")},clearText:function(A){A.onblur=function(){if(this.value==""||this.value==null){this.value=HD.road.GPX.template.text.copyAndPasteRoute}};if(A.value==""||A.value==null||A.value==HD.road.GPX.template.text.copyAndPasteRoute){A.value=""}},template:{text:{copyAndPasteRoute:"Copy and paste the contents of a GPX file in here, then click Upload.",defaultRideName:"stops and waypoints"},gpxDeviceOption:'<option value="_VALUE">_KEY</option>',gpxDeviceSelect:'<select id="gpxDeviceSelect">_OPTIONS</select>',gpxRouteSelect:'<select id="gpxRouteSelect">_OPTIONS</select>&nbsp;<input id="gpxImport" type="button" value="Import" class="btn" onclick="HD.road.GPX.importRoute();" />',gpxInterface:'<div class="gpx" ><div id="gpxStatus" class="status"></div><div id="gpxDevices" class="devices"></div><div id="gpxRoutes" class="routes"></div><div class="controls"><table><tr><td><input id="gpxFind" type="button" value="Find device" class="btn" onclick="HD.road.GPX.findDevices();" /></td></tr><tr><td><input id="gpxWrite" type="button" value="Export" class="btn" onclick="HD.road.GPX.exportRoute();" /><input id="gpxRead" type="button" value="Import" class="btn" onclick="HD.road.GPX.readDevice();" /></td></tr><tr><td><input id="gpxManualWrite" type="button" value="Manual export" class="btn" onclick="HD.road.GPX.manualWriteRoute();" /><input id="gpxManualRead" type="button" value="Manual import" class="btn" onclick="HD.road.GPX.manualReadRoute();" /></td></tr></table></div><div id="gpxManualWriteDiv"><textarea id="gpxManualWriteText" type="input" value="Copy and paste the contents of a GPX file in here, then click Upload." onfocus="HD.road.GPX.clearText(this);" ></textarea><br/><input id="gpxUpload" type="button" value="Import" class="btn" onclick="HD.road.GPX.upload();" /><input id="gpxDownload" type="button" value="Export" class="btn" onclick="HD.road.GPX.download();" /></div></div><form method="POST" onsubmit="return false;" name="gpxForm" id="gpxForm" action="ridePlannerGPX.jsp"><input name="gpxInput" id="gpxInput" type="text" value="" ></input></form> ',gpxDownloadForm:'<form method="POST" onsubmit="return false;" name="gpxDownloadForm" id="gpxDownloadForm" action="ridePlannerGPX.jsp"><input name="gpxInput" id="gpxInput" type="text" value="" ></input><input name="gpxName" id="gpxName" type="text" value="" ></input></form> ',gpxUploadForm:'<form method="POST" onsubmit="return false;" name="gpxUploadForm" id="gpxUploadForm" action="ridePlannerGPX.jsp" enctype="multipart/form-data"><input name="gpxOutput" id="gpxOutput" type="file" value="" size="14"></input></form> ',garminGpxXml:'<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="Harley-Davidson Ride Planner" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">\n_WAYPOINTS_ROUTE</gpx>\n',garminGpxWaypoint:'<wpt lat="_LAT" lon="_LON">\n\t<name>_NAME</name>\n\t<cmt>_CMT</cmt>\n\t<desc>_DESC</desc>\n\t<sym>Waypoint</sym>\n\t<extensions>\n\t\t<gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3">\n\t\t\t<gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode>\n\t\t</gpxx:WaypointExtension>\n\t</extensions>\n</wpt>\n',garminGpxRoute:"<rte>\n\t<name>_NAME</name>\n_SEGMENTS\n</rte>\n",garminGpxSegment:'\t<rtept lat="_LAT" lon="_LON">\n\t\t<name>_NAME</name>\n\t\t<sym>Waypoint</sym>\n\t</rtept>\n_POINTS\n',garminGpxSimpleSeg:'\t<rtept lat="_LAT" lon="_LON">\n\t\t<name>_NAME</name>\n\t\t<sym>Waypoint</sym>\n\t</rtept>\n'}};HD.road.Route=function(A){this.type=null;this.data=(A!=null)?A:{};this.stopList=new HD.road.StopList()};HD.road.Route.prototype.attachEvent=function(A,B){this.stopList.attachEvent(A,B)};HD.road.Route.prototype.detachEvents=function(A,B){this.stopList.detachEvents()};HD.road.Route.prototype.getStart=function(){return this.stopList.start};HD.road.Route.prototype.getEnd=function(){return this.stopList.end};HD.road.Route.prototype.get=function(A){return this.stopList.get(A)};HD.road.Route.prototype.getStop=function(A){return this.stopList.getStop(A)};HD.road.Route.prototype.getSegment=function(A){return this.stopList.getSegment(A)};HD.road.Route.prototype.addRoute=function(A){this.stopList.addStopList(A.stopList)};HD.road.Route.prototype.addStopAfter=function(A,B){this.stopList.addStopAfter(A,B)};HD.road.Route.prototype.addStopBefore=function(A,B){this.stopList.addStopBefore(A,B)};HD.road.Route.prototype.removeStop=function(A){return this.stopList.removeStop(A)};HD.road.Route.prototype.moveStopAfter=function(B,A){this.stopList.moveStopAfter(B,A)};HD.road.Route.prototype.moveStopBefore=function(B,A){this.stopList.moveStopBefore(B,A)};HD.road.Route.prototype.convertViaToStop=function(A){this.stopList.convertViaToStop(A)};HD.road.Route.prototype.convertStopToVia=function(A){this.stopList.convertStopToVia(A)};HD.road.Route.prototype.reroute=function(A){this.stopList.reroute(A)};HD.road.Route.prototype.reverse=function(){this.stopList.reverse()};HD.road.Route.prototype.clone=function(B){var A=new HD.road.Route();A.type=this.type;HD.util.copyObject(this.data,A.data);A.stopList=this.stopList.clone(B);return A};HD.road.Route.prototype.clear=function(){this.stopList.clear()};HD.road.Route.prototype.isEmpty=function(){return this.stopList.isEmpty()};HD.road.Route.prototype.isComplete=function(){return((this.stopList.end!=null)&&(this.stopList.end.segmentOut.getVias()==null))};HD.road.Route.prototype.getVELatLong=function(B){var A=!!this.data.midpoint&&HD.util.Math.pointInsideMap(HD.DWR.parseVELatLong(this.data.midpoint),B)?this.data.midpoint:this.data.point||null;return(A!=null)?HD.DWR.parseVELatLong(A):null};HD.road.Route.prototype.getStops=function(){var B=new Array();var A=this.getStart();while(A!=null){B.push(A);A=A.nextStop()}return B};HD.road.Route.prototype.getStopPoints=function(){if(this.isEmpty()){return }var B=new Array();var A=this.stopList.start;while(A!=null){if(A instanceof HD.road.Stop){B.push(HD.DWR.formatPoint(A))}else{B=B.concat(HD.DWR.formatPoints(A.vias))}A=A.next()}return B};HD.road.Route.prototype.getVELatLongs=function(C,A){if(this.isEmpty()){return }var E=new Array();var D=this.stopList.start;var B=D.segmentOut;if(B.isEmpty()){E.push(D.getVELatLong())}else{do{B.getVELatLongs(C,E,A);B=B.nextSegment()}while(B!=null&&!B.isEmpty())}return E};HD.road.Route.prototype.recalculate=function(){if(this.isEmpty()){return }var D=0;var C=0;var A=this.getStart().segmentOut;var B;while(A!=null){B=A.data;if(B.distance){D+=B.distance}if(B.duration){C+=B.duration}A=A.nextSegment()}if(D){this.data.distance=D}if(C){this.data.duration=C}};HD.road.Address=function(A){this.data=(A!=null)?A:{}};HD.road.Address.prototype.toString=function(){var A="";if(this.data.lineOne){A+=this.data.lineOne}if(this.data.lineTwo){if(A.length>0){A+=", "}A+=this.data.lineTwo}if(this.data.city){if(A.length>0){A+=", "}A+=this.data.city}if(this.data.stateCode){if(A.length>0){A+=", "}A+=this.data.stateCode}else{if(this.data.province){if(A.length>0){A+=", "}A+=this.data.province}}if(this.data.postalCode){if(A.length>0){A+=", "}A+=this.data.postalCode}if(!this.isUS()){var B=this.getCountry();if(B){if(A.length>0){A+=", "}A+=B}}return A};HD.road.Address.prototype.toHTML=function(){var A="";if(this.data.city){A+=HD.util.convertToJSSafeHTMLString(this.data.city)}if(this.data.stateCode){if(A.length>0){A+=", "}A+=this.data.stateCode}else{if(this.data.province){if(A.length>0){A+=", "}A+=this.data.province}}if(this.data.postalCode){if(A.length>0){A+=", "}A+=this.data.postalCode}if(!this.isUS()){var B=this.getCountry();if(B){if(A.length>0){A+=", "}A+=B}}var C="";if(this.data.lineOne){C+=HD.util.convertToJSSafeHTMLString(this.data.lineOne)}if(this.data.lineTwo){if(C.length>0){C+="<br/>"}C+=HD.util.convertToJSSafeHTMLString(this.data.lineTwo)}if(A.length>0){if(C.length>0){C+="<br/>"}C+=A}return C};HD.road.Address.prototype.isUS=function(){var A=this.getCountry();if(A&&(A=="US"||A=="United States")){return true}return false};HD.road.Address.prototype.getCountry=function(){var A;if(this.data.countryName){A=this.data.countryName}else{if(this.data.countryCode){A=this.data.countryCode}else{if(this.data.country){A=this.data.country}}}return A};HD.road.Segment=function(G,F,A,E,C){this.id=HD.util.IdGenerator.generateId();this.vias=(F!=null)?F:new Array();this.directions=null;this.data=(E!=null)?E:{};this.setStart(G);this.setEnd(A);var B=this;var D=new HD.road.RequestChain(C);D.init=function(H){B.chainInit.call(B,H)};D.success=function(){B.chainSuccess.call(B)};D.failure=function(H){B.chainFailure.call(B,H)};this.chain=D};HD.road.Segment._ZOOM_POINTS="points";HD.road.Segment._ZOOM_POINT_LISTS="pointLists";HD.road.Segment._ZOOM_LAT_LONGS="latLongs";HD.road.Segment._ZOOM_VIAS="vias";HD.road.Segment.prototype.setStart=function(A){if(A!=null){A.segmentOut=this}if(this.start!=null){this.start.segmentOut=null}this.start=A};HD.road.Segment.prototype.setEnd=function(A){if(A!=null){A.segmentIn=this}if(this.end!=null){this.end.segmentIn=null}this.end=A};HD.road.Segment.prototype.next=function(){return this.end};HD.road.Segment.prototype.prev=function(){return this.start};HD.road.Segment.prototype.nextSegment=function(B){var A=(this.end!=null)?this.end.segmentOut:null;if(B&&A!=null){}return A};HD.road.Segment.prototype.prevSegment=function(A){var B=(this.start!=null)?this.start.segmentIn:null;if(A&&B!=null){}return B};HD.road.Segment.prototype.getPoints=function(D){if(this.isEmpty()){return null}var C=this.getZoomCache(HD.road.Segment._ZOOM_POINTS);var A=HD.road.RouteContext.getZoomIndex(D);var B=C[A];if(B==null){B=HD.road.DWR.decodePolyline(this,A);C[A]=B}return B};HD.road.Segment.prototype.getPointList=function(E,B){if(this.isEmpty()){return null}var L=this.getZoomCache(HD.road.Segment._ZOOM_POINT_LISTS);var I=HD.road.RouteContext.getZoomIndex(E);var A=L[I];if(A==null){var F;var K=this.getPoints(E);var G=0;var C=this.start.clone();A=new HD.road.StopList();var D=this.getVias(E);var J=(D!=null)?D.length:0;for(var H=0;H<J;H++){F=D[H];G=this.addPointListSegment(A,C,F,K,G,I);C=F}if(this.end!=null){F=this.end.clone();G=this.addPointListSegment(A,C,F,K,G,I)}L[I]=A}return A};HD.road.Segment.prototype.addPointListSegment=function(B,D,F,L,H,I){var J=L[H];var A=new Array();var C=0;var K=H;if(J.isSamePoint(F)){A.push(J)}else{do{A.push(J);J=L[++H];C+=(H>K?HD.util.Math.getDistanceBetweenLatLng(L[H-1],J,"mi"):0)}while(!J.isSamePoint(F))}A.push(J);var G=B.addSegment(D,null,F,{distance:C});var E=G.getZoomCache(HD.road.Segment._ZOOM_POINTS);E[I]=A;return H};HD.road.Segment.prototype.getVELatLongs=function(B,F,Q){if(this.isEmpty()){return null}var I=this.getZoomCache(HD.road.Segment._ZOOM_LAT_LONGS);var M=HD.road.RouteContext.getZoomIndex(B);var D=I[M];if(D==null){var N=this.getPoints(B);var L=(N!=null)?N.length:0;if(L==0){return F?F:new Array(L)}D=new Array(L);if(!!Q){var H=false;if(this.end!=null&&this.end.isEnd()){H=true}}var A=this.getVias(B)||[];for(var K=0;K<L;K++){var P=N[K].getVELatLong();if(!!Q){if(K==0||(K==L-1)&&H){P.isSignificant=true;log("significant "+P.Latitude+" "+P.Longitude)}for(var J=0,E=A.length;J<E;J++){var O=A[J];if(P.Latitude==O.latitude&&P.Longitude==O.longitude){P.isSignificant=true;log("significant "+P.Latitude+" "+P.Longitude)}}}D[K]=P}I[M]=D}if(F!=null){var C=D.length;for(var G=0;G<C;G++){F.push(D[G])}}return(F!=null)?F:D};HD.road.Segment.prototype.getVias=function(B){var C=this.vias;var N=this.vias.length;if(N==0){return null}var E=this.getZoomCache(HD.road.Segment._ZOOM_VIAS);var J=HD.road.RouteContext.getZoomIndex(B);var F=E[J];if(F==null){var M=this.getPoints(B);var I=M.length;var D=0;var O;var K;F=new Array(N);for(var H=0;H<N;H++){O=C[H];var A=0;var L=Number.MAX_VALUE;for(var G=D;G<I;++G){A=HD.util.getDistance(O,M[G]);if(A<L){L=A;D=G}}O=O.clone();HD.util.copyObject(M[D],O);F[H]=O}E[J]=F}return F};HD.road.Segment.prototype.getVia=function(B){var A=this.indexOfVia(B);return(A>=0)?this.vias[A]:null};HD.road.Segment.prototype.indexOfVia=function(C){var B=this.vias.length;for(var A=0;A<B;A++){if(this.vias[A].id==C){return A}}return -1};HD.road.Segment.prototype.addViaBefore=function(B,E){this.chain.init();var D=this.vias;if((E==null)||((this.end!=null)&&(E==this.end.id))){D.push(B)}else{if(E==this.start.id){HD.ui.Dialog.showError("Cannot insert via point before segment!");return }else{var C=D.length;var A;for(A=0;A<C;A++){if(E==D[A].id){break}}if(A==0){D.unshift(B)}else{D.splice(A,0,B)}}}this.chain.addRouteRequest(this);this.chain.execute()};HD.road.Segment.prototype.removeVia=function(D){this.chain.init(D);var C=this.vias;var B=C.length;var A;for(A=0;A<B;A++){if(D==C[A].id){break}}C.splice(A,1);this.chain.addRouteRequest(this);this.chain.execute()};HD.road.Segment.prototype.setRoutePreference=function(A){if(this.data.routePreference==A){return }this.chain.init();this.data.routePreference=A;this.chain.addRouteRequest(this);this.chain.execute()};HD.road.Segment.prototype.reroute=function(A){this.chain.init(A);this.chain.addRouteRequest(this);this.chain.execute()};HD.road.Segment.prototype.clone=function(E,B,G,A){var D=new HD.road.Segment(null,null,null,null,B);var F=D.id;var C=D.chain;HD.util.copyObject(this,D);if(!!E){D.id=HD.util.IdGenerator.generateId()}D.chain=C;D.vias=HD.util.cloneObject(this.vias,true);if(G==null){G=this.start.clone(E)}D.start=null;D.setStart(G);if(this.end!=null){if(A==null){A=this.end.clone(E)}}else{A=null}D.end=null;D.setEnd(A);return D};HD.road.Segment.prototype.isEmpty=function(){return((this.encodedPoints==null)&&(this.zoomCaches==null))};HD.road.Segment.prototype.toString=function(){return"segment: "+this.id};HD.road.Segment.prototype.clear=function(){delete this.data.handle;delete this.data.distance;delete this.data.duration;delete this.encodedPoints;delete this.encodedLevels;delete this.directions;delete this.zoomCaches};HD.road.Segment.prototype.getZoomCache=function(B){if(this.zoomCaches==null){this.zoomCaches={}}var A=this.zoomCaches[B];if(A==null){A=new Array(HD.road.RouteContext.zoomIndexCount);this.zoomCaches[B]=A}return A};HD.road.Segment.prototype.initDirections=function(){if(this.directions!=null){return }this.chain.init();this.chain.addDirectionsRequest(this);this.chain.execute()};HD.road.Segment.prototype.chainInit=function(A){if(!this.chain.isPaused){this.clonedVias=HD.util.cloneObject(this.vias,true);this.clonedZoomCaches=HD.util.cloneObject(this.zoomCaches)}this.chain.viaId=A};HD.road.Segment.prototype.chainSuccess=function(){delete this.clonedVias;delete this.clonedZoomCaches;delete this.chain.viaId};HD.road.Segment.prototype.chainFailure=function(B){this.vias=this.clonedVias;this.zoomCaches=this.clonedZoomCaches;delete this.clonedVias;delete this.clonedZoomCaches;var A;if(this.chain.viaId){A=this.getVia(this.chain.viaId);A.setLocation(A.latitude,A.longitude);delete this.chain.viaId}return A};HD.road.Segment.prototype.clearVias=function(){this.vias=new Array();delete this.clonedVias};HD.road.Stop=function(B,C){if(B){this.id=HD.util.IdGenerator.generateId();this.type=B}this.data=(C!=null)?C:{};this.data.id=!!this.data.id?this.data.id:this.id;this.visId=null;this.segmentOut=null;this.segmentIn=null;this.test=true;this.scope=null;this.negate=false;if(!!this.data.entityType){this.isDrag=false;this.skipBestFit=true;if(!!this.data.entityData&&!(this.data.entityData instanceof HD.road.Stop)){this.data.entityData=HD.road.DWR.javaEntityToStop(this.data.entityData);this.foundEntity(this.data.entityData,this.data.entityType)}}if(this.type==HD.road.constants._STOP_TYPES.EVENT&&!!this.data.dealer){if(!(this.data.dealer instanceof HD.road.Stop)){this.data.dealer=HD.road.DWR.javaFullDealerToStop(this.data)}if(this.data.dealer instanceof HD.road.Stop){this.foundEntity(this.data.dealer,HD.rp.constants._POI_TYPES.DEALER)}}if((this.type==HD.road.constants._STOP_TYPES.DEALER||this.type==HD.road.constants._STOP_TYPES.EVENT)&&!!this.data.events&&this.data.events.length>0){for(var A=0;A<this.data.events.length;A++){if(!(this.data.events[A] instanceof HD.road.Stop)){this.data.events[A]=HD.road.DWR.javaEntityToStop(this.data.events[A]);if(this.type==HD.road.constants._STOP_TYPES.DEALER){this.data.events[A].data.dealer=this}}if(this.data.events[A] instanceof HD.road.Stop){this.foundEntity(this.data.events[A],HD.rp.constants._POI_TYPES.EVENT)}}}};HD.road.Stop.prototype.get=function(A){return null};HD.road.Stop.prototype.is=function(C){var B=function(D,F){for(var E=0;E<D.length;E++){if(F==(typeof D[E]=="string"?HD.road.constants._STOP_TYPES[D[E].toUpperCase()]:D[E])){return true}}return false};var A=!this.scope?B(arguments,this.type):this.is.apply(this.scope,arguments).end();this.test=this.test&&!!C&&(!this.negate?A:!A);this.negate=false;return this};HD.road.Stop.prototype.has=function(B){var A=!this.scope?this.check(B):this.check.apply(this.scope,arguments);this.test=this.test&&!!B&&(!this.negate?A:!A);this.negate=false;return this};HD.road.Stop.prototype.not=function(){this.negate=true;return this};HD.road.Stop.prototype.check=function(A){return !!A&&!this.scope?(A=="road"?!!this.isStatic:A=="events"?!!this.data.events&&this.data.events.length>=(arguments[1]||1):A=="dealer"?this.check("events")&&!!this.data.events[0].data.dealer&&this.latitude==this.data.events[0].data.dealer.latitude&&this.longitude==this.data.events[0].data.dealer.longitude:(typeof this[A]!="undefined"&&!!this[A])||(typeof this.data[A]!="undefined"&&!!this.data[A])):this.check.apply(this.scope,arguments)};HD.road.Stop.prototype.entity=function(A){this.scope=A||this.getEntity().data||null;this.test=this.test&&!!this.scope;return this};HD.road.Stop.prototype.end=function(){var A=this.test;this.test=true;this.scope=null;this.negate=false;return A};HD.road.Stop.prototype.setLocation=function(C,B,A){this.latitude=C;this.longitude=B;this.address=A;delete this.point};HD.road.Stop.prototype.setPoint=function(B,A){if(this.type==HD.road.constants._STOP_TYPES.STOP){this.point=HD.DWR.formatPoint(new HD.road.Waypoint(B,A))}else{this.setLocation(B,A)}};HD.road.Stop.prototype.setAddress=function(A){this.point=A.toString()};HD.road.Stop.prototype.next=function(){return this.segmentOut};HD.road.Stop.prototype.prev=function(){return this.segmentIn};HD.road.Stop.prototype.nextStop=function(){return(!this.isEnd())?this.segmentOut.end:null};HD.road.Stop.prototype.prevStop=function(){return(!this.isStart())?this.segmentIn.start:null};HD.road.Stop.prototype.isStart=function(){return(this.segmentIn==null)};HD.road.Stop.prototype.isEnd=function(){return(this.segmentOut.end==null)};HD.road.Stop.prototype.getVisId=function(){if(this.visId){return this.visId}var A=1;var B=this;while((B=B.prevStop())!=null){++A}return A};HD.road.Stop.prototype.getLocation=function(){var B;if(this.address!=null){B=this.address.toString()}if(B==null||B.length<1){var A=new HD.road.Waypoint(this.latitude,this.longitude,HD.road.constants._POINT_SCALE);B=HD.DWR.formatPoint(A)}return B};HD.road.Stop.prototype.getLocationHTML=function(){var A;if(this.address!=null){A=this.address.toHTML()}if(A==null||A.length<1){A=this.getLocation()}return A};HD.road.Stop.prototype.getTitle=function(){var B;var A;if(this.address!=null){A=this.address.data.lineOne!=null?this.address.data.lineOne+" - ":"";A+=this.address.data.city!=null?this.address.data.city+", ":"";A+=this.address.data.stateCode!=null?this.address.data.stateCode:""}if(!!this.data.name){B=this.data.name}else{if(this.is("event").has("events").end()){B=this.getLocation()}else{if((A!=null)&&(A.length>1)){B=A}else{if(this.isStart()){B="Start Location"}else{if(this.isEnd()){B="End Location"}else{B="Location "+this.getVisId()}}}}}return B};HD.road.Stop.prototype.clearEntity=function(){this.data.entityData=null;this.data.entityType=null;this.data.entityObjectId=null};HD.road.Stop.prototype.getEntity=function(){return{data:!!this.data.entityData?this.data.entityData:(!!this.data.entityObjectId?this.get(HD.util.rtrim(this.data.entityObjectId))||false:false),id:!!this.data.entityObjectId?HD.util.rtrim(this.data.entityObjectId):false,type:!!this.data.entityType?HD.util.rtrim(this.data.entityType):false}};HD.road.Stop.prototype.foundEntity=function(){};HD.road.Stop.prototype.clone=function(B){var A=new HD.road.Stop();var C=A.id;HD.util.copyObject(this,A);if(!!B){A.id=HD.util.IdGenerator.generateId()}A.segmentIn=null;A.segmentOut=null;return A};HD.road.Stop.prototype.getVELatLong=function(){return new VELatLong(parseFloat(this.latitude),parseFloat(this.longitude))};HD.road.Stop.prototype.toString=function(){return"stop: "+this.id};HD.road.Waypoint=function(C,A,B){if(B){C=parseFloat(C).toFixed(B);A=parseFloat(A).toFixed(B)}this.latitude=parseFloat(C);this.longitude=parseFloat(A)};HD.road.Waypoint.prototype.getLatitude=function(){return parseFloat(this.latitude)};HD.road.Waypoint.prototype.getLongitude=function(){return parseFloat(this.longitude)};HD.road.Waypoint.prototype.getVELatLong=function(){var C=this.latitude;var A=this.longitude;if((C!=null)&&(A!=null)){var B=new VELatLong(parseFloat(C),parseFloat(A));return B}return null};HD.road.Waypoint.prototype.isSamePoint=function(A){return((this.latitude==A.latitude)&&(this.longitude==A.longitude))};HD.road.StopList=function(){this.start=null;this.end=null;var B=this;var A=new HD.road.EventManager();var C=new HD.road.RequestChain(A);C.init=function(D){B.chainInit.call(B,D)};C.success=function(){B.chainSuccess.call(B)};C.failure=function(D){B.chainFailure.call(B,D)};this.chain=C};HD.road.StopList.prototype.attachEvent=function(A,B){this.chain.eventManager.registerEvent(A,B)};HD.road.StopList.prototype.detachEvents=function(A,B){this.chain.eventManager.unregisterEvents()};HD.road.StopList.prototype.get=function(C){if(this.isEmpty()){return null}var B=this.start;while(B!=null){if(B.id==C){break}if(B instanceof HD.road.Segment){var A=B.getVia(C);if(A!=null){B=A;break}}B=B.next()}return B};HD.road.StopList.prototype.getVia=function(C){if(this.isEmpty()){return null}var B=this.start.segmentOut;var A;while(B!=null){A=B.getVia(C);if(A!=null){break}B=B.nextSegment()}return A};HD.road.StopList.prototype.getStop=function(E,A){if(this.isEmpty()){return null}var D=this.start;while(D!=null){if(D.id==E){break}D=D.nextStop()}if(!!A){if(D==null&&!!this.start){var B=this.start.next();while(B!=null){for(var C=0;C<B.vias.length;C++){if(B.vias[C].id==E){D={via:B.vias[C],segment:B};break}}B=B.nextSegment()}}}return D};HD.road.StopList.prototype.getSegment=function(D){if(this.isEmpty()){return null}var C=this.start.segmentOut;var A,B;while(C!=null){if(C.id==D||C.getVia(D)!=null){return C}B=C.getPointList();if(B!=null){A=B.start.segmentOut;while(A!=null){if(A.id==D){return A}A=A.nextSegment()}}C=C.nextSegment()}};HD.road.StopList.prototype.addStopList=function(A){this.chain.init();if(this.start==null){this.start=A.start;this.end=A.end}else{this.end.segmentOut.setEnd(A.start);this.chain.addGeocodeRequest(this.end);this.chain.addRouteRequest(this.end.segmentOut)}var B=A.start;while(B!=null){if((B instanceof HD.road.Segment)&&!(B.isEmpty())){this.chain.addEvent(HD.road.constants._EVENT.SEGMENT_UPDATED,B)}else{this.chain.addEvent(HD.road.constants._EVENT.STOP_UPDATED,B)}B=B.next()}this.end=A.end;A.start=null;A.end=null;this.chain.execute()};HD.road.StopList.prototype.addSegment=function(F,E,A,C){var B=new HD.road.Segment(F,E,A,C,this.chain.eventManager);if(this.start==null){this.start=B.start}else{if(this.end!=B.start){return }}if(B.end!=null){this.end=B.end;var D=new HD.road.Segment(B.end,null,null,null,this.chain.eventManager)}return B};HD.road.StopList.prototype.addStopAfter=function(G,A,B,J){this.chain.init();var F=null,C=null,H=null;if(this.start==null){this.start=G;this.chain.addGeocodeRequest(G);F=new HD.road.Segment(G,((J!=null)?J:null),null,null,this.chain.eventManager)}else{if(A){C=this.getStop(A,true);if(!!C&&!!C.via){H=C.segment;C=C.via}}else{C=this.end}var I=null;if(!!H){var K=null;for(var E=0;E<H.vias.length;E++){if(H.vias[E].id==C.id){K=H.vias.splice(E+1);break}}I=H.end||null;H.setEnd(G);J=K.concat(J||[])}else{I=C.nextStop();C.segmentOut.setEnd(G)}if(B){C.segmentOut.vias=new Array()}var D=new HD.road.Segment(G,((J!=null)?J:null),I,null,this.chain.eventManager);this.chain.addGeocodeRequest(G);if(!H){this.chain.addRouteRequest(C.segmentOut)}else{this.chain.addRouteRequest(H)}if((I!=null)||(D.vias.length>0)){this.chain.addRouteRequest(D)}}if(G.isEnd()){this.end=G}if(!this.chain.isPaused){this.notifyAfterStop(!H?C:G)}this.chain.execute()};HD.road.StopList.prototype.addStopBefore=function(C,F,B,E){if(this.start==null){this.addStopAfter(C,null,B,E)}else{var A;if(F){A=this.getStop(F)}else{A=this.start}var G=(A!=null)?A.prevStop():null;if(G!=null){this.addStopAfter(C,G.id,B,E)}else{this.chain.init();var D=new HD.road.Segment(C,((E!=null)?E:null),A,null,this.chain.eventManager);this.chain.addGeocodeRequest(C);this.chain.addRouteRequest(D);if(C.isStart()){this.start=C}if(!this.chain.isPaused){this.notifyAfterStop(C)}this.chain.execute()}}};HD.road.StopList.prototype.removeStop=function(F){this.chain.init();var C=this.getStop(F);if(C.isStart()){this.start=C.nextStop()}if(C.isEnd()){this.end=C.prevStop()}var A=C.segmentOut;var B=C.segmentIn;var D=C.nextStop();var E=C.prevStop();A.setStart(null);A.setEnd(null);this.chain.addEvent(HD.road.constants._EVENT.SEGMENT_REMOVED,A);this.chain.addEvent(HD.road.constants._EVENT.STOP_REMOVED,C);if(B!=null){B.setEnd(D);B.vias=B.vias.concat(A.vias);this.chain.addRouteRequest(B)}if(!this.chain.isPaused){this.notifyAfterStop(E)}this.chain.execute();return C};HD.road.StopList.prototype.moveStopAfter=function(D,C){var B=this.getStop(D);this.chain.init();this.chain.pause();this.removeStop(D);this.addStopAfter(B,C,true);var A=this.getStop(C);this.notifyAfterStop((B.getVisId()<A.getVisId())?B:A.prevStop());this.chain.unpause();this.chain.execute()};HD.road.StopList.prototype.moveStopBefore=function(D,C){var B=this.getStop(D);this.chain.init();this.chain.pause();this.removeStop(D);this.addStopBefore(B,C,true);var A=this.getStop(C);this.notifyAfterStop((B.getVisId()<A.getVisId())?B:A);this.chain.unpause();this.chain.execute()};HD.road.StopList.prototype.convertViaToStop=function(F){this.chain.init();this.chain.pause();var E=this.getSegment(F);var B=E.indexOfVia(F);var D=E.vias.splice(B,(E.vias.length-B));var A=D.shift();var C=new HD.road.Stop(HD.road.constants._STOP_TYPES.STOP);C.skipBestFit=true;C.setPoint(A.latitude,A.longitude);this.addStopAfter(C,E.start.id);C.segmentOut.vias=D;this.notifyAfterStop(this.getStop(E.start.id));this.chain.unpause();this.chain.execute()};HD.road.StopList.prototype.convertStopToVia=function(F){this.chain.init();this.chain.pause();var D=this.getStop(F);var C=D.segmentIn;var A=D.segmentOut;var E=(!!A.vias&&A.vias.length>0)?A.vias[0].id:null;var B=new HD.road.Stop(HD.road.constants._STOP_TYPES.VIA);B.skipBestFit=true;B.setPoint(D.latitude,D.longitude);this.removeStop(F);C.addViaBefore(B,E);this.notifyAfterStop(this.getStop(C.start.id));this.chain.unpause();this.chain.execute()};HD.road.StopList.prototype.reroute=function(B){this.chain.init(B);var A=this.getStop(B);this.chain.addGeocodeRequest(A);if(A.segmentIn!=null){this.chain.addRouteRequest(A.segmentIn)}if(A.segmentOut!=null){this.chain.addRouteRequest(A.segmentOut)}this.chain.execute()};HD.road.StopList.prototype.reverse=function(){var C=this.end;var A;var B;this.chain.init();this.chain.pause();this.clear();while(C!=null){A=new HD.road.Stop(C.type,C.data);A.setLocation(C.latitude,C.longitude,C.address);this.addStopAfter(A,null);C=C.prevStop()}this.chain.unpause();this.chain.execute()};HD.road.StopList.prototype.clone=function(E){var B=new HD.road.StopList();var A=B.chain.eventManager;A.registerEvents(this.chain.eventManager);if(this.isEmpty()){return B}var C=this.start.segmentOut.nextSegment();var D=this.start.segmentOut.clone(E,A);var F;B.start=D.start;while(C!=null){F=D.end;D=C.clone(E,A,F);C=C.nextSegment()}B.end=D.start;return B};HD.road.StopList.prototype.clear=function(){this.chain.init();var A=this.end.segmentOut;while(A!=null){if(A instanceof HD.road.Stop){this.chain.addEvent(HD.road.constants._EVENT.STOP_REMOVED,A)}else{this.chain.addEvent(HD.road.constants._EVENT.SEGMENT_REMOVED,A)}A=A.prev()}this.chain.execute();this.start=this.end=null};HD.road.StopList.prototype.isEmpty=function(){return(this.start==null)};HD.road.StopList.prototype.getStopCount=function(){return(!this.isEmpty())?this.end.getVisId():0};HD.road.StopList.prototype.notifyAfterStop=function(B){var C=this.start;var A=(B==null);while(C!=null){if(!A){A=(C==B)}else{if(!this.chain.containsEvent(HD.road.constants._EVENT.STOP_UPDATED,C)){this.chain.addEvent(HD.road.constants._EVENT.STOP_UPDATED,C)}}C=C.nextStop()}};HD.road.StopList.prototype.chainInit=function(A){if(!this.chain.isPaused){this.clonedList=this.clone()}this.chain.stopId=A};HD.road.StopList.prototype.chainSuccess=function(){delete this.clonedList;delete this.chain.stopId};HD.road.StopList.prototype.chainFailure=function(B){this.start=this.clonedList.start;this.end=this.clonedList.end;delete this.clonedList;var A;if(this.chain.stopId){A=this.getStop(this.chain.stopId);A.setLocation(A.latitude,A.longitude,A.address);delete this.chain.stopId}return A};HD.road.DWR={decodePolyline:function(C,Q){var J=C.encodedLevels;var G=J.length;var F=[G];for(var T=0;T<G;T++){F[T]=J.charCodeAt(T)-63}var B=C.encodedPoints;var M=B.length;var H=0;var E=0;var V=0;var O=0;var L=[];var A;var U=0;while(H<M){var S;var N=0;var I=0;do{S=B.charCodeAt(H++)-63;I|=(S&31)<<N;N+=5}while(S>=32);var D=((I&1)?~(I>>1):(I>>1));E+=D;N=0;I=0;do{S=B.charCodeAt(H++)-63;I|=(S&31)<<N;N+=5}while(S>=32);var P=((I&1)?~(I>>1):(I>>1));V+=P;A=F[U++];if(A>=Q){L[O++]=new HD.road.Waypoint((E*0.00001),(V*0.00001))}}var K=C.start;L[0]=new HD.road.Waypoint(K.latitude,K.longitude);if((K=C.end)!=null){L[L.length-1]=new HD.road.Waypoint(K.latitude,K.longitude)}return L},waypointToWKTString:function(A){return A.longitude+" "+A.latitude},routeToWKTString:function(C,F){if(C==null||C.isEmpty()){return }F=F||1;var H=new Array();var G=C.stopList.start;var E=G.segmentOut;if(E.isEmpty()){H.push(this.waypointToWKTString(G))}else{do{var D=E.getPoints(F);for(var B=0,A=D.length;B<A;B++){H.push(this.waypointToWKTString(D[B]))}E=E.nextSegment()}while(E!=null&&!E.isEmpty())}return H.join(",")},routeToJavaRoad:function(H){var E=H.getStart().segmentOut;var K=new Array();var D=new Array();var A;var J;var I;var C;var G=null;do{if(K.length==0){I=0;K.push(this.stopToJavaStop(E.start,false))}else{I=C}A=E.vias;J=A.length;if(J>0){G=new Array(J);for(var F=0;F<A.length;F++){G[F]=K.length;K.push(this.stopToJavaStop(E.vias[F],true))}}C=K.length;K.push(this.stopToJavaStop(E.end,false));D.push(this.segmentToJavaSegment(E,I,G,C));G=null;E=E.nextSegment()}while(!E.isEmpty());var B=(H.data!=null)?HD.util.cloneObject(H.data):{};delete B.roadCharacteristics;delete B.stateCodes;B.stops=K;B.segments=D;return B},javaRoadToRoute:function(D){var M=new HD.road.Route(D);var F=D.segments;if(F!=null){var E=M.stopList;var N=D.stops;var G;var J;var H;var L;var A;var B;var C;for(var K=0;K<F.length;K++){G=F[K];B=new Array();if(K==0){J=N[G.startIndex];A=this.javaStopToStop(J,false)}else{A=C}H=G.viaIndexes;if(H){L=H.length;for(var I=0;I<L;I++){J=N[H[I]];via=this.javaStopToStop(J,true);B.push(via)}}if(G.endIndex){J=N[G.endIndex];C=this.javaStopToStop(J,false)}else{C=null}this.javaSegmentToSegment(G,E,A,B,C)}delete D.segments;delete D.stops}return M},stopToJavaStop:function(A,C){var B=HD.util.cloneObject(A.data);B.point=HD.DWR.formatPoint(A);delete B.entityData;if(C){B.via=true}else{if(A.address!=null){B.address=HD.util.cloneObject(A.address.data)}}return B},javaStopToStop:function(E,F){var D=(F)?HD.road.constants._STOP_TYPES.VIA:HD.road.constants._STOP_TYPES.STOP;var C=new HD.road.Stop(D,E);var B=null;if(E.address!=null){B=new HD.road.Address(E.address)}var A=HD.DWR.parsePoint(E.point,new HD.road.Waypoint());C.setLocation(A.latitude,A.longitude,B);delete E.address;delete E.point;return C},segmentToJavaSegment:function(B,E,A,C){var D=HD.util.cloneObject(B.data);D.startIndex=E;if(A!=null){D.viaIndexes=A}D.endIndex=C;D.encodedPoints=B.encodedPoints;D.encodedLevels=B.encodedLevels;return D},javaSegmentToSegment:function(E,B,F,D,A){var C=B.addSegment(F,D,A,E);C.encodedPoints=E.encodedPoints;C.encodedLevels=E.encodedLevels;delete E.encodedPoints;delete E.encodedLevels;delete E.startIndex;delete E.endIndex;delete E.viaIndexes;return C},javaEntityToStop:function(E){var A,C,D;if(typeof E.type=="undefined"&&!!E.events&&E.events.length>0){A=new HD.road.Address();A.data.lineOne=E.startAddress;A.data.lineTwo="";A.data.city=E.startCity;A.data.stateCode=E.startState;A.data.postalCode=HD.util.rtrim(E.startZip);A.data.country=E.startCountry;E.type="e";E.name=E.startName;delete E.startAddress;delete E.startCity;delete E.startCounty;delete E.startName;delete E.startState;delete E.startZip;C=new HD.road.Stop(HD.road.constants._STOP_TYPES.EVENT,E);C.setLocation(E.latitude,E.longitude,A);C.fromEvents=true}else{if((typeof E.type=="undefined")&&!!(E.vendorCode=="BW")){A=new HD.road.Address();A.data.lineOne=E.address;A.data.city=E.city;A.data.stateCode=E.state;A.data.postalCode=E.postalCode;A.data.country=E.country;E.type="h";E.objectId=E.id;C=new HD.road.Stop(HD.road.constants._STOP_TYPES.HOTEL,E);C.setLocation(E.latitude,E.longitude,A)}else{if(typeof E.addressStart!="undefined"&&typeof E.addressEnd!="undefined"){D=HD.road.constants._STOP_TYPES.EVENT;A=new HD.road.Address();if(!!E.addressStart){A.data.lineOne=E.addressStart.lineOne||null;A.data.lineOne=E.addressStart.lineTwo||null;A.data.city=E.addressStart.city||null;A.data.stateCode=E.addressStart.stateCode||null;A.data.postalCode=E.addressStart.postalCode||null;A.data.country=E.addressStart.countryCode||null}this.setAndDelete(E,"objectId","detailKey");if(!!E.dealer){var B=HD.road.DWR.javaFullDealerToStop(E);if(!!B){E.dealer=B}}C=new HD.road.Stop(D,E);C.setLocation(E.latitude,E.longitude,A)}else{D=HD.road.constants._STOP_TYPES[HD.rp.constants._POI_TYPES[E.type.substring(0,1)]];A=new HD.road.Address();A.data.lineOne=E.addressLine1;A.data.lineTwo=E.addressLine2;A.data.city=E.city;A.data.stateCode=E.subdivision;A.data.postalCode=E.postalCode;A.data.country=E.country;C=new HD.road.Stop(D,E);C.setLocation(E.latitude,E.longitude,A)}}}return C},javaEntitiesToStops:function(E){var C=[];var F,B,G;if(E!=null){for(var A=0;A<E.length;A++){B=E[A];if(!!B.dealer){var D=HD.road.DWR.javaFullDealerToStop(B);if(!!D){B.dealer=D}}F=HD.road.DWR.javaEntityToStop(B);F.latLong=new VELatLong(parseFloat(F.latitude),parseFloat(F.longitude));C.push(F)}}return C},javaFullDealerToStop:function(B){if(B==null||B.dealer==null){return null}var A=B.dealer;A.type=HD.rp.constants._POI_TYPES.DEALER;this.setAndDelete(A,"dealerNumber","detailKey");this.setAndDelete(A,"dealerName","name");this.setAndDelete(A,"state","subdivision");this.setAndDelete(A,"addr1","addressLine1");this.setAndDelete(A,"addr2","addressLine2");return HD.road.DWR.javaEntityToStop(A)},setAndDelete:function(A,C,B){if(typeof A[B]=="undefined"||!A[B]){A[B]=A[C];delete A[C]}}};HD.road.RequestChain=function(A){var C=this;var B=new HD.RequestChain();B.success=function(){C.handleSuccess.call(C)};B.failure=function(D){C.handleFailure.call(C,D)};this.chain=B;this.events=new Array();this.eventManager=A;this.isPaused=false};HD.road.RequestChain.prototype.addEvent=function(A,B){this.events.push({event:A,obj:B})};HD.road.RequestChain.prototype.containsEvent=function(C,E){var D=this.events.length;var B;for(var A=0;A<D;A++){B=this.events[A];if((B.event==C)&&(B.obj==E)){return true}}return false};HD.road.RequestChain.prototype.addGeocodeRequest=function(A){this.addEvent(HD.road.constants._EVENT.STOP_UPDATED,A);this.chain.add(new HD.road.GeocodeRequest(A))};HD.road.RequestChain.prototype.addRouteRequest=function(A){this.addEvent(HD.road.constants._EVENT.SEGMENT_UPDATED,A);this.chain.add(new HD.road.RouteRequest(A))};HD.road.RequestChain.prototype.addDirectionsRequest=function(A){this.addEvent(HD.road.constants._EVENT.DIRECTIONS_UPDATED,A);this.chain.add(new HD.road.DirectionsRequest(A))};HD.road.RequestChain.prototype.pause=function(){this.isPaused=true};HD.road.RequestChain.prototype.unpause=function(){this.isPaused=false};HD.road.RequestChain.prototype.execute=function(){if(!this.isPaused){this.chain.execute()}};HD.road.RequestChain.prototype.handleSuccess=function(){if(this.success!=null){this.success()}var A;while(this.events.length>0){A=this.events.shift();this.eventManager.fireEvent(A.event,A.obj)}this.chain.clear()};HD.road.RequestChain.prototype.handleFailure=function(A){var B;if(this.failure!=null){B=this.failure(A)}this.eventManager.fireEvent(HD.road.constants._EVENT.ROUTING_FAILED,B);this.chain.clear();this.events.length=0};HD.road.GeocodeRequest=function(A){this.stop=A};HD.road.GeocodeRequest.prototype.execute=function(D){var C=this.stop;var A=C.point;if(A==null){D.requestSucceeded();return }var E={point:A};var B=this;GeocodeService.geocode(E,function(F){B.handleExecute.call(B,F,D)})};HD.road.GeocodeRequest.prototype.handleExecute=function(C,E){var D=this.stop;var F=C.points;var B;if(F==null){B=HD.DWR.parsePoint(D.point,new HD.road.Waypoint());if(B==null){E.requestFailed()}else{D.setLocation(B.latitude,B.longitude);E.requestSucceeded()}}else{B=HD.DWR.parsePoint(F[0],new HD.road.Waypoint());var A=new HD.road.Address(C.addresses[0]);D.setLocation(B.latitude,B.longitude,A);E.requestSucceeded()}};HD.road.RouteRequest=function(A){this.segment=A};HD.road.RouteRequest.prototype.execute=function(C){var E=this.segment;var G=E.start;var A=E.end;var F=E.vias;if((A==null)&&(F.length==0)){E.clear();C.requestSucceeded();return }var D={};D.startPoint=HD.DWR.formatPoint(G);if(A!=null){D.endPoint=HD.DWR.formatPoint(A)}if(F.length>0){D.viaPoints=HD.DWR.formatPoints(F)}D.preference=E.data.routePreference||HD.road.RouteContext.routePreference;D.providePoints=true;D.provideDirections=true;var B=this;RoadService.determineRoute(D,function(H){B.handleExecute.call(B,H,C)})};HD.road.RouteRequest.prototype.handleExecute=function(B,D){var E=this.segment;var G=E.start;var A=E.end;var F=E.vias;var C;if(B.encodedPoints!=null){E.clear();E.encodedPoints=B.encodedPoints;E.encodedLevels=B.encodedLevels}else{D.requestFailed();return }E.data.routePreference=E.data.routePreference||HD.road.RouteContext.routePreference;if(B.handle){E.data.handle=B.handle}E.data.distance=B.distance;E.data.duration=B.duration;if(B.directions){E.directions=B.directions}D.requestSucceeded()};HD.road.DirectionsRequest=function(A){this.segment=A};HD.road.DirectionsRequest.prototype.execute=function(C){var E=this.segment;var G=E.start;var A=E.end;var F=E.vias;var D={};D.startPoint=HD.DWR.formatPoint(G);if(A!=null){D.endPoint=HD.DWR.formatPoint(A)}if(F.length>0){D.viaPoints=HD.DWR.formatPoints(F)}D.preference=E.data.routePreference||HD.road.RouteContext.routePreference;D.providePoints=false;D.provideDirections=true;var B=this;RoadService.determineRoute(D,function(H){B.handleExecute.call(B,H,C)})};HD.road.DirectionsRequest.prototype.handleExecute=function(A,B){var C=this.segment;if(A.handle){C.data.handle=A.handle}C.directions=A.directions;B.requestSucceeded()};HD.road.XML={xmlToRoutes:function(F,E){var G=F.getElementsByTagName("routes")[0];var B=G.getElementsByTagName("route");var D=new Array();for(var C=0,A=B.length;C<A;C++){D.push(B[C])}if(D.length!=1){alert("Unexpect number of routes returned "+D.length)}else{this.xmlToRoute(D[0],E)}},xmlToRoute:function(H,I){HD.rp.MapController.addLoadingIndicator();var M=new HD.road.Route();M.data.name=H.getAttribute("name");M.data.id=null;M.data.mappedRouteId=H.getAttribute("mappedRouteId");M.type=I;var N=[];var G={};var O=[];var K=H.firstChild;while(K!=null){if(K.nodeType==1){var L=K.nodeName;if(L=="stop"){var C=this.xmlToStop(K);N.push(C.stop);var A=C.eventId;if(HD.util.hasValue(A)){G[A]=C.stop;O.push(A)}}else{if(L=="segment"){N.push(this.xmlToSegment(K))}}}K=K.nextSibling}var D=M.stopList;for(var J=0,B=N.length;J+2<B;){var E=D.addSegment(N[J],null,N[J+2],null);var F=N[J+1];E.directions=F.directions;E.encodedPoints=F.encodedPoints;E.encodedLevels=F.encodedLevels;E.data.duration=F.duration;E.data.distance=F.distance;J=J+2}HD.rp.EventPanel.getEventsByObjectIds(O,function(S){for(var Q=0,P=S.length;Q<P;Q++){var V=S[Q];var U=V.data.detailKey;var T=G[U];T.address=V.address;T.data.entityData=V;T.data.entityType=HD.rp.constants._POI_TYPES.EVENT;T.data.detailKey=U}HD.rp.MapController.removeLoadingIndicator();HD.rp.MyRide.clearRide();HD.rp.MyRide.setAsMyRide(M)})},xmlToSegment:function(A){var J=A.getElementsByTagName("directions")[0];var D=J.getElementsByTagName("dir");var G=new Array();var C=0;var H=0;for(var I=0,F=D.length;I<F;I++){var K=D[I];var B=parseFloat(K.getAttribute("dist"));var E=parseInt(K.getAttribute("duration"),10);C+=B;H+=E;G[I]={text:K.getAttribute("dir"),distance:B,duration:E}}return{directions:G,encodedPoints:A.getAttribute("encodedPoints"),encodedLevels:A.getAttribute("encodedLevels"),distance:C,duration:H}},xmlToStop:function(D){var C=new HD.road.Stop(HD.road.constants._STOP_TYPES.STOP);var B=new HD.road.Address({lineOne:D.getAttribute("stopAddressLine1"),city:D.getAttribute("stopAddressCity"),stateCode:D.getAttribute("stopAddressState")});C.setLocation(D.getAttribute("lat"),D.getAttribute("lon"),B);var A=D.getElementsByTagName("notes");if(A!=null&&A.length>0){C.data.notes=A[0].text}return{stop:C,eventId:D.getAttribute("objectId")}}};HD.Map=function(A,D,B,C){this.mapDiv=A||"map";this.map=null;if(HD.util.EventController!=null&&typeof HD.util.EventController!="undefined"){this.events=HD.util.EventController.events(this)}this.latitude=D||37.71859;this.longitude=B||-96.679687;this.zoomLevel=C||4;this.mapStyle=VEMapStyle.Road;this.isMapFixed=false;this.is3DOn=false;this.controller=null;this.shouldUpdateZIndexes=true};HD.Map.prototype={init:function(){this.map=new VEMap(this.mapDiv);this.map.LoadMap(new VELatLong(this.latitude,this.longitude),this.zoomLevel,this.mapStyle,this.isMapFixed);this.map.HideDashboard();this.mapDiv=$(this.mapDiv);this.shadowLayer=document.createElement("div");this.shadowLayer.className="shadowLayer";this.mapDiv.firstChild.appendChild(this.shadowLayer);this.mapGraphicsStyle=this.mapDiv.firstChild.style;this.map.ClearInfoBoxStyles();this.map.ShowMessageBox=false;if(this.events!=null){var A=this.events.create("DrawEntities",this);var D=["DrawAll","DrawEntity"];for(var C=0;C<D.length;C++){this.map.m_vegraphicsmanager[D[C]]=A.inject(this.map.m_vegraphicsmanager[D[C]])}A.subscribe(this.updateZIndexes,this);A.subscribe(this.moveShadows,this);A.subscribe(function(){for(var G=0;G<this.map.GetShapeLayerCount();G++){var F=this.map.GetShapeLayerByIndex(G);var H=$(F.iid);if(!!H){var E=HD.rp.constants._LAYER_TYPE_CLASS[!!F.layerType?F.layerType:0];YAHOO.util.Dom.addClass(H,!!E?E:"")}}},this)}var B=this;this.attachEvent("onstartzoom",function(){B.hideShadows.call(B)});this.attachEvent("onendzoom",function(){B.showShadows.call(B)})},importShapeLayerData:function(A,C,B){this.map.ImportShapeLayerData(A,C,B)},addLargeControl:function(){if(this.controller){this.controller.remove()}this.controller=new HD.map.LargeMapControl(this)},addSmallControl:function(){if(this.controller){this.controller.remove()}this.controller=new HD.map.SmallMapControl(this)},addTracker:function(){if(!this.tracker){var C=this.map.mapelement;this.tracker=document.createElement("div");this.tracker.className="mapTracker";document.body.appendChild(this.tracker);var A=this;var B=YAHOO.util.Dom.getXY(this.map.mapelement);this.trackerFn=function(E){var D=A.map.PixelToLatLong(new VEPixel(E.pageX-B[0],E.pageY-B[1]));A.tracker.innerHTML=HD.util.template(HD.rp.HTML.mapTracker,{_XVAL:E.pageX-B[0],_YVAL:E.pageY-B[1],_LON:HD.util.Math.round(D.Longitude,5),_LAT:HD.util.Math.round(D.Latitude,5),_PROX:HD.util.Math.round(HD.util.Math.getDistanceBetweenLatLng(A.map.GetCenter(),D,"mi"),5)});A.tracker.style.left=(E.pageX)+"px";A.tracker.style.top=(E.pageY-A.tracker.offsetHeight)+"px"};YAHOO.util.Event.addListener(C,"mousemove",this.trackerFn);YAHOO.util.Event.addListener(this.tracker,"mousemove",this.trackerFn)}},removeTracker:function(){if(!!this.tracker){YAHOO.util.Event.removeListener(this.map.mapelement,"mousemove",this.trackerFn);YAHOO.util.Event.removeListener(this.tracker,"mousemove",this.trackerFn);this.tracker.parentNode.removeChild(this.tracker);this.tracker=null;this.trackerFn=null}},resize:function(C,A){var B=this.mapDiv.style;this.map.Resize(parseInt(B.width,10),parseInt(B.height,10))},getWidth:function(){return Math.round(this.getSEPixel().x)},getHeight:function(){return Math.round(this.getSEPixel().y)},getMapView:function(){return this.map.GetMapView()},getNW:function(){return this.map.GetMapView().TopLeftLatLong},getNWPoint:function(){var A=this.getNW();return new HD.road.Waypoint(A.Latitude,A.Longitude)},getNWPixel:function(){return this.latLongToXY(this.getNW())},getSE:function(){return this.map.GetMapView().BottomRightLatLong},getSEPoint:function(){var A=this.getSE();return new HD.road.Waypoint(A.Latitude,A.Longitude)},getSEPixel:function(){return this.latLongToXY(this.getSE())},xyToLatLong:function(A,B){return this.map.PixelToLatLong(new VEPixel(A,B))},latLongToXY:function(A){return this.map.LatLongToPixel(A)},calculateOffset:function(){return{x:HD.rp.constants._MAP_LEFT_TOP_X,y:HD.rp.constants._MAP_LEFT_TOP_Y}},getMouseXY:function(B){var C=this.calculateOffset();var A=B.clientX-parseInt(this.mapGraphicsStyle.left,10)-C.x;var D=B.clientY-parseInt(this.mapGraphicsStyle.top,10)-C.y;return{x:A,y:D}},find:function(A,B,D){var C=this;this.map.Find(null,A,null,null,0,B,false,false,false,false,function(G,F,E,H){C.handleFind.call(C,D,G,F,E,H)})},handleFind:function(E,P,B,L,A){var H=null;if(L!=null){var F=L.length;var J;var S;var K;var I;var C;var N;for(var O=0;O<F;O++){J=L[O];S=J.Name;var M=/ \[.+?\],/;S=S.replace(M,",");M=/^(.+?) \((.+?)\),/;match=S.match(M);if(match){var Q=match[2];if((Q=="county")||(Q=="river")){continue}}K=S.split(", ");I=K.length;C=new HD.road.Address();if(I==3){match=K[0].match(/^[0-9]/);if(match){C.data.lineOne=K[0];C.data.city=K[1];var D=K[2].split(" ");C.data.stateCode=D[0];C.data.postalCode=D[1]}else{C.data.city=K[0]+" ("+K[1]+")";C.data.stateCode=K[2]}C.data.countryName=K[3]}else{if(I==2){if(!(K[0].indexOf("-")==0||K[1].indexOf("-")==0)){match=K[0].match(/^[0-9]\S+/);if(match){C.data.postalCode=match[0];C.data.stateCode=K[1]}else{C.data.city=K[0];C.data.stateCode=K[1]}}C.data.countryName=K[2]}else{if(I==1){C.data.stateCode=K[0]}else{continue}}}if(C.data.stateCode.length!=2){var G=HD.util.convertToStateCode(C.data.stateCode);if(G!=null){C.data.stateCode=G}else{C.data.province=C.data.stateCode;delete C.data.stateCode}}if(H==null){H=new Array()}N=new HD.road.Stop(HD.road.constants._STOP_TYPES.STOP);N.setLocation(J.LatLong.Latitude,J.LatLong.Longitude,C);H.push(N)}}E(H)},startContinuousPan:function(A,B){this.map.StartContinuousPan(A,B)},endContinuousPan:function(){this.map.EndContinuousPan()},disableScrollWheelZoom:function(){this.map.AttachEvent("onmousewheel",function(){return true})},resetMap:function(){this.map.SetCenterAndZoom(new VELatLong(this.latitude,this.longitude),this.zoomLevel)},attachEvent:function(A,B){this.map.AttachEvent(A,B)},detachEvent:function(A,B){this.map.DetachEvent(A,B)},getShape:function(A){return A?this.map.GetShapeByID(A):null},getPushpinId:function(A){try{return A.Primitives[0].iid}catch(B){return null}},isPushpin:function(A){return A.GetType()==VEShapeType.Pushpin},isPolyline:function(A){return A.GetType()==VEShapeType.Polyline},setCenter:function(A){this.map.SetCenter(A)},setCenterAndZoom:function(G,B){if(G instanceof VELatLong&&typeof B=="number"){this.map.SetCenterAndZoom(G,B);return true}else{var C=G;var Q=!!B;var J=false;var U=C.data;var E=U.boundingPoint1;var D=U.boundingPoint2;var K=HD.DWR.parseVELatLong(U.midpoint||U.point);var H=HD.rp.hdMap.getZoomLevel();var F=null;if(E&&D){F=new VELatLongRectangle(HD.DWR.parseVELatLong(E),HD.DWR.parseVELatLong(D));if(Q){try{HD.rp.hdMap.setMapView(F)}catch(P){J=true}}}else{var A=C.getVELatLongs();if(Q){try{if(A){HD.rp.hdMap.setMapView(A)}else{J=true}}catch(P){J=true}}else{if(A){var V=[];for(var M=0;M<A.length;M++){V.push({latitude:A[M].Latitude,longitude:A[M].Longitude})}var L=HD.rp.hdMap.map.vemapcontrol.GetBestMapViewBounds(V);F=new VELatLongRectangle(new VELatLong(L[0],L[1]),new VELatLong(L[2],L[3]))}}}if(!!F&&!Q){var T={top:Math.abs(F.TopLeftLatLong.Latitude-K.Latitude),bottom:Math.abs(K.Latitude-F.BottomRightLatLong.Latitude),left:Math.abs(F.TopLeftLatLong.Longitude-K.Longitude),right:Math.abs(K.Longitude-F.BottomRightLatLong.Longitude)};var I=HD.rp.hdMap.map.GetMapView();var S={y:Math.abs(I.TopLeftLatLong.Latitude-I.BottomRightLatLong.Latitude)/2,x:Math.abs(I.TopLeftLatLong.Longitude-I.BottomRightLatLong.Longitude)/2};var N=function(){return T.top<=S.y&&T.bottom<=S.y&&T.left<=S.x&&T.right<=S.x};var O=N();while(H>=1&&H<=19){if((O&&N())||(!O&&!N())){S.x*=O?0.5:2;S.y*=O?0.5:2;H+=O?1:-1}else{H+=O?-1:0;break}}this.map.SetCenterAndZoom(K,H);return true}else{if(Q){return J}else{this.map.SetCenter(K);return false}}}},getCenter:function(){return this.map.GetCenter()},zoomToStreet:function(A){this.map.SetCenterAndZoom(A,16)},setMapView:function(A){this.map.SetMapView(A)},getZoomLevel:function(){return this.map.GetZoomLevel()},setZoomLevel:function(A){if(A>0&&A<20){try{return this.map.SetZoomLevel(A)}catch(B){}}},addShape:function(A){this.map.AddShape(A);A.domEl=$(A.Primitives[0].iid)},deleteShape:function(A){A.domEl=null;this.map.DeleteShape(A)},addShapeLayer:function(A){this.map.AddShapeLayer(A)},getMapStyle:function(){return this.map.GetMapStyle()},setMapStyle:function(A){this.map.SetMapStyle(A)},setMapMode:function(A){this.map.SetMapMode(A)},getMapMode:function(){return this.map.GetMapMode()},toggle3D:function(){this.is3DOn=!this.is3DOn;this.setMapMode(!this.is3DOn?VEMapMode.Mode2D:VEMapMode.Mode3D)},zoomIn:function(){var A=this.getZoomLevel();if(A==19){return }return this.setZoomLevel(this.getZoomLevel()+1)},zoomOut:function(){var A=this.getZoomLevel();if(A==0){return }return this.setZoomLevel(this.getZoomLevel()-1)},updateZIndexes:function(){if(!this.shouldUpdateZIndexes){return }for(var D=0;D<this.map.GetShapeLayerCount();D++){var C=this.map.GetShapeLayerByIndex(D);var B=C.layerType==HD.rp.constants._LAYER_TYPE.MY_RIDE;for(var A=0;A<C.GetShapeCount();A++){this.setPinZIndex(C.GetShapeByIndex(A),B)}}},zIndexFromLatLong:function(E,C){var A=this.map.LatLongToPixel(new VELatLong(E,C));if(A.x>=0&&A.y>=0){var D=Math.floor(A.y)+"";var B=(9999-Math.floor(A.x))+"";while(D.length<4){D="0"+D}while(B.length<4){B="0"+B}return D+B}else{return"0"}},setPinZIndex:function(A,B){if(A&&A.Type==VEShapeType.Pushpin){try{var C=$(A.Primitives[0].iid);if(!!C){var E=this.zIndexFromLatLong(A.Latitude,A.Longitude);if(!!B){E="8"+E.substr(1)}C.style.zIndex=E}}catch(D){}}},setPinOnTop:function(A){if(A&&A.Type==VEShapeType.Pushpin){try{var B=$(A.Primitives[0].iid);if(!!B){this.updateZIndexes();B.style.zIndex="99999999"}}catch(C){}}},createPushpin:function(A){return new VEShape(VEShapeType.Pushpin,A)},createPolyline:function(A){return new VEShape(VEShapeType.Polyline,A)},getVEPixels:function(D){if(D==null||D.length<1){return }var B=new Array();for(var A=0;A<D.length;A++){var C=this.latLongToXY(D[A]);B.push(C.x+" "+C.y)}return B},getTop:function(){return this.map.GetTop()},getLeft:function(){return this.map.GetLeft()},setStopsXY:function(C){var B=new Array();for(var A=0;A<C.length;A++){B.push(this.cloneAndSetStopXY(C[A]))}return B},cloneAndSetStopXY:function(A){var C=HD.util.cloneObject(A);var B=this.latLongToXY(C.latLong);C.x=Math.round(B.x);C.y=Math.round(B.y);delete C.latitude;delete C.longitude;delete C.latLong;delete C.getVisId;return C},shadowLayer:null,addPinShadow:function(A,B){this.removePinShadow(A);var C=HD.util.createElement(B);if(A.domEl&&A.domEl.style){C.style.left=A.domEl.style.left;C.style.top=A.domEl.style.top}this.shadowLayer.appendChild(C);C.pinId=A.Primitives[0].iid;A.shadowEl=C},removePinShadow:function(A){if(!!A.shadowEl){try{this.shadowLayer.removeChild(A.shadowEl)}catch(B){}}A.shadowEl=null},movePin:function(A,B){A.domEl.style.top=(B.y-11)+"px";A.domEl.style.left=(B.x)+"px";this.moveShadow(A)},moveShadow:function(A){if(!!A.shadowEl){A.shadowEl.style.left=A.domEl.style.left;A.shadowEl.style.top=A.domEl.style.top}},moveShadows:function(){var C=this.shadowLayer.firstChild;var A;var B="";while(C){A=$(C.pinId);if(!A){C.style.display="none"}else{C.style.display="block";C.style.left=A.style.left;C.style.top=A.style.top;C.style.zIndex="100"}C=C.nextSibling}},hideShadows:function(){this.shadowLayer.style.display="none"},showShadows:function(){this.shadowLayer.style.display="block"}};if(typeof HD.map=="undefined"){HD.map={}}HD.map.LargeMapControl=function(A){if(!A){return }this.mapObj=A;var E=document.createElement("div");E.className=HD.map.HTML.largeControl.viewsClass;E.innerHTML=HD.map.HTML.largeControl.viewsCode();document.body.appendChild(E);var C=document.createElement("div");C.className=HD.map.HTML.largeControl.linksClass;C.innerHTML=HD.map.HTML.largeControl.linksCode();document.body.appendChild(C);var B=document.createElement("div");B.className=HD.map.HTML.largeControl.controlsClass;B.innerHTML=HD.map.HTML.largeControl.controlsCode();document.body.appendChild(B);var G=YAHOO.util.Dom;var F=YAHOO.util.Event;var D=this;this.animateOpen=new YAHOO.util.Anim(G.generateId(E),{height:{to:E.offsetHeight-3}},0.5,YAHOO.util.Easing.easeOut);this.animateClose=new YAHOO.util.Anim(G.generateId(E),{height:{to:HD.map.HTML.largeControl.closedHeight}},0.5,YAHOO.util.Easing.easeOut);this.wrapper=E;this.sliderBg=G.getElementsByClassName(HD.map.HTML.largeControl.sliderBgClass,"div",B)[0];this.sliderMinus=G.getElementsByClassName(HD.map.HTML.largeControl.sliderMinusClass,"div",B)[0];this.sliderPlus=G.getElementsByClassName(HD.map.HTML.largeControl.sliderPlusClass,"div",B)[0];this.sliderThumb=G.getElementsByClassName(HD.map.HTML.largeControl.sliderThumbClass,"div",B)[0];this.panTools=G.getElementsByClassName(HD.map.HTML.largeControl.panToolClass,"div",B)[0];this.roadToggle=G.getElementsByClassName(HD.map.HTML.largeControl.roadClass,"div",E)[0];this.aerialToggle=G.getElementsByClassName(HD.map.HTML.largeControl.aerialClass,"div",E)[0];this.mixedToggle=G.getElementsByClassName(HD.map.HTML.largeControl.mixedClass,"div",E)[0];this.threeDToggle=G.getElementsByClassName(HD.map.HTML.largeControl.threeDClass,"div",E)[0];this.flyThrough=G.getElementsByClassName(HD.map.HTML.largeControl.flyThroughClass,"div",E)[0];this.compass=new HD.map.Compass(this.panTools,A);F.addListener(this.roadToggle,"click",function(){A.setMapStyle(VEMapStyle.Road);HD.rp.util.Hitbox.track("Application/Map/View/Road")});F.addListener(this.aerialToggle,"click",function(){A.setMapStyle(VEMapStyle.Aerial);HD.rp.util.Hitbox.track("Application/Map/View/Aerial")});F.addListener(this.mixedToggle,"click",function(){A.setMapStyle(VEMapStyle.Hybrid);HD.rp.util.Hitbox.track("Application/Map/View/Mixed")});F.addListener(this.threeDToggle,"click",function(){A.toggle3D();D.setMapViewDisplay.call(D)});F.addListener(this.flyThrough,"click",function(){HD.rp.ThreeD.flyThrough();D.setMapViewDisplay.call(D)});F.addListener(this.sliderMinus,"click",function(){A.zoomOut()});F.addListener(this.sliderPlus,"click",function(){A.zoomIn()});this.mapSlider=new YAHOO.widget.Slider.getVertSlider(G.generateId(this.sliderBg,"slider_"),G.generateId(this.sliderThumb,"slider_"),63,105,9);this.setZoomDisplay(A.getZoomLevel());this.mapSlider.onSlideEnd=function(){D.setZoomFromSlider()};if(HD.util.getRequestParam(HD.rp.constants._REQUEST_PARAMS.MODE_3D)){this.threeDToggle.style.display="block";this.flyThrough.style.display="block"}A.attachEvent("onchangemapstyle",function(){D.setMapViewDisplay()});this.setMapViewDisplay()};HD.map.LargeMapControl.prototype={setZoomDisplay:function(A){this.mapSlider.setValue(this.convertToSliderZoom(A),true,true)},setZoomFromSlider:function(){var A=this.convertToMapZoom(this.mapSlider.getValue());this.mapObj.setZoomLevel(A)},convertToMapZoom:function(A){return(((-(1/9))*A)+12)},convertToSliderZoom:function(A){return((-9)*(A-12))},setMapViewDisplay:function(){YAHOO.util.Dom.removeClass(this.roadToggle,"s");YAHOO.util.Dom.removeClass(this.aerialToggle,"s");YAHOO.util.Dom.removeClass(this.mixedToggle,"s");YAHOO.util.Dom.removeClass(this.threeDToggle,"s");YAHOO.util.Dom.removeClass(this.flyThrough,"s");switch(this.mapObj.getMapStyle()){case VEMapStyle.Road:YAHOO.util.Dom.addClass(this.roadToggle,"s");break;case VEMapStyle.Aerial:YAHOO.util.Dom.addClass(this.aerialToggle,"s");break;case VEMapStyle.Hybrid:YAHOO.util.Dom.addClass(this.mixedToggle,"s");break;default:break}if(this.mapObj.is3DOn){YAHOO.util.Dom.addClass(this.threeDToggle,"s")}if(HD.rp.ThreeD.isOn){YAHOO.util.Dom.addClass(this.flyThrough,"s")}}};HD.map.SmallMapControl=function(A){if(!A){return }this.zoomInEl=HD.util.createElement(HD.map.HTML.smallControl.zoomIn);this.zoomOutEl=HD.util.createElement(HD.map.HTML.smallControl.zoomOut);this.wrapper=document.createElement("div");this.wrapper.className=HD.map.HTML.smallControl.wrapperClass;this.wrapper.appendChild(this.zoomInEl);this.wrapper.appendChild(this.zoomOutEl);A.mapDiv.appendChild(this.wrapper);YAHOO.util.Event.addListener(this.zoomOutEl,"click",function(){A.zoomOut()});YAHOO.util.Event.addListener(this.zoomInEl,"click",function(){A.zoomIn()})};if(typeof HD.map=="undefined"){HD.map={}}HD.map.Constants={CONTROLLER:{LARGE:"large",SMALL:"small"}};HD.map.Text={aerial:"Aerial",linkToPage:"Link to this page",mapTools:"Map Tools",mixed:"Mixed",print:"Print this view",road:"Road",sendInEmail:"Send in e-mail",threeD:"3D",flyThrough:"Fly through",gps:"GPS Synchronization",tooltips:{aerial:"Show aerial imagery",minus:"Zoom out",mixed:"Show imagery and road map",plus:"Zoom in",road:"Show road map",slider:"Slide to zoom"}};HD.map.HTML={pinShadow:'<div class="pinShadow"></div>',largeControl:{mapViewStyle:"mapViewStyle",closedHeight:15,roadClass:"roadStyle",aerialClass:"aerialStyle",mixedClass:"mixedStyle",threeDClass:"3dMode",flyThroughClass:"flyThrough",closeClass:"x",compassClass:"compassoff",sliderPlusClass:"plus",sliderMinusClass:"minus",sliderBgClass:"sliderbg",sliderThumbClass:"sliderthumb",panToolClass:"panTool",viewsClass:"roadViews",linksClass:"roadLinks",controlsClass:"roadControls",backgroundClass:"background",controlsCode:function(){return'<div class="'+this.backgroundClass+'"></div><div class="'+this.panToolClass+'"><div><div id="panUp" title="Pan up" class="panUp"></div><div id="panLeft" title="Pan left" class="panLeft"></div><div id="resetMap" title="Reset map" class="resetMap"></div><div id="panRight" title="Pan right" class="panRight"></div><div id="panDown" title="Pan down" class="panDown"></div></div></div><div id="zoomIn" class="'+this.sliderPlusClass+'" title="'+HD.map.Text.tooltips.plus+'"></div><div class="'+this.sliderBgClass+'"><div class="'+this.sliderThumbClass+'" title="'+HD.map.Text.tooltips.slider+'"></div></div><div id="zoomOut" class="'+this.sliderMinusClass+'" title="'+HD.map.Text.tooltips.minus+'"></div>'},linksCode:function(){return'<div class="gpsSync" onclick="HD.rp.dialog.GPS.show();"><div>'+HD.map.Text.gps+"</div></div>"},viewsCode:function(){return'<div id="'+this.roadClass+'" class="'+this.roadClass+' mapViewStyle" title="'+HD.map.Text.tooltips.road+'"><div>'+HD.map.Text.road+'</div></div><div id="'+this.aerialClass+'" class="'+this.aerialClass+' mapViewStyle" title="'+HD.map.Text.tooltips.aerial+'"><div>'+HD.map.Text.aerial+'</div></div><div id="'+this.mixedClass+'" class="'+this.mixedClass+' mapViewStyle" title="'+HD.map.Text.tooltips.mixed+'"><div>'+HD.map.Text.mixed+'</div></div><div id="'+this.threeDClass+'" class="'+this.threeDClass+' mapViewStyle" style="display:none"><div>'+HD.map.Text.threeD+'</div></div><div id="'+this.flyThroughClass+'" class="'+this.flyThroughClass+' mapViewStyle" style="display:none"><div>'+HD.map.Text.flyThrough+"</div></div>"}},smallControl:{wrapperClass:"smallMapControls",zoomOut:'<div class="zoomOut"></div>',zoomIn:'<div class="zoomIn"></div>'}};HD.map.Compass=function(A,C){this.element=A;this.compassRoll=this.element.firstChild;this.hdMap=C;this.panning=false;this.maxScrollSpeed=15;this.reset=false;var B=YAHOO.util.Event;var D=this;B.addListener();B.addListener(this.element,"mousedown",function(E){D.mouseDown.call(D,E||window.event)});B.addListener(this.element,"mousemove",function(E){D.mouseMove.call(D,E||window.event)});B.addListener(this.element,"mouseup",function(E){D.mouseUp.call(D,E||window.event)})};HD.map.Compass.prototype.mouseDown=function(A){if(this.element.setCapture){this.element.setCapture()}this.reset=false;this.Pan(A)};HD.map.Compass.prototype.mouseMove=function(A){if(this.panning){this.Pan(A)}};HD.map.Compass.prototype.mouseUp=function(){if(this.element.releaseCapture){this.element.releaseCapture()}this.panning=false;this.hdMap.endContinuousPan();this.compassRoll.className="";if(this.reset){this.hdMap.resetMap();this.reset=false}};HD.map.Compass.prototype.Pan=function(E){var B=YAHOO.util.Dom.getXY(this.element);var F=HD.util.getMouseXY(E);var D=F[0]-B[0]-(this.element.offsetWidth/2);var C=F[1]-B[1]-(this.element.offsetHeight/2);if(Math.abs(D)<10&&Math.abs(C)<10&&!this.panning){this.reset=true;if(this.compassRoll.className!="compassreset"){this.compassRoll.className="compassreset"}return }this.panning=true;var A=Math.atan2(C,D);if(Math.abs(A)<=(Math.PI/4)){if(this.compassRoll.className!="compassright"){this.compassRoll.className="compassright"}}else{if(A>(Math.PI/4)&&A<=(3*Math.PI/4)){if(this.compassRoll.className!="compassdown"){this.compassRoll.className="compassdown"}}else{if(Math.abs(A)>(3*Math.PI/4)){if(this.compassRoll.className!="compassleft"){this.compassRoll.className="compassleft"}}else{if(A<=((0-Math.PI)/4)&&A>(3*(0-Math.PI)/4)){if(this.compassRoll.className!="compassup"){this.compassRoll.className="compassup"}}}}}D=Math.round(Math.min(Math.max(D,-this.maxScrollSpeed),this.maxScrollSpeed));C=Math.round(Math.min(Math.max(C,-this.maxScrollSpeed),this.maxScrollSpeed));this.hdMap.startContinuousPan(D,C)};HD.map.LayerManager=function(E,D){this.hdMap=E;this.layers={};for(var B=0;B<D.length;B++){this.layers[D[B]]=this.createLayer(D[B]);var A=new VELatLong();A=this.hdMap.getCenter();var C=new VEShape(VEShapeType.Pushpin,A);this.layers[D[B]].AddShape(C);this.layers[D[B]].DeleteShape(C)}};HD.map.LayerManager.prototype={createLayer:function(B){var A=new VEShapeLayer();this.hdMap.addShapeLayer(A);A.layerType=B;return A},getLayer:function(B){var A=this.layers[B];return A||this.layers[HD.rp.constants._LAYER_TYPE.DEFAULT]},addShape:function(A,C,B){this.getLayer(C).AddShape(A);A.domEl=$(A.Primitives[0].iid);if(!!B){this.hdMap.addPinShadow(A,B)}},deleteShape:function(A,B){A.domEl=null;this.hdMap.removePinShadow(A);this.getLayer(B).DeleteShape(A)},deleteAllShapes:function(A){this.getLayer(A).DeleteAllShapes()},getLayerType:function(C){if(!C){return null}var A=HD.road.constants._STOP_TYPES;if(C.type==HD.road.constants._STOP_TYPES.STOP||C.type==HD.road.constants._STOP_TYPES.VIA){return HD.rp.constants._LAYER_TYPE.MY_RIDE}else{for(var B in A){if(A[B]==C.type&&!!HD.rp.constants._LAYER_TYPE[B]){return HD.rp.constants._LAYER_TYPE[B]}}return HD.rp.constants._LAYER_TYPE.DEFAULT}}};HD.rp={hdMap:null,mapDiv:"rpMap",accordian:null,showDetails:false,dwrMonitor:null,freezeStates:[],freezeLoader:null,loaderAnimations:new Array(),events:null,pageInit:function(){if(showDebug){var V=new YAHOO.Debugger()}HD.rp.constants._READ_ONLY=false;HD.rp.constants._NO_LOGIN=false;this.events=HD.util.EventController.events(this);this.DWR.init();HD.util.PageResizeHandler.addElementToResize("accordian",0,HD.rp.constants._MAP_LEFT_TOP_Y-6);HD.util.PageResizeHandler.addElementToResize("rpMap",HD.rp.constants._MAP_LEFT_TOP_X,HD.rp.constants._MAP_LEFT_TOP_Y);HD.util.PageResizeHandler.addElementToResize("freeze",HD.rp.constants._MAP_LEFT_TOP_X,HD.rp.constants._MAP_LEFT_TOP_Y);HD.util.PageResizeHandler.postResizeListener=function(){if(HD.util.isIE){var e=$("rpMap").style;e.width=(parseInt(e.width,10)-3)+"px"}if(!!HD.rp.accordian&&HD.rp.accordian instanceof HD.ui.Accordian){HD.rp.accordian.resize()}if(!!HD.rp.hdMap&&HD.rp.hdMap instanceof HD.Map){HD.rp.hdMap.resize()}};HD.util.PageResizeHandler.init();try{this.hdMap=new HD.Map(this.mapDiv,HD.util.getRequestParam(HD.rp.constants._REQUEST_PARAMS.LATITUDE),HD.util.getRequestParam(HD.rp.constants._REQUEST_PARAMS.LONGITUDE),HD.util.getRequestParam(HD.rp.constants._REQUEST_PARAMS.ZOOM_LEVEL))}catch(b){HD.ui.Dialog.showNotice(HD.rp.text.unsupportedBrowser,HD.rp.text.unsupportedBrowserFailedText,null,400,100);return }this.hdMap.init();this.hdMap.addLargeControl();this.mapDiv=$(this.mapDiv);this.MapController.init(HD.rp.hdMap);HD.road.Stop.prototype.foundEntity=function(e,f){if(e&&e instanceof HD.road.Stop){switch(HD.util.rtrim(f)){case HD.rp.constants._POI_TYPES.DEALER:case HD.rp.constants._POI_TYPES.HOTEL:case HD.rp.constants._POI_TYPES.EVENT:case HD.rp.constants._POI_TYPES.FUEL:HD.rp.Panel.addDataModel(HD.rp.DataItem.make(e));break}}};HD.road.RouteContext.setZoomLevel(this.hdMap.getZoomLevel());document.body.oncontextmenu=function(f){f=f||window.event;var g=!!f.target?f.target:!!f.srcElement?f.srcElement:null;if(!!g&&g.nodeType==3){g=g.parentNode}return(!!g&&!!g.nodeName.match(/^input$/i))};var O=this;this.dwrMonitor=new HD.util.DWRMonitor({EntityService:["findEntitiesInBox","findEntitiesAlongRoute"],EventsService:["getEventLocationsInBox","getEventsInBox"],HotelsService:["getHotelLocationsInBox","getHotelsInBox"],RoadService:["getBywaysInBox","getRoadsInBox","findRoadsInBox","findEnvIntersects","findIntersects"]});HD.rp.hdMap.map.AttachEvent("onchangeview",function(){O.dwrMonitor.kill();HD.rp.Panel.each(function(e){e.clearRequestQueue()})});var X=HD.rp.service.RoadManager.prototype.get;var S=HD.rp.service.RoadManager.prototype.handleGet;this.addFreezeState(function(){var e=false;HD.rp.Panel.each(function(f){e=e||f.isGetActive()});return e});HD.rp.service.RoadManager.prototype.get=function(j,g,e,f){HD.rp.freezeMap();X.apply(this,arguments)};HD.rp.service.RoadManager.prototype.handleGet=function(e,f){S.apply(this,arguments);HD.rp.unfreezeMap()};var K=HD.rp.service.RoadManager.prototype.find;var A=HD.rp.service.RoadManager.prototype.handleFind;this.addFreezeState(function(){var e=false;HD.rp.Panel.each(function(f){e=e||f.isFindActive()});return e});HD.rp.service.RoadManager.prototype.find=function(e){HD.rp.freezeMap();K.apply(this,arguments)};HD.rp.service.RoadManager.prototype.handleFind=function(e){A.apply(this,arguments);HD.rp.unfreezeMap()};var T=HD.rp.service.PointsList.prototype.getDataInBox;var P=HD.rp.service.PointsList.prototype.getDataAlongRoute;var D=HD.rp.service.PointsList.prototype.handleGetData;var c=HD.rp.service.PointsList.prototype.getEntityData;var L=HD.rp.service.PointsList.prototype.handleGetEntityData;this.addFreezeState(function(){var e=false;HD.rp.Panel.each(function(f){e=e||f.isActive()});return e});HD.rp.service.PointsList.prototype.getDataInBox=function(f,g){var e=T.apply(this,arguments);if(!!e){HD.rp.freezeMap()}return e};HD.rp.service.PointsList.prototype.getDataAlongRoute=function(f,g){var e=P.apply(this,arguments);if(!!e){HD.rp.freezeMap()}return e};HD.rp.service.PointsList.prototype.handleGetData=function(f,e){D.apply(this,arguments);HD.rp.unfreezeMap()};HD.rp.service.PointsList.prototype.getEntityData=function(f,g){var e=c.apply(this,arguments);if(!!e){HD.rp.freezeMap()}return e};HD.rp.service.PointsList.prototype.handleGetEntityData=function(f,e){L.apply(this,arguments);HD.rp.unfreezeMap()};this.addFreezeState(function(){return HD.rp.renderer.rideSegment.routing});var U=HD.User.handleGetCurrentUser;HD.User.handleGetCurrentUser=function(e){if(!!e&&!!e.user){HD.rp.util.Hitbox.track("Application/Signed+In")}return U.apply(this,arguments)};HD.rp.util.Hitbox.track("Application");HD.rp.util.Hitbox.track("Application/Map/View/Road");this.accordian=new HD.ui.Accordian("accordian",null,0);this.accordian.onOpenListener=function(g){HD.rp.setAccordianContents(g);HD.rp.setToggleIconClass(g);var l=$("rideAddLocationsBottom");var k=YAHOO.util.Dom;var j=YAHOO.util.Event;var e=k.getElementsByClassName("stopPin","div",l)[0];var p=k.getElementsByClassName("i","input",l)[0];if(HD.rp.MyRide.numStops>0){k.addClass(l,"hasStops");k.removeClass(e,"hidden");var f=HD.rp.MyRide.route.getStart();p.value=!!f?f.getLocation():"";var n=f.latitude||"";var o=f.longitude||"";j.addListener(e,"click",function(){HD.rp.MapController.centerOnPoint(n+" "+o)})}else{k.removeClass(l,"hasStops");k.addClass(e,"hidden");p.value="";HD.rp.MyRide.addressBlur(p);j.removeListener(e,"click")}};this.accordian.init();for(var J in HD.rp.constants._ACCORDIAN.TABS){if(HD.rp.constants._ACCORDIAN.TABS[J]!=HD.rp.constants._ACCORDIAN.TABS.MY_RIDE){this.accordian.hideTab(HD.rp.constants._ACCORDIAN.TABS[J])}}this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_TOP_CONTROL);this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_BOTTOM_CONTROL);this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_ADD_LOCATION);this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_SAVE_CONTROL);this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_PROMO);for(var H in HD.rp.constants._ACCORDIAN.TABS){if(HD.rp.constants._ACCORDIAN.TABS[H]!=HD.rp.constants._ACCORDIAN.TABS.MY_RIDE){this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC[H+"_TOP"]);this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC[H+"_BOTTOM"])}}var Z=$("showDetails");Z.checked=this.showDetails;var W=function(k,f){HD.rp.showDetails=this.checked;if(HD.rp.showDetails){YAHOO.util.Dom.addClass($("rideContent"),"showDetails");if(!f){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Notes/Show"))}var g=HD.rp.MyRide.route.stopList.start;while(!!g){if(g.type==HD.road.constants._STOP_TYPES.STOP){var j=YAHOO.util.Dom.getElementsByClassName("note","div",g.listEl)[0];HD.rp.renderer.NoteEditor.inject(j,g.data.notes)}g=g.next()}}else{YAHOO.util.Dom.removeClass($("rideContent"),"showDetails");if(!f){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Notes/Hide"))}}};YAHOO.util.Event.addListener(Z,"change",W);if(HD.util.isIE){YAHOO.util.Event.addListener(Z,"click",function(){this.blur()})}W.call(Z,null,true);var G=$("avoidHighways1");var E=$("avoidHighways2");G.checked=HD.road.RouteContext.isAvoidHighways();E.checked=HD.road.RouteContext.isAvoidHighways();var C=function(){$("avoidHighways1").checked=this.checked;$("avoidHighways2").checked=this.checked;if(this.checked){HD.rp.util.Hitbox.track("Application/My+Ride/Switch+Routing/Shortest/Global")}else{HD.rp.util.Hitbox.track("Application/My+Ride/Switch+Routing/Fastest/Global")}HD.road.RouteContext.setAvoidHighways(this.checked)};YAHOO.util.Event.addListener(G,"change",C);YAHOO.util.Event.addListener(E,"change",C);if(HD.util.isIE){YAHOO.util.Event.addListener(G,"click",function(){this.blur()});YAHOO.util.Event.addListener(E,"click",function(){this.blur()})}C.call(G);HD.ui.NoteEditor.prototype.content.html=HD.util.template(HD.rp.HTML.noteEditor.html,{_BASE:HD.ui.NoteEditor.prototype.content.html});HD.ui.NoteEditor.prototype.content.html_char_left=HD.util.template(HD.rp.HTML.noteEditor.htmlCharLeft,{_BASE:HD.ui.NoteEditor.prototype.content.html_char_left});HD.ui.DatePicker.prototype.content.weekdays_start=HD.rp.HTML.dateTime.weekdaysStart;HD.ui.DatePicker.prototype.content.html=HD.util.template(HD.rp.HTML.dateTime.htmlDatePicker,{_BASE:HD.ui.DatePicker.prototype.content.html});HD.ui.ImageGallery.prototype.content.defaultImage=HD.rp.URL.blankImage;this.hdMap.map.AttachEvent("onmousedown",HD.ui.Menu.checkMenu);this.MyRide.init();HD.rp.Panel.load(HD.rp.RoadsPanel);HD.rp.Panel.load(HD.rp.DealerPanel);HD.rp.Panel.load(HD.rp.HotelPanel);HD.rp.Panel.load(HD.rp.EventPanel);HD.rp.Panel.load(HD.rp.FuelPanel);YAHOO.util.Connect.asyncRequest("GET",RP_PATH+"/servlet/XDomain?targetUrl="+HD.rp.URL.welcomePage+"?locale=en_US&doHead=1",{success:function(e){HD.rp.dialog.WelcomeDialog.handleHead(e)}});HD.rp.Panel.load(HD.rp.FacilitiesPanel);this.WelcomeBox.init(true);var N=HD.rp.constants._LAYER_TYPE;var B=function(g){var e=-1;for(var f in g){if(g[f]>=e){e=g[f]+1}}return e};for(var M in HD.road.constants._STOP_TYPES){if(M!="STOP"&&M!="VIA"&&(/^[a-z]/i).test(M)&&!HD.rp.constants._LAYER_TYPE[M]){var F=B(HD.rp.constants._LAYER_TYPE);HD.rp.constants._LAYER_TYPE[M]=F;var Q=M.split("_");for(var Y=0;Y<Q.length;Y++){Q[Y]=HD.util.capitalize(Q[Y])}HD.rp.constants._LAYER_TYPE_CLASS[F]="layer"+Q.join("")}}var I=[N.DEFAULT];for(var d in N){if(d!="DEFAULT"&&d!="MY_RIDE"){I.push(N[d])}}I.push(N.MY_RIDE);this.layers=new HD.map.LayerManager(this.hdMap,I);this.setToggleIconClass();if(HD.map.Test!=null){HD.map.Test.init(HD.rp.hdMap)}this.loaderAnimations[0]=new YAHOO.util.Anim("pageLoader",{opacity:{to:0}},1,YAHOO.util.Easing.easeIn);this.loaderAnimations[0].onComplete.subscribe(function(){$("pageLoader").style.display="none"});if(USER_AGENT.indexOf("spoof")!=-1){HD.ui.Dialog.showNotice(HD.rp.text.unsupportedBrowser,HD.rp.text.unsupportedBrowserText,null,400,100)}if(!!HD.rp.constants._NO_LOGIN){HD.rp.setAsNoLogin()}if(!!HD.rp.constants._READ_ONLY){HD.rp.setAsReadOnly(true)}if(HD.util.getRequestParam(HD.rp.constants._REQUEST_PARAMS.SHOW_SAVED_ROADS)){HD.rp.User.loginPendingFor=HD.rp.User._LOGIN_PENDING_FOR.MYRIDES_PRELOGIN}setTimeout(function(){HD.rp.loaderAnimations[0].animate();var g=HD.util.getRequestParam(HD.rp.constants._REQUEST_PARAMS.ADDRESS1);var f=HD.util.getRequestParam(HD.rp.constants._REQUEST_PARAMS.ADDRESS2);if(!!g){if(!!f){HD.rp.MyRide.addressesFromURL=[unescape(f)]}HD.rp.MyRide.addressInput1.value=unescape(g);HD.rp.MyRide.addNewLocation(HD.rp.MyRide.addressInput1.value,HD.rp.MyRide.addressInput1,true,true)}var e=HD.util.getRequestParam(HD.rp.constants._REQUEST_PARAMS.MYRIDE_ID);var j=HD.util.getRequestParam(HD.rp.constants._REQUEST_PARAMS.USER_SUBMITTED)=="Y"?true:false;if(!!e){HD.rp.freezeMap();RoadService.getRoad({road:{id:e,userSubmitted:j}},function(l){HD.rp.unfreezeMap();var k=HD.road.DWR.javaRoadToRoute(l.road);HD.rp.MyRide.appendRoute(k)})}},100)},setAccordianContents:function(A){A=A||this.accordian.selectedTabIndex;var B=HD.rp.MyRide.route.stopList.getStopCount();if(A==HD.rp.constants._ACCORDIAN.TABS.MY_RIDE){HD.rp.MyRide.setAccordianElements();for(var D in HD.rp.constants._ACCORDIAN.TABS){if(HD.rp.constants._ACCORDIAN.TABS[D]!=HD.rp.constants._ACCORDIAN.TABS.MY_RIDE){this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC[D+"_TOP"]);this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC[D+"_BOTTOM"]);YAHOO.util.Dom.removeClass(HD.rp.hdMap.mapDiv,D.toLowerCase())}}}else{this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_TOP_CONTROL);this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_BOTTOM_CONTROL);this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_SAVE_CONTROL);this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_PROMO);if(B>1){this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_ADD_LOCATION)}else{this.accordian.showStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_ADD_LOCATION)}for(var C in HD.rp.constants._ACCORDIAN.TABS){if(A==HD.rp.constants._ACCORDIAN.TABS[C]){this.accordian.showStaticTab(HD.rp.constants._ACCORDIAN.STATIC[C+"_TOP"]);this.accordian.showStaticTab(HD.rp.constants._ACCORDIAN.STATIC[C+"_BOTTOM"]);YAHOO.util.Dom.addClass(HD.rp.hdMap.mapDiv,C.toLowerCase())}else{if(HD.rp.constants._ACCORDIAN.TABS[C]!=HD.rp.constants._ACCORDIAN.TABS.MY_RIDE){this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC[C+"_TOP"]);this.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC[C+"_BOTTOM"]);YAHOO.util.Dom.removeClass(HD.rp.hdMap.mapDiv,C.toLowerCase())}}}}},setToggleIconClass:function(A){A=A||this.accordian.selectedTabIndex;HD.rp.Panel.each(function(B){B.setToggleState(A)})},freezeMap:function(){if(HD.rp.constants._FREEZE_MAP){$("freeze").style.display="block"}else{if(this.freezeLoader){this.freezeLoader.remove()}this.freezeLoader=new HD.ui.LoadingIndicator(HD.rp.constants._FREEZE_MAP?$("freeze"):$("rpMap"),HD.rp.dialog.Text.loading+" ...")}},unfreezeMap:function(){for(var A=0;A<this.freezeStates.length;A++){if(this.freezeStates[A]()){return false}}if(HD.rp.constants._FREEZE_MAP){$("freeze").style.display="none"}else{if(this.freezeLoader){this.freezeLoader.remove()}this.freezeLoader=null}return true},addFreezeState:function(A){this.freezeStates.push(A)},reset:function(){HD.rp.MapMenu.hide();HD.ui.Dialog.showConfirm(HD.rp.text.startOver,HD.rp.text.startOverMessage,function(){HD.ui.Dialog.hide();HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Reset"));HD.rp.MyRide.clearRide();HD.rp.Panel.each(function(B){B.hideLocations()});HD.rp.Panel.each(function(B){B.hide()});var A=new HD.Map();HD.rp.hdMap.setCenterAndZoom(new VELatLong(A.latitude,A.longitude),A.zoomLevel)},280,95)},zoomOut:function(){this.hdMap.setZoomLevel(this.hdMap.getZoomLevel()-1)},zoomIn:function(){this.hdMap.setZoomLevel(this.hdMap.getZoomLevel()+1)},launchHelp:function(A){window.open(HD.rp.URL.help+(!!A?"#"+A:""),"","width=740,height=560,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,menubar=no,status=no")},setAsNoLogin:function(){var A=function(){HD.ui.Dialog.showNotice(HD.rp.text.noLoginMode,HD.rp.text.noLoginModeText,null,400,120)};A()},setAsReadOnly:function(A){var D=function(I){HD.ui.Dialog.showNotice(HD.rp.text.readOnlyMode,HD.rp.text.readOnlyModeText,typeof I=="function"?I:null,400,100)};var H=YAHOO.util.Dom;var F=YAHOO.util.Event;H.replaceClass($("rpSaveButton"),"btn","btnDisabled");F.removeListener($("rpSaveButton"),"click");F.addListener($("rpSaveButton"),"click",D);H.replaceClass($("rpEmailButton"),"btn","btnDisabled");F.removeListener($("rpEmailButton"),"click");F.addListener($("rpEmailButton"),"click",D);var B=function(){D(function(){HD.rp.dialog.RoadDetails.showDetails(HD.rp.dialog.RoadDetails.road)})};HD.rp.dialog.RoadDetails.showReviewForm=B;HD.rp.dialog.RoadDetails.submitReviewForm=B;HD.rp.dialog.RoadDetails.submitRating=B;var C=function(){D(function(){HD.rp.dialog.SaveDialog.show(HD.rp.dialog.SaveDialog.ride,HD.rp.dialog.SaveDialog.onComplete)})};var G=HD.rp.dialog.SaveDialog.show;HD.rp.dialog.SaveDialog.show=function(){G.apply(this,arguments);$("saveRoadButton").onclick=C;H.replaceClass($("saveRoadButton"),"btn","btnDisabled")};HD.rp.dialog.SaveDialog.saveRoad=C;var E=function(){D(function(){HD.rp.dialog.UserRoadList.init()})};HD.rp.dialog.UserRoadList.deleteUserRoad=E;HD.rp.dialog.UserRoadList.moveRoads=E;if(!A){D()}}};HD.rp.constants={_PAGE_SIZE:{POIS:10,ROADS:10,EVENTS:10,ROAD_DETAILS:10},_CUSTOM_CURSOR:{GRAB:"/grab.cur",GRABBING:"/grabbing.cur",GRAB_SHAPE:"/target.cur"},_ACCORDIAN:{TABS:{MY_RIDE:0},STATIC:{RIDE_TOP_CONTROL:0,RIDE_BOTTOM_CONTROL:1,RIDE_ADD_LOCATION:2,RIDE_SAVE_CONTROL:3,RIDE_PROMO:4}},_FIND_NUM_RESULTS:3,_MAX_USER_ROADS:50,_MAX_USER_ROADS_WARN:47,_MAP_LEFT_TOP_X:267,_MAP_LEFT_TOP_Y:90,_DATAMODEL_ID_ATTRIBUTE:"datamodel_id",_POINT_TYPE_ID_ATTRIBUTE:"point_type",_SEGMENT_END_ID_ATTRIBUTE:"segment_end",_SEGMENT_START_ATTRIBUTE:"segment_start",_SEGMENT_START_LAT_LONG_ATTRIBUTE:"segment_start_lat_long",_SEGMENT_END_LAT_LONG_ATTRIBUTE:"segment_end_lat_long",_SHOW_POLYLINE_ATTRIBUTE:"showPolyline",_SHOW_POLYLINE_OVERRIDE_ATTRIBUTE:"showPolylineOverride",_IS_DRAG_ENABLED:"is_drag_enabled",_PROXIMITY_ATTRIBUTE:"proximity",_VIS_ID_ATTRIBUTE:"visid",_PERMALINK_MY_RIDE_IMPORT:false,_STOP_RENAME:true,_POI_TYPES:{DEALER:"d",HOTEL:"h",EVENT:"e",FUEL:"g",FACILITY:"f",d:"DEALER",h:"HOTEL",e:"EVENT",g:"FUEL",f:"FACILITY"},_FACILITY_TYPES:{MUSEUM:"Museum",FACILITY:"Facility"},_CORRIDOR_WIDTH:{d:20,h:20,e:20,g:5},_HD_EVENT_TYPES:{HOG:"HOG",H_D:"H-D",DEALER:"DLR"},_HD_HOTEL_TYPES:{REGULAR:"REG",PREFERRED:"PFRD"},_EVENT_TYPE:{MOUSEOVER:"mouseover",CLICK:"click",CONTEXTMENU:"contextmenu"},_EVENT_ORIGINS:{STOP:HD.road.constants._STOP_TYPES.STOP,VIA:HD.road.constants._STOP_TYPES.VIA,DEALER:HD.road.constants._STOP_TYPES.DEALER,HOTEL:HD.road.constants._STOP_TYPES.HOTEL,EVENT:HD.road.constants._STOP_TYPES.EVENT,FUEL:HD.road.constants._STOP_TYPES.FUEL,MAP:11},_GEOMETRY_TYPE:{NONE:0,SEGMENTS:1,POINTS:2},_LAYER_TYPE:{DEFAULT:0,MY_RIDE:1},_LAYER_TYPE_CLASS:{0:"layerDefault",1:"layerMyRide"},_ELEMENT_IDS:{RP_TABLE:"rpTable"},_REQUEST_PARAMS:{SHOW_DEBUG:"showdebug",SHOW_HOTELS:"showHotels",SHOW_DEALERS:"showDealers",SHOW_EVENTS:"showEvents",SHOW_FUEL:"showFuel",SHOW_FACILITIES:"showFacilities",SHOW_GREAT_ROADS:"showGreatRoads",SHOW_USER_ROADS:"showUserRoads",SHOW_SAVED_ROADS:"showSavedRoads",PROMO:"promo",ADDRESS1:"address1",ADDRESS2:"address2",LATITUDE:"latitude",LONGITUDE:"longitude",ZOOM_LEVEL:"zoomLevel",MODE_3D:"mode3d",BYWAY_ID:"bywayId",ROAD_ID:"roadId",MYRIDE_ID:"myrideId",FLY_THROUGH:"flyThrough",USER_SUBMITTED:"userSubmitted"},_MIN_ZOOM_LEVELS:{HOTELS:10,DEALERS:10,EVENTS:10,GREAT_ROADS:1,USER_ROADS:5,ROAD_INTERSECTS:10,ROAD_PUSHPIN:1,ROAD_POLYLINE:7,ROAD_MIN:1,ROAD_LENGTH:500},_OVERVIEW_TABS:{OVERVIEW:0,REVIEWS:1,PHOTOS:2,PLACES_TO_VISIT:3,SAMPLE_ITINERARY:4,LOCAL_LINKS:5,REPORT_ABUSE:6,WRITE_A_REVIEW:7},_CHANGE_VIEW_DELAY:1500,_EVENT_SEARCH_DELAY:2000,_FREEZE_MAP:false,_READ_ONLY:false,_NO_LOGIN:false,_NO_PAGING_INDEX:0,_FIRST_PAGE_INDEX:1,_ZOOM_LEVELS:{STATE:7,ZIP:12,NON_MAJOR_CITY:12,MAJOR_CITIES:{Houston:{state:"TX",zoom:11},"San Francisco":{state:"CA",zoom:11},Phoenix:{state:"AZ",zoom:11},Tampa:{state:"FL",zoom:11},"New Orleans":{state:"LA",zoom:11},"San Antonio":{state:"TX",zoom:11},"New York":{state:"NY",zoom:11},"Los Angeles":{state:"CA",zoom:11},Chicago:{state:"IL",zoom:11},Dallas:{state:"TX",zoom:11},Philadelphia:{state:"PA",zoom:11},Miami:{state:"FL",zoom:11},Detroit:{state:"MI",zoom:11},Boston:{state:"MA",zoom:11},Seattle:{state:"WA",zoom:11},"San Diego":{state:"CA",zoom:11},Denver:{state:"CO",zoom:11},Portland:{state:"OR",zoom:11},Cleveland:{state:"OH",zoom:11},Milwaukee:{state:"WI",zoom:11},Jacksonville:{state:"FL",zoom:11},"Las Vegas":{state:"NV",zoom:11},Indianapolis:{state:"IN",zoom:11},Washington:{state:"DC",zoom:12},Atlanta:{state:"GA",zoom:12},Riverside:{state:"CA",zoom:12},Minneapolis:{state:"MN",zoom:12},"St. Louis":{state:"MO",zoom:12},Baltimore:{state:"MD",zoom:12},Pittsburgh:{state:"MD",zoom:12},Cincinnati:{state:"OH",zoom:12}},STREET:15},_ZOOM_LEVEL_MIN:1,_ZOOM_LEVEL_STREET:16,_SIMPLIFICATION_FACTOR:0.1};HD.rp.service={};HD.rp.renderer={};HD.register("rp","1.0");HD.rp.DWR={init:function(){var A=this;this.setDefaultErrorHandler();DWREngine.setWarningHandler(function(D,B,C){A.errorHandler.call(A,D,B,C,"warning")})},setTempErrorHandler:function(A){DWREngine.setErrorHandler(A)},setDefaultErrorHandler:function(){var A=this;DWREngine.setErrorHandler(function(D,B,C){A.errorHandler.call(A,D,B,C,"error")})},errorHandler:function(D,B,E,C){log("DWR ERROR: "+D+" \n"+HD.util.debugObject(B));C=C||"error";var A=(C=="error")?HD.rp.text.error:HD.rp.text.warning;if(HD.util.hasValue(B.javaClassName)){A=A+": "+HD.rp.text.genericErrorMessage}else{A=A+": "+HD.rp.text.connectionErrorMessage}HD.ui.LoadingIndicators.removeAll();setTimeout(function(){HD.ui.Dialog.showError(A)},"100");if(typeof E=="function"){E()}},getCallMetaData:function(D,B){var C=this;var A={callback:D,errorHandler:function(F,E){C.errorHandler.call(C,F,E,B)}};return A}};if(typeof dwr!="undefined"&&typeof dwr.engine!="undefined"){dwr.engine._getJSessionId=function(){var A=HD.rp.DWR.document;if(!A){var B=$("dwr");if(B){A=B.contentWindow||dwrFram.contentDocument;if(A.document){A=A.document}}else{A=document}HD.rp.DWR.document=A}var E=A.cookie.split(";");for(var D=0;D<E.length;D++){var C=E[D];while(C.charAt(0)==" "){C=C.substring(1,C.length)}if(C.indexOf(dwr.engine._sessionCookieName+"=")==0){return C.substring(dwr.engine._sessionCookieName.length+1,C.length)}}return""}}HD.User.setUserListener=function(){var A=null;if(HD.User.isLoggedIn){if(HD.rp.User.loginPendingFor==HD.rp.User._LOGIN_PENDING_FOR.SAVE){HD.rp.MyRide.saveRide()}else{if(HD.rp.User.loginPendingFor==HD.rp.User._LOGIN_PENDING_FOR.MYRIDES||HD.rp.User.loginPendingFor==HD.rp.User._LOGIN_PENDING_FOR.MYRIDES_PRELOGIN){A=HD.rp.User.loginPendingFor}else{if(HD.rp.User.loginPendingFor==HD.rp.User._LOGIN_PENDING_FOR.SENDROAD){HD.rp.MyRide.sendRoad(true)}}}HD.rp.User.loginPendingFor=null}else{if(HD.rp.User.loginPendingFor==HD.rp.User._LOGIN_PENDING_FOR.MYRIDES_PRELOGIN){HD.User.promptLogin()}}HD.rp.WelcomeBox.setMessage(A)};HD.User.showLogin=function(){window.open(loginURL,"","width=800,height=650,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,directories=no,status=no")};HD.rp.User={_LOGIN_PENDING_FOR:{SAVE:1,MYRIDES:2,LOGINLINK:3,SENDROAD:4,MYRIDES_PRELOGIN:5,1:"SAVE",2:"MYRIDES",3:"LOGINLINK",4:"SENDROAD",5:"MYRIDES_PRELOGIN"},_COUNT_TYPE:{RP:0,LEGACY:1},roadCounts:[0,0],loginPendingFor:null,loginPendingObject:null,getUserRoad:function(C,B,A){if(B==null){B=this}if(HD.ui.Dialog.isShown){HD.ui.Dialog.showLoading()}RoadService.getRoad({road:{id:C,userSubmitted:true}},function(D){B.handleGetUserRoad.call(B,D,A||false)})},handleGetUserRoad:function(B,C){HD.ui.LoadingIndicators.removeAll();if(!B.road){log("WARNING! FAILED TO FIND SAVED ROAD");return }var A=HD.road.DWR.javaRoadToRoute(B.road);A.doc=B.roadDoc;HD.util.rtrimObject(A.doc);HD.ui.Dialog.hide();if(!!C){HD.rp.dialog.SaveDialog.show(A)}else{HD.rp.MyRide.setAsMyRide(A)}}};HD.rp.cookie={skipWelcomeMessage:"skipWelcomeMessage5.28.2008",skipWelcomeDuration:new Date(new Date().setTime(new Date().getTime()+(1000*60*60*24*90)))};HD.rp.text={aHarleyDavidsonRider:"A Harley-Davidson Rider",abuseUserRoad1:"The Ride Planner relies on users to keep the database of the ride plans accurate and appropriate.",abuseUserRoad2:" to report abuse, errors, or other issues with this road.",abuseGreatRoad:"Byway information was obtained by permission from <a href='http://www.byways.org'>www.byways.org</a>.<br/>&copy; 2006 H-D, All rights reserved.",access:"This road is ",addAllLocationsToMyRide:"Add road to My Ride",addAllLocationsText:"The locations and waypoints of this road will be added to the end of the locations list in the My Ride panel.",addressInputError:"We could not find an address for the location that was entered.  Please check the address and try again.",agreeToTerms1:"By submitting this information I agree to all",agreeToTerms2:"terms &amp; conditions",blank:"",addLocationNoPlus:"Add Location",addNotes:"Add notes",addLocationToMyRide:"Add location to My Ride",addToLocations:"Add to locations",addToMyRide:"Add to My Ride",address:"Address",addressInputValue:"address, state, city or zip",addWaypointToMyRide:"Add waypoint to My Ride",averageRating:"Average Rating",addLocation:"+ Add location",addWaypoint:"+ Add waypoint",americasByway:"America's Byway",archivedDealer:"Archived Harley-Davidson Dealer",archivedEvent:"Archived Event",archivedFuel:"Archived Gas Station",archivedHotel:"Archived Hotel",avoidHighwaysLocation:"Avoid highways to this location",avoidHighwaysSegment:"Avoid highways for this segment",bestTimeToTravel:"Best time to travel",bookOnlineNow:"Book online now using special rates for H-D riders",bookHotelOnline:"Book using special rates for H-D riders",cancel:"Cancel",category:"Category",centerHere:"Center here",changeToLocation:"Change to location",changeToWaypoint:"Change to waypoint",checkAvailability:"Check availability",checkIn:"Check in",checkOut:"Check out",clear:"Clear",clearAllLocations:"Clear all locations",clearAllWaypoints:"Clear all waypoints",clearLocations:"Clear locations",clearLocationsMessage:"Are you sure that you want to clear your locations? This will clear your entire ride.",clickHere:"Click here",clickToHide:"Click to hide",clickToRename:"Click to rename",clickToShow:"Click to show",close:"Close",continueText:"Continue...",connectionErrorMessage:"A connection error has occurred. Please make sure you are connected to the Internet.<br /><br />If the problem persists, check your firewall settings.",createPersonalProfile:"Create Personal Profile",copyright:"Copyright",dateHasNotChanged:"Date has not been changed.",dateNotCreated:"Date has not been created.",defaultAjaxFailure:"There was a problem with your request.<br />Please try again later.",dealerTab:"Harley-Davidson Dealers",dealerToggle:"Harley-Davidson Dealerships",dealerWebsite:"Dealer's web site",deleteRide:"Delete ride plan",departure:"Departure",destination:"Destination",details:"View/Modify details",directions:"Directions",displayPrivateRoads:"display private roads",displayPublicRoads:"display public roads",distance:"Distance",distanceFromPrevious:"Distance from ",drivingDirections:"Driving Directions",duration:"Duration",editNote:"Edit Note",email:"Send in e-mail",end:"End",error:"Error",estimatedTime:"Est. time",estimatedTimeFull:"Estimated time",event:function(A){return(A==1)?"event":"events"},eventInfo:"Event Information",eventLocation:"Event Location",eventNoInfo:"Event",eventTab:"Events",eventToggle:"Events",eventTypes:{dealer:"Dealer events",h_d:"Harley-Davidson Motor Co. events",hog:"H.O.G. events"},fax:"Fax",firstReview:"Be the first to rate this road",flyThrough:"Fly through",fuelLocation:"Gas Station",fuelLocationName:"Shell Station",fuelTab:"Fuel",fuelToggle:"Shell Fuel",genericErrorMessage:"An error has occurred while trying to connect to our servers.  Please try your action again.<br /><br />If the error persists, please wait and try again in several minutes.",go:"Go",greatRoadSubmitter:"byways.org",hasSentYouARidePlan:"has sent you a Ride Plan",here:"here",help:"Help",hideAddress:"Hide address",hideLocations:"Hide locations",hideRoad:"Hide road",hotelBookingPrompt:"Please provide all information below to check hotel availability",hotelTab:"Hotels",hotelToggle:"Best Western Hotels",incorrectInfo:"Incorrect information",inappropriateContent:"Inappropriate Content",km:"km",lastUpdated:"Last Updated: ",length:"Length",maxRoutesExceeded:"Error: You may only save up to "+HD.rp.constants._MAX_USER_ROADS+" rides at a time. You have reached the limit, so you may want to consider deleting some of your routes.",maxRoutesExceededWarn:"Warning: You may only save up to "+HD.rp.constants._MAX_USER_ROADS+" rides at a time. You are approaching the limit, so you may want to consider deleting some of your routes. Once you reach the "+HD.rp.constants._MAX_USER_ROADS+"-ride limit, you will not be able to save any more rides.",miles:"mi",moreInfo:"More Information",movedSuccessfully:"Selected ride plans were moved to...",mySavedRidePlans:"My Saved Ride Plans",nameAddressChange:"If your name or address has changed recently, correct the information in your ",needHelp:"Need Help?",next:"next",noDatesPlanned:"No dates were planned.",noLoginMode:"No-Login Mode In Effect",noLoginModeText:"The Ride Planner application is currently being updated. Although you can still use Ride Planner, any features that involve logging in (such as saving your ride plan or accessing your rides) will be <strong>unavailable</strong> until the update is complete.  The estimated time for completion is Saturday 4/12/2008 at 9:30 AM CDT.",noPhotos:"",noRiderReviews:"<em>No rider reviews have been posted for this road.</em><br/>Have you ridden this road? Be the first to",noRiderReviewsNoLogin:"To rate and review this road, you must be logged into your H-D.com profile.<br/>You can log in or create a free online profile",noSampleItinerary:"Currently, no sample itinerary is available for this road.",note:"Note",numberOfAdults:"Number of adults",numberOfRooms:"Number of rooms",of:"of",onlineProfile:"online profile",ok:"Ok",panelMessages:{roadStates:{beyondZoom:'You are too far out to display roads information on the map. Please <a href="javascript:void(0)" onclick="HD.rp.hdMap.setZoomLevel(HD.rp.constants._MIN_ZOOM_LEVELS.ROAD_MIN);">zoom in</a> to see roads.',beyondZoomUserRoads:'There are too many rider submitted roads to view. Please <a href="javascript:void(0)" onclick="HD.rp.hdMap.setZoomLevel(HD.rp.constants._MIN_ZOOM_LEVELS.USER_ROADS);">zoom in</a> to a specific area to view rider submitted roads.',noGreatRoadsInView:'No Great Roads shown in this area. <a href="javascript:void(0)" onclick="HD.rp.zoomOut();">Zoom out</a> or move the map to a different area to view Great Roads.',noRoadsInView:'There are no roads shown in the current view. <a href="javascript:void(0)" onclick="HD.rp.zoomOut();">Zoom out</a> or move the map to a different area to view roads.',noUserRoadsInView:'There are no rider submitted roads in this area. <a href="javascript:void(0)" onclick="HD.rp.hdMap.zoomOut();">Zoom out</a> or move the map to a different area to view rider submitted roads.'},dealerStates:{beyondZoom:'You are too far out to display H-D information. Please <a href="javascript:void(0)" onclick="HD.rp.hdMap.setZoomLevel(HD.rp.constants._MIN_ZOOM_LEVELS.DEALERS);">zoom in</a> to see H-D Dealerships.',noneInView:'No H-D Dealerships shown in this area. <a href="javascript:void(0)" onclick="HD.rp.hdMap.zoomOut();">Zoom out</a> or move the map to a different area to view H-D Dealerships.'},hotelStates:{beyondZoom:'You are too far out to display Best Western Hotels. Please <a href="javascript:void(0)" onclick="HD.rp.hdMap.setZoomLevel(HD.rp.constants._MIN_ZOOM_LEVELS.HOTELS);">zoom in</a> to view hotels.',noneInView:'No Hotels shown in this area. <a href="javascript:void(0)" onclick="HD.rp.hdMap.zoomOut();">Zoom out</a> or move the map to a different area to view hotels.'},eventStates:{beyondZoom:'You are too far out to display Events. Please <a href="javascript:void(0)" onclick="HD.rp.hdMap.setZoomLevel(HD.rp.constants._MIN_ZOOM_LEVELS.HOTELS);">zoom in</a> to view events.',noneInView:'No Events shown in this area for the dates selected. <a href="javascript:void(0)" onclick="HD.rp.hdMap.zoomOut();">Zoom out</a>, move the map to a different area, or change your date range to view events.'},fuelStates:{beyondZoom:'You are too far out to display Shell Fuel. Please <a href="javascript:void(0)" onclick="HD.rp.hdMap.setZoomLevel(HD.rp.constants._MIN_ZOOM_LEVELS.FUEL);">zoom in</a> to view fuel.',noneInView:'No gas stations shown in this area. <a href="javascript:void(0)" onclick="HD.rp.hdMap.zoomOut();">Zoom out</a> or move the map to a different area to view gas stations.'}},phone:"Phone",pleaseSelectCategory:"Please Select Category",prev:"prev",print:"Print",privateRide:"This ride is private",profile:"My online profile",provideDescription:"Provide description",publicRide:"This ride is public",publishRoad:"Publish road",purchaseTickets:"Purchase tickets",rateThisRoad:"RATE THIS ROAD",rating:"Rating",readOnlyMode:"Read-Only Mode In Effect",readOnlyModeText:"The Ride Planner application is currently being updated. Although you can still use Ride Planner, any features that involve saving information (such as saving your ride plan) will be <strong>unavailable</strong> until the update is complete.",remove:"remove",removeToMyRide:"Remove from My Ride",removeLocation:"Remove location",removeLocationToMyRide:"Remove location from My Ride",removeWaypoint:"Remove waypoint",rename:"rename",requiredFiedlsInBold:"Fields in <b>bold</b> with an asterisk (*) are required.",returnToOverview:"Return to overview",review:"Review",riddenRoad:"Have you ridden this road? Please take a moment to submit a review. Submitting a review will help your fellow riders experience, choose, and create new roads of their own.",reviewAgreement1:"I have read and understand the",reviewAgreement2:"consent agreement.",reviewDisclaimer:'By submitting this review, I consent that my name, my review and any other reproductions of my information and likeness (the "Materials") may be used by Harley-Davidson, its affiliates (collectively refereed to as "Harley-Davidson") and/or others with its consent, for the purpose of illustration, advertising, promotions, duplication or publication or for any other purpose in any manner and in any media without further consideration. I represent and warrant that I am the owner of the Materials and have the rights to dispose of my ownership rights as I see fit.  I hereby assign to Harley-Davidson all rights, title and interest in the Materials and any other tangible medium of expression of my information including all copyrights therein that I provide to Harley-Davidson.',reviewGuidelinesHeader:"GUIDELINES FOR SUBMITTING A ROAD",reviewGuidelines1:"Share your own, original opinions of roads you have traveled. Provide the kinds of information you would tell a friend about what you saw, did, and experienced on the trip and what they should be sure not to miss.",reviewGuidelines2:"Harley-Davidson will review all Great Road submissions prior to publication. If a submission is found to contain any of the following, it will be edited to remove the offensive language or rejected:",reivewGuidelinesLi1:"Profanity",reivewGuidelinesLi2:"Obscenities",reivewGuidelinesLi3:"Identifying personal information about you or others (such as email addresses, mailing addresses, or phone numbers)",reivewGuidelinesLi4:"Solicitations",reivewGuidelinesLi5:"Remarks of a defamatory, abusive, or prejudiced nature",reviewGuidelines3:"Have fun with this feature of H-D.com. Be truthful and objective. Your fellow riders will use this information to have the same mind-blowing experience you did.",reviews:"Reviews",reviewThankYou:"Your road review has been sent to Harley-Davidson.",reviewThisRoad:"Review this road",riderFriendlyHotel:"Rider Friendly Hotel",roadLength:"Length",roadName:"Road name",roadRating:"Average Rating",roadRatingText:{1:"Poor",2:"Fair",3:"Good",4:"Great",5:"Excellent"},roadCharacteristics:{scenery:{1:"Desert",2:"Farmland",3:"Forest",4:"Lakes",5:"Mountains",6:"Ocean",7:"Plains",8:"River",9:"Rural",10:"Urban/Residential",11:"Fall Colors",12:"Historic Sites",13:"Beaches",14:"Parks"},timeofyear:{1:"Winter",2:"Summer",3:"Spring",4:"Fall"}},roadsTab:"Roads",roadsToggle:"Scenic Roads",roadSubmitter:"Submitted by",routingFailed:"We can not create a route to one of the locations you've chosen.  Please choose a new location, or enter the correct address in the My Ride panel.<br /><br />Make sure the points you've chosen are on an existing road, are not located outside the United States or Canada, and are not in an invalid area, such as a body of water.",sampleItineraryHeader:"This is a point by point itinerary for the points of interest along the ",save:"Save",saveAndContinue:"Save and Continue...",saved:"Saved: ",saveDisclaimer:"By submitting this road, I consent that my name, road information and any other reproductions of my information and likeness may be used by Harley-Davidson, its affiliates and/or others with its consent, for the purpose of illustration, advertising, promotions, duplication or publication or for any other purpose in any manner and in any media without further consideration. I also assign to Harley-Davidson all right, title and interest in this information and any other tangible medium of expression of my image and information including all copyrights therein. We reserve the right to edit all letters sent for publication on harley-davidson.com.",savedRides:"My Saved Ride Plans",savedRoads:"saved roads",saveFailed:"This route can't be saved because it has a waypoint as its last stop.  Please change your ending waypoint by right-clicking on it and selecting 'Change to location'.",saveNote:"Save Note",scenery:"Scenery",seeDifference:"see the difference",selectAStar:"Select a star",selectDates:"Select dates",sendRideSave:"Save ride plan",sendRideSaveMessage:"Before emailing the ride plan, you have to save your changes. Do you want to save your ride plan and continue?",servicesOffered:"Services Offered",sessionTimeOut:"Your session has timed out.  Please log in again.",shellServices:{suppliedByShell:"Supplied By Shell",convenienceStore:"Convenience Store",carWash:"Car Wash",restaurant:"Restaurant",autoCare:"Auto Care",diesel:"Diesel",atm:"ATM",twentyFourHr:"24 Hour",website:"Website",twentyFourHrTruck:"24 Hour Truck",truckParking:"Truck Parking",showers:"Showers",email:"Email",atmTruck:"Atm Truck",barber:"Barber",laundry:"Laundry",lounge:"Lounge",truckRepairs:"Truck Repairs",truckWash:"Truck Wash",internetAccess:"Internet Access",certifiedScales:"Certified Scales",premiumCw:"Premium Cw",promotionOne:"Promotion One Text",promotionTwo:"Promotion Two Text",promotionThree:"Promotion Three Text"},showAddress:"Show address",showAllLocations:"Show All Locations",showLocations:"Show locations",showRoad:"Show Road",showRouteLine:"Show route line on the map",signAs:"Sign as",signIn:"Sign In",signMyReview:"Sign My Review",signOut:"Sign Out",simplificationError:"The Ride Planner was unable to export the route.  Please consider converting your ride plan into multiple ride plans before trying again.",start:"Start",startOver:"Start over",startLocation:"Start Location",startOverMessage:"Are you sure that you want to reset the view, clear all of your locations and start over?",states:"State(s)",state:"State",stop:"Stop",submitRatingReview:"Submit Rating and Review",submitReviewFooter:"&copy; 2001-2007 H-D. All rights reserved.",submittedBy:"Submitted By",suggestedTimeAtSite:"Suggested Time at This Site",thankYouForFeedback:"Thank you for your feedback! We will review your message and ensure that the appropriate action is taken.",travelTimeFromPrevious:"Travel Time from ",timeToAllow:"Time to Allow",title:"Title",titleYourReview:"Title Your Review",totalDistance:"Total Distance",totalEstimatedTime:"Total Estimated Time",unsupportedBrowser:"Unsupported Browser Detected",unsupportedBrowserText:"Ride Planner currently supports Internet Explorer and Firefox web browsers. Although you can use Ride Planner with another browser, <strong>some features may not function as intended</strong>.",unsupportedBrowserFailedText:"Ride Planner currently supports Internet Explorer and Firefox web browsers. Although you can use Ride Planner with another browser, <strong>some features may not function as intended</strong> or the application may fail to load.",view:"View",viewDealerEvents:"View dealer events",viewDealerInfo:"View dealer information",viewLocationInfo:"View location information",viewEventInfo:"View event information",viewPrivatePolicy:"View our <a href='"+hdPrivacyPolicyURL+"' target='_blank'>privacy policy</a> for more information.",warning:"Warning",waypoint:"Waypoint",website:"Website",welcome:"Welcome",welcomeGuest:"Welcome, Guest",wishToWriteAReview:"If you wish, you may write a review to display with your rating.",writeAReview:"Write A Review",youhave:"You have ",yourRating:"Your rating",yourRideHasBeenSent:"Your Ride Plan has been sent to the following email addresses",zeroDays:"0 days 0 hours",zeroMiles:"0 miles / 0 km",zoomToStreet:"Zoom to street level",zoomToShowRide:"Zoom to show entire ride",zoomToShowRoad:"Zoom to show road",zoomToShowUserRoads1:"No Rider submitted roads show in the area. ",zoomToShowUserRoads2:"Zoom out",zoomToShowUserRoads3:" or move the map to a different area to view Rider submitted roads."};HD.rp.URL={eventDetailsDealer:eventDetailsDealerURL,eventDetailsHD:eventDetailsHDURL,hotel:bestWesternURL,hotelSearch:bestWesternSearchURL,hotelLanding:bestWesternLandingURL,welcomePage:welcomePageURL,hotelCountryCodes:{find:function(A){A=A.replace(/\s\(.+\)$/,"");return !!this[A]?this[A]:""},CA:"CA",Canada:"CA","United States":"US",US:"US"},hotelStateCodes:{find:function(B,A){B=HD.rp.URL.hotelCountryCodes.find(B);A=A.replace(/\s\(.+\)$/,"");return !!this[B]&&!!this[B][A]?this[B][A]:""},CA:{Alberta:"AB","British Columbia":"BC",Manitoba:"MB","New Brunswick":"NB",Newfoundland:"NL","Nova Scotia":"NS",Ontario:"ON","Prince Edward Island":"PE",Quebec:"QC",Saskatchewan:"SK",Yukon:"YT",AB:"AB",BC:"BC",MB:"MB",NB:"NB",NL:"NL",NS:"NS",ON:"ON",PE:"PE",QC:"QC",SK:"SK",YT:"YT"},US:{Alabama:"AL",Alaska:"AK",Arizona:"AZ",Arkansas:"AR",California:"CA",Colorado:"CO",Connecticut:"CT",Delaware:"DE","District of Columbia":"DC",Florida:"FL",Georgia:"GA",Hawaii:"HI",Idaho:"ID",Illinois:"IL",Indiana:"IN",Iowa:"IA",Kansas:"KS",Kentucky:"KY",Louisiana:"LA",Maine:"ME",Maryland:"MD",Massachusetts:"MA",Michigan:"MI",Minnesota:"MN",Mississippi:"MS",Missouri:"MO",Montana:"MT",Nebraska:"NE",Nevada:"NV","New Hampshire":"NH","New Jersey":"NJ","New Mexico":"NM","New York":"NY","North Carolina":"NC","North Dakota":"ND",Ohio:"OH",Oklahoma:"OK",Oregon:"OR",Pennsylvania:"PA","Rhode Island":"RI","South Carolina":"SC","South Dakota":"SD",Tennessee:"TN",Texas:"TX",Utah:"UT",Vermont:"VT",Virginia:"VA",Washington:"WA","West Virginia":"WV",Wisconsin:"WI",Wyoming:"WY",AL:"AL",AK:"AK",AZ:"AZ",AR:"AR",CA:"CA",CO:"CO",CT:"CT",DE:"DE",DC:"DC",FL:"FL",GA:"GA",HI:"HI",ID:"ID",IL:"IL",IN:"IN",IA:"IA",KS:"KS",KY:"KY",LA:"LA",ME:"ME",MD:"MD",MA:"MA",MI:"MI",MN:"MN",MS:"MS",MO:"MO",MT:"MT",NE:"NE",NV:"NV",NH:"NH",NJ:"NJ",NM:"NM",NY:"NY",NC:"NC",ND:"ND",OH:"OH",OK:"OK",OR:"OR",PA:"PA",RI:"RI",SC:"SC",SD:"SD",TN:"TN",TX:"TX",UT:"UT",VT:"VT",VA:"VA",WA:"WA",WV:"WV",WI:"WI",WY:"WY"}},blankImage:HD.constants.IMAGE_PATH+"/Content/Pictorial/Ride_Planner/!pixel.gif",help:HD.constants.HELP_PATH,facilities:HD.constants.JSP_PATH+"/hd.facilities.xml"};HD.rp.HTML={zoomToSeeUserRoads:'<div class="changeView">'+HD.rp.text.zoomToShowUserRoads1+' <a href="javascript:void(0);" onclick="HD.rp.zoomOut();">'+HD.rp.text.zoomToShowUserRoads2+"</a>"+HD.rp.text.zoomToShowUserRoads3+"</div>",noRiderReviews:'<div class="noData">'+HD.rp.text.noRiderReviews+' <a href="javascript:void(0);" onclick="HD.rp.dialog.RoadDetails.showReviewForm();">'+HD.rp.text.writeAReview.toLowerCase()+"</a>.</div>",noRiderReviewsNoLogin:'<div class="noLogin">'+HD.rp.text.noRiderReviewsNoLogin+' <a href="javascript:void(0);" onclick="HD.User.showLogin();">'+HD.rp.text.here+"</a>.</div>",onlineProfileLink:'<a href="#">'+HD.rp.text.onlineProfile+"</a>",roadFooter:'<div class="roadFooter"><div>'+HD.rp.text.abuseUserRoad1+' <a href="javascript:void(0)" onclick="HD.rp.dialog.RoadDetails.showReportAbuse();">'+HD.rp.text.clickHere+"</a>"+HD.rp.text.abuseUserRoad2+"</div></div>",roadDetailsTools:'<div class="roadTools"><strong>Rider Tools</strong><a href="javascript:void(0)" id="roadToolsReview" class="btn" onclick="HD.rp.dialog.RoadDetails.showReviewForm();">Review This Road</a><a href="javascript:void(0)" class="btn" onclick="HD.rp.Panel.invoke(\'printRoad\',_ROAD_ID)">Printable Version</a></div>',archivedClass:"archived",hiddenClass:"hidden",visibleClass:"visible",invisibleClass:"invisible",noClass:"",noPagingResults:"",panelLoadingIndicator:'<div class="loadingIndicatorPanelGray"><div></div></div>',mapLoadingImage:'<div class="mapLoadingImage"></div>',roadStateSquare:'<div class="stateSquare">_STATE</div>',roadCharacteristics:{scenery:{1:'<div class="rcDesert">Desert</div>',2:'<div class="rcFarmland">Farmland</div>',3:'<div class="rcForest">Forests</div>',4:'<div class="rcLakes">Lakes</div>',5:'<div class="rcMountains">Mountains</div>',6:'<div class="rcOcean">Ocean</div>',7:'<div class="rcPlaines">Plains</div>',8:'<div class="rcRivers">Rivers</div>',9:'<div class="rcRural">Rural</div>',10:'<div class="rcUrban">Urban/Residential</div>',11:'<div class="rcFallColors">Fall Colors</div>',12:'<div class="rcHistoric">Historic</div>',13:'<div class="rcBeaches">Beaches</div>',14:'<div class="rcParks">Parks</div>'},timeofyear:{1:"Winter",2:"Summer",3:"Spring",4:"Fall"}},pinShadow:'<div class="pinShadow"></div>',viaPin:'<div class="viaPin _PANEL" title="Drag to move waypoint"></div>',viaPinStatic:'<div class="viaPin _PANEL"></div>',viaPinClass:"viaPin",stopPin:'<div class="stopPin _ENTITY_TYPE" id="stopPin"><div>_NUM</div></div>',stopPinList:'<div class="stopPin _ENTITY_TYPE" id="stopPin" title="Jump to location"><div>_NUM</div></div>',stopPinClass:"stopPin",stopDealerPinClass:"stopDealerPin",stopDealerEventPinClass:"stopDealerEventPin",stopEventPinClass:"stopEventPin",stopHotelPinClass:"stopHotelPin",stopHotelPreferredPinClass:"stopHotelPreferredPin",stopFuelPinClass:"stopFuelPin",hotelPin:'<div class="hotelPin _PANEL-hotelPin" id="hotelPin"><div>_NUM</div></div>',hotelPinClass:"hotelPin",hotelPreferredPin:'<div class="hotelPreferredPin _PANEL-hotelPreferredPin" id="hotelPreferredPin"><div>_NUM</div></div>',hotelPreferredPinClass:"hotelPreferredPin",dealerPin:'<div class="dealerPin _PANEL-dealerPin" id="dealerPin"><div>_NUM</div></div>',dealerPinClass:"dealerPin",dealerEventPin:'<div class="dealerPin dealerEventPin _PANEL-dealerEventPin" id="dealerPin"><div>_NUM</div></div>',dealerEventPinClass:"dealerEventPin",eventPin:'<div class="eventPin _PANEL-eventPin" id="eventPin"><div>_NUM</div></div>',eventPinClass:"eventPin",fuelPin:'<div class="fuelPin _PANEL-fuelPin" id="fuelPin"><div>_NUM</div></div>',fuelPinClass:"fuelPin",greatRoadPin:'<div class="greatRoadPin _PANEL-greatRoadPin" id="greatRoadPin"><div>_NUM</div></div>',greatRoadPinClass:"greatRoadPin",userRoadPin:'<div class="userRoadPin _PANEL-userRoadPin" id="userRoadPin"><div>_NUM</div></div>',userRoadPinClass:"userRoadPin",facilityPin:'<div class="facilityPin _PANEL-facilityPin" id="facilityPin"><div>_NUM</div></div>',facilityPinClass:"facilityPin",stopFacilityPinClass:"stopFacilityPin",museumPin:'<div class="museumPin _PANEL-museumPin" id="museumPin"><div>_NUM</div></div>',museumPinClass:"museumPin",stopMuseumPinClass:"stopMuseumPin",myRideSegment:'<div class="myRideSegment"></div>',myRideSegmentClass:"myRideSegment",myRideSegmentOverIcon:'<div class="myRideSegmentOverIcon"><div>Drag&nbsp;to&nbsp;change&nbsp;route</div></div>',panel:{global:{panel:(['<div id="_NAMETab" class="t">','<span class="close" onclick="_REFERENCE.hide(this);" title="Close panel"></span>',"<div>_TAB</div>","</div>",'<div class="st" id="_NAMETop">','<div id="_NAMEFilters">_FILTERS</div>','<div id="_NAMEMessage"></div>','<div id="_NAMEPaging"></div>',"</div>",'<div class="c" id="_NAMEContent"></div>','<div class="st" id="_NAMEBottom"><div id="_NAMEPromo"></div></div>']).join(""),toggle:'<a href="javascript:void(0)" id="_NAMEToggle" class="_NAME" title="_TOGGLE"></a>'},events:{filters:(['<form id="eventFiltersForm">','<div id="eventsGrouping">',"<em>Display events by </em>",'<select id="events-grouping">','<option value="location" selected="selected">Location</option>','<option value="date">Date</option>',"</select>","</div>",'<ul id="eventsDate">',"<li>","From<br/>",'<input type="text" id="events-startDate"/>','<a href="javascript:void(0)" id="events-startToggle"></a>',"</li>",'<li class="mid">',"&nbsp;<br/>","<span>&nbsp;&nbsp;&ndash;&nbsp;&nbsp;</span>","</li>","<li>","To<br/>",'<input type="text" id="events-endDate"/>','<a href="javascript:void(0)" id="events-endToggle"></a>',"</li>","</ul>",'<ul id="eventsTypes">','<li><label><input id="eventsTypesDealer" type="checkbox" checked="checked"/>'+HD.rp.text.eventTypes.dealer+"</label></li>",'<li><label><input id="eventsTypesH-D" type="checkbox" checked="checked"/>'+HD.rp.text.eventTypes.h_d+"</label></li>",'<li><label><input id="eventsTypesHOG" type="checkbox" checked="checked"/>'+HD.rp.text.eventTypes.hog+"</label></li>","</ul>","</form>"]).join("")},roads:{filters:(["<table>",'<tr><td colspan="2"><b>Roads within current map view</b></td></tr>','<tr><td class="one"><div class="gr_panel"></div></td><td class="two"> <input type="checkbox" id="greatRoadCheck"/> <label for="greatRoadCheck" id="greatRoadCheckLabel">Show Great Roads</label></td></tr>','<tr><td class="one"><div class="usr_panel"></div></td><td class="two"> <input type="checkbox" id="userRoadCheck"/> <label for="userRoadCheck" id="userRoadCheckLabel">Show Rider Submitted Roads</label></td></tr>',"</table>"]).join("")}},stopList:{className:"stopListItem",code:'<table><tr><td><strong onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_STOP_NAME</strong>(<a class="r" id="stopR">'+HD.rp.text.remove+'</a>)</td><td class="r d"><a class="d" id="stopD" title="Move location down"></a></td><td class="r u"><a class="u" id="stopU" title="Move location up"></a></td></tr></table><div class="form"><form onsubmit="return false;" id="stopForm"><span onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_STOP_PIN</span> <input type="text" name="loc" class="i" value="_INPUT_VALUE" id="stopI" /><input type="button" name="go" class="b" id="stopB" value="'+HD.rp.text.go+'" />_ENTITY_CONTENT<div class="cl"></div></form></div><div class="note" id="note"><div class="addNotes"><a href="javascript:void(0)" class="noteAction" id="addNotes">'+HD.rp.text.addNotes+'</a></div><div class="viewNotes"><p><span></span></p><a href="javascript:void(0)" class="noteAction" id="viewNotes">'+HD.rp.text.view+"</a></div></div>",codeStopRename:'<table><tr><td class="stopName"><div><strong id="stopName">_STOP_NAME</strong>(<a id="stopN">'+HD.rp.text.rename+'</a> | <a class="r" id="stopR">'+HD.rp.text.remove+'</a>)</div></td><td class="r d"><a class="d" id="stopD" title="Move location down"></a></td><td class="r u"><a class="u" id="stopU" title="Move location up"></a></td></tr></table><div class="form"><form onsubmit="return false;" id="stopForm"><span onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_STOP_PIN</span> <input type="text" name="loc" class="i" value="_INPUT_VALUE" id="stopI" /><input type="button" name="go" class="b" id="stopB" value="'+HD.rp.text.go+'" />_ENTITY_CONTENT<div class="cl"></div></form></div><div class="note" id="note"><div class="addNotes"><a href="javascript:void(0)" class="noteAction" id="addNotes">'+HD.rp.text.addNotes+'</a></div><div class="viewNotes"><p><span></span></p><a href="javascript:void(0)" class="noteAction" id="viewNotes">'+HD.rp.text.view+"</a></div></div>",entityCode:"<p>_CONTENT</p>",renameCode:'<form onsubmit="HD.rp.MyRide.handleRenameStop(this);return false"><input class="rename" type="text" value="_NAME" /><a href="javascript:void(0);" class="btn" onclick="HD.rp.MyRide.handleRenameStop(this.parentNode)">'+HD.rp.text.save+'</a><a href="javascript:void(0);" onclick="HD.rp.MyRide.cancelRenameStop(this.parentNode)">'+HD.rp.text.cancel+"</a></form>"},directionsList:{className:"directionsListItem",code:'<div class="sm"><div class="l"><div>'+HD.rp.text.distance+": _DISTANCE</div><div>"+HD.rp.text.estimatedTime+': _DURATION</div></div><a class="r">'+HD.rp.text.drivingDirections+'</a></div><table class="d"><tr class="routing"><td colspan="2"><label><input class="avoidHighways" type="checkbox" _AVOIDING/> '+HD.rp.text.avoidHighwaysSegment+'</label></td></tr>_DIRECTIONS</table><div class="sp"></div>',rowCode:'<tr><td>_DIRECTIONS</td><td class="r"><span>_DISTANCE</span></td></tr>'},rideTotals:{className:"rideTotalsItem",code:'<div class="sm"><div>'+HD.rp.text.totalDistance+": _DISTANCE</div><div>"+HD.rp.text.totalEstimatedTime+": _DURATION</div></div>"},roadList:{className:"roadListItem",code:'<table><tr><td><div class="pin" onclick="HD.rp.MapController.centerRoad(_ROAD_ID)">_ROAD_PIN</div></td><td><div class="r"><strong style="cursor:pointer;" onclick="HD.rp.MapController.centerRoad(_ROAD_ID)">_ROAD_NAME</strong><div class="ratings _HAS_RATING">'+HD.rp.text.roadRating+'<div class="ratingsWrapper"><div class="ratings_ROAD_RATING"></div></div><a class="reviews" href="javascript:void(0);" onclick="HD.rp.Panel.invoke(\'showRoadDetails\',_ROAD_ID,HD.rp.constants._OVERVIEW_TABS.REVIEWS);">'+HD.rp.text.reviews+'</a></div><div class="ratings _HAS_NO_RATING"><a class="norating" href="javascript:void(0);" onclick="HD.rp.Panel.invoke(\'showRoadDetails\',\'_ROAD_ID\',HD.rp.constants._OVERVIEW_TABS.REVIEWS);">'+HD.rp.text.firstReview+"</a></div><div>"+HD.rp.text.roadLength+": _ROAD_LENGTH</div><div>"+HD.rp.text.roadSubmitter+' _ROAD_SUBMITTER</div><div><span id="linkMoreInfo"><a href="javascript:void(0);" onclick="HD.rp.Panel.invoke(\'showRoadDetails\',\'_ROAD_ID\',HD.rp.constants._OVERVIEW_TABS.OVERVIEW);">'+HD.rp.text.moreInfo+'</a>&nbsp;&nbsp;</span></div><div class="locations hideLocs _ROAD_POLY_STATE"><a class="toggleShow" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'zoomToShowRoad\',\'_ROAD_ID\');">'+HD.rp.text.showRoad+'</a><a class="toggleHide" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'hideLocations\',\'_ROAD_ID\',true);">'+HD.rp.text.hideRoad+'</a><ul class="locationsList"></ul><a class="addAllLocs" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+'</a><p class="addAllLocsText">'+HD.rp.text.addAllLocationsText+"</p></div></div></td></tr></table>",failureCode:"<div>(Unable to retrieve road)</div><br/>",loadingCode:'<div class="panelLoadingImage"></div><br/>',locationCode:"<li><strong>_NAME</strong><br/><p>_ADDRESS</p></li>",shortCode:'<div class="pin" onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_ROAD_PIN</div><div class="r"><strong style="cursor:pointer;" onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_ROAD_NAME</strong><div class="panelLoadingImage"></div><br/><br/></div>',waypointCode:"<li><strong>"+HD.rp.text.waypoint+'</strong><br/><a href="javascript:void(0)" onclick="HD.rp.MapController.addToRoute(HD.road.constants._STOP_TYPES.VIA,_ID,true);">'+HD.rp.text.addWaypointToMyRide+"</a></li>",zoomCode:'<div class="pin" onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_ROAD_PIN</div><div class="r"><strong style="cursor:pointer;" onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_ROAD_NAME</strong><div class="ratings _HAS_RATING">'+HD.rp.text.roadRating+'<div class="ratingsWrapper"><div class="ratings_ROAD_RATING"></div></div><a class="reviews" href="javascript:void(0);" onclick="HD.rp.Panel.invoke(\'showRoadDetails\',\'_ROAD_ID\',HD.rp.constants._OVERVIEW_TABS.REVIEWS);">'+HD.rp.text.reviews+'</a></div><div class="ratings _HAS_NO_RATING"><a class="norating" href="javascript:void(0);" onclick="HD.rp.Panel.invoke(\'showRoadDetails\',\'_ROAD_ID\',HD.rp.constants._OVERVIEW_TABS.REVIEWS);">'+HD.rp.text.firstReview+"</a></div><div>"+HD.rp.text.roadLength+": _ROAD_LENGTH</div><div>_ROAD_TIME</div><div>"+HD.rp.text.roadSubmitter+' _ROAD_SUBMITTER</div><div><span id="linkMoreInfo"><a href="javascript:void(0);" onclick="HD.rp.Panel.invoke(\'showRoadDetails\',\'_ROAD_ID\',HD.rp.constants._OVERVIEW_TABS.OVERVIEW);">'+HD.rp.text.moreInfo+"</a>&nbsp;&nbsp;<a href=\"javascript:void(0);\" onclick=\"HD.rp.Panel.invoke('zoomToShowRoad','_ROAD_ID');\">"+HD.rp.text.showRoad+"</a></span></div></div>"},hotelList:{className:"poiListItem",code:'<table><tr><td><div class="pin" onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_PIN</div></td><td><div class="r"><strong onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_NAME</strong><div class="_IS_RF">'+HD.rp.text.riderFriendlyHotel+'</div><div><a href="javascript:void(0)" onclick="HD.rp.MapMenu.show(HD.rp.MapController.getDataModel(_1HOTEL_ID).pinEl,HD.rp.MapMenu._TYPE.CLICK,null,null,\'hotel-booking\');">'+HD.rp.text.bookHotelOnline+'</a></div><div>_ADDRESS</div><a class="add" onclick="HD.rp.MapController.addPOIToRoute(\'_1HOTEL_ID\')">'+HD.rp.text.addLocationToMyRide+"</a></div></td></tr></table>",entityContent:'<div class="_IS_RF">'+HD.rp.text.riderFriendlyHotel+'</div><p class="_IS_RF"/><div/><a href="javascript:void(0)" onclick="HD.rp.MapMenu.show(HD.rp.MapController.getDataModel(_1HOTEL_ID).pinEl,HD.rp.MapMenu._TYPE.CLICK,null,null,\'hotel-booking\');">'+HD.rp.text.bookHotelOnline+"</a>"},dealerList:{className:"poiListItem",code:'<table><tr><td><div class="pin" onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_PIN</div></td><td><div class="r"><strong onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_NAME</strong>_SITE_LINK<div>_ADDRESS</div><div>'+HD.rp.text.phone+': _PHONE</div><a href="javascript:void(0)" onclick="HD.rp.DealerPanel.getDealerDetails(\'_DEALER_ID\');">'+HD.rp.text.moreInfo+'</a><br/><a class="add" onclick="HD.rp.MapController.addPOIToRoute(_1DEALER_ID)">'+HD.rp.text.addLocationToMyRide+"</a></div></td></tr></table>",entityContent:'<a class="_HAS_URL" target=__blank" href="_DEALER_URL" onclick="HD.rp.DealerPanel.getDealerWebsite(\'_DEALER_ID\');">'+HD.rp.text.dealerWebsite+'</a><br class="_HAS_URL"/><a href="javascript:void(0)" onclick="HD.rp.DealerPanel.getDealerDetails(\'_DEALER_ID\');">'+HD.rp.text.moreInfo+"</a>",siteLink:'<div><a target=__blank" href="_DEALER_URL" onclick="HD.rp.DealerPanel.getDealerWebsite(\'_DEALER_ID\');">'+HD.rp.text.dealerWebsite+"</a></div>"},eventList:{className:"poiListItem",code:'<table><tr><td><div class="pin _NOT_LIST_ITEM" onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_PIN</div></td><td><div class="r"><strong onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_STOP_NAME</strong><div>_DATE</div><div class="b">_LOCATION_NAME</div><div class="_IS_LIST_ITEM">_ADDRESS</div><a class="_NOT_CONTAINER" href="javascript:void(0)" onclick="HD.rp.EventPanel.launchEvent(\'_EVENT_OBJECTID\',\'_EVENT_TYPE\')">'+HD.rp.text.eventInfo+'</a><br class="_NOT_CONTAINER"/><a class="add _NOT_CONTAINER" onclick="HD.rp.MapController.addPOIToRoute(_EVENT_ID)">'+HD.rp.text.addToMyRide+'</a><a class="add _IS_CONTAINER" onclick="HD.rp.MapController.addPOIToRoute(\'_LOCATION_ID\')">'+HD.rp.text.addLocationToMyRide+"</a></div></td></tr></table>",entityContent:'<span class="eventDate _HAS_DATE">_EVENT_DATE</span><br class="_HAS_DATE"/><a class="_HAS_INFO" href="javascript:void(0)" onclick="HD.rp.EventPanel.launchEvent(\'_EVENT_OBJECTID\',\'_EVENT_TYPE\')">'+HD.rp.text.eventInfo+'</a><span class="_HAS_NO_INFO">'+HD.rp.text.eventNoInfo+"</span>"},fuelList:{className:"poiListItem",code:'<table><tr><td><div class="pin" onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_PIN</div></td><td><div class="r"><strong onclick="HD.rp.MapController.centerOnPoint(\'_LAT_LONG\')">_NAME</strong><div>_ADDRESS</div><a class="add" onclick="HD.rp.MapController.addPOIToRoute(_FUEL_ID)">'+HD.rp.text.addLocationToMyRide+"</a></div></td></tr></table>",entityContent:HD.rp.text.fuelLocation},mapMenuClass:"mapMenu",mapMenuClose:'<div class="x" onclick="HD.ui.Menu.hide();"></div>',menuLineMaskClass:"menuLineMaskClass",menuContextArrowLeftClass:"menuContextArrowLeft",menuContextArrowRightClass:"menuContextArrowRight",rideMenus:{hover:'<a href="javascript:void(0)" class="t" onclick="HD.rp.MapMenu.show(\'_DATAMODEL_ID\',HD.rp.MapMenu._TYPE.CLICK);">_LOCATION_NAME</a>',click:'<div class="n _IS_STATIC">_ROAD_NAME<br/>_NUM. _LOCATION_NAME</div><div class="n _NOT_STATIC">_NUM. _LOCATION_NAME</div><div class="a">'+HD.rp.text.address+':</div><div class="a">_ADDRESS</div><div class="sp"></div><a class="_IS_STATIC" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+'</a><a class="_NOT_STATIC _IS_STOP" href="javascript:void(0)" onclick="HD.rp.MapController.removePoint();">'+HD.rp.text.removeLocationToMyRide+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+"</a>",context:'<a class="_NOT_STATIC" href="javascript:void(0)" onclick="HD.rp.MapController.removePoint();">'+HD.rp.text.removeLocation+'</a><a class="_NOT_STATIC _HIDE_LOCATIONTOVIA" href="javascript:void(0)" onclick="HD.rp.MapController.locationToVia();">'+HD.rp.text.changeToWaypoint+'</a><div class="sp _NOT_STATIC"></div><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+'</a><a class="_HIDE_SHOWRIDE" href="javascript:void(0)" onclick="HD.rp.MapController.showAllPins();">'+HD.rp.text.zoomToShowRide+"</a>"},viaMenus:{click:'<div class="n _IS_STATIC">_ROAD_NAME<br/>'+HD.rp.text.waypoint+'</div><a class="_IS_STATIC" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+'</a><div class="_IS_STATIC" id="menuWaypointArrowLeft"></div><div class="_IS_STATIC" id="menuWaypointArrowRight"></div>',context:'<a class="_NOT_STATIC" href="javascript:void(0)" onclick="HD.rp.MapController.removePoint();">'+HD.rp.text.removeWaypoint+'</a><a class="_NOT_STATIC" href="javascript:void(0)" onclick="HD.rp.MapController.viaToLocation();">'+HD.rp.text.changeToLocation+'</a><div class="sp _NOT_STATIC"></div><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+'</a><a class="_HIDE_SHOWRIDE" href="javascript:void(0)" onclick="HD.rp.MapController.showAllPins();">'+HD.rp.text.zoomToShowRide+"</a>"},dealerMenus:{hover:'<a href="javascript:void(0)" class="t" onclick="HD.rp.MapMenu.show(\'_DATAMODEL_ID\',HD.rp.MapMenu._TYPE.CLICK);">_LOCATION_NAME</a>',click:'<div class="n _IS_STATIC">_ROAD_NAME<br/>_NUM. _LOCATION_NAME</div><div class="n _NOT_STATIC _IS_STOP">_NUM. _LOCATION_NAME</div><div class="n _NOT_STATIC _NOT_STOP">_LOCATION_NAME</div><div class="a">_ADDRESS</div><div>'+HD.rp.text.phone+': _PHONE</div>_DEALER_SITE_LINK<a href="javascript:void(0)" onclick="HD.rp.DealerPanel.getDealerDetails(\'_DEALER_ID\');">'+HD.rp.text.moreInfo+'</a><div class="sp"></div><a class="_IS_STATIC" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+'</a><a class="_NOT_STATIC _IS_STOP" href="javascript:void(0)" onclick="HD.rp.MapController.removePoint();">'+HD.rp.text.removeLocationToMyRide+'</a><a class="_NOT_STATIC _NOT_STOP" href="javascript:void(0)" onclick="HD.rp.MapController.addPOIToRoute();">'+HD.rp.text.addLocationToMyRide+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+"</a>",siteLink:'<a target="_blank" href="_DEALER_SITE_URL" onclick="HD.rp.DealerPanel.getDealerWebsite(\'_DEALER_ID\');">'+HD.rp.text.dealerWebsite+"</a>"},hotelMenus:{hover:'<a href="javascript:void(0)" class="t" onclick="HD.rp.MapMenu.show(\'_DATAMODEL_ID\',HD.rp.MapMenu._TYPE.CLICK);">_LOCATION_NAME</a>',click:'<div class="n _IS_STATIC">_ROAD_NAME<br/>_NUM. _LOCATION_NAME</div><div class="n _NOT_STATIC _IS_STOP">_NUM. _LOCATION_NAME</div><div class="n _NOT_STATIC _NOT_STOP">_LOCATION_NAME</div><div class="a">_ADDRESS</div><div class="_IS_RF">'+HD.rp.text.riderFriendlyHotel+'</div><a class="bookHotel">'+HD.rp.text.bookHotelOnline+'</a><div class="sp"></div><a class="add _IS_STATIC" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+'</a><a class="add _NOT_STATIC _IS_STOP" href="javascript:void(0)" onclick="HD.rp.MapController.removePoint();">'+HD.rp.text.removeLocationToMyRide+'</a><a class="add _NOT_STATIC _NOT_STOP" href="javascript:void(0)" onclick="HD.rp.MapController.addPOIToRoute(\'_HOTEL_ID\');">'+HD.rp.text.addLocationToMyRide+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+"</a>",bookingSlider:"<p>"+HD.rp.text.hotelBookingPrompt+":</p><ul>"+HD.rp.text.selectDates+':<li class="checkin"><input id="hotelCheckIn" type="text"/><a href="javascript:void(0)"></a></li><li class="span">&nbsp;-&nbsp;</li><li class="checkout"><input id="hotelCheckOut" type="text"/><a href="javascript:void(0)"></a></li></ul><p>'+HD.rp.text.numberOfRooms+": 1</p><p>"+HD.rp.text.numberOfAdults+': <select id="hotelNumAdults"><option value="1" selected>1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option></select></p><a href="javascript:void(0);" class="btn" id="hotelBookSubmit" onclick="HD.rp.HotelPanel.launchHotelSearch(_HOTEL_ID, { checkIn: $(\'hotelCheckIn\').value, checkOut: $(\'hotelCheckOut\').value,  numAdults: $(\'hotelNumAdults\').value });">'+HD.rp.text.checkAvailability+"</a>"},eventMenus:{hover:'<a href="javascript:void(0)" class="t" onclick="HD.rp.MapMenu.show(\'_DATAMODEL_ID\',HD.rp.MapMenu._TYPE.CLICK);">_LOCATION_NAME<br/>_EVENT_COUNT</a>',click:'_LOCATION_CONTENT<div class="n">_EVENT_COUNT</div>_EVENT_CONTENT<div class="a eventPaging _HAS_PAGING"><table><tr><td class="prevArrow hidearrow"><a href="javascript:void(0)" onclick="HD.rp.MapMenu.menuPager(\'event-paging\',-1)">'+HD.rp.text.prev+'</a></td><td class="paging">_PAGING_CONTENT</td><td class="nextArrow"><a href="javascript:void(0)" onclick="HD.rp.MapMenu.menuPager(\'event-paging\',1)">'+HD.rp.text.next+"</a></td></tr></table></div>",clickItem:'<a class="event _HAS_EVENT _IS_STATIC" href="javascript:void(0)" onclick="this.blur();"><em>_ROAD_NAME<br/>_EVENT_NUM. _EVENT_NAME</em><br/><span class="name">'+HD.rp.text.viewEventInfo+'</span><br class="_HAS_DATE"/><span class="date _HAS_DATE">_EVENT_DATE</span></a><a class="event _HAS_EVENT _NOT_STATIC" href="javascript:void(0)" onclick="this.blur();"><em>_EVENT_NUM. _EVENT_NAME</em><br/><span class="name">'+HD.rp.text.viewEventInfo+'</span><br class="_HAS_DATE"/><span class="date _HAS_DATE">_EVENT_DATE</span></a>',dealerInfo:'<a class="eventLocation" href="javascript:void(0)"><em>_LOCATION_NAME</em><br/><span class="name">'+HD.rp.text.viewDealerInfo+"</span></a>",locationInfo:'<a class="eventLocation" href="javascript:void(0)"><em>_LOCATION_NAME</em><br/><span class="name">'+HD.rp.text.viewLocationInfo+"</span></a>",dealerSlider:'<p class="_IS_STATIC _IS_STOP"><em>_ROAD_NAME<br/>_NUM. _DEALER_NAME</em></p><p class="_IS_STATIC _NOT_STOP"><em>_ROAD_NAME<br/>_DEALER_NAME</em></p><p class="_NOT_STATIC _IS_STOP"><em>_NUM. _DEALER_NAME</em></p><p class="_NOT_STATIC _NOT_STOP"><em>_DEALER_NAME</em></p><p>_DEALER_ADDRESS</p><p>'+HD.rp.text.phone+': _DEALER_PHONE</p><p>_DEALER_SITE_LINK<a href="javascript:void(0)" onclick="HD.rp.DealerPanel.getDealerDetails(\'_DEALER_ID\');">'+HD.rp.text.moreInfo+'</a></p><div class="footer"><div class="sp"></div><a class="add _IS_STATIC" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+'</a><a class="add _NOT_STATIC _IS_STOP" onclick="HD.rp.MapController.removePoint()">'+HD.rp.text.removeToMyRide+'</a><a class="add _NOT_STATIC _NOT_STOP" onclick="HD.rp.MapController.addPOIToRoute(_LOCATION_ID)">'+HD.rp.text.addLocationToMyRide+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+"</a></div>",eventSlider:'<p class="_IS_STATIC _IS_STOP"><em>_ROAD_NAME<br/>_NUM. _EVENT_NAME</em><br class="_HAS_DATE"/>_EVENT_DATE</p><p class="_IS_STATIC _NOT_STOP"><em>_ROAD_NAME<br/>_EVENT_NAME</em><br class="_HAS_DATE"/>_EVENT_DATE</p><p class="_NOT_STATIC _IS_STOP"><em>_NUM. _EVENT_NAME</em><br class="_HAS_DATE"/>_EVENT_DATE</p><p class="_NOT_STATIC _NOT_STOP"><em>_EVENT_NAME</em><br class="_HAS_DATE"/>_EVENT_DATE</p><p class="_HAS_REMOTE_DEALER"><em>_REMOTE_DEALER_NAME</em></p><p>_EVENT_DESCRIPTION</p><p class="_HAS_INFO"><a href="javascript:void(0)" onclick="HD.rp.EventPanel.launchEvent(\'_EVENT_ID\',\'_EVENT_TYPE\')">'+HD.rp.text.eventInfo+'</a></p><div class="footer"><div class="sp"></div><a class="_IS_STATIC" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+'</a><a class="add _NOT_STATIC _NOT_STOP" onclick="HD.rp.MapController.addPOIToRoute(_EVENT_ID);">'+HD.rp.text.addToMyRide+'</a><a class="_NOT_STATIC _IS_STOP" href="javascript:void(0)" onclick="HD.rp.MapController.removePoint();">'+HD.rp.text.removeToMyRide+"</a></div>",locationSlider:'<p class="_IS_STATIC _IS_STOP"><em>_ROAD_NAME<br/>_NUM. _LOCATION_NAME</em></p><p class="_IS_STATIC _NOT_STOP"><em>_ROAD_NAME<br/>_LOCATION_NAME</em></p><p class="_NOT_STATIC _IS_STOP"><em>_NUM. _LOCATION_NAME</em></p><p class="_NOT_STATIC _NOT_STOP"><em>_LOCATION_NAME</em></p><p>_LOCATION_ADDRESS</p><div class="footer"><div class="sp"></div><a class="add _IS_STATIC" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+'</a><a class="add _NOT_STATIC _IS_STOP" onclick="HD.rp.MapController.removePoint()">'+HD.rp.text.removeToMyRide+'</a><a class="add _NOT_STATIC _NOT_STOP" onclick="HD.rp.MapController.addPOIToRoute(\'_LOCATION_ID\')">'+HD.rp.text.addLocationToMyRide+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+"</a></div>"},fuelMenus:{hover:'<a href="javascript:void(0)" class="t" onclick="HD.rp.MapMenu.show(\'_DATAMODEL_ID\',HD.rp.MapMenu._TYPE.CLICK);">_LOCATION_NAME</a>',click:'<div class="n _IS_STATIC">_ROAD_NAME<br/>_NUM. _LOCATION_NAME</div><div class="n _NOT_STATIC _IS_STOP">_NUM. _LOCATION_NAME</div><div class="n _NOT_STATIC _NOT_STOP">_LOCATION_NAME</div><div class="a">_ADDRESS</div><div class="a fuelServices _HAS_SERVICES">'+HD.rp.text.servicesOffered+':<br/><ul class="first">_FUEL_SERVICES1</ul><ul class="second">_FUEL_SERVICES2</ul><div class="cl"></div></div><div class="sp"></div><a class="_IS_STATIC" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+'</a><a class="_NOT_STATIC _IS_STOP" href="javascript:void(0)" onclick="HD.rp.MapController.removePoint();">'+HD.rp.text.removeLocationToMyRide+'</a><a class="_NOT_STATIC _NOT_STOP" href="javascript:void(0)" onclick="HD.rp.MapController.addPOIToRoute();">'+HD.rp.text.addLocationToMyRide+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+"</a>",service:"<li>_SERVICE</li>"},roadMenus:{hover:'<a href="javascript:void(0)" class="t" onclick="HD.rp.MapMenu.show(\'_DATAMODEL_ID\',HD.rp.MapMenu._TYPE.CLICK);">_LOCATION_NAME</a>',click:'<div class="n">_ROAD_NAME</div><table class="ratings _HAS_RATING"><tr><td>'+HD.rp.text.roadRating+'</td><td><div class="ratingsWrapper"><div class="ratings_ROAD_RATING"></div></div></td></tr></table><a class="norating _HAS_NO_RATING" href="javascript:void(0);" onclick="HD.rp.Panel.invoke(\'showRoadDetails\',\'_ROAD_ID\',HD.rp.constants._OVERVIEW_TABS.REVIEWS);">'+HD.rp.text.firstReview+"</a><div>"+HD.rp.text.length+": _LENGTH</div><a href=\"javascript:void(0)\"  onclick=\"HD.rp.Panel.invoke('showRoadDetails','_ROAD_ID',HD.rp.constants._OVERVIEW_TABS.OVERVIEW);\">"+HD.rp.text.moreInfo+"</a>"+(HD.util.getRequestParam(HD.rp.constants._REQUEST_PARAMS.MODE_3D)?('<a href="javascript:void(0)" onclick="HD.rp.ThreeD.flyThrough(HD.rp.MapController.getDataModel(\'_ROAD_ID\'), true);">'+HD.rp.text.flyThrough+"</a>"):"")+'<div class="sp"></div><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a class="_SHOW_LOCATIONS_STATE _SHOW_LOCATIONS_LEVEL" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'zoomToShowRoad\',\'_ROAD_ID\');">'+HD.rp.text.zoomToShowRoad+'</a><a class="_SHOW_LOCATIONS_STATE _SHOW_LOCATIONS_LEVEL" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'zoomToShowRoad\',\'_ROAD_ID\',true);">'+HD.rp.text.showRoad+'</a><a class="_HIDE_LOCATIONS_STATE _SHOW_LOCATIONS_LEVEL" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'hideLocations\',\'_ROAD_ID\',true);">'+HD.rp.text.hideRoad+'</a><a class="_HIDE_LOCATIONS_STATE _SHOW_LOCATIONS_LEVEL" href="javascript:void(0)" onclick="HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+"</a>"},facilityMenus:{hover:'<a href="javascript:void(0)" class="t" onclick="HD.rp.MapMenu.show(\'_DATAMODEL_ID\',HD.rp.MapMenu._TYPE.CLICK);">_LOCATION_NAME</a>',click:'<div class="n _IS_STATIC">_ROAD_NAME<br/>_NUM. _LOCATION_NAME</div><div class="n _NOT_STATIC _IS_STOP">_NUM. _LOCATION_NAME</div><div class="n _NOT_STATIC _NOT_STOP">_LOCATION_NAME</div><div class="a">_ADDRESS</div><div>'+HD.rp.text.phone+": _PHONE</div><a href=\"javascript:void(0)\" onclick=\"HD.rp.FacilitiesPanel.showFacility('_SITE_LINK','_LOCATION_NAME');\">"+HD.rp.text.moreInfo+'</a><a class="_TICKETS_LINK_CLASS" href="javascript:void(0)" onclick="HD.rp.FacilitiesPanel.showFacility(\'_TICKETS_LINK\', \'Harley-Davidson Museum Tickets\');">'+HD.rp.text.purchaseTickets+'</a><div class="sp"></div><a class="_IS_STATIC" href="javascript:void(0)" onclick="HD.rp.util.Hitbox.track(\'Application/Facilities/Add+Locations\');HD.rp.Panel.invoke(\'addLocations\',\'_ROAD_ID\');">'+HD.rp.text.addAllLocationsToMyRide+'</a><a class="_NOT_STATIC _IS_STOP" href="javascript:void(0)" onclick="HD.rp.util.Hitbox.track(\'Application/Facilities/Remove+Location\');HD.rp.MapController.removePoint();">'+HD.rp.text.removeLocationToMyRide+'</a><a class="_NOT_STATIC _NOT_STOP" href="javascript:void(0)" onclick="HD.rp.util.Hitbox.track(\'Application/Facilities/Add+Location\');HD.rp.MapController.addPOIToRoute();">'+HD.rp.text.addLocationToMyRide+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+"</a>"},defaultPinMenu:{context:'<a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap();">'+HD.rp.text.centerHere+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+"</a>"},mapMenus:{context:'<a href="javascript:void(0)" onclick="HD.rp.MapController.addToRouteFromXY(HD.road.constants._STOP_TYPES.STOP,_MAP_X,_MAP_Y,_STOP_ID);"><b>'+HD.rp.text.addLocation+'</b></a><a class="_HIDE_WAYPOINT" href="javascript:void(0)" onclick="HD.rp.MapController.addToRouteFromXY(HD.road.constants._STOP_TYPES.VIA,_MAP_X,_MAP_Y,_SEGMENT_ID);">'+HD.rp.text.addWaypoint+'</a><div class="sp"></div><a href="javascript:void(0)" onclick="HD.rp.MapController.centerMap(null,true);">'+HD.rp.text.centerHere+'</a><a class="_HIDE_SHOWRIDE" href="javascript:void(0)" onclick="HD.rp.MapController.showAllPins();">'+HD.rp.text.zoomToShowRide+'</a><a href="javascript:void(0)" onclick="HD.rp.MapController.zoomToStreet();">'+HD.rp.text.zoomToStreet+"</a>"},disambiguate:{className:"disambiguate",header:"<h3>Did you mean:</h3>",line:'<a href="javascript:void(0)" onclick="HD.rp.MyRide.handleDisambiguate(_PARAMS);HD.ui.Menu.hide();">_ADDRESS</a>'},mapTracker:'<table><tr><td><strong>x:</strong>&nbsp;_XVAL</td><td><strong>y:</strong>&nbsp;_YVAL</td></tr><tr><td><strong>lon:</strong>&nbsp;_LON</td><td><strong>lat:</strong>&nbsp;_LAT</td></tr><tr><td colspan="2"><strong>proximity&nbsp;(mi):</strong>&nbsp;_PROX</td></tr></table>',welcomeGuest:"<div>"+HD.rp.text.welcomeGuest+'</div><div><a href="javascript:void(0)" onclick="HD.rp.User.loginPendingFor=HD.rp.User._LOGIN_PENDING_FOR.LOGINLINK;HD.User.promptLogin();return false;">'+HD.rp.text.signIn+'</a>  or  <a href ="'+profileURL+'&locale=en_US&profilelook=sgr_look&hideTopNav=true&ignoredetection=true" target="_blank">'+HD.rp.text.createPersonalProfile+'</a></div><div><a href="javascript:void(0)" onclick="HD.rp.launchHelp();">'+HD.rp.text.needHelp+"</a></div>",welcomeUser:"<div>"+HD.rp.text.welcome+", _USER</div><div>"+HD.rp.text.youhave+'<a href="javascript:void(0)" onclick="HD.rp.User.loginPendingFor = HD.rp.User._LOGIN_PENDING_FOR.MYRIDES;if(!HD.User.promptLogin()) {return;};HD.rp.dialog.UserRoadList.init();return false;" id="welcomeRoadCount">_ROAD_COUNT '+HD.rp.text.savedRoads+'</a></div><div class="links"><a href ="'+profileURL+'&locale=en_US&profilelook=sgr_look&hideTopNav=true&ignoredetection=true" target="_blank">'+HD.rp.text.profile+'</a> | <a href="javascript:void(0)" onclick="HD.rp.launchHelp();">'+HD.rp.text.help+'</a> | <a href="javascript:void(0);" onclick="window.open(\''+logoutURL+"', '', 'width=800,height=650,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,directories=no,status=no');\">"+HD.rp.text.signOut+"</a></div>",welcomeGuestNoLogin:"<div>"+HD.rp.text.welcomeGuest+"</div><div>"+HD.rp.text.signIn+" or "+HD.rp.text.createPersonalProfile+"</div><div>"+HD.rp.text.needHelp+"</div></div>",movedRoadsMenuClass:"movedRoadsMenu",movedRoadsMenu:'<div class="ext"><div class="int5m">'+HD.rp.text.movedSuccessfully+"</div></div>",movedRoadsItemClass:"movedRoadsItem",movedRoadsItem:'<div class="ext"><div class="int2"><span class="rdtitle">_USER_ROAD_NAME</span></div></div>',roadLength:"_MI "+HD.rp.text.miles+" / _KM "+HD.rp.text.km,roadLengthMiles:"_MI&nbsp;"+HD.rp.text.miles,roadLengthKilometers:"_KM&nbsp;"+HD.rp.text.km,roadLengthMilesLB:"_MI<br/>"+HD.rp.text.miles,roadLengthKilometersLB:"_KM<br/>"+HD.rp.text.km,imageGallery:{gallery:'<table class="imageGallery"><tr><td></td><td class="content"><div class="swapImage1"></div><div class="swapImage2"></div></td><td></td></tr><tr class="navigation"><td class="_PREV_PAGE_CLASS" href="javascript:void(0);" onclick="HD.rp.dialog.RoadDetails.getPhotosData(_PREV_PAGE_INDEX);">&lt;</td><td class="thumbs">_THUMBS></td><td class="_NEXT_PAGE_CLASS" href="javascript:void(0);" onclick="HD.rp.dialog.RoadDetails.getPhotosData(_NEXT_PAGE_INDEX);">&gt;</td></tr></table>',thumb:'<img class="thumb" src="_THUMB_URL" id="_ID" />',image:'<img class="image" src="_IMAGE_URL" />'},usStatesDropDownOptions:'<option value="">'+HD.rp.text.state+'</option><option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option>',noteEditor:{html:'<div class="editor">_BASE</div><div class="noteShadow shadow"/></div><div class="noteArrow arrowBlackLeft shadow"/></div><div class="noteArrow noteArrowLeft"></div>',htmlCharLeft:"_BASE"},dateTime:{htmlDatePicker:"_BASE"},sendRoadSuccess:HD.rp.text.yourRideHasBeenSent+':<br/><br/>_RECIPIENTS<br/><table width="480" cellspacing="0" cellpadding="0" border="0"><tr><td align="center"><a class="btn" href="javascript:void(0)" onclick="HD.ui.Dialog.hide()">'+HD.rp.text.ok+"</a></td></tr></table>",sendRoadRecipient:"_RECIPIENT<br/>",sendRoadSubject:"_RECIPIENT "+HD.rp.text.hasSentYouARidePlan,permalinkRoadName:"<h2>_NAME</h2>",permalinkRoadDetails:"<div><strong>"+HD.rp.text.start+":</strong><span>_START</span></div><div><strong>"+HD.rp.text.end+":</strong><span>_END</span></div><div><strong>"+HD.rp.text.length+":</strong><span>_LENGTH</span></div><div><strong>"+HD.rp.text.duration+":</strong><span>_DURATION</span></div><div><strong>"+HD.rp.text.submittedBy+':</strong><span>_SUBMITTEDBY</span></div><div class="_BEST_TRAVEL_TIME_CLASS"><strong>'+HD.rp.text.bestTimeToTravel+':</strong><span>_BEST_TRAVEL_TIME</span></div><div class="_STATES_CLASS"><strong>'+HD.rp.text.states+':</strong><span>_STATES</span></div><div class="_ROAD_SCENERY_CLASS"><strong>'+HD.rp.text.scenery+":</strong><span>_ROAD_SCENERY</span></div>",permalinkTextSeparator:", "};HD.rp.util={shapeInsideView:function(B){var A=HD.rp.hdMap.map.LatLongToPixel(new VELatLong(B.Latitude,B.Longitude));A=[A.x+HD.rp.hdMap.map.GetLeft(),A.y+HD.rp.hdMap.map.GetTop()];return !HD.util.pointOutsideBounds(A,HD.rp.hdMap.map.mapelement)},formatRoadLength:function(A,B){if(A==null||typeof A=="undefined"){return null}return HD.util.template((B!=null)?B:HD.rp.HTML.roadLength,{_MI:A.toFixed(HD.road.constants._DISTANCE_SCALE),_KM:HD.util.Math.toKilometers(A).toFixed(HD.road.constants._DISTANCE_SCALE)})},formatRoadLengthMiles:function(B,A){return this.formatRoadLength(B,!!A?HD.rp.HTML.roadLengthMilesLB:HD.rp.HTML.roadLengthMiles)},formatRoadLengthKilometers:function(B,A){return this.formatRoadLength(B,!!A?HD.rp.HTML.roadLengthKilometersLB:HD.rp.HTML.roadLengthKilometers)},formatDate:function(A){return HD.util.Date.formatDate(A,HD.content.Date.FORMAT.WMDYlong)}};HD.rp.util.Hitbox=new HD.util.Hitbox({accounts:{HD:(!!window._acct?window._acct.split(";")[0]||"":"")||"DM5201108HDV10EN3",RP:(!!window._acct?window._acct.split(";")[1]||"":"")||"DM52081637BW10EN3"},categories:{HD:"/Experience/Rideplanner",RP:""},rules:{r:[{c:"Application",p:"application",r:[{c:"Signed+In",p:"signed_in",r:[{c:"View+Saved+Roads",p:"view_roads",r:[{c:"Delete+Road",p:"delete_road"},{c:"Convert+Old+Road",p:"convert_road"}]}]},{c:"Map",r:[{c:"View",r:[{c:"Road",p:"view_road"},{c:"Aerial",p:"view_aerial"},{c:"Mixed",p:"view_mixed"}]},{c:"Show",r:[{c:"Roads",p:"show_roads"},{c:"Dealers",p:"show_dealers"},{c:"Hotels",p:"show_hotels"},{c:"Events",p:"show_events"},{c:"Fuel",p:"show_fuel"}]},{c:"Hide",r:[{c:"Roads",p:"hide_roads"},{c:"Dealers",p:"hide_dealers"},{c:"Hotels",p:"hide_hotels"},{c:"Events",p:"hide_events"},{c:"Fuel",p:"hide_fuel"}]}]},{c:"My+Ride",r:[{c:"Add+Location",r:[{c:"User",r:[{c:"Map",x:["HD"],p:"add_loc_user"},{c:"Toolbar",x:["HD"],p:"add_loc_user"},{c:"URL",x:["HD"],p:"add_loc_user"}]},{c:"Dealer",r:[{c:"DealerID+Name",x:["HD"],p:"add_loc_dealer"}]},{c:"Facility",r:[{c:"FacilityID+Name",x:["HD"],p:"add_loc_facility"}]},{c:"Hotel",r:[{c:"HotelID+Name",x:["HD"],p:"add_loc_hotel"}]},{c:"Road",r:[{c:"Great+Road",x:["HD"],r:[{c:"RoadID+Name",p:"add_loc_road"}]},{c:"User+Road",x:["HD"],r:[{c:"RoadID+Name",p:"add_loc_road"}]}]},{c:"Event",r:[{c:"EventID+Name",x:["HD"],p:"add_loc_event"}]},{c:"Fuel",r:[{c:"FuelID+Name",x:["HD"],p:"add_loc_fuel"}]}]},{c:"Drag+Location",p:"drag_loc"},{c:"Remove+Location",r:[{c:"Map",x:["HD"],p:"remove_loc_map"},{c:"Toolbar",x:["HD"],p:"remove_loc_toolbar"}]},{c:"Change+Route",p:"change_route"},{c:"Switch+Routing",r:[{c:"Fastest",r:[{c:"Segment",p:"fast_routing_segment"},{c:"Global",p:"fast_routing_global"}]},{c:"Shortest",r:[{c:"Segment",p:"short_routing_segment"},{c:"Global",p:"short_routing_global"}]}]},{c:"Add+Waypoint",p:"add_way_pt"},{c:"Drag+Waypoint",p:"drag_way_pt"},{c:"Remove+Waypoint",p:"remove_way_pt"},{c:"Notes",r:[{c:"Add",p:"add_notes"},{c:"View",p:"view_notes"},{c:"Edit",p:"edit_notes"},{c:"Show",p:"show_notes"},{c:"Hide",p:"hide_notes"}]},{c:"Directions",r:[{c:"Show",p:"show_directions"},{c:"Hide",p:"hide_directions"}]},{c:"Reorder",r:[{c:"Up",p:"reorder_up"},{c:"Down",p:"reorder_down"}]},{c:"Roundtrip",p:"roundtrip"},{c:"Reverse+Route",p:"reverse_route"},{c:"Clear+Locations",p:"clear_locations"},{c:"Reset",p:"reset"},{c:"Save",r:[{c:"Form",p:"save_form"},{c:"Confirm",r:[{c:"Private",x:["HD"],p:"save_conf_private"},{c:"Public",x:["HD"],p:"save_conf_public"}]}]},{c:"Email",r:[{c:"Form",p:"email_form"},{c:"Confirm",r:[{c:"Recipients-SelfSends",x:["HD"],p:"email_confirm"}]}]},{c:"Print",r:[{c:"View",p:"print_view"},{c:"Confirm+Print",p:"Ov-OVERVIEW+Mp-MAPS+Dr-DIRECTIONS+Pl-PLACES+Ln-LOCALLINKS+It-ITINERARY+Dl-DEALERS+Ht-HOTELS+Ev-EVENTS+Fu-FUEL+Fs-FULLSIZE"}]}]},{c:"Roads",r:[{c:"Locations",r:[{c:"Show",p:"show_road_locations"},{c:"Hide",p:"hide_road_locations"}]},{c:"Show",r:[{c:"Great+Roads",p:"show_great_roads"},{c:"User+Roads",p:"show_user_roads"}]},{c:"Hide",r:[{c:"Great+Roads",p:"hide_great_roads"},{c:"User+Roads",p:"hide_user_roads"}]},{c:"More+Info",r:[{c:"RoadID+Name",x:["HD"],p:"more_info"},{c:"Overview",r:[{c:"RoadID+Name",x:["HD"],p:"overview"}]},{c:"Reviews",r:[{c:"RoadID+Name",x:["HD"],p:"reviews"}]},{c:"Photos",r:[{c:"RoadID+Name",x:["HD"],p:"photos"}]},{c:"Places+to+Visit",r:[{c:"RoadID+Name",x:["HD"],p:"places_to_visit"}]},{c:"Sample+Itinerary",r:[{c:"RoadID+Name",x:["HD"],p:"itinerary"}]},{c:"Local+Links",r:[{c:"RoadID+Name",x:["HD"],p:"local_links"}]},{c:"Rate+Road",r:[{c:"RoadID+Name",x:["HD"],p:"road_rating"}]},{c:"Create+Review",p:"review_form"},{c:"Submit+Review",p:"review_submit"},{c:"Print+View",p:"print_view"},{c:"Confirm+Print",p:"Ov-OVERVIEW+Mp-MAPS+Dr-DIRECTIONS+Pl-PLACES+Ln-LOCALLINKS+It-ITINERARY+Dl-DEALERS+Ht-HOTELS+Ev-EVENTS+Fu-FUEL+Fs-FULLSIZE"}]}]},{c:"Dealers",r:[{c:"More+Info",r:[{c:"DealerID+Name",x:["HD"],p:"view_dealer_info"}]},{c:"View+Dealer+Website",r:[{c:"DealerID+Name",x:["HD"],p:"view_dealer_site"}]}]},{c:"Hotels",r:[{c:"Book",r:[{c:"HotelID+Name",x:["HD"],p:"book_hotel"}]}]},{c:"Events",r:[{c:"More+Info",r:[{c:"EventID+Name",x:["HD"],p:"event_info"}]}]},{c:"Facilities",r:[{c:"More+Info",r:[{c:"FacilityID+Name",x:["HD"],p:"facility_info"}]},{c:"Purchase+Tickets",r:[{c:"FacilityID+Name",x:["HD"],p:"purchase_tickets"}]}]},{c:"GPS",p:"gps",r:[{c:"Detect+Devices",p:"gps_detect_devices"},{c:"Export",r:[{c:"Automatic",r:[{c:"RoadID+Name",x:["HD"],p:"gps_export_automatic"}]},{c:"Manual",r:[{c:"RoadID+Name",x:["HD"],p:"gps_export_manual"}]}]},{c:"Import",r:[{c:"Automatic",r:[{c:"RoadID+Name",x:["HD"],p:"gps_import_automatic"}]},{c:"Manual",r:[{c:"RoadID+Name",x:["HD"],p:"gps_import_manual"}]}]}]}]},{c:"Receive+Shared+Plan",p:"share_plan_open",r:[{c:"Print",p:"share_print"},{c:"View+Or+Edit+Plan",p:"share_edit_view"},{c:"Start+New",p:"share_new"}]},{c:"Landing",p:"landing",r:[{c:"Intro",p:"intro"},{c:"Build",p:"build"},{c:"Save",p:"save"},{c:"Share",p:"share"},{c:"Launch",p:"launch"},{c:"More+Info",r:[{c:"Intro",r:[{c:"New+and+Improved+Technology",p:"new_technology"},{c:"Location+Based+Services",p:"services"},{c:"Great+Roads+and+Submitted+Roads",p:"roads"},{c:"New+Ride+Planning+Features+More",p:"new_features"}]},{c:"Build",r:[{c:"Create+Your+Own+Route",p:"create_own_route"},{c:"Interest+Right+Click",p:"interest_rt_click"},{c:"Waypoints",p:"waypoints"},{c:"Interest+Dealers+Hotels",p:"interest_dealers_hotels"}]},{c:"Save",r:[{c:"Manage",p:"manage"},{c:"Save",p:"save"},{c:"Update",p:"update"},{c:"Send",p:"send"}]},{c:"Share",r:[{c:"Share+Route",p:"share_route"},{c:"Update+Public+Ride",p:"update_ride"},{c:"View+Submitted+Plans",p:"view_submitted_plans"}]}]},{c:"Launch+Old+Rideplanner",p:"launch_old_rideplanner"},{c:"Launch+Rideplanner",r:[{c:"Home+Page",p:"launch_rideplanner"},{c:"Great+Road",p:"launch_rideplanner"},{c:"User+Submitted+Road",p:"launch_rideplanner"},{c:"Intro",r:[{c:"New+and+Improved+Technology",p:"launch_rideplanner"},{c:"Location+Based+Services",p:"launch_rideplanner"},{c:"Great+Roads+and+Submitted+Roads",p:"launch_rideplanner"},{c:"New+Ride+Planning+Features+More",p:"launch_rideplanner"}]},{c:"Build",r:[{c:"Create+Your+Own+Route",p:"launch_rideplanner"},{c:"Interest+Right+Click",p:"launch_rideplanner"},{c:"Waypoints",p:"launch_rideplanner"},{c:"Interest+Dealers+Hotels",p:"launch_rideplanner"}]},{c:"Save",r:[{c:"Manage",p:"launch_rideplanner"},{c:"Save",p:"launch_rideplanner"},{c:"Update",p:"launch_rideplanner"},{c:"Send",p:"launch_rideplanner"}]},{c:"Share",r:[{c:"Share+Route",p:"launch_rideplanner"},{c:"Update+Public+Ride",p:"launch_rideplanner"},{c:"View+Submitted+Plans",p:"launch_rideplanner"}]},{c:"Launch",p:"launch_rideplanner"}]}]},{c:"Help",p:"help",r:[{c:"Map+Controls",p:"help_map"},{c:"Navigating+the+Map",p:"help_navigate"},{c:"Map+Views",p:"help_map_views"},{c:"Link+to+this+Page",p:"help_link"},{c:"Using+App",p:"help_using_app"},{c:"Creating+Plan",p:"help_creating_ride"},{c:"Modifying+Plan",p:"help_modify_ride"},{c:"Location+Details",p:"help_loc_details"},{c:"Clear+Locations",p:"help_clear_loc"},{c:"Driving+Directions",p:"help_directions"},{c:"Adding+Notes",p:"help_add_notes"},{c:"Roundtrip",p:"help_roundtrip"},{c:"Reverse+Route",p:"help_reverse_route"},{c:"Using+Waypoints",p:"help_waypoints"},{c:"Saving+Plan",p:"help_save_plan"},{c:"Public+vs+Private",p:"help_private_public"},{c:"New+Features",p:"help_features"},{c:"View+Roads",p:"help_view_roads"},{c:"View+Dealers",p:"help_view_dealers"},{c:"View+Hotels",p:"help_view_hotels"},{c:"Accessing+Saved+Plans",p:"help_access_plan"},{c:"E-mailing+Plan",p:"help_email"},{c:"Printing",p:"help_print"},{c:"Old+Ride+Plans",p:"help_old_plan"},{c:"Legend",p:"help_legend"}]}]}});HD.rp.service.DealerServicesTypes={MOTORCYCLES:"motorcycles",SERVICE:"service",MOTORCLOTHES:"motorclothes",ACCESSORIES:"accessories",ECOMMERCE:"ecommerce",RENTALS:"rentals",RIDERSEDGE:"ridersEdge",HOGCHAPTER:"hogChapter",HOGFLY:"hogFly",BUELL:"buell",BRAG:"brag",getAll:function(){return[this.MOTORCYCLES,this.SERVICE,this.MOTORCLOTHES,this.ACCESSORIES,this.ECOMMERCE,this.RENTALS,this.RIDERSEDGE,this.HOGCHAPTER,this.HOGFLY,this.BUELL,this.BRAG]}};HD.rp.service.DealerDetails=function(A){var B=HD.rp.service.DealerServicesTypes;this.data=A;this[B.MOTORCYCLES]=A.motorcycles;this[B.SERVICE]=A.service;this[B.MOTORCLOTHES]=A.motorclothes;this[B.ACCESSORIES]=A.accessories;this[B.ECOMMERCE]=A.ecommerce;this[B.RENTALS]=A.rentals;this[B.RIDERSEDGE]=A.ridersEdge;this[B.HOGCHAPTER]=A.hogChapter;this[B.HOGFLY]=A.hogFly;this[B.BUELL]=A.buell;this[B.BRAG]=A.brag};HD.rp.service.DealerDetails.prototype.generateView=function(){var B=this.data;var A=HD.rp.dialog.HTML.dealerDetails;A=A.replace(/_DEALER_NAME/,B.dealerName);A=A.replace(/_ADDRESS_LINE_ONE/,B.addr1);A=A.replace(/_ADDRESS_LINE_TWO/,B.city+", "+B.state+" "+B.postalCode);A=A.replace(/_PHONE/,B.phone);A=A.replace(/_FAX/,B.fax);A=A.replace(/_DEALER_URL/g,B.url||"");A=A.replace(/_DEALER_ID/g,HD.util.rtrim(B.dealerNumber||""));A=A.replace(/_HAS_URL/g,!B.url?"hide":"");A=A.replace(/_HOURS/,this.generateHoursView());A=A.replace(/_CHAPTER_NAME/,B.hogChapname);A=A.replace(/_CHAPTER_URL/g,B.hogChaplink);A=A.replace(/_SERVICES_CONTENT/,this.generateServicesView());return A};HD.rp.service.DealerDetails.prototype.generateServicesView=function(){var E=HD.rp.service.DealerServicesTypes.getAll();var F=HD.rp.dialog.HTML.dealerServices;var C=new Array();for(var B=0,A=E.length;B<A;B++){var D=E[B];if(this[D]==true){C.push(F[D])}}return C.join("")};HD.rp.service.DealerDetails.prototype.generatePrintView=function(){var D=this.data;var C=HD.rp.dialog.HTML.dealerDetailsPrint;if(D.hogChapname){C=C.replace(/_HOG_CHAPTER_CLASS/,HD.rp.HTML.noClass);C=C.replace(/_HOG_CHAPTER_DATA/,D.hogChapname)}else{C=C.replace(/_HOG_CHAPTER_CLASS/,HD.rp.HTML.hiddenClass)}var B=this.generateServicesView();if(HD.util.hasValue(B)){C=C.replace(/_DEALER_SERVICES_CLASS/,HD.rp.HTML.noClass);C=C.replace(/_DEALER_SERVICES_DATA/,B)}else{C=C.replace(/_DEALER_SERVICES_CLASS/,HD.rp.HTML.hiddenClass)}var A=this.generateHoursView();if(HD.util.hasValue(A)){C=C.replace(/_DEALER_HOURS_CLASS/,HD.rp.HTML.noClass);C=C.replace(/_DEALER_HOURS_DATA/,A)}else{C=C.replace(/_DEALER_HOURS_CLASS/,HD.rp.HTML.hiddenClass)}return C};HD.rp.service.DealerDetails.prototype.generateHoursView=function(){var B=this.data;if(HD.util.hasValue(B.dealerHours)){var A=B.dealerHours;A=A.replace(/(<br\s*\/?>)?Monday/,"<br/>"+HD.content.Date.DAYS[1].l);A=A.replace(/(<br\s*\/?>)?Tuesday/,"<br/>"+HD.content.Date.DAYS[2].l);A=A.replace(/(<br\s*\/?>)?Wednesday/,"<br/>"+HD.content.Date.DAYS[3].l);A=A.replace(/(<br\s*\/?>)?Thursday/,"<br/>"+HD.content.Date.DAYS[4].l);A=A.replace(/(<br\s*\/?>)?Friday/,"<br/>"+HD.content.Date.DAYS[5].l);A=A.replace(/(<br\s*\/?>)?Saturday/,"<br/>"+HD.content.Date.DAYS[6].l);return A}return""};HD.rp.service.RoadManagerEvents={ON_FOUND_NO_ROADS:"on_found_no_roads",ON_FOUND_ROADS:"on_found_roads",ON_GOT_ROAD:"on_got_road",ON_DELETED_ROAD:"on_deleted_road"};HD.rp.service.RoadManager=function(B,A){this.callbacks=B||{};this.roadView=A;this.roadCache={};this.roadOrder=new Array();this.activeFinds=0;this.activeGets=0;this.activeGetRequests={}};HD.rp.service.RoadManager.prototype.find=function(A){this.incrementActiveFinds();A=HD.util.cloneObject(A);var E=HD.rp.DWR.getCallMetaData(function(F){D.handleFind.call(D,F)},function(){D.handleFindError.call(D)});var C;var D=this;if(A.id){delete A.zoom;C={road:A,geometryType:HD.rp.constants._GEOMETRY_TYPE.NONE};RoadService.getRoad(C,E)}else{var B=A.zoom;delete A.zoom;C=A;if(!!A.access){RoadService.getRoadsInBox(C,E)}else{if(A.userSubmitted==false&&B>=0&&B<HD.rp.constants._MIN_ZOOM_LEVELS.USER_ROADS){RoadService.getBywaysInBox(C,E)}else{if(B<HD.rp.constants._MIN_ZOOM_LEVELS.ROAD_INTERSECTS){RoadService.findEnvIntersects(C,E)}else{RoadService.findIntersects(C,E)}}}}};HD.rp.service.RoadManager.prototype.handleFind=function(E){if(E.road){var D=this.convertFromJavaRoad(E.road);this.roadOrder=[D.data.id];D.visId=1;this.copyFields(D);var C={roadsList:[D]};this.executeCallback(HD.rp.service.RoadManagerEvents.ON_FOUND_ROADS,C);this.getData(D,D[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE])}else{if(E.results){this.roadOrder=new Array();var I=E.results;var J=I.length;var G=E.resultIndex;var K=new Array();var L,B;for(var H=0;H<J;H++){L=this.convertFromJavaRoad(I[H]);this.copyFields(L);B=L.data.id;L.visId=H+1+G;this.roadOrder.push(B);K.push(L)}I=K;var A={roadsList:I,pageIndex:E.pageNumber,recordIndex:G,recordsOnPage:J,totalPageCount:E.totalPageCount,totalRecordsCount:E.totalResultCount};this.executeCallback(HD.rp.service.RoadManagerEvents.ON_FOUND_ROADS,A);for(var F=0;F<J;F++){L=I[F];this.getData(L,L[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE])}}else{this.roadOrder.length=0;this.executeCallback(HD.rp.service.RoadManagerEvents.ON_FOUND_NO_ROADS)}}this.decrementActiveFinds()};HD.rp.service.RoadManager.prototype.handleFindError=function(){this.decrementActiveFinds()};HD.rp.service.RoadManager.prototype.getData=function(B,D){var H=B.data.id;var A=B.visId;var G=B[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE];var C=B[HD.rp.constants._SHOW_POLYLINE_OVERRIDE_ATTRIBUTE];var E=this.getCachedRoad(H);if((D)&&((B.isEmpty())&&((E==null)||(E.isEmpty())))&&!this.activeGetRequests[HD.util.rtrim(H)]){var F=this;this.get(H,B.data.userSubmitted,D,function(I){F.gotRoad.call(F,I,A,G,C)})}else{this.incrementActiveGets();if(E==null){E=B;this.roadCache[B.data.id]=E}this.gotRoad(E,A,G,C);this.decrementActiveGets()}};HD.rp.service.RoadManager.prototype.get=function(H,E,C,D){if(!this.activeGetRequests[HD.util.rtrim(H)]){this.incrementActiveGets();var G=HD.rp.DWR.getCallMetaData(function(I){A.handleGet.call(A,I,D)},function(){A.handleGetError.call(A,H,E)});var B=(C)?HD.rp.constants._GEOMETRY_TYPE.SEGMENTS:HD.rp.constants._GEOMETRY_TYPE.NONE;var F={road:{id:H,userSubmitted:E},geometryType:B,provideImage:true};var A=this;this.activeGetRequests[HD.util.rtrim(H)]=[D];RoadService.getRoad(F,G)}else{if(!!D){this.activeGetRequests[HD.util.rtrim(H)].push(D)}}};HD.rp.service.RoadManager.prototype.handleGet=function(B,E){if(!B.road){log("SUPER BAD ERROR! FAILED TO FIND SAVED ROAD")}else{var A=this.convertFromJavaRoad(B.road);this.copyFields(A);this.roadCache[A.data.id]=A;if(E!=null){E(A)}else{this.executeCallback(HD.rp.service.RoadManagerEvents.ON_GOT_ROAD,A)}if(!!this.activeGetRequests[HD.util.rtrim(A.data.id)]){var D=this.activeGetRequests[HD.util.rtrim(A.data.id)];for(var C=0;C<D.length;C++){if(D[C]!=E){D[C](A)}}delete this.activeGetRequests[HD.util.rtrim(A.data.id)]}}this.decrementActiveGets()};HD.rp.service.RoadManager.prototype.handleGetError=function(F,D){try{var C=YAHOO.util.Dom.getElementsByClassName("r","div",$("road_list_"+F))[0];var A=C.childNodes;for(var B=A.length-1;B>=0;B--){if(A[B].nodeName.match(/^(div|br)$/i)){C.removeChild(A[B])}}C.innerHTML+=HD.rp.HTML.roadList.failureCode}catch(E){}this.decrementActiveGets()};HD.rp.service.RoadManager.prototype.gotRoad=function(B,A,D,C){B.visId=A;this.copyFields(B);this.executeCallback(HD.rp.service.RoadManagerEvents.ON_GOT_ROAD,B)};HD.rp.service.RoadManager.prototype.remove=function(B){var A=this;RoadService.deleteRoad({road:{id:B}},function(C){if(C==null){HD.User.userReconnect()}else{A.handleRemove.call(A,C)}})};HD.rp.service.RoadManager.prototype.handleRemove=function(B){if(!B.road){}else{var A=HD.road.DWR.javaRoadToRoute(B.road);this.executeCallback(HD.rp.service.RoadManagerEvents.ON_DELETED_ROAD,A)}};HD.rp.service.RoadManager.prototype.getCallback=function(A){return this.callbacks[A]};HD.rp.service.RoadManager.prototype.getRoadIndex=function(B){for(var A=0;A<this.roadOrder.length;A++){if(this.roadOrder[A]==B){return A+1}}return -1};HD.rp.service.RoadManager.prototype.getCachedRoad=function(A){return this.roadCache[A]};HD.rp.service.RoadManager.prototype.getAllCachedRoads=function(C){var B=C||new Array();for(var A=0;A<this.roadOrder.length;A++){B.push(this.getCachedRoad(this.roadOrder[A]))}return B};HD.rp.service.RoadManager.prototype.executeCallback=function(B,C,A){if(A){return }var D=this.getCallback(B);if(D){D(C)}};HD.rp.service.RoadManager.prototype.setRoadType=function(A){if(A.userSubmitted||(A.data!=null&&A.data.userSubmitted)){A.type=HD.road.constants._STOP_TYPES.USER_ROAD}else{A.type=HD.road.constants._STOP_TYPES.GREAT_ROAD}};HD.rp.service.RoadManager.prototype.incrementActiveFinds=function(){this.activeFinds++};HD.rp.service.RoadManager.prototype.decrementActiveFinds=function(){if(this.activeFinds>0){this.activeFinds--}};HD.rp.service.RoadManager.prototype.incrementActiveGets=function(){this.activeGets++};HD.rp.service.RoadManager.prototype.decrementActiveGets=function(){if(this.activeGets>0){this.activeGets--}};HD.rp.service.RoadManager.prototype.convertFromJavaRoad=function(C){var A=HD.road.DWR.javaRoadToRoute(C);this.setRoadType(A);var B=A.type;var D=A.getStart();while(D!=null){D.type=B;D=D.next()}return A};HD.rp.service.RoadManager.prototype.copyFields=function(A){var B=this.getCachedRoad(A.data.id);if(B==null){return }A[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]=B[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE];A[HD.rp.constants._SHOW_POLYLINE_OVERRIDE_ATTRIBUTE]=B[HD.rp.constants._SHOW_POLYLINE_OVERRIDE_ATTRIBUTE]};HD.rp.service.RoadData=function(A){this.callbacks=A};HD.rp.service.RoadData.prototype.getData=function(F,H,D){var C=H;var I=F;var G=this.checkPageIndex(D,C._FIRST_PAGE);var A=HD.rp.constants._PAGE_SIZE.ROAD_DETAILS;var B=this.getCache(I,C._CACHE_FIELD);var E=this;OverviewService[C._FUNCTION]({roadId:F.data.id,pageNumber:G,pageSize:A},function(J){B.pageNumber=G;B.resultIndex=J.resultIndex;B.pages=J.totalPageCount;B.results=J.totalResultCount;B.pageSize=A;B.data[G]=J.results;E.handleData.call(E,I,C,G,B)})};HD.rp.service.RoadData.prototype.getCache=function(A,B){if(A[B]==null){A[B]={data:new Array()}}return A[B]};HD.rp.service.RoadData.prototype.handleData=function(B,D,A,C){if(!C.data[A]||C.data[A].length==0){this.executeCallback(D._NO_DATA,B)}else{this.executeCallback(D._YES_DATA,B,C,A)}};HD.rp.service.RoadData.prototype.executeCallback=function(D,B,C,A){var E=this.callbacks[D];if(E!=null){E(B,C,A)}};HD.rp.service.RoadData.prototype.checkPageIndex=function(A,B){return(A==null)?B:A};HD.rp.service.RoadDataTypes={_REVIEWS:{_FIRST_PAGE:HD.rp.constants._FIRST_PAGE_INDEX,_CACHE_FIELD:"reviews",_FUNCTION:"getReviews",_YES_DATA:"yes_review_data",_NO_DATA:"no_review_data"},_PHOTOS:{_FIRST_PAGE:HD.rp.constants._NO_PAGING_INDEX,_CACHE_FIELD:"photos",_FUNCTION:"getImageGallery",_YES_DATA:"yes_photo_data",_NO_DATA:"no_photo_data"},_PLACES:{_FIRST_PAGE:HD.rp.constants._FIRST_PAGE_INDEX,_CACHE_FIELD:"places",_FUNCTION:"getPlacesToVisit",_YES_DATA:"yes_places_data",_NO_DATA:"no_places_data"},_ITINERARY:{_FIRST_PAGE:HD.rp.constants._FIRST_PAGE_INDEX,_CACHE_FIELD:"itinerary",_FUNCTION:"getItineraries",_YES_DATA:"yes_itinerary_data",_NO_DATA:"no_itinerary_data"},_LINKS:{_FIRST_PAGE:HD.rp.constants._NO_PAGING_INDEX,_CACHE_FIELD:"links",_FUNCTION:"getWebLinks",_YES_DATA:"yes_links_data",_NO_DATA:"no_links_data"},_CONTACTS:{_FIRST_PAGE:HD.rp.constants._NO_PAGING_INDEX,_CACHE_FIELD:"contacts",_FUNCTION:"getLocalInformation",_YES_DATA:"yes_contacts_data",_NO_DATA:"no_contacts_data"}};HD.rp.service.PointsList=function(B){this.poiType=B;this.lastSearchTime=0;var A=this;this.services={getDataInBox:function(C){EntityService.findEntitiesInBox(C,function(D){A.handleGetData.call(A,D,false)})},getDataAlongRoute:function(C){EntityService.findEntitiesAlongRoute(C,function(D){A.handleGetData.call(A,D,false)})},getEntityData:function(C){if(A.poiType==HD.rp.constants._POI_TYPES.DEALER){EntityService.getDealers(C,function(D){A.handleGetEntityData.call(A,D)})}}};this.callbacks={handleGetDataInBox:null,handleGetDataAlongRoute:null,handleGetEntityData:null,clear:null};this.isActive=false;this.cache=[];this.entityCache={};this.pageCount=-1};HD.rp.service.PointsList.prototype={getDataInBox:function(A,D,C){if(this.poiType==HD.rp.constants._POI_TYPES.FACILITIES){return }var G=D.map||HD.rp.hdMap;var F=G.getCenter();var B=G.getNW();var E=G.getSE();delete D.map;D=D||{};D.type=D.type||this.poiType;D.point=F.Latitude+" "+F.Longitude;D.distance=HD.util.Math.getDistanceBetweenLatLng(B,F);D.boundingPoint1=B.Latitude+" "+B.Longitude;D.boundingPoint2=E.Latitude+" "+E.Longitude;D.pageSize=D.pageSize||HD.rp.constants._PAGE_SIZE.POIS;D.simplificationFactor=HD.rp.constants._SIMPLIFICATION_FACTOR;D.pageNumber=A;this.services.getDataInBox(D);this.lastSearchTime=new Date().getTime();this.isActive=true;return true},getDataAlongRoute:function(A,C,D){if(this.poiType==HD.rp.constants._POI_TYPES.FACILITIES){return }var G=HD.rp.hdMap;var B=G.getNW();var F=G.getSE();var E={type:this.poiType,stops:C,boundingPoint1:B.Latitude+" "+B.Longitude,boundingPoint2:F.Latitude+" "+F.Longitude,pageNumber:A,pageSize:HD.rp.constants._PAGE_SIZE.POIS,corridorWidth:HD.rp.constants._CORRIDOR_WIDTH[this.poiType],simplificationFactor:HD.rp.constants._SIMPLIFICATION_FACTOR};this.services.getDataAlongRoute(E);this.lastSearchTime=new Date().getTime();this.isActive=true;return true},handleGetData:function(D,E){this.isActive=false;var A=D.pageNumber;this.cache[A]=[];var F=D.results;var C=HD.road.DWR.javaEntitiesToStops(F);for(var B=0;B<C.length;B++){var G=C[B];if(A>0){G.visId=B+1+(HD.rp.constants._PAGE_SIZE.POIS*(A-1))}else{G.visId=B+1}this.addDataModel(G)}this.cache[A]=C;this.pageCount=D.totalPageCount;if(E){this.callbacks.handleGetDataAlongRoute(this.cache[A],A,this.pageCount)}else{this.callbacks.handleGetDataInBox(this.cache[A],A,this.pageCount,D.resultIndex,this.cache[A].length,D.totalResultCount)}},getEntityData:function(B,A){if(this.callbacks.handleGetEntityData==null){return }this.isActive=true;this.services.getEntityData(B);return true},handleGetEntityData:function(A){this.isActive=false;this.callbacks.handleGetEntityData(A)},clearData:function(){if(this.callbacks.clear){this.callbacks.clear()}},getDataModel:function(H){for(var B=0,A=this.cache.length;B<A;B++){var G=this.cache[B];if(G==null){continue}for(var C=0,F=G.length;C<F;C++){var E=G[C];if(E.id==H||E.data.id==H||(!!E.data.detailKey&&HD.util.rtrim(E.data.detailKey)==H)){return G[C]}}}var D=this.entityCache[H];return !!D?D:null},getCachedData:function(A){return this.cache[A]},addDataModel:function(A){this.entityCache[A.data.id]=A;if(A.data.detailKey){this.entityCache[HD.util.rtrim(A.data.detailKey)]=A}}};HD.rp.service.MapImage={getRouteStops:function(A){var B=new Array();var C=A.getStart();while(C!=null){B.push(this.serializeStop(C,this.getStopType(C)));C=C.nextStop()}return B},getStopType:function(B){var C=B.type;var A=B.getEntity();if(HD.util.hasValue(A)){switch(A.type){case HD.rp.constants._POI_TYPES.DEALER:return 11;case HD.rp.constants._POI_TYPES.HOTEL:return 12;case HD.rp.constants._POI_TYPES.EVENT:return 13;case HD.rp.constants._POI_TYPES.FUEL:return 14;default:break}}return C},serializeStop:function(A,C){var B=HD.util.hasValue(C)?C:A.type;return{visId:A.getVisId(),latitude:A.latitude,longitude:A.longitude,type:B}},requestMap:function(L,N,B,O){var P=HD.rp.service.MapImage.getRouteStops(N);var G=[];var H=[];if(N!=null){var A=N.getStart();if(HD.util.hasValue(A)){var J=A.segmentOut;while(J!=null){var F=J.data.routePreference==HD.road.constants._ROUTE_PREFERENCE_SHORTEST?"Shortest":"Quickest";var Q=J.start;H.push({waypoint:{latitude:Q.latitude,longitude:Q.longitude},preference:F});var D=J.getVias();if(D!=null){for(var M=0,K=D.length;M<K;M++){var I=D[M];H.push({waypoint:{latitude:I.latitude,longitude:I.longitude},preference:F})}}J=J.nextSegment()}}}var E={poisRequest:B,roadType:N.type,maps:L,stops:P,segments:H,simplificationFactor:HD.rp.constants._SIMPLIFICATION_FACTOR};var C=O;MapImageService.getMapImages(E,function(U){var X=U.entityData;var Y=U.mapUrls;if(HD.util.hasValue(X)){for(var W in X){var V=X[W];var T=HD.road.DWR.javaEntitiesToStops(V);for(var S=0;S<T.length;S++){T[S].visId=S+1}X[W]=T}}C(U)})}};HD.rp.renderer={};HD.rp.renderer.getMapPin=function(A,C){var B=new VEShape(VEShapeType.Pushpin,A.getVELatLong());B.SetCustomIcon(HD.rp.renderer.getPinHTML(A,null,C));B[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]=A.id;B[HD.rp.constants._POINT_TYPE_ID_ATTRIBUTE]=A.type;return B};HD.rp.renderer.getPinHTML=function(A,C,G){if(!A){return }var F="";switch(A.type){case HD.road.constants._STOP_TYPES.STOP:F=!!C?HD.rp.HTML.stopPinList:HD.rp.HTML.stopPin;var B=A.getEntity();switch(B.type){case HD.rp.constants._POI_TYPES.DEALER:F=HD.util.template(F,{_ENTITY_TYPE:HD.rp.HTML.stopDealerPinClass});break;case HD.rp.constants._POI_TYPES.HOTEL:var E=-1;if(!!A.data.rating){E=A.data.rating}else{if(!!A.data.entityData){E=!!A.data.entityData.data?A.data.entityData.data.rating||-1:-1}}var D=E==2?HD.rp.HTML.stopHotelPreferredPinClass:HD.rp.HTML.stopHotelPinClass;F=HD.util.template(F,{_ENTITY_TYPE:D});break;case HD.rp.constants._POI_TYPES.EVENT:if(!!B.data&&A.has("dealer").end()){F=HD.util.template(F,{_ENTITY_TYPE:HD.rp.HTML.stopDealerEventPinClass})}else{F=HD.util.template(F,{_ENTITY_TYPE:HD.rp.HTML.stopEventPinClass})}break;case HD.rp.constants._POI_TYPES.FUEL:F=HD.util.template(F,{_ENTITY_TYPE:HD.rp.HTML.stopFuelPinClass});break;case HD.rp.constants._POI_TYPES.FACILITY:if(A.data.facilityType==HD.rp.constants._FACILITY_TYPES.FACILITY){F=HD.util.template(F,{_ENTITY_TYPE:HD.rp.HTML.stopFacilityPinClass})}else{if(A.data.facilityType==HD.rp.constants._FACILITY_TYPES.MUSEUM){F=HD.util.template(F,{_ENTITY_TYPE:HD.rp.HTML.stopMuseumPinClass})}}break;default:F=HD.util.template(F,{_ENTITY_TYPE:""});break}F=HD.util.template(F,{_NUM:A.getVisId()});break;case HD.road.constants._STOP_TYPES.HOTEL:F=A.data.rating==2?HD.rp.HTML.hotelPreferredPin:HD.rp.HTML.hotelPin;F=HD.util.template(F,{_NUM:A.getVisId()});break;case HD.road.constants._STOP_TYPES.DEALER:F=HD.rp.HTML.dealerPin;F=HD.util.template(F,{_NUM:A.getVisId()});break;case HD.road.constants._STOP_TYPES.EVENT:F=A.has("dealer").end()?HD.rp.HTML.dealerEventPin:HD.rp.HTML.eventPin;F=HD.util.template(F,{_NUM:A.getVisId()});break;case HD.road.constants._STOP_TYPES.FUEL:F=HD.rp.HTML.fuelPin;F=HD.util.template(F,{_NUM:A.getVisId()});break;case HD.road.constants._STOP_TYPES.GREAT_ROAD:F=HD.rp.HTML.greatRoadPin;F=HD.util.template(F,{_NUM:A.getVisId()});break;case HD.road.constants._STOP_TYPES.USER_ROAD:F=HD.rp.HTML.userRoadPin;F=HD.util.template(F,{_NUM:A.getVisId()});break;case HD.road.constants._STOP_TYPES.FACILITY:if(A.data.facilityType==HD.rp.constants._FACILITY_TYPES.FACILITY){F=HD.rp.HTML.facilityPin}else{if(A.data.facilityType==HD.rp.constants._FACILITY_TYPES.MUSEUM){F=HD.rp.HTML.museumPin}}F=HD.util.template(F,{_NUM:""});break;default:F=!!A.isStatic?HD.rp.HTML.viaPinStatic:HD.rp.HTML.viaPin;break}if(!C){F=F.replace(/\s*id=["'].+?["']/i,"")}F=HD.util.template(F,{_PANEL:!!G?"panel"+HD.util.capitalize(G):"panel"});return F};HD.rp.renderer.ridePoint={isInit:false,init:function(){this.isInit=true;this.listPanel=$(this.listPanel)},listPrefix:"ride_list_el_",pinPrefix:"ride_pin_el_",listPanel:HD.rp.constants._ELEMENT_IDS.RP_TABLE,mapPanel:"",clear:function(A){if(!A){return }var C=YAHOO.util.Event;if(!!A.listPinEl){C.removeListener(A.listEl,"mouseover");C.removeListener(A.listEl,"mouseout");C.removeListener(A.listPinEl,"click")}if(!!A.formEl){C.removeListener(A.formEl,"submit")}if(!!A.clickEls){for(var B=0;B<A.clickEls.length;B++){C.removeListener(A.clickEls[B],"click");A.clickEls[B]=null}}if(A.pinEl){HD.rp.layers.deleteShape(A.pinEl,HD.rp.constants._LAYER_TYPE.MY_RIDE)}if(A.listEl&&A.listEl.parentNode){A.listEl.parentNode.removeChild(A.listEl)}A.pinEl=null;A.listEl=null;A.listPinEl=null;A.noteEl=null;A.formEl=null;A.clickEls=[]},render:function(O){if(!O){return }if(!this.isInit){this.init()}this.clear(O);O.pinEl=HD.rp.renderer.getMapPin(O);O.pinEl[HD.rp.constants._IS_DRAG_ENABLED]=O.isDrag!=null?O.isDrag:true;O.pinEl[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]=O.id;HD.rp.layers.addShape(O.pinEl,HD.rp.layers.getLayerType(O),HD.rp.HTML.pinShadow);if(!!O.entityPinEl){HD.rp.MapController.getDataModel(O.entityPinEl[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]).pinEl=O.pinEl;if(!!O.entityPinEl.Primitives&&!!O.entityPinEl.Primitives[0]&&!!$(O.entityPinEl.Primitives[0].iid)){$(O.entityPinEl.Primitives[0].iid).style.display="none"}}if(O.type!=HD.road.constants._STOP_TYPES.STOP){return }var H=this.listPrefix+O.id;var D=document.getElementById(H);if(D==null){D=document.createElement("div");D.id=H}else{D.innerHTML=""}D.className=HD.rp.HTML.stopList.className;if(O.isStart()){YAHOO.util.Dom.addClass(D,"start")}if(O.isEnd()){YAHOO.util.Dom.addClass(D,"end")}var I=!!HD.rp.constants._STOP_RENAME?HD.rp.HTML.stopList.codeStopRename:HD.rp.HTML.stopList.code;I=HD.util.template(I,{_LAT_LONG:HD.DWR.formatPoint(O),_STOP_PIN:HD.rp.renderer.getPinHTML(O,true),_STOP_NAME:HD.util.convertToJSSafeHTMLString((function(){var P=O.getTitle();P=(P.length>24)?P.substring(0,19)+"...":P;return P})()),_INPUT_VALUE:HD.util.convertToJSSafeHTMLString(O.getLocation()),_ENTITY_CONTENT:O.getEntity().type?(function(){var S="";var P=HD.rp.MapController.getDataModel(O.getEntity().id);switch(O.getEntity().type){case HD.rp.constants._POI_TYPES.DEALER:if(!!P){S=HD.util.template(HD.rp.HTML.dealerList.entityContent,{_DEALER_ID:HD.util.rtrim(P.data.detailKey),_DEALER_URL:!!P.data.url?P.data.url:"",_HAS_URL:!P.data.url?"hide":""})}else{S=HD.rp.text.archivedDealer;YAHOO.util.Dom.addClass(D,HD.rp.HTML.archivedClass)}break;case HD.rp.constants._POI_TYPES.HOTEL:var Q=P.data.rating==2;S=HD.util.template(HD.rp.HTML.hotelList.entityContent,{_1HOTEL_ID:O.id,_IS_RF:Q?"":"hidden"});break;case HD.rp.constants._POI_TYPES.EVENT:if(!P){P=O.data.entityData}if(!!P){S=HD.util.template(HD.rp.HTML.eventList.entityContent,{_EVENT_DATE:HD.util.Date.formatDateSpan(P.data.startDate,P.data.endDate,HD.content.Date.FORMAT.MDYlong),_HAS_DATE:!!P.data.startDate&&!!P.data.endDate?"":"hide",_HAS_INFO:"",_HAS_NO_INFO:"hide",_EVENT_TYPE:HD.util.rtrim(P.data.type),_EVENT_OBJECTID:P.data.detailKey||""})}else{if(!HD.util.rtrim(O.getEntity().id||"")){S=HD.rp.text.eventLocation}else{S=HD.rp.text.archivedEvent;YAHOO.util.Dom.addClass(D,HD.rp.HTML.archivedClass)}}break;case HD.rp.constants._POI_TYPES.FUEL:if(!!P){S=HD.util.template(HD.rp.HTML.fuelList.entityContent,{_FUEL_ID:HD.util.rtrim(P.data.detailKey)})}else{S=HD.rp.text.archivedFuel;YAHOO.util.Dom.addClass(D,HD.rp.HTML.archivedClass)}break}return HD.util.template(HD.rp.HTML.stopList.entityCode,{_CONTENT:S})})():""});D.innerHTML=I;O.listEl=D;if(O.isStart()){var C=YAHOO.util.Dom.getElementsByClassName("start","div",this.listPanel);for(var G=0;G<C.length;G++){var M=HD.rp.MapController.getDataModel(C[G][HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]);if(!!M){this.render(M)}}if(this.listPanel.firstChild){this.listPanel.insertBefore(D,this.listPanel.firstChild)}else{this.listPanel.appendChild(D)}}else{if(O.isEnd()){var N=YAHOO.util.Dom.getElementsByClassName("end","div",this.listPanel);for(var E=0;E<N.length;E++){var B=HD.rp.MapController.getDataModel(N[E].getAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE));if(!!B){this.render(B)}}this.render(O.prevStop());this.listPanel.appendChild(D)}else{if(O.prev().listEl!=null){this.listPanel.insertBefore(D,O.prev().listEl.nextSibling)}else{this.listPanel.appendChild(D)}}}var J=YAHOO.util.Event;var K=HD.rp.constants._DATAMODEL_ID_ATTRIBUTE;var A=document.getElementById(HD.rp.HTML.stopPinClass);A.removeAttribute("id");O.listPinEl=A;O.listEl.setAttribute(K,O.id);J.addListener(O.listEl,"mouseover",function(){HD.rp.MapController.listPinOver(this)});J.addListener(O.listEl,"mouseout",function(){HD.rp.MapController.listPinOut(this)});A.setAttribute(K,O.id);J.addListener(A,"click",function(){HD.rp.MapController.listPinClick(this)});O.clickEls=[];var L=document.getElementById("note");L.removeAttribute("id");O.noteEl=L;var F=document.getElementById("addNotes");F.removeAttribute("id");O.clickEls.push(F);J.addListener(F,"click",HD.rp.renderer.NoteEditor.init(),{data:O.data});F=noteAddEl=document.getElementById("viewNotes");F.removeAttribute("id");O.clickEls.push(F);J.addListener(F,"click",HD.rp.renderer.NoteEditor.init(),{data:O.data});HD.rp.renderer.NoteEditor.inject(L,O.data.notes);F=document.getElementById("stopR");F.removeAttribute("id");F.setAttribute(K,O.id);O.clickEls.push(F);J.addListener(F,"click",function(){HD.rp.MyRide.removeStop(this)});F=document.getElementById("stopD");F.removeAttribute("id");F.setAttribute(K,O.id);O.clickEls.push(F);J.addListener(F,"click",function(){HD.rp.MyRide.moveStopDown(this)});F=document.getElementById("stopU");F.removeAttribute("id");F.setAttribute(K,O.id);O.clickEls.push(F);J.addListener(F,"click",function(){HD.rp.MyRide.moveStopUp(this)});F=document.getElementById("stopB");F.removeAttribute("id");F.setAttribute(K,O.id);O.clickEls.push(F);J.addListener(F,"click",function(){HD.rp.MyRide.changeAddress(this,this.parentNode.getElementsByTagName("input")[0],true)});F=document.getElementById("stopI");F.removeAttribute("id");O.clickEls.push(F);J.addListener(F,"click",function(){this.select()});if(!!HD.rp.constants._STOP_RENAME){F=document.getElementById("stopName");F.removeAttribute("id");F.setAttribute(K,O.id);if(!O.getEntity().type){F.setAttribute("title",HD.rp.text.clickToRename)}O.clickEls.push(F);J.addListener(F,"click",function(){HD.rp.MyRide.renameStop(this)});J.addListener(F,"mouseover",function(){document.body.style.cursor="pointer"});J.addListener(F,"mouseout",function(){document.body.style.cursor="default"});F=document.getElementById("stopN");F.removeAttribute("id");F.setAttribute(K,O.id);if(!O.getEntity().type){F.setAttribute("title",HD.rp.text.clickToRename)}O.clickEls.push(F);J.addListener(F,"click",function(){HD.rp.MyRide.renameStop(this)})}F=document.getElementById("stopForm");F.removeAttribute("id");F.setAttribute(K,O.id);O.formEl=F;J.addListener(F,"submit",function(){HD.rp.MyRide.changeAddress(this,this.getElementsByTagName("input")[0],true)});D.scrollIntoView(false);if(!!O.fitToMap){HD.rp.MapController.showAllPins();delete O.fitToMap}if(!!HD.rp.MyRide.addressesFromURL&&HD.rp.MyRide.addressesFromURL.length>0){HD.rp.MyRide.addressInput2.value=HD.rp.MyRide.addressesFromURL[0];HD.rp.MyRide.addNewLocation(HD.rp.MyRide.addressInput2.value,HD.rp.MyRide.addressInput2,true,true);HD.rp.MyRide.addressesFromURL=null}}};HD.rp.renderer.rideSegment={directionsPrefix:"ride_directions_",listPanel:HD.rp.constants._ELEMENT_IDS.RP_TABLE,segmentWidth:HD.util.isIE?5:6,segmentColor:new VEColor(255,0,0,0.7),segmentHLColor:new VEColor(156,0,0,1),hitboxWidth:HD.util.isIE?10:18,hitboxColor:new VEColor(0,255,0,0.01),hitboxHLColor:new VEColor(0,156,0,0.01),showAvoidHighways:false,ahSegmentColor:new VEColor(0,0,255,0.7),ahSegmentHLColor:new VEColor(0,0,156,1),routing:false,isInit:false,init:function(){this.isInit=true;this.listPanel=$(this.listPanel)},clear:function(C){if(!C){return }var B=C.pinEls;var A;if(B!=null){for(A=0;A<B.length;A++){HD.rp.layers.deleteShape(B[A],HD.rp.constants._LAYER_TYPE.MY_RIDE)}C.pinEls=null}if(C.polies&&C.polies.length>0){for(A=0;A<C.polies.length;A++){HD.rp.layers.deleteShape(C.polies[A],HD.rp.constants._LAYER_TYPE.MY_RIDE)}C.polies=null}if(C.listEl){YAHOO.util.Event.removeListener(C.listEl,"mouseover");YAHOO.util.Event.removeListener(C.listEl,"mouseout");YAHOO.util.Event.removeListener(C.listEl.getElementsByTagName("a")[0],"click");YAHOO.util.Event.removeListener(C.listEl.getElementsByTagName("input")[0],"change");if(HD.util.isIE){YAHOO.util.Event.removeListener(C.listEl.getElementsByTagName("input")[0],"click")}C.listEl.parentNode.removeChild(C.listEl);C.listEl=null}},render:function(G,F){if(!G){return }if(!this.isInit){this.init()}this.clear(G);if(G.isEmpty()){return }var I=G.getPointList();if(I!=null){var J=I.start.segmentOut;G.polies=new Array();var B=function(W,U,T,V){var X=new VEShape(VEShapeType.Polyline,W.getVELatLongs());X.myride=true;X.hitbox=!!V;X.SetLineWidth(U);X.SetLineColor(T);X.SetCustomIcon(HD.rp.HTML.myRideSegment);X[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]=G.id;X[HD.rp.constants._SEGMENT_END_ID_ATTRIBUTE]=W.end.id;X[HD.rp.constants._SEGMENT_START_LAT_LONG_ATTRIBUTE]=W.start.getVELatLong();X[HD.rp.constants._SEGMENT_END_LAT_LONG_ATTRIBUTE]=W.end.getVELatLong();X.HideIcon();X[HD.rp.constants._IS_DRAG_ENABLED]=true;return X};do{var M=B(J,this.segmentWidth,!!this.showAvoidHighways&&G.data.routePreference==HD.road.constants._ROUTE_PREFERENCE_SHORTEST?this.ahSegmentColor:this.segmentColor);var O=B(J,this.hitboxWidth,this.hitboxColor,true);O.segmentPoly=M;M.hitboxPoly=O;HD.rp.layers.addShape(M,HD.rp.constants._LAYER_TYPE.MY_RIDE);HD.rp.layers.addShape(O,HD.rp.constants._LAYER_TYPE.MY_RIDE);G.polies.push(O);G.polies.push(M);M.subsegment_id=J.id;O.subsegment_id=J.id;J=J.end.segmentOut}while(!J.isEmpty())}var D=this;var S=G;G.onMouseOver=function(T,U){D.mouseOver(S,T,U)};G.onMouseOut=function(){D.mouseOut(S)};var C=G.getVias();var E;if(C!=null){E=new Array(C.length);for(var P=0;P<C.length;P++){var Q=C[P];var L=HD.rp.renderer.getMapPin(Q);L[HD.rp.constants._IS_DRAG_ENABLED]=true;L[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]=Q.id;L[HD.rp.constants._SEGMENT_START_LAT_LONG_ATTRIBUTE]=!!Q.segmentIn&&!!Q.segmentIn.start?Q.segmentIn.start.getVELatLong():null;L[HD.rp.constants._SEGMENT_END_LAT_LONG_ATTRIBUTE]=!!Q.segmentOut&&!!Q.segmentOut.end?Q.segmentOut.end.getVELatLong():null;HD.rp.layers.addShape(L,HD.rp.constants._LAYER_TYPE.MY_RIDE);E[P]=L}}G.pinEls=E;var K=document.createElement("div");K.className=HD.rp.HTML.directionsList.className;K.segmentId=G.id;K.id=this.directionsPrefix+G.id;h=HD.rp.HTML.directionsList.code;h=HD.util.template(h,{_DISTANCE:HD.rp.util.formatRoadLengthMiles(G.data.distance),_DURATION:HD.util.Date.parseMilliseconds(G.data.duration),_AVOIDING:G.data.routePreference==HD.road.constants._ROUTE_PREFERENCE_SHORTEST?"checked":"",_DIRECTIONS:(function(){var U=G.directions;var T=[];if(U!=null){for(i=0;i<U.length;i++){T.push(HD.util.template(HD.rp.HTML.directionsList.rowCode,{_DIRECTIONS:HD.util.convertToJSSafeHTMLString(U[i].text.replace(/\//g," / ")),_DISTANCE:HD.rp.util.formatRoadLengthMiles(U[i].distance,true)}))}}return T.join("")})()});K.innerHTML=h;var N=K.getElementsByTagName("a")[0];YAHOO.util.Event.addListener(N,"click",function(){HD.rp.MyRide.toggleDirections(this)});N=K.getElementsByTagName("input")[0];var H=this;YAHOO.util.Event.addListener(N,"change",function(){H.routing=true;HD.rp.freezeMap();if(this.checked){HD.rp.util.Hitbox.track("Application/My+Ride/Switch+Routing/Shortest/Segment")}else{HD.rp.util.Hitbox.track("Application/My+Ride/Switch+Routing/Fastest/Segment")}G.toggleDirections=true;G.setRoutePreference(this.checked?HD.road.constants._ROUTE_PREFERENCE_SHORTEST:HD.road.constants._ROUTE_PREFERENCE_FASTEST)});if(HD.util.isIE){YAHOO.util.Event.addListener(N,"click",function(){this.blur()})}if(G.prev().listEl!=null){this.listPanel.insertBefore(K,G.prev().listEl.nextSibling)}else{this.listPanel.appendChild(K)}G.listEl=K;var A=G;YAHOO.util.Event.addListener(K,"mouseover",function(){A.onMouseOver(null,null)});YAHOO.util.Event.addListener(K,"mouseout",function(){A.onMouseOut()});if(!!G.toggleDirections){HD.rp.MyRide.toggleDirections(K.getElementsByTagName("a")[0],true);delete G.toggleDirections}else{if(K.nextSibling){K.nextSibling.scrollIntoView(false)}}this.routing=false;HD.rp.unfreezeMap()},oldCursor:"",mouseOver:function(D,C,B){if(D.isMouseOver){return }if(!!D.isMouseOverDelay){D.isMouseOver=true;return }D.isMouseOver=true;if(C&&B){this.oldCursor=HD.rp.mapDiv.style.cursor;HD.rp.mapDiv.style.cursor="url("+HD.constants.CURSOR_PATH+"/line_over.cur), pointer";this.createOverPolyImage(C,B)}for(var A=0;A<D.polies.length;A++){if(!D.polies[A].hitbox){D.polies[A].SetLineColor(!!this.showAvoidHighways&&D.data.routePreference==HD.road.constants._ROUTE_PREFERENCE_SHORTEST?this.ahSegmentHLColor:this.segmentHLColor)}}},mouseOut:function(B){B.isMouseOver=false;B.isMouseOverDelay=true;var A=this;setTimeout(function(){B.isMouseOverDelay=false;if(!B.isMouseOver){A.removeOverPolyImage();if(A.oldCursor){HD.rp.mapDiv.style.cursor=A.oldCursor}if(!!B.polies){for(var C=0;C<B.polies.length;C++){if(!B.polies[C].hitbox){B.polies[C].SetLineColor(!!A.showAvoidHighways&&B.data.routePreference==HD.road.constants._ROUTE_PREFERENCE_SHORTEST?A.ahSegmentColor:A.segmentColor)}}}if(!!A.shapeDragImage){A.endMovePolyImage()}}},25)},polyIcon:null,createOverPolyImage:function(A,F){if(!this.polyIcon){var E=HD.rp.hdMap.calculateOffset();var B=HD.rp.hdMap.xyToLatLong(A-E.x+30,F-E.y-15);this.polyIcon=new VEShape(VEShapeType.Pushpin,B);this.polyIcon.SetCustomIcon(HD.rp.HTML.myRideSegmentOverIcon);HD.rp.layers.addShape(this.polyIcon,HD.rp.constants._LAYER_TYPE.MY_RIDE);try{var C=$(this.polyIcon.Primitives[0].iid);C.parentNode.style.zIndex="99999999"}catch(D){}}},removeOverPolyImage:function(){if(!this.polyIcon){return }HD.rp.layers.deleteShape(this.polyIcon,HD.rp.constants._LAYER_TYPE.MY_RIDE);this.polyIcon=null},shapeDragImage:null,mouseMove:function(C,A,E){var D=HD.rp.hdMap.calculateOffset();var B=HD.rp.hdMap.xyToLatLong(A+8-D.x,E+8-D.y);if(!!this.polyIcon){this.polyIcon.SetPoints([HD.rp.hdMap.xyToLatLong(A-D.x+30,E-D.y-15)]);$(this.polyIcon.Primitives[0].iid).style.zIndex="99999999"}},createMovePolyImage:function(B){var A=new VEShape(VEShapeType.Pushpin,B);A.SetCustomIcon(HD.rp.HTML.myRideSegment);A.myride=true;HD.rp.layers.addShape(A,HD.rp.constants._LAYER_TYPE.MY_RIDE);return A},endMovePolyImage:function(){HD.rp.layers.deleteShape(this.shapeDragImage,HD.rp.constants._LAYER_TYPE.MY_RIDE);this.shapeDragImage=null}};HD.rp.renderer.rideTotals={totalsEl:null,isInit:false,init:function(){if(this.isInit){return }this.isInit=true;this.totalsEl=document.createElement("div");this.totalsEl.className=HD.rp.HTML.rideTotals.className;$("rideListWrapper").insertBefore(this.totalsEl,$("rideAddLocation"))},clear:function(){this.init();this.totalsEl.innerHTML="";this.totalsEl.style.display="none"},render:function(){this.init();var A=HD.rp.HTML.rideTotals.code;A=HD.util.template(A,{_DISTANCE:HD.rp.util.formatRoadLengthMiles(!!HD.rp.MyRide.route.data.distance?HD.rp.MyRide.route.data.distance:0),_DURATION:HD.util.Date.parseMilliseconds(!!HD.rp.MyRide.route.data.duration?HD.rp.MyRide.route.data.duration:0)});this.totalsEl.innerHTML=A;this.totalsEl.style.display="block"}};HD.rp.renderer.NoteEditor={init:function(){return function(D,C){var A=this;var B=new HD.ui.NoteEditor({value:C.data.notes||""});B.mouseover=true;YAHOO.util.Event.addListener(B.handle,"mouseover",function(F,E){HD.rp.renderer.NoteEditor.onMouseOver.apply(E.self,arguments)},{noteEditor:B,self:A});YAHOO.util.Event.addListener(B.handle,"mouseout",function(F,E){HD.rp.renderer.NoteEditor.onMouseOut.apply(E.self,arguments)},{noteEditor:B,self:A});B.events.save.subscribe(function(){HD.rp.renderer.NoteEditor.onSave.call(B,A.parentNode.parentNode,C.data)});B.events.destroy.subscribe(function(){YAHOO.util.Event.removeListener(B.handle,"mouseover");YAHOO.util.Event.removeListener(B.handle,"mouseout")});HD.ui.Menu.show(A.parentNode.parentNode,B.handle,"rt",null,{offset:[6,-20+A.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.scrollTop],onHide:function(){HD.rp.renderer.NoteEditor.onHide.call(B)},onShow:function(){HD.rp.renderer.NoteEditor.onShow.call(B,A)}})}},inject:function(A,D){D=D||"";var C=YAHOO.util.Dom.getElementsByClassName("viewNotes","div",A)[0];if(D.length>0){YAHOO.util.Dom.addClass(C.parentNode,"hasNote")}else{YAHOO.util.Dom.removeClass(C.parentNode,"hasNote")}var B=C.getElementsByTagName("p")[0];var E=C.getElementsByTagName("span")[0];var F=D;E.innerHTML=HD.ui.NoteEditor.prototype.encode(F);while(E.offsetHeight>B.offsetHeight){F=F.substr(0,F.lastIndexOf(" "));E.innerHTML=HD.ui.NoteEditor.prototype.encode(F+"...")}},onSave:function(A,B){B.notes=this.options.value;HD.rp.renderer.NoteEditor.inject(A,this.options.value);HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Notes/Edit"))},onMouseOver:function(B,A){A.noteEditor.mouseover=true},onMouseOut:function(B,A){A.noteEditor.mouseover=false;if(!!A.noteEditor.timeout){clearTimeout(A.noteEditor.timeout)}A.noteEditor.timeout=setTimeout(function(){if(A.noteEditor.getMode()=="edit"){A.noteEditor.mouseover=true}if(!A.noteEditor.mouseover){A.noteEditor.destroy()}},2000)},onHide:function(){this.destroy()},onShow:function(A){if(this.options.value==""){this.setMode("edit")}var B=HD.util.getBoundingBox(A);var D=HD.util.getBoundingBox(this.handle);var F=HD.util.getPageOverlap(this.handle,D[2],D[0]);if(F.overBottom){var C=HD.util.getPageHeight()+HD.util.getPageScrollTop();var E=this.handle.offsetTop+this.handle.offsetHeight;var G=E-C;this.handle.style.top=(this.handle.offsetTop-G-3)+"px";D=HD.util.getBoundingBox(this.handle)}var H=YAHOO.util.Dom.getElementsByClassName("noteArrow","div",this.handle);H[0].style.top=(B[2]-D[2]+(B[3]-B[2])/2-H[0].offsetHeight/2+1+(H[0].offsetTop-H[1].offsetTop))+"px";H[1].style.top=(B[2]-D[2]+(B[3]-B[2])/2-H[1].offsetHeight/2+1)+"px";var I=YAHOO.util.Dom.getElementsByClassName("viewNotes","div",A)[0];if(this.options.value==""){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Notes/Add"))}else{HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Notes/View"))}}};HD.rp.renderer.roadList={listPrefix:"road_list_",listPanel:"roadsContent",roadIdToPinMap:{},isInit:false,init:function(){this.listPanel=$(this.listPanel);this.isInit=true},clear:function(A){if(!A){return }if(!!A.listEl){YAHOO.util.Event.removeListener(A.listEl,"mouseover");YAHOO.util.Event.removeListener(A.listEl,"mouseout");if(A.listEl.parentNode==this.listPanel){this.listPanel.removeChild(A.listEl)}A.listEl=null}if(!!A.pinEl){HD.rp.layers.deleteShape(A.pinEl,HD.rp.layers.getLayerType(A));A.pinEl=null}if(!!A.listPinEl){YAHOO.util.Event.removeListener(A.listEl,"mouseover");YAHOO.util.Event.removeListener(A.listPinEl,"click");A.listPinEl=null}},clearAll:function(C,B){HD.rp.layers.deleteAllShapes(C);var D=YAHOO.util.Dom.getElementsByClassName(B,"div",this.listPanel);for(var A=0;A<D.length;A++){this.listPanel.removeChild(D[A])}},render:function(F,I){if(I){this.init()}if(!F){return }if(!this.isInit){this.init()}var C=F;if(!!F.item){F=F.item}else{C=null}this.clear(F);var O=F.data;var T=F.type;var V=F.visId;var Y=O.id;var M=O.averageRating||0;var W=HD.rp.util.formatRoadLength(O.distance)||HD.rp.text.zeroMiles;var L=O.signAs||HD.rp.text.americasByway;var N=O.userSubmitted;var H=false;var E=HD.constants.JSP_PATH+HD.rp.URL.roadDetail;E=HD.util.template(E,{_ROAD_ID:Y,_USER_SUBMITTED:N});if(!!F.datamodel){delete F.datamodel}var D=F.getVELatLong(HD.rp.hdMap.map);var P={type:T,getVisId:function(){return V},getVELatLong:function(){return D},id:Y};var S=$(this.listPrefix+Y);if(S==null){S=document.createElement("div");S.roadId=this.listPrefix+Y}S.className=HD.rp.HTML.roadList.className+" "+HD.road.constants._STOP_TYPES[T];S.visid=V;S[HD.rp.constants._PROXIMITY_ATTRIBUTE]=O.proximity;var X=HD.rp.HTML.roadList.code;X=HD.util.template(X,{_ROAD_PIN:HD.rp.renderer.getPinHTML(P,true),_HAS_RATING:M==0||H?"hide":"",_HAS_NO_RATING:M!=0||H?"hide":"",_LAT_LONG:O.point,_ROAD_NAME:HD.util.convertToJSSafeHTMLString(O.name),_ROAD_RATING:M,_ROAD_LENGTH:W,_ROAD_SUBMITTER:HD.util.convertToJSSafeHTMLString(L),_ROAD_ID:Y,_ROAD_US:N,_ROAD_URL:E,_SHOW_LOCATIONS:HD.rp.hdMap.getZoomLevel()>=HD.rp.constants._MIN_ZOOM_LEVELS.ROAD_POLYLINE?HD.rp.HTML.visibleClass:HD.rp.HTML.hiddenClass,_ROAD_POLY_CHECK:F[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]?'checked="true"':"",_ROAD_POLY_STATE:F[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]?"showRoute":"hideRoute"});S.innerHTML=X;F.listEl=S;this.insertElement(S,!!C?HD.rp.Panel.get(C.panel,"reference").elements.content:this.listPanel);HD.rp.Panel.each(function(Z){if(!!Z.showLocationsRoad&&Z.showLocationsRoad.data.id==O.id){Z.viewShowLocations(Z.showLocationsRoad,true)}});var B=F.data.id;YAHOO.util.Event.addListener(S,"mouseover",function(){HD.rp.Panel.invoke("viewRoadMouseOver",B)});YAHOO.util.Event.addListener(S,"mouseout",function(){HD.rp.Panel.invoke("viewRoadMouseOut",B)});var G=HD.rp.renderer.getMapPin(P,!!C?C.panel:null);G[HD.rp.constants._IS_DRAG_ENABLED]=false;HD.rp.layers.addShape(G,HD.rp.layers.getLayerType(P),HD.rp.HTML.pinShadow);F.pinEl=G;G.datamodel=F;var K=HD.road.constants._STOP_TYPES[F.type].toLowerCase();var J=K.split(/_/);K=J[0];if(J.length>1){for(var U=1;U<J.length;U++){K+=J[U].substr(0,1).toUpperCase()+J[U].substr(1)}}K+="PinClass";var A=YAHOO.util.Event;G=document.getElementById(HD.rp.HTML[K]);G.removeAttribute("id");F.listPinEl=G;var Q=HD.rp.constants._DATAMODEL_ID_ATTRIBUTE;S.setAttribute(Q,Y);A.addListener(S,"mouseover",function(){HD.rp.MapController.listPinOver(this)});G.setAttribute(Q,Y);A.addListener(G,"click",function(){})},insertElement:function(B,A){A.appendChild(B)}};HD.rp.renderer.roadSegment={listPrefix:"road_list_",listPanel:"findRoadsResults",segmentWidth:6,segmentColor:new VEColor(0,179,223,0.7),segmentHLColor:new VEColor(0,102,161,1),grSegmentColor:new VEColor(216,0,255,0.7),grSegmentHLColor:new VEColor(119,0,140,1),init:function(){this.listPanel=$(this.listPanel)},clear:function(A){if(!A){return }if(A.poly){HD.rp.layers.deleteShape(A.poly,HD.rp.layers.getLayerType(A));A.poly=null}if(A.listEl){A.listEl.parentNode.removeChild(A.listEl);A.listEl=null}},render:function(H,E,B,G){if(E){this.init()}if(!H||H.isEmpty()){return }this.clear(H);var A=H.getVELatLongs();if(A==null||A.length<2){return }var D=new VEShape(VEShapeType.Polyline,A);D.SetLineWidth(this.segmentWidth);if(H.type==HD.road.constants._STOP_TYPES.GREAT_ROAD){H.segmentColor=(!!G?this.grSegmentHLColor:this.grSegmentColor);H.segmentHLColor=this.grSegmentHLColor}else{H.segmentColor=(!!G?this.segmentHLColor:this.segmentColor);H.segmentHLColor=this.segmentHLColor}D.SetLineColor(H.segmentColor);D.HideIcon();var F=this;var C=H;if(!B){H.onMouseOver=function(){F.mouseOver.call(F,C)};H.onMouseOut=function(){F.mouseOut.call(F,C)}}else{H.onMouseOver=null;H.onMouseOut=null}D[HD.rp.constants._IS_DRAG_ENABLED]=false;HD.rp.layers.addShape(D,HD.rp.layers.getLayerType(H));H.poly=D},mouseOver:function(A){if(A.isMouseOver){return }A.isMouseOver=true;if(!!A.poly){A.poly.SetLineColor(A.segmentHLColor)}},mouseOut:function(A){A.isMouseOver=false;if(!!A.poly){A.poly.SetLineColor(A.segmentColor)}}};HD.rp.renderer.poi={hotelListPrefix:"hotel_list_",dealerListPrefix:"dealer_list_",eventListPrefix:"event_list_",fuelListPrefix:"fuel_list_",dealerListPanel:"dealerContent",hotelListPanel:"hotelContent",eventsListPanel:"eventContent",fuelListPanel:"fuelContent",isInit:false,init:function(){isInit=true;this.dealerListPanel=$(this.dealerListPanel);this.hotelListPanel=$(this.hotelListPanel);this.eventsListPanel=$(this.eventsListPanel);this.fuelListPanel=$(this.fuelListPanel)},clear:function(B){if(!B){return }var C=YAHOO.util.Event;if(!!B.listPinEl){C.removeListener(B.listEl,"mouseover");C.removeListener(B.listEl,"mouseout");C.removeListener(B.listPinEl,"click")}if(!!B.pinEl&&B.data.id==B.pinEl.datamodel_id){HD.rp.layers.deleteShape(B.pinEl,HD.rp.layers.getLayerType(B))}else{if(!!B.pinEl){var A=HD.rp.MapController.getDataModel(B.pinEl.datamodel_id);if(!!A&&!!A.entityPinEl){HD.rp.layers.deleteShape(A.entityPinEl,HD.rp.layers.getLayerType(B))}}}if(B.listEl&&B.listEl.parentNode){B.listEl.parentNode.removeChild(B.listEl)}B.pinEl=null;B.listEl=null;B.listPinEl=null},render:function(M){if(!this.isInit){this.init()}var F=M;if(!!M.item){M=M.item}else{F=null}this.clear(M);M.pinEl=HD.rp.renderer.getMapPin(M,!!F?F.panel:null);M.pinEl[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]=M.data.id;M.pinEl[HD.rp.constants._IS_DRAG_ENABLED]=false;HD.rp.layers.addShape(M.pinEl,HD.rp.layers.getLayerType(M),HD.rp.HTML.pinShadow);var V=HD.rp.MyRide.route.stopList.start;while(V!=null&&!M.fromEvents){if(V.getEntity().type&&!!M.data.detailKey&&V.getEntity().id==HD.util.rtrim(M.data.detailKey)){try{var T=$(M.pinEl.Primitives[0].iid);if(!!T){T.style.display="none";V.entityPinEl=M.pinEl;M.pinEl=V.pinEl;break}}catch(b){}}V=V.nextStop()}var D=M.type==HD.road.constants._STOP_TYPES.HOTEL;var H=M.type==HD.road.constants._STOP_TYPES.DEALER;var c=M.type==HD.road.constants._STOP_TYPES.EVENT;var C=M.type==HD.road.constants._STOP_TYPES.FUEL;var P=M.type==HD.road.constants._STOP_TYPES.FACILITY;var I=M.is("event").has("dealer").end();var f=I||M.has("events").end();if(P){return }var O=M.data.id;O=D?this.hotelListPrefix+O:O;O=H?this.dealerListPrefix+O:O;O=c?this.eventListPrefix+O:O;O=C?this.fuelListPrefix+O:O;var W=$(O);if(W==null){W=document.createElement("div");W.id=O}var Z,Y="";var N="stopPin";var E=this.dealerListPanel;if(D){W.className=HD.rp.HTML.hotelList.className;var A=M.data.rating==2;N=A?HD.rp.HTML.hotelPreferredPinClass:HD.rp.HTML.hotelPinClass;Y=HD.rp.HTML.hotelList.code;Y=HD.util.template(Y,{_1HOTEL_ID:M.data.id,_HOTEL_ID:HD.util.rtrim(M.data.id),_LAT_LONG:HD.DWR.formatPoint(M),_PIN:HD.rp.renderer.getPinHTML(M,true),_NAME:HD.util.convertToJSSafeHTMLString(M.data.name),_ADDRESS:M.address.toHTML(),_FAX:M.data.fax,_IS_RF:A?"":"hidden"});E=this.hotelListPanel}if(H||I){var U=H?M:M.data.events[0].data.dealer;W.className=HD.rp.HTML.dealerList.className;N=HD.rp.HTML.dealerPinClass;Z=(U.data.url)?HD.util.template(HD.rp.HTML.dealerList.siteLink,{_DEALER_URL:U.data.url,_DEALER_ID:HD.util.rtrim(U.data.detailKey)}):"";Y=HD.rp.HTML.dealerList.code;Y=HD.util.template(Y,{_1DEALER_ID:U.data.id,_DEALER_ID:HD.util.rtrim(U.data.detailKey),_LAT_LONG:HD.DWR.formatPoint(U),_SITE_LINK:Z,_PIN:HD.rp.renderer.getPinHTML(M,true),_NAME:HD.util.convertToJSSafeHTMLString(U.data.name),_ADDRESS:U.address.toHTML(),_PHONE:U.data.phone});var J=[];if(I){for(var X=0;X<M.data.events.length;X++){var S=M.data.events[X];var Q=HD.rp.HTML.eventList.code;Q=HD.util.template(Q,{_PIN:HD.rp.renderer.getPinHTML(S,true),_STOP_NAME:(X+1)+". "+HD.util.convertToJSSafeHTMLString(S.getTitle()),_LAT_LONG:HD.DWR.formatPoint(S),_DATE:HD.util.Date.formatDateSpan(S.data.startDate,S.data.endDate),_LOCATION_NAME:!!S.data.dealer?S.data.dealer.data.name||"":"",_EVENT_SITE:"javascript:void(0);",_EVENT_ID:S.data.id,_EVENT_TYPE:HD.util.rtrim(S.data.type),_EVENT_OBJECTID:S.data.detailKey||"",_NOT_CONTAINER:"",_IS_CONTAINER:"hide",_IS_LIST_ITEM:"hide",_NOT_LIST_ITEM:"invisible",_LOCATION_ID:""});J.push(Q)}}Y+=J.join("");E=H?this.dealerListPanel:this.eventsListPanel}if(c&&!I){W.className=HD.rp.HTML.eventList.className;N=HD.rp.HTML.eventPinClass;Y=HD.rp.HTML.eventList.code;Y=HD.util.template(Y,{_PIN:HD.rp.renderer.getPinHTML(M,true),_STOP_NAME:HD.util.convertToJSSafeHTMLString(M.getTitle()),_LAT_LONG:HD.DWR.formatPoint(M),_DATE:HD.util.Date.formatDateSpan(M.data.startDate,M.data.endDate),_ADDRESS:M.address.toHTML(),_LOCATION_NAME:!!M.data.dealer?M.data.dealer.data.name||"":"",_EVENT_SITE:"javascript:void(0);",_EVENT_ID:M.data.id,_EVENT_TYPE:HD.util.rtrim(M.data.type),_EVENT_OBJECTID:M.data.detailKey||"",_NOT_CONTAINER:f?"hide":"",_IS_CONTAINER:f?"":"hide",_IS_LIST_ITEM:"",_NOT_LIST_ITEM:"",_LOCATION_ID:f?M.data.id:""});var G=[];if(f){for(var g=0;g<M.data.events.length;g++){var K=M.data.events[g];var d=HD.rp.HTML.eventList.code;d=HD.util.template(d,{_PIN:HD.rp.renderer.getPinHTML(K,true),_STOP_NAME:(g+1)+". "+HD.util.convertToJSSafeHTMLString(K.getTitle()),_LAT_LONG:HD.DWR.formatPoint(K),_DATE:HD.util.Date.formatDateSpan(K.data.startDate,K.data.endDate),_LOCATION_NAME:!!K.data.dealer?K.data.dealer.data.name||"":"",_EVENT_SITE:"javascript:void(0);",_EVENT_ID:K.data.id,_EVENT_TYPE:HD.util.rtrim(K.data.type),_EVENT_OBJECTID:K.data.detailKey||"",_NOT_CONTAINER:"",_IS_CONTAINER:"hide",_IS_LIST_ITEM:"hide",_NOT_LIST_ITEM:"invisible",_LOCATION_ID:""});G.push(d)}}Y+=G.join("");E=this.eventsListPanel}if(C){W.className=HD.rp.HTML.fuelList.className;N=HD.rp.HTML.fuelPinClass;Y=HD.rp.HTML.fuelList.code;Y=HD.util.template(Y,{_FUEL_ID:HD.util.rtrim(M.data.detailKey),_LAT_LONG:HD.DWR.formatPoint(M),_PIN:HD.rp.renderer.getPinHTML(M,true),_NAME:HD.rp.text.fuelLocationName,_ADDRESS:M.address.toHTML()});E=this.fuelListPanel}W.innerHTML=Y;W.visid=M.getVisId();W[HD.rp.constants._PROXIMITY_ATTRIBUTE]=M.data.proximity;M.listEl=W;M.listEl[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]=M.data.id;this.insertElement(M.listEl,!!F?HD.rp.Panel.get(F.panel,"reference").elements.content:E);var B=YAHOO.util.Event;var L=document.getElementById(N);L.removeAttribute("id");M.listPinEl=L;W.setAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE,M.data.id);B.addListener(W,"mouseover",function(){HD.rp.MapController.listPinOver(this)});L.setAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE,M.data.id);B.addListener(L,"click",function(){})},rerender:function(A){if(!this.isInit){this.init()}A.pinEl.SetCustomIcon(HD.rp.renderer.getPinHTML(A));A.listEl.firstChild.firstChild.firstChild.innerHTML=A.getVisId();var B=this.hotelListPanel;if(A.type==HD.road.constants._STOP_TYPES.DEALER){B=this.dealerListPanel}B.removeChild(A.listEl);this.insertElement(A.listEl,B)},insertElement:function(D,A){var C=A.childNodes;var B=HD.util.binarySearch(C,D,function(F,E){var G=HD.rp.constants._VIS_ID_ATTRIBUTE;return F[G]==E[G]?0:F[G]<E[G]?-1:1},true);if(B!=null){A.insertBefore(D,C[B])}else{A.appendChild(D)}}};HD.rp.MapMenu={_TYPE:{HOVER:"hover",CONTEXT:"context",CLICK:"click",DETAILS:"details"},isInit:false,isShowingPushpinMenu:false,showingPushpinId:null,showingPushpinMenuType:null,isShowingContextMenu:false,pushpinMenu:null,pushpinLineMask:null,contextMenu:null,contextMenuLeftArrow:null,contextMenuRightArrow:null,sliders:[],menuPagers:{},init:function(){this.pushpinMenu=document.createElement("div");this.pushpinMenu.id=HD.rp.HTML.mapMenuClass;this.pushpinMenu.style.display="block";this.pushpinMenu.style.visibility="hidden";this.pushpinMenu.className=HD.rp.HTML.mapMenuClass;document.body.appendChild(this.pushpinMenu);this.pushpinLineMask=document.createElement("div");this.pushpinLineMask.id=HD.rp.HTML.menuLineMaskClass;this.pushpinLineMask.className=HD.rp.HTML.menuLineMaskClass;this.pushpinLineMask.style.visibility="hidden";document.body.appendChild(this.pushpinLineMask);this.contextMenu=document.createElement("div");this.contextMenu.id=HD.rp.HTML.mapMenuClass;this.contextMenu.style.display="block";this.contextMenu.style.visibility="hidden";this.contextMenu.className=HD.rp.HTML.mapMenuClass;document.body.appendChild(this.contextMenu);this.contextMenuLeftArrow=document.createElement("div");this.contextMenuLeftArrow.style.display="block";this.contextMenuLeftArrow.style.visibility="hidden";this.contextMenuLeftArrow.id=HD.rp.HTML.menuContextArrowLeftClass;this.contextMenuLeftArrow.className=HD.rp.HTML.menuContextArrowLeftClass;document.body.appendChild(this.contextMenuLeftArrow);this.contextMenuRightArrow=document.createElement("div");this.contextMenuRightArrow.style.display="block";this.contextMenuRightArrow.style.visibility="hidden";this.contextMenuRightArrow.id=HD.rp.HTML.menuContextArrowRightClass;this.contextMenuRightArrow.className=HD.rp.HTML.menuContextArrowRightClass;document.body.appendChild(this.contextMenuRightArrow);this.isInit=true},show:function(B,H,G,D,A){if(HD.rp.MapController.isLoading()){return }var E=null;var I=null;var C=null;if(!this.isInit){this.init()}if(typeof B=="string"){I=HD.rp.MapController.getDataModel(B);E=I.pinEl}else{if(B instanceof HD.road.Stop){E=B.pinEl;I=B}else{if(B instanceof HD.road.Route){E=B.pinEl;I=B}else{if(B instanceof VEShape){E=B;I=HD.rp.MapController.getDataModel(B);if(!I&&!!B.datamodel){I=B.datamodel}}else{if(!!B&&!!B.pinEl){E=B.pinEl;I=B}else{return }}}}}if(!I){return }if(!!E){HD.rp.MapController.oldShapeClicked=E}var F=HD.rp.hdMap.getPushpinId(E);if(!F){return }if(H==this._TYPE.CONTEXT){this.showContextMenu(I,F,G)}else{this.showPushpinMenu(I,F,H,G,A)}HD.rp.hdMap.setPinOnTop(E)},showPushpinMenu:function(b,n,U,y,AB){var AF;if(U==this._TYPE.CLICK){this.hideContextMenu()}if(this.isShowingPushpinMenu&&this.showingPushpinId==n&&!AB&&(this.showingPushpinMenuType==U||this.showingPushpinMenuType==this._TYPE.CLICK)){return }this.hidePushpinMenu();var G=$(n);var AH=null;var AG,A,AI,q,S="";var s,T,o,M,O,Y=null;var N=false;var Q=b.type==HD.road.constants._STOP_TYPES.STOP?b.getEntity():{data:false,id:false,type:false};o=b.type==HD.road.constants._STOP_TYPES.STOP?(Q.type?HD.rp.MapController.getDataModel(Q.id):null):null;if(o==null&&Q.data!=null){o=Q.data}var AJ=b.type==HD.road.constants._STOP_TYPES.STOP&&!!o?o.type||b.type:b.type;switch(AJ){case HD.road.constants._STOP_TYPES.STOP:AH=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.stopPinClass,"div",G)[0];switch(U){case this._TYPE.HOVER:AG=HD.rp.HTML.rideMenus.hover;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(b.getTitle()),_DATAMODEL_ID:b.id});break;case this._TYPE.CLICK:AG=HD.rp.HTML.rideMenus.click;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_NUM:b.getVisId(),_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(b.getTitle()),_ADDRESS:(b.address)?b.address.toHTML():"",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":""});break;default:break}break;case HD.road.constants._STOP_TYPES.VIA:if(!b.isStatic){return }AH=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.viaPinClass,"div",G)[0];switch(U){case this._TYPE.CLICK:AG=HD.rp.HTML.viaMenus.click;N=true;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":""});break;case this._TYPE.HOVER:return ;default:return }break;case HD.road.constants._STOP_TYPES.HOTEL:var p=b.data.rating==2;var AA=p?HD.rp.HTML.hotelPreferredPinClass:HD.rp.HTML.hotelPinClass;AH=YAHOO.util.Dom.getElementsByClassName(!o?AA:HD.rp.HTML.stopPinClass,"div",G)[0];if(!AH){AH=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.stopPinClass,"div",G)[0]}switch(U){case this._TYPE.HOVER:AG=HD.rp.HTML.hotelMenus.hover;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(b.getTitle()),_DATAMODEL_ID:!!o?b.id:b.data.id});break;case this._TYPE.CLICK:AG=HD.rp.HTML.hotelMenus.click;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_NUM:b.getVisId(),_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(b.getTitle()),_ADDRESS:b.address.toHTML(),_HOTEL_ID:HD.util.rtrim((o||b).data.id),_DATAMODEL_ID:b.data.id,_IS_STOP:!!o?"":"hide",_NOT_STOP:!!o?"hide":"",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":"",_IS_RF:p?"":"hidden"});break;default:break}break;case HD.road.constants._STOP_TYPES.DEALER:AH=YAHOO.util.Dom.getElementsByClassName(!o?HD.rp.HTML.dealerPinClass:HD.rp.HTML.stopPinClass,"div",G)[0];if(!AH){AH=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.stopPinClass,"div",G)[0]}switch(U){case this._TYPE.HOVER:AG=HD.rp.HTML.dealerMenus.hover;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(b.getTitle()),_DATAMODEL_ID:!!o?b.id:b.data.id});break;case this._TYPE.CLICK:AG=HD.rp.HTML.dealerMenus.click;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_NUM:b.getVisId(),_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(b.getTitle()),_ADDRESS:b.address.toHTML(),_DEALER_SITE_LINK:((o||b).data.url)?HD.util.template(HD.rp.HTML.dealerMenus.siteLink,{_DEALER_SITE_URL:(o||b).data.url,_DEALER_ID:HD.util.rtrim((o||b).data.detailKey)}):" ",_DATAMODEL_ID:b.data.id,_DEALER_ID:HD.util.rtrim((o||b).data.detailKey),_PHONE:(o||b).data.phone,_IS_STOP:!!o?"":"hide",_NOT_STOP:!!o?"hide":"",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":""});break;default:break}break;case HD.road.constants._STOP_TYPES.EVENT:AH=YAHOO.util.Dom.getElementsByClassName(!o?HD.rp.HTML.eventPinClass:HD.rp.HTML.stopPinClass,"div",G)[0];if(!AH){AH=YAHOO.util.Dom.getElementsByClassName(!o?HD.rp.HTML.dealerEventPinClass:HD.rp.HTML.stopPinClass,"div",G)[0]}if(!AH){AH=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.stopPinClass,"div",G)[0]}switch(U){case this._TYPE.HOVER:AG=HD.rp.HTML.eventMenus.hover;M=!!(o||b).data.events?(o||b).data.events.length:1;Y=(o||b).has("dealer").end();O=Y?(o||b).data.events[0].data.dealer:(o||b);AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(!!O.data.startName?O.data.startName:O.getTitle()),_EVENT_COUNT:M+" "+HD.rp.text.event(M),_DATAMODEL_ID:!!o?b.id:b.data.id});break;case this._TYPE.CLICK:AG=HD.rp.HTML.eventMenus.click;M=!!(o||b).data.events?(o||b).data.events.length:1;var E=0;var B=function(AK){var t=E*3;return AK>=1+t&&AK<=3+t};var Z=function(t){if(t<1||t>3){return null}var AK=E*3;return AK+t<=M?AK+t:null};A="";for(AF=0;AF<(M+(M%3?3-M%3:0));AF++){var z=HD.rp.HTML.eventMenus.clickItem;var l=!!(o||b).data.events?(o||b).data.events[AF]||null:(AF==0?o||b:null);z=HD.util.template(z,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_HAS_EVENT:(B(AF+1)?"":"hideevent")+(AF<M?"":" noevent"),_EVENT_NUM:!!o?b.getVisId():AF+1,_EVENT_NAME:!!l?HD.util.convertToJSSafeHTMLString(l.getTitle()):"",_EVENT_DATE:!!l?HD.util.Date.formatDateSpan(l.data.startDate,l.data.endDate,HD.content.Date.FORMAT.MDYlong):"",_HAS_DATE:!!l&&!!l.data.startDate&&!!l.data.endDate?"":"hide",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":""});A+=z}Y=(o||b).has("dealer").end();AG=HD.util.template(AG,{_LOCATION_CONTENT:Y?HD.rp.HTML.eventMenus.dealerInfo:HD.rp.HTML.eventMenus.locationInfo});O=Y?(o||b).data.events[0].data.dealer:(o||b);AG=HD.util.template(AG,{_IS_STATIC:"hide",_NOT_STATIC:"",_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(!!O.data.startName?O.data.startName:O.getTitle()),_EVENT_COUNT:M+" "+HD.rp.text.event(M),_EVENT_CONTENT:A,_HAS_PAGING:M>3?"":"noPaging",_PAGING_CONTENT:M>3?(Z(1)+" - "+(Z(3)||Z(2)||Z(1))+" "+HD.rp.text.of+" "+M):"",_NUM:b.getVisId(),_IS_STOP:b.type==HD.road.constants._STOP_TYPES.STOP?"":"hide",_NOT_STOP:b.type==HD.road.constants._STOP_TYPES.STOP?"hide":"",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":""});break;default:break}break;case HD.road.constants._STOP_TYPES.FUEL:AH=YAHOO.util.Dom.getElementsByClassName(!o?HD.rp.HTML.fuelPinClass:HD.rp.HTML.stopPinClass,"div",G)[0];if(!AH){AH=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.stopPinClass,"div",G)[0]}switch(U){case this._TYPE.HOVER:AG=HD.rp.HTML.fuelMenus.hover;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_LOCATION_NAME:HD.rp.text.fuelLocationName,_DATAMODEL_ID:!!o?b.id:b.data.id});break;case this._TYPE.CLICK:AG=HD.rp.HTML.fuelMenus.click;var J=[],I=[];var x=(o||b).data.fullEntityData;var c=false;var C=false;if(!!x){for(var r in x){if(x[r]){c=true;J.push(HD.util.template(HD.rp.HTML.fuelMenus.service,{_SERVICE:HD.rp.text.shellServices[r]}))}}}if(J.length>=4){C=true;for(var X=J.length-(J.length%2?2:1);X>=1;X-=2){I.unshift(J.splice(X,1)[0])}}AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_NUM:b.getVisId(),_LOCATION_NAME:HD.rp.text.fuelLocationName,_ADDRESS:b.address.toHTML(),_FUEL_ID:HD.util.rtrim((o||b).data.detailKey),_HAS_SERVICES:c?(C?"double":""):"hide",_FUEL_SERVICES1:J.join(""),_FUEL_SERVICES2:I.join(""),_DATAMODEL_ID:b.data.id,_IS_STOP:!!o?"":"hide",_NOT_STOP:!!o?"hide":"",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":""});break;default:break}break;case HD.road.constants._STOP_TYPES.GREAT_ROAD:AH=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.greatRoadPinClass,"div",G)[0];switch(U){case this._TYPE.HOVER:AG=HD.rp.HTML.roadMenus.hover;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_DATAMODEL_ID:b.data.id,_PROX_DISTANCE:b.data.proximity,_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(b.data.name)});break;case this._TYPE.CLICK:AG=HD.rp.HTML.roadMenus.click;q=b.data.averageRating||0;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_ROAD_NAME:HD.util.convertToJSSafeHTMLString(b.data.name),_ROAD_ID:b.data.id||"",_HAS_RATING:q==0?"hide":"",_HAS_NO_RATING:q!=0?"hide":"",_SHOW_LOCATIONS_STATE:!!b.isStatic?"hide":"",_HIDE_LOCATIONS_STATE:!!b.isStatic?"":"hide",_SHOW_LOCATIONS_LEVEL:"",_ROAD_RATING:q,_LENGTH:HD.rp.util.formatRoadLength(b.data.distance)||HD.rp.text.zeroMiles,_IS_USER_SUBMITTED:false});break;default:break}break;case HD.road.constants._STOP_TYPES.USER_ROAD:AH=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.userRoadPinClass,"div",G)[0];switch(U){case this._TYPE.HOVER:AG=HD.rp.HTML.roadMenus.hover;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_DATAMODEL_ID:b.data.id,_PROX_DISTANCE:b.data.proximity,_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(b.data.name)});break;case this._TYPE.CLICK:AG=HD.rp.HTML.roadMenus.click;q=b.data.averageRating||0;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_ROAD_NAME:HD.util.convertToJSSafeHTMLString(b.data.name),_ROAD_ID:b.data.id||"",_HAS_RATING:q==0?"hide":"",_HAS_NO_RATING:q!=0?"hide":"",_SHOW_LOCATIONS_STATE:!!b.isStatic?"hide":"",_HIDE_LOCATIONS_STATE:!!b.isStatic?"":"hide",_SHOW_LOCATIONS_LEVEL:"",_ROAD_RATING:q,_LENGTH:HD.rp.util.formatRoadLength(b.data.distance)||HD.rp.text.zeroMiles,_IS_USER_SUBMITTED:true});break;default:break}break;case HD.road.constants._STOP_TYPES.FACILITY:var V=false;if(b.data.facilityType==HD.rp.constants._FACILITY_TYPES.FACILITY){AH=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.facilityPinClass,"div",G)[0]}else{if(b.data.facilityType==HD.rp.constants._FACILITY_TYPES.MUSEUM){AH=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.museumPinClass,"div",G)[0];V=true}}switch(U){case this._TYPE.HOVER:AG=HD.rp.HTML.facilityMenus.hover;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_DATAMODEL_ID:b.data.id,_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(b.getTitle())});break;case this._TYPE.CLICK:if(V){HD.rp.util.Hitbox.track("Application/Map/Pushpin+Menu/Facilities/Museum")}else{HD.rp.util.Hitbox.track("Application/Map/Pushpin+Menu/Facilities/Plant")}AG=HD.rp.HTML.facilityMenus.click;AG=HD.util.template(AG,{_IS_STATIC:!!b.isStatic?"":"hide",_NOT_STATIC:!!b.isStatic?"hide":"",_NUM:b.getVisId(),_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(b.getTitle()),_ADDRESS:b.address.toHTML(),_SITE_LINK:b.data.url,_DATAMODEL_ID:b.data.id,_PHONE:(o||b).data.phone,_IS_STOP:!!o?"":"hide",_NOT_STOP:!!o?"hide":"",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":"",_TICKETS_LINK_CLASS:V?HD.rp.HTML.visibleClass:HD.rp.HTML.hiddenClass,_TICKETS_LINK:b.data.ticketsUrl});break;default:break}break;default:return }this.pushpinMenu.innerHTML=AG;this.pushpinMenu.menuType=U;this.pushpinMenu.pushpinId=n;this.pushpinMenu.dataId=b.id;this.isShowingPushpinMenu=true;this.showingPushpinId=n;this.showingPushpinMenuType=U;HD.rp.hdMap.shouldUpdateZIndexes=false;if(U==this._TYPE.CLICK&&(o||b) instanceof HD.road.Stop){if((o||b).is("event").end()){var W=YAHOO.util.Dom;var D=W.getElementsByClassName("hide","a",this.pushpinMenu);for(AF=0;AF<D.length;AF++){D[AF].parentNode.removeChild(D[AF])}links=W.getElementsByClassName("event","a",this.pushpinMenu);var k=[];for(AF=0;AF<links.length;AF+=3){var AC=W.hasClass(links[AF],"hideevent");if(AC){W.removeClass(links[AF+0],"hideevent");W.removeClass(links[AF+1],"hideevent");W.removeClass(links[AF+2],"hideevent")}k.push(links[AF+0].offsetHeight+(W.hasClass(links[AF+0],"noevent")?-2:0)+links[AF+1].offsetHeight+(W.hasClass(links[AF+1],"noevent")?-2:0)+links[AF+2].offsetHeight+(W.hasClass(links[AF+2],"noevent")?-2:0));if(AC){W.addClass(links[AF+0],"hideevent");W.addClass(links[AF+1],"hideevent");W.addClass(links[AF+2],"hideevent")}}var AE=Math.max.apply(Math,k);var g=this.pushpinMenu;this.menuPagers["event-paging"]=function(AW){var AO=YAHOO.util.Dom;var AS=$("mapMenu").offsetHeight;var AU=AO.getElementsByClassName("event","a",g);var AV=[];var AT=0;for(AF=0;AF<AU.length;AF++){if(!AO.hasClass(AU[AF],"hide")){AV.push(AU[AF]);if(!AO.hasClass(AU[AF],"noevent")){AT++}}}var AQ=0;for(AF=0;AF<AV.length;AF+=3){if(!AO.hasClass(AV[AF],"hideevent")){AQ=AF/3+AW;break}}var AR=function(AZ){var AY=AQ*3;return AZ>=1+AY&&AZ<=3+AY};var AP=function(AY){if(AY<1||AY>3){return null}var AZ=AQ*3;return AZ+AY<=M?AZ+AY:null};var AX=YAHOO.util.Dom.getElementsByClassName("sliderMask","div",$("mapMenu"));AX=AX.length>0?AX[0]:null;for(AF=0;AF<AV.length;AF++){if(AR(AF+1)){AO.removeClass(AV[AF],"hideevent");if(!!AX&&AV[AF].className.match("sliding")){AX.style.visibility="visible"}}else{AO.addClass(AV[AF],"hideevent");if(!!AX&&AV[AF].className.match("sliding")){AX.style.visibility="hidden"}}}var AL=AO.getElementsByClassName("prevArrow","td",g)[0];var AN=AO.getElementsByClassName("nextArrow","td",g)[0];var AK=AO.getElementsByClassName("paging","td",g)[0];var AM=AO.getElementsByClassName("eventPaging","div",g)[0];AO[AQ>0?"removeClass":"addClass"](AL,"hidearrow");AO[AQ<((AV.length+(AV.length%3?3-AV.length%3:0))/3-1)?"removeClass":"addClass"](AN,"hidearrow");AK.innerHTML=AV.length>3?(AP(1)+" - "+(AP(3)||AP(2)||AP(1))+" "+HD.rp.text.of+" "+AT):"";AM.style.marginTop=(AE-k[AQ])+"px";var t=(AS-$("mapMenu").offsetHeight);AM.style.marginBottom=(t>0?t:0)+"px"};this.menuPagers["event-paging"](0)}}if(U==this._TYPE.CLICK&&(o||b) instanceof HD.road.Stop){this.sliders=[];if(b.type==HD.road.constants._STOP_TYPES.HOTEL||(b.type==HD.road.constants._STOP_TYPES.STOP&&Q.type==HD.rp.constants._POI_TYPES.HOTEL&&!!o)){var j=b.type==HD.road.constants._STOP_TYPES.HOTEL?b:o;if(!!j){var K=YAHOO.util.Dom.getElementsByClassName("bookHotel","a",this.pushpinMenu)[0];var d=HD.rp.HTML.hotelMenus.bookingSlider;d=HD.util.template(d,{_HOTEL_ID:j.data.id});var AD=new Date();var F=new Date();AD.setDate(AD.getDate()+1);F.setDate(F.getDate()+2);var f=new HD.ui.DateRangeSelector({selected_start:HD.util.Date.formatDate(AD),selected_end:HD.util.Date.formatDate(F)});f.events.change.subscribe(function(AP,AL){var AK=AL[0];var AM=AL[1];var AO=AL[2];var t=HD.util.Date.parseDate(AK.start.handles.entry.value);var AN=HD.util.Date.parseDate(AK.end.handles.entry.value);if(!(t>AN)&&!(t<AN)){if(AM=="start"||AO){AN.setDate(AN.getDate()+1);AK.end.handles.entry.value=HD.util.Date.formatDate(AN)}else{t.setDate(t.getDate()-1);AK.start.handles.entry.value=HD.util.Date.formatDate(t)}}});var P=function(AP,t,AM){var AO=YAHOO.util.Dom;var AK=AO.getElementsByClassName("checkin","li",t)[0];var AL=AK.getElementsByTagName("input")[0];var AR=AK.getElementsByTagName("a")[0];var AN=AO.getElementsByClassName("checkout","li",t)[0];var AQ=AN.getElementsByTagName("input")[0];var AS=AN.getElementsByTagName("a")[0];f.start.handles.entry.id=AL.id;AK.replaceChild(f.start.handles.entry,AL);AK.replaceChild(f.start.handles.toggle,AR);f.end.handles.entry.id=AQ.id;AN.replaceChild(f.end.handles.entry,AQ);AN.replaceChild(f.end.handles.toggle,AS)};var H=function(){f.destroy()};this.makePushpinSlider(K,"hotel-booking","hotel-booking",d,j,P,H,(AB||false)=="hotel-booking")}}else{if((o||b).is("event").end()){l=null;if((o||b).is("event").not().has("events").end()){l=(o||b)}Y=(o||b).has("dealer").end();O=Y?(o||b).data.events[0].data.dealer:(o||b);if(AJ==HD.road.constants._STOP_TYPES.DEALER){Y=true}links=YAHOO.util.Dom.getElementsByClassName("event","a",this.pushpinMenu);for(AF=0;AF<links.length;AF++){if(!YAHOO.util.Dom.hasClass(links[AF],"noevent")&&!YAHOO.util.Dom.hasClass(links[AF],"hide")){y=l;if(!y&&!!(o||b).data.events&&(o||b).data.events.length>0){y=(o||b).data.events[parseInt(links[AF].innerHTML.match(/>(\d+)\./i)[1],10)-1]}if(!!y){d=HD.rp.HTML.eventMenus.eventSlider;var w=y.data.description||"";if(w.length>300){w=w.substr(0,300)+"..."}d=HD.util.template(d,{_IS_STATIC:AJ==HD.road.constants._STOP_TYPES.EVENT&&!!b.isStatic?"":"hide",_NOT_STATIC:AJ==HD.road.constants._STOP_TYPES.EVENT&&!!b.isStatic?"hide":"",_EVENT_NAME:HD.util.convertToJSSafeHTMLString(y.getTitle()),_HAS_DATE:!!y.data.startDate&&!!y.data.endDate?"":"hide",_HAS_INFO:"",_EVENT_DATE:HD.util.Date.formatDateSpan(y.data.startDate,y.data.endDate,HD.content.Date.FORMAT.MDYlong),_EVENT_DESCRIPTION:w,_EVENT_TYPE:HD.util.rtrim(y.data.type),_EVENT_ID:y.data.detailKey||"",_NUM:b.type==HD.road.constants._STOP_TYPES.STOP&&AJ==HD.road.constants._STOP_TYPES.EVENT?b.getVisId():"",_IS_STOP:b.type==HD.road.constants._STOP_TYPES.STOP&&AJ==HD.road.constants._STOP_TYPES.EVENT?"":"hide",_NOT_STOP:b.type==HD.road.constants._STOP_TYPES.STOP&&AJ==HD.road.constants._STOP_TYPES.EVENT?"hide":"",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":"",_HAS_REMOTE_DEALER:!Y&&!!y.data.dealer?"":"hide",_REMOTE_DEALER_NAME:!Y&&!!y.data.dealer?HD.util.convertToJSSafeHTMLString(y.data.dealer.data.name||""):"hide"});this.makePushpinSlider(links[AF],"event-info","event-info-"+y.data.id,d,y,null,null,!!l)}}}var L="";if(Y&&!!O){L=HD.rp.HTML.eventMenus.dealerSlider;L=HD.util.template(L,{_DEALER_ID:HD.util.rtrim(O.data.detailKey)||"",_DEALER_NAME:O.data.name||"",_DEALER_ADDRESS:O.address.toHTML(),_DEALER_PHONE:O.data.phone||"",_DEALER_SITE_LINK:(O.data.url)?HD.util.template(HD.rp.HTML.dealerMenus.siteLink,{_DEALER_SITE_URL:O.data.url,_DEALER_ID:HD.util.rtrim(O.data.detailKey)||""}):"",_LOCATION_ID:HD.util.rtrim(O.data.id),_NUM:b.getVisId(),_IS_STATIC:AJ==HD.road.constants._STOP_TYPES.DEALER&&!!b.isStatic?"":"hide",_NOT_STATIC:AJ==HD.road.constants._STOP_TYPES.DEALER&&!!b.isStatic?"hide":"",_IS_STOP:b.type==HD.road.constants._STOP_TYPES.STOP&&AJ==HD.road.constants._STOP_TYPES.DEALER?"":"hide",_NOT_STOP:b.type==HD.road.constants._STOP_TYPES.STOP&&AJ==HD.road.constants._STOP_TYPES.DEALER?"hide":"",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":""})}else{L=HD.rp.HTML.eventMenus.locationSlider;L=HD.util.template(L,{_LOCATION_NAME:HD.util.convertToJSSafeHTMLString(!!O.data.startName?O.data.startName:O.getTitle()),_LOCATION_ADDRESS:O.address.toHTML(),_LOCATION_ID:O.data.id,_NUM:b.getVisId(),_IS_STATIC:AJ==HD.road.constants._STOP_TYPES.DEALER&&!!b.isStatic?"":"hide",_NOT_STATIC:AJ==HD.road.constants._STOP_TYPES.DEALER&&!!b.isStatic?"hide":"",_IS_STOP:b.type==HD.road.constants._STOP_TYPES.STOP&&AJ==HD.road.constants._STOP_TYPES.DEALER?"":"hide",_NOT_STOP:b.type==HD.road.constants._STOP_TYPES.STOP&&AJ==HD.road.constants._STOP_TYPES.DEALER?"hide":"",_ROAD_NAME:!!b.isStatic&&!!b.parentRoad?b.parentRoad.name||"":"",_ROAD_ID:!!b.isStatic&&!!b.parentRoad?b.parentRoad.id||"":""})}this.makePushpinSlider(YAHOO.util.Dom.getElementsByClassName("eventLocation","a",this.pushpinMenu)[0],"location-info","location-info",L,O,null,null,!l)}}}var e=HD.ui.MenuUtil.getNewPosition(AH,this.pushpinMenu,"tl",y,true);var u=e[2];if(u.charAt(0)=="b"){e=HD.ui.MenuUtil.getNewPosition(AH,this.pushpinMenu,"rt",y,true);u=e[2]}if(N){if(u.indexOf("l")>-1){e[0]-=2;e[1]-=1;$("menuWaypointArrowLeft").style.display="block";$("menuWaypointArrowRight").style.display="none"}else{e[1]-=1;$("menuWaypointArrowLeft").style.display="none";$("menuWaypointArrowRight").style.display="block"}}else{switch(u){case"tl":e[1]=e[1]+1;this.pushpinLineMask.style.width=AH.offsetWidth-2+"px";this.pushpinLineMask.style.height=1+"px";this.pushpinLineMask.style.left=e[0]+1+"px";this.pushpinLineMask.style.top=e[1]+this.pushpinMenu.offsetHeight-1+"px";break;case"tr":e[1]=e[1]+1;this.pushpinLineMask.style.width=AH.offsetWidth-2+"px";this.pushpinLineMask.style.height=1+"px";this.pushpinLineMask.style.left=e[0]+1+this.pushpinMenu.offsetWidth-AH.offsetWidth+"px";this.pushpinLineMask.style.top=e[1]+this.pushpinMenu.offsetHeight-1+"px";break;case"rt":e[0]=e[0]-1;this.pushpinLineMask.style.height=AH.offsetHeight-6+"px";this.pushpinLineMask.style.width=1+"px";this.pushpinLineMask.style.left=e[0]+"px";this.pushpinLineMask.style.top=e[1]+1+"px";break;case"lt":e[0]=e[0]+1;this.pushpinLineMask.style.height=AH.offsetHeight-6+"px";this.pushpinLineMask.style.width=1+"px";this.pushpinLineMask.style.left=e[0]+this.pushpinMenu.offsetWidth-1+"px";this.pushpinLineMask.style.top=e[1]+1+"px";break}}this.pushpinMenu.style.left=e[0]+"px";this.pushpinMenu.style.top=e[1]+"px";this.pushpinMenu.style.display="block";this.pushpinMenu.style.zIndex=5;this.pushpinMenu.style.visibility="visible";this.pushpinLineMask.style.zIndex=6;this.pushpinLineMask.style.visibility=N?"hidden":"visible"},showContextMenu:function(A,G,D){if(!this.isInit){this.init()}this.hideContextMenu();var E=null;switch(A.type){case HD.road.constants._STOP_TYPES.STOP:E=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.stopPinClass,null,G)[0];h=HD.rp.HTML.rideMenus.context;h=HD.util.template(h,{_IS_STATIC:!!A.isStatic?"":"hide",_NOT_STATIC:!!A.isStatic?"hide":"",_HIDE_LOCATIONTOVIA:!!A.segmentIn?"":"hide",_HIDE_SHOWRIDE:(HD.rp.MyRide.route.stopList.getStopCount()<2)?"hide":""});hideLine=true;break;case HD.road.constants._STOP_TYPES.VIA:E=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.viaPinClass,null,G)[0];h=HD.rp.HTML.viaMenus.context;h=HD.util.template(h,{_IS_STATIC:!!A.isStatic?"":"hide",_NOT_STATIC:!!A.isStatic?"hide":"",_VIA_ID:A.id,_HIDE_SHOWRIDE:(HD.rp.MyRide.route.stopList.getStopCount()<2)?"hide":""});break;case HD.road.constants._STOP_TYPES.HOTEL:var C=A.data.rating==2?HD.rp.HTML.hotelPreferredPinClass:HD.rp.HTML.hotelPinClass;E=YAHOO.util.Dom.getElementsByClassName(C,null,G)[0];h=HD.rp.HTML.defaultPinMenu.context;break;case HD.road.constants._STOP_TYPES.DEALER:E=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.dealerPinClass,null,G)[0];h=HD.rp.HTML.defaultPinMenu.context;break;case HD.road.constants._STOP_TYPES.EVENT:E=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.eventPinClass,null,G)[0];h=HD.rp.HTML.defaultPinMenu.context;break;case HD.road.constants._STOP_TYPES.GREAT_ROAD:E=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.greatRoadPinClass,null,G)[0];h=HD.rp.HTML.defaultPinMenu.context;break;case HD.road.constants._STOP_TYPES.USER_ROAD:E=YAHOO.util.Dom.getElementsByClassName(HD.rp.HTML.userRoadPinClass,null,G)[0];h=HD.rp.HTML.defaultPinMenu.context;break;default:h=HD.rp.HTML.defaultPinMenu.context;break}this.contextMenu.innerHTML=h;this.contextMenu.pushpinId=G;this.contextMenu.dataId=A.id;this.isShowingContextMenu=true;HD.rp.hdMap.shouldUpdateZIndexes=false;var F=HD.ui.MenuUtil.getNewPosition(!!E?E:$(G),this.contextMenu,"rt",D,true);var B=F[2];switch(B){case"lb":F[0]=F[0]-7;this.contextMenuLeftArrow.style.left=F[0]+this.contextMenu.offsetWidth-1+"px";this.contextMenuLeftArrow.style.top=F[1]+this.contextMenu.offsetHeight-this.contextMenuLeftArrow.offsetHeight-6+"px";this.contextMenuLeftArrow.style.zIndex=100001;this.contextMenuLeftArrow.style.visibility="visible";break;case"lt":F[0]=F[0]-7;this.contextMenuLeftArrow.style.left=F[0]+this.contextMenu.offsetWidth-1+"px";this.contextMenuLeftArrow.style.top=F[1]+"px";this.contextMenuLeftArrow.style.zIndex=100001;this.contextMenuLeftArrow.style.visibility="visible";F[1]=F[1]-10;break;case"rb":F[0]=F[0]+7;this.contextMenuRightArrow.style.left=F[0]-7+"px";this.contextMenuRightArrow.style.top=F[1]+this.contextMenu.offsetHeight-this.contextMenuLeftArrow.offsetHeight-6+"px";this.contextMenuRightArrow.style.zIndex=100001;this.contextMenuRightArrow.style.visibility="visible";break;case"rt":F[0]=F[0]+7;this.contextMenuRightArrow.style.left=F[0]-7+"px";this.contextMenuRightArrow.style.top=F[1]+"px";this.contextMenuRightArrow.style.zIndex=100001;this.contextMenuRightArrow.style.visibility="visible";F[1]=F[1]-10;break}this.contextMenu.style.left=F[0]+"px";this.contextMenu.style.top=F[1]+"px";this.contextMenu.style.display="block";this.contextMenu.style.zIndex=100000;this.contextMenu.style.visibility="visible"},showMapContextMenu:function(H,C){if(!this.isInit){this.init()}this.hide();var B=(C&&C.subsegment_id)?HD.rp.MyRide.route.getSegment(C.subsegment_id):null;if(B){}var F=HD.rp.HTML.mapMenus.context;F=HD.util.template(F,{_STOP_ID:(B)?B.start.id:"null",_SEGMENT_ID:(B)?B.id:"null",_HIDE_WAYPOINT:(HD.rp.MyRide.route.stopList.getStopCount()<=0||B)?"hide":"",_HIDE_SHOWRIDE:(HD.rp.MyRide.route.stopList.getStopCount()<2)?"hide":"",_MAP_X:HD.rp.MapController.mouseDownXY[0],_MAP_Y:HD.rp.MapController.mouseDownXY[1]});this.contextMenu.innerHTML=F;var A=HD.util.getPageOverlap(this.contextMenu,H[1],H[0]);var G=(A.overRight)?"l":"r";var E=(A.overBottom)?"t":"b";var D=G+E;switch(D){case"lb":H[0]=H[0]-this.contextMenu.offsetWidth-7;H[1]=H[1]-14;this.contextMenuLeftArrow.style.left=H[0]+this.contextMenu.offsetWidth-1+"px";this.contextMenuLeftArrow.style.top=H[1]+7+"px";this.contextMenuLeftArrow.style.zIndex=100001;this.contextMenuLeftArrow.style.visibility="visible";break;case"lt":H[0]=H[0]-this.contextMenu.offsetWidth-7;H[1]=H[1]-this.contextMenu.offsetHeight+14;this.contextMenuLeftArrow.style.left=H[0]+this.contextMenu.offsetWidth-1+"px";this.contextMenuLeftArrow.style.top=H[1]+this.contextMenu.offsetHeight-21+"px";this.contextMenuLeftArrow.style.zIndex=100001;this.contextMenuLeftArrow.style.visibility="visible";break;case"rb":H[0]=H[0]+7;H[1]=H[1]-14;this.contextMenuRightArrow.style.left=H[0]-7+"px";this.contextMenuRightArrow.style.top=H[1]+7+"px";this.contextMenuRightArrow.style.zIndex=100001;this.contextMenuRightArrow.style.visibility="visible";break;case"rt":H[0]=H[0]+7;H[1]=H[1]-this.contextMenu.offsetHeight+14;this.contextMenuRightArrow.style.left=H[0]-7+"px";this.contextMenuRightArrow.style.top=H[1]+this.contextMenu.offsetHeight-21+"px";this.contextMenuRightArrow.style.zIndex=100001;this.contextMenuRightArrow.style.visibility="visible";break}this.contextMenu.style.left=H[0]+"px";this.contextMenu.style.top=H[1]+"px";this.contextMenu.style.display="block";this.contextMenu.style.zIndex=100000;this.contextMenu.style.visibility="visible";this.isShowingContextMenu=true;HD.rp.hdMap.shouldUpdateZIndexes=false},hide:function(){this.hideContextMenu();this.hidePushpinMenu()},hidePushpinMenu:function(B){if(!this.isShowingPushpinMenu){return }this.menuPagers={};HD.rp.hdMap.shouldUpdateZIndexes=true;this.isShowingPushpinMenu=false;this.showingPushpinId=null;this.showingPushpinMenuType=null;this.pushpinMenu.style.visibility="hidden";this.pushpinMenu.style.zIndex=0;this.pushpinLineMask.style.visibility="hidden";this.pushpinLineMask.style.zIndex=0;HD.rp.hdMap.updateZIndexes();var C=YAHOO.util.Dom.getElementsByClassName("slider","a",this.pushpinMenu);for(var A=0;A<C.length;A++){YAHOO.util.Event.removeListener(C[A],"click");if(!!C[A].openFn){C[A].openFn=null}if(!!C[A].closeFn){C[A].closeFn();C[A].closeFn=null}}},hideContextMenu:function(A){if(!this.isShowingContextMenu){return }this.isShowingContextMenu=false;HD.rp.hdMap.shouldUpdateZIndexes=true;this.contextMenu.style.visibility="hidden";this.contextMenu.style.zIndex=0;this.contextMenuLeftArrow.style.visibility="hidden";this.contextMenuLeftArrow.style.zIndex=0;this.contextMenuRightArrow.style.visibility="hidden";this.contextMenuRightArrow.style.zIndex=0;HD.rp.hdMap.updateZIndexes()},menuPager:function(A,B){var C=this.menuPagers[A];if(!!C){C(B)}},makePushpinSlider:function(C,I,B,E,H,F,A,D){C.onclick=function(){return false};YAHOO.util.Dom.addClass(C,"slider");C.openFn=F||null;C.closeFn=A||null;var G=function(V,P){this.blur();var S=YAHOO.util.Dom;var M=this.parentNode;V=V||window.event;var W=function(Z,Y){Z.onStart.subscribe(Y);Z.onTween.subscribe(Y);Z.onComplete.subscribe(Y)};var J=function(Y){S.removeClass(this,Y.slidingDirection);if(!!Y.anim){Y.anim.onComplete.unsubscribeAll();Y.anim.stop()}Y.anim=new YAHOO.util.Anim(Y,Y.slidingDirection=="slidingRight"?{clipRight:{from:parseInt(Y.style.clipRight,10),to:0}}:{clipLeft:{from:parseInt(Y.style.clipLeft,10),to:Y.offsetWidth+1}},0.25,YAHOO.util.Easing.easeOut);W(Y.anim,function(){Y.style.clip=Y.slidingDirection=="slidingRight"?"rect(auto,"+Y.style.clipRight+",auto,auto)":"rect(auto,auto,auto,"+Y.style.clipLeft+")"});Y.anim.onComplete.subscribe(function(){if(!!Y.parentNode){Y.parentNode.removeChild(Y)}try{delete Y.anim}catch(Z){}if(!!A){A.call(this,Z,Y,P.pointData)}});if(!!Y.mask&&!!Y.mask.parentNode){Y.mask.parentNode.removeChild(Y.mask)}Y.anim.animate()};for(var Q=0;Q<HD.rp.MapMenu.sliders.length;Q++){if(HD.rp.MapMenu.sliders[Q].id!=B||HD.rp.MapMenu.sliders[Q].getAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE)!=H.data.id){J.call(HD.rp.MapMenu.sliders[Q].link,HD.rp.MapMenu.sliders[Q])}}var L=$(B);if(!!L){if(!S.hasClass(this,L.slidingDirection)&&!!L.anim){S.addClass(this,L.slidingDirection);L.anim.onComplete.unsubscribeAll();L.anim.stop();L.anim=new YAHOO.util.Anim(L,L.slidingDirection=="slidingRight"?{clipRight:{from:parseInt(L.style.clipRight,10),to:L.offsetWidth+1}}:{clipLeft:{from:parseInt(L.style.clipLeft,10),to:0}},0.25,YAHOO.util.Easing.easeOut);W(L.anim,function(){L.style.clip=L.slidingDirection=="slidingRight"?"rect(auto,"+L.style.clipRight+",auto,auto)":"rect(auto,auto,auto,"+L.style.clipLeft+")"});L.anim.onComplete.subscribe(function(){try{delete L.anim}catch(Y){}});if(!!L.mask&&!!L.parentNode){L.parentNode.appendChild(L.mask)}L.anim.animate()}else{J.call(this,L)}return }M=C.parentNode;var U='<div class="content">'+E+"</div>";L=document.createElement("div");L.id=B;L.style.display="none";L.className=I+" slider";L.innerHTML=U;L.style.height=M.clientHeight+"px";L.link=this;L.setAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE,H.data.id);HD.rp.MapMenu.sliders.push(L);this.parentNode.appendChild(L);if(!!F){F.call(this,V,L,P.pointData)}L.slidingDirection="slidingRight";var X=YAHOO.util.Dom.getXY(M);var K=HD.util.getRelativeScroll(M);var T=HD.util.getPageScroll(M);var O=X[0]-K[0]+T[0]+M.offsetWidth+230;if(O>(HD.util.getPageWidth()+HD.util.getPageScrollLeft())){L.slidingDirection="slidingLeft"}S.addClass(this,L.slidingDirection);if(HD.util.isIE){L.mask=document.createElement("div");L.mask.className="sliderMask";L.mask.style.height=(this.offsetHeight-2)+"px";L.mask.style.top=(this.offsetTop+1)+"px";L.mask.style.left=L.slidingDirection=="slidingRight"?(M.offsetWidth-2)+"px":"-1px";this.parentNode.appendChild(L.mask)}S.addClass(L,L.slidingDirection);L.style[L.slidingDirection=="slidingRight"?"left":"right"]=(M.offsetWidth-2)+"px";L.style.clip=L.slidingDirection=="slidingRight"?"rect(auto 0px auto auto)":"rect(auto auto auto "+(L.offsetWidt+1)+"px)";L.style.display="block";if(L.scrollHeight>L.offsetHeight){S.addClass(L,"sliderScrolling")}var N=new YAHOO.util.Anim(L,L.slidingDirection=="slidingRight"?{clipRight:{from:0,to:L.offsetWidth+1}}:{clipLeft:{from:L.offsetWidth+1,to:0}},0.25,YAHOO.util.Easing.easeOut);W(N,function(){L.style.clip=L.slidingDirection=="slidingRight"?"rect(auto "+L.style.clipRight+" auto auto)":"rect(auto auto auto "+L.style.clipLeft+")"});N.animate()};YAHOO.util.Event.addListener(C,"click",G,{pointData:H});if(!!D){setTimeout(function(){G.call(C,null,{pointData:H})},5)}}};HD.rp.DataItem=HD.util.Class.create({name:"global",panel:"global",renderer:null,item:null,initialize:function(A){HD.util.Class.extend(this,A,true);HD.rp.Panel.addDataModel(this);this.action("init")},action:function(C,A){var B=this.get("actions",C)||function(){};B(this,A||{})},get:function(A){var B=[this.name,this.panel];for(var C=0;C<arguments.length;C++){B.push(arguments[C])}return HD.rp.DataItem.get.apply(HD.rp.DataItem,B)},getPanel:function(A){return !!A?HD.rp.Panel.get(this.panel,"reference","reference"):HD.rp.Panel.get(this.panel,"reference")},getRenderer:function(A){return A||this.renderer||this.get("renderer")||{}},clear:function(B,A){A=this.getRenderer(A);if(!!A.clear){A.clear(this.item);this.action("clear",{renderer:A})}},render:function(C,B,A){B=this.getRenderer(B);if(!!B.render){B.render(C||this.item,!C?this:null,A);this.action("render",{renderer:B})}}});HD.rp.DataItem.implement=function(C,A,B){C=typeof C=="function"?C.prototype.name:C||"global";A=typeof A=="function"?A.prototype.name:A||"global";B=B||{};HD.rp.DataItem.items[C]=HD.rp.DataItem.items[C]||{};HD.rp.DataItem.items[C][A]=HD.rp.DataItem.items[C][A]||{};HD.util.Class.extend(HD.rp.DataItem.items[C][A],B,true)};HD.rp.DataItem.get=function(F,B,A){F=typeof F=="function"?F.prototype.name:F||"global";B=typeof B=="function"?B.prototype.name:B||"global";var G=function(H,K){var L=function(M,N){return typeof M=="object"&&!!M&&typeof M[N]!="undefined"?M[N]:null};var J=H||{};for(var I=0;I<K.length;I++){J=L(J,K[I])}return J};if(!!HD.rp.DataItem.items[F]){var E=[];for(var D=2;D<arguments.length;D++){E.push(arguments[D])}var C=G(HD.rp.DataItem.items[F][B]||null,E);if(C==null){C=G(HD.rp.DataItem.items[F].global||null,E)}return C}else{return null}};HD.rp.DataItem.make=function(C,A){var B=HD.util.capitalize(HD.road.constants._STOP_TYPES[C.type].replace(/_/g," ")).replace(/\s*/g,"");if(typeof HD.rp[B+"Item"]=="function"){return new HD.rp[B+"Item"]({panel:typeof A=="function"?A.prototype.name:A||"global",item:C})}else{return null}};HD.rp.DataItem.items={};HD.rp.DataItem.implement(HD.rp.DataItem);HD.rp.RoadItem=HD.util.Class.inherit(HD.rp.DataItem,{name:"road",initialize:function(A){}});HD.rp.DataItem.implement(HD.rp.RoadItem,null,{renderer:(function(){var A=new HD.util.RenderFactory();A.add(HD.rp.renderer.roadList,HD.road.Route);A.add(HD.rp.renderer.roadSegment,HD.road.Segment);return A})()});HD.rp.GreatRoadItem=HD.util.Class.inherit(HD.rp.RoadItem,{name:"great_road",initialize:function(A){}});HD.rp.DataItem.implement(HD.rp.GreatRoadItem,null,{renderer:(function(){var A=new HD.util.RenderFactory();A.add(HD.rp.renderer.roadList,HD.road.Route);A.add(HD.rp.renderer.roadSegment,HD.road.Segment);return A})()});HD.rp.UserRoadItem=HD.util.Class.inherit(HD.rp.RoadItem,{name:"user_road",initialize:function(A){}});HD.rp.DataItem.implement(HD.rp.UserRoadItem,null,{renderer:(function(){var A=new HD.util.RenderFactory();A.add(HD.rp.renderer.roadList,HD.road.Route);A.add(HD.rp.renderer.roadSegment,HD.road.Segment);return A})()});HD.rp.PoiItem=HD.util.Class.inherit(HD.rp.DataItem,{name:"poi",initialize:function(A){}});HD.rp.DataItem.implement(HD.rp.PoiItem,null,{renderer:(function(){var A=new HD.util.RenderFactory();A.add(HD.rp.renderer.poi,HD.road.Stop);return A})()});HD.rp.DealerItem=HD.util.Class.inherit(HD.rp.PoiItem,{name:"dealer",initialize:function(A){}});HD.rp.DataItem.implement(HD.rp.DealerItem,null,{renderer:(function(){var A=new HD.util.RenderFactory();A.add(HD.rp.renderer.poi,HD.road.Stop);return A})()});HD.rp.HotelItem=HD.util.Class.inherit(HD.rp.PoiItem,{name:"hotel",initialize:function(A){}});HD.rp.DataItem.implement(HD.rp.HotelItem,null,{renderer:(function(){var A=new HD.util.RenderFactory();A.add(HD.rp.renderer.poi,HD.road.Stop);return A})()});HD.rp.EventItem=HD.util.Class.inherit(HD.rp.PoiItem,{name:"event",initialize:function(A){}});HD.rp.DataItem.implement(HD.rp.EventItem,null,{renderer:(function(){var A=new HD.util.RenderFactory();A.add(HD.rp.renderer.poi,HD.road.Stop);return A})()});HD.rp.FuelItem=HD.util.Class.inherit(HD.rp.PoiItem,{name:"fuel",initialize:function(A){}});HD.rp.DataItem.implement(HD.rp.FuelItem,null,{renderer:(function(){var A=new HD.util.RenderFactory();A.add(HD.rp.renderer.poi,HD.road.Stop);return A})()});HD.rp.FacilityItem=HD.util.Class.inherit(HD.rp.PoiItem,{name:"facilities",initialize:function(A){}});HD.rp.DataItem.implement(HD.rp.FacilityItem,null,{renderer:(function(){var A=new HD.util.RenderFactory();A.add(HD.rp.renderer.poi,HD.road.Stop);return A})()});HD.rp.Panel=HD.util.Class.create({name:"global",accordian:{tab:-1,top:-1,bottom:-1},elements:{content:"globalContent",filters:"globalFilters",message:"globalMessage",paging:"globalPaging",promo:"globalPromo",tab:"globalTab",toggle:"globalToggle"},isOn:false,listManager:{find:function(){}},loadingIndicator:null,pagingManager:"panelPagingWrapper",reference:"HD.rp.Panel",renderedItems:[],request:{params:[],handler:function(A){},serialize:function(){return""}},stack:[],text:{beyondZoom:"",filters:"",noneInView:"",tab:"Global",toggle:"Global"},initialize:function(K){HD.util.Class.extend(this,[{elements:{content:this.name+"Content",filters:this.name+"Filters",message:this.name+"Message",paging:this.name+"Paging",promo:this.name+"Promo",tab:this.name+"Tab",toggle:this.name+"Toggle"}},K],true);HD.rp.Panel.implement(this.name);var A=document.createElement("div");A.innerHTML=HD.util.template(HD.rp.Panel.html.panel,{_NAME:this.name,_FILTERS:this.text.filters,_REFERENCE:this.reference,_TAB:this.text.tab});while(A.childNodes.length>0){$("accordian").appendChild(A.childNodes[0])}A.innerHTML+=HD.util.template(HD.rp.Panel.html.toggle,{_NAME:this.name,_TOGGLE:this.text.toggle});var F=$("toggle");var I=$$("#toggle .boxR")[0]||null;while(A.childNodes.length>0){if(!!I){F.insertBefore(A.childNodes[0],I)}else{F.appendChild(A.childNodes[0])}}F.style.left=(F.offsetWidth/2*-1)+"px";for(var J in HD.rp.constants._ACCORDIAN.TABS){if(HD.rp.constants._ACCORDIAN.TABS[J]>=this.accordian.tab){this.accordian.tab=HD.rp.constants._ACCORDIAN.TABS[J]+1}}for(var D in HD.rp.constants._ACCORDIAN.STATIC){if(HD.rp.constants._ACCORDIAN.STATIC[D]>=this.accordian.top){this.accordian.top=HD.rp.constants._ACCORDIAN.STATIC[D]+1;this.accordian.bottom=this.accordian.top+1}}HD.rp.constants._ACCORDIAN.TABS[this.name.toUpperCase()]=this.accordian.tab;HD.rp.constants._ACCORDIAN.STATIC[this.name.toUpperCase()+"_TOP"]=this.accordian.top;HD.rp.constants._ACCORDIAN.STATIC[this.name.toUpperCase()+"_BOTTOM"]=this.accordian.bottom;HD.rp.accordian.init();HD.rp.accordian.hideTab(this.accordian.tab);HD.rp.accordian.hideStaticTab(this.accordian.top);HD.rp.accordian.hideStaticTab(this.accordian.bottom);for(var B in this.elements){this.elements[B]=$(this.elements[B])}var G=YAHOO.util.Event;G.addListener(this.elements.toggle,"click",this.show,null,this);G.addListener(this.elements.promo,"click",this.promo,null,this);this.pagingManager=new HD.ui.Paging(this.pagingManager);this.stack=[this];var H=this;while(!!H.base){this.stack.unshift(H.base.prototype);H=H.base}this.action("init");var C={};for(var E=0;E<this.request.params.length;E++){C[this.request.params[E]]=HD.util.getRequestParam(this.request.params[E])}this.request.handler.call(this,C)},action:function(E,B){var A=this;var D=function(){var F=this.get("actions",E)||function(){};F(A,B||{})};for(var C=0;C<this.stack.length;C++){D.call(this.stack[C])}},get:function(A){var B=[this.name];for(var C=0;C<arguments.length;C++){B.push(arguments[C])}return HD.rp.Panel.get.apply(HD.rp.Panel,B)},clear:function(){for(var A=0;A<this.renderedItems.length;A++){this.renderedItems[A].clear()}this.renderedItems=[];this.action("clear")},render:function(E,C,B,H,G,I){if(!this.isOn){return }if(this.loadingIndicator){this.loadingIndicator.remove()}this.loadingIndicator=null;this.elements.content.innerHTML="";if(!E||E.length==0){if(!this.renderedItems){return }this.clear();this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults;this.updateState();return }this.isOn=true;var F=new Array();var A=new Array();this.clear();this.renderedItems=[];for(var D=0;D<E.length;D++){var J=HD.rp.DataItem.make(E[D],this.name);if(!!J){this.renderedItems.push(J);J.render()}else{log("Failed to convert data item in "+this.name+" panel.")}}HD.rp.accordian.hideStaticTab(this.accordian.top);this.elements.paging.innerHTML=this.pagingManager.generateByRecord(B,C,H,G,I,this.reference+".find",true)||HD.rp.HTML.noPagingResults;if(HD.rp.accordian.selectedTabIndex==this.accordian.tab){HD.rp.accordian.showStaticTab(this.accordian.top)}HD.rp.accordian.resize();this.updateState();HD.rp.hdMap.shouldUpdateZIndexes=true;HD.rp.hdMap.updateZIndexes();this.action("render")},find:function(A){if(this.isOn){A=A||HD.rp.constants._FIRST_PAGE_INDEX;this.listManager.find();this.action("find",{pageIndex:A})}},promo:function(){this.action("promo")},toggle:function(A){this.isOn=typeof A!="undefined"||A==null?A:!this.isOn;if(this.isOn){this.find(null,true)}else{this.clear();this.updateState()}this.action("toggle",{force:A})},hide:function(A){if(A&&A.blur){A.blur()}HD.rp.accordian.hideTab(this.accordian.tab);this.toggle(false);HD.rp.setToggleIconClass();HD.rp.MapMenu.hide();this.action("hide")},show:function(A){if(A&&A.blur){A.blur()}if(HD.rp.accordian.selectedTabIndex==this.accordian.tab){return }HD.rp.accordian.selectTab(this.accordian.tab);if(HD.rp.MapController.changeViewTimer!=null){HD.rp.MapController.changeView(this.name)}if(!this.isOn){this.toggle(true);this.action("show")}},isActive:function(){return false},setToggleState:function(A){if(A==this.accordian.tab){this.elements.toggle.className="selected"}else{if(this.isOn){this.elements.toggle.className="showing"}else{this.elements.toggle.className=""}}},serializeRequest:function(){return this.request.serialize.call(this)},updateState:function(D){var A=this.elements.message;var B=HD.rp.text.blank;var C=B;if(!D){if(this.renderedItems.length==0){if(HD.rp.hdMap.getZoomLevel()<HD.rp.constants._MIN_ZOOM_LEVELS[this.name.toUpperCase()]||0){C=this.text.beyondZoom}else{C=this.text.noneInView}}else{C=B}}A.style.display=!!C?"block":"none";A.innerHTML=C;HD.rp.accordian.updateContentHeight();this.action("updateState",{message:C});return C}});HD.rp.Panel.implement=function(A,B){A=typeof A=="function"?A.prototype.name:A||"panel";B=B||{};HD.rp.Panel.panels[A]=HD.rp.Panel.panels[A]||{};HD.util.Class.extend(HD.rp.Panel.panels[A],B,true);HD.util.Class.extend(HD.rp.Panel.panels[A],{cache:{global:{}}})};HD.rp.Panel.addDataModel=function(G){if(!G){return }var F=G.name||"global";var C=G.panel||"global";if(!!G&&typeof G.item=="object"&&typeof G.item.data=="object"){var D=HD.rp.Panel.get(C,"cache")||{};var B=HD.rp.Panel.get("global","cache")||{};D[F]=D[F]||{};B[F]=D[F]||{};if(!!G.item.data.id){var A=HD.util.rtrim(G.item.data.id+"");D[F][A]=G;D.global[A]=G;B[F][A]=G;B.global[A]=G}if(!!G.item.data.detailKey){var E=HD.util.rtrim(G.item.data.detailKey+"");D[F][E]=G;D.global[E]=G;B[F][E]=G;B.global[E]=G}}};HD.rp.Panel.getDataModel=$data=function(D,B,I,E){if(!!D&&!!D.item){return !!E?D.item:D}B=typeof B=="function"?B.prototype.name:B||"global";I=typeof I=="function"?I.prototype.name:I||"global";if(!!D){var A=HD.rp.Panel.get(B,"cache",I)||{};var G=A[D]||null;if(G==null){if(B=="global"){var C=[];HD.rp.Panel.each(function(J){C.push(J.getDataModel(D,I,E))});for(var F=0;F<C.length;F++){if(C[F]!=null){G=C[F];break}}}else{try{G=HD.rp.Panel.get(B,"reference").getDataModel(D,I,E)}catch(H){}}}G=!!G&&!!G.item&&!!E?G.item:G;return G}else{return null}};HD.rp.Panel.get=function(B,A){B=typeof B=="function"?B.prototype.name:B||"global";var F=function(G,J){var K=function(L,M){return typeof L=="object"&&!!L&&typeof L[M]!="undefined"?L[M]:null};var I=G||{};for(var H=0;H<J.length;H++){I=K(I,J[H])}return I};if(!!HD.rp.Panel.panels[B]){var E=[];for(var D=1;D<arguments.length;D++){E.push(arguments[D])}var C=F(HD.rp.Panel.panels[B],E);if(C==null&&B!="global"&&!!HD.rp.Panel.panels.global){C=F(HD.rp.Panel.panels.global,E)}return C}else{return null}};HD.rp.Panel.invoke=function(A,D,I){var F={id:null,panel:null,item:null};if(typeof D=="object"){for(var C in F){if(typeof D[C]!="undefined"){F[C]=D[C]}}}else{F.id=D}var G=HD.rp.Panel.getDataModel(F.id,F.panel,F.item);if(!!G){var B=G.getPanel();var H=[G];for(var E=2;E<arguments.length;E++){H.push(arguments[E])}return(B.get("reference",A)||function(){return null}).apply(B,H)}};HD.rp.Panel.load=function(panel){var name=panel.prototype.name;var ref=panel.prototype.reference;eval(ref+" = new "+ref+"();");HD.rp.Panel.implement(name,{reference:eval(ref)})};HD.rp.Panel.each=function(D,C,B){B=B||function(){};for(var A in HD.rp.Panel.panels){if(!!HD.rp.Panel.panels[A].reference){if(!!C){try{D.call(C,HD.rp.Panel.panels[A].reference)}catch(E){B(E)}}else{try{D(HD.rp.Panel.panels[A].reference)}catch(E){B(E)}}}}};HD.rp.Panel.panels={};HD.rp.Panel.html=HD.rp.HTML.panel.global;HD.rp.Panel.implement(HD.rp.Panel);HD.rp.WelcomeBox={messageEl:"welcomeMessage",isInit:false,init:function(A){this.messageEl=$(this.messageEl);this.isInit=true;if(A){this.setMessage()}},setMessage:function(B){if(!this.isInit){this.init(false)}if(HD.User.isLoggedIn){var A=this;RoadService.getUserRoadCount({userId:HD.User.data.id},function(C){if(C==null){HD.User.userReconnect()}else{A.handleRoadCount.call(A,C,B)}})}else{this.messageEl.innerHTML=HD.rp.constants._NO_LOGIN?HD.rp.HTML.welcomeGuestNoLogin:HD.rp.HTML.welcomeGuest}},handleRoadCount:function(B,C){if(B==null){return }HD.rp.User.roadCounts=B;var A=HD.rp.HTML.welcomeUser;A=HD.util.template(A,{_ROAD_COUNT:B[HD.rp.User._COUNT_TYPE.RP]+B[HD.rp.User._COUNT_TYPE.LEGACY],_USER:(HD.User.data.screenName!=null)?HD.User.data.screenName:HD.User.data.firstName});this.messageEl.innerHTML=A;if(!!C&&(C==HD.rp.User._LOGIN_PENDING_FOR.MYRIDES||C==HD.rp.User._LOGIN_PENDING_FOR.MYRIDES_PRELOGIN)){HD.rp.dialog.UserRoadList.init()}}};HD.rp.MyRide={route:new HD.road.Route(),rideList:HD.rp.constants._ELEMENT_IDS.RP_TABLE,rideSaveControls:"rideSaveControlsWrapper",addressInput1:null,addressInput2:null,factory:new HD.util.RenderFactory(),numStops:0,saveOnComplete:null,hbx:null,addressesFromURL:[],init:function(){var A=this;this.rideSaveControls=$(this.rideSaveControls);this.hbx=HD.rp.util.Hitbox.select("Application/My+Ride");this.factory.add(HD.rp.renderer.ridePoint,HD.road.Stop);this.factory.add(HD.rp.renderer.rideSegment,HD.road.Segment);this.initRoute();var B=YAHOO.util.Event;this.addressInput1=$("staticLocAdrs");this.addressInput2=$("staticLocAdrs1");B.addListener(this.addressInput1,"focus",function(){HD.rp.MyRide.addressFocus(this)});B.addListener(this.addressInput2,"focus",function(){HD.rp.MyRide.addressFocus(this)});B.addListener(this.addressInput1,"blur",function(){HD.rp.MyRide.addressBlur(this)});B.addListener(this.addressInput2,"blur",function(){HD.rp.MyRide.addressBlur(this)});B.addListener($("staticLocGo"),"click",function(){HD.rp.MyRide.addNewLocation(HD.rp.MyRide.addressInput1.value,A.addressInput1,true)});B.addListener($("staticLocGo1"),"click",function(){var C=$("rpTable").getElementsByTagName("input");if(HD.rp.MyRide.numStops>0){C[0].value=A.addressInput2.value;HD.rp.MyRide.changeAddress(C[1],C[0],true)}else{HD.rp.MyRide.addNewLocation(HD.rp.MyRide.addressInput2.value,A.addressInput2,true)}});B.addListener($("rideAddLocation1"),"submit",function(){HD.rp.MyRide.addNewLocation(HD.rp.MyRide.addressInput1.value,A.addressInput1,true);A.addressInput1.blur();return false});B.addListener($("rideAddLocation2"),"submit",function(){var C=$("rpTable").getElementsByTagName("input");if(HD.rp.MyRide.numStops>0){C[0].value=A.addressInput2.value;HD.rp.MyRide.changeAddress(C[1],C[0],true)}else{HD.rp.MyRide.addNewLocation(HD.rp.MyRide.addressInput2.value,A.addressInput2,true)}A.addressInput2.blur();return false});this.resetAddressFields();B.addListener($("rpSaveButton"),"click",function(){HD.rp.MyRide.saveRide()});B.addListener($("rpSaveAsButton"),"click",function(){HD.rp.MyRide.saveRide(HD.rp.MyRide.route.data.name,true)});B.addListener($("rpSaveAsNewButton"),"click",function(){HD.rp.MyRide.saveRide(HD.rp.MyRide.route.data.name,null,true)});B.addListener($("dirsShow"),"click",function(){HD.rp.MyRide.showAllDirections()});B.addListener($("dirsHide"),"click",function(){HD.rp.MyRide.hideAllDirections()});B.addListener($("clearRoute"),"click",function(){HD.rp.MyRide.clearRideConfirm()});B.addListener($("reverseDirs"),"click",function(){HD.rp.MyRide.reverseDirections()});B.addListener($("roundtrip"),"click",function(){HD.rp.MyRide.roundtrip()});B.addListener($("rpPrintButton"),"click",function(){HD.rp.MapController.printRoad(HD.rp.MyRide.route,true)});B.addListener($("rpEmailButton"),"click",function(){HD.rp.MyRide.sendRoad()});B.addListener($("rpGpsButton"),"click",function(){HD.road.GPX.routeToGPX(HD.rp.MyRide.route)});B.addListener($("rpReset"),"click",function(){HD.rp.reset()});this.setAccordianElements()},initRoute:function(A){var B=this;A=A||this.route;A.attachEvent(HD.road.constants._EVENT.STOP_UPDATED,function(D){var E=D.segmentIn==null;if(E){HD.rp.MyRide.markChanged()}HD.rp.accordian.selectTab(HD.rp.constants._ACCORDIAN.TABS.MY_RIDE);HD.rp.MyRide.resetAddressFields();HD.rp.MyRide.render(D);if(!D.skipBestFit){if(E){HD.rp.MapController.setCityView(D)}else{var C=HD.rp.MyRide.route.getStart().segmentOut;if(C.end!=null||C.vias.length>0){HD.rp.MapController.showAllPins()}}D.skipBestFit=true}HD.rp.MapController.removeLoadingIndicator();if(!!HD.rp.MyRide.stopUpdatedCallback){HD.rp.MyRide.stopUpdatedCallback(D)}});A.attachEvent(HD.road.constants._EVENT.STOP_REMOVED,function(C){HD.rp.MyRide.factory.clear(C);HD.rp.MapController.removeLoadingIndicator()});A.attachEvent(HD.road.constants._EVENT.SEGMENT_UPDATED,function(C){HD.rp.MyRide.markChanged();HD.rp.MyRide.route.recalculate();HD.rp.MyRide.render(C);HD.rp.MapController.removeLoadingIndicator();if(!!HD.rp.MyRide.stopUpdatedCallback){HD.rp.MyRide.stopUpdatedCallback(C)}});A.attachEvent(HD.road.constants._EVENT.SEGMENT_REMOVED,function(C){HD.rp.MyRide.route.recalculate();HD.rp.MyRide.factory.clear(C);HD.rp.MapController.removeLoadingIndicator()});A.attachEvent(HD.road.constants._EVENT.DIRECTIONS_UPDATED,function(C){HD.rp.MyRide.render(C);HD.rp.MyRide.showDirections(C.listEl,C);HD.rp.MapController.removeLoadingIndicator()});A.attachEvent(HD.road.constants._EVENT.ROUTING_FAILED,function(C){HD.rp.MapController.removeLoadingIndicator();HD.ui.Dialog.showError(HD.rp.text.routingFailed);if(C!=null){HD.rp.MapController.undoStopDrag(C)}})},markChanged:function(){this.lastRouteChangeTime=new Date().getTime();HD.rp.Panel.each(function(A){A.find()})},isOutOfDate:function(A){if(this.route.isEmpty()){return true}return this.lastRouteChangeTime>A},clear:function(){var D=this.route.getStart();while(D!=null){this.factory.clear(D);if(D instanceof HD.road.Stop&&!!D.entityPinEl){var A=HD.rp.MapController.getDataModel(D.entityPinEl[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]);A.pinEl=D.entityPinEl;delete D.entityPinEl;try{var C=$(A.pinEl.Primitives[0].iid);C.style.display="block"}catch(B){}}D=D.next()}this.route=new HD.road.Route();this.initRoute();HD.rp.layers.deleteAllShapes(HD.rp.constants._LAYER_TYPE.MY_RIDE);$(HD.rp.constants._ELEMENT_IDS.RP_TABLE).innerHTML=""},importRoute:function(A){A=A.clone(true);delete A.type;delete A.visId;delete A.data.id;var B=A.stopList.start;while(B!=null){if(B.type==HD.road.constants._STOP_TYPES.GREAT_ROAD||B.type==HD.road.constants._STOP_TYPES.USER_ROAD){B.type=HD.road.constants._STOP_TYPES.STOP}B=B.next()}this.setAsMyRide(A);HD.rp.accordian.selectTab(HD.rp.constants._ACCORDIAN.TABS.MY_RIDE)},appendRoute:function(A){HD.rp.MapController.addLoadingIndicator();A=A.clone(true);delete A.type;delete A.visId;delete A.data.id;var C=A.getStart();while(C!=null){if(C.type==HD.road.constants._STOP_TYPES.GREAT_ROAD||C.type==HD.road.constants._STOP_TYPES.USER_ROAD){C.type=HD.road.constants._STOP_TYPES.STOP}if(!!C.vias){for(var B=0;B<C.vias.length;B++){delete C.vias[B].isStatic;delete C.vias[B].parentRoad}}delete C.isStatic;delete C.parentRoad;C=C.next()}this.initRoute(A);this.route.addRoute(A);HD.rp.accordian.selectTab(HD.rp.constants._ACCORDIAN.TABS.MY_RIDE)},render:function(A){HD.rp.MapController.removeLoadingIndicator();A=A||this.route.stopList.start;this.factory.render(A,false);this.setAccordianElements()},renderRoute:function(A){HD.rp.layers.deleteAllShapes(HD.rp.constants._LAYER_TYPE.MY_RIDE);A=A||this.route;A=A.stopList.start;while(A!=null){this.factory.render(A);A=A.next()}this.setAccordianElements()},toggleDirections:function(B,A){if(YAHOO.util.Dom.hasClass(B.parentNode.parentNode,"on")){this.hideDirections(B.parentNode.parentNode);if(!A){HD.rp.util.Hitbox.track(this.hbx.select("Directions/Hide"))}}else{this.showDirections(B.parentNode.parentNode);if(!A){HD.rp.util.Hitbox.track(this.hbx.select("Directions/Show"))}}},showDirections:function(B,A){var C=A||HD.rp.MyRide.route.getSegment(B.segmentId);if(C.directions==null){C.initDirections()}else{YAHOO.util.Dom.addClass(B,"on")}},hideDirections:function(A){YAHOO.util.Dom.removeClass(A,"on")},showAllDirections:function(){var A=YAHOO.util.Dom.getElementsByClassName("directionsListItem","div",$(this.rideList));for(var B=0;B<A.length;B++){this.showDirections(A[B])}HD.rp.util.Hitbox.track(this.hbx.select("Directions/Show"))},hideAllDirections:function(){var A=YAHOO.util.Dom.getElementsByClassName("directionsListItem","div",$(this.rideList));for(var B=0;B<A.length;B++){this.hideDirections(A[B])}HD.rp.util.Hitbox.track(this.hbx.select("Directions/Hide"))},resetAddressFields:function(){this.addressInput1.value=HD.rp.text.addressInputValue;this.addressInput2.value=HD.rp.text.addressInputValue},addressFocus:function(A){if(A.value==HD.rp.text.addressInputValue){A.value=""}else{A.select()}},addressBlur:function(A){if(A.value==""){A.value=HD.rp.text.addressInputValue}},addNewLocation:function(B,D,A,E){if(!B||B==HD.rp.text.addressInputValue){return }D=(D)?$(D):null;A=A||false;var C=this;HD.rp.MapController.addLoadingIndicator();HD.rp.hdMap.find(B,HD.rp.constants._FIND_NUM_RESULTS,function(F){C.handleAddNewLocation.call(C,F,D,A)},D);if(!!E){HD.rp.util.Hitbox.track(this.hbx.select("Add+Location/User/URL"))}else{HD.rp.util.Hitbox.track(this.hbx.select("Add+Location/User/Toolbar"))}},handleAddNewLocation:function(M,F,A){if(M==null){HD.rp.MapController.removeLoadingIndicator();HD.ui.Dialog.showError(HD.rp.text.addressInputError)}else{if(M.length>1){HD.rp.MapController.removeLoadingIndicator();this.showDisambiguate(M,F)}else{stopToAdd=M[0];if(HD.rp.MyRide.route.stopList&&HD.rp.MyRide.route.stopList.getStopCount()<2){HD.rp.MyRide.route.addStopAfter(stopToAdd)}else{var L=new Array();var J=0;var N=Number.MAX_VALUE;var D=null;var K=Number.MAX_VALUE;var B=0;(function(Q){for(var P=Q;P!=null;P=P.nextSegment()){L=P.getPoints();J=(L!=null)?L.length:0;K=Number.MAX_VALUE;B=0;for(var O=0;O<J;O++){B=HD.util.getDistance(stopToAdd,L[O]);if(B<K){K=B;index=O}}if(K<N){N=K;D=P;if(D.vias.length>0){var S=D.getPointList();N=Number.MAX_VALUE;D=null;arguments.callee(S.start.next())}}}})(HD.rp.MyRide.route.getStart().next());var I=D.data.distance;var G=D.nextSegment();var E=(G)?G.distance:0;var H=HD.util.Math.getDistanceBetweenLatLng(stopToAdd,D.start,"mi");var C=HD.util.Math.getDistanceBetweenLatLng(stopToAdd,D.end,"mi");if(I>H){HD.rp.MyRide.route.addStopAfter(stopToAdd,D.start.id)}else{if(E>C){HD.rp.MyRide.route.addStopAfter(stopToAdd,D.end.id)}else{HD.rp.MyRide.route.addStopAfter(stopToAdd)}}}}}},changeAddress:function(E,J,B){if(!J.value||J.value==HD.rp.text.addressInputValue){return }if(E.blur){E.blur()}B=(HD.rp.MyRide.numStops>1)?B||false:false;var F=HD.rp.MyRide.route.getStop(E.getAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE));var K=this.isAddressLineChanged(F,J.value);if(K!=null){var L=this;var D=F.id;var G;HD.rp.MapController.addLoadingIndicator();if(!!F.entityPinEl){G=HD.rp.MapController.getDataModel(F.entityPinEl[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]);G.pinEl=F.entityPinEl;delete F.entityPinEl;try{var C=$(G.pinEl.Primitives[0].iid);C.style.display="block"}catch(H){}}G=F.getEntity();if(!!G.type||!!G.id||!!G.data){F.clearEntity();F.data.name=null;F.isDrag=true}if(K.address!=null){HD.rp.hdMap.find(K.address,HD.rp.constants._FIND_NUM_RESULTS,function(M){L.handleChangeAddress.call(L,M,D,J,B)})}else{if(K.latLong!=null){var I=K.latLong;F.latitude=I.Latitude;F.longitude=I.Longitude;var A=new HD.RequestChain();A.success=function(M){HD.rp.MapController.removeLoadingIndicator();L.handleChangeAddress.call(L,[F],D,J,B)};A.failure=function(M){HD.rp.MapController.removeLoadingIndicator();HD.rp.MapController.undoStopDrag(F)};A.add(new HD.road.GeocodeRequest(F));A.execute()}}}else{HD.rp.hdMap.setCenterAndZoom(F.getVELatLong(),Math.max(12,HD.rp.hdMap.getZoomLevel()))}},isAddressLineChanged:function(B,D){var A={};var C=HD.DWR.parsePoint(D);if(C!=null){if(B.latitude!=C.latitude||B.longitude!=C.longitude){B.address=null;A.latLong=HD.DWR.parseVELatLong(D);return A}}else{if(B.address!=null){if(B.address.toString()!=D){A.address=D;return A}}else{A.address=D;return A}}return null},handleChangeAddress:function(E,F,D,B){if(E==null||E.length==0){HD.rp.MapController.removeLoadingIndicator()}else{if(E.length>1){HD.rp.MapController.removeLoadingIndicator();this.showDisambiguate(E,D,F)}else{if(this.route.stopList.getStopCount()==1){HD.rp.hdMap.setCenter(E[0].getVELatLong())}var A=E[0];var C=HD.rp.MyRide.route.getStop(F);C.setLocation(A.latitude,A.longitude,A.address);if(B){C.fitToMap=true}HD.rp.MyRide.route.reroute(F)}}},showDisambiguate:function(E,D,A){var G=(A)?",'"+A+"'":"";this.disambiguateStops=E;var C=HD.rp.HTML.disambiguate.header;for(var B=0;B<E.length;B++){C+=HD.util.template(HD.rp.HTML.disambiguate.line,{_PARAMS:B+G,_ADDRESS:E[B].address.toString()})}var F=document.createElement("div");F.className=HD.rp.HTML.disambiguate.className;F.innerHTML=C;document.body.appendChild(F);HD.ui.Menu.show(D,F,"bl")},disambiguateStops:null,handleDisambiguate:function(C,F){if(C==null){return }if(F){HD.rp.MapController.addLoadingIndicator();var A=this.disambiguateStops[C];var D=HD.rp.MyRide.route.getStop(F);D.setLocation(A.latitude,A.longitude,A.address);var E=D.listEl.getElementsByTagName("input")[0];E.value=A.address.toHTML();HD.rp.MyRide.route.reroute(F)}else{HD.rp.MapController.addLoadingIndicator();var B=this.disambiguateStops[C];this.addressInput1.value=B.address.toHTML();HD.rp.MyRide.route.addStopAfter(B)}},saveRide:function(D,A,C,B){if(!HD.User.promptLogin()){HD.rp.User.loginPendingFor=HD.rp.User._LOGIN_PENDING_FOR.SAVE;this.saveOnComplete=B||null;return }if(!this.canSave()){HD.ui.Dialog.showError(HD.rp.text.maxRoutesExceeded);return }if(this.route.stopList.end.segmentOut.vias.first()!=null){HD.ui.Dialog.showError(HD.rp.text.saveFailed);return }B=B||this.saveOnComplete||null;HD.rp.dialog.SaveDialog.show(null,B);this.saveOnComplete=null},canSave:function(){return(HD.rp.User.roadCounts[HD.rp.User._COUNT_TYPE.RP]>=HD.rp.constants._MAX_USER_ROADS)?(HD.rp.MyRide.isNewRoute())?false:true:true},isNewRoute:function(){return HD.rp.MyRide.route.data.id==null||HD.rp.MyRide.route.data.id=="undefined"},removeStop:function(C){HD.rp.MapController.addLoadingIndicator();var B=HD.rp.MapController.getDataModel(C.getAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE));HD.rp.MyRide.route.removeStop(C.getAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE));HD.rp.util.Hitbox.track(this.hbx.select("Remove+Location/Toolbar"));if(!!B.entityPinEl){var A=HD.rp.MapController.getDataModel(B.entityPinEl[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]);A.pinEl=B.entityPinEl;delete B.entityPinEl;try{var E=$(A.pinEl.Primitives[0].iid);E.style.display="block"}catch(D){}}this.setAccordianElements()},moveStopUp:function(C){if(!HD.rp.MyRide.route.stopList.chain.chain.busy){var A=C.getAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE);var B=HD.rp.MyRide.route.getStop(A).prevStop();if(!!B){HD.rp.MapController.addLoadingIndicator();HD.rp.MyRide.route.moveStopBefore(A,B.id)}HD.rp.util.Hitbox.track(this.hbx.select("Reorder/Up"))}},moveStopDown:function(C){if(!HD.rp.MyRide.route.stopList.chain.chain.busy){var A=C.getAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE);var B=HD.rp.MyRide.route.getStop(A).nextStop();if(!!B){HD.rp.MapController.addLoadingIndicator();HD.rp.MyRide.route.moveStopAfter(A,B.id)}HD.rp.util.Hitbox.track(this.hbx.select("Reorder/Down"))}},renameStop:function(C){var A=C.getAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE);var B=HD.rp.MyRide.route.getStop(A);if(!B.getEntity().type){C.parentNode.style.display="none";var E=document.createElement("div");E.innerHTML=HD.util.template(HD.rp.HTML.stopList.renameCode,{_DATAMODEL_ID:A,_NAME:B.data.name});C.parentNode.parentNode.appendChild(E);var D=E.getElementsByTagName("input")[0];D.focus();D.select()}},handleRenameStop:function(C){var D=C.parentNode.parentNode.getElementsByTagName("strong")[0];var E=C.parentNode.getElementsByTagName("input")[0];var A=D.getAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE);var B=HD.rp.MyRide.route.getStop(A);B.data.name=E.value||"";D.innerHTML=B.getTitle();C.parentNode.parentNode.removeChild(C.parentNode);D.parentNode.style.display="block"},cancelRenameStop:function(A){var B=A.parentNode.parentNode.getElementsByTagName("strong")[0];A.parentNode.parentNode.removeChild(A.parentNode);B.parentNode.style.display="block"},printRide:function(){log("print ride plan")},clearRide:function(){this.clear();this.setEditMode();this.setAccordianElements();HD.rp.Panel.each(function(A){A.hideLocations()})},clearRideConfirm:function(){HD.rp.MapMenu.hide();HD.ui.Dialog.showConfirm(HD.rp.text.clearLocations,HD.rp.text.clearLocationsMessage,function(){HD.ui.Dialog.hide();HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Clear+Locations"));HD.rp.MyRide.clearRide()},280,95)},roundtrip:function(){HD.rp.MapController.addLoadingIndicator();HD.rp.util.Hitbox.track(this.hbx.select("Roundtrip"));var B=this.route.getStart();var A=new HD.road.Stop(HD.road.constants._STOP_TYPES.STOP);A.setLocation(B.latitude,B.longitude,B.address);this.route.addStopAfter(A)},reverseDirections:function(){HD.rp.MapController.addLoadingIndicator();HD.rp.util.Hitbox.track(this.hbx.select("Reverse+Route"));this.route.reverse()},setAccordianElements:function(A){A=A||HD.rp.accordian.selectedTabIndex;if(A!=HD.rp.constants._ACCORDIAN.TABS.MY_RIDE){return }this.numStops=this.route.stopList.getStopCount();if(this.numStops>1){$("rideInstructions").style.display="none";$("rpTable").style.display="block";HD.rp.renderer.rideTotals.render();HD.rp.accordian.showStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_TOP_CONTROL);HD.rp.accordian.showStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_BOTTOM_CONTROL);HD.rp.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_ADD_LOCATION);HD.rp.accordian.showStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_SAVE_CONTROL);$("addLocationLabel").innerHTML=HD.rp.text.addLocationNoPlus;YAHOO.util.Dom.replaceClass($("rideAddLocation"),"noStops","hasStops")}else{if(this.numStops==1){HD.rp.renderer.rideTotals.clear();$("rideInstructions").style.display="none";$("rideAddLocation").style.display="block";$("rpTable").style.display="block";HD.rp.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_TOP_CONTROL);HD.rp.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_BOTTOM_CONTROL);HD.rp.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_ADD_LOCATION);HD.rp.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_SAVE_CONTROL);$("addLocationLabel").innerHTML=HD.rp.text.addLocationNoPlus;YAHOO.util.Dom.replaceClass($("rideAddLocation"),"noStops","hasStops")}else{HD.rp.renderer.rideTotals.clear();$("rideInstructions").style.display="block";$("rideAddLocation").style.display="block";$("rpTable").style.display="none";HD.rp.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_TOP_CONTROL);HD.rp.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_BOTTOM_CONTROL);HD.rp.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_ADD_LOCATION);HD.rp.accordian.hideStaticTab(HD.rp.constants._ACCORDIAN.STATIC.RIDE_SAVE_CONTROL);$("addLocationLabel").innerHTML=HD.rp.text.startLocation;YAHOO.util.Dom.replaceClass($("rideAddLocation"),"hasStops","noStops")}}this.setEditMode()},setEditMode:function(){if(this.isNewRoute()){YAHOO.util.Dom.removeClass(this.rideSaveControls,"editMode")}else{YAHOO.util.Dom.addClass(this.rideSaveControls,"editMode")}},setAsMyRide:function(A){this.clear();this.route=A;this.route.type=null;this.route.recalculate();this.initRoute();this.renderRoute();this.setEditMode();HD.rp.MapController.showAllPins()},sendRoad:function(A){if(!A){HD.ui.Dialog.showConfirm(HD.rp.text.sendRideSave,HD.rp.text.sendRideSaveMessage,function(){HD.rp.MyRide.saveRide(null,null,null,function(){if(!HD.User.promptLogin()){HD.rp.User.loginPendingFor=HD.rp.User._LOGIN_PENDING_FOR.SENDROAD}else{HD.rp.MyRide.sendRoad(true)}})},330,95);return }HD.rp.dialog.SendDialog.show(this.route.data.id)},rideIt:function(C){var B=document.createElement("div");B.className="rider";var G=YAHOO.util.Dom.getXY(HD.rp.hdMap.map.mapelement);C=C||this.route;var D=C.stopList.start;var F=(!!D&&!!D.segmentOut)?D.segmentOut.getVELatLongs():null;if(F){var A=function(I){var J;if((I+1)<F.length){var M=HD.rp.hdMap.map.LatLongToPixel(F[I]);var K=HD.rp.hdMap.map.LatLongToPixel(F[I+1]);var L=Math.sqrt(Math.pow(Math.abs(K.x-M.x),2)+Math.pow(Math.abs(K.y-M.y),2));J=new YAHOO.util.Anim(B,{top:{from:(M.y+G[1]),to:(K.y+G[1])},left:{from:(M.x+G[0]),to:(K.x+G[0])}},L/175);J.onComplete.subscribe(function(){A(I+1)});J.animate()}else{D=D.nextStop();F=(!!D&&!!D.segmentOut)?D.segmentOut.getVELatLongs():null;if(!!F){A(0)}else{J=new YAHOO.util.Anim(B,{opacity:{from:1,to:0}},0.5,YAHOO.util.Easing.easeOut);J.onComplete.subscribe(function(){document.body.removeChild(B)});J.animate()}}};document.body.appendChild(B);var H=HD.rp.hdMap.map.LatLongToPixel(F[0]);B.style.top=(H.y+G[1])+"px";B.style.left=(H.x+G[0])+"px";var E=new YAHOO.util.Anim(B,{opacity:{from:0,to:1}},0.5,YAHOO.util.Easing.easeIn);E.onComplete.subscribe(function(){A(0)});E.animate()}}};HD.rp.MapController={loadingIndicator:null,mouseDownXY:null,shapeClicked:null,shapeDragged:null,shapeDragLine1:null,shapeDragLine2:null,shapeDragImage:null,dragThreshold:5,changeViewTimer:null,oldCursor:null,backupCoordinates:{},overlayIFrames:new Array(),init:function(){var A=this;HD.rp.hdMap.attachEvent("onmouseover",function(B){return A.handleMouseOver.call(A,B)});HD.rp.hdMap.attachEvent("onmouseout",function(B){return A.handleMouseOut.call(A,B)});HD.rp.hdMap.attachEvent("onmousedown",function(B){return A.handleMouseDown.call(A,B)});HD.rp.hdMap.attachEvent("onclick",function(B){return A.handleMouseClick.call(A,B)});HD.rp.hdMap.attachEvent("onmousemove",function(B){return A.handleMouseMove.call(A,B)});HD.rp.hdMap.attachEvent("onmouseup",function(B){return A.handleMouseUp.call(A,B)});HD.rp.hdMap.attachEvent("onendzoom",function(B){return A.handleEndZoom.call(A,B)});HD.rp.hdMap.attachEvent("onchangeview",function(B){return A.handleChangeView.call(A,B)});HD.rp.hdMap.attachEvent("oninitmode",function(B){return A.handleInitMode.call(A,B)});HD.road.Stop.prototype.get=this.getDataModel},handleMouseDown:function(B){this.mouseDownXY=[B.mapX,B.mapY];var A=this.getShape(B);this.oldShapeClicked=(A)?A:this.oldShapeClicked;if(navigator.userAgent.indexOf("Opera")!=-1){B.rightMouseButton=B.ctrlKey}if(B.rightMouseButton){if(!A){HD.rp.MapMenu.showMapContextMenu([B.clientX,B.clientY]);return false}else{if(A.segment_end){HD.rp.MapMenu.showMapContextMenu([B.clientX,B.clientY],A);return false}}}else{if(A){A.domEl=$(A.Primitives[0].iid);this.shapeClicked=A}else{if(HD.rp.MapMenu){HD.rp.MapMenu.hide()}return false}}return true},handleMouseClick:function(B){if(navigator.userAgent.indexOf("Safari")!=-1&&B.rightMouseButton){window.getSelection().removeAllRanges()}if(navigator.userAgent.indexOf("Mac")==-1||navigator.userAgent.indexOf("Safari")==-1||!B.rightMouseButton){return true}this.mouseDownXY=[B.mapX,B.mapY];var A=this.getShape(B);this.oldShapeClicked=(A)?A:this.oldShapeClicked;if(!A){HD.rp.MapMenu.showMapContextMenu([B.clientX,B.clientY]);return false}else{if(A.segment_end){HD.rp.MapMenu.showMapContextMenu([B.clientX,B.clientY],A);return false}else{HD.rp.MapMenu.show(A,HD.rp.MapMenu._TYPE.CONTEXT);return false}}return true},handleMouseMove:function(B){if(this.mousedOver){if(this.mousedOver.elementID!=B.elementID){this.handleMouseOut()}}if(this.shapeClicked){if(!!document.selection){try{document.selection.clear()}catch(C){}}if(HD.rp.MapMenu){HD.rp.MapMenu.hide()}if(!this.shapeDragged&&this.isDragged(this.shapeClicked,this.mouseDownXY,[B.mapX,B.mapY])){this.shapeDragged=this.shapeClicked}if(!this.shapeDragged){return }if(HD.rp.hdMap.isPushpin(this.shapeDragged)){try{HD.rp.hdMap.movePin(this.shapeDragged,HD.rp.hdMap.getMouseXY(B))}catch(C){}var D=this.getDataModel(this.shapeDragged);if(!!D&&D.type==HD.road.constants._STOP_TYPES.VIA){this.movePoly(this.shapeDragged,B.clientX,B.clientY,true)}}if(HD.rp.hdMap.isPolyline(this.shapeDragged)){this.movePoly(this.shapeDragged,B.clientX,B.clientY)}}else{var A=this.getShape(B);if(!this.shapeDragged&&!!A&&!!A.myride){HD.rp.renderer.rideSegment.mouseMove(A.hitbox?A.segmentPoly:A,B.clientX,B.clientY)}else{return false}}},handleMouseUp:function(D){this.shapeClicked=null;var A=this.shapeDragged;if(navigator.userAgent.indexOf("Opera")!=-1){D.rightMouseButton=D.ctrlKey}if(A){var F=HD.rp.hdMap.xyToLatLong(D.mapX,D.mapY);var C=this.getDataModel(A);if(HD.rp.hdMap.isPushpin(A)){this.addLoadingIndicator();C.skipBestFit=true;this.backupCoordinates.pinId=HD.rp.hdMap.getPushpinId(A);this.backupCoordinates.latitude=C.latitude;this.backupCoordinates.longitude=C.longitude;C.setPoint(F.Latitude,F.Longitude);if(C.type==HD.road.constants._STOP_TYPES.STOP){HD.rp.MyRide.route.reroute(C.id);HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Drag+Location"))}else{if(C.type==HD.road.constants._STOP_TYPES.VIA){HD.rp.MyRide.route.getSegment(C.id).reroute(C.id);this.endMovePoly(true);HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Drag+Waypoint"))}}}if(HD.rp.hdMap.isPolyline(A)){this.addLoadingIndicator();this.endMovePoly();var E=A[HD.rp.constants._SEGMENT_END_ID_ATTRIBUTE];var B=new HD.road.Stop(HD.road.constants._STOP_TYPES.VIA);B.setLocation(F.Latitude,F.Longitude);C.addViaBefore(B,E);this.polyOut(A);HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Change+Route"))}this.shapeDragged=null}else{A=this.getShape(D);if(A&&HD.rp.hdMap.isPushpin(A)){if(D.rightMouseButton){HD.rp.MapMenu.show(A,HD.rp.MapMenu._TYPE.CONTEXT)}else{HD.rp.MapMenu.show(A,HD.rp.MapMenu._TYPE.CLICK)}}else{return false}}},handleMouseOver:function(C){if(this.shapeDragged||C.elementID==null){return true}var A=this.getShape(C);this.mousedOver=A;this.mousedOver.elementID=C.elementID;if(HD.rp.hdMap.isPushpin(A)){if(!!A.myride&&!!A.mouseOver&&!!A.mouseOut){A.mouseOver(C);this.mouseOutCallback=A.mouseOut}else{var B=this.getDataModel(A);if(B instanceof HD.road.Route){HD.rp.Panel.invoke("viewRoadMouseOver",B.data.id);this.mouseOutCallback=function(){HD.rp.Panel.invoke("viewRoadMouseOut",B.data.id)}}HD.rp.MapMenu.show(A,HD.rp.MapMenu._TYPE.HOVER)}}if(HD.rp.hdMap.isPolyline(A)){this.polyOver(A,C.clientX,C.clientY);var D=this;this.mouseOutCallback=function(){D.polyOut(A)}}return true},handleMouseOut:function(A){this.mousedOver=null;if(this.mouseOutCallback!=null){this.mouseOutCallback();this.mouseOutCallback=null}},handleEndZoom:function(A){var B=HD.rp.hdMap.getZoomLevel();if(HD.road.RouteContext.setZoomLevel(B)){HD.rp.MyRide.renderRoute();HD.rp.Panel.each(function(C){C.showRoads()})}HD.rp.hdMap.controller.setZoomDisplay(B)},handleChangeView:function(){if(HD.rp.hdMap.is3DOn){return }if(HD.rp.Print.isOn){return }HD.rp.MapMenu.hide();if(this.changeViewTimer!=null){window.clearTimeout(this.changeViewTimer)}this.changeViewTimer=window.setTimeout(this.changeView,HD.rp.constants._CHANGE_VIEW_DELAY)},handleInitMode:function(){if(HD.rp.hdMap.is3DOn){this.show3dControls()}else{this.hide3dControls()}},show3dControls:function(){var A=HD.constants.JSP_PATH+"/empty.jsp?locale="+HD.constants.LOCALE;var H=YAHOO.util.Dom.getElementsByClassName(HD.map.HTML.largeControl.mapViewStyle);for(var J=0,G=H.length;J<G;J++){var F=H[J];if(HD.util.isVisible(F)){var E=HD.util.getDimensions(F);var K=E.height;var B=E.width;var D=HD.util.cumulativeOffset(F);var C=D[0];var I=D[1];this.overlayIFrames.push(this.createIFrame("buttonOverlay"+J,A,"absolute",C,I,4,B,K))}}},createIFrame:function(B,A,F,D,H,G,C,I){var E=document.createElement("iframe");E.name=B;E.src=A;E.style.position=F;E.style.left=D+"px";E.style.top=H+"px";E.style.zIndex=G;E.width="65px";E.height="21px";E.allowtransparency="true";E.frameBorder="0";E.scrolling="no";document.body.appendChild(E);return E},hide3dControls:function(){var A=this.overlayIFrames;if(A!=null){for(i=0,len=A.length;i<len;i++){document.body.removeChild(A[i])}}this.overlayIFrames=new Array()},changeView:function(A){if(this.changeViewTimer!=null){window.clearTimeout(this.changeViewTimer)}this.changeViewTimer=null;HD.rp.Panel.each(function(B){if(B.isOn&&(!A||A!=B.name)){B.find()}})},undoStopDrag:function(A){if(A.type==HD.road.constants._STOP_TYPES.VIA){var B=$(this.backupCoordinates.pinId);if(B!=null){B.style.display="none"}A.setPoint(this.backupCoordinates.latitude,this.backupCoordinates.longitude)}HD.rp.renderer.ridePoint.render(A)},getShape:function(A){return HD.rp.hdMap.getShape(A.elementID)},showAllPins:function(){var A=HD.rp.MyRide.route.getVELatLongs();if(A){HD.rp.hdMap.setMapView(A)}HD.rp.MapMenu.hide()},zoomToStreet:function(A){A=A||this.getCoordinates();if(!(A instanceof VELatLong)){A=HD.DWR.parseVELatLong(A)}HD.rp.hdMap.zoomToStreet(A);HD.rp.MapMenu.hide()},centerOnPoint:function(A){HD.rp.hdMap.setZoomLevel(16);this.centerMap(A)},centerMap:function(B,A){B=B||this.getCoordinates(A);if(!(B instanceof VELatLong)){B=HD.DWR.parseVELatLong(B)}HD.rp.hdMap.setCenter(B);HD.rp.MapMenu.hide()},getCoordinates:function(C){if(!C&&this.oldShapeClicked!=null&&HD.rp.hdMap.isPushpin(this.oldShapeClicked)){try{return this.oldShapeClicked.GetPoints()[0]}catch(B){var A=this.getDataModel(this.oldShapeClicked);return A.getVELatLong()}}else{return HD.rp.hdMap.xyToLatLong(this.mouseDownXY[0],this.mouseDownXY[1])}},isDragged:function(B,D,C){if(!B[HD.rp.constants._IS_DRAG_ENABLED]){return false}var A=D[0]-C[0];var E=D[1]-C[1];return Math.sqrt(A*A+E*E)>this.dragThreshold},getDataModel:function(D,A,C){if(D==null){return }if(D instanceof HD.road.Stop||D instanceof HD.road.Segment||D instanceof HD.road.Route){return D}var E=null;var B=typeof D;E=(B=="string"||B=="number")?D:E;E=(D instanceof VEShape)?D[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]:E;if(E==null){return }return HD.rp.MyRide.route.get(E)||HD.rp.Panel.getDataModel(E,A,C,true)||null},movePoly:function(E,G,F,B){var A=E[HD.rp.constants._SEGMENT_START_LAT_LONG_ATTRIBUTE];var C=E[HD.rp.constants._SEGMENT_END_LAT_LONG_ATTRIBUTE];var D=HD.rp.hdMap.calculateOffset();var H=HD.rp.hdMap.xyToLatLong(G-(D.x-10),F-(D.y-10));var J=[!!A?A:H,H];var I=[H,!!C?C:H];if(!B){this.setDragCursor()}if(!this.shapeDragLine1||!this.shapeDragLine2){this.shapeDragLine1=this.createMovePoly(J);this.shapeDragLine2=this.createMovePoly(I)}else{this.shapeDragLine1.SetPoints(J);this.shapeDragLine2.SetPoints(I)}},setDragCursor:function(){this.oldCursor=HD.rp.mapDiv.style.cursor;HD.rp.mapDiv.style.cursor="url("+HD.constants.CURSOR_PATH+"/line_drag.cur), pointer"},unsetDragCursor:function(){HD.rp.mapDiv.style.cursor=this.oldCursor},createMovePoly:function(B){var A=new VEShape(VEShapeType.Polyline,B);A.HideIcon();A.SetLineWidth(3);A.SetLineColor(new VEColor(68,66,63,0.7));HD.rp.layers.addShape(A,HD.rp.constants._LAYER_TYPE.MY_RIDE);return A},endMovePoly:function(A){HD.rp.layers.deleteShape(this.shapeDragLine1,HD.rp.constants._LAYER_TYPE.MY_RIDE);HD.rp.layers.deleteShape(this.shapeDragLine2,HD.rp.constants._LAYER_TYPE.MY_RIDE);this.shapeDragLine1=null;this.shapeDragLine2=null;if(!A){this.unsetDragCursor()}},polyOver:function(A,D,B){var C=this.getDataModel(A);if(C&&C.onMouseOver){C.onMouseOver(D,B)}},polyOut:function(A){var B=this.getDataModel(A);if(B&&B.onMouseOut){B.onMouseOut()}},addPOIToRoute:function(K){HD.rp.MapMenu.hide();this.addLoadingIndicator();var E=(K!=null)?this.getDataModel(K):this.getDataModel(this.oldShapeClicked);var H=new HD.road.Stop(HD.road.constants._STOP_TYPES.STOP);H.setLocation(E.latitude,E.longitude,E.address);H.data.name=E.is("fuel").end()?HD.rp.text.fuelLocationName:E.data.name;H.isDrag=false;H.skipBestFit=true;var U=E.is("event").has("events").end();var J=E.is("hotel").has("hotels");if((!!E.data.entityType||!!E.data.type)){if(!!E.pinEl&&!U&&!J){H.entityPinEl=E.pinEl}for(var T in E.data){var M=E.data[T];if(M!=null){H.data[T]=M}}if(!!E.data.entityType){H.data.entityType=HD.util.rtrim(E.data.entityType);H.data.entityObjectId=!!E.data.entityObjectId?E.data.entityObjectId:null}else{if(E.type==HD.road.constants._STOP_TYPES.EVENT){H.data.entityType=HD.rp.constants._POI_TYPES.EVENT;var A=null;if(!!E.data.detailKey){A=E.data.detailKey}H.data.entityObjectId=A}else{if(E.type==HD.road.constants._STOP_TYPES.HOTEL){H.data.entityType=HD.rp.constants._POI_TYPES.HOTEL;var Q=null;if(!!E.data.id){Q=E.data.id}H.data.entityObjectId=Q}else{if(!!E.data.type){H.data.entityType=HD.util.rtrim(E.data.type);H.data.entityObjectId=!!E.data.detailKey?E.data.detailKey:null}}}}}if(HD.rp.MyRide.route.stopList&&HD.rp.MyRide.route.stopList.getStopCount()<2){HD.rp.MyRide.route.addStopAfter(H)}else{var N=new Array();var P=0;var S=Number.MAX_VALUE;var C=null;var I=Number.MAX_VALUE;var F=0;(function(X){for(var W=X;W!=null;W=W.nextSegment()){N=W.getPoints();P=(N!=null)?N.length:0;I=Number.MAX_VALUE;F=0;for(var V=0;V<P;V++){F=HD.util.getDistance(H,N[V]);if(F<I){I=F;index=V}}if(I<S){S=I;C=W;if(C.vias.length>0){var Y=C.getPointList();S=Number.MAX_VALUE;C=null;arguments.callee(Y.start.next())}}}})(HD.rp.MyRide.route.getStart().next());var D=C.data.distance;var L=C.nextSegment();var B=(L)?L.distance:0;var O=HD.util.Math.getDistanceBetweenLatLng(H,C.start,"mi");var G=HD.util.Math.getDistanceBetweenLatLng(H,C.end,"mi");if(D>O){HD.rp.MyRide.route.addStopAfter(H,C.start.id)}else{if(B>G){HD.rp.MyRide.route.addStopAfter(H,C.end.id)}else{HD.rp.MyRide.route.addStopAfter(H)}}}if(!!E){if(E.is("dealer").end()){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Add+Location/Dealer/DealerID+Name"),{DealerID:HD.util.rtrim(E.data.detailKey),Name:HD.util.rtrim(E.data.name)})}else{if(E.is("hotel").end()){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Add+Location/Hotel/HotelID+Name"),{HotelID:HD.util.rtrim(E.data.detailKey),Name:HD.util.rtrim(E.data.name)})}else{if(E.is("event").end()){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Add+Location/Event/EventID+Name"),{EventID:HD.util.rtrim(E.data.detailKey||""),Name:HD.util.rtrim(E.data.name)})}else{if(E.is("fuel").end()){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Add+Location/Fuel/FuelID+Name"),{FuelID:HD.util.rtrim(E.data.detailKey),Name:HD.rp.text.fuelLocationName})}else{if(E.is("facility")){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Add+Location/Facility/FacilityID+Name"),{FacilityID:HD.util.rtrim(E.data.detailKey||""),Name:HD.util.rtrim(E.data.name)})}}}}}}},addToRoute:function(D,H,A){this.addLoadingIndicator();var F=null;var C=this;var E,G;E=(H!=null&&D!=null)?this.getDataModel(H):this.getDataModel(this.oldShapeClicked);if(D==HD.road.constants._STOP_TYPES.VIA&&HD.rp.MyRide.route.stopList.getStopCount()<=0){D=HD.road.constants._STOP_TYPES.STOP}if(E!=null&&!!E.address){F=new HD.road.Stop(D);G=E!=null?E.getVELatLong():HD.rp.hdMap.xyToLatLong(this.mouseDownXY[0],this.mouseDownXY[1]);F.setLocation(G.Latitude,G.Longitude,E.address)}else{F=new HD.road.Stop(D);G=E!=null?E.getVELatLong():HD.rp.hdMap.xyToLatLong(this.mouseDownXY[0],this.mouseDownXY[1]);F.setPoint(G.Latitude,G.Longitude)}F.data.name=E.data.name;F.isDrag=!!A;F.skipBestFit=true;if(D==HD.road.constants._STOP_TYPES.STOP){HD.rp.MyRide.route.addStopAfter(F)}else{var B=HD.rp.MyRide.route.getEnd();B.segmentOut.addViaBefore(F)}HD.rp.MapMenu.hide()},addToRouteFromXY:function(C,A,G,D){this.addLoadingIndicator();D=D||null;var F=HD.rp.hdMap.xyToLatLong(A,G);var E=new HD.road.Stop(C);E.setPoint(F.Latitude,F.Longitude);E.skipBestFit=true;if(C==HD.road.constants._STOP_TYPES.STOP){HD.rp.MyRide.route.addStopAfter(E,D);HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Add+Location/User/Map"))}else{var B=(D)?HD.rp.MyRide.route.getSegment(D):HD.rp.MyRide.route.getEnd().segmentOut;B.addViaBefore(E);HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Add+Waypoint"))}HD.rp.MapMenu.hide()},removePoint:function(){this.addLoadingIndicator();var B=this.getDataModel(this.oldShapeClicked);if(B.type==HD.road.constants._STOP_TYPES.STOP){HD.rp.MyRide.route.removeStop(B.id);HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Remove+Location/Map"));if(!!B.entityPinEl){var A=HD.rp.MapController.getDataModel(B.entityPinEl[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]);A.pinEl=B.entityPinEl;delete B.entityPinEl;try{var E=$(A.pinEl.Primitives[0].iid);E.style.display="block"}catch(D){}}}else{if(B.type==HD.road.constants._STOP_TYPES.VIA){var C=HD.rp.MyRide.route.getSegment(B.id);C.removeVia(B.id);HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Remove+Waypoint"))}}HD.rp.MapMenu.hide();HD.rp.MyRide.setAccordianElements()},viaToLocation:function(){this.addLoadingIndicator();HD.rp.MyRide.route.convertViaToStop(this.oldShapeClicked[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]);HD.rp.MapMenu.hide()},locationToVia:function(){this.addLoadingIndicator();HD.rp.MyRide.route.convertStopToVia(this.oldShapeClicked[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]);HD.rp.MapMenu.hide()},listPinOver:function(B,C){var A=!!C?C:this.getDataModel(B.getAttribute(HD.rp.constants._DATAMODEL_ID_ATTRIBUTE));if(!A){return }A=!!A.pinEl?A:this.getDataModel(A.data.id);if(!!A.pinEl&&HD.rp.util.shapeInsideView(A.pinEl)){HD.rp.MapMenu.show(A,HD.rp.MapMenu._TYPE.HOVER,"hover",true)}},listPinOut:function(A){},listPinClick:function(A){},centerRoad:function(B){var A=HD.rp.Panel.getDataModel(B,null,null,true);if(A==null){return }HD.rp.hdMap.setMapView([HD.DWR.parseVELatLong(A.data.boundingPoint1),HD.DWR.parseVELatLong(A.data.boundingPoint2)]);HD.rp.MapMenu.hide()},linkToPage:function(){var F=HD.rp.hdMap.getCenter();var B=new HD.road.Waypoint(F.Latitude,F.Longitude,HD.road.constants._POINT_SCALE);var G=HD.rp.hdMap.getZoomLevel();var E=HD.constants.JSP_PATH+"/ridePlanner.jsp?locale="+HD.constants.LOCALE;E+="&"+HD.rp.constants._REQUEST_PARAMS.LATITUDE+"="+B.latitude;E+="&"+HD.rp.constants._REQUEST_PARAMS.LONGITUDE+"="+B.longitude;E+="&"+HD.rp.constants._REQUEST_PARAMS.ZOOM_LEVEL+"="+G;HD.rp.Panel.each(function(H){E+=H.serializeRequest()});var A=document.createElement("div");A.className=HD.rp.dialog.HTML.linkDialog.className;var D=HD.rp.dialog.HTML.linkDialog.code;D=HD.util.template(D,{_CONTENT:E});A.innerHTML=D;HD.ui.Dialog.show(HD.map.Text.linkToPage,"400","60",A);var C=A.getElementsByTagName("input")[0];C.focus();C.select()},printMyRoad:function(){this.printRoad(HD.rp.MyRide.route)},printRoad:function(B,C){if(B.type==null||!!C){B.type=(B.data.id==null||B.data.id==0||!!C)?HD.road.constants._STOP_TYPES.MY_RIDE:HD.road.constants._STOP_TYPES.USER_ROAD}if(B.type==HD.road.constants._STOP_TYPES.MY_RIDE){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Print/View"))}else{HD.rp.util.Hitbox.track("Application/Roads/More+Info/Print+View")}var A=B.clone();A.detachEvents();HD.rp.Print.init(A,HD.rp.hdMap)},addLoadingIndicator:function(A){A=A||null;if(this.loadingIndicator){this.loadingIndicator.remove()}this.loadingIndicator=new HD.ui.LoadingIndicator(HD.rp.mapDiv,A)},isLoading:function(){return(this.loadingIndicator)?true:false},removeLoadingIndicator:function(){if(this.loadingIndicator){this.loadingIndicator.remove()}this.loadingIndicator=null},setCityView:function(E){if(E.address==null){return }var H=0;var F=E.address.data;var B=HD.util.hasValue(F.lineOne);var I=HD.util.hasValue(F.city);var G=HD.util.hasValue(F.postalCode);var C=HD.util.hasValue(F.stateCode);var D=HD.util.hasValue(F.province);if((!B&&!I&&!G&&C)||(!B&&!I&&!G&&D)){H=HD.rp.constants._ZOOM_LEVELS.STATE}else{if(!B&&!I&&G&&C){H=HD.rp.constants._ZOOM_LEVELS.ZIP}else{if(!B&&I&&C){var A=HD.rp.constants._ZOOM_LEVELS.MAJOR_CITIES[F.city];H=A!=null?A.zoom:HD.rp.constants._ZOOM_LEVELS.NON_MAJOR_CITY}else{if(B&&I&&G&&C){H=HD.rp.constants._ZOOM_LEVELS.STREET}}}}if(H!=0){HD.rp.hdMap.setCenterAndZoom(E.getVELatLong(),H)}},publishRoad:function(A,B){RoadService.publishRoad(A,B,function(C){alert(C)})}};HD.rp.RoadPanel=HD.util.Class.inherit(HD.rp.Panel,{name:"road",reference:"HD.rp.RoadPanel",listManager:new HD.rp.service.RoadManager(),showLocationsRoad:null,useBestFit:false,initialize:function(A){HD.util.Class.extend(this,[A],true)},getDataModel:function(C,B,A){return !!this.showLocationsRoad?this.showLocationsRoad.get(C):null},find:function(B){if(this.listManager&&this.isOn){B=B||HD.rp.constants._FIRST_PAGE_INDEX;var A={boundingPoint1:HD.DWR.formatVELatLong(HD.rp.hdMap.getNW()),boundingPoint2:HD.DWR.formatVELatLong(HD.rp.hdMap.getSE()),point:HD.DWR.formatVELatLong(HD.rp.hdMap.getCenter()),zoom:HD.rp.hdMap.getZoomLevel(),pageNumber:B||1,userSubmitted:null};this.listManager.find(A);this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults;if(this.loadingIndicator){this.loadingIndicator.remove()}this.elements.content.innerHTML="";this.loadingIndicator=new HD.ui.LoadingIndicator(this.elements.content," ","loadingIndicatorPanelGray",{noPosition:true});this.action("find",{searchObject:A,pageIndex:B})}this.updateState(true)},foundRoads:function(A){if(this.isOn){for(var C=0;C<A.roadsList.length;C++){this.setRoadPolylineStatus(A.roadsList[C])}if(!!this.showLocationsRoad&&!!A&&!!A.roadsList){var D=false;for(var B=0;B<A.roadsList.length;B++){if(A.roadsList[B].data.id==this.showLocationsRoad.data.id){D=true;break}}if(!D){this.hideLocations()}}this.render(A.roadsList||[],A.pageIndex,A.totalPageCount,A.recordIndex,A.recordsOnPage,A.totalRecordsCount)}else{this.foundNoRoads()}},foundNoRoads:function(){this.clear();this.hideLocations();if(this.loadingIndicator){this.loadingIndicator.remove()}this.loadingIndicator=null;this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults;this.updateState()},gotRoad:function(B){var A=HD.rp.DataItem.make(B,this.name);this.setRoadPolylineStatus(B);if(A.item[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]){this.showLocations(A.item,true)}else{this.viewRenderRoad(A.item)}},printRoad:function(E,D,B){HD.ui.Dialog.hide();var A=HD.rp.Panel.getDataModel(E,this.name,null,true);E=!!A?A.data.id:E;if(A!=null&&A.getStart()!=null){HD.rp.MapController.printRoad(A,B)}else{var C=this;this.listManager.get(E,A.data.userSubmitted,true,function(G){var F=HD.rp.DataItem.make(G,C.name);C.printRoad.call(C,E,null,B)})}},showRoadDetails:function(D,C){var A=HD.rp.Panel.getDataModel(D,this.name,null,true);D=!!A?A.data.id:D;if(A==null){return }if(A.getStart()==null){var B=this;this.listManager.get(D,A.data.userSubmitted,true,function(F){var E=HD.rp.DataItem.make(F,B.name);B.showRoadDetails(D,C)})}else{HD.rp.dialog.RoadDetails.showDetails(A,C)}},setRoadPolylineStatus:function(A){if(A[HD.rp.constants._SHOW_POLYLINE_OVERRIDE_ATTRIBUTE]!=null){A[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]=A[HD.rp.constants._SHOW_POLYLINE_OVERRIDE_ATTRIBUTE]}else{A[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]=false}},zoomToShowRoad:function(D,B,E){var A=HD.rp.Panel.getDataModel(D,this.name,null,true);D=!!A?A.data.id:D;var C=false;if(!B){C=!HD.rp.hdMap.setCenterAndZoom(A,!!this.useBestFit)}this.showLocations(D,null,C,E)},showLocations:function(F,C,E,G){HD.rp.MapMenu.hide();var B=!(F instanceof HD.road.Route)?HD.rp.Panel.getDataModel(F,this.name,null,true):F;if(!B){return }F=!!B?B.data.id:F;this.hideLocations();if(!C){this.action("showLocations")}B[HD.rp.constants._SHOW_POLYLINE_OVERRIDE_ATTRIBUTE]=true;B[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]=true;if(B.isEmpty()){var D=this;var A=G;this.listManager.get(F,B.data.userSubmitted,true,function(I){var H=HD.rp.DataItem.make(I,D.name);D.viewRenderRoad(H.item,null,true,true,!!E);if(A!=null){A(H.item)}})}else{this.viewRenderRoad(B,null,true,true,!!E)}},hideLocations:function(D,C,B){HD.rp.MapMenu.hide();if(!!this.showLocationsRoad&&(!B||B==this.showLocationsRoad.type)){var A=this.showLocationsRoad;if(!!C){this.action("hideLocations")}A[HD.rp.constants._SHOW_POLYLINE_OVERRIDE_ATTRIBUTE]=null;A[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]=null;this.viewHideLocations(A);this.showLocationsRoad=null}},addLocations:function(B){this.hideLocations();var A=HD.rp.Panel.getDataModel(B,this.name,null,true);B=!!A?A.data.id:B;HD.rp.MyRide.appendRoute(A);this.action("addLocations",A)},clearRequestQueue:function(){this.listManager.activeFinds=0},isFindActive:function(){return(this.listManager.activeFinds>0)},isGetActive:function(){return(this.listManager.activeGets>0)},viewShowLocations:function(C,A){C.isStatic=true;var F={id:C.data.id,name:C.data.name,type:C.type};var I=C.stopList.start;var D=[];while(I!=null){if(!I.vias){if(!A){if(I.type==HD.road.constants._STOP_TYPES.GREAT_ROAD||I.type==HD.road.constants._STOP_TYPES.USER_ROAD){I.type=HD.road.constants._STOP_TYPES.STOP}I.isStatic=true;I.parentRoad=F;I.pinEl=HD.rp.renderer.getMapPin(I);I.pinEl[HD.rp.constants._IS_DRAG_ENABLED]=false;I.pinEl[HD.rp.constants._DATAMODEL_ID_ATTRIBUTE]=I.id;HD.rp.layers.addShape(I.pinEl,HD.rp.layers.getLayerType(C),HD.rp.HTML.pinShadow)}var G=HD.rp.HTML.roadList.locationCode;G=G.replace(/_NAME/,I.getTitle());G=G.replace(/_ADDRESS/,I.getLocationHTML());G=G.replace(/_ID/,I.id);D.push(G)}I=I.next()}var H=YAHOO.util.Dom;var E=H.getElementsByClassName("locations","div",C.listEl)[0];var B=H.getElementsByClassName("locationsList","ul",E)[0];if(typeof B!="undefined"){B.innerHTML=D.join("");var J=B.getElementsByTagName("li");if(J.length>0){H.addClass(J[J.length-1],"last")}H.replaceClass(E,"hideLocs","showLocs")}if(!!C.listEl&&!!C.listEl.parentNode){C.listEl.parentNode.scrollTop=C.listEl.offsetTop}},viewHideLocations:function(B){this.viewClearRoadPolylines(B);var F=HD.rp.layers.getLayer(HD.rp.layers.getLayerType(B));var I=F.GetShapeCount();for(var C=I-1;C>=0;C--){var H=F.GetShapeByIndex(C);var D=HD.rp.Panel.getDataModel(H.datamodel_id,this.name,null,true);if(!!D){if(D instanceof HD.road.Stop){switch(D.type){case HD.road.constants._STOP_TYPES.STOP:case HD.road.constants._STOP_TYPES.VIA:HD.rp.layers.deleteShape(H,HD.rp.layers.getLayerType(B));delete D.pinEl;delete D.isStatic;delete D.parentRoad;break;default:break}}}}var G=YAHOO.util.Dom;var E=G.getElementsByClassName("locations","div",B.listEl);if(E.length>0){E=E[0];var A=G.getElementsByClassName("locationsList","ul",E)[0];A.innerHTML="";G.replaceClass(E,"showLocs","hideLocs")}delete B.isStatic},viewClearRoadPolylines:function(A){var B=HD.rp.renderer;if(!A.isEmpty()){var C=A.getStart().segmentOut;while(C!=null){B.roadSegment.clear(C);C=C.nextSegment()}}},viewRenderRoad:function(D,C,L,K,B){if(this.isOn){if(!!B){HD.rp.hdMap.setCenterAndZoom(D,!!this.useBestFit)}for(var F=0;F<this.renderedItems.length;F++){var H=this.renderedItems[F].item;if(H.data.id==D.data.id&&H!=D){for(prop in H){var A=prop.length;var G=prop.lastIndexOf("El");if((G>0)&&((A-G)==2)){D[prop]=H[prop]}}this.renderedItems[F].item=D;D=this.renderedItems[F];break}}if(!D.item){D=HD.rp.DataItem.make(D,this.name);this.renderedItems.push(D)}if(!D.item[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]||D.item.isEmpty()){return }var E=true;var I=D.item.getStart().segmentOut;var J=D.getRenderer();while(I!=null){D.render(I,J,[E,!!C,!!L]);I=I.nextSegment();E=false}if(!!K){this.viewShowLocations(D.item);this.showLocationsRoad=D.item}}else{D[HD.rp.constants._SHOW_POLYLINE_OVERRIDE_ATTRIBUTE]=null;D[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]=null;this.showLocationsRoad=null}},viewRoadMouseOver:function(B){var A=HD.rp.Panel.getDataModel(B,this.name,null,true);var C=A.getStart();while(C!=null){if(C.onMouseOver){C.onMouseOver()}C=C.next()}},viewRoadMouseOut:function(B){var A=HD.rp.Panel.getDataModel(B,this.name,null,true);var C=A.getStart();while(C!=null){if(C.onMouseOut){C.onMouseOut()}C=C.next()}}});HD.rp.Panel.implement(HD.rp.RoadPanel,{actions:{hide:function(A){A.hideLocations()},init:function(A){A.listManager.callbacks[HD.rp.service.RoadManagerEvents.ON_FOUND_ROADS]=function(){A.foundRoads.apply(A,arguments)};A.listManager.callbacks[HD.rp.service.RoadManagerEvents.ON_FOUND_NO_ROADS]=function(){A.foundNoRoads.apply(A,arguments)};A.listManager.callbacks[HD.rp.service.RoadManagerEvents.ON_GOT_ROAD]=function(){A.gotRoad.apply(A,arguments)}}}});HD.rp.RoadsPanel=HD.util.Class.inherit(HD.rp.RoadPanel,{name:"roads",reference:"HD.rp.RoadsPanel",hbx:HD.rp.util.Hitbox.select("Application/Roads"),isGreatOn:false,isUserOn:false,roadId:false,initialize:function(A){HD.util.Class.extend(this,[{listManager:new HD.rp.service.RoadManager(),request:{params:[HD.rp.constants._REQUEST_PARAMS.SHOW_GREAT_ROADS,HD.rp.constants._REQUEST_PARAMS.SHOW_USER_ROADS,HD.rp.constants._REQUEST_PARAMS.BYWAY_ID,HD.rp.constants._REQUEST_PARAMS.ROAD_ID],handler:function(F){var B=F[HD.rp.constants._REQUEST_PARAMS.BYWAY_ID];var E=F[HD.rp.constants._REQUEST_PARAMS.ROAD_ID];var D=!!F[HD.rp.constants._REQUEST_PARAMS.SHOW_GREAT_ROADS];var C=!!F[HD.rp.constants._REQUEST_PARAMS.SHOW_USER_ROADS];if(B||E){if(!HD.rp.constants._PERMALINK_MY_RIDE_IMPORT){this.show(null,false,false)}if(B){this.showRoad(B,HD.road.constants._STOP_TYPES.GREAT_ROAD)}else{this.showRoad(E,HD.road.constants._STOP_TYPES.USER_ROAD)}}else{if(D||C){this.show(null,D,C)}}},serialize:function(){var B="";if(this.isGreatOn){B+="&"+HD.rp.constants._REQUEST_PARAMS.SHOW_GREAT_ROADS+"=1"}if(this.isUserOn){B+="&"+HD.rp.constants._REQUEST_PARAMS.SHOW_USER_ROADS+"=1"}return B}},text:{beyondZoom:HD.rp.text.panelMessages.roadStates.beyondZoomUserRoads,filters:HD.rp.HTML.panel.roads.filters,noneInView:HD.rp.text.panelMessages.roadStates.noRoadsInView,tab:HD.rp.text.roadsTab,toggle:HD.rp.text.roadsToggle}},A],true)},showRoads:function(){var A=HD.rp.Panel.getDataModel(this.roadId,this.name,null,true);this.viewRenderRoad(A)},showRoad:function(C,B){if(this.listManager){this.setGreatRoads(false,true);this.setUserRoads(false,true);this.roadId=C;var A={id:C,userSubmitted:B!=HD.road.constants._STOP_TYPES.GREAT_ROAD};this.listManager.find(A);this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults;if(this.loadingIndicator){this.loadingIndicator.remove()}this.elements.content.innerHTML="";this.loadingIndicator=new HD.ui.LoadingIndicator(this.elements.content," ","loadingIndicatorPanelGray",{noPosition:true});this.updateState(true);this.action("showRoad",{searchObject:A})}},foundRoads:function(A){if(this.isOn&&!this.roadId){for(var C=0;C<A.roadsList.length;C++){this.setRoadPolylineStatus(A.roadsList[C])}if(!!this.showLocationsRoad&&!!A&&!!A.roadsList){var D=false;for(var B=0;B<A.roadsList.length;B++){if(A.roadsList[B].data.id==this.showLocationsRoad.data.id){D=true;break}}if(!D){this.hideLocations()}}this.render(A.roadsList||[],A.pageIndex,A.totalPageCount,A.recordIndex,A.recordsOnPage,A.totalRecordsCount)}else{if(A.roadsList.length==1&&!!this.roadId){if(HD.rp.constants._PERMALINK_MY_RIDE_IMPORT){A.roadsList[0][HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]=true}else{this.setRoadPolylineStatus(A.roadsList[0]);A.roadsList[0][HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]=true;this.render(A.roadsList||[],A.pageIndex,A.totalPageCount,A.recordIndex,A.recordsOnPage,A.totalRecordsCount);this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults}}else{this.foundNoRoads()}}},gotRoad:function(B){var A=HD.rp.DataItem.make(B,this.name);if(this.roadId==A.item.data.id){if(HD.rp.constants._PERMALINK_MY_RIDE_IMPORT){A.item[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]=false;HD.rp.MyRide.importRoute(A.item);HD.rp.MapController.showAllPins()}else{B[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]=true;this.zoomToShowRoad(A.item.data.id)}}else{this.setRoadPolylineStatus(B);if(A.item[HD.rp.constants._SHOW_POLYLINE_ATTRIBUTE]){this.showLocations(A.item,true)}else{this.viewRenderRoad(A.item)}}},toggle:function(C,B,A){this.isOn=typeof C!="undefined"||C==null?C:!this.isOn;B=B==null?true:B;A=A==null?true:A;if(this.isOn){this.setGreatRoads(B,true);this.setUserRoads(A,true);this.find()}else{this.setGreatRoads(B,true);this.setUserRoads(A,true);this.clear();this.updateState()}this.action("toggle",{force:C})},show:function(D,C,B){if(D&&D.blur){D.blur()}if(HD.rp.accordian.selectedTabIndex==this.accordian.tab){return }HD.rp.accordian.selectTab(this.accordian.tab);if(HD.rp.MapController.changeViewTimer!=null){HD.rp.MapController.changeView(this.name)}C=C==null?true:C;B=B==null?true:B;if(!this.isOn){var A=HD.rp.hdMap.getZoomLevel()>=HD.rp.constants._MIN_ZOOM_LEVELS.USER_ROADS;this.toggle(true,C,B&&A);this.action("show")}},hide:function(A){if(A&&A.blur){A.blur()}HD.rp.accordian.hideTab(this.accordian.tab);this.toggle(false);HD.rp.setToggleIconClass();HD.rp.MapMenu.hide();this.action("hide")},find:function(B,C){if(this.listManager&&(this.isGreatOn||this.isUserOn)){this.roadId=null;B=B||HD.rp.constants._FIRST_PAGE_INDEX;var A={boundingPoint1:HD.DWR.formatVELatLong(HD.rp.hdMap.getNW()),boundingPoint2:HD.DWR.formatVELatLong(HD.rp.hdMap.getSE()),point:HD.DWR.formatVELatLong(HD.rp.hdMap.getCenter()),zoom:HD.rp.hdMap.getZoomLevel(),pageNumber:B||1,pageSize:10,userSubmitted:this.isGreatOn&&this.isUserOn?null:this.isUserOn};HD.rp.dwrMonitor.kill({RoadService:["getBywaysInBox","findRoadsInBox"]});this.clearRequestQueue();this.listManager.find(A);this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults;if(this.loadingIndicator){this.loadingIndicator.remove()}this.elements.content.innerHTML="";this.loadingIndicator=new HD.ui.LoadingIndicator(this.elements.content," ","loadingIndicatorPanelGray",{noPosition:true});this.action("find",{searchObject:A,pageIndex:B});this.updateState(true)}else{if(!!C){this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults;if(this.loadingIndicator){this.loadingIndicator.remove()}this.clear();this.elements.content.innerHTML="";this.updateState()}else{this.updateState(true)}}},setGreatRoads:function(B,A){if(B!=null){if(B!=this.isGreatOn){if(!!B){HD.rp.util.Hitbox.track(this.hbx.select("Show/Great+Roads"))}else{HD.rp.util.Hitbox.track(this.hbx.select("Hide/Great+Roads"))}this.isGreatOn=B;this.elements.greatRoadCheck.checked=this.isGreatOn;if(!A){this.find(null,true)}}}return this.isGreatOn},setUserRoads:function(B,A){if(B!=null){if(B!=this.isUserOn){if(!!B){HD.rp.util.Hitbox.track(this.hbx.select("Show/User+Roads"))}else{HD.rp.util.Hitbox.track(this.hbx.select("Hide/User+Roads"))}this.isUserOn=B;this.elements.userRoadCheck.checked=this.isUserOn;if(!A){this.find(null,true)}}}return this.isUserOn},updateState:function(D){var A=this.elements.message;var B=HD.rp.text.blank;var C=B;if(!D){if((!this.isGreatOn&&!this.isUserOn)||(this.renderedItems.length==0)){C=this.text.noneInView}else{if(!!this.roadId){C=B}}}A.style.display=!!C?"block":"none";A.innerHTML=C;HD.rp.accordian.updateContentHeight();this.action("updateState",{message:C});return C}});HD.rp.Panel.implement(HD.rp.RoadsPanel,{actions:{addLocations:function(B,A){if(A.type==HD.road.constants._STOP_TYPES.GREAT_ROAD){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Add+Location/Road/Great+Road/RoadID+Name"),{RoadID:HD.util.rtrim(A.data.id),Name:HD.util.rtrim(A.data.name)})}else{if(A.type==HD.road.constants._STOP_TYPES.USER_ROAD){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Add+Location/Road/User+Road/RoadID+Name"),{RoadID:HD.util.rtrim(A.data.id),Name:HD.util.rtrim(A.data.name)})}}},hide:function(){HD.rp.util.Hitbox.track("Application/Map/Hide/Roads")},hideLocations:function(A){HD.rp.util.Hitbox.track(A.hbx.select("Locations/Hide"))},init:function(A){var B=YAHOO.util.Event;A.elements.greatRoadCheck=$("greatRoadCheck");A.elements.userRoadCheck=$("userRoadCheck");B.addListener(A.elements.greatRoadCheck,"click",function(){A.setGreatRoads(this.checked)});B.addListener(A.elements.userRoadCheck,"click",function(){A.setUserRoads(this.checked)})},promo:function(){HD.rp.launchHelp("public")},show:function(){HD.rp.util.Hitbox.track("Application/Map/Show/Roads")},showLocations:function(A){HD.rp.util.Hitbox.track(A.hbx.select("Locations/Show"))}}});HD.rp.PoiPanel=HD.util.Class.inherit(HD.rp.Panel,{name:"poi",reference:"HD.rp.PoiPanel",listManager:new HD.rp.service.PointsList(this.name),initialize:function(A){HD.util.Class.extend(this,[A],true)},find:function(A,C){A=A||HD.rp.constants._FIRST_PAGE_INDEX;if(this.listManager&&this.isOn){if(HD.rp.MyRide.route.isEmpty()){this.listManager.getDataInBox(A,{})}else{var B=HD.road.DWR.routeToWKTString(HD.rp.MyRide.route,1);this.listManager.getDataAlongRoute(A,B,C)}}this.updateState(true)},isActive:function(){return this.listManager.isActive}});HD.rp.Panel.implement(HD.rp.PoiPanel,{actions:{init:function(A){A.listManager.callbacks.handleGetDataInBox=function(){A.render.apply(A,arguments)};A.listManager.callbacks.handleGetDataAlongRoute=function(){A.render.apply(A,arguments)};A.listManager.callbacks.handleGetEntityData=null;A.listManager.callbacks.clear=function(){A.clear()}}}});HD.rp.DealerPanel=HD.util.Class.inherit(HD.rp.PoiPanel,{name:"dealer",reference:"HD.rp.DealerPanel",initialize:function(A){HD.util.Class.extend(this,[{listManager:new HD.rp.service.PointsList(HD.rp.constants._POI_TYPES.DEALER),request:{params:[HD.rp.constants._REQUEST_PARAMS.SHOW_DEALERS],handler:function(B){if(!!B[HD.rp.constants._REQUEST_PARAMS.SHOW_DEALERS]){this.show()}},serialize:function(){var B="";if(this.isOn){B+="&"+HD.rp.constants._REQUEST_PARAMS.SHOW_DEALERS+"=1"}return B}},text:{beyondZoom:HD.rp.text.panelMessages.dealerStates.beyondZoom,filters:"",noneInView:HD.rp.text.panelMessages.dealerStates.noneInView,tab:HD.rp.text.dealerTab,toggle:HD.rp.text.dealerToggle}},A],true)},getDealerWebsite:function(B){var A=HD.rp.Panel.getDataModel(B,null,HD.rp.DealerItem,true);if(!!A){HD.rp.util.Hitbox.track("Application/Dealers/View+Dealer+Website/DealerID+Name",{DealerID:HD.util.rtrim(A.data.detailKey),Name:HD.util.rtrim(A.data.name)})}},getDealerDetails:function(B){var A=HD.rp.Panel.getDataModel(B,null,HD.rp.DealerItem,true);if(!!A){HD.rp.util.Hitbox.track("Application/Dealers/More+Info/DealerID+Name",{DealerID:HD.util.rtrim(A.data.detailKey),Name:HD.util.rtrim(A.data.name)})}this.listManager.getEntityData([B],HD.rp.constants._POI_TYPES.DEALER)},showDealerDetails:function(B){if(!B.length||B.length<1){return }var A=B[0];var D=new HD.rp.service.DealerDetails(A);var C=D.generateView();HD.ui.Dialog.show(HD.rp.dialog.Text.dealerInformation,435,345,C)}});HD.rp.Panel.implement(HD.rp.DealerPanel,{actions:{hide:function(){HD.rp.util.Hitbox.track("Application/Map/Hide/Dealers")},init:function(A){A.listManager.callbacks.handleGetEntityData=function(){A.showDealerDetails.apply(A,arguments)}},promo:function(){HD.rp.launchHelp("public")},show:function(){HD.rp.util.Hitbox.track("Application/Map/Show/Dealers")}}});HD.rp.HotelPanel=HD.util.Class.inherit(HD.rp.PoiPanel,{name:"hotel",reference:"HD.rp.HotelPanel",initialize:function(A){HD.util.Class.extend(this,[{listManager:new HD.rp.service.PointsList(HD.rp.constants._POI_TYPES.HOTEL),request:{params:[HD.rp.constants._REQUEST_PARAMS.SHOW_HOTELS],handler:function(B){if(!!B[HD.rp.constants._REQUEST_PARAMS.SHOW_HOTELS]){this.show()}},serialize:function(){var B="";if(this.isOn){B+="&"+HD.rp.constants._REQUEST_PARAMS.SHOW_HOTELS+"=1"}return B}},text:{beyondZoom:HD.rp.text.panelMessages.hotelStates.beyondZoom,filters:"",noneInView:HD.rp.text.panelMessages.hotelStates.noneInView,tab:HD.rp.text.hotelTab,toggle:HD.rp.text.hotelToggle}},A],true)},find:function(A,D){this.searchQueue=null;if(this.listManager&&this.isOn){var B={corridorWidth:HD.rp.constants._CORRIDOR_WIDTH[HD.rp.constants._POI_TYPES.HOTEL],stops:HD.road.DWR.routeToWKTString(HD.rp.MyRide.route,1)};HD.rp.dwrMonitor.kill({HotelsService:["getHotelLocationsInBox","getHotelsInBox"]});var C=this.listManager.getDataInBox(A||HD.rp.constants._FIRST_PAGE_INDEX,B,D);if(C){this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults;if(this.loadingIndicator){this.loadingIndicator.remove()}this.elements.content.innerHTML="";this.loadingIndicator=new HD.ui.LoadingIndicator(this.elements.content," ","loadingIndicatorPanelGray",{noPosition:true});this.updateState(true);this.action("find",{pageIndex:A})}}else{if(types.length==0){this.clear();if(this.loadingIndicator){this.loadingIndicator.remove()}this.loadingIndicator=null;this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults;this.updateState()}}},launchHotelSearch:function(I,J){var H={checkIn:(new Date().getMonth()+1)+"/"+(new Date().getDate())+"/"+(new Date().getFullYear()),checkOut:(new Date().getMonth()+1)+"/"+(new Date().getDate()+2)+"/"+(new Date().getFullYear()),numAdults:1};J=J||{};for(var B in J){H[B]=J[B]}var F=HD.rp.Panel.getDataModel(I,null,HD.rp.HotelItem,true);if(!F){return }var C="";var G="";var D="";D=H.checkIn.split("/");for(var E=0;E<D.length;E++){C+=D[E].length<2?"0"+D[E]:D[E];if(E<2){C+="/"}}D=H.checkOut.split("/");for(var E=0;E<D.length;E++){G+=D[E].length<2?"0"+D[E]:D[E];if(E<2){G+="/"}}HD.rp.util.Hitbox.track("Application/Hotels/Book/HotelID+Name",{HotelID:HD.util.rtrim(F.data.detailKey),Name:HD.util.rtrim(F.data.name)});var A=HD.rp.URL.hotelSearch;A=HD.util.template(A,{_HOTEL_ID:HD.util.rtrim(F.data.id),_COUNTRY_CODE:HD.rp.URL.hotelCountryCodes.find(F.address.data.country),_STATE_CODE:!!F.address.data.stateCode?HD.rp.URL.hotelStateCodes.find(F.address.data.country,F.address.data.stateCode):(!!F.address.data.province?HD.rp.URL.hotelStateCodes.find(F.address.data.country,F.address.data.province):""),_CITY_CODE:F.address.data.city,_CHECKIN_DATE:C.replace(/\//g,"%2F"),_CHECKOUT_DATE:G.replace(/\//g,"%2F"),_NUM_ADULTS:H.numAdults});window.open(A)}});HD.rp.Panel.implement(HD.rp.HotelPanel,{actions:{hide:function(){HD.rp.util.Hitbox.track("Application/Map/Hide/Hotels")},promo:function(){window.open(HD.rp.URL.hotelLanding)},init:function(A){A.listManager.services.getDataInBox=function(C){var B=C.grouping;delete C.grouping;HotelsService[B=="location"?"getHotelLocationsInBox":"getHotelsInBox"](C,function(D){A.listManager.handleGetData.call(A.listManager,D,false)})};A.listManager.services.getDataAlongRoute=function(){return };A.listManager.services.getEntityData=function(){return };A.listManager.callbacks.handleGetDataAlongRoute=function(){return }},show:function(){HD.rp.util.Hitbox.track("Application/Map/Show/Hotels")}}});HD.rp.EventPanel=HD.util.Class.inherit(HD.rp.PoiPanel,{name:"event",reference:"HD.rp.EventPanel",dateRange:null,searchQueue:null,initialize:function(A){HD.util.Class.extend(this,[{listManager:new HD.rp.service.PointsList(HD.rp.constants._POI_TYPES.EVENT),request:{params:[HD.rp.constants._REQUEST_PARAMS.SHOW_EVENTS],handler:function(B){if(!!B[HD.rp.constants._REQUEST_PARAMS.SHOW_EVENTS]){this.show()}},serialize:function(){var B="";if(this.isOn){B+="&"+HD.rp.constants._REQUEST_PARAMS.SHOW_EVENTS+"=1"}return B}},text:{beyondZoom:HD.rp.text.panelMessages.eventStates.beyondZoom,filters:HD.rp.HTML.panel.events.filters,noneInView:HD.rp.text.panelMessages.eventStates.noneInView,tab:HD.rp.text.eventTab,toggle:HD.rp.text.eventToggle}},A],true)},find:function(A,F){this.searchQueue=null;var E=[];for(var C in this.elements.types){if(this.elements.types[C].checked){E.push(HD.rp.constants._HD_EVENT_TYPES[C.toUpperCase()])}}if(this.listManager&&this.isOn&&E.length>0){var B={startDate:HD.util.Date.parseDate(this.dateRange.start.handles.entry.value),endDate:HD.util.Date.parseDate(this.dateRange.end.handles.entry.value),type:E.join(","),grouping:this.elements.grouping.value,corridorWidth:HD.rp.constants._CORRIDOR_WIDTH[HD.rp.constants._POI_TYPES.EVENT],stops:HD.road.DWR.routeToWKTString(HD.rp.MyRide.route,1)};HD.rp.dwrMonitor.kill({EventsService:["getEventLocationsInBox","getEventsInBox"]});var D=this.listManager.getDataInBox(A||HD.rp.constants._FIRST_PAGE_INDEX,B,F);if(D){this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults;if(this.loadingIndicator){this.loadingIndicator.remove()}this.elements.content.innerHTML="";this.loadingIndicator=new HD.ui.LoadingIndicator(this.elements.content," ","loadingIndicatorPanelGray",{noPosition:true});this.updateState(true);this.action("find",{pageIndex:A})}}else{if(E.length==0){this.clear();if(this.loadingIndicator){this.loadingIndicator.remove()}this.loadingIndicator=null;this.elements.paging.innerHTML=HD.rp.HTML.noPagingResults;this.updateState()}}},queueSearch:function(A){if(!!this.searchQueue){clearTimeout(this.searchQueue)}var B=this;this.searchQueue=setTimeout(function(){B.find(null,true)},!!A?0:HD.rp.constants._EVENT_SEARCH_DELAY)},launchEvent:function(D,B){var A=HD.rp.Panel.getDataModel(D,null,"event",true);if(!!A){HD.rp.util.Hitbox.track("Application/Events/More+Info/EventID+Name",{EventID:HD.util.rtrim(A.data.detailKey),Name:HD.util.rtrim(A.data.name)})}var C=HD.util.rtrim(B)==HD.rp.constants._HD_EVENT_TYPES.DEALER?HD.rp.URL.eventDetailsDealer:HD.rp.URL.eventDetailsHD;C=HD.util.template(C,{_EVENT_TYPE:HD.util.rtrim(B),_EVENT_ID:D||""});window.open(C,"","width=491,height=500,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,menubar=no,status=no")},getEventById:function(C,B){var A=B;EventsService.getEventById(C,function(D){var E=HD.road.DWR.javaEntityToStop(D);A(E)})},getEventsByObjectIds:function(B,C){var A=C;EventsService.getEventsByObjectIds(B,function(D){var E=HD.road.DWR.javaEntitiesToStops(D);A(E)})}});HD.rp.Panel.implement(HD.rp.EventPanel,{actions:{hide:function(){HD.rp.util.Hitbox.track("Application/Map/Hide/Events")},init:function(B){B.listManager.services.getDataInBox=function(F){var E=F.grouping;delete F.grouping;EventsService[E=="location"?"getEventLocationsInBox":"getEventsInBox"](F,function(G){B.listManager.handleGetData.call(B.listManager,G,false)})};B.listManager.services.getDataAlongRoute=function(){return };B.listManager.services.getEntityData=function(){return };B.listManager.callbacks.handleGetDataAlongRoute=function(){return };var A=new Date();B.dateRange=new HD.ui.DateRangeSelector({selected_start:HD.util.Date.formatDate(new Date(A.getFullYear(),A.getMonth(),A.getDate())),selected_end:HD.util.Date.formatDate(new Date(A.getFullYear(),A.getMonth()+1,A.getDate()))});B.elements.startEntry=$("events-startDate");B.elements.startToggle=$("events-startToggle");B.elements.endEntry=$("events-endDate");B.elements.endToggle=$("events-endToggle");B.dateRange.start.handles.entry.id=B.elements.startEntry.id;B.dateRange.start.handles.toggle.id=B.elements.startToggle.id;B.elements.startEntry.parentNode.replaceChild(B.dateRange.start.handles.entry,B.elements.startEntry);B.elements.startToggle.parentNode.replaceChild(B.dateRange.start.handles.toggle,B.elements.startToggle);B.dateRange.end.handles.entry.id=B.elements.endEntry.id;B.dateRange.end.handles.toggle.id=B.elements.endToggle.id;B.elements.endEntry.parentNode.replaceChild(B.dateRange.end.handles.entry,B.elements.endEntry);B.elements.endToggle.parentNode.replaceChild(B.dateRange.end.handles.toggle,B.elements.endToggle);B.elements.types={dealer:$("eventsTypesDealer"),h_d:$("eventsTypesH-D"),hog:$("eventsTypesHOG")};var C=function(){B.queueSearch()};B.dateRange.events.change.subscribe(C);B.elements.grouping=$("events-grouping");YAHOO.util.Event.addListener(B.elements.grouping,"change",C);YAHOO.util.Event.addListener(B.dateRange.start.handles.entry,"change",C);YAHOO.util.Event.addListener(B.dateRange.end.handles.entry,"change",C);for(var D in B.elements.types){YAHOO.util.Event.addListener(B.elements.types[D],"change",C);YAHOO.util.Event.addListener(B.elements.types[D],"click",C)}YAHOO.util.Event.addListener($("eventFiltersForm"),"submit",function(){C(true);return false})},show:function(){HD.rp.util.Hitbox.track("Application/Map/Show/Events")}}});HD.rp.FuelPanel=HD.util.Class.inherit(HD.rp.PoiPanel,{name:"fuel",reference:"HD.rp.FuelPanel",initialize:function(A){HD.util.Class.extend(this,[{listManager:new HD.rp.service.PointsList(HD.rp.constants._POI_TYPES.FUEL),request:{params:[HD.rp.constants._REQUEST_PARAMS.SHOW_FUEL],handler:function(B){if(!!B[HD.rp.constants._REQUEST_PARAMS.SHOW_FUEL]){this.show()}},serialize:function(){var B="";if(this.isOn){B+="&"+HD.rp.constants._REQUEST_PARAMS.SHOW_FUEL+"=1"}return B}},text:{beyondZoom:HD.rp.text.panelMessages.fuelStates.beyondZoom,filters:"",noneInView:HD.rp.text.panelMessages.fuelStates.noneInView,tab:HD.rp.text.fuelTab,toggle:HD.rp.text.fuelToggle}},A],true)}});HD.rp.Panel.implement(HD.rp.FuelPanel,{actions:{hide:function(){HD.rp.util.Hitbox.track("Application/Map/Hide/Fuel")},show:function(){HD.rp.util.Hitbox.track("Application/Map/Show/Fuel")}}});HD.rp.FacilitiesPanel=HD.util.Class.inherit(HD.rp.PoiPanel,{name:"facilities",reference:"HD.rp.FacilitiesPanel",initialize:function(A){HD.util.Class.extend(this,[{listManager:new HD.rp.service.PointsList(HD.rp.constants._POI_TYPES.FACILITIES),request:{params:[HD.rp.constants._REQUEST_PARAMS.SHOW_FACILITIES],handler:function(B){this.show()},serialize:function(){var B="";if(this.isOn){B+="&"+HD.rp.constants._REQUEST_PARAMS.SHOW_FACILITIES+"=1"}return B}},text:{beyondZoom:"",filters:"",noneInView:"",tab:null,toggle:null}},A],true)},find:function(A,B){return },handleResponse:function(Q){var F=Q.getElementsByTagName("item");var P=HD.util;this.data=[];var B=F.length;for(var M=0;M<B;M++){var L=F[M];var K=P.getXMLNodeValue(L.getElementsByTagName("title")[0]);var J=P.getXMLNodeValue(L.getElementsByTagName("link")[0]);var O=P.getXMLNodeValue(L.getElementsByTagName("description")[0]);var H=P.getXMLNodeValue(L.getElementsByTagName("type")[0]);var E=P.getXMLNodeValue(L.getElementsByTagName("phone")[0]);var C=null;if(H==HD.rp.constants._FACILITY_TYPES.MUSEUM){C=P.getXMLNodeValue(L.getElementsByTagName("ticketsLink")[0])}var G;var A;try{G=P.getXMLNodeValue(L.getElementsByTagName("lat")[0]);A=P.getXMLNodeValue(L.getElementsByTagName("long")[0])}catch(D){G=P.getXMLNodeValue(L.getElementsByTagName("geo:lat")[0]);A=P.getXMLNodeValue(L.getElementsByTagName("geo:long")[0])}var N=new HD.road.Address({lineOne:P.getXMLNodeValue(L.getElementsByTagName("street")[0]),city:P.getXMLNodeValue(L.getElementsByTagName("city")[0]),stateCode:P.getXMLNodeValue(L.getElementsByTagName("state")[0])});var I=new HD.road.Stop(HD.road.constants._STOP_TYPES.FACILITY);I.setLocation(G,A,N);I.data.name=K;I.data.url=J;I.data.ticketsUrl=C;I.data.entityType=HD.rp.constants._POI_TYPES.FACILITY;I.data.phone=E;I.data.facilityType=H;this.data[M]=I}this.render(this.data,1,1,0,B,B)},showFacility:function(B,A){window.open(B,"","width=620,height=540,scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no,directories=no,status=no");if(A!="Harley-Davidson Museum Tickets"){HD.rp.util.Hitbox.track("Application/Facilities/More+Info/FacilityID+Name",{FacilityID:"",Name:A})}else{HD.rp.util.Hitbox.track("Application/Facilities/Purchase+Tickets/FacilityID+Name",{FacilityID:"",Name:A})}}});HD.rp.Panel.implement(HD.rp.FacilitiesPanel,{actions:{init:function(B){var A=B;YAHOO.util.Connect.asyncRequest("GET",HD.rp.URL.facilities,{success:function(C){A.handleResponse.call(A,C.responseXML)}})},show:function(){HD.rp.accordian.selectTab(HD.rp.constants._ACCORDIAN.TABS.MY_RIDE)}}});HD.rp.dialog={};HD.rp.dialog.Text={access:"This road is ",all:"all",archivedFromOld:"Archived From Old Ride Planner",archivedPlansHelpText:'To change or modify your old ride plan, you will have to move it to the new Ride Planner. To do so, click the &quot;Move to New Ride Planner&quot; link next to the ride plan name . Once you\'ve moved a ride plan, it will not be accessible from the old Ride Planner.  <a href="javascript:void(0)" onclick="HD.rp.launchHelp(\'oldrp\');">Learn more.</a>',automaticMode:"Automatic Mode",back:"Back",bestSeasons:"Best Seasons to Ride",cancel:"Cancel",clickHere:"Click here",close:"Close",comments:"Comments",copyInstructions:"Press Ctrl-C or Cmd-C to copy to the clipboard:",dealerInformation:"Dealer Information",deleteRide:"Delete ride plan",defaultSignature:"A Harley-Davidson Rider",defaultRideName:"Ride Planner Route",details:"View/Modify details",detectAnother:"Detect Devices",detectMyDevice:"Detect My Device...",displayPrivateRoads:"display private roads",displayPublicRoads:"display public roads",email:"Send in e-mail",enterBasicInfo:"Enter some basic info about your trip.",exportRidePlan:"EXPORT STOPS AND WAYPOINTS",fax:"Fax",gpsExport:"export",gps:{autoCopy:'Automatically synchronize your H-D supported GPS devices; including Road Tech&trade;, Quest&trade;, and Conquest&trade;. We also have limited support of other Garmin&trade; devices. Click the "Detect My Device" button to continue. The _PLUGIN is required for device detection.',autoExport:"Export stops and waypoints to GPS Device",autoExportError:{title:"Unable To Export Ride Plan",message:'Your GPS device is unable to communicate with the Ride Planner. Please make sure that the ride plan has a name and at least one location. If the problem occurs again, please use the "Manual" option to export your ride plan.'},autoImport:"Import stops and waypoints from GPS Device",autoImportError:{title:"Unable To Import Ride Plan",message:'The Ride Planner is unable to communicate with your GPS device. Please try again. If the problem occurs again, please use the "Manual" option to import your ride plan.'},autoNameRoute:{title:"Name your route",message:"If your device contains a route with the same name, it will be overwritten. You can _READDEVICEDATA and select a route to overwrite."},autoTip:'If your device has successfully been detected, you may choose to export your stops and waypoints from the Ride Planner to your GPS device, or import from your GPS device into the Ride Planner. You may detect another device using the "Detect Devices" button above.',autoTipError:{title:'Unable to find your "My Ride."',message:'In order to export stops and waypoints from the Ride Planner, you must indicate which ride you want to export by opening the ride from your "My Rides" listing or click "show road" on any road, then "Add road to My Ride." '},copy:"&copy; 2007 H-D, All rights reserved. Garmin&trade; is a trademark of Garmin Ltd.",device:"device",exportComplete:{title:"Export Complete!",message:'Stops and waypoints for "_NAME" were successfully exported! Check your GPS device to see that it has been properly uploaded.  The route on your device may differ from your Ride Planner route.  See <a href="javascript:void(0)" onclick="HD.rp.launchHelp(\'gps\');">help</a> for more information.'},exporting:"Exporting _NAME...",file:"file",formatName:"GPX file format",gpxInfo:"GPX (the GPS Exchange Format) is a XML data format for the interchange of GPS data between applications and Web services on the Internet. Refer to your GPS device manual to ensure your device supports the GPX file format.",importComplete:{title:"Import Complete!",message:"_NAME was successfully imported! Close this panel to view and edit your route on the Ride Planner map."},importing:"Importing _NAME...",importSelect:"Please select the ride plan that you would like to import",manualCopy:"If you have another device or the auto-synchronization does not work for you, use the Manual Mode. You may import and export your stops and waypoints as a GPX file, so be certain that your device supports the _FORMAT.",manualExport:{title:"Export stops and waypoints as a GPX file",message:"Click to download your stops and waypoints as a GPX file, so that it may be uploaded to your GPS device."},manualExportError:{title:"Unable To Export File",message:"Please make sure that the ride plan has a name and at least one location. Please try again."},manualImport:{title:"Import from GPX file",message:"Please locate your file and click the button below to import the file."},manualImportError:{title:"Unable To Import File",message:'Check to be sure that you have converted the file to the GPX file format. The data in your file must be compliant to GPX standards and the file name should end with a ".gpx" designation.'},manualNameRoute:{title:"Name your route",message:"If your device contains a ride plan with the same name, it will be overwritten."},noDevices:{title:"Unable To Detect GPS Device",message:'Your GPS device was not detected. Please try again. If you receive this message again, please use the "Manual" option to import and export your ride plans.'},noPlugin:{title:"Plugin Not Detected",message:"Your GPS device was not detected. Please make sure all connections are secure, and that you have installed the _PLUGIN for your GPS device. _CLICKHERE to install the plugin, then restart your browser and try again."},noRoutes:{title:"No Ride Plans Found",message:"Your _SOURCE does not contain any ride plan data. A ride plan must contain at least one location to be considered a valid ride plan. Please choose another _SOURCE or try again."},overwriteSelect:"Select the route to overwrite",pluginName:"Garmin Communicator Plugin",readDevice:"Reading device data...",readDeviceData:"read device data",readGPX:"Reading GPX file...",reset:"Return to GPS Synchronization",searchDevices:"Searching for attached devices...",selectedDevice:"Selected device",title:"GPS Synchronization",wait:"Please wait &ndash; the data transfer may take several minutes. Please do not disconnect your device until this process is complete.",waitManual:"Please wait &ndash; the data transfer may take several minutes."},gpsImport:"import",hogChapter:"H.O.G.&reg; Chapter",hours:"Hours",importGPX:"Import GPX File",lastSaved:"Last Saved",lastUpdated:"Last Updated: ",loading:"Loading",loadingRide:"Loading Ride",manualMode:"Manual Mode",message:"Message",move:"Move",moveRidePlans:'Please select the saved ride plans you want to move to the new Ride Planner 2.0.  Once you\'ve moved a ride plan, it will not be accessible from the old Ride Planner. <a href="javascript:void(0)" onclick="HD.rp.launchHelp(\'oldrp\');">Learn more.</a>',moveRoadToNewRP:"Move to New Ride Planner",moveSelected:"MOVE SELECTED",mySavedRidePlans:"My Saved Ride Plans",newRidePlanner:"New Ride Planner",next:"Next",noDatesPlanned:"No dates were planned.",noRoadsMsg:'You do not have any saved ride plans yet. You can create a ride plan by providing two or more locations, then click the "Save" button at the bottom of the My Ride panel and provide some details about your newly-created plan. Once you create and save your new ride plan, it will appear on this screen.',or:"or",print:"Print",privacyWarning:"Be careful about revealing your personal address in a public ride plan.  Adjust your ride plan addresses to protect your privacy.",privateLabel:"Private",provideAdditional:"Provide additional details about this ride",provideTheFollowing:"Please provide the following information.",publicLabel:"Public",publicSignature:"Public Signature",quickTip:"Quick Tip",rateAndReview:"Rate and review",recipientEmailAddresses:"Recipient Email Addresses",recommended:"recommended",retry:"Retry",rideNameExamples:"Examples: Long coastal byway, Morning run.",rideNameRequired:"Ride name required.",ridePlan:"Ride Plan",ridePlanName:"Ride plan name:",ridePlanPreview:"Ride Plan Preview",save:"Save",saved:"Saved: ",savedSuccessfully:"ride plan was saved successfully.<br />You can retrieve it anytime by clicking the <strong>Saved Rides</strong> link at the top right of the page.<br/><br/>Popular options:<br/>",saveGPX:"Save as GPX File",saveYourRide:"Save Your Ride",savingRide:"Saving Ride",scenery:"Scenery",seeTheDifference:"see the difference",select:"Select",send:"Send",sendARide:"Send a Ride",sending:"Sending",sendToFriend:"Send ride plan to a friend",seperatedByComma:"Seperated by commas",services:"Services",showDatePicker:"Show date picker",sortAccess:"access",sortAsc:"asc",sortByAccess:"Access",sortByLastUpdated:"Last Updated",sortByName:"Name",sortName:"name",sortDateChanged:"dateChanged",sortDesc:"desc",submittingAReview:"Submitting a review will help your fellow riders experience, choose, and create new roads of their own.",thankYouCaps:"THANK YOU",theRideIs:"The ride is:",viewPrintable:"View printable version of the ride plan",visitOurHogChapter:"Visit Our H.O.G.&reg; Chapter",welcomeMessage:{title:"Welcome to Ride Planner"},whenAreYouGoing:"When are you going:",yourEmail:"Your Email",yourName:"Your Name",yourRidePlanWasSaved:"Your ride plan was saved!",dealerServices:{header:"Dealer Services",motorcycles:{header:"H-D&reg; Motorcycles",desc:"The legend rolls on, thundering toward a distant horizon."},service:{header:"Service",desc:"Professional technicians with Ph-Ds in Harley healthcare."},motorclothes:{header:"MotorClothes&reg; Merchandise",desc:"Made to look great, ride comfortably and wear for thousands of miles."},accessories:{header:"Genuine Motor Accessories",desc:"From mild to wild, you can customize your Harley."},ecommerce:{header:"Shop Online",desc:"Check out the latest H-D gear for you and your bike."},rentals:{header:"H-D&reg; Authorized Rentals",desc:"Rent the ride, own the road and live your dream."},ridersEdge:{header:"Rider&acute;s Edge&reg;",desc:"Learn to ride safe and smart in a classroom-on-wheels."},hogChapter:{header:"H.O.G.&reg; Chapter",desc:"Share your passion with Harley Owners Group&reg; members."},hogfly:{header:"H.O.G.&reg; Fly & Ride",desc:"Going somewhere? Bring your helmet."},buell:{header:"Buell&reg; Motorcycles",desc:"Streetfighter motorcycles designed for the adventure of riding."},brag:{header:"BRAG",desc:" Buell Riders Adventure Group"}},roadTabs:{overview:"Overview",reviews:"Reviews",photos:"Photos",placesToVisit:"Places to visit",sampleItinerary:"Sample itinerary",localLinks:"Local links",reportAbuse:"Report abuse",writeAReview:"Write a review"},roadScenery:{desert:"Desert",farmland:"Farmland",forest:"Forest",lakes:"Lakes",mountains:"Mountains",ocean:"Ocean",plains:"Plains",river:"River",rural:"Rural",urbanResidential:"Urban/Residential",fallColors:"Fall Colors",historicalSites:"Historic Sites",beaches:"Beaches",parks:"Parks"},roadLinks:{adventure:"Adventure",areaInformation:"Area Information",associations:"Associations",bikersHikersPedestrians:"Bikers, Hikers, & Pedestrians",businesses:"Businesses",bywaysAndBackways:"Byways & Backways",communityAndRegionInfo:"Community & Region Info",cultureAndTheArts:"Culture & the Arts",events:"Events",federalLands:"Federal Lands",governmentInfo:"Government Info",government:"Government",historyAndHeritage:"History & Heritage",localInfo:"Local Info",maps:"Maps",miscellaneous:"Miscellaneous",motorcyclists:"Motorcyclists",outdoors:"Outdoors",preservationAndProtection:"Preservation and Protection",recreation:"Recreation",research:"Research",travelAndTourism:"Travel & Tourism",travelGuide:"Travel Guide"}};HD.rp.dialog.URL={gpsPlugin:"http://www.garmin.com/products/communicator/"};HD.rp.dialog.HTML={savedRoadsDialog:{loading:'<div class="savedRoadsLoading"><div>'+HD.rp.dialog.Text.loading+"</div></div>",noRoads:HD.rp.dialog.Text.noRoadsMsg,wrapper:'<div class="savedRoadsTabPanel"><div class="savedRoadsHeader"><input type="checkbox" id="displayPublic" checked onclick="HD.rp.dialog.UserRoadList.togglePublic(this);" /><label for="displayPublic" id="displayPublicLabel">'+HD.rp.dialog.Text.displayPublicRoads+'</label><input type="checkbox" id="displayPrivate" checked onclick="HD.rp.dialog.UserRoadList.togglePrivate(this);" /><label for="displayPrivate" id="displayPrivateLabel">'+HD.rp.dialog.Text.displayPrivateRoads+'</label></div><div class = "savedRoadsItem _ACCESS"><div class="left">&nbsp;<a href="javascript:void(0)" onclick="HD.rp.dialog.UserRoadList.sortRoads(HD.rp.dialog.Text.sortAccess);">'+HD.rp.dialog.Text.sortByAccess+'</a></div><div class="middle"><a href="javascript:void(0)" onclick="HD.rp.dialog.UserRoadList.sortRoads(HD.rp.dialog.Text.sortName);">'+HD.rp.dialog.Text.sortByName+'</a></div><div class="right"><a href="javascript:void(0)" onclick="HD.rp.dialog.UserRoadList.sortRoads(HD.rp.dialog.Text.sortDateChanged);">'+HD.rp.dialog.Text.sortByLastUpdated+'</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></div><div class="savedRoadsList" id="savedRoadsList">_CONTENT</div></div>',item:'<div class="savedRoadsItem _ACCESS"><div class="left"><div class="_ACCESS_ICON">_ROAD_ORDINAL</div></div><div class="middle"><div class="rdtitle" onclick="HD.rp.User.getUserRoad(_ROAD_ID);">_USER_ROAD_NAME</div><div class="ride">_START_DATE _END_DATE</div><div class="ride"><a href="javascript:void(0)" onclick="HD.rp.User.getUserRoad(_ROAD_ID,null,true);">'+HD.rp.dialog.Text.details+'</a>&nbsp;|&nbsp; <a href="javascript:void(0)" onclick="HD.rp.dialog.SendDialog.show(_ROAD_ID)">'+HD.rp.dialog.Text.email+'</a></div></div><div class="right"><div class="ride">_CC_DATE</div><div class="ride">'+HD.rp.dialog.Text.access+'_ACCESS</div><a href="javascript:void(0)" onclick="HD.rp.dialog.UserRoadList.deleteUserRoad(_ROAD_ID);" class="d">'+HD.rp.dialog.Text.deleteRide+'</a></div><div class="clear"></div></div>'},legacyRoadsDialog:{loading:'<div class="savedRoadsLoading"><div>'+HD.rp.dialog.Text.loading+"</div></div>",wrapper:'<div class="legacyTabPanel"><div class="header">'+HD.rp.dialog.Text.archivedPlansHelpText+'</div><div class="list"><table id="legacyListTable"><tr><td></td><td class="h">'+HD.rp.dialog.Text.ridePlan+'</td><td class="h">'+HD.rp.dialog.Text.lastSaved+'</td><td class="h">'+HD.rp.dialog.Text.move+"</td></tr>_ROWS</table></div></div>",item:'<tr><td></td><td class="nm">_ROAD_NAME</td><td>_ROAD_SAVED_DATE</td><td class="c"><a href="javascript:void(0);" onclick="HD.rp.dialog.UserRoadList.moveRoads(\'_ROAD_ID\');">'+HD.rp.dialog.Text.moveRoadToNewRP+"</a></td></tr>",inactiveItem:'<tr class="convertedRoad"><td></td><td class="nm">_ROAD_NAME</td><td>_ROAD_SAVED_DATE</td><td class="c"></td></tr>'},saveRoadDialog:{checkListItem:'<div class="checkListItem"><input type="checkbox" name="_TYPE" id="_TYPE_NAME" value="_ID" class="check" /><label for="_TYPE_NAME">_NAME</label></div>',form:"<h1>"+HD.rp.dialog.Text.enterBasicInfo+'</h1><div id="dlgSaveMessage"></div><form name="saveRoadForm" id="saveRoadForm" method="post" onsubmit="HD.rp.dialog.SaveDialog.saveRoad()" class=""><table><tr><td class="l"><label for="rideName" id="rideNameLabel">'+HD.rp.dialog.Text.ridePlanName+'</label></td><td><input class="enabled" type="text" name="rideName" id="rideName" value="" /></td></tr><tr class="sub"><td></td><td><em>'+HD.rp.dialog.Text.rideNameRequired+"</em> "+HD.rp.dialog.Text.rideNameExamples+"</td></tr><tr><td nowrap>"+HD.rp.dialog.Text.whenAreYouGoing+'</td><td id="saveRoadDateRange"><input id="dateFrom" name="dateFrom" value="mm/dd/yyyy" /><a class="date-selector-toggle" href="javascript:void(0);" onclick="HD.rp.dialog.SaveDialog.showCalendar(\'cal1\',$(\'dateFrom\'));"></a><span>&nbsp;-&nbsp;</span><input id="dateTo" name="dateTo" value="mm/dd/yyyy" /><a class="date-selector-toggle" href="javascript:void(0);" onclick="HD.rp.dialog.SaveDialog.showCalendar(\'cal2\',$(\'dateTo\'));"></a></td></tr><tr><td>'+HD.rp.dialog.Text.theRideIs+'</td><td class="in"><input id="savePrivateRadio" type="radio" name="access" value="PRIVATE" checked onclick="HD.rp.dialog.SaveDialog.setPrivate();" /><label for="savePrivateRadio">'+HD.rp.dialog.Text.privateLabel+'</label><input id="savePublicRadio" type="radio" name="access" value="PUBLIC" onclick="HD.rp.dialog.SaveDialog.setPublic();" /><label for="savePublicRadio">'+HD.rp.dialog.Text.publicLabel+'</label> <span class="sub"><em>('+HD.rp.dialog.Text.recommended+')</em> <a href="javascript:void(0)" onclick="HD.rp.launchHelp(\'public\');">'+HD.rp.dialog.Text.seeTheDifference+'</a></span></td></tr><tr><td colspan="2" class="additionalInfo"><span onclick="HD.rp.dialog.SaveDialog.toggleAdditional();">'+HD.rp.dialog.Text.provideAdditional+'</span><div id="additionalInfo"><table><tr><td class="l">'+HD.rp.dialog.Text.scenery+":</td><td>_SCENERY_CHECKLIST</td></tr><tr><td>"+HD.rp.dialog.Text.bestSeasons+':</td><td>_SEASONS_CHECKLIST</td></tr></table></div></td></tr><tr><td style="vertical-align:top;">'+HD.rp.dialog.Text.comments+':</td><td><textarea name="comments" id="comments" style="width:330px;" rows="3"></textarea></td></tr><tr><td colspan="2" class="inl"><div id="savePublicSignature"><table><tr><td class="l">'+HD.rp.dialog.Text.publicSignature+':</td><td><select name="submissionSignAs" id="submissionSignAs"><option value="_DEFAULT_NAME">_DEFAULT_NAME</option><option value="_FULL_NAME">_FULL_NAME</option><option value="_USERNAME">_USERNAME</option></select><select name="submittedByState" id="submittedByState">'+HD.rp.HTML.usStatesDropDownOptions+'</select></td></tr></table></div></td></tr><tr><td colspan="2"><div class="lineDashed"><div></td></tr><tr><td></td><td id="saveDisclaimer" class="hide"><input type="checkbox" name="userUnderstandAgreement" id="userUnderstandAgreement" value="true" /> <label for="userUnderstandAgreement">'+HD.rp.text.agreeToTerms1+' </label><a href="javascript:void(0)" onclick="HD.rp.dialog.SaveDialog.toggleAgreement(this.parentNode.className.match(/hide/), this)">'+HD.rp.text.agreeToTerms2+"</a><div>"+HD.rp.text.saveDisclaimer+"</div></td></tr><tr><td></td><td>"+HD.rp.dialog.Text.privacyWarning+'</td></tr><tr><td colspan="2"><div class="lineDashed"><div></td></tr></table><div style="text-align:center;"><a id="saveRoadButton" class="btn" href="javascript:void(0)" onclick="HD.rp.User.loginPendingFor = HD.rp.User._LOGIN_PENDING_FOR.SAVE;HD.rp.dialog.SaveDialog.saveRoad()">'+HD.rp.dialog.Text.save+'</a><a class="btn" href="javascript:void(0)" onclick="HD.ui.Dialog.hide()">'+HD.rp.dialog.Text.cancel+'</a></div><input type="hidden" name="submittedBy" value="_USER_ID" /></form>',noticeSaveDialog:"<strong>&quot;_RIDE_PLAN_NAME&quot;</strong> "+HD.rp.dialog.Text.savedSuccessfully+'<a href="javascript:void(0)" onclick="HD.rp.dialog.SendDialog.show(_RIDE_ID);">'+HD.rp.dialog.Text.sendToFriend+'</a><br/><a href="javascript:void(0)" onclick="HD.rp.MapController.printRoad(HD.rp.dialog.SaveDialog.ride);HD.ui.Dialog.hide();">'+HD.rp.dialog.Text.viewPrintable+" </a>",roadLimitWarning:'<div class="formError" id="dlgSaveLimit">'+HD.rp.text.maxRoutesExceededWarn+"</div>"},linkDialog:{className:"linkDialogWrapper",code:HD.rp.dialog.Text.copyInstructions+'<br/><input type="text" value="_CONTENT"/>'},sendDialog:{code:'<div id="sendDialogWrapper"><h1>'+HD.rp.dialog.Text.provideTheFollowing+'</h1><div id="dlgSendMessage"></div><form name="sendRoadForm" id="sendRoadForm" method="post"><table><tr><td class="l"><label for="senderName" id="senderNameLabel">'+HD.rp.dialog.Text.yourName+':</label></td><td><input type="text" name="senderName" id="senderName" value="_SENDER_NAME" /></td></tr><tr><td class="l"><label for="senderEmail" id="senderEmailLabel">'+HD.rp.dialog.Text.yourEmail+':</label></td><td><input type="text" name="senderEmail" id="senderEmail" value="_SENDER_EMAIL" /></td></tr><tr><td class="l"><label for="recipientEmails" id="recipientEmailAddressesLabel">'+HD.rp.dialog.Text.recipientEmailAddresses+":</label><br /><span>("+HD.rp.dialog.Text.seperatedByComma+')</span></td><td><textarea name="recipientEmails" id="recipientEmails" rows="2">_RECIPIENT_EMAIL</textarea></td></tr><tr><td class="l"><label for="message" id="messageLabel">'+HD.rp.dialog.Text.message+':</label></td><td><textarea name="message" id="message" rows="4">_RECIPIENT_MESSAGE</textarea></td></tr><tr><td></td><td><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.SendDialog.sendRoad(_ROAD_ID)">'+HD.rp.dialog.Text.send+'</a><a class="btn" href="javascript:void(0)" onclick="HD.ui.Dialog.hide()">'+HD.rp.dialog.Text.cancel+"</a></td></tr></table></form></div>"},gpsDialog:{code:'<div id="gpsDialog" class="init"><div id="gpsTabs"><a id="gpsAutoTab" class="gpsTab" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.switchTab(\'auto\',this);">'+HD.rp.dialog.Text.automaticMode+'</a><a id="gpsManualTab" class="gpsTab" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.switchTab(\'manual\',this);">'+HD.rp.dialog.Text.manualMode+'</a></div><div id="gpsContent"><div id="gpsInitContent" class="gpsContent"><div id="gpsInitAuto" class="gpsInitContent"><p>'+HD.util.template(HD.rp.dialog.Text.gps.autoCopy,{_PLUGIN:'<a href="'+HD.rp.dialog.URL.gpsPlugin+'" target="_blank">'+HD.rp.dialog.Text.gps.pluginName+"</a>"})+'</p><div><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.detectDevices();">'+HD.rp.dialog.Text.detectMyDevice.toUpperCase()+'</a></div></div><div id="gpsInitManual" class="gpsInitContent"><p>'+HD.util.template(HD.rp.dialog.Text.gps.manualCopy,{_FORMAT:HD.rp.dialog.Text.gps.formatName})+'</p><div><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.manualMode();">'+HD.rp.dialog.Text.manualMode.toUpperCase()+'</a></div></div><div id="gpsInitOr">'+HD.rp.dialog.Text.or.toUpperCase()+'</div></div><div id="gpsAutoContent" class="gpsContent"><div id="gpsDevices"><p>'+HD.rp.dialog.Text.gps.selectedDevice+':</p><select id="gpsDeviceList"></select><a id="gpsDetectAnother" class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.detectDevices();">'+HD.rp.dialog.Text.detectAnother.toUpperCase()+'</a></div><div class="gpsBar"></div><div id="gpsAutoExport" class="gpsPort"><p>'+HD.rp.dialog.Text.gps.autoExport+'</p><div><a id="gpsAutoExportBtn" class="btnDisabled" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.autoExport();">'+HD.rp.dialog.Text.gpsExport.toUpperCase()+'</a></div></div><div id="gpsAutoImport" class="gpsPort"><p>'+HD.rp.dialog.Text.gps.autoImport+'</p><div><a id="gpsAutoImportBtn" class="btnDisabled" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.autoImport();">'+HD.rp.dialog.Text.gpsImport.toUpperCase()+'</a></div></div><div id="gpsAutoTips"><p><span>'+HD.rp.dialog.Text.quickTip+"</span>"+HD.rp.dialog.Text.gps.autoTip+'</p></div></div><div id="gpsManualContent" class="gpsContent"><div id="gpsManualDownload" class="gpsLoad"><p><span>'+HD.rp.dialog.Text.gps.manualExport.title+'</span></p><div class="gpsLoadInfo"><p>'+HD.rp.dialog.Text.gps.manualExport.message+'</p></div><div><a id="gpsManualExportBtn" class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.manualExport();">'+HD.rp.dialog.Text.saveGPX.toUpperCase()+'</a></div></div><div id="gpsManualUpload" class="gpsLoad"><p><span>'+HD.rp.dialog.Text.gps.manualImport.title+'</span></p><div class="gpsLoadInfo"><p>'+HD.rp.dialog.Text.gps.manualImport.message+'</p></div><div id="gpsManualUploadForm"></div><div><a id="gpsManualImportBtn" class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.manualImport();">'+HD.rp.dialog.Text.importGPX.toUpperCase()+'</a></div></div><div id="gpsDisclaimer">'+HD.rp.dialog.Text.gps.gpxInfo+'</div></div><div id="gpsBusyContent" class="gpsContent"></div></div><div id="gpsCopy">'+HD.rp.dialog.Text.gps.copy+"</div></div>",actions:{detectDevices:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.searchDevices+'</p><div id="gpsLoading"></div><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.wait+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">'+HD.rp.dialog.Text.cancel.toUpperCase()+"</a></div></div>",noDevices:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.noDevices.title+'</p><p id="gpsActionInfo">'+HD.util.template(HD.rp.dialog.Text.gps.noDevices.message,{_PLUGIN:HD.rp.dialog.Text.gps.pluginName,_CLICKHERE:'<a href="'+HD.rp.dialog.URL.gpsPlugin+'" target="_blank">'+HD.rp.dialog.Text.clickHere+"</a>"})+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.detectDevices();">'+HD.rp.dialog.Text.retry.toUpperCase()+"</a></div></div>",noPlugin:'<div class="gpsBar"></div><p id="gpsAction">'+HD.util.template(HD.rp.dialog.Text.gps.noPlugin.title,{_PLUGIN:HD.rp.dialog.Text.gps.pluginName})+'</p><p id="gpsActionInfo">'+HD.util.template(HD.rp.dialog.Text.gps.noPlugin.message,{_PLUGIN:HD.rp.dialog.Text.gps.pluginName,_CLICKHERE:'<a href="'+HD.rp.dialog.URL.gpsPlugin+'" target="_blank">'+HD.rp.dialog.Text.clickHere+"</a>"})+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.show(true);">'+HD.rp.dialog.Text.retry.toUpperCase()+"</a></div></div>",readDevice:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.readDevice+'</p><div id="gpsLoading"></div><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.wait+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">'+HD.rp.dialog.Text.cancel.toUpperCase()+"</a></div></div>",autoImportRoute:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.importSelect+':</p><select id="gpsRouteList" size="8"></select><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.autoImportRoute();">'+HD.rp.dialog.Text.next.toUpperCase()+" &gt;</a></div></div>",autoImportNoRoutes:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.noRoutes.title+'</p><p id="gpsActionInfo">'+HD.util.template(HD.rp.dialog.Text.gps.noRoutes.message,{_SOURCE:HD.rp.dialog.Text.gps.device})+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.autoImport();">'+HD.rp.dialog.Text.retry.toUpperCase()+" &gt;</a></div></div>",autoImportRouteLoad:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.importing+'</p><div id="gpsLoading"></div><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.wait+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">'+HD.rp.dialog.Text.cancel.toUpperCase()+"</a></div></div>",autoImportError:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.autoImportError.title+'</p><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.autoImportError.message+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.autoImport();">'+HD.rp.dialog.Text.retry.toUpperCase()+"</a></div></div>",autoImportComplete:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.importComplete.title+'</p><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.importComplete.message+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.close();">'+HD.rp.dialog.Text.close.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">'+HD.rp.dialog.Text.gps.reset.toUpperCase()+"</a></div></div>",autoExport:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.autoNameRoute.title+':</p><input id="gpsRouteName" type="text" value="_NAME" /><p id="gpsActionInfo">'+HD.util.template(HD.rp.dialog.Text.gps.autoNameRoute.message,{_READDEVICEDATA:'<a href="javascript:void(0)" onclick="HD.rp.dialog.GPS.autoExportRead();">'+HD.rp.dialog.Text.gps.readDeviceData+"</a>"})+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.autoExportWrite();">'+HD.rp.dialog.Text.exportRidePlan.toUpperCase()+"</a></div></div>",autoExportRoute:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.exporting+'</p><div id="gpsLoading"></div><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.wait+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">'+HD.rp.dialog.Text.cancel.toUpperCase()+"</a></div></div>",autoExportError:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.autoExportError.title+'</p><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.autoExportError.message+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.autoExport();">'+HD.rp.dialog.Text.retry.toUpperCase()+"</a></div></div>",autoExportComplete:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.exportComplete.title+'</p><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.exportComplete.message+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.close();">'+HD.rp.dialog.Text.close.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">'+HD.rp.dialog.Text.gps.reset.toUpperCase()+"</a></div></div>",autoExportReadDevice:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.readDevice+'</p><div id="gpsLoading"></div><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.wait+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">'+HD.rp.dialog.Text.cancel.toUpperCase()+"</a></div></div>",autoExportRouteList:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.overwriteSelect+':</p><select id="gpsRouteList" size="8"></select><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.autoExportRoute();">'+HD.rp.dialog.Text.next.toUpperCase()+" &gt;</a></div></div>",autoExportNoRoutes:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.noRoutes.title+'</p><p id="gpsActionInfo">'+HD.util.template(HD.rp.dialog.Text.gps.noRoutes.message,{_SOURCE:HD.rp.dialog.Text.gps.device})+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.autoExportRead();">'+HD.rp.dialog.Text.retry.toUpperCase()+" &gt;</a></div></div>",manualImportLoad:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.readGPX+'</p><div id="gpsLoading"></div><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.waitManual+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">'+HD.rp.dialog.Text.cancel.toUpperCase()+"</a></div></div>",manualImportRouteLoad:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.importing+'</p><div id="gpsLoading"></div><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.waitManual+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">'+HD.rp.dialog.Text.cancel.toUpperCase()+"</a></div></div>",manualImportRouteList:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.importSelect+':</p><select id="gpsRouteList" size="8"></select><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.manualImportRoute();">'+HD.rp.dialog.Text.next.toUpperCase()+" &gt;</a></div></div>",manualImportError:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.manualImportError.title+'</p><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.manualImportError.message+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.manualImport();">'+HD.rp.dialog.Text.retry.toUpperCase()+"</a></div></div>",manualImportComplete:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.importComplete.title+'</p><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.importComplete.message+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.close();">'+HD.rp.dialog.Text.close.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">'+HD.rp.dialog.Text.gps.reset.toUpperCase()+"</a></div></div>",manualExport:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.manualNameRoute.title+':</p><input id="gpsRouteName" type="text" value="_NAME" /><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.manualNameRoute.message+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.manualExportWrite();">'+HD.rp.dialog.Text.exportRidePlan.toUpperCase()+"</a></div></div>",manualExportError:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.manualExportError.title+'</p><p id="gpsActionInfo">'+HD.rp.dialog.Text.gps.manualExportError.message+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.manualExport();">'+HD.rp.dialog.Text.retry.toUpperCase()+"</a></div></div>",manualImportNoRoutes:'<div class="gpsBar"></div><p id="gpsAction">'+HD.rp.dialog.Text.gps.noRoutes.title+'</p><p id="gpsActionInfo">'+HD.util.template(HD.rp.dialog.Text.gps.noRoutes.message,{_SOURCE:HD.rp.dialog.Text.gps.file})+'</p><div class="gpsActionsPanel"><div class="gpsBar"></div><div class="gpsActionsLeft"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.cancel();">&lt; '+HD.rp.dialog.Text.back.toUpperCase()+'</a></div><div class="gpsActionsRight"><a class="btn" href="javascript:void(0)" onclick="HD.rp.dialog.GPS.manualImport(true);">'+HD.rp.dialog.Text.retry.toUpperCase()+" &gt;</a></div></div>"}},welcomeDialog:{code:'<div id="welcomeMessage"><div class="left"></div><div class="right"><p><strong>REPLACE THIS WITH TEXT FROM DOCUMENTUM</strong></p></div></div>'},roadDetailsDialog:{overviewTab:'<div id="roadDetailsOverviewTab" class="roadDetailsContent"><table class=\'roadDetailsTab\'><tr><td class=\'data\'><div><table class="_HAS_RATING"><tr><td>'+HD.rp.text.roadRating+': </td><td class="ratings"><div class="ratingsWrapper"><div class="ratings_ROAD_RATING"></div></div></td><td><a class="reviews" href="javascript:void(0);" onclick="HD.rp.dialog.RoadDetails.showReviewForm();">'+HD.rp.text.reviewThisRoad+'</a></td></tr></table><div class="_HAS_NO_RATING"><a class="_HAS_NO_RATING" href="javascript:void(0);" onclick="HD.rp.dialog.RoadDetails.setActiveTab(HD.rp.constants._OVERVIEW_TABS.REVIEWS);">'+HD.rp.text.firstReview+"</a></div><div>"+HD.rp.text.roadLength+": _ROAD_LENGTH</div><div>"+HD.rp.text.estimatedTimeFull+": _ROAD_TIME</div><div>"+HD.rp.text.roadSubmitter+': _ROAD_SUBMITTER</div><div class="_TIME_TO_TRAVEL_CLASS">'+HD.rp.text.bestTimeToTravel+': _BEST_TRAVEL_TIME</div><table class="_STATES_CLASS"><tr><td>'+HD.rp.text.states+': </td><td>_ROAD_STATES</td></tr></table><table class="_ROAD_SCENERY_CLASS"><tr><td>'+HD.rp.text.scenery+": </td><td>_ROAD_SCENERY</td></tr></table><div>_ROAD_DESCRIPTION</div></div></td><td class='images'>_ROAD_IMAGE<div class=\"overviewPromo1\" onclick=\"HD.rp.launchHelp('publicprivate');\"></div></td></tr></table></div>"+HD.rp.HTML.roadDetailsTools+HD.rp.HTML.roadFooter,roadImage:'<img src="_ROAD_IMAGE_URL" />',genericTab:"<div class=\"roadDetailsContent\"><table class='roadDetailsTab'><tr><td class='data'><div class=\"mapLoadingImage\"></div></td></tr></table></div>"+HD.rp.HTML.roadDetailsTools+HD.rp.HTML.roadFooter,photosTab:'<div class="roadDetailsContent photos"><div class="mapLoadingImage"></div></div>'+HD.rp.HTML.roadDetailsTools+HD.rp.HTML.roadFooter,reviewsTab:'<div class="roadDetailsContent reviewsContent"><table class="roadDetailsTab"><tr><td class="rateRoad"><div class="rating"><div class="rateThisRoad">'+HD.rp.text.rateThisRoad+'</div><div id="ratingWrapperRT" class="starRating"><div id="textRatingRT">'+HD.rp.text.selectAStar+"</div><span>"+HD.rp.text.yourRating+': </span></div><a id="ratingSend" class="btnDisabled" onclick="HD.rp.dialog.RoadDetails.submitRating(this.className.match(/Disabled/))" href="javascript:void(0)">'+HD.rp.text.continueText.toUpperCase()+"</a></div><p>"+HD.rp.text.riddenRoad+'</p></td><td class="reviews"><div class="mapLoadingImage"></div></td></tr></table></div>'+HD.rp.HTML.roadDetailsTools+HD.rp.HTML.roadFooter,reportAbuseTab:'<div class="roadDetailsContent"><form name="sendAbuseForm" id="sendAbuseForm" method="post"><table id="abuseForm" style="display:block"><tr><td>'+HD.rp.text.provideDescription+':</td><td><textarea name="description" id="abuseDescription" cols="50" rows="10" wrap="physical" onkeyup="HD.rp.dialog.RoadDetails.showSendReportButton();"></textarea></td></tr><tr><td>'+HD.rp.text.roadName+':</td><td><input name="roadName" value="_ROAD_NAME" disabled="true"/></td></tr><tr><td>'+HD.rp.text.category+':</td><td><select name="category" id="abuseCategory" onchange="HD.rp.dialog.RoadDetails.showSendReportButton();"><option value="'+HD.rp.text.pleaseSelectCategory+'">'+HD.rp.text.pleaseSelectCategory+'</option><option value="'+HD.rp.text.incorrectInfo+'">'+HD.rp.text.incorrectInfo+'</option><option value="'+HD.rp.text.inappropriateContent+'">'+HD.rp.text.inappropriateContent+'</option></select></td></tr><tr><td></td><td><a class="btnDisabled" id="abuseSend" onclick="HD.rp.dialog.RoadDetails.submitReportAbuse()" href="javascript:void(0)">'+HD.rp.dialog.Text.send+'</a>&nbsp;<a class="btn" onclick="HD.rp.dialog.RoadDetails.closeReportAbuse()" href="javascript:void(0)">'+HD.rp.dialog.Text.cancel+"</a></td></tr><tr><td></td><td>"+HD.rp.text.viewPrivatePolicy+'</td></tr></table><div id="abuseFormSubmitted" style="display:none"><div>'+HD.rp.text.thankYouForFeedback+'</div><input type="button" value="Return to overview" onclick="HD.rp.dialog.RoadDetails.closeReportAbuse()"/></div></div>'+HD.rp.HTML.roadDetailsTools+HD.rp.HTML.roadFooter,linkCategory:'<div class="category"><div class="title">_TITLE</div><div>_LINKS</div></div>',review:'<div class="review"><div class="bold">_TITLE</div><div class="ratings"><div>'+HD.rp.text.rating+':&nbsp;</div><div class="ratingsWrapper"><div class="ratings_RATING"></div></div></div><div class="author">Submitted by _AUTHOR on _DATE</div><div class="reviewText">_REVIEW</div></div>',place:'<table class="placeToVisitDetails"><tr><td class="facts"><img class="placeToVisitImg" src="_IMAGE_URL"/></td><td class="data"><div class="brief"><a class="_BRIEF_ONLY" href="javascript:void(0);" ison="false" onclick="this.parentNode.className=this.ison==\'true\'?\'brief\':\'full\';this.ison=this.ison==\'false\'?\'true\':\'false\';">_TITLE (_STATE)</a><br/><div class="full">_FULL_DESCRIPTION</div><div class="brief">_BRIEF_DESCRIPTION</div><div class="_DIRECTIONS_CLASS"><b>'+HD.rp.text.directions+':</b> _DIRECTIONS<br/></div><div class="_COPYRIGHT_CLASS">_COPYRIGHT</div></div></td></tr></table>',link:'<div class="localLink"><a href="javascript:void(0);" onclick="window.open(\'_URL\')">_TITLE</a><div>_INFO</div></div>',photo:'<div><img src="_URL"></img></div>',itinerary:'<div class="sampleItinerary"><div>'+HD.rp.text.sampleItineraryHeader+'_ROAD_NAME.</div><div class="_DEPARTURE_CLASS"><b>'+HD.rp.text.departure+':</b> _DEPARTURE</div><div class="_DESTINATION_CLASS"><b>'+HD.rp.text.destination+":</b> _DESTINATION</div><div><b>"+HD.rp.text.timeToAllow+":</b> _TIME</div><div>_ITINERARY</div></div>",noItinerary:'<div class="noData">'+HD.rp.text.noSampleItinerary+"</div>",itineraryStop:'<div class="_STOP_CLASS"><div><b>_STOP_TITLE</b></div><div>_DESCRIPTION</div><div class="distance"><b>'+HD.rp.text.distanceFromPrevious+'_PREVIOUS_TITLE:</b> _DISTANCE</div><div class="time"><b>'+HD.rp.text.travelTimeFromPrevious+"_PREVIOUS_TITLE:</b> _TRAVEL_TIME</div><div><b>"+HD.rp.text.suggestedTimeAtSite+":</b> _STOP_TIME</div></div>",writeReview:'<div class="roadDetailsContent"><div class="writeReview"><div class="title">'+HD.rp.dialog.Text.rateAndReview+' _ROAD_NAME</div><div class="info">'+HD.rp.dialog.Text.submittingAReview+'</div><table><tr><td class="field">'+HD.rp.text.yourRating+'</td><td class="value" colspan="3"><div id="ratingWrapper" class="starRating"></div><div id="textRating">'+HD.rp.text.selectAStar+'</div></td></tr><tr><td class="field">'+HD.rp.text.title+'</td><td class="value" colspan="3"><input id="reviewTitle" class="i" /></td></tr><tr><td class="field">'+HD.rp.text.review+'</td><td class="value" colspan="3"><textarea id="reviewText" cols="75" rows="6" wrap="physical" class="i"></textarea></td></tr><tr><td class="field1">'+HD.rp.text.signAs+'</td><td class="value1"><select id="reviewSignature" class="i"></select></td><td class="field2">'+HD.rp.text.state+'</td><td class="value2"><select id="reviewState" class="i" onclick="HD.rp.dialog.RoadDetails.setSignature(this.value)">'+HD.rp.HTML.usStatesDropDownOptions+'</select></td></tr><tr><td class="field"></td><td id="reviewDisclaimer" class="value hide" colspan="3"><input type="checkbox" id="reviewAgreementCheck" name="reviewAgreementCheck"/><label for="reviewAgreementCheck" id="reviewAgreementCheckLabel">&nbsp;'+HD.rp.text.reviewAgreement1+'&nbsp;</label><a href="javascript:void(0)" onclick="HD.rp.dialog.RoadDetails.toggleAgreement(this.parentNode.className.match(/hide/), this)">'+HD.rp.text.reviewAgreement2+"</a><div>"+HD.rp.text.reviewDisclaimer+'</div></td></tr><tr><td class="field last"></td><td class="value last" colspan="3"><a id="reviewSend" class="btnDisabled" onclick="HD.rp.dialog.RoadDetails.submitReviewForm(this.className.match(/Disabled/))" href="javascript:void(0)">'+HD.rp.text.submitRatingReview.toUpperCase()+'</a>&nbsp;<a class="btn" onclick="HD.rp.dialog.RoadDetails.closeReviewForm()" href="javascript:void(0)">'+HD.rp.text.cancel.toUpperCase()+'</a></td></tr><tr></table></div><div class="thankYouReview" style="display:none"><div class="header2">'+HD.rp.dialog.Text.thankYouCaps+"</div><div>"+HD.rp.text.reviewThankYou+'</div><a href="javascript:void(0)" class="btn" onclick="HD.rp.dialog.RoadDetails.closeReviewForm()">'+HD.rp.text.returnToOverview+"</a></div></div>"+HD.rp.HTML.roadDetailsTools+HD.rp.HTML.roadFooter},dealerServices:{motorcycles:"<div class='dsvcMotorcycles' title='"+HD.rp.dialog.Text.dealerServices.motorcycles.header+" - "+HD.rp.dialog.Text.dealerServices.motorcycles.desc+"'></div>",service:"<div class='dsvcService' title='"+HD.rp.dialog.Text.dealerServices.service.header+" - "+HD.rp.dialog.Text.dealerServices.service.desc+"'></div>",motorclothes:"<div class='dsvcMotorclothes' title='"+HD.rp.dialog.Text.dealerServices.motorclothes.header+" - "+HD.rp.dialog.Text.dealerServices.motorclothes.desc+"'></div>",accessories:"<div class='dsvcAccessories' title='"+HD.rp.dialog.Text.dealerServices.accessories.header+" - "+HD.rp.dialog.Text.dealerServices.accessories.desc+"'></div>",ecommerce:"<div class='dsvcEcommerce' title='"+HD.rp.dialog.Text.dealerServices.ecommerce.header+" - "+HD.rp.dialog.Text.dealerServices.ecommerce.desc+"'></div>",rentals:"<div class='dsvcRentals' title='"+HD.rp.dialog.Text.dealerServices.rentals.header+" - "+HD.rp.dialog.Text.dealerServices.rentals.desc+"'></div>",ridersEdge:"<div class='dsvcRidersedge' title='"+HD.rp.dialog.Text.dealerServices.ridersEdge.header+" - "+HD.rp.dialog.Text.dealerServices.ridersEdge.desc+"'></div>",hogChapter:"<div class='dsvcHogchapter' title='"+HD.rp.dialog.Text.dealerServices.hogChapter.header+" - "+HD.rp.dialog.Text.dealerServices.hogChapter.desc+"'></div>",hogfly:"<div class='dsvcHogfly' title='"+HD.rp.dialog.Text.dealerServices.hogfly.header+" - "+HD.rp.dialog.Text.dealerServices.hogfly.desc+"'></div>",buell:"<div class='dsvcBuell' title='"+HD.rp.dialog.Text.dealerServices.buell.header+" - "+HD.rp.dialog.Text.dealerServices.buell.desc+"'></div>",brag:"<div class='dsvcBrag' title='"+HD.rp.dialog.Text.dealerServices.brag.header+" - "+HD.rp.dialog.Text.dealerServices.brag.desc+"'></div>"},dealerDetails:"<div class='dealerInformation'><table><tr><td><div class='hdLogo'></div></td><td><strong>_DEALER_NAME</strong><br/>_ADDRESS_LINE_ONE<br/>_ADDRESS_LINE_TWO<br/>_PHONE<br/>"+HD.rp.dialog.Text.fax+" _FAX<br/><a class='_HAS_URL' target='_blank' href='_DEALER_URL' onclick=\"HD.rp.Panel.invoke('getDealerWebsite','_DEALER_ID');\">_DEALER_URL</a><br class='_HAS_URL'/><br/><strong>"+HD.rp.dialog.Text.hours+":</strong><br/>_HOURS</td></tr><tr><td><div class='hogLogo'></div></td><td><strong>"+HD.rp.dialog.Text.hogChapter+"</strong><br/> _CHAPTER_NAME<br/>"+HD.rp.dialog.Text.visitOurHogChapter+"<br /><a href='_CHAPTER_URL' target='_blank'>_CHAPTER_URL</a></td></tr><tr><td></td><td><strong>"+HD.rp.dialog.Text.services+":</strong><br/>_SERVICES_CONTENT<br/></td></tr></table></div>",dealerDetailsPrint:"<tr class='_HOG_CHAPTER_CLASS'><td class='a'>H.O.G. Chapter</td><td class='b bold'>_HOG_CHAPTER_DATA</td></tr><tr class='_DEALER_SERVICES_CLASS'><td class='a'>Services</td><td class='b'>_DEALER_SERVICES_DATA</td></tr><tr class='_DEALER_HOURS_CLASS'><td class='a'>Hours</td><td class='b'>_DEALER_HOURS_DATA</td></tr>"};HD.rp.dialog.SaveDialog={dateRange:null,ride:null,onComplete:null,loading:null,init:function(){var A=this;HD.ui.Dialog.events.beforeHide.event.subscribe(function(){if(!!A.dateRange){A.dateRange.destroy();A.dateRange=null}});this.isInit=true},show:function(L,B){if(!this.isInit){this.init()}HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Save/Form"));this.ride=L||HD.rp.MyRide.route;this.onComplete=B||null;var I=this.buildFormHTML();HD.ui.Dialog.show(HD.rp.dialog.Text.saveYourRide,"500","570",I);var E=$("saveRoadDateRange");this.dateRange=new HD.ui.DateRangeSelector(null,null,function(){return HD.util.isIE?0:2});var A=E.getElementsByTagName("input")[0];var G=E.getElementsByTagName("a")[0];var F=E.getElementsByTagName("input")[1];var J=E.getElementsByTagName("a")[1];this.dateRange.start.handles.entry.id=A.id;this.dateRange.start.handles.entry.name=A.name;E.replaceChild(this.dateRange.start.handles.entry,A);E.replaceChild(this.dateRange.start.handles.toggle,G);this.dateRange.end.handles.entry.id=F.id;this.dateRange.end.handles.entry.name=F.name;E.replaceChild(this.dateRange.end.handles.entry,F);E.replaceChild(this.dateRange.end.handles.toggle,J);if(this.ride.data&&this.ride.data.id&&this.ride.doc){this.ride.doc.userUnderstandAgreement="true"}if(this.ride.doc){HD.util.FormUtil.setValues($("saveDialogWrapper").getElementsByTagName("form")[0],this.ride.doc)}var M=$("submissionSignAs");for(var D=M.options.length-1;D>=0;D--){if(!M.options[D].value){M.removeChild(M.options[D])}}if($("savePublicRadio").checked){this.setPublic()}else{this.setPrivate()}var H=this.ride;if(H.doc){var K=(H.doc.scenery&&H.doc.scenery.length>0)?true:false;var C=(H.doc.timeofyearDescription&&H.doc.timeofyearDescription.length>0)?true:false;if(K||C){this.showAdditional()}}},buildFormHTML:function(){var D=HD.rp.User.roadCounts[HD.rp.User._COUNT_TYPE.RP]>=HD.rp.constants._MAX_USER_ROADS_WARN?HD.rp.dialog.HTML.saveRoadDialog.roadLimitWarning:"";D+=HD.rp.dialog.HTML.saveRoadDialog.form;var G=HD.User.data;var F=G.firstName+" "+G.lastName.substring(0,1)+".";D=HD.util.template(D,{_FULL_NAME:F||"",_DEFAULT_NAME:HD.rp.dialog.Text.defaultSignature||"",_USERNAME:G.screenName||"",_SCENERY_CHECKLIST:(function(){var H=[];var I=HD.rp.text.roadCharacteristics.scenery;for(var J in I){H.push(HD.util.template(HD.rp.dialog.HTML.saveRoadDialog.checkListItem,{_NAME:I[J],_ID:J,_TYPE:"scenery"}))}return H.join("")})(),_SEASONS_CHECKLIST:(function(){var I=[];var H=HD.rp.text.roadCharacteristics.timeofyear;for(var J in H){I.push(HD.util.template(HD.rp.dialog.HTML.saveRoadDialog.checkListItem,{_NAME:H[J],_ID:J,_TYPE:"timeofyearDescription"}))}return I.join("")})(),_USER_ID:G.id});var E=document.createElement("div");E.innerHTML=D;E.setAttribute("id","saveDialogWrapper");var C;if(this.ride.doc){C=this.ride.doc.submittedByState}if(HD.User.data.state&&!C){var B=E.getElementsByTagName("select");for(var A=0;A<B.length;A++){if(B[A].name=="submittedByState"){HD.util.FormUtil.setSelectValue(B[A],HD.User.data.state)}}}return E},saveRoad:function(){this.showLoading(HD.rp.dialog.Text.savingRide);var B=HD.util.FormUtil.getValues($("saveRoadForm"));if(B.dateFrom=="mm/dd/yyyy"){B.dateFrom=""}if(B.dateTo=="mm/dd/yyyy"){B.dateTo=""}var A={name:"rp_RoadSubmission",page:"1",road:HD.road.DWR.routeToJavaRoad(this.ride),roadDoc:B};this.ride.doc=B;var C=this;RoadService.saveRoad(A,function(D){if(D==null){HD.User.userReconnect()}else{C.handleSaveResponse.call(C,D)}})},handleSaveResponse:function(B){this.hideLoading();if(!B.valid){HD.util.FormUtil.markErrors(B.errors,$("saveRoadForm"),$("dlgSaveMessage"),"formError")}else{HD.util.copyObject(B.road,this.ride.data);HD.rp.WelcomeBox.setMessage();HD.ui.Dialog.hide();if(!!this.onComplete){this.onComplete(this.ride)}else{var A=HD.util.template(HD.rp.dialog.HTML.saveRoadDialog.noticeSaveDialog,{_RIDE_PLAN_NAME:this.ride.doc.rideName,_RIDE_ID:this.ride.data.id});HD.ui.Dialog.showNotice(HD.rp.dialog.Text.yourRidePlanWasSaved,A,null,500,200)}if(this.ride.doc.access=="PUBLIC"){HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Save/Confirm/Public"))}else{HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Save/Confirm/Private"))}}},toggleAdditional:function(){if(YAHOO.util.Dom.hasClass($("saveRoadForm"),"additional")){HD.rp.dialog.SaveDialog.hideAdditional()}else{HD.rp.dialog.SaveDialog.showAdditional()}},showAdditional:function(){YAHOO.util.Dom.addClass($("saveRoadForm"),"additional")},hideAdditional:function(){YAHOO.util.Dom.removeClass($("saveRoadForm"),"additional")},toggleAgreement:function(B,A){if(!!B){YAHOO.util.Dom.removeClass($("saveDisclaimer"),"hide")}else{YAHOO.util.Dom.addClass($("saveDisclaimer"),"hide")}if(!!A){A.blur()}},setPublic:function(){YAHOO.util.Dom.addClass($("saveRoadForm"),"public");YAHOO.util.Dom.removeClass($("saveRoadForm"),"private");HD.rp.dialog.SaveDialog.showAdditional()},setPrivate:function(){YAHOO.util.Dom.addClass($("saveRoadForm"),"private");YAHOO.util.Dom.removeClass($("saveRoadForm"),"public");var B=$("additionalInfo").getElementsByTagName("input");for(var A=0;A<B.length;A++){if(B[A].checked){return }}HD.rp.dialog.SaveDialog.hideAdditional()},showLoading:function(A){this.loading=new HD.ui.LoadingIndicator("hdDialogContent",(A||HD.rp.dialog.Text.loading)+" ...")},hideLoading:function(){this.loading.remove()}};HD.rp.dialog.RoadDetails={isInit:false,init:function(){var A=this;var B={};B[HD.rp.service.RoadDataTypes._REVIEWS._YES_DATA]=function(C,E,D){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populateReviewsTab(C,E,D)}};B[HD.rp.service.RoadDataTypes._REVIEWS._NO_DATA]=function(C){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populateNoReviewsTab(C)}};B[HD.rp.service.RoadDataTypes._PHOTOS._YES_DATA]=function(C,E,D){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populatePhotosTabProxy(C,E,D)}};B[HD.rp.service.RoadDataTypes._PHOTOS._NO_DATA]=function(C){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populateNoPhotosTab(C)}};B[HD.rp.service.RoadDataTypes._PLACES._YES_DATA]=function(C,E,D){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populatePlacesTab(C,E,D)}};B[HD.rp.service.RoadDataTypes._PLACES._NO_DATA]=function(C){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populateNoPlacesTab(C)}};B[HD.rp.service.RoadDataTypes._ITINERARY._YES_DATA]=function(C,E,D){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populateItineraryTab(C,E,D)}};B[HD.rp.service.RoadDataTypes._ITINERARY._NO_DATA]=function(C){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populateNoItineraryTab(C)}};B[HD.rp.service.RoadDataTypes._LINKS._YES_DATA]=function(C,E,D){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populateLinksTab(C,E,D)}};B[HD.rp.service.RoadDataTypes._LINKS._NO_DATA]=function(C){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populateNoLinksTab(C)}};B[HD.rp.service.RoadDataTypes._CONTACTS._YES_DATA]=function(C,E,D){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populateContactsSubTab(C,E,D)}};B[HD.rp.service.RoadDataTypes._CONTACTS._NO_DATA]=function(C){if(A.isShowing.call(A)){HD.rp.dialog.RoadDetails.populateNoContactsSubTab(C)}};this.roadData=new HD.rp.service.RoadData(B);this.paging=new HD.ui.Paging("pagingWrapper");this.paging.HTML.byPageHTML.prevText="&nbsp;";this.paging.HTML.byPageHTML.nextText="&nbsp;";this.isInit=true},isShowing:function(){return HD.util.hasValue($("roadDetailsOverviewTab"))},tabView:null,road:null,nullIndex:-1,dialogHeight:500,dialogWidth:720,hbx:null,starRating:new HD.ui.StarRating("ratingWrapper","textRating",function(){HD.rp.dialog.RoadDetails.enableReviewFormSend()}),starRatingRT:new HD.ui.StarRating("ratingWrapperRT","textRatingRT",function(){HD.rp.dialog.RoadDetails.enableRatingSend()}),showDetails:function(B,A){if(!this.isInit){this.init()}if(!B){return }this.hbx=HD.rp.RoadsPanel.hbx;HD.rp.util.Hitbox.track(this.hbx.select("More+Info/RoadID+Name"),{RoadID:HD.util.rtrim(B.data.id),Name:HD.util.rtrim(B.data.name)});A=A||HD.rp.constants._OVERVIEW_TABS.OVERVIEW;this.road=B;this.writeAReviewTabIndex=this.nullIndex;this.reportAbuseTabIndex=this.nullIndex;if(B.type==HD.road.constants._STOP_TYPES.GREAT_ROAD){this.buildGreatRoad()}else{if(B.type==HD.road.constants._STOP_TYPES.USER_ROAD){this.buildUserRoad()}}this.tabView.set("activeIndex",A);HD.ui.Dialog.show(B.data.name,this.dialogWidth,this.dialogHeight,this.tabView)},buildUserRoad:function(){this.clearTabs();this.addOverviewTab();this.addReviewsTab()},buildPromoRoad:function(){this.clearTabs();this.addOverviewTab(true)},buildGreatRoad:function(){this.clearTabs();this.addOverviewTab();this.addReviewsTab();this.addPhotosTab();this.addPlacesToVisitTab();this.addSampleItineraryTab();this.addLocalLinksTab();this.addContactsSubTab()},addOverviewTab:function(E){var D=this.road;var Q=D.data;var H=Q.averageRating||0;var N=HD.rp.util.formatRoadLength(Q.distance)||HD.rp.text.zeroMiles;var A=Q.timeToAllow!=null?Q.timeToAllow:HD.util.Date.parseMilliseconds(Q.duration)||"";var G=Q.signAs||HD.rp.text.americasByway;var M=Q.description||Q.comments||"";var K=Q.image||"";var O=HD.rp.dialog.HTML.roadDetailsDialog.overviewTab;var C=Q.stateCodes;var I=Q.roadCharacteristics;var F=[];var S=[];if(I!=null&&I.length>0){for(var P=0;P<I.length;P++){var J=I[P];var B=J.type.toLowerCase();var L=J.value;if(B=="timeofyear"){F.push(HD.rp.HTML.roadCharacteristics[B][L])}else{if(B=="scenery"){S.push(HD.rp.HTML.roadCharacteristics[B][L])}}}}if(K!=""){K=HD.util.template(HD.rp.dialog.HTML.roadDetailsDialog.roadImage,{_ROAD_IMAGE_URL:HD.constants.PHOTO_PATH+K})}O=HD.util.template(O,{_HAS_RATING:H==0||!!E?"hide":"",_HAS_NO_RATING:H!=0||!!E?"hide":"",_ROAD_RATING:H,_ROAD_LENGTH:N,_ROAD_TIME:A,_ROAD_SUBMITTER:HD.util.convertToJSSafeHTMLString(G),_STATES_CLASS:C!=null&&C.length>0?HD.rp.HTML.visibleClass:HD.rp.HTML.hiddenClass,_ROAD_STATES:C!=null&&C.length>0?(function(){var U=[];for(var T=0;T<C.length;T++){U.push(HD.util.template(HD.rp.HTML.roadStateSquare,{_STATE:C[T].toUpperCase()}))}return U.join("")})():"",_TIME_TO_TRAVEL_CLASS:F.length>0?HD.rp.HTML.visibleClass:HD.rp.HTML.hiddenClass,_BEST_TRAVEL_TIME:F.length>0?(function(){var U=[];for(var T=0;T<F.length;T++){if(U.length>0){U.push(" ")}U.push(F[T])}return U.join("")})():"",_ROAD_SCENERY_CLASS:S.length>0?HD.rp.HTML.visibleClass:HD.rp.HTML.hiddenClass,_ROAD_SCENERY:S.length>0?(function(){var V=1;var U=["<table>"];for(var T=0;T<S.length;T++){if(V==1){U.push("<tr>")}U.push("<td>"+S[T]+"</td>");if(V==3){V=1;U.push("</tr>")}else{V++}}if(U[U.length]!="</tr>"){U.push("</tr>")}U.push("</table>");return U.join("")})():"",_ROAD_DESCRIPTION:M,_ROAD_IMAGE:K});O=this.setFooterAndImage(O);this.addTab(HD.rp.constants._OVERVIEW_TABS.OVERVIEW,O,this.hbx.select("More+Info/Overview/RoadID+Name"))},addReviewsTab:function(){var A=this.road;var B=HD.rp.dialog.HTML.roadDetailsDialog.reviewsTab;B=this.setFooterAndImage(B);this.addTab(HD.rp.constants._OVERVIEW_TABS.REVIEWS,B,this.hbx.select("More+Info/Reviews/RoadID+Name"));this.getReviewsData()},getReviewsData:function(A){this.roadData.getData(this.road,HD.rp.service.RoadDataTypes._REVIEWS,A)},populateNoReviewsTab:function(A){var B=HD.rp.dialog.HTML.roadDetailsDialog.reviewsTab;B=this.setFooterAndImage(B);var C=this.getTab(HD.rp.constants._OVERVIEW_TABS.REVIEWS);C.set("content",B);this.setTabContent(C,HD.rp.HTML.mapLoadingImage,HD.rp.HTML.noRiderReviews+(!HD.User.isLoggedIn?HD.rp.HTML.noRiderReviewsNoLogin:""));if(!!$(this.starRatingRT.parentId)){this.starRatingRT.render()}},populateReviewsTab:function(D,J,K){var U=J.data[K];var L=J.pages;var B=J.resultIndex;var T=U.length;var I=J.results;var E="HD.rp.dialog.RoadDetails.getReviewsData";var H=this.paging.generateByRecord(L,K,B,T,I,E)||HD.rp.HTML.noPagingResults;var Q=[];if(H!=null){Q.push(H)}for(var V=0;V<U.length;V++){var S=U[V];var P=HD.rp.dialog.HTML.roadDetailsDialog.review;P=HD.util.template(P,{_TITLE:S.title,_RATING:S.rating,_AUTHOR:S.signAs,_DATE:HD.rp.util.formatDate(S.submissionDate),_REVIEW:S.reviewText});Q.push(P)}if(H!=null){Q.push('<div class="reviewHeader"></div>'+H)}var A=this.getTab(HD.rp.constants._OVERVIEW_TABS.REVIEWS);var N=HD.rp.dialog.HTML.roadDetailsDialog.reviewsTab;N=this.setFooterAndImage(N);A.set("content",N);this.setTabContent(A,HD.rp.HTML.mapLoadingImage,Q.join(""));var F=A.get("contentEl");var O=YAHOO.util.Dom.getElementsByClassName("pagingWrapper","div",F);var G=false;for(var M=0;M<O.length;M++){if(!O[M].innerHTML){O[M].parentNode.removeChild(O[M]);G=true}}if(G){var C=YAHOO.util.Dom.getElementsByClassName("reviewHeader","div",F)[0];C.parentNode.removeChild(C);U=YAHOO.util.Dom.getElementsByClassName("review","div",F);if(U.length>0){YAHOO.util.Dom.addClass(U[0],"noPaging")}}if(!!$(this.starRatingRT.parentId)){this.starRatingRT.render()}},repopulateReviewsTab:function(){this.road.reviews=null;this.getReviewsData(1)},enableRatingSend:function(){$("ratingSend").className=$("ratingSend").className.replace(/Disabled/g,"")},addPhotosTab:function(){var A=this.road;var C=HD.rp.dialog.HTML.roadDetailsDialog.photosTab;C=this.setFooterAndImage(C);var B=this.addTab(HD.rp.constants._OVERVIEW_TABS.PHOTOS,C,this.hbx.select("More+Info/Photos/RoadID+Name"));this.getPhotosData(0)},getPhotosData:function(A){this.roadData.getData(this.road,HD.rp.service.RoadDataTypes._PHOTOS,A)},populateNoPhotosTab:function(A){log("no places")},populatePhotosTabProxy:function(C,D,B){if(HD.ui.Dialog.isShown){this.populatePhotosTab(C,D,B)}else{var A=this;var E=C;var G=D;var F=B;this.callbackFunction=function(){A.populatePhotosTab.call(A,E,G,F)};HD.ui.Dialog.events.afterShow.event.subscribe(HD.rp.dialog.RoadDetails.callbackFunction)}},populatePhotosTab:function(F,A,D){var I=A.data[D];var B={images:[],thumbs:[],captions:[],credits:[],noscrollLimit:8};for(var H=0;H<I.length;H++){if(I[H].webUseCode=="t"){B.thumbs.push(this.getImagePath(I[H]))}else{var E=I[H];B.images.push(this.getImagePath(E));B.captions.push(E.publicationInfo.description||null);var J=(E.publicationInfo.copyrighted)?HD.rp.text.copyright+" "+E.publicationInfo.copyrightDate+" "+E.publicationInfo.copyrightHolder:E.publicationInfo.creditTo;B.credits.push(J)}}while(B.thumbs.length<B.images.length){B.thumbs.push(null)}var C=this.getTab(HD.rp.constants._OVERVIEW_TABS.PHOTOS);var G=HD.rp.dialog.HTML.roadDetailsDialog.photosTab;G=this.setFooterAndImage(G);C.set("content",G);this.setTabContent(C,HD.rp.HTML.mapLoadingImage,'<div id="imageGallery"></div>');$("imageGallery").appendChild(new HD.ui.ImageGallery(B).handle);HD.ui.Dialog.events.afterShow.event.unsubscribe(HD.rp.dialog.RoadDetails.callbackFunction)},addPlacesToVisitTab:function(){var A=this.road;var B=HD.rp.dialog.HTML.roadDetailsDialog.genericTab;B=this.setFooterAndImage(B);this.addTab(HD.rp.constants._OVERVIEW_TABS.PLACES_TO_VISIT,B,this.hbx.select("More+Info/Places+to+Visit/RoadID+Name"));this.getPlacesToVisitData()},getPlacesToVisitData:function(A){this.roadData.getData(this.road,HD.rp.service.RoadDataTypes._PLACES,A)},populateNoPlacesTab:function(A){log("no places")},populatePlacesTab:function(H,C,F){var B=C.data[F];var E=C.pages;var J=C.resultIndex;var Q=B.length;var O=C.results;var A="HD.rp.dialog.RoadDetails.getPlacesToVisitData";var M=this.paging.generateByRecord(E,F,J,Q,O,A)||HD.rp.HTML.noPagingResults;var N=[];if(M!=null){N.push(M)}for(var P=0;P<B.length;P++){var I=B[P];var K=HD.rp.dialog.HTML.roadDetailsDialog.place;var G=I.images[0];K=HD.util.template(K,{_IMAGE_URL:G!=null?this.getImagePath(G):HD.rp.URL.blankImage,_TITLE:I.name,_STATE:I.stateCode,_BRIEF_DESCRIPTION:I.description,_DIRECTIONS_CLASS:I.toDirections!=null&&I.toDirections!=" "?HD.rp.HTML.visibleClass:HD.rp.HTML.hiddenClass,_DIRECTIONS:I.toDirections!=null&&I.toDirections!=" "?I.toDirections:"",_FULL_DESCRIPTION:I.extendedDescriptions.Description||I.description,_BRIEF_ONLY:!!I.extendedDescriptions.Description?"":"briefOnly",_COPYRIGHT_CLASS:I.extendedDescriptions.Credits!=null?"copyright":HD.rp.HTML.hiddenClass,_COPYRIGHT:I.extendedDescriptions.Credits!=null?I.extendedDescriptions.Credits:""});N.push(K)}if(M!=null){N.push(M)}var D=this.getTab(HD.rp.constants._OVERVIEW_TABS.PLACES_TO_VISIT);var L=HD.rp.dialog.HTML.roadDetailsDialog.genericTab;L=this.setFooterAndImage(L);D.set("content",L);this.setTabContent(D,HD.rp.HTML.mapLoadingImage,N.join(""))},addSampleItineraryTab:function(){var A=this.road;var B=HD.rp.dialog.HTML.roadDetailsDialog.genericTab;B=this.setFooterAndImage(B);this.addTab(HD.rp.constants._OVERVIEW_TABS.SAMPLE_ITINERARY,B,this.hbx.select("More+Info/Sample+Itinerary/RoadID+Name"));this.getItineraryData()},getItineraryData:function(A){this.roadData.getData(this.road,HD.rp.service.RoadDataTypes._ITINERARY,A)},populateNoItineraryTab:function(A){var B=this.getTab(HD.rp.constants._OVERVIEW_TABS.SAMPLE_ITINERARY);this.setTabContent(B,HD.rp.HTML.mapLoadingImage,HD.rp.dialog.HTML.roadDetailsDialog.noItinerary)},populateItineraryTab:function(F,A,E){var C=A.data[E];var I=[];for(var J=0;J<C.length;J++){var K=C[J];var G=HD.rp.dialog.HTML.roadDetailsDialog.itinerary;var B=K.totalDays>1?K.totalDays+" days":K.totalDays+" day";G=HD.util.template(G,{_ROAD_NAME:F.data.name,_DEPARTURE_CLASS:K.departureCity!=null?HD.rp.HTML.visibleClass:HD.rp.HTML.hiddenClass,_DEPARTURE:K.departureCity!=null?K.departureCity.name+", "+K.departureCity.stateCode:"",_DESTINATION_CLASS:K.destinationCity!=null?HD.rp.HTML.visibleClass:HD.rp.HTML.hiddenClass,_DESTINATION:K.destinationCity!=null?K.destinationCity.name+", "+K.destinationCity.stateCode:"",_TIME:B,_ITINERARY:(function(){var S=[];var O=K.entries.length;var P=null;for(var T=0;T<O;T++){var U=K.entries[T];var V=HD.rp.dialog.HTML.roadDetailsDialog.itineraryStop;var M=T==0;var N=T==O-1;var Q=T+1;var L=M?HD.rp.text.start:N?HD.rp.text.end:HD.rp.text.stop+" "+Q;V=HD.util.template(V,{_STOP_CLASS:M?"firstItineraryStop":"itineraryStop",_STOP_TITLE:L+": "+U.name,_DESCRIPTION:U.reason,_DISTANCE:HD.rp.util.formatRoadLength(U.toDistance),_TRAVEL_TIME:HD.util.Date.parseMinutes(U.toTime),_STOP_TIME:HD.util.Date.parseMinutes(U.stoppingTime),_PREVIOUS_TITLE:P!=null?P.name:""});P=U;S.push(V)}return S.join("")})()});I.push(G)}var H=I.join("");var D=this.getTab(HD.rp.constants._OVERVIEW_TABS.SAMPLE_ITINERARY);this.setTabContent(D,HD.rp.HTML.mapLoadingImage,H)},addLocalLinksTab:function(){var A=this.road;var B=HD.rp.dialog.HTML.roadDetailsDialog.genericTab;B=this.setFooterAndImage(B);this.addTab(HD.rp.constants._OVERVIEW_TABS.LOCAL_LINKS,B,this.hbx.select("More+Info/Local+Links/RoadID+Name"));this.getLinksData()},getLinksData:function(A){this.roadData.getData(this.road,HD.rp.service.RoadDataTypes._LINKS,A)},populateNoLinksTab:function(A){log("no links")},populateLinksTab:function(E,A,D){var L=A.data[D];var M={};var K,B,J,G,I;for(K=0;K<L.length;K++){I=L[K];G=HD.rp.dialog.HTML.roadDetailsDialog.link;G=HD.util.template(G,{_URL:I.webSite.url,_TITLE:I.webSite.name,_INFO:I.webSite.description});J=M[I.category.name];if(J==null){J=new Array();M[I.category.name]=J}J.push(G)}var H=new Array();var F=this._LOCAL_LINKS_CATEGORIES;for(K=0;K<F.length;K++){B=F[K];J=M[B];if(J==null||J.length<1){continue}G=HD.rp.dialog.HTML.roadDetailsDialog.linkCategory;G=HD.util.template(G,{_TITLE:B,_LINKS:J.join("")});H.push(G)}var C=this.getTab(HD.rp.constants._OVERVIEW_TABS.LOCAL_LINKS);this.setTabContent(C,HD.rp.HTML.mapLoadingImage,H.join(""))},addContactsSubTab:function(){log("addContactsSubTab");this.getContactsData()},getContactsData:function(A){log("getContactsData");this.roadData.getData(this.road,HD.rp.service.RoadDataTypes._CONTACTS,A)},populateContactsSubTab:function(B,C,A){log("populateContactsSubTab")},populateNoContactsSubTab:function(){log("populateNoContactsSubTab")},showReviewForm:function(C){if(!HD.User.promptLogin(function(){HD.rp.dialog.RoadDetails.showReviewForm(C)})){return }if(this.writeAReviewTabIndex!=this.nullIndex){this.tabView.set("activeIndex",this.writeAReviewTabIndex);return }var A=this.road;var B=HD.rp.dialog.HTML.roadDetailsDialog.writeReview;B=HD.util.template(B,{_ROAD_NAME:A.data.name});B=this.setFooterAndImage(B);this.writeAReviewTabIndex=0;while(this.getTab(this.writeAReviewTabIndex)!=null){this.writeAReviewTabIndex++}this.addTab(HD.rp.constants._OVERVIEW_TABS.WRITE_A_REVIEW,B,this.hbx.select("More+Info/Create+Review"));this.tabView.set("activeIndex",this.writeAReviewTabIndex);this.assignReviewFormListeners();if(!!$(this.starRating.parentId)){this.starRating.render(C)}},submitReviewForm:function(B){if(!B&&!this.enableReviewFormSend()){var A={roadReview:{roadId:this.road.data.id,title:this.reviewTitleEl.value,reviewText:this.reviewTextEl.value,submittedBy:HD.User.data.id,signAs:this.reviewSignatureEl.value,submissionDate:new Date(),rating:this.starRating.getRating()}};var C=this;OverviewService.addReview(A,function(){C.repopulateReviewsTab()});HD.rp.util.Hitbox.track(this.hbx.select("More+Info/Submit+Review"));YAHOO.util.Dom.getElementsByClassName("thankYouReview","div",document.body)[0].style.display="block";YAHOO.util.Dom.getElementsByClassName("writeReview","div",document.body)[0].style.display="none";window.setTimeout(function(){C.closeReviewForm.call(C)},this._TAB_CLOSE_DELAY)}},closeReviewForm:function(){if(this.writeAReviewTabIndex==this.nullIndex){return }var A=this.getTab(this.writeAReviewTabIndex);if(A!=null){this.tabView.removeTab(A)}if(this.reportAbuseTabIndex>this.writeAReviewTabIndex){this.reportAbuseTabIndex--}this.writeAReviewTabIndex=this.nullIndex;this.tabView.set("activeIndex",0)},toggleAgreement:function(B,A){if(!!B){YAHOO.util.Dom.removeClass($("reviewDisclaimer"),"hide")}else{YAHOO.util.Dom.addClass($("reviewDisclaimer"),"hide")}if(!!A){A.blur()}},setSignature:function(F){this.enableReviewFormSend();HD.util.FormUtil.setSelectValue(this.reviewStateEl,F);var E=HD.rp.text.aHarleyDavidsonRider;var D=!!HD.User.data.lastName&&!!HD.User.data.firstName?HD.User.data.lastName+" "+HD.User.data.firstName.substring(0,1)+"."+(!!F?", "+F:""):null;var C=!!HD.User.data.screenName?HD.User.data.screenName+(!!F?", "+F:""):null;var B=this.reviewSignatureEl.selectedIndex;var A=0;if(!!E){this.reviewSignatureEl.options[A++]=new Option(E,E)}if(!!D){this.reviewSignatureEl.options[A++]=new Option(D,D)}if(!!C){this.reviewSignatureEl.options[A++]=new Option(C,C)}while(A<3){this.reviewSignatureEl.options[A++]=null}if(B<this.reviewSignatureEl.options.length){this.reviewSignatureEl.selectedIndex=B}this.reviewSignatureEl.disabled=false;this.enableReviewFormSend()},assignReviewFormListeners:function(){this.reviewTitleEl=$("reviewTitle");this.reviewTextEl=$("reviewText");this.reviewStateEl=$("reviewState");this.reviewSignatureEl=$("reviewSignature");this.reviewAgreeCheckEl=$("reviewAgreementCheck");this.reviewSendEl=$("reviewSend");this.setSignature(HD.User.data.state);var B=this;var A=function(){B.enableReviewFormSend.call(B)};this.reviewTitleEl.onkeyup=A;this.reviewTextEl.onkeyup=A;this.reviewAgreeCheckEl.onchange=A},enableReviewFormSend:function(){var A=false;if(this.starRating.getRating()<1||this.starRating.getRating()>5){A=true}if(this.reviewTitleEl.value.length<1){A=true}if(this.reviewTextEl.value.length<1){A=true}if(this.reviewStateEl.value.length<1||this.reviewStateEl.selectedIndex==0){A=true}if(this.reviewSignatureEl.value.length<1){A=true}if(!this.reviewAgreeCheckEl.checked){A=true}this.reviewSendEl.className=A?"btnDisabled":"btn";return A},submitRating:function(A){if(!A){if(!HD.User.promptLogin(function(){HD.rp.dialog.RoadDetails.submitRating(A)})){return }HD.rp.util.Hitbox.track(this.hbx.select("More+Info/Rate+Road/RoadID+Name"),{RoadID:HD.util.rtrim(this.road.data.id),Name:HD.util.rtrim(this.road.data.name)});HD.rp.dialog.RoadDetails.showReviewForm(this.starRatingRT.getRating())}},showReportAbuse:function(){if(this.reportAbuseTabIndex!=this.nullIndex){this.tabView.set("activeIndex",this.reportAbuseTabIndex);return }this.reportAbuseTabIndex=0;while(this.getTab(this.reportAbuseTabIndex)!=null){this.reportAbuseTabIndex++}var A=this.road;var B=HD.rp.dialog.HTML.roadDetailsDialog.reportAbuseTab;B=HD.util.template(B,{_ROAD_NAME:A.data.name});B=this.setFooterAndImage(B);this.addTab(HD.rp.constants._OVERVIEW_TABS.REPORT_ABUSE,B,null);this.tabView.set("activeIndex",this.reportAbuseTabIndex)},submitReportAbuse:function(){var C=HD.util.FormUtil.getValues($("sendAbuseForm"));C.senderEmail=HD.User.data.email;var A=this.road;if(!C.roadName){C.roadName=A.name}var B={name:"rp_EmailAbuseSubmission",page:"1",emailDoc:C};var D=this;EmailService.sendAbuse(B,function(E){D.closeReportAbuse.call(D,E)})},closeReportAbuse:function(A){if(this.reportAbuseTabIndex==this.nullIndex){return }var B=this.getTab(this.reportAbuseTabIndex);if(B!=null){this.tabView.removeTab(B)}if(this.writeAReviewTabIndex>this.reportAbuseTabIndex){this.writeAReviewTabIndex--}this.reportAbuseTabIndex=this.nullIndex},showSendReportButton:function(){var A=($("abuseCategory").selectedIndex>0&&$("abuseDescription").value.length>0)?false:true;YAHOO.util.Dom.replaceClass($("abuseSend"),A?"btn":"btnDisabled",A?"btnDisabled":"btn")},setActiveTab:function(A){this.tabView.set("activeIndex",A)},_TAB_CLOSE_DELAY:6000,_TAB_HEADERS:{0:HD.rp.dialog.Text.roadTabs.overview,1:HD.rp.dialog.Text.roadTabs.reviews,2:HD.rp.dialog.Text.roadTabs.photos,3:HD.rp.dialog.Text.roadTabs.placesToVisit,4:HD.rp.dialog.Text.roadTabs.sampleItinerary,5:HD.rp.dialog.Text.roadTabs.localLinks,6:HD.rp.dialog.Text.roadTabs.reportAbuse+" <span class='tabClose' onclick='HD.rp.dialog.RoadDetails.closeReportAbuse()'>&nbsp;</span>",7:HD.rp.dialog.Text.roadTabs.writeAReview+" <span class='tabClose' onclick='HD.rp.dialog.RoadDetails.closeReviewForm()'>&nbsp;</span>"},_DB_CHARS_MAPPING:{scenery:{1:["desert",HD.rp.dialog.Text.roadScenery.desert],2:["farms",HD.rp.dialog.Text.roadScenery.farmland],3:["forest",HD.rp.dialog.Text.roadScenery.forest],4:["lakes",HD.rp.dialog.Text.roadScenery.lakes],5:["mountains",HD.rp.dialog.Text.roadScenery.mountains],6:["ocean",HD.rp.dialog.Text.roadScenery.ocean],7:["plains",HD.rp.dialog.Text.roadScenery.plains],8:["river",HD.rp.dialog.Text.roadScenery.river],9:["rural",HD.rp.dialog.Text.roadScenery.rural],10:["urban",HD.rp.dialog.Text.roadScenery.urbanResidential],11:["fallcolors",HD.rp.dialog.Text.roadScenery.fallColors],12:["historicalsite",HD.rp.dialog.Text.roadScenery.historicalSites],13:["beach",HD.rp.dialog.Text.roadScenery.beaches],14:["park",HD.rp.dialog.Text.roadScenery.parks]}},_LOCAL_LINKS_CATEGORIES:[HD.rp.dialog.Text.roadLinks.adventure,HD.rp.dialog.Text.roadLinks.areaInformation,HD.rp.dialog.Text.roadLinks.associations,HD.rp.dialog.Text.roadLinks.bikersHikersPedestrians,HD.rp.dialog.Text.roadLinks.businesses,HD.rp.dialog.Text.roadLinks.bywaysAndBackways,HD.rp.dialog.Text.roadLinks.communityAndRegionInfo,HD.rp.dialog.Text.roadLinks.cultureAndTheArts,HD.rp.dialog.Text.roadLinks.events,HD.rp.dialog.Text.roadLinks.federalLands,HD.rp.dialog.Text.roadLinks.governmentInfo,HD.rp.dialog.Text.roadLinks.government,HD.rp.dialog.Text.roadLinks.historyAndHeritage,HD.rp.dialog.Text.roadLinks.maps,HD.rp.dialog.Text.roadLinks.miscellaneous,HD.rp.dialog.Text.roadLinks.motorcyclists,HD.rp.dialog.Text.roadLinks.outdoors,HD.rp.dialog.Text.roadLinks.preservationAndProtection,HD.rp.dialog.Text.roadLinks.recreation,HD.rp.dialog.Text.roadLinks.research,HD.rp.dialog.Text.roadLinks.travelAndTourism,HD.rp.dialog.Text.roadLinks.travelGuide,HD.rp.dialog.Text.roadLinks.localInfo],_IMAGE_TYPES:{THUMBNAIL:"t",FULL_PHOTO:"g"},addTab:function(E,D,C){var A=C;var B=new YAHOO.widget.Tab({label:this._TAB_HEADERS[E],content:D});B.addListener("activeChange",function(F){if(!F.prevValue&&F.newValue&&A){HD.rp.util.Hitbox.track(A,{RoadID:HD.util.rtrim(HD.rp.dialog.RoadDetails.road.data.id),Name:HD.util.rtrim(HD.rp.dialog.RoadDetails.road.data.name)})}});this.tabView.addTab(B);return B},setTabContent:function(C,B,A){var D=C.get("content");D=D.replace(B,A);C.set("content",D)},setFooterAndImage:function(B){var A=this.road;B=HD.util.template(B,{_ROAD_ID:this.road.data.id});return B},clearTabs:function(){if(this.tabView!=null){var A=0;var B=this.getTab(A);while(B!=null){B.removeListener("activeChange");B=this.getTab(++A)}}this.tabView=new YAHOO.widget.TabView()},getTab:function(A){try{return this.tabView.getTab(A)}catch(B){return null}},getImagePath:function(A){return HD.constants.PHOTO_PATH+A.directoryName+A.filename}};HD.rp.dialog.UserRoadList={savedRidesPanel:null,legacyRidesPanel:null,previewPanel:null,loading:null,legacyRides:null,rpRides:null,tabView:null,tabs:[{title:HD.rp.dialog.Text.newRidePlanner,tab:null},{title:HD.rp.dialog.Text.archivedFromOld,tab:null},{title:HD.rp.dialog.Text.ridePlanPreview,tab:null}],selectedIndex:0,isShowing:false,isInit:false,currentSort:null,currentSortOrder:null,currentPublicToggle:null,currentPrivateToggle:null,isToggleInit:false,init:function(A){if(!A){HD.rp.util.Hitbox.track("Application/Signed+In/View+Saved+Roads")}this.isShowing=false;var B=(HD.rp.User.roadCounts[HD.rp.User._COUNT_TYPE.LEGACY]>0)?true:false;if(B){HD.ui.Dialog.showLoading(HD.content.Text.loading,"700","400","loadingIndicatorWhite");this.tabs[0].tab=new YAHOO.widget.Tab({label:this.tabs[0].title,content:HD.rp.dialog.HTML.savedRoadsDialog.loading});this.tabs[1].tab=new YAHOO.widget.Tab({label:this.tabs[1].title,content:HD.rp.dialog.HTML.legacyRoadsDialog.loading});this.tabs[0].tab.addListener("activeChange",function(C){if(!C.prevValue&&C.newValue){RoadService.getUserRoads({userId:HD.User.data.id},HD.rp.dialog.Text.sortName,HD.rp.dialog.Text.sortAsc,function(D){if(D==null){HD.User.userReconnect()}else{HD.rp.dialog.UserRoadList.renderSavedRides(D)}})}});this.tabs[1].tab.addListener("activeChange",function(C){if(!C.prevValue&&C.newValue){LegacyService.getRidePlans({userId:HD.User.data.id},function(D){HD.rp.dialog.UserRoadList.renderLegacyRides(D)})}});this.tabs[2].tab=new YAHOO.widget.Tab({label:this.tabs[2].title,content:this.previewPanel});this.tabView=new YAHOO.widget.TabView();this.tabView.addTab(this.tabs[0].tab);this.tabView.addTab(this.tabs[1].tab);if(HD.rp.User.roadCounts[HD.rp.User._COUNT_TYPE.RP]>0){this.tabView.set("activeIndex",0)}else{this.tabView.set("activeIndex",1)}}else{HD.ui.Dialog.showLoading(HD.content.Text.loading,"545","354","loadingIndicatorWhite");RoadService.getUserRoads({userId:HD.User.data.id},HD.rp.dialog.Text.sortName,HD.rp.dialog.Text.sortAsc,function(C){if(C==null){HD.User.userReconnect()}else{HD.rp.dialog.UserRoadList.renderSavedRides(C)}})}this.isInit=true;this.currentSort=HD.rp.dialog.Text.sortName;this.currentSortOrder=HD.rp.dialog.Text.sortAsc;this.isToggleInit=false},show:function(){if(!this.isInit){this.isInit()}if(this.tabView){HD.ui.Dialog.show(HD.rp.dialog.Text.mySavedRidePlans,"700","420",this.tabView)}else{HD.ui.Dialog.show(HD.rp.dialog.Text.mySavedRidePlans,"545","400",this.savedRidesPanel)}this.isShowing=true},renderSavedRides:function(H){H=!!H?H.results:null;this.rpRides=H;var C=HD.util.Date;var M=HD.rp.dialog.Text;var B,G,J=null;var I=new Array();var E=!!H?H.length:0;for(var F=0;F<E;F++){var D=H[F];B=(!D.startDate)?M.noDatesPlanned:C.getVerboseDateString(D.startDate);G=(!D.endDate)?"":"- "+C.getVerboseDateString(D.endDate);if(D.dateChanged){J=M.lastUpdated+C.getVerboseDateString(D.dateChanged)}else{if(D.dateCreated){J=M.saved+C.getVerboseDateString(D.dateCreated)}else{J=""}}var A=D.access.toLowerCase();A=HD.util.rtrim(A);var K=(A=="private")?"pvtLg":"pblcLg";var L=HD.rp.dialog.HTML.savedRoadsDialog.item;L=HD.util.template(L,{_USER_ROAD_NAME:D.name,_ACCESS_ICON:K,_ROAD_ORDINAL:F+1,_START_DATE:B,_END_DATE:G,_ACCESS:A,_CC_DATE:J,_ROAD_ID:D.id});I.push(L)}this.savedRidesPanel=HD.util.template(HD.rp.dialog.HTML.savedRoadsDialog.wrapper,{_CONTENT:I.length>0?I.join(""):HD.rp.dialog.HTML.savedRoadsDialog.noRoads});if(this.tabView){this.tabs[0].tab.set("content",this.savedRidesPanel)}else{if(this.isShowing){$("hdDialogContent").innerHTML=this.savedRidesPanel}}this.updateCheckBoxes();if(!this.isShowing){this.show()}},renderLegacyRides:function(A){A=A.results;if(A==null){A=[]}this.legacyRides=A;var C=HD.util.Date;var K=HD.rp.dialog.Text;var B,G,I=null;var F=HD.rp.dialog.HTML.legacyRoadsDialog;var H="";for(var E=0;E<A.length;E++){var D=A[E];if(D.dateChanged){I=C.getVerboseDateString(D.dateChanged)}else{if(D.dateCreated){I=C.getVerboseDateString(D.dateCreated)}else{I=""}}var J=this.isConvertedRides(D.id)?F.inactiveItem:F.item;J=HD.util.template(J,{_ROAD_NAME:D.name,_ROAD_SAVED_DATE:I,_ROAD_ID:D.id});H+=J}this.legacyRidesPanel=HD.util.template(F.wrapper,{_ROWS:H});this.tabs[1].tab.set("content",this.legacyRidesPanel);if(!this.isShowing){this.show()}},isConvertedRides:function(D){var B=this.rpRides;if(B==null||D==null){return false}for(var C=0,A=B.length;C<A;C++){if(B[C].mappedRouteId==D){return true}}return false},moveRoads:function(B){if(!B){return }var A=HD.util.isArray(B)?B:[B];this.tabs[0].tab.set("content",HD.rp.dialog.HTML.savedRoadsDialog.loading);this.tabs[1].tab.set("content",HD.rp.dialog.HTML.legacyRoadsDialog.loading);LegacyService.moveRidePlans({userId:HD.User.data.id,roadIds:A},function(C){HD.rp.dialog.UserRoadList.updateLegacyRides(C)});HD.rp.util.Hitbox.track("Application/Signed+In/View+Saved+Roads/Convert+Old+Road")},updateLegacyRides:function(A){this.renderLegacyRides(A);HD.rp.User.roadCounts=A.counts;this.tabView.set("activeIndex",0);return },togglePublic:function(B){if(B.blur){B.blur()}var A=$("savedRoadsList");if(B.checked){YAHOO.util.Dom.removeClass(A,"noPublic");this.currentPublicToggle=true}else{YAHOO.util.Dom.addClass(A,"noPublic");this.currentPublicToggle=false}},togglePrivate:function(B){if(B.blur){B.blur()}var A=$("savedRoadsList");if(B.checked){YAHOO.util.Dom.removeClass(A,"noPrivate");this.currentPrivateToggle=true}else{YAHOO.util.Dom.addClass(A,"noPrivate");this.currentPrivateToggle=false}},toggleLegacyCheckboxes:function(C){if(C.blur){C.blur()}var D=$("legacyListTable").getElementsByTagName("input");var B=true;for(var A=0;A<D.length;A++){if(!D[A].checked){B=false}}for(A=0;A<D.length;A++){if(!B){D[A].checked=true}else{D[A].checked=false}this.toggleLegacyRow(D[A])}},toggleLegacyRow:function(A){if(A.blur){A.blur()}if(A.checked){A.parentNode.parentNode.className="s"}else{A.parentNode.parentNode.className=""}},deleteUserRoad:function(B){var A=this;RoadService.deleteRoad({road:{id:B}},function(C){if(C==null){HD.User.userReconnect()}else{A.handleDeleteUserRoad.call(A,C)}});HD.rp.util.Hitbox.track("Application/Signed+In/View+Saved+Roads/Delete+Road")},handleDeleteUserRoad:function(){HD.rp.WelcomeBox.setMessage();this.init(true);RoadService.getUserRoads({userId:HD.User.data.id},HD.rp.dialog.Text.sortName,HD.rp.dialog.Text.sortAsc,function(A){if(A==null){HD.User.userReconnect()}else{HD.rp.dialog.UserRoadList.renderSavedRides(A)}})},sortRoads:function(A){if(this.currentSort==A){if(this.currentSortOrder==HD.rp.dialog.Text.sortAsc){RoadService.getUserRoads({userId:HD.User.data.id},A,HD.rp.dialog.Text.sortDesc,function(B){if(B==null){HD.User.userReconnect()}else{HD.rp.dialog.UserRoadList.renderSavedRides(B)}});this.currentSort=A;this.currentSortOrder=HD.rp.dialog.Text.sortDesc}else{RoadService.getUserRoads({userId:HD.User.data.id},A,HD.rp.dialog.Text.sortAsc,function(B){if(B==null){HD.User.userReconnect()}else{HD.rp.dialog.UserRoadList.renderSavedRides(B)}});this.currentSort=A;this.currentSortOrder=HD.rp.dialog.Text.sortAsc}}else{RoadService.getUserRoads({userId:HD.User.data.id},A,HD.rp.dialog.Text.sortAsc,function(B){if(B==null){HD.User.userReconnect()}else{HD.rp.dialog.UserRoadList.renderSavedRides(B)}});this.currentSort=A;this.currentSortOrder=HD.rp.dialog.Text.sortAsc}},updateCheckBoxes:function(){if(this.isToggleInit){var A=$("savedRoadsList");if((this.currentPublicToggle==true)&&(this.currentPrivateToggle==true)){YAHOO.util.Dom.removeClass(A,"noPublic");YAHOO.util.Dom.removeClass(A,"noPrivate");$("displayPublic").checked=true;$("displayPrivate").checked=true}else{if((this.currentPublicToggle==true)&&(this.currentPrivateToggle==false)){YAHOO.util.Dom.removeClass(A,"noPublic");YAHOO.util.Dom.addClass(A,"noPrivate");$("displayPublic").checked=true;$("displayPrivate").checked=false}else{if((this.currentPublicToggle==false)&&(this.currentPrivateToggle==true)){YAHOO.util.Dom.addClass(A,"noPublic");YAHOO.util.Dom.removeClass(A,"noPrivate");$("displayPublic").checked=false;$("displayPrivate").checked=true}else{YAHOO.util.Dom.addClass(A,"noPublic");YAHOO.util.Dom.addClass(A,"noPrivate");$("displayPublic").checked=false;$("displayPrivate").checked=false}}}}else{this.currentPublicToggle=true;this.currentPrivateToggle=true;this.isToggleInit=true}}};HD.rp.dialog.SendDialog={loading:null,show:function(D){if(!D){return }HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Email/Form"));var C=HD.rp.dialog.HTML.sendDialog.code;D=D||"";var A=HD.User.data.fullName||"";var B=HD.User.data.email||"";C=HD.util.template(C,{_SENDER_NAME:A,_SENDER_EMAIL:B,_RECIPIENT_EMAIL:"",_RECIPIENT_MESSAGE:"",_ROAD_ID:D});HD.ui.Dialog.show(HD.rp.dialog.Text.sendARide,"500","300",C)},sendRoad:function(D){this.loading=new HD.ui.LoadingIndicator("hdDialogContent",HD.rp.dialog.Text.sending+" ...");var B=HD.util.FormUtil.getValues($("sendRoadForm"));B.recipientEmails=B.recipientEmails.replace(/\s*;\s*/g,",");B.recipientEmails=B.recipientEmails.replace(/\s*\n\s*/g,",");B.recipientEmails=B.recipientEmails.replace(/\s*\r\s*/g,",");if(B.recipientEmails!=null&&B.recipientEmails!=""){B.recipientEmails=B.recipientEmails.split(/\s*,\s*/)}B.subject=HD.util.template(HD.rp.HTML.sendRoadSubject,{_RECIPIENT:HD.User.data.fullName});var A={name:"rp_EmailRoadSubmission",page:"1",emailDoc:B,id:D};var C=this;EmailService.sendRoad(A,function(E){C.handleSendRoad.call(C,E,B)})},handleSendRoad:function(D,G){this.loading.remove();if(!D.valid){HD.util.FormUtil.markErrors(D.errors,$("sendRoadForm"),$("dlgSendMessage"),"formError")}else{if(D.success==false){}var C=0;for(var E=0;E<G.recipientEmails.length;E++){if(G.recipientEmails[E].toLowerCase()==G.senderEmail.toLowerCase()){C++}}HD.rp.util.Hitbox.track(HD.rp.MyRide.hbx.select("Email/Confirm/Recipients-SelfSends"),{Recipients:G.recipientEmails.length,SelfSends:C});var B=G.recipientEmails;var I=B.length;var F=HD.rp.HTML.sendRoadRecipient;var H=[];for(var A=0;A<I;++A){H.push(HD.util.template(HD.rp.HTML.sendRoadRecipient,{_RECIPIENT:HD.util.convertToJSSafeHTMLString(B[A])}))}H=HD.util.template(HD.rp.HTML.sendRoadSuccess,{_RECIPIENTS:H.join("")});$("sendDialogWrapper").innerHTML=H}}};HD.rp.dialog.GPS={loading:null,hasGarminPlugin:false,pastInit:false,route:null,hbx:HD.rp.util.Hitbox.select("Application/GPS"),show:function(A){this.hasGarminPlugin=HD.road.GPX.init(this);this.pastInit=false;HD.ui.Dialog.show(HD.rp.dialog.Text.gps.title,454,324,HD.rp.dialog.HTML.gpsDialog.code);$("gpsManualUploadForm").appendChild(HD.road.GPX.upload());if(!!A){this.detectDevices()}else{HD.rp.util.Hitbox.track(this.hbx)}},switchTab:function(A,B){if(B&&B.blur){B.blur()}this.action();$("gpsDialog").className=A;var D=YAHOO.util.Dom;if(A=="auto"){var C=$("gpsDeviceList");C.style.width=(C.parentNode.offsetWidth-C.nextSibling.offsetWidth-8)+"px";D.replaceClass($("gpsAutoImportBtn"),$("gpsDeviceList").options.length==0?"btn":"btnDisabled",$("gpsDeviceList").options.length==0?"btnDisabled":"btn")}else{if(A=="manual"){$("gpxUploadForm").innerHTML=$("gpxUploadForm").innerHTML}}},getDevice:function(){var A=$("gpsDeviceList");return A.selectedIndex>-1?{name:A.options[A.selectedIndex].text,number:parseInt(A.options[A.selectedIndex].value,10)}:{name:"",number:-1}},getRoute:function(){var A=$("gpsRouteList");return A.selectedIndex>-1?{name:A.options[A.selectedIndex].text,id:parseInt(A.options[A.selectedIndex].value,10)}:{name:"",id:-1}},exportError:function(){if(YAHOO.util.Dom.hasClass($("gpsBusyContent"),"autoExport")){this.action("autoExportError")}else{if(YAHOO.util.Dom.hasClass($("gpsDialog"),"manual")){this.action("manualExportError")}}},importError:function(){if(YAHOO.util.Dom.hasClass($("gpsBusyContent"),"autoImportRouteLoad")){this.action("autoImportError")}else{if(YAHOO.util.Dom.hasClass($("gpsBusyContent"),"manualImportLoad")||YAHOO.util.Dom.hasClass($("gpsBusyContent"),"manualImportRouteLoad")){this.action("manualImportError")}}},importComplete:function(){if(YAHOO.util.Dom.hasClass($("gpsBusyContent"),"autoImportRouteLoad")){this.action("autoImportComplete",{_NAME:this.route.name||this.route.data.name||""});HD.rp.util.Hitbox.track(this.hbx.select("Import/Automatic/RoadID+Name"),{RoadID:HD.util.rtrim(!!this.route.data?this.route.data.id:""),Name:HD.util.rtrim(!!this.route.data?this.route.data.name:"")})}else{if(YAHOO.util.Dom.hasClass($("gpsBusyContent"),"manualImportRouteLoad")){this.action("manualImportComplete",{_NAME:this.route.name||this.route.data.name||""});HD.rp.util.Hitbox.track(this.hbx.select("Import/Manual/RoadID+Name"),{RoadID:HD.util.rtrim(!!this.route.data?this.route.data.id:""),Name:HD.util.rtrim(!!this.route.data?this.route.data.name:"")})}}},action:function(B,A){if(!!B){YAHOO.util.Dom.addClass($("gpsDialog"),"busy");$("gpsBusyContent").innerHTML=HD.util.template(HD.rp.dialog.HTML.gpsDialog.actions[B]||"",A||{});$("gpsBusyContent").className="gpsContent "+B;if(!!this.loading){this.loading.remove()}if(!!$("gpsLoading")){this.loading=new HD.ui.LoadingIndicator($("gpsLoading")," ","loadingIndicatorWhite",{noPosition:true})}else{$("gpsBusyContent").className+=" noLoading"}}else{$("gpsBusyContent").innerHTML="";$("gpsBusyContent").className="gpsContent"}},cancel:function(){var B=YAHOO.util.Dom;var A=$("gpsBusyContent");if(B.hasClass(A,"detectDevices")||B.hasClass(A,"noDevices")||B.hasClass(A,"noPlugin")){HD.road.GPX.cancelFindDevices();this.pastInit=false;this.switchTab("init")}else{if(B.hasClass(A,"readDevice")){HD.road.GPX.cancelReadFromDevice();this.switchTab("auto")}else{if(B.hasClass(A,"autoExportRoute")){HD.road.GPX.cancelWriteToDevice();this.switchTab("auto")}else{if(B.hasClass(A,"autoImportRoute")||B.hasClass(A,"autoImportNoRoutes")||B.hasClass(A,"autoImportError")||B.hasClass(A,"autoExport")||B.hasClass(A,"autoExportError")||B.hasClass(A,"autoImportComplete")||B.hasClass(A,"autoExportComplete")){this.switchTab("auto")}else{if(B.hasClass(A,"autoImportRouteLoad")){HD.road.GPX.cancelImport=true;this.switchTab("auto")}else{if(B.hasClass(A,"autoExportReadDevice")){HD.road.GPX.cancelReadFromDevice();this.autoExport()}else{if(B.hasClass(A,"autoExportRouteList")||B.hasClass(A,"autoExportNoRoutes")){this.autoExport()}else{if(B.hasClass(A,"manualImportLoad")||B.hasClass(A,"manualImportRouteLoad")||B.hasClass(A,"manualImportRouteList")||B.hasClass(A,"manualImportError")||B.hasClass(A,"manualImportComplete")||B.hasClass(A,"manualExport")||B.hasClass(A,"manualExportError")||B.hasClass(A,"manualImportNoRoutes")){this.switchTab("manual")}}}}}}}}},close:function(){HD.ui.Dialog.hide()},detectDevices:function(){if(!!this.hasGarminPlugin){this.pastInit=true;this.switchTab("auto");this.action("detectDevices");HD.road.GPX.findDevices();HD.rp.util.Hitbox.track(this.hbx.select("Detect+Devices"))}else{this.pastInit=true;this.switchTab("auto");this.action("noPlugin");this.pastInit=false}},autoExport:function(B){var A=$("gpsDeviceList").options.length;var C=YAHOO.util.Dom;if(A>0){this.route=HD.rp.MyRide.route;if(!!this.route&&this.route.stopList.getStopCount()>0){this.action("autoExport",{_NAME:B||this.route.name||this.route.data.name||HD.rp.dialog.Text.defaultRideName})}else{$("gpsAutoTips").innerHTML='<p><span><font color="red"> '+HD.rp.dialog.Text.gps.autoTipError.title+"</span>"+HD.rp.dialog.Text.gps.autoTipError.message+"</font></p>";C.replaceClass($("gpsAutoExportBtn"),"btn","btnDisabled")}}},autoExportWrite:function(){this.route=HD.rp.MyRide.route;this.route.data.name=$("gpsRouteName").value||HD.rp.dialog.Text.defaultRideName;this.action("autoExportRoute",{_NAME:this.route.data.name||""});HD.road.GPX.exportRoute(this.getDevice().number,this.route)},autoExportRoute:function(){var A=this.getRoute();this.autoExport(A.name)},autoExportRead:function(){this.action("autoExportReadDevice");HD.road.GPX.readDevice(this.getDevice().number)},autoImport:function(){var A=$("gpsDeviceList").options.length;if(A>0){this.action("readDevice");HD.road.GPX.readDevice(this.getDevice().number)}},autoImportRoute:function(){this.route=this.getRoute();this.action("autoImportRouteLoad",{_NAME:this.route.name});HD.road.GPX.importRoute(this.route.id)},manualMode:function(){this.pastInit=true;this.switchTab("manual")},manualExport:function(){this.route=HD.rp.MyRide.route;var A=YAHOO.util.Dom;if(!!this.route&&this.route.stopList.getStopCount()>0){this.action("manualExport",{_NAME:name||this.route.name||this.route.data.name||HD.rp.dialog.Text.defaultRideName})}else{$("gpsDisclaimer").innerHTML='<font color="red"><b>'+HD.rp.dialog.Text.gps.autoTipError.title+" </b> "+HD.rp.dialog.Text.gps.autoTipError.message+"</font>";A.replaceClass($("gpsManualExportBtn"),"btn","btnDisabled")}},manualExportWrite:function(){this.route=HD.rp.MyRide.route;this.route.data.name=$("gpsRouteName").value||HD.rp.dialog.Text.defaultRideName;HD.road.GPX.download(this.route);this.switchTab("manual")},download:function(C){var A=$("gpsManualDownload").getElementsByTagName("form");for(var B=A.length-1;B>=0;B--){A[B].parentNode.removeChild(A[B])}$("gpsManualDownload").appendChild(C);setTimeout(function(){$("gpxDownloadForm").submit()},25);HD.rp.util.Hitbox.track(this.hbx.select("Export/Manual/RoadID+Name"),{RoadID:HD.util.rtrim(!!this.route.data?this.route.data.id:""),Name:HD.util.rtrim(!!this.route.data?this.route.data.name:"")})},manualImport:function(){this.action("manualImportLoad");YAHOO.util.Connect.setForm("gpxUploadForm",true);YAHOO.util.Connect.asyncRequest("POST","ridePlannerGPX.jsp",{upload:function(A){HD.road.GPX.upload(A.responseXML)}})},upload:function(A){if(A.length>0){this.action("manualImportRouteList");this.uploadFormCache=null;var C=$("gpsRouteList");C.options.length=0;for(var B=0;B<A.length;B++){C.options[B]=new Option(A[B].name||(HD.rp.dialog.Text.defaultRideName+" "+(B+1)),A[B].id)}}else{this.action("manualImportNoRoutes")}},manualImportRoute:function(A){this.route=this.getRoute();this.action("manualImportRouteLoad",{_NAME:this.route.name});HD.road.GPX.importRoute(this.route.id)},onStartFindDevices:function(A){},onFinishFindDevices:function(B,A){var F=YAHOO.util.Dom;if(F.hasClass($("gpsBusyContent"),"detectDevices")){if(A.length>0){var D=$("gpsDeviceList");D.options.length=0;for(var C=0;C<A.length;C++){D.options[C]=new Option(A[C].name,A[C].number)}F.replaceClass($("gpsAutoExportBtn"),"btnDisabled","btn");F.replaceClass($("gpsAutoImportBtn"),"btnDisabled","btn");this.switchTab("auto")}else{var E=$("gpsDeviceList");E.options.length=0;F.replaceClass($("gpsAutoExportBtn"),"btn","btnDisabled");F.replaceClass($("gpsAutoImportBtn"),"btn","btnDisabled");this.action("noDevices")}}},onStartWriteToDevice:function(A){},onFinishWriteToDevice:function(A){this.action("autoExportComplete",{_NAME:this.route.name||this.route.data.name||""});HD.rp.util.Hitbox.track(this.hbx.select("Export/Automatic/RoadID+Name"),{RoadID:HD.util.rtrim(!!this.route.data?this.route.data.id:""),Name:HD.util.rtrim(!!this.route.data?this.route.data.name:"")})},onStartReadFromDevice:function(A){},onFinishReadFromDevice:function(B,A){if(A.length>0){if(YAHOO.util.Dom.hasClass($("gpsBusyContent"),"readDevice")){this.action("autoImportRoute")}else{if(YAHOO.util.Dom.hasClass($("gpsBusyContent"),"autoExportReadDevice")){this.action("autoExportRouteList")}}var D=$("gpsRouteList");D.options.length=0;for(var C=0;C<A.length;C++){D.options[C]=new Option(A[C].name,A[C].id)}}else{if(YAHOO.util.Dom.hasClass($("gpsBusyContent"),"readDevice")){this.action("autoImportNoRoutes")}else{if(YAHOO.util.Dom.hasClass($("gpsBusyContent"),"autoExportReadDevice")){this.action("autoExportNoRoutes")}}}}};HD.rp.dialog.WelcomeDialog={initializeAndShow:function(A){ScrapeService.getPage({urlString:HD.rp.URL.welcomePage},function(B){HD.rp.dialog.WelcomeDialog.handleGetPage(B)})},handleGetPage:function(A){HD.rp.dialog.HTML.welcomeDialog.code=A;if(!(USER_AGENT.indexOf("spoof")!=-1)){HD.rp.dialog.WelcomeDialog.show()}},handleHead:function(A){HD.rp.cookie.skipWelcomeMessage=A.getResponseHeader.mrddate.substring(0,A.getResponseHeader.mrddate.length-1);if(!HD.util.Cookie.get(HD.rp.cookie.skipWelcomeMessage)){YAHOO.util.Connect.asyncRequest("GET",RP_PATH+"/servlet/XDomain?targetUrl="+HD.rp.URL.welcomePage+"?locale=en_US",{success:function(B){HD.rp.dialog.WelcomeDialog.handleGetPage(B.responseText)}})}else{}},handleHeadFailed:function(A){},show:function(){HD.ui.Dialog.show(HD.rp.dialog.Text.welcomeMessage.title,"480","175",HD.rp.dialog.HTML.welcomeDialog.code,null,{right:20,bottom:20},false,"hidden");var A=function(){if(HD.ui.Dialog.hdDialog.header.innerHTML==HD.rp.dialog.Text.welcomeMessage.title){if(HD.util.Cookie.get(HD.rp.cookie.skipWelcomeMessage)==null){HD.util.Cookie.set(HD.rp.cookie.skipWelcomeMessage,"yes")}}HD.ui.Dialog.events.beforeHide.event.unsubscribe(A)};HD.ui.Dialog.events.beforeHide.event.subscribe(A)}};HD.rp.Print={isOn:false,isImageSwapDone:false,loading:null,staticMaps:{overview:"overviewMap",start:"startMap",end:"endMap",fullsize:"fullSizeMap"},staticMapsCompleted:{},init:function(A,C){this.isOn=true;this.road=A;this.map=C;this.isImageSwapDone=false;$("rpHtml").style.overflow="auto";HD.util.PageResizeHandler.handlePageResize();this.initPageElements();this.initRoadData();if(A.type==HD.road.constants._STOP_TYPES.GREAT_ROAD){this.buildGreatRoad(A)}else{if(A.type==HD.road.constants._STOP_TYPES.USER_ROAD){this.buildUserRoad(A)}else{if(A.type==HD.road.constants._STOP_TYPES.MY_RIDE){this.buildMyRide(A)}}}var D=this.staticMaps;for(var B in D){D[B]=$(D[B]);this.staticMapsCompleted[B]=false}if(HD.rp.EventPanel.isOn){this.setEventFields(true)}this.getStaticImages(A,HD.rp.DealerPanel.isOn,HD.rp.HotelPanel.isOn,HD.rp.EventPanel.isOn,HD.rp.FuelPanel.isOn)},initPageElements:function(){this.printWrapperEl=$(HD.rp.Print.HTML.ids.printWrapper);this.printMaskEl=$(HD.rp.Print.HTML.ids.printMask);this.printWrapperEl.innerHTML=HD.rp.Print.HTML.printBase;YAHOO.util.Dom.addClass(document.body,"print");HD.util.setVisible(this.printWrapperEl);HD.util.setVisible(this.printMaskEl);this.exitPrintButton=$(HD.rp.Print.HTML.ids.exitPrint);this.hdDealersCheck1=$(HD.rp.Print.HTML.ids.checkHDDealers1);this.bwHotelsCheck1=$(HD.rp.Print.HTML.ids.checkBWHotels1);this.fuelsCheck1=$(HD.rp.Print.HTML.ids.checkFuel1);this.eventsCheck1=$(HD.rp.Print.HTML.ids.checkEvents1);this.greatRoadsChecks1=$(HD.rp.Print.HTML.ids.greatRoadsChecks1);this.printButton1=$(HD.rp.Print.HTML.ids.printButton1);this.refreshButton1=$(HD.rp.Print.HTML.ids.refreshButton1);this.refreshWrapper=$(HD.rp.Print.HTML.ids.refreshWrapper);this.mapsWrapper=$(HD.rp.Print.HTML.ids.mapsWrapper);this.directionsWrapper=$(HD.rp.Print.HTML.ids.directionsWrapper);this.placesWrapper=$(HD.rp.Print.HTML.ids.placesWrapper);this.linksWrapper=$(HD.rp.Print.HTML.ids.linksWrapper);this.reviewsWrapper=$(HD.rp.Print.HTML.ids.reviewsWrapper);this.checkMaps1=$(HD.rp.Print.HTML.ids.checkMaps1);this.checkFullSizeMapOn=$(HD.rp.Print.HTML.ids.checkFullSizeMapOn);this.checkDirections1=$(HD.rp.Print.HTML.ids.checkDirections1);this.checkRideSummary=$(HD.rp.Print.HTML.ids.checkRideSummary);this.checkRoadDescription=$(HD.rp.Print.HTML.ids.checkRoadDescription);this.checkPlacesToVisit1=$(HD.rp.Print.HTML.ids.checkPlacesToVisit1);this.checkLocalLinks1=$(HD.rp.Print.HTML.ids.checkLocalLinks1);this.checkReviews1=$(HD.rp.Print.HTML.ids.checkReviews1);this.roadDescription=$(HD.rp.Print.HTML.ids.roadDescription);this.startEntry=$(HD.rp.Print.HTML.ids.printEventsStartDate);this.startToggle=$(HD.rp.Print.HTML.ids.printEventsStartToggle);this.endEntry=$(HD.rp.Print.HTML.ids.printEventsEndDate);this.endToggle=$(HD.rp.Print.HTML.ids.printEventsEndToggle);this.smallFont=$(HD.rp.Print.HTML.ids.smallFont);this.mediumFont=$(HD.rp.Print.HTML.ids.mediumFont);this.largeFont=$(HD.rp.Print.HTML.ids.largeFont);this.printLoadingIndicator=$(HD.rp.Print.HTML.ids.printLoadingIndicator);this.printLoadingBg=$(HD.rp.Print.HTML.ids.printLoadingBg);this.poisDealersRadius=$(HD.rp.Print.HTML.ids.poisDealersRadius);this.poisHotelsRadius=$(HD.rp.Print.HTML.ids.poisHotelsRadius);this.poisFuelsRadius=$(HD.rp.Print.HTML.ids.poisFuelsRadius);this.poisEventsRadius=$(HD.rp.Print.HTML.ids.poisEventsRadius);var B=this.road;var A=this;var D=YAHOO.util.Event;D.addListener(this.refreshButton1,"click",function(){A.refreshMaps()});D.addListener(this.poisDealersRadius,"change",function(){A.refreshMaps()});D.addListener(this.poisHotelsRadius,"change",function(){A.refreshMaps()});D.addListener(this.poisEventsRadius,"change",function(){A.refreshMaps()});D.addListener(this.poisFuelsRadius,"change",function(){A.refreshMaps()});D.addListener(this.printButton1,"click",function(){A.executePrint()});D.addListener(this.exitPrintButton,"click",function(){A.exitPrint()});D.addListener(this.hdDealersCheck1,"click",function(){A.togglePOIs(HD.rp.constants._POI_TYPES.DEALER,this)});D.addListener(this.bwHotelsCheck1,"click",function(){A.togglePOIs(HD.rp.constants._POI_TYPES.HOTEL,this)});D.addListener(this.fuelsCheck1,"click",function(){A.togglePOIs(HD.rp.constants._POI_TYPES.FUEL,this)});D.addListener(this.eventsCheck1,"click",function(){A.setEventFields(this.checked);A.togglePOIs(HD.rp.constants._POI_TYPES.EVENT,this)});D.addListener(this.checkFullSizeMapOn,"click",function(){if(this.checked){A.showFullSizeMap()}else{A.showOverviewMap()}});D.addListener(this.checkRoadDescription,"change",function(){HD.util.hideShowSection(A.checkRoadDescription.checked,A.HTML.ids.roadDescription)});D.addListener(this.checkMaps1,"change",function(){HD.util.hideShowSection(A.checkMaps1.checked,A.HTML.ids.mapsWrapper)});D.addListener(this.checkDirections1,"change",function(){HD.rp.Print.populateDirections(B,null,A.checkDirections1.checked)});D.addListener(this.checkRideSummary,"change",function(){HD.util.hideShowSection(A.checkRideSummary.checked,A.HTML.ids.rideSummary)});D.addListener(this.checkPlacesToVisit1,"change",function(){HD.util.hideShowSection(A.checkPlacesToVisit1.checked,A.HTML.ids.placesWrapper)});D.addListener(this.checkLocalLinks1,"change",function(){HD.util.hideShowSection(A.checkLocalLinks1.checked,A.HTML.ids.linksWrapper)});D.addListener(this.checkReviews1,"change",function(){HD.util.hideShowSection(A.checkReviews1.checked,A.HTML.ids.reviewsWrapper)});D.addListener(this.smallFont,"click",function(){A.setFont(this)});D.addListener(this.mediumFont,"click",function(){A.setFont(this)});D.addListener(this.largeFont,"click",function(){A.setFont(this)});D.addListener(this.poisDealersRadius,"change",function(){A.showRefreshDialog.call(A,true)});D.addListener(this.poisHotelsRadius,"change",function(){A.showRefreshDialog.call(A,true)});D.addListener(this.poisFuelsRadius,"change",function(){A.showRefreshDialog.call(A,true)});D.addListener(this.poisEventsRadius,"change",function(){A.showRefreshDialog.call(A,true)});document.onkeydown=function(E){return A.handleKeyboardEvent.call(A,E)};document.onkeyup=function(E){return A.handleKeyboardEvent.call(A,E)};var C=new Date();this.dateRange=new HD.ui.DateRangeSelector({selected_start:HD.util.Date.formatDate(new Date(C.getFullYear(),C.getMonth(),C.getDate())),selected_end:HD.util.Date.formatDate(new Date(C.getFullYear(),C.getMonth()+1,C.getDate()))});this.dateRange.events.change.subscribe(function(){A.setEventFields(A.eventsCheck1.checked);A.togglePOIs(HD.rp.constants._POI_TYPES.EVENT,A.eventsCheck1)});this.dateRange.start.handles.entry.id=this.startEntry.id;this.dateRange.start.handles.toggle.id=this.startToggle.id;this.startEntry.parentNode.replaceChild(this.dateRange.start.handles.entry,this.startEntry);this.startToggle.parentNode.replaceChild(this.dateRange.start.handles.toggle,this.startToggle);this.dateRange.end.handles.entry.id=this.endEntry.id;this.dateRange.end.handles.toggle.id=this.endToggle.id;this.endEntry.parentNode.replaceChild(this.dateRange.end.handles.entry,this.endEntry);this.endToggle.parentNode.replaceChild(this.dateRange.end.handles.toggle,this.endToggle);this.setFont(this.mediumFont)},initRoadData:function(){var C=this;var B={};var A=HD.rp.service.RoadDataTypes;B[A._PLACES._YES_DATA]=function(D,F,E){C.populatePlaces.call(C,D,F,E)};B[A._PLACES._NO_DATA]=function(D){C.populateNoPlaces.call(C)};B[A._LINKS._YES_DATA]=function(D,F,E){C.populateLinks.call(C,D,F,E)};B[A._LINKS._NO_DATA]=function(D){C.populateNoLinks.call(C)};B[A._REVIEWS._YES_DATA]=function(D,F,E){C.populateReviews.call(C,F,E)};B[A._REVIEWS._NO_DATA]=function(D){C.populateNoReviews.call(C)};this.roadData=new HD.rp.service.RoadData(B)},showLoading:function(){this.printLoadingBg.style.display="block";if(HD.util.isIE){var A=this.printLoadingBg.style;A.left="-10px";A.height=$(HD.rp.Print.HTML.ids.printContentTools).offsetHeight+"px";A.width=$(HD.rp.Print.HTML.ids.printContentTools).offsetWidth+"px"}this.loading=new HD.ui.LoadingIndicator(HD.rp.Print.HTML.ids.printContentTools)},hideLoading:function(){this.printLoadingBg.style.display="none";if(this.loading){this.loading.remove()}this.loading=null},setFont:function(A){if(A==this.selectedFont){return }if(this.selectedFont!=null){YAHOO.util.Dom.removeClass(this.selectedFont,HD.rp.Print.HTML.classes.selected)}YAHOO.util.Dom.addClass(A,HD.rp.Print.HTML.classes.selected);this.selectedFont=A;$(HD.rp.Print.HTML.ids.printWrapper).className=A.id},handleKeyboardEvent:function(A){var B=A||window.event;if(!B.ctrlKey){return }if(String.fromCharCode(B.keyCode).toLowerCase()=="p"){B.cancelBubble=true;this.executePrint();return false}},buildGreatRoad:function(A){this.populateRideSummary(A);this.populateOverview(A);this.populateDirections(A);this.setupMaps(A);this.roadData.getData(A,HD.rp.service.RoadDataTypes._PLACES,HD.rp.constants._NO_PAGING_INDEX);this.roadData.getData(A,HD.rp.service.RoadDataTypes._LINKS,HD.rp.constants._NO_PAGING_INDEX);this.roadData.getData(A,HD.rp.service.RoadDataTypes._REVIEWS,HD.rp.constants._NO_PAGING_INDEX)},buildUserRoad:function(A){this.populateRideSummary(A);this.populateOverview(A);this.populateDirections(A);this.setupMaps(A);this.populateNoPlaces();this.populateNoLinks();this.populateNoReviews();HD.util.setInvisible(this.greatRoadsChecks1)},buildMyRide:function(A){this.populateRideSummary(A);this.populateOverview(A);this.populateDirections(A);this.setupMaps(A);this.populateNoPlaces();this.populateNoLinks();this.populateNoReviews();HD.util.setInvisible(this.greatRoadsChecks1)},togglePOIs:function(A,B){this.refreshWrapper.style.display="block"},showRefreshDialog:function(A){this.refreshWrapper.style.display=A?"block":"none"},refreshMaps:function(){this.getStaticImages(this.road,this.hdDealersCheck1.checked,this.bwHotelsCheck1.checked,this.eventsCheck1.checked,this.fuelsCheck1.checked)},setEventFields:function(A){if(A){HD.util.setVisible(HD.rp.Print.HTML.ids.eventDateRow1);HD.util.setVisible(HD.rp.Print.HTML.ids.eventDateRow2)}else{HD.util.setInvisible(HD.rp.Print.HTML.ids.eventDateRow1);HD.util.setInvisible(HD.rp.Print.HTML.ids.eventDateRow2)}},showFullSizeMap:function(){this.checkFullSizeMapOn.checked=true;HD.util.hideShowSection(true,this.fullSizeMapWrapper);HD.util.hideShowSection(false,this.overviewMapWrapper)},showOverviewMap:function(){this.checkFullSizeMapOn.checked=false;HD.util.hideShowSection(true,this.overviewMapWrapper);HD.util.hideShowSection(false,this.fullSizeMapWrapper)},getStaticImages:function(A,C,F,D,B){var E=new Array();E.push(this.createMapRequest(this.staticMaps.fullsize.id,778,500,A.getStart(),0,true,false));E.push(this.createMapRequest(this.staticMaps.overview.id,280,200,A.getStart(),0,false,false));E.push(this.createMapRequest(this.staticMaps.start.id,280,200,A.getStart(),19,false,true));E.push(this.createMapRequest(this.staticMaps.end.id,280,200,A.getEnd(),19,false,true));this.requestMap(E,A,C,F,D,B)},createMapRequest:function(G,D,B,F,E,A,C){return{id:G,width:D,height:B,centerPoint:{latitude:F.latitude,longitude:F.longitude},zoomLevel:E,pinClustering:A,viewByScale:C}},mergeArrays:function(D,C){if(D==null||C==null){return }for(var B=0,A=C.length;B<A;B++){D.push(C[B])}},requestMap:function(M,H,S,J,Q,I){if(M==null){return }this.showLoading();var T=[];var G=[];var O=HD.rp.constants._POI_TYPES;var F=HD.rp.constants._CORRIDOR_WIDTH;if(S){this.hdDealersCheck1.checked=true;T.push(O.DEALER);G.push(this.poisDealersRadius.value)}if(J){this.bwHotelsCheck1.checked=true;T.push(O.HOTEL);G.push(this.poisHotelsRadius.value);var E={pageNumber:1,pageSize:50,unit:"MI"}}if(I){this.fuelsCheck1.checked=true;T.push(O.FUEL);G.push(this.poisFuelsRadius.value)}if(Q){this.eventsCheck1.checked=true;T.push(O.EVENT);G.push(this.poisEventsRadius.value);var D=HD.util.Date.parseDate($("events-startDate").value);var P=HD.util.Date.parseDate($("events-endDate").value);this.setEventFields(true);this.dateRange.start.handles.entry.value=$("events-startDate").value;this.dateRange.end.handles.entry.value=$("events-endDate").value;var K={dealer:$("eventsTypesDealer"),h_d:$("eventsTypesH-D"),hog:$("eventsTypesHOG")};var L=[];for(var U in K){if(K[U].checked){L.push(HD.rp.constants._HD_EVENT_TYPES[U.toUpperCase()])}}var B={type:L.join(","),startDate:D,endDate:P,pageNumber:1,pageSize:50,unit:"MI",grouping:$("events-grouping").value}}HD.rp.MapController.showAllPins();var C=this.map.getMapView();var A={eventsRequest:B,hotelsRequest:E,poiTypes:T,corridorWidths:G,stops:HD.road.DWR.routeToWKTString(H,1),boundingPoint1:HD.DWR.formatVELatLong(C.TopLeftLatLong),boundingPoint2:HD.DWR.formatVELatLong(C.BottomRightLatLong)};var N=this;HD.rp.service.MapImage.requestMap(M,H,A,function(V){var Z=V.mapUrls;for(var Y in Z){N.swapMapImage.call(N,Y,Z[Y])}N.clearAllPOIs.call(N);var X=V.entityData;for(var W in X){N.populatePOIs.call(N,X[W],W)}N.hideLoading.call(N);N.refreshWrapper.style.display="none"})},swapMapImage:function(D,C){var F=this;var B=$(D);var E=D;B.innerHTML="<img src='"+C+"'></img>";var A=B.getElementsByTagName("img")[0];A.onload=function(){F.staticMapsCompleted[E]=true}},exitPrint:function(){this.isImageSwapDone=false;this.printWrapperEl.innerHTML="";HD.util.setInvisible(this.printWrapperEl);HD.util.setInvisible(this.printMaskEl);YAHOO.util.Dom.removeClass(document.body,"print");$("rpHtml").style.overflow="hidden";HD.util.PageResizeHandler.handlePageResize();this.isOn=false},disableCheckBoxes:function(){this.hdDealersCheck1.disabled=true;this.bwHotelsCheck1.disabled=true;this.eventsCheck1.disabled=true;this.checkFullSizeMapOn.disabled=true;this.checkRoadDescription.disabled=true;this.checkMaps1.disabled=true;this.checkDirections1.disabled=true;this.checkRideSummary.disabled=true;this.checkPlacesToVisit1.disabled=true;this.checkLocalLinks1.disabled=true;this.checkReviews1.disabled=true},executePrint:function(){var B=function(C){C=$(C);return !C||!!C.disabled?"X":(!!C.checked?"Y":"N")};var A={OVERVIEW:B(this.checkRideSummary),MAPS:B(this.checkMaps1),DIRECTIONS:B(this.checkDirections1),PLACES:B(this.checkPlacesToVisit1),LOCALLINKS:B(this.checkLocalLinks1),ITINERARY:"X",DEALERS:B(this.hdDealersCheck1),HOTELS:B(this.bwHotelsCheck1),EVENTS:B(this.eventsCheck1),FUEL:"X",FULLSIZE:B(this.checkFullSizeMapOn)};if(this.road.type==HD.road.constants._STOP_TYPES.MY_RIDE){HD.rp.util.Hitbox.track("Application/My+Ride/Print/Confirm+Print",A)}else{HD.rp.util.Hitbox.track("Application/Roads/More+Info/Confirm+Print",A)}setTimeout("print()",100)},getScenery:function(G){var F=G.roadCharacteristics;var C=[];var E=HD.rp.Print.HTML.scene;if(F!=null&&F.length>0){for(var B=0,A=F.length;B<A;B++){var H=F[B];var D=H.type.toLowerCase();if(D=="scenery"){C.push(HD.rp.dialog.RoadDetails._DB_CHARS_MAPPING[D][H.value][1])}}}return C},setupMaps:function(A){HD.util.hideShowSection(false,this.fullSizeMapWrapper)},getAddress:function(B,A){if(B.address==null){return B.latitude+" : "+B.longitude}return(A)?B.address.toString():B.address.toHTML()},populateRideSummary:function(A,D){var F=A.data;var E=A.stopList;var C=HD.rp.Print.HTML.rideSummary;C=C.replace(/_ROAD_NAME_CLASS/,(!!F.name)?"":HD.rp.HTML.hiddenClass);C=C.replace(/_ROAD_NAME/,(!!F.name)?F.name:"");C=C.replace(/_START_ADDRESS/,this.getAddress(E.start,true));C=C.replace(/_END_ADDRESS/,this.getAddress(E.end,true));C=C.replace(/_DRIVE_DISTANCE/,HD.rp.util.formatRoadLengthMiles(F.distance));C=C.replace(/_DRIVE_TIME/,HD.util.Date.parseMilliseconds(this.getDriveTime(A)));C=C.replace(/_ROAD_START_DATE_CLASS/,(!!F.startDate)?"":HD.rp.HTML.hiddenClass);C=C.replace(/_ROAD_END_DATE_CLASS/,(!!F.endDate)?"":HD.rp.HTML.hiddenClass);C=C.replace(/_START_DATE/,HD.rp.util.formatDate(F.startDate));C=C.replace(/_END_DATE/,HD.rp.util.formatDate(F.endDate));if(F.id!=null&&F.id!=0){C=C.replace(/_ROAD_RATING_CLASS/,"");C=C.replace(/_RATING_VAL/,Math.round(F.averageRating*10)/10)}else{C=C.replace(/_ROAD_RATING_CLASS/,HD.rp.HTML.hiddenClass)}if(typeof D=="function"){D.call(D,C)}else{$(HD.rp.Print.HTML.ids.rideSummary).innerHTML=C;HD.util.setVisible(HD.rp.Print.HTML.ids.rideSummary);var B=$("tripNotes");B.value=HD.rp.Print.Text.typeNotesHere;YAHOO.util.Event.addListener(B,"focus",function(){if(this.value==HD.rp.Print.Text.typeNotesHere){this.value="";this.parentNode.className=HD.rp.Print.HTML.classes.filledNotes}else{this.select()}});YAHOO.util.Event.addListener(B,"blur",function(){if(this.value==""){this.value=HD.rp.Print.Text.typeNotesHere;this.parentNode.className=HD.rp.Print.HTML.classes.emptyNotes}else{this.parentNode.className=HD.rp.Print.HTML.classes.filledNotes}})}},getDriveTime:function(A){var C=A.data;if(C.duration!=null){return C.duration}var D=0;var B=A.getStart().segmentOut;while(B!=null){var E=B.data;if(E.duration!=null){D+=E.duration}B=B.nextSegment()}return D},populateOverview:function(A,D){var F=A.data;var C=HD.rp.HTML.visibleClass;var G=HD.rp.HTML.hiddenClass;var B=HD.rp.Print.HTML.overview;if(F.seasons!=null&&F.seasons["Best Time to Drive"]!=null){B=B.replace(/_TIME_TO_TRAVLE_CLASS/,HD.rp.HTML.visibleClass);B=B.replace(/_BEST_TRAVEL_TIME/,F.seasons["Best Time to Drive"])}else{B=B.replace(/_TIME_TO_TRAVLE_CLASS/,G)}var E=this.getScenery(F);if(E.length>0){B=B.replace(/_ROAD_SCENERY_CLASS/,C);B=B.replace(/_ROAD_SCENERY/,E.join(", "))}else{B=B.replace(/_ROAD_SCENERY_CLASS/,G)}if(F.description!=null){B=B.replace(/_ROAD_OVERVIEW_CLASS/,C);B=B.replace(/_ROAD_OVERVIEW/,F.description)}else{B=B.replace(/_ROAD_OVERVIEW_CLASS/,G)}if(A.type==HD.road.constants._STOP_TYPES.GREAT_ROAD){B=B.replace(/_GR_COPYRIGHT/,C)}else{B=B.replace(/_GR_COPYRIGHT/,G)}if(typeof D=="function"){D.call(D,B)}else{$(HD.rp.Print.HTML.ids.overviewDirectionsMaps).innerHTML=B;HD.util.setVisible(HD.rp.Print.HTML.ids.overviewDirectionsMaps);if(F.name==null){HD.util.uncheckAndDisable(HD.rp.Print.HTML.ids.checkRoadDescription);HD.util.setInvisible(HD.rp.Print.HTML.ids.lblRoadDescription);HD.util.setInvisible(HD.rp.Print.HTML.ids.roadDescription)}this.fullSizeMapWrapper=$(HD.rp.Print.HTML.ids.fullSizeMapWrapper);this.overviewMapWrapper=$(HD.rp.Print.HTML.ids.overviewMapWrapper)}},populateDirections:function(E,A,I){var O=[];var B=E.stopList.start.segmentOut;var G=true;var F,M,D,K,Q,C,S,J,H;while(B!=null&&!B.isEmpty()){F=B.directions;if(!!F){Q="";Q+=HD.rp.Print.HTML.directions.stop;C=B.start.data;J=B.start.getEntity();H=((!!J.type)?"":(!!C.name)?C.name+"<br/>":"")+this.getAddress(B.start);Q=Q.replace(/_DEPARTURE_TIME_CLASS/,(!!C.stopTime)?"":HD.rp.HTML.hiddenClass);Q=Q.replace(/_DEPARTURE_TIME/,(!!C.stopTime)?C.stopTime:"");Q=Q.replace(/_DRIVE_CLASS/,(!!B.data.distance)?"":HD.rp.HTML.hiddenClass);Q=Q.replace(/_DRIVE_DISTANCE/,HD.rp.util.formatRoadLengthMiles(B.data.distance));Q=Q.replace(/_DRIVE_TIME/,HD.util.Date.parseMilliseconds(B.data.duration));Q=Q.replace(/_ENTITY_INFO_PART_1/,(!!J.type)?this.createEntityHeader(J,B.start):"");Q=Q.replace(/_ENTITY_INFO_PART_2/,(!!J.type)?this.createEntityFooter(J,B.start):"");Q=Q.replace(/_STOP_ADDRESS_LABEL/,(G)?HD.rp.Print.Text.stopAddressLabel.first:HD.rp.Print.Text.stopAddressLabel.middle);Q=Q.replace(/_ADDRESS/,H);if(!!C.notes){Q+=HD.rp.Print.HTML.directions.stopNotes;Q=Q.replace(/_START_NOTES_TEXT/,C.notes)}Q+=HD.rp.Print.HTML.directions.directionsTable;D=[];for(var T=0,P=F.length;T<P;T++){M=F[T];K=HD.rp.Print.HTML.directions.direction;K=K.replace(/_NUM/,T+1);if((I)||(I==null)){K=K.replace(/_COUNTER/,T%2==0?"shaded":"")}else{K=K.replace(/_COUNTER/,HD.rp.HTML.hiddenClass)}K=K.replace(/_DIRECTION/,HD.util.convertToJSSafeHTMLString(M.text));K=K.replace(/_DISTANCE/,HD.rp.util.formatRoadLengthMiles(M.distance));K=K.replace(/_DURATION/,HD.util.Date.parseMilliseconds(M.duration));D.push(K)}Q=Q.replace(/_TURN_BY_TURN_DIRECTIONS/,D.join(""));if(B.end.segmentOut==null||B.end.segmentOut.isEmpty()){K=HD.rp.Print.HTML.directions.stop;S=B.end.data;J=B.end.getEntity();H=((!!J.type)?"":(!!S.name)?S.name+"<br/>":"")+this.getAddress(B.end);K=K.replace(/_DEPARTURE_TIME_CLASS/,HD.rp.HTML.hiddenClass);K=K.replace(/_DEPARTURE_TIME/,"");K=K.replace(/_DRIVE_CLASS/,HD.rp.HTML.hiddenClass);K=K.replace(/_DRIVE_DISTANCE/,"");K=K.replace(/_DRIVE_TIME/,"");K=K.replace(/_ENTITY_INFO_PART_1/,(!!J.type)?this.createEntityHeader(J):"");K=K.replace(/_ENTITY_INFO_PART_2/,(!!J.type)?this.createEntityFooter(J):"");K=K.replace(/_STOP_ADDRESS_LABEL/,HD.rp.Print.Text.stopAddressLabel.last);K=K.replace(/_ADDRESS/,H);if(!!S.notes){K+=HD.rp.Print.HTML.directions.stopNotes;K=K.replace(/_START_NOTES_TEXT/,S.notes)}Q+=K}O.push(Q);G=false}else{var L=this;var N=E;E.attachEvent(HD.road.constants._EVENT.DIRECTIONS_UPDATED,function(U){L.populateDirections.call(L,N,A||null)});B.initDirections();return }B=B.nextSegment()}if(typeof A=="function"){A.call(A,O.join(""))}else{$(HD.rp.Print.HTML.ids.rideDirections).innerHTML=O.join("");this.directionsWrapper=$(HD.rp.Print.HTML.ids.directionsWrapper);HD.util.setVisible(this.directionsWrapper)}},createEntityHeader:function(B,A){var C;var D=B.data.data||{};if(B.type==HD.rp.constants._POI_TYPES.DEALER){C=HD.rp.Print.HTML.directions.stopEntityData.dealer1;C=C.replace(/_DEALER_NAME/,D.name||A.getTitle());C=C.replace(/_DEALER_PHONE/,HD.util.hasValue(D.phone)?D.phone+"<br/>":"");C=C.replace(/_DEALER_FAX/,HD.util.hasValue(D.fax)?"Fax "+D.fax+"<br/>":"")}else{if(B.type==HD.rp.constants._POI_TYPES.HOTEL){C=HD.rp.Print.HTML.directions.stopEntityData.hotel1;C=C.replace(/_HOTEL_NAME/,D.name||A.getTitle());C=C.replace(/_IS_RF/,B.data.data.rating==2?"":"hidden")}else{if(B.type==HD.rp.constants._POI_TYPES.EVENT){C=HD.rp.Print.HTML.directions.stopEntityData.event1;C=C.replace(/_EVENT_NAME/,D.name||A.getTitle());C=C.replace(/_EVENT_DATE/,D.startDate||"")}else{if(B.type==HD.rp.constants._POI_TYPES.FUEL){C=HD.rp.Print.HTML.directions.stopEntityData.fuel1;C=C.replace(/_FUEL_NAME/,D.name||A.getTitle())}else{C=""}}}}return C},createEntityFooter:function(B,A){var C;var E=B.data.data||{};var D=B.data.fullEntityData;if(B.type==HD.rp.constants._POI_TYPES.DEALER){C=HD.rp.Print.HTML.directions.stopEntityData.dealer2;C=C.replace(/_DEALER_SERVICES/,!!D?new HD.rp.service.DealerDetails(D).generatePrintView():"N/A");C=C.replace(/_HAS_SERVICES/,!!D?HD.rp.HTML.visibleClass:HD.rp.HTML.hiddenClass)}else{if(B.type==HD.rp.constants._POI_TYPES.HOTEL){C=HD.rp.Print.HTML.directions.stopEntityData.hotel2}else{if(B.type==HD.rp.constants._POI_TYPES.EVENT){C=HD.rp.Print.HTML.directions.stopEntityData.event2;C=C.replace(/_EVENT_DETAILS/,E.description||"N/A")}else{if(B.type==HD.rp.constants._POI_TYPES.FUEL){C=HD.rp.Print.HTML.directions.stopEntityData.fuel2;var G=[];if(!!D){for(var F in D){G.push(HD.rp.text.shellServices[F])}}C=C.replace(/_FUEL_SERVICES/,G.length>0?G.join(", "):"N/A");C=C.replace(/_HAS_SERVICES/,!!D?HD.rp.HTML.visibleClass:HD.rp.HTML.hiddenClass)}else{C=""}}}}return C},populatePlaces:function(E,B,C){var A=B.data[C];var H=[];for(var I=0;I<A.length;I++){var F=A[I];var D=F.images[0];var G=HD.rp.Print.HTML.place;G=G.replace(/_IMAGE_URL/,(D!=null)?D.directoryName+D.filename:HD.rp.URL.blankImage);G=G.replace(/_PLACE_TITLE/,F.name);G=G.replace(/_PLACE_STATE/g,F.stateCode);G=G.replace(/_PLACE_DESCRIPTION/,F.extendedDescriptions.Description||F.description);G=G.replace(/_LAST_ITEM_CLASS/,(I==(A.length-1))?"last":"");if(F.toDirections!=null&&F.toDirections!=" "){G=G.replace(/_DIRECTIONS_CLASS/,HD.rp.HTML.visibleClass);G=G.replace(/_PLACE_DIRECTIONS/,F.toDirections)}else{G=G.replace(/_DIRECTIONS_CLASS/,HD.rp.HTML.hiddenClass)}if(F.extendedDescriptions.Credits!=null){G=G.replace(/_COPYRIGHT_CLASS/,HD.rp.HTML.visibleClass);G=G.replace(/_PLACE_COPYRIGHT/,F.extendedDescriptions.Credits)}else{G=G.replace(/_COPYRIGHT_CLASS/,HD.rp.HTML.hiddenClass)}H.push(G)}$(HD.rp.Print.HTML.ids.placesToVisit).innerHTML=H.join("");HD.util.setVisible(this.placesWrapper)},populateNoPlaces:function(){HD.util.uncheckAndDisable(this.checkPlacesToVisit1);HD.util.setInvisible(HD.rp.Print.HTML.ids.lblPlacesToVisit);HD.util.setInvisible(this.placesWrapper)},populateLinks:function(D,A,C){var L=A.data[C];var M={};var J,F,B;for(var K=0,G=L.length;K<G;K++){var I=L[K];F=HD.rp.Print.HTML.link;F=F.replace(/_URL/,I.webSite.url);F=F.replace(/_TITLE/,I.webSite.name);F=F.replace(/_INFO/,I.webSite.description);J=M[I.category.name];if(J==null){J=new Array();M[I.category.name]=J}J.push(F)}var H=new Array();var E=HD.rp.dialog.RoadDetails._LOCAL_LINKS_CATEGORIES;for(K=0,G=E.length;K<G;K++){B=E[K];J=M[B];if(J==null||J.length<1){continue}F=HD.rp.Print.HTML.linkCategory;F=F.replace(/_TITLE/,B);F=F.replace(/_LINKS/,J.join(""));H.push(F)}$(HD.rp.Print.HTML.ids.localLinks).innerHTML=H.join("");HD.util.setVisible(this.linksWrapper)},populateNoLinks:function(){HD.util.uncheckAndDisable(this.checkLocalLinks1);HD.util.setInvisible(HD.rp.Print.HTML.ids.lblLocalLinks);HD.util.setInvisible(this.linksWrapper)},populateReviews:function(D,B){var E=D.data[B];var G=new Array();for(var C=0;C<E.length;C++){var A=E[C];var F=HD.rp.Print.HTML.review;F=HD.util.template(F,{_TITLE:A.title,_RATING:A.rating,_AUTHOR:A.signAs,_DATE:HD.rp.util.formatDate(A.submissionDate),_REVIEW:A.reviewText});G.push(F);G.push('<div class="horizontalSpacer"></div>')}$(HD.rp.Print.HTML.ids.roadReviews).innerHTML=G.join("");HD.util.setVisible(this.reviewsWrapper)},populateNoReviews:function(){HD.util.uncheckAndDisable(this.checkReviews1);HD.util.setInvisible(HD.rp.Print.HTML.ids.lblReviews);HD.util.setInvisible(this.reviewsWrapper)},clearAllPOIs:function(){$(HD.rp.Print.HTML.ids.poiDealers).innerHTML="";HD.util.setInvisible(HD.rp.Print.HTML.ids.poisDealersWrapper);$(HD.rp.Print.HTML.ids.poiHotels).innerHTML="";HD.util.setInvisible(HD.rp.Print.HTML.ids.poisHotelsWrapper);$(HD.rp.Print.HTML.ids.poiEvents).innerHTML="";HD.util.setInvisible(HD.rp.Print.HTML.ids.poisEventsWrapper);$(HD.rp.Print.HTML.ids.poiFuels).innerHTML="";HD.util.setInvisible(HD.rp.Print.HTML.ids.poisFuelsWrapper)},populatePOIs:function(D,A,F){this.hideLoading();var G,E,C;switch(A){case HD.rp.constants._POI_TYPES.DEALER:C="populateDealerPOI";G=HD.rp.Print.HTML.ids.poiDealers;E=HD.rp.Print.HTML.ids.poisDealersWrapper;break;case HD.rp.constants._POI_TYPES.HOTEL:C="populateHotelPOI";G=HD.rp.Print.HTML.ids.poiHotels;E=HD.rp.Print.HTML.ids.poisHotelsWrapper;break;case HD.rp.constants._POI_TYPES.EVENT:C="populateEventPOI";G=HD.rp.Print.HTML.ids.poiEvents;E=HD.rp.Print.HTML.ids.poisEventsWrapper;break;case HD.rp.constants._POI_TYPES.FUEL:C="populateFuelPOI";G=HD.rp.Print.HTML.ids.poiFuels;E=HD.rp.Print.HTML.ids.poisFuelsWrapper;break;default:return }if(!D||D.length==0){$(G).innerHTML=HD.rp.Print.HTML.noPoi}else{var B=new Array();for(a=0,len=D.length;a<len;a++){B.push(this[C](D[a]))}$(G).innerHTML=B.join("")}HD.util.setVisible(E)},populateDealerPOI:function(F){var E=F.data;var C=HD.rp.Print.HTML.poi.dealer;C=C.replace(/_PIN/,HD.rp.renderer.getPinHTML(F));C=C.replace(/_NAME/,HD.util.convertToJSSafeHTMLString(E.name));C=C.replace(/_ADDRESS/,F.address.toHTML());C=C.replace(/_PHONE/,E.phone);C=C.replace(/_MAP_PUSHPIN_INDEX/g,F.mapPushpinIndex);C=C.replace(/_DATA_TYPE/g,F.type);var B=document.createElement("input");B.type="checkbox";YAHOO.util.Event.addListener(B,"click",function(){HD.rp.Print.togglePrintClass(this.parentNode.parentNode.parentNode)});if(HD.util.hasValue(E.url)){C=C.replace(/_LINK_CLASS/,HD.rp.HTML.noClass);C=C.replace(/_LINK/,E.url)}else{C=C.replace(/_LINK_CLASS/,HD.rp.HTML.hiddenClass)}if(HD.util.hasValue(E.fax)){C=C.replace(/_FAX_CLASS/,HD.rp.HTML.noClass);C=C.replace(/_FAX/,"Fax "+E.fax)}else{C=C.replace(/_FAX_CLASS/,HD.rp.HTML.hiddenClass)}var D=E.fullEntityData;var A=new HD.rp.service.DealerDetails(D).generateServicesView();if(HD.util.hasValue(A)){C=C.replace(/_SERVICES_CLASS/,HD.rp.Print.HTML.classes.dealerServices);C=C.replace(/_SERVICES/,A)}else{C=C.replace(/_SERVICES_CLASS/,HD.rp.HTML.hiddenClass)}if(D.hogChapter){C=C.replace(/_HOG_CHAPTER_CLASS/,HD.rp.HTML.noClass);C=C.replace(/_HOG_CHAPTER_NAME/,D.hogChapname);if(HD.util.hasValue(D.hogChaplink)){C=C.replace(/_HOG_CHAPTER_LINK_CLASS/,HD.rp.HTML.noClass);C=C.replace(/_HOG_CHAPTER_LINK/,D.hogChaplink)}else{C=C.replace(/_HOG_CHAPTER_LINK_CLASS/,HD.rp.HTML.hiddenClass)}}else{C=C.replace(/_HOG_CHAPTER_CLASS/,HD.rp.HTML.hiddenClass)}return C},populateHotelPOI:function(D){var B=D.data;var C=D.data.rating==2;var A=HD.rp.Print.HTML.poi.hotel;A=A.replace(/_PIN/,HD.rp.renderer.getPinHTML(D));A=A.replace(/_NAME/,HD.util.convertToJSSafeHTMLString(B.name));A=A.replace(/_ADDRESS/,D.address.toHTML());A=A.replace(/_MAP_PUSHPIN_INDEX/g,D.mapPushpinIndex);A=A.replace(/_IS_RF/,C?"":"hidden");return A},populateEventPOI:function(C){var B=C.data;var A=HD.rp.Print.HTML.poi.event;A=A.replace(/_PIN/,HD.rp.renderer.getPinHTML(C));A=A.replace(/_NAME/,HD.util.convertToJSSafeHTMLString(B.name));A=A.replace(/_DATE/,B.startDate);A=A.replace(/_MAP_PUSHPIN_INDEX/g,C.mapPushpinIndex);if(HD.util.hasValue(B.description)){A=A.replace(/_DESCRIPTION_CLASS/,HD.rp.HTML.noClass);A=A.replace(/_DESCRIPTION/,B.description)}else{A=A.replace(/_DESCRIPTION_CLASS/,HD.rp.HTML.hiddenClass)}A=A.replace(/_HOST_NAME/,(B.dealer&&B.dealer.data.name)?B.dealer.data.name:"");A=A.replace(/_LOCATION/,C.address.toHTML());A=A.replace(/_CONTACT/,B.contactPhone||"");return A},populateFuelPOI:function(C){var B=C.data;var A=HD.rp.Print.HTML.poi.fuel;A=A.replace(/_PIN/,HD.rp.renderer.getPinHTML(C));A=A.replace(/_NAME/,HD.util.convertToJSSafeHTMLString(B.name));A=A.replace(/_ADDRESS/,C.address.toHTML());A=A.replace(/_PHONE/,B.phone);A=A.replace(/_MAP_PUSHPIN_INDEX/g,C.mapPushpinIndex);return A},clearPOIs:function(A){var B=null;switch(A){case HD.rp.constants._POI_TYPES.DEALER:B=HD.rp.Print.HTML.ids.poisDealersWrapper;break;case HD.rp.constants._POI_TYPES.HOTEL:B=HD.rp.Print.HTML.ids.poisHotelsWrapper;break;case HD.rp.constants._POI_TYPES.EVENT:B=HD.rp.Print.HTML.ids.poisEventsWrapper;break;case HD.rp.constants._POI_TYPES.EVENT:B=HD.rp.Print.HTML.ids.poisFuelsWrapper;break;default:return }HD.util.setInvisible(B)}};HD.rp.Print.Text={noResults:"No Results Found",printTitle:"Print Out Your Ride Plan",stopAddressLabel:{first:"Depart From",middle:"Arrive At",last:"Arrive At"},typeNotesHere:"Type your notes here"};HD.rp.Print.HTML={classes:{emptyNotes:"emptyNotes",filledNotes:"filledNotes",selected:"selected",noprint:"noprint",dealerServices:"dealerServices"},mapIds:{fullsize:"fullSizeMap",overview:"overviewMap",start:"startMap",end:"endMap"},ids:{printWrapper:"printWrapper",printMask:"printMask",printHeader:"printHeader",printTitle:"printTitle",exitPrint:"exitPrint",eventDateRow1:"eventDateRow1",eventDateRow2:"eventDateRow2",printLoadingBg:"printLoadingBg",printContentTools:"printContentTools",rideSummary:"rideSummary",overviewDirectionsMaps:"overviewDirectionsMaps",rideDirections:"rideDirections",placesToVisit:"placesToVisitContent",localLinks:"localLinksContent",roadReviews:"roadReviewContent",poiDealers:"poiDealersContent",poiHotels:"poiHotelsContent",poiEvents:"poiEventsContent",poiFuels:"poiFuelsContent",checkHDDealers1:"checkHDDealers1",checkBWHotels1:"checkBWHotels1",checkEvents1:"checkEvents1",checkFuel1:"checkFuel1",greatRoadsChecks1:"greatRoadsChecks1",printButton1:"printButton1",refreshButton1:"refreshButton1",refreshWrapper:"refreshWrapper",fullSizeMapWrapper:"fullSizeMapWrapper",overviewMapWrapper:"overviewMapWrapper",mapsWrapper:"mapsWrapper",directionsWrapper:"directionsWrapper",placesWrapper:"placesWrapper",linksWrapper:"linksWrapper",reviewsWrapper:"reviewsWrapper",overviewsWrapper:"overviewsWrapper",printContent:"printContent",usePrintButton:"usePrintButton",roadDescription:"roadDescription",printEventsStartDate:"printEventsStartDate",printEventsStartToggle:"printEventsStartToggle",printEventsEndDate:"printEventsEndDate",printEventsEndToggle:"printEventsEndToggle",poisDealersWrapper:"poisDealersWrapper",poisHotelsWrapper:"poisHotelsWrapper",poisEventsWrapper:"poisEventsWrapper",poisFuelsWrapper:"poisFuelsWrapper",poisDealersRadius:"poisDealersRadius",poisHotelsRadius:"poisHotelsRadius",poisEventsRadius:"poisEventsRadius",poisFuelsRadius:"poisFuelsRadius",smallFont:"smallFont",mediumFont:"mediumFont",largeFont:"largeFont",lblMaps:"lblMaps",lblFullSize:"lblFullSize",lblDirections:"lblDirections",lblRideSummary:"lblRideSummary",lblRoadDescription:"lblRoadDescription",lblPlacesToVisit:"lblPlacesToVisit",lblLocalLinks:"lblLocalLinks",lblReviews:"lblReviews",checkRoadDescription:"checkRoadDescription",checkMaps1:"checkMaps1",checkDirections1:"checkDirections1",checkRideSummary:"checkRideSummary",checkPlacesToVisit1:"checkPlacesToVisit1",checkLocalLinks1:"checkLocalLinks1",checkReviews1:"checkReviews1",checkFullSizeMapOn:"checkFullSizeMapOn"},overview:'<table><tr><td class="one"><div id="roadDescription"><div class="smHdr">Road Description</div><p class="_TIME_TO_TRAVLE_CLASS">Best time to travel: <strong>_BEST_TRAVEL_TIME</strong></p><p class="_ROAD_SCENERY_CLASS">Scenery along to the route: <strong>_ROAD_SCENERY</strong></p><p class="_ROAD_OVERVIEW_CLASS">_ROAD_OVERVIEW</p><p class="copyright _GR_COPYRIGHT">Great Road information was obtained by permission from www.byways.org</p></div><div class="directions" id="directionsWrapper"><div class="smHdr">Directions</div><div id="rideDirections"></div></div></td><td class="two" id="mapsWrapper"><div class="maps"><div id="overviewMapWrapper"><div class="smHdr">Overview Map</div><div class="miniMap" id="overviewMap"><div class="loadingIndicatorWhite"><div>Loading ...</div></div></div></div><div class="smHdr">Start</div><div class="miniMap" id="startMap"><div class="loadingIndicatorWhite"><div>Loading ...</div></div></div><div class="smHdr">End</div><div class="miniMap" id="endMap"><div class="loadingIndicatorWhite"><div>Loading ...</div></div></div></div></td></tr></table>',rideSummary:'<div id="rideSummary"><div class="smHdr">Ride Summary</div><div id="driveSummary"><table><tr class="_ROAD_NAME_CLASS"><td>Name:</td><td><strong>_ROAD_NAME</strong></td></tr><tr class="_ROAD_RATING_CLASS"><td>Rating</td><td><strong><div class="ratingsWrapper"><div class="ratings_RATING_VAL"/></div></strong></td></tr><tr><td>Start:</td><td><strong>_START_ADDRESS</strong></td></tr><tr><td>End:</td><td><strong>_END_ADDRESS</strong></td></tr><tr><td>Drive Total:</td><td><strong>_DRIVE_DISTANCE</strong> (about _DRIVE_TIME)</td></tr><tr class="_ROAD_START_DATE_CLASS"><td>Start Date:</td><td><strong>_START_DATE</strong></td></tr><tr class="_ROAD_END_DATE_CLASS"><td>End Date:</td><td><strong>_END_DATE</strong></td></tr></table></div></div>',directions:{directionsTable:'<table class="turnByTurnDirections"><colgroup><col class="one" /><col class="two" /><col class="three" /></colgroup>_TURN_BY_TURN_DIRECTIONS</table>',direction:'<tr class="_COUNTER"><td>_NUM</td><td><strong>_DIRECTION</strong></td><td><strong>_DISTANCE</strong><div class="time">_DURATION</div></td></tr>',stop:'<table class="stopTable"><colgroup><col class="one" /><col class="two" /></colgroup>_ENTITY_INFO_PART_1<tr class="_DEPARTURE_TIME_CLASS"><td>Departure time:</td><td><strong>_DEPARTURE_TIME</strong></td></tr><tr><td>_STOP_ADDRESS_LABEL:</td><td><strong>_ADDRESS</strong></td></tr>_ENTITY_INFO_PART_2<tr class="_DRIVE_CLASS"><td>Drive:</td><td><strong>_DRIVE_DISTANCE (about _DRIVE_TIME)</strong></td></tr></table>',stopNotes:'<div><div class="smHdr">Notes:</div> <div class="stopNotes">_START_NOTES_TEXT</div> </div> ',stopEntityData:{dealer1:"<tr><td>Dealer:</td><td><strong>_DEALER_NAME</strong><br />_DEALER_PHONE_DEALER_FAX</td></tr>",dealer2:'<tr class="_HAS_SERVICES"><td>&nbsp;</td><td>_DEALER_SERVICES</td></tr>',hotel1:'<tr><td>Hotel:</td><td><strong>_HOTEL_NAME</strong><div class="_IS_RF">'+HD.rp.text.riderFriendlyHotel+"</div></td></tr>",hotel2:"<tr><td>&nbsp;</td><td>Call 1-888-224-BIKE to book Best Western hotel using special rates for H-D riders.</td></tr>",event1:"<tr><td>Event:</td><td><strong>_EVENT_NAME</strong></td></tr><tr><td>Date:</td><td><strong>_EVENT_DATE</strong></td></tr>",event2:"<tr><td>Event Details:</td><td>_EVENT_DETAILS</td></tr>",fuel1:"<tr><td>Fuel:</td><td><strong>_FUEL_NAME</strong></td></tr>",fuel2:'<tr class="_HAS_SERVICES"><td>&nbsp;</td><td>_FUEL_SERVICES</td></tr>'}},noPoi:'<div class="noprint noResults">'+HD.rp.Print.Text.noResults+"</div>",poi:{dealer:'<table class="poi"><tr><td class="a">_PIN</td><td class="b"><div><strong>_NAME</strong></div><div>_ADDRESS</div><div>_PHONE</div><div class="_FAX_CLASS">_FAX</div><div class="_LINK_CLASS">Visit our Web site:<br/>_LINK</div></td><td class="c"><div class="_SERVICES_CLASS">Services:<br/>_SERVICES</div><div class="clear"></div><br/><br/><br/><div class="_HOG_CHAPTER_CLASS">H.O.G. Chapter:<div><strong>_HOG_CHAPTER_NAME</strong></div><div class="_HOG_CHAPTER_LINK_CLASS">_HOG_CHAPTER_LINK</div></div></td></tr></table>',hotel:'<table class="poi"><tr><td class="a">_PIN</td><td class="b"><div><b>_NAME</b></div><div class="_IS_RF">'+HD.rp.text.riderFriendlyHotel+"</div><div>Call 1-888-224-BIKE to book using special rates for H-D riders</div><div>_ADDRESS</div></td></tr></table>",event:'<table class="poi"><tr><td class="a">_PIN</td><td class="b"><strong>_NAME</strong><br>_DATE<br/><div class="_DESCRIPTION_CLASS"><br/><strong>Details</strong><br />_DESCRIPTION</div></td><td class="c"><strong>Event Host</strong>_HOST_NAME<br/><strong>Event Location</strong>_LOCATION<br/><strong>Contact Information</strong>_CONTACT<br/></td></tr></table>',fuel:'<table class="poi"><tr><td class="a">_PIN</td><td class="b"><div><b>_NAME</b></div><div>_ADDRESS</div></td></tr></table>'},place:'<table class="place _LAST_ITEM_CLASS"><tr><td><strong>_PLACE_TITLE (_PLACE_STATE)</strong><br /><p>_PLACE_DESCRIPTION</p><p class="_DIRECTIONS_CLASS"><strong>Directions:</strong> _PLACE_DIRECTIONS</p><p class="copyright _COPYRIGHT_CLASS">_PLACE_COPYRIGHT</p></td><td><img class="placeToVisitImg" src="_IMAGE_URL"/></td></tr></table>',review:'<div class="review"><div class="bold">_TITLE</div><div class="author">Submitted by _AUTHOR on _DATE</div><table><tr><td>'+HD.rp.text.rating+':&nbsp;</td><td><div class="ratingsWrapper"><div class="ratings_RATING"></div></div></td></tr></table><p>_REVIEW</p></div>',linkCategory:'<div class="localCat"><div class="title">_TITLE</div><div>_LINKS</div></div>',link:'<div class="localLink"><strong>_TITLE</strong> (_URL)</br><p>_INFO</p></div>',printBase:"<div id='printContent' class='printContent'><div id='printHeader'><div id='printTitle'>"+HD.rp.Print.Text.printTitle+"</div><div id='exitPrint'></div></div><div class='tools' id='printContentTools'><table class='toolsTable'><tr><td class='col1'><div class='header'>Select map information to print out:</div><table><tr><td><label id='lblMaps' for='checkMaps1'><input checked='checked' id='checkMaps1' type='checkbox' />Maps</label><br/><label id='lblFullSize' for='checkFullSizeMapOn'><input id='checkFullSizeMapOn' type='checkbox' />Large overview map</label><br/><label id='lblDirections' for='checkDirections1'><input checked='checked' id='checkDirections1' type='checkbox' type='checkbox' />Driving directions</label><br/><label id='lblRideSummary' for='checkRideSummary'><input checked='checked' id='checkRideSummary' type='checkbox' type='checkbox' />Ride summary</label><br/></td><td><label id='lblRoadDescription' for='checkRoadDescription'><input checked='checked' id='checkRoadDescription' type='checkbox' />Road description</label><br/><label id='lblPlacesToVisit' for='checkPlacesToVisit1'><input checked='checked' id='checkPlacesToVisit1' type='checkbox' />Places to visit</label><br/><label id='lblLocalLinks' for='checkLocalLinks1'><input checked='checked' id='checkLocalLinks1' type='checkbox' />Local links</label><br/><label id='lblReviews' for='checkReviews1'><input checked='checked' id='checkReviews1' type='checkbox' />Road reviews</label><br/></td></tr></table></td><td class='col2'><div class='header'>Print additional info:</div><table><tr><td><div><label for=''><input id='checkHDDealers1' type='checkbox'/>H-D Dealerships</label></div></td><td><div><label for=''><input id='checkBWHotels1' type='checkbox'/>Best Western Hotels</label></div></td></tr><tr><td><div><label for=''><input id='checkEvents1' type='checkbox'/>Events</label></div></td><td><div><label for=''><input id='checkFuel1' type='checkbox'/>Fuel</label></div></td></tr><tr><td><div id='eventDateRow1' style='display:none;'><input type='text' id='printEventsStartDate'/><a href='javascript:void(0)' id='printEventsStartToggle'></a></div></td><td><div id='eventDateRow2' style='display:none;'><input type='text' id='printEventsEndDate'/><a href='javascript:void(0)' id='printEventsEndToggle'></a></div></td></tr><tr><td colspan='2'><div id='refreshWrapper'>After you made all necessary adjustments above, click \"Update selection\" button first then click \"Print\" button.<div id='refreshButton1' class='refreshButton'>Update selection</div></div></td></tr></table></td><td class='col3'><div class='header'>Font sizes:</div><table class='fontSelector'><tr><td id='smallFont'>A</td><td class='sp'></td><td id='mediumFont'>A</td><td class='sp'></td><td id='largeFont'>A</td></tr></table></br><div id='printButton1' class='printButton'></div></td></tr></table><div id='printLoadingBg'>&nbsp;</div></div><div class='printableContent'><div class='printableHeader'><table><tr><td><div class='logo'></div></td><td><div class='emptyNotes'><textarea id='tripNotes' class='notes'></textarea></div></td></tr></table></div><div class='rideSummary' id='rideSummary'></div><div id='fullSizeMapWrapper'><div class='smHdr'>Overview Map</div><div class='fullSizeMap' id='fullSizeMap'><div class='loadingIndicatorWhite'><div>Loading ...</div></div></div></div><div id='overviewDirectionsMaps' class='overviewDirectionsMaps'></div><div class='poisDealers' id='poisDealersWrapper'><table class='radiusTable'><tr><td class='title'><div>Harley-Davidson Dealers</div></td><td class='dropdown'><select id='poisDealersRadius'><option value='1'>Within 1 mile radius</option><option selected='true' value='5'>Within 5 mile radius</option><option value='10'>Within 10 mile radius</option><option value='20'>Within 20 mile radius</option></select></td></tr></table><table><tr><td id='poiDealersContent'></td><td class='help'>&nbsp;</td></tr></table></div><div class='poisHotels' id='poisHotelsWrapper'><table class='radiusTable'><tr><td class='title'><div>Best Western Hotels</div></td><td class='dropdown'><select id='poisHotelsRadius'><option value='1'>Within 1 mile radius</option><option value='5'>Within 5 mile radius</option><option selected='true' value='10'>Within 10 mile radius</option><option value='20'>Within 20 mile radius</option></select></td></tr></table><table><tr><td id='poiHotelsContent'></td><td class='help'>&nbsp;</td></tr></table></div><div class='poisEvents' id='poisEventsWrapper'><table class='radiusTable'><tr><td class='title'><div>Events</div></td><td class='dropdown'><select id='poisEventsRadius'><option value='1'>Within 1 mile radius</option><option value='5'>Within 5 mile radius</option><option value='10'>Within 10 mile radius</option><option selected='true' value='20'>Within 20 mile radius</option></select></td></tr></table><table><tr><td id='poiEventsContent'></td><td class='help'>&nbsp;</td></tr></table></div><div class='poisFuels' id='poisFuelsWrapper'><table class='radiusTable'><tr><td class='title'><div>Fuel</div></td><td class='dropdown'><select id='poisFuelsRadius'><option selected='true' value='1'>Within 1 mile radius</option><option value='5'>Within 5 mile radius</option><option value='10'>Within 10 mile radius</option><option value='20'>Within 20 mile radius</option></select></td></tr></table><table><tr><td id='poiFuelsContent'></td><td class='help'>&nbsp;</td></tr></table></div><div class='placesToVisit' id='placesWrapper'><div class='sectionHdr'>Places to Visit</div><div id='placesToVisitContent'><div class='loadingIndicatorWhite'><div>Loading ...</div></div></div></div><div class='localLinks' id='linksWrapper'><div class='sectionHdr'>Local Links</div><div id='localLinksContent'><div class='loadingIndicatorWhite'><div>Loading ...</div></div></div><div class='roadReviews' id='reviewsWrapper'><div class='sectionHdr'>Road Reviews</div><div id='roadReviewContent'><div class='loadingIndicatorWhite'><div>Loading ...</div></div></div></div><div class='copyright printFooter'>Road conditions may vary from your ride plan due to traffic, construction, and other events. Ride plans are for planning purposes only.<br />&copy; 2001-2007 H-D. All rights reserved.</div></div>"};HD.rp.ThreeD={_MIN_JUMP_DISTANCE:0.00005,currentIndex:null,stops:null,map:null,isOn:false,flyThrough:function(B,D){if(this.isOn){this.isOn=false;return }B=B||HD.rp.MyRide.route;if(B.isEmpty()){if(D){HD.rp.RoadsPanel.zoomToShowRoad(B.data.id,null,function(E){HD.rp.ThreeD.flyThrough(E)})}return }var C=HD.rp.hdMap;if(!C.is3DOn){C.toggle3D()}C.setZoomLevel(19);this.isOn=true;this.currentIndex=0;this.stops=B.getVELatLongs(19);this.map=C;var A=this;C.attachEvent("onchangeview",HD.rp.ThreeD.handleChangeView);this.setView()},handleChangeView:function(){var A=HD.rp.ThreeD;A.setView.call(A)},setView:function(){if(!this.map.is3DOn){this.isOn=false}if(!this.isOn){return }var E=this.stops;var G=this.map;var C=this.currentIndex;if(C+1<E.length){var D=E[C];var F=this.calculateHeading(D,E[C+1]);if(F!=null){var B=1;var H=HD.util.getDistance(D,E[C+B]);while(H<this._MIN_JUMP_DISTANCE){B++;H=HD.util.getDistance(D,E[C+B])}this.currentIndex+=B;var A=new VEMapViewSpecification(D,null,100,-45,F);G.setMapView(A)}}else{this.isOn=false;return }},calculateHeading:function(B,A){return(180*Math.atan2(-51.075*(B.Longitude-A.Longitude),-69.023*(B.Latitude-A.Latitude)))/Math.PI}};