 /*
  * jQuery 1.2.6 - New Wave Javascript
  *
  * Copyright (c) 2008 John Resig (jquery.com)
  * Dual licensed under the MIT (MIT-LICENSE.txt)
  * and GPL (GPL-LICENSE.txt) licenses.
  *
  * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
  * $Rev: 5685 $
 */
 
 /*
 * jQuery history plugin
 *
 * Copyright (c) 2006 Taku Sano (Mikage Sawatari)
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Modified by Lincoln Cooper to add Safari support and only call the callback once during initialization
 * for msie when no initial hash supplied.
 */
 

/*  Prototype JavaScript framework, version 1.6.0.2
 *  (c) 2005-2008 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
 *
 *--------------------------------------------------------------------------*/
 

var i18n={"reverseDrive":"Reverse Drive","hActivateAlert":"Activate Alert","jamFactorIconsPath":"/images/en_US/jamFactor/","seeTheDetails":"See the details","constructionZone":"Construction Zone","addA":"Add A","pleaseEnterAddress":"Please enter an address.","incidents":"Incidents","moreEventsBelow":"More Events Below","roadsFromTo":"From ${0} To ${1}","oneEmailRequired":"We're sorry, but you must have at least one email address associated with your MyTraffic account. If your email address has changed, please click the 'Edit' link instead of the 'Delete' link.","asOf":"as of","citySelectTransparentPixel":"/images/en_US/citySelectWidget/transparent_pixel.gif","travelimeColon":"Travel Time:","closeText":"close","labelRoadway":"Road","emailText":"Email","labellocation":"Location","addAlert":"Add Alert","yourDrive":"Your drive","min":"min","current":"Current","massTransit":"Mass Transit","shareYourInformationOutsideWhenNecessary":"We only share your information outside of our company when necessary to administer products or services we, or our subsidiaries, may provide when we have your permission, when required by law, or as otherwise described in our","pleaseEnterTheNamesDrive2":"Please enter the names for Drive 2","pleaseEnterTheNamesDrive1":"Please enter the names for Drive 1","userDeviceText4":"MyTraffic Alerts are messages we send you to let you know about traffic conditions on your saved drives. You can get Alerts at the same time on selected days of the week, or when traffic conditions are bad, or both. Here's a sample:","userDeviceText3":"Text-based traffic reports deliver critical traffic information right into your wireless device in a concise and easy to read format. Here's a sample:","printDrive":"Print Drive","incident":"Incident","userDeviceText2":"Our automated system watches the traffic conditions along your Drives around the clock. Based on your MyTraffic Alerts, the system makes a quick - usually about 30 seconds - call to your phone to tell you what's happening up to the minute. You can receive a call at a specific time, or when traffic gets bad, or both.","userDeviceText1":"Get up-to-date critical traffic information where you are, even when you're away from your computer and don't have email access. Hear about accidents or congestion even after you the office or hit the road.","nvtAdMessagesWasCalledTwice":"was called twice","malformed":"Malformed","cSevereSevere":"","galleries":"Galleries","whatIsJamFactor":"What is Jam Factor","viewAlerts":"view alerts","noInformationAvailableAtThisTime":"No information available at this time.","exampleText":"Enter an Address, City, State, Zip Code, Road, Event, or Point of Interest","recentlyViewed":"Recently Viewed","newAlertnameColon":"New Alert name :","textMessage":"Text Message","tuesday":"Tuesday","imagesPathAlertaction":"alertAction/","labelSegmentName":"Section","welcomeToNavteqTraffic":"Welcome to NAVTEQ Traffic.com","notRegisteredUser":"Become a MyTraffic Member","nextSteps":"Next Steps","nearbyHotspots":"Nearby Hotspots:","fastestNow":"Fastest Now!","alertTicketMouseOver":"View all alerts","byType":"By Type:","sorryDidnotEnterStartPointOrEndPoint":"We're sorry but you did not enter a Start Point or End Point.","clickForMoreInformation":"Click for more information","verifyThisDevice":"Please verify phone number","moreHotspotsBelow":"More Hotspots Below","freeTrafficAlerts":"Free MyTraffic Alerts","averageSpeedColon":"Average Speed:","jan":"Jan","labelPrimaryDrive":"Primary Drive","pleaseSelectDriveToSave":"Please select a drive to save","cLand":"LAND","labelLevel":"Level","rSSFeed":"RSS Feed","viaColon":"Via:","trafficBroughtCooperation":"Traffic brought to you in cooperation with:","labelEnds":"Ends","ifText":"if","labelIncidents":"Incidents","findWhenTrafficGetsBad":"Know when traffic gets bad!","cMinor":"Minor","jamFactorColon":"Jam Factor:","alertSuspended":"Alert Suspended","checkThisBoxToSaveDrive2":"Check this box to save Drive 2.","checkThisBoxToSaveDrive1":"Check this box to save Drive 1.","jamFactorexceeds":"Jam Factor exceeds","anAlertWillBeSentOn":"An alert will be sent on","to":"to","wouldYouLikeToBrowse":"Browse","labelJamFactor":"Jam Factor","driveTime":"Drive Time","signIn":"Sign In","alert":"Alert","alertStatusSuspend":"Suspended","emailAddress":"Email Address","imagesPathJamfactor":"jamFactor/","addEditAlerts":"AddEditAlerts","labelDescription":"Description","cMobile":"MOBILE","mins":"mins","wednesday":"Wednesday","textText":"Text","labelDrive2":"Drive 2:","labelDrive1":"Drive 1:","accessEvenMoreRecentlyViewdRoadSignin":"To access even more of your recently viewed roads, sign in or register for <em>free</em> below.","previousSection":"Previous Section -","events":"Events","editAccountInformation":"Edit your account information","distanceColon":"Distance:","alertStatusActive":"Active","fastesDriveWhenTraffic":"This is the fastest drive when taking traffic into consideration.","loadingOr":"Loading or","registeredUser":"Sign In","pleaseverifyphone":"Please verify phone","reverseDirection":"Reverse Direction","noRecentRoads":"There are no Recently Viewed roads available at this time.  To use this feature, first select a road or two from the 'Hotspots' or 'All Roads' link above.","createAnAlert":"Create an Alert","imagesPathWsCommon":"ws-common/","imagesPathWsMy":"ws-my/","orBrowserMetroAreaWithLinks":"Or browse ${0} Area traffic with the links below:","activeAlert":"Activate Alert","labelTravelTime":"Travel Time","friday":"Friday","alertErrorMsg":"To create an Alert, you first need to save a Drive, Use the 'Check your Drive Time' form above to enter a start and end point, press 'Go', and then save your Drive. You will then be able to set up an Alert.","createEmailAlert":"Create an e-mail alert","restAPIFailureMessage":"There was an error retrieving data from the server.  Please try again later.","monday":"Monday","bookmarkDrive":"Bookmark Drive","forUpToDateTrafficCall":"For up-to-date Traffic on the road, call 1-866-MY-TRAFC","cSevere":"Severe","currentConditions":"Current Conditions","sorryNotAbleToFindAnyResults":"We're sorry but we were not able find any results for you.","usernameColon":"Username","hDeleteAlert":"Delete Alert","clickToSort":"Click to sort","labelType":"Type","backToColon":"Back to:","roadwork":"Construction","zoomIn":"Zoom in","hdrive":"Drive","imagesPathHomepage":"homepage/","november":"November","drivesNotSaved":"We're sorry.  An error occurred, and the following drives were not saved:","browseTrafficInfo":"View City Area Information","hasBeenSucessfullySavedTo":"has been sucessfully saved to","findRoadOrPlace":"Find traffic conditions for:","weReSorryButWeWereNotAbleToFindColon":"We're sorry but we were not able to find:","easyAccessUpToTheMinuteTrafficInfo":"Get easy access to your drives in a MyTraffic account","atText":"at","jun":"Jun","milesAbbr":"mi","region":"Region","jul":"Jul","hotspots":"Hotspots","imagesPathWsMetro":"ws-metro/","sampleText":"Sample Text","loginpageForgotPassword":"Forgot Password?","sampleEmailAlert":"Sample Email Alert","TodayBestCommuteBasedOnSecondInfo":"Find today's best commute based on up-to-the-minute info","weProtectYourInformation":"We protect the security and confidentiality of your information","loginText":"Login","andText":"and","manageAccount":"Manage Your MyTraffic Account","moreRoadworkBelow":"More Construction Below","addSPEditSPAlerts":"Add Edit Alerts","foundIncidents":"Found Incidents:","updates2Seconds":"Updates 2 Seconds","may":"May","hearSample":"Hear Sample","removeDestination":"Remove destination","couldNotBeSaved":"could not be saved","viewAll":"View all","mar":"Mar","renameDrive":"Rename Drive","addAWaypoint":"Add a waypoint","labelDelay":"Delay","imagesPathCityselectwidget":"citySelectWidget/","yourPrivacyIsImportant":"Your privacy is important to us.","areaAlerts":"Area Breaking Traffic News","imagesPathWsRouting":"ws-routing/","audioPath":"/audio/en_US/","nvtAdMessagesMissingAdSetup":"Page: - Missing Ad Setup for location:","fromHere":"From here","createTextMessageAlert":"Create a text message alert","labelDriveName":"Drive Name","max30Characters":"(Maximum of 30 characters)","area":"Area","areYouSureWantDeleteDrive":"Are you sure you want to delete this drive","completeTrafficConditionsMyArea":"Get complete traffic conditions for your area","trafficDotCom":"Traffic.com","labelIncidentType":"Incident Type","MOBI_DOT_TRAFFIC_DOT_COM":"http://mobi.traffic.com","stayConnectedMostCurrentTrafficNews":"Stay connected to your current traffic news via email, phone or text","tohere":"To here","labelDistance":"Distance","reorderDrives":"Reorder Drives","areaWeather":"Weather","saveThisDrive":"Save this Drive","isNowsuspended":"is now Suspended.","delayColon":"Delay:","majorEvent":"Major Event","signUpFree":"Sign Up. It's Free!","cTo":"to","august":"August","setUpAlertsForColon":"Set Up Alert For:","directDrive":"Direct Drive","fiveDayForecast":"Five Day Forecast","areaTrafficSummary":"Area Traffic Summary","clickHereToViewAlerts":"View breaking traffic news.","buttonSave":"Save","poweredByrafficLand":"Powered by TrafficLand","alerts":"Alerts","yourAlert":"Your alert","allRoads":"All Roads","newUserText":"New User","labelTime":"Time","between":"between","addOrEditAlerts":"Add/Edit Alerts","labelDirection":"Direction","saveText":"Save","addAnother":"Add Another","weFoundTwoDrives":"Your Drive Times and Directions","phoneCall":"Phone call","imagesPathSheilds":"shields/","lowColon":"Low:","enterNameForDrive2Here":"Enter a name for Drive 2 here.","backToFullRoad":"Back to Full Road:","moreHotspotsDetails":"More Hotspots Details","february":"February","cImpact":"Impact","scheduleAlerts":"Schedule Alerts","atSpeedLimit":"@ Speed Limit","pleaseCheckYourSearchTryAgain":"Please Check your search and try again","highColon":"High:","renameThisDriveColon":"Rename This Drive:","dec":"Dec","pluralS":"s","afterMeridian":"AM","nvtAdMessagesAdLocation":"Ad Location:","reverseThisDrive":"Reverse This Drive","mapIconsPath":"/images/en_US/mapIcons/","symbolF":"F","labelName":"Name","youHave":"You Have","getDetoursOnTheSpotChangingConditions":"Save regular and alternate drives for speedy comparison","more":"More","fastesDriveWithoutTraffic":"This is the most direct drive without taking traffic into consideration.","interstateForecast":"Interstate Forecast","hAlerts":"Alerts","nvtAdMessagesAdLocationsWereSetupNeverReferenced":"The following ad locations were setup for this page and never referenced:","postMeridain":"PM","createPhoneAlert":"Create a phone alert","hasBeenDeleted":"has been deleted","driveLimitExceeded":"We're sorry but you cannot create more than 20 drives. To add a new drive, please delete an existing drive first.","nov":"Nov","atSpeedLimitColon":"@ Speed Limit:","addressCityStateZIP":"Address, City, State, ZIP","privacyPolicy":"Privacy Policy","radioText":"radio","passwordColon":"Password","enterNameForDrive1Here":"Enter a name for Drive 1 here.","PleaseEnterStartPointAndEndPoint":"Please enter a Start Point and End Point below","signInRegister":"Please sign in to your account or register","newText":"new","labelJamFactorReg":"Jam Factor&reg;","checkCurrentTafficConditionsOnYourDrives":"Check current traffic conditions on your saved drives.","january":"January","imagesPathMapIcons":"mapIcons/","pleaseEnterNamesForDrive1AndDrive2":"Please enter the names for Drive1 and Drive2","seeYourDrive":"See Your Drive","precipitationMap":"Precipitation Map","gotoMyDrives":"Go to MyDrives","Step2Colon":"Step 2:","searchTraffic":"Search Traffic","clickIconToViewCamera":"Click icon to view camera ...","saturday":"Saturday","textOnly":"Text Only","swfPath":"/swf/en_US","aug":"Aug","addAnAlert":"Add an Alert","sorryCouldNotFindARouteFromTo":"We're sorry but we could not find a route from ${0} to ${1}","setUpRoutes":"Set Up Drives","removeStartpoint":"Remove startpoint","backtoMyDrives":"Back to My Drives","moreIncidentsBelow":"More Incidents Below","cancelAccount":"Cancel Account","moreDrivesBelow":"More Drives Below","nAAbbr":"N/A","noChangesToForm":"No changes made to the form. Do you still want to save the form?","voicePhoneCall":"Phone Call","imagesPathWsMetroAgencylogo":"ws-metro/agencyLogo/","didYouMeanColon":"Did you mean:","whatIsThis":"What&#39;s this?","hr":"hr","sponsoredBy":"Sponsored by:","renameADriveColon":"Rename a Drive:","areaTrafficResources":"area traffic resources","alertActivated":"Alert Activated","FREE_MOBILE_TRAFFIC_WEBSITE":"A free mobile traffic website that offers fresh information about traffic hotspots&ndash;everything from travel times and vehicle speeds to delay times and accident reports&ndash;via your web-enabled wireless device.","phoneText":"Phone","hasBeenRenamed":"has been renamed","buttonCancel":"Cancel","signUp":"Sign Up","sep":"Sep","areaHotSpots":"Area Hotspots","june":"June","myTrafficNews":"MyTraffic RSS","september":"September","deleteDrive":"Delete Drive","cModerate":"Moderate","viewSample":"View Sample","getAlternateRoutesDetoursAsConditionsChange":"Save regular and alternate drives for speedy comparison","changeContactInformationHint":"Change or update your contact information, including the email addresses or phone numbers to which your MyTraffic Alerts are delivered","fullRoad":"All Sections","logout":"Sign Out","DirectionsColon":"Drive Time &amp; Directions:","SIGNIN_REGISTER":"Deprecated - Use signInRegister instead.  This should be deleted.","alertsAssociatedWithThisDriveDeleted":"Any alerts associated with this drive will be deleted.","labelStatus":"Status","removeWaypoint":"Remove waypoint","dontProvideDetailedTrafficReports":"We don't currently provide detailed traffic reports for the roads in your drive.","areaIncidents":"Area Incidents","Step1Colon":"Step 1:","weDoNotSellYourInformation":"We do not sell your information to others.","addAlerts":"Add Alerts","changeContactInformation":"Change Account Information","imagesPathWeatherIcons":"weatherIcons/","moreDetailsBelow":"More Details Below","july":"July","areaJamFactor":"Area Jam Factor","closeModal":"Close Modal","altTextClickToSortOn":"Click to sort on","bookmarkRoad":"Bookmark Road","imagesPathWeatherwidget":"weatherWidget/","sTextMessage":"","roadClosed":"Road Closed","areYouSureWantToDeleteTheAlert":"Are you sure you want to delete this alert?","reorderADrive":"Reorder a Drive","october":"October","addText":"Add","drive":"Drive","moreRoadsBelow":"More Roads Below","mph":"mph","moreMassTransitBelow":"More Mass Transit Below","enterVerificationCode":"Please enter your verification code:","oct":"Oct","notifiedWhenTingsHappenOnYouRoute":"Be notified when traffic for your drives get bad","hEditAlert":"Edit Alert","buttonGo":"Go","SourceColon":"Source:","addADrive":"Add a Drive","getStarted":"Get started now!","andDrive":"and Drive","apr":"Apr","imagesPathWsCommonWeatherwidget":"ws-common/weatherWidget/","labelAlertName":"Alert Name","sendVerification":"Send Verification","cancelAccountHint":"Cancel your account and delete all your drives and alerts","printThisDrive":"Print this Drive","clickToView":"Click to view","editAlert":"edit alert","phoneNumber":"Phone Number","suspendAlert":"Suspend Alert","clickIconForMoreInformation":"Click icon for more information ...","swapYourStartEndPointsFindBestWay":"View the best way back.","noText":"No","turnByTurnDirections":"Turn-By-Turn Directions","backTo":"Back to","noHotSpotsInArea":"We did not find any traffic hotspots in this area.","imagesPathBullets":"bullets/","labelStep":"Step","majorRoads":"Major Roads","clickCityBelowToViewYourMetroRegion":"Click below to view city area traffic","december":"December","nextSection":"Next Section -","getDetoursAlternates":"Get Alternate Routes","centerMap":"Center map","cFrom":"from","changePasswordHint":"Change your account password","giveYourselfOptionsWhenGetGridlocked":"View your best option before you hit the road","drives":"Drives","yourTrafficAlerts":"Your Traffic Alerts","labelB":"B","saveYourDrive":"Save Your Drive","labelA":"A","backToSearchResults":"Back to Search Results","areaTrafficLinksBelow":"Area traffic with the links below:","loadingText":"loading","passInmetroId":"You must pass in a metroId","customDrive":"Custom Drive","sampleTextMessageAlert":"Sample Text Message Alert","areYouSureYouWantToDeleteThisDevice":"Are you sure you want to delete this device?","loginpageUsername":"Username","loginpagePassword":"Password","jsAdvertisement":"Advertisement","yesText":"Yes","pleaseNoteWeOnlySaveMajorRoads":"*Please note we only save the major roads of the first city area in your drive.","cReceive":"Receive","nameYourDrives":"Name Your Drives","myTrafficSignIn":"MyTraffic Sign In","browseTraffic":"Browse Traffic","editText":"Edit","april":"April","imagesPath":"/images/en_US/","listenSampleAlert":"Listen to a Sample Alert","setupCustomAlertsSendDirectlyToPhone":"Receive custom alerts, and get them by email, phone and text","hAlert":"Alert","currentConditionsRouteYouDrive":"See current conditions on the route you drive from start to finish","goback":"Go back","backBrowseTraffic":"Back to Browse Traffic","sampleAlerts":"View Sample Alerts","OrBrowse":"Or browse","isNowactivated":"is now Activated.","timestampRefresh":"Refresh","goToMyTraffic":"Go To MyTraffic","nearbyIncidents":"Nearby Incidents:","myTraffic":"MyTraffic","drive2":"Drive 2","drive1":"Drive 1","march":"March","selectTheDrivesYouWantSave":"Select the Drives You Want to Save*","byRoad":"By Road:","timestampPageUpdated":"Page Updated","traffic":"traffic","rememberMe":"Remember Me","newUser":"New User?","weatherIconsPath":"/images/en_US/weatherIcons/","clickToSeeItemOnMap":"Click to see item on map","loadingDots":"Loading . . .","hRenameAlert":"Rename Alert","noChangesMadeToTheForm":"No changes made to the form. Do you still want to save the form?","viewSampleAlerts":"View Sample Alerts","thursday":"Thursday","citySelectMetroClose":"/images/en_US/citySelectWidget/metro_close.jpg","forThisDrive":"for this drive:","theWeatherChannel":"The Weather Channel","testVariable":"From ${0} to ${1}","imagesPathjamFactorPrinting":"jamFactorPrinting/","scheduled":"Scheduled","changePassword":"Change Password","moreResultsBelow":"More Results Below","delayTimeColon":"Delay:","forgotyourpassword":"Forgot your password?","ongoing":"Ongoing","currentDriveTimeColon":"Drive Time Now:","deviceText":"Device Text","airportConditions":"Airport Conditions","viewThisDrive":"View this Drive","resetYourPassword":"Forgot Password","imagesPathModal":"modal/","zoomOut":"Zoom out","getRealTimeTrafficAlertsForThisDrive":"Get real-time traffic alerts for this drive sent by email, phone, or text","feb":"Feb","pleaseTryAnotherAddress":"Please try another address.","backToRecentlyViewed":"Back to Recently Viewed","images":"/images/","viewPreviousSearchEntries":"View previous search entries.","sunday":"Sunday"};
function nvthash(B){var A=B.length;var D=0;for(var C=0;C<A;C++){D+=new Number(B.indexOf(C));}if(D<0){D=D*-1;
}return D%10;}commonData.staticServer=function(C){var B=nvthash(C);var A=commonData.staticServerName.split("//");
if(A[1].charAt(0)=="t"){return A[0]+"//"+"t"+B+A[1].substring(1);}else{return A[0]+"//"+B+A[1];}};var Prototype={Version:"1.6.0.2",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A;
}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false;}var Class={create:function(){var E=null,D=$A(arguments);
if(Object.isFunction(D[0])){E=D.shift();}function A(){this.initialize.apply(this,arguments);}Object.extend(A,Class.Methods);
A.superclass=E;A.subclasses=[];if(E){var B=function(){};B.prototype=E.prototype;A.prototype=new B;E.subclasses.push(A);
}for(var C=0;C<D.length;C++){A.addMethods(D[C]);}if(!A.prototype.initialize){A.prototype.initialize=Prototype.emptyFunction;
}A.prototype.constructor=A;return A;}};Class.Methods={addMethods:function(G){var C=this.superclass&&this.superclass.prototype;
var B=Object.keys(G);if(!Object.keys({toString:true}).length){B.push("toString","valueOf");}for(var A=0,D=B.length;
A<D;A++){var F=B[A],E=G[F];if(C&&Object.isFunction(E)&&E.argumentNames().first()=="$super"){var H=E,E=Object.extend((function(I){return function(){return C[I].apply(this,arguments);
};})(F).wrap(H),{valueOf:function(){return H;},toString:function(){return H.toString();}});}this.prototype[F]=E;
}return this;}};var Abstract={};Object.extend=function(A,C){for(var B in C){A[B]=C[B];}return A;};Object.extend(Object,{inspect:function(A){try{if(Object.isUndefined(A)){return"undefined";
}if(A===null){return"null";}return A.inspect?A.inspect():String(A);}catch(B){if(B instanceof RangeError){return"...";
}throw B;}},toJSON:function(A){var C=typeof A;switch(C){case"undefined":case"function":case"unknown":return ;
case"boolean":return A.toString();}if(A===null){return"null";}if(A.toJSON){return A.toJSON();}if(Object.isElement(A)){return ;
}var B=[];for(var E in A){var D=Object.toJSON(A[E]);if(!Object.isUndefined(D)){B.push(E.toJSON()+": "+D);
}}return"{"+B.join(", ")+"}";},toQueryString:function(A){return $H(A).toQueryString();},toHTML:function(A){return A&&A.toHTML?A.toHTML():String.interpret(A);
},keys:function(A){var B=[];for(var C in A){B.push(C);}return B;},values:function(B){var A=[];for(var C in B){A.push(B[C]);
}return A;},clone:function(A){return Object.extend({},A);},isElement:function(A){return A&&A.nodeType==1;
},isArray:function(A){return A!=null&&typeof A=="object"&&"splice" in A&&"join" in A;},isHash:function(A){return A instanceof Hash;
},isFunction:function(A){return typeof A=="function";},isString:function(A){return typeof A=="string";
},isNumber:function(A){return typeof A=="number";},isUndefined:function(A){return typeof A=="undefined";
}});Object.extend(Function.prototype,{argumentNames:function(){var A=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");
return A.length==1&&!A[0]?[]:A;},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this;
}var A=this,C=$A(arguments),B=C.shift();return function(){return A.apply(B,C.concat($A(arguments)));};
},bindAsEventListener:function(){var A=this,C=$A(arguments),B=C.shift();return function(D){return A.apply(B,[D||window.event].concat(C));
};},curry:function(){if(!arguments.length){return this;}var A=this,B=$A(arguments);return function(){return A.apply(this,B.concat($A(arguments)));
};},delay:function(){var A=this,B=$A(arguments),C=B.shift()*1000;return window.setTimeout(function(){return A.apply(A,B);
},C);},wrap:function(B){var A=this;return function(){return B.apply(this,[A.bind(this)].concat($A(arguments)));
};},methodize:function(){if(this._methodized){return this._methodized;}var A=this;return this._methodized=function(){return A.apply(null,[this].concat($A(arguments)));
};}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"';
};var Try={these:function(){var C;for(var B=0,D=arguments.length;B<D;B++){var A=arguments[B];try{C=A();
break;}catch(E){}}return C;}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(A){return String(A).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1");
};var PeriodicalExecuter=Class.create({initialize:function(B,A){this.callback=B;this.frequency=A;this.currentlyExecuting=false;
this.registerCallback();},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},execute:function(){this.callback(this);},stop:function(){if(!this.timer){return ;}clearInterval(this.timer);
this.timer=null;},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;
this.execute();}finally{this.currentlyExecuting=false;}}}});Object.extend(String,{interpret:function(A){return A==null?"":String(A);
},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(E,C){var A="",D=this,B;
C=arguments.callee.prepareReplacement(C);while(D.length>0){if(B=D.match(E)){A+=D.slice(0,B.index);A+=String.interpret(C(B));
D=D.slice(B.index+B[0].length);}else{A+=D,D="";}}return A;},sub:function(C,A,B){A=this.gsub.prepareReplacement(A);
B=Object.isUndefined(B)?1:B;return this.gsub(C,function(D){if(--B<0){return D[0];}return A(D);});},scan:function(B,A){this.gsub(B,A);
return String(this);},truncate:function(B,A){B=B||30;A=Object.isUndefined(A)?"...":A;return this.length>B?this.slice(0,B-A.length)+A:String(this);
},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");
},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");},extractScripts:function(){var B=new RegExp(Prototype.ScriptFragment,"img");
var A=new RegExp(Prototype.ScriptFragment,"im");return(this.match(B)||[]).map(function(C){return(C.match(A)||["",""])[1];
});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script);});
},escapeHTML:function(){var A=arguments.callee;A.text.data=this;return A.div.innerHTML;},unescapeHTML:function(){var A=new Element("div");
A.innerHTML=this.stripTags();return A.childNodes[0]?(A.childNodes.length>1?$A(A.childNodes).inject("",function(B,C){return B+C.nodeValue;
}):A.childNodes[0].nodeValue):"";},toQueryParams:function(B){var A=this.strip().match(/([^?#]*)(#.*)?$/);
if(!A){return{};}return A[1].split(B||"&").inject({},function(E,F){if((F=F.split("="))[0]){var C=decodeURIComponent(F.shift());
var D=F.length>1?F.join("="):F[0];if(D!=undefined){D=decodeURIComponent(D);}if(C in E){if(!Object.isArray(E[C])){E[C]=[E[C]];
}E[C].push(D);}else{E[C]=D;}}return E;});},toArray:function(){return this.split("");},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);
},times:function(A){return A<1?"":new Array(A+1).join(this);},camelize:function(){var D=this.split("-"),A=D.length;
if(A==1){return D[0];}var C=this.charAt(0)=="-"?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0];for(var B=1;
B<A;B++){C+=D[B].charAt(0).toUpperCase()+D[B].substring(1);}return C;},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();
},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();
},dasherize:function(){return this.gsub(/_/,"-");},inspect:function(B){var A=this.gsub(/[\x00-\x1f\\]/,function(C){var D=String.specialChar[C[0]];
return D?D:"\\u00"+C[0].charCodeAt().toPaddedString(2,16);});if(B){return'"'+A.replace(/"/g,'\\"')+'"';
}return"'"+A.replace(/'/g,"\\'")+"'";},toJSON:function(){return this.inspect(true);},unfilterJSON:function(A){return this.sub(A||Prototype.JSONFilter,"#{1}");
},isJSON:function(){var A=this;if(A.blank()){return false;}A=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");
return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(A);},evalJSON:function(sanitize){var json=this.unfilterJSON();
try{if(!sanitize||json.isJSON()){return eval("("+json+")");}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());
},include:function(A){return this.indexOf(A)>-1;},startsWith:function(A){return this.indexOf(A)===0;},endsWith:function(A){var B=this.length-A.length;
return B>=0&&this.lastIndexOf(A)===B;},empty:function(){return this=="";},blank:function(){return/^\s*$/.test(this);
},interpolate:function(A,B){return new Template(this,B).evaluate(A);}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
},unescapeHTML:function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">");
}});}String.prototype.gsub.prepareReplacement=function(B){if(Object.isFunction(B)){return B;}var A=new Template(B);
return function(C){return A.evaluate(C);};};String.prototype.parseQuery=String.prototype.toQueryParams;
Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});
with(String.prototype.escapeHTML){div.appendChild(text);}var Template=Class.create({initialize:function(A,B){this.template=A.toString();
this.pattern=B||Template.Pattern;},evaluate:function(A){if(Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements();
}return this.template.gsub(this.pattern,function(D){if(A==null){return"";}var F=D[1]||"";if(F=="\\"){return D[2];
}var B=A,G=D[3];var E=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;D=E.exec(G);if(D==null){return F;}while(D!=null){var C=D[1].startsWith("[")?D[2].gsub("\\\\]","]"):D[1];
B=B[C];if(null==B||""==D[3]){break;}G=G.substring("["==D[3]?D[1].length:D[0].length);D=E.exec(G);}return F+String.interpret(B);
});}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(C,B){var A=0;
C=C.bind(B);try{this._each(function(E){C(E,A++);});}catch(D){if(D!=$break){throw D;}}return this;},eachSlice:function(D,C,B){C=C?C.bind(B):Prototype.K;
var A=-D,E=[],F=this.toArray();while((A+=D)<F.length){E.push(F.slice(A,A+D));}return E.collect(C,B);},all:function(C,B){C=C?C.bind(B):Prototype.K;
var A=true;this.each(function(E,D){A=A&&!!C(E,D);if(!A){throw $break;}});return A;},any:function(C,B){C=C?C.bind(B):Prototype.K;
var A=false;this.each(function(E,D){if(A=!!C(E,D)){throw $break;}});return A;},collect:function(C,B){C=C?C.bind(B):Prototype.K;
var A=[];this.each(function(E,D){A.push(C(E,D));});return A;},detect:function(C,B){C=C.bind(B);var A;
this.each(function(E,D){if(C(E,D)){A=E;throw $break;}});return A;},findAll:function(C,B){C=C.bind(B);
var A=[];this.each(function(E,D){if(C(E,D)){A.push(E);}});return A;},grep:function(D,C,B){C=C?C.bind(B):Prototype.K;
var A=[];if(Object.isString(D)){D=new RegExp(D);}this.each(function(F,E){if(D.match(F)){A.push(C(F,E));
}});return A;},include:function(A){if(Object.isFunction(this.indexOf)){if(this.indexOf(A)!=-1){return true;
}}var B=false;this.each(function(C){if(C==A){B=true;throw $break;}});return B;},inGroupsOf:function(B,A){A=Object.isUndefined(A)?null:A;
return this.eachSlice(B,function(C){while(C.length<B){C.push(A);}return C;});},inject:function(A,C,B){C=C.bind(B);
this.each(function(E,D){A=C(A,E,D);});return A;},invoke:function(B){var A=$A(arguments).slice(1);return this.map(function(C){return C[B].apply(C,A);
});},max:function(C,B){C=C?C.bind(B):Prototype.K;var A;this.each(function(E,D){E=C(E,D);if(A==null||E>=A){A=E;
}});return A;},min:function(C,B){C=C?C.bind(B):Prototype.K;var A;this.each(function(E,D){E=C(E,D);if(A==null||E<A){A=E;
}});return A;},partition:function(D,B){D=D?D.bind(B):Prototype.K;var C=[],A=[];this.each(function(F,E){(D(F,E)?C:A).push(F);
});return[C,A];},pluck:function(B){var A=[];this.each(function(C){A.push(C[B]);});return A;},reject:function(C,B){C=C.bind(B);
var A=[];this.each(function(E,D){if(!C(E,D)){A.push(E);}});return A;},sortBy:function(B,A){B=B.bind(A);
return this.map(function(D,C){return{value:D,criteria:B(D,C)};}).sort(function(F,E){var D=F.criteria,C=E.criteria;
return D<C?-1:D>C?1:0;}).pluck("value");},toArray:function(){return this.map();},zip:function(){var B=Prototype.K,A=$A(arguments);
if(Object.isFunction(A.last())){B=A.pop();}var C=[this].concat(A).map($A);return this.map(function(E,D){return B(C.pluck(D));
});},size:function(){return this.toArray().length;},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">";
}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});
function $A(C){if(!C){return[];}if(C.toArray){return C.toArray();}var B=C.length||0,A=new Array(B);while(B--){A[B]=C[B];
}return A;}if(Prototype.Browser.WebKit){$A=function(C){if(!C){return[];}if(!(Object.isFunction(C)&&C=="[object NodeList]")&&C.toArray){return C.toArray();
}var B=C.length||0,A=new Array(B);while(B--){A[B]=C[B];}return A;};}Array.from=$A;Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Object.extend(Array.prototype,{_each:function(B){for(var A=0,C=this.length;
A<C;A++){B(this[A]);}},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];
},compact:function(){return this.select(function(A){return A!=null;});},flatten:function(){return this.inject([],function(B,A){return B.concat(Object.isArray(A)?A.flatten():[A]);
});},without:function(){var A=$A(arguments);return this.select(function(B){return !A.include(B);});},reverse:function(A){return(A!==false?this:this.toArray())._reverse();
},reduce:function(){return this.length>1?this:this[0];},uniq:function(A){return this.inject([],function(D,C,B){if(0==B||(A?D.last()!=C:!D.include(C))){D.push(C);
}return D;});},intersect:function(A){return this.uniq().findAll(function(B){return A.detect(function(C){return B===C;
});});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]";
},toJSON:function(){var A=[];this.each(function(B){var C=Object.toJSON(B);if(!Object.isUndefined(C)){A.push(C);
}});return"["+A.join(", ")+"]";}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach;
}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(C,A){A||(A=0);var B=this.length;if(A<0){A=B+A;
}for(;A<B;A++){if(this[A]===C){return A;}}return -1;};}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(B,A){A=isNaN(A)?this.length:(A<0?this.length+A:A)+1;
var C=this.slice(0,A).reverse().indexOf(B);return(C<0)?C:A-C-1;};}Array.prototype.toArray=Array.prototype.clone;
function $w(A){if(!Object.isString(A)){return[];}A=A.strip();return A?A.split(/\s+/):[];}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var E=[];
for(var B=0,C=this.length;B<C;B++){E.push(this[B]);}for(var B=0,C=arguments.length;B<C;B++){if(Object.isArray(arguments[B])){for(var A=0,D=arguments[B].length;
A<D;A++){E.push(arguments[B][A]);}}else{E.push(arguments[B]);}}return E;};}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);
},succ:function(){return this+1;},times:function(A){$R(0,this,true).each(A);return this;},toPaddedString:function(C,B){var A=this.toString(B||10);
return"0".times(C-A.length)+A;},toJSON:function(){return isFinite(this)?this.toString():"null";}});$w("abs round ceil floor").each(function(A){Number.prototype[A]=Math[A].methodize();
});function $H(A){return new Hash(A);}var Hash=Class.create(Enumerable,(function(){function A(B,C){if(Object.isUndefined(C)){return B;
}return B+"="+encodeURIComponent(String.interpret(C));}return{initialize:function(B){this._object=Object.isHash(B)?B.toObject():Object.clone(B);
},_each:function(C){for(var B in this._object){var D=this._object[B],E=[B,D];E.key=B;E.value=D;C(E);}},set:function(B,C){return this._object[B]=C;
},get:function(B){return this._object[B];},unset:function(B){var C=this._object[B];delete this._object[B];
return C;},toObject:function(){return Object.clone(this._object);},keys:function(){return this.pluck("key");
},values:function(){return this.pluck("value");},index:function(C){var B=this.detect(function(D){return D.value===C;
});return B&&B.key;},merge:function(B){return this.clone().update(B);},update:function(B){return new Hash(B).inject(this,function(C,D){C.set(D.key,D.value);
return C;});},toQueryString:function(){return this.map(function(D){var C=encodeURIComponent(D.key),B=D.value;
if(B&&typeof B=="object"){if(Object.isArray(B)){return B.map(A.curry(C)).join("&");}}return A(C,B);}).join("&");
},inspect:function(){return"#<Hash:{"+this.map(function(B){return B.map(Object.inspect).join(": ");}).join(", ")+"}>";
},toJSON:function(){return Object.toJSON(this.toObject());},clone:function(){return new Hash(this);}};
})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(C,A,B){this.start=C;
this.end=A;this.exclusive=B;},_each:function(A){var B=this.start;while(this.include(B)){A(B);B=B.succ();
}},include:function(A){if(A<this.start){return false;}if(this.exclusive){return A<this.end;}return A<=this.end;
}});var $R=function(C,A,B){return new ObjectRange(C,A,B);};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest();
},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");
})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A);
},register:function(A){if(!this.include(A)){this.responders.push(A);}},unregister:function(A){this.responders=this.responders.without(A);
},dispatch:function(D,B,C,A){this.each(function(E){if(Object.isFunction(E[D])){try{E[D].apply(E,[B,C,A]);
}catch(F){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;
},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=Class.create({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};
Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams();
}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject();
}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,B,A){$super(A);
this.transport=Ajax.getTransport();this.request(B);},request:function(B){this.url=B;this.method=this.options.method;
var D=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){D["_method"]=this.method;
this.method="post";}this.parameters=D;if(D=Object.toQueryString(D)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+D;
}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_=";}}}try{var A=new Ajax.Response(this);
if(this.options.onCreate){this.options.onCreate(A);}Ajax.Responders.dispatch("onCreate",this,A);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1);}this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||D):null;this.transport.send(this.body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange();}}catch(C){this.dispatchException(C);
}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState);
}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){E["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){E["Connection"]="close";
}}if(typeof this.options.requestHeaders=="object"){var C=this.options.requestHeaders;if(Object.isFunction(C.push)){for(var B=0,D=C.length;
B<D;B+=2){E[C[B]]=C[B+1];}}else{$H(C).each(function(F){E[F.key]=F.value;});}}for(var A in E){this.transport.setRequestHeader(A,E[A]);
}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300);},getStatus:function(){try{return this.transport.status||0;
}catch(A){return 0;}},respondToReadyState:function(A){var C=Ajax.Request.Events[A],B=new Ajax.Response(this);
if(C=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON);
}catch(D){this.dispatchException(D);}var E=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&E&&E.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse();
}}try{(this.options["on"+C]||Prototype.emptyFunction)(B,B.headerJSON);Ajax.Responders.dispatch("on"+C,this,B,B.headerJSON);
}catch(D){this.dispatchException(D);}if(C=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;
}},isSameOrigin:function(){var A=this.url.match(/^\s*https?:\/\/[^\/]*/);return !A||(A[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}));
},getHeader:function(A){try{return this.transport.getResponseHeader(A)||null;}catch(B){return null;}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON());
}catch(e){this.dispatchException(e);}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);
Ajax.Responders.dispatch("onException",this,A);}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Response=Class.create({initialize:function(C){this.request=C;var D=this.transport=C.transport,A=this.readyState=D.readyState;
if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();
this.responseText=String.interpret(D.responseText);this.headerJSON=this._getHeaderJSON();}if(A==4){var B=D.responseXML;
this.responseXML=Object.isUndefined(B)?null:B;this.responseJSON=this._getResponseJSON();}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||"";
}catch(A){return"";}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders();
}catch(A){return null;}},getResponseHeader:function(A){return this.transport.getResponseHeader(A);},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders();
},_getHeaderJSON:function(){var A=this.getHeader("X-JSON");if(!A){return null;}A=decodeURIComponent(escape(A));
try{return A.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin());}catch(B){this.request.dispatchException(B);
}},_getResponseJSON:function(){var A=this.request.options;if(!A.evalJSON||(A.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null;
}try{return this.responseText.evalJSON(A.sanitizeJSON||!this.request.isSameOrigin());}catch(B){this.request.dispatchException(B);
}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,A,C,B){this.container={success:(A.success||A),failure:(A.failure||(A.success?null:A))};
B=Object.clone(B);var D=B.onComplete;B.onComplete=(function(E,F){this.updateContent(E.responseText);if(Object.isFunction(D)){D(E,F);
}}).bind(this);$super(C,B);},updateContent:function(D){var C=this.container[this.success()?"success":"failure"],A=this.options;
if(!A.evalScripts){D=D.stripScripts();}if(C=$(C)){if(A.insertion){if(Object.isString(A.insertion)){var B={};
B[A.insertion]=D;C.insert(B);}else{A.insertion(C,D);}}else{C.update(D);}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,A,C,B){$super(B);
this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);
this.updater={};this.container=A;this.url=C;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent();},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=A.responseText;}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency);
},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(B){if(arguments.length>1){for(var A=0,D=[],C=arguments.length;
A<C;A++){D.push($(arguments[A]));}return D;}if(Object.isString(B)){B=document.getElementById(B);}return Element.extend(B);
}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,A){var C=[];var E=document.evaluate(F,$(A)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var B=0,D=E.snapshotLength;B<D;B++){C.push(Element.extend(E.snapshotItem(B)));}return C;};}if(!window.Node){var Node={};
}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});
}(function(){var A=this.Element;this.Element=function(D,C){C=C||{};D=D.toLowerCase();var B=Element.cache;
if(Prototype.Browser.IE&&C.name){D="<"+D+' name="'+C.name+'">';delete C.name;return Element.writeAttribute(document.createElement(D),C);
}if(!B[D]){B[D]=Element.extend(document.createElement(D));}return Element.writeAttribute(B[D].cloneNode(false),C);
};Object.extend(this.Element,A||{});}).call(window);Element.cache={};Element.Methods={visible:function(A){return $(A).style.display!="none";
},toggle:function(A){A=$(A);Element[Element.visible(A)?"hide":"show"](A);return A;},hide:function(A){$(A).style.display="none";
return A;},show:function(A){$(A).style.display="";return A;},remove:function(A){A=$(A);A.parentNode.removeChild(A);
return A;},update:function(A,B){A=$(A);if(B&&B.toElement){B=B.toElement();}if(Object.isElement(B)){return A.update().insert(B);
}B=Object.toHTML(B);A.innerHTML=B.stripScripts();B.evalScripts.bind(B).defer();return A;},replace:function(B,C){B=$(B);
if(C&&C.toElement){C=C.toElement();}else{if(!Object.isElement(C)){C=Object.toHTML(C);var A=B.ownerDocument.createRange();
A.selectNode(B);C.evalScripts.bind(C).defer();C=A.createContextualFragment(C.stripScripts());}}B.parentNode.replaceChild(C,B);
return B;},insert:function(C,E){C=$(C);if(Object.isString(E)||Object.isNumber(E)||Object.isElement(E)||(E&&(E.toElement||E.toHTML))){E={bottom:E};
}var D,F,B,G;for(var A in E){D=E[A];A=A.toLowerCase();F=Element._insertionTranslations[A];if(D&&D.toElement){D=D.toElement();
}if(Object.isElement(D)){F(C,D);continue;}D=Object.toHTML(D);B=((A=="before"||A=="after")?C.parentNode:C).tagName.toUpperCase();
G=Element._getContentFromAnonymousElement(B,D.stripScripts());if(A=="top"||A=="after"){G.reverse();}G.each(F.curry(C));
D.evalScripts.bind(D).defer();}return C;},wrap:function(B,C,A){B=$(B);if(Object.isElement(C)){$(C).writeAttribute(A||{});
}else{if(Object.isString(C)){C=new Element(C,A);}else{C=new Element("div",C);}}if(B.parentNode){B.parentNode.replaceChild(C,B);
}C.appendChild(B);return C;},inspect:function(B){B=$(B);var A="<"+B.tagName.toLowerCase();$H({"id":"id","className":"class"}).each(function(F){var E=F.first(),C=F.last();
var D=(B[E]||"").toString();if(D){A+=" "+C+"="+D.inspect(true);}});return A+">";},recursivelyCollect:function(A,C){A=$(A);
var B=[];while(A=A[C]){if(A.nodeType==1){B.push(Element.extend(A));}}return B;},ancestors:function(A){return $(A).recursivelyCollect("parentNode");
},descendants:function(A){return $(A).select("*");},firstDescendant:function(A){A=$(A).firstChild;while(A&&A.nodeType!=1){A=A.nextSibling;
}return $(A);},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[];}while(A&&A.nodeType!=1){A=A.nextSibling;
}if(A){return[A].concat($(A).nextSiblings());}return[];},previousSiblings:function(A){return $(A).recursivelyCollect("previousSibling");
},nextSiblings:function(A){return $(A).recursivelyCollect("nextSibling");},siblings:function(A){A=$(A);
return A.previousSiblings().reverse().concat(A.nextSiblings());},match:function(B,A){if(Object.isString(A)){A=new Selector(A);
}return A.match($(B));},up:function(B,D,A){B=$(B);if(arguments.length==1){return $(B.parentNode);}var C=B.ancestors();
return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A);},down:function(B,C,A){B=$(B);if(arguments.length==1){return B.firstDescendant();
}return Object.isNumber(C)?B.descendants()[C]:B.select(C)[A||0];},previous:function(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B));
}var C=B.previousSiblings();return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A);},next:function(C,D,B){C=$(C);
if(arguments.length==1){return $(Selector.handlers.nextElementSibling(C));}var A=C.nextSiblings();return Object.isNumber(D)?A[D]:Selector.findElement(A,D,B);
},select:function(){var A=$A(arguments),B=$(A.shift());return Selector.findChildElements(B,A);},adjacent:function(){var A=$A(arguments),B=$(A.shift());
return Selector.findChildElements(B.parentNode,A).without(B);},identify:function(B){B=$(B);var C=B.readAttribute("id"),A=arguments.callee;
if(C){return C;}do{C="anonymous_element_"+A.counter++;}while($(C));B.writeAttribute("id",C);return C;
},readAttribute:function(C,A){C=$(C);if(Prototype.Browser.IE){var B=Element._attributeTranslations.read;
if(B.values[A]){return B.values[A](C,A);}if(B.names[A]){A=B.names[A];}if(A.include(":")){return(!C.attributes||!C.attributes[A])?null:C.attributes[A].value;
}}return C.getAttribute(A);},writeAttribute:function(E,C,F){E=$(E);var B={},D=Element._attributeTranslations.write;
if(typeof C=="object"){B=C;}else{B[C]=Object.isUndefined(F)?true:F;}for(var A in B){C=D.names[A]||A;F=B[A];
if(D.values[A]){C=D.values[A](E,F);}if(F===false||F===null){E.removeAttribute(C);}else{if(F===true){E.setAttribute(C,C);
}else{E.setAttribute(C,F);}}}return E;},getHeight:function(A){return $(A).getDimensions().height;},getWidth:function(A){return $(A).getDimensions().width;
},classNames:function(A){return new Element.ClassNames(A);},hasClassName:function(A,B){if(!(A=$(A))){return ;
}var C=A.className;return(C.length>0&&(C==B||new RegExp("(^|\\s)"+B+"(\\s|$)").test(C)));},addClassName:function(A,B){if(!(A=$(A))){return ;
}if(!A.hasClassName(B)){A.className+=(A.className?" ":"")+B;}return A;},removeClassName:function(A,B){if(!(A=$(A))){return ;
}A.className=A.className.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," ").strip();return A;},toggleClassName:function(A,B){if(!(A=$(A))){return ;
}return A[A.hasClassName(B)?"removeClassName":"addClassName"](B);},cleanWhitespace:function(B){B=$(B);
var C=B.firstChild;while(C){var A=C.nextSibling;if(C.nodeType==3&&!/\S/.test(C.nodeValue)){B.removeChild(C);
}C=A;}return B;},empty:function(A){return $(A).innerHTML.blank();},descendantOf:function(D,C){D=$(D),C=$(C);
var F=C;if(D.compareDocumentPosition){return(D.compareDocumentPosition(C)&8)===8;}if(D.sourceIndex&&!Prototype.Browser.Opera){var E=D.sourceIndex,B=C.sourceIndex,A=C.nextSibling;
if(!A){do{C=C.parentNode;}while(!(A=C.nextSibling)&&C.parentNode);}if(A&&A.sourceIndex){return(E>B&&E<A.sourceIndex);
}}while(D=D.parentNode){if(D==F){return true;}}return false;},scrollTo:function(A){A=$(A);var B=A.cumulativeOffset();
window.scrollTo(B[0],B[1]);return A;},getStyle:function(B,C){B=$(B);C=C=="float"?"cssFloat":C.camelize();
var D=B.style[C];if(!D){var A=document.defaultView.getComputedStyle(B,null);D=A?A[C]:null;}if(C=="opacity"){return D?parseFloat(D):1;
}return D=="auto"?null:D;},getOpacity:function(A){return $(A).getStyle("opacity");},setStyle:function(B,C){B=$(B);
var E=B.style,A;if(Object.isString(C)){B.style.cssText+=";"+C;return C.include("opacity")?B.setOpacity(C.match(/opacity:\s*(\d?\.?\d*)/)[1]):B;
}for(var D in C){if(D=="opacity"){B.setOpacity(C[D]);}else{E[(D=="float"||D=="cssFloat")?(Object.isUndefined(E.styleFloat)?"cssFloat":"styleFloat"):D]=C[D];
}}return B;},setOpacity:function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;return A;
},getDimensions:function(C){C=$(C);var G=$(C).getStyle("display");if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight};
}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";B.position="absolute";
B.display="block";var H=C.clientWidth;var E=C.clientHeight;B.display=A;B.position=D;B.visibility=F;return{width:H,height:E};
},makePositioned:function(A){A=$(A);var B=Element.getStyle(A,"position");if(B=="static"||!B){A._madePositioned=true;
A.style.position="relative";if(window.opera){A.style.top=0;A.style.left=0;}}return A;},undoPositioned:function(A){A=$(A);
if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right="";
}return A;},makeClipping:function(A){A=$(A);if(A._overflow){return A;}A._overflow=Element.getStyle(A,"overflow")||"auto";
if(A._overflow!=="hidden"){A.style.overflow="hidden";}return A;},undoClipping:function(A){A=$(A);if(!A._overflow){return A;
}A.style.overflow=A._overflow=="auto"?"":A._overflow;A._overflow=null;return A;},cumulativeOffset:function(B){var A=0,C=0;
do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent;}while(B);return Element._returnOffset(C,A);
},positionedOffset:function(B){var A=0,D=0;do{A+=B.offsetTop||0;D+=B.offsetLeft||0;B=B.offsetParent;if(B){if(B.tagName=="BODY"){break;
}var C=Element.getStyle(B,"position");if(C!=="static"){break;}}}while(B);return Element._returnOffset(D,A);
},absolutize:function(B){B=$(B);if(B.getStyle("position")=="absolute"){return ;}var D=B.positionedOffset();
var F=D[1];var E=D[0];var C=B.clientWidth;var A=B.clientHeight;B._originalLeft=E-parseFloat(B.style.left||0);
B._originalTop=F-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;
B.style.position="absolute";B.style.top=F+"px";B.style.left=E+"px";B.style.width=C+"px";B.style.height=A+"px";
return B;},relativize:function(A){A=$(A);if(A.getStyle("position")=="relative"){return ;}A.style.position="relative";
var C=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);
A.style.top=C+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth;
return A;},cumulativeScrollOffset:function(B){var A=0,C=0;do{A+=B.scrollTop||0;C+=B.scrollLeft||0;B=B.parentNode;
}while(B);return Element._returnOffset(C,A);},getOffsetParent:function(A){if(A.offsetParent){return $(A.offsetParent);
}if(A==document.body){return $(A);}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return $(A);
}}return $(document.body);},viewportOffset:function(D){var A=0,C=0;var B=D;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;
if(B.offsetParent==document.body&&Element.getStyle(B,"position")=="absolute"){break;}}while(B=B.offsetParent);
B=D;do{if(!Prototype.Browser.Opera||B.tagName=="BODY"){A-=B.scrollTop||0;C-=B.scrollLeft||0;}}while(B=B.parentNode);
return Element._returnOffset(C,A);},clonePosition:function(B,D){var A=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
D=$(D);var E=D.viewportOffset();B=$(B);var F=[0,0];var C=null;if(Element.getStyle(B,"position")=="absolute"){C=B.getOffsetParent();
F=C.viewportOffset();}if(C==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop;
}if(A.setLeft){B.style.left=(E[0]-F[0]+A.offsetLeft)+"px";}if(A.setTop){B.style.top=(E[1]-F[1]+A.offsetTop)+"px";
}if(A.setWidth){B.style.width=D.offsetWidth+"px";}if(A.setHeight){B.style.height=D.offsetHeight+"px";
}return B;}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});
Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(D,B,C){switch(C){case"left":case"top":case"right":case"bottom":if(D(B,"position")==="static"){return null;
}case"height":case"width":if(!Element.visible(B)){return null;}var E=parseInt(D(B,C),10);if(E!==B["offset"+C.capitalize()]){return E+"px";
}var A;if(C==="height"){A=["border-top-width","padding-top","padding-bottom","border-bottom-width"];}else{A=["border-left-width","padding-left","padding-right","border-right-width"];
}return A.inject(E,function(F,G){var H=D(B,G);return H===null?F:F-parseInt(H,10);})+"px";default:return D(B,C);
}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(C,A,B){if(B==="title"){return A.title;
}return C(A,B);});}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(C,B){B=$(B);
var A=B.getStyle("position");if(A!=="static"){return C(B);}B.setStyle({position:"relative"});var D=C(B);
B.setStyle({position:A});return D;});$w("positionedOffset viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(E,C){C=$(C);
var B=C.getStyle("position");if(B!=="static"){return E(C);}var D=C.getOffsetParent();if(D&&D.getStyle("position")==="fixed"){D.setStyle({zoom:1});
}C.setStyle({position:"relative"});var F=E(C);C.setStyle({position:B});return F;});});Element.Methods.getStyle=function(A,B){A=$(A);
B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize();var C=A.style[B];if(!C&&A.currentStyle){C=A.currentStyle[B];
}if(B=="opacity"){if(C=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(C[1]){return parseFloat(C[1])/100;
}}return 1;}if(C=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px";
}return null;}return C;};Element.Methods.setOpacity=function(B,E){function F(G){return G.replace(/alpha\([^\)]*\)/gi,"");
}B=$(B);var A=B.currentStyle;if((A&&!A.hasLayout)||(!A&&B.style.zoom=="normal")){B.style.zoom=1;}var D=B.getStyle("filter"),C=B.style;
if(E==1||E===""){(D=F(D))?C.filter=D:C.removeAttribute("filter");return B;}else{if(E<0.00001){E=0;}}C.filter=F(D)+"alpha(opacity="+(E*100)+")";
return B;};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(A,B){return A.getAttribute(B,2);
},_getAttrNode:function(A,C){var B=A.getAttributeNode(C);return B?B.value:"";},_getEv:function(A,B){B=A.getAttribute(B);
return B?B.toString().slice(23,-2):null;},_flag:function(A,B){return $(A).hasAttribute(B)?B:null;},style:function(A){return A.style.cssText.toLowerCase();
},title:function(A){return A.title;}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B;
},style:function(A,B){A.style.cssText=B?B:"";}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex "+"encType maxLength readOnly longDesc").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A;
Element._attributeTranslations.has[A.toLowerCase()]=A;});(function(A){Object.extend(A,{href:A._getAttr,src:A._getAttr,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv});
})(Element._attributeTranslations.read.values);}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(A,B){A=$(A);
A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B;return A;};}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A);
A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;if(B==1){if(A.tagName=="IMG"&&A.width){A.width++;A.width--;
}else{try{var D=document.createTextNode(" ");A.appendChild(D);A.removeChild(D);}catch(C){}}}return A;
};Element.Methods.cumulativeOffset=function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break;
}}B=B.offsetParent;}while(B);return Element._returnOffset(C,A);};}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(B,C){B=$(B);
if(C&&C.toElement){C=C.toElement();}if(Object.isElement(C)){return B.update().insert(C);}C=Object.toHTML(C);
var A=B.tagName.toUpperCase();if(A in Element._insertionTranslations.tags){$A(B.childNodes).each(function(D){B.removeChild(D);
});Element._getContentFromAnonymousElement(A,C.stripScripts()).each(function(D){B.appendChild(D);});}else{B.innerHTML=C.stripScripts();
}C.evalScripts.bind(C).defer();return B;};}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(C,E){C=$(C);
if(E&&E.toElement){E=E.toElement();}if(Object.isElement(E)){C.parentNode.replaceChild(E,C);return C;}E=Object.toHTML(E);
var D=C.parentNode,B=D.tagName.toUpperCase();if(Element._insertionTranslations.tags[B]){var F=C.next();
var A=Element._getContentFromAnonymousElement(B,E.stripScripts());D.removeChild(C);if(F){A.each(function(G){D.insertBefore(G,F);
});}else{A.each(function(G){D.appendChild(G);});}}else{C.outerHTML=E.stripScripts();}E.evalScripts.bind(E).defer();
return C;};}Element._returnOffset=function(B,C){var A=[B,C];A.left=B;A.top=C;return A;};Element._getContentFromAnonymousElement=function(C,B){var D=new Element("div"),A=Element._insertionTranslations.tags[C];
if(A){D.innerHTML=A[0]+B+A[1];A[2].times(function(){D=D.firstChild;});}else{D.innerHTML=B;}return $A(D.childNodes);
};Element._insertionTranslations={before:function(A,B){A.parentNode.insertBefore(B,A);},top:function(A,B){A.insertBefore(B,A.firstChild);
},bottom:function(A,B){A.appendChild(B);},after:function(A,B){A.parentNode.insertBefore(B,A.nextSibling);
},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};
(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD});}).call(Element._insertionTranslations);
Element.Methods.Simulated={hasAttribute:function(A,C){C=Element._attributeTranslations.has[C]||C;var B=$(A).getAttributeNode(C);
return B&&B.specified;}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};
window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true;
}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K;
}var A={},B=Element.Methods.ByTag;var C=Object.extend(function(F){if(!F||F._extendedByPrototype||F.nodeType!=1||F==window){return F;
}var D=Object.clone(A),E=F.tagName,H,G;if(B[E]){Object.extend(D,B[E]);}for(H in D){G=D[H];if(Object.isFunction(G)&&!(H in F)){F[H]=G.methodize();
}}F._extendedByPrototype=Prototype.emptyFunction;return F;},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(A,Element.Methods);
Object.extend(A,Element.Methods.Simulated);}}});C.refresh();return C;})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B);
}return Element.Methods.Simulated.hasAttribute(A,B);};Element.addMethods=function(C){var I=Prototype.BrowserFeatures,D=Element.Methods.ByTag;
if(!C){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)});
}if(arguments.length==2){var B=C;C=arguments[1];}if(!B){Object.extend(Element.Methods,C||{});}else{if(Object.isArray(B)){B.each(H);
}else{H(B);}}function H(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={};
}Object.extend(Element.Methods.ByTag[F],C);}function A(L,K,F){F=F||false;for(var N in L){var M=L[N];if(!Object.isFunction(M)){continue;
}if(!F||!(N in K)){K[N]=M.methodize();}}}function E(L){var F;var K={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};
if(K[L]){F="HTML"+K[L]+"Element";}if(window[F]){return window[F];}F="HTML"+L+"Element";if(window[F]){return window[F];
}F="HTML"+L.capitalize()+"Element";if(window[F]){return window[F];}window[F]={};window[F].prototype=document.createElement(L).__proto__;
return window[F];}if(I.ElementExtensions){A(Element.Methods,HTMLElement.prototype);A(Element.Methods.Simulated,HTMLElement.prototype,true);
}if(I.SpecificElementExtensions){for(var J in Element.Methods.ByTag){var G=E(J);if(Object.isUndefined(G)){continue;
}A(D[J],G.prototype);}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh();
}Element.cache={};};document.viewport={getDimensions:function(){var A={};var C=Prototype.Browser;$w("width height").each(function(E){var B=E.capitalize();
A[E]=(C.WebKit&&!document.evaluate)?self["inner"+B]:(C.Opera)?document.body["client"+B]:document.documentElement["client"+B];
});return A;},getWidth:function(){return this.getDimensions().width;},getHeight:function(){return this.getDimensions().height;
},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);
}};var Selector=Class.create({initialize:function(A){this.expression=A.strip();this.compileMatcher();
},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false;}var A=this.expression;
if(Prototype.Browser.WebKit&&(A.include("-of-type")||A.include(":empty"))){return false;}if((/(\[[\w-]*?:|:checked)/).test(this.expression)){return false;
}return true;},compileMatcher:function(){if(this.shouldUseXPath()){return this.compileXPathMatcher();
}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];
return ;}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];
while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));
e=e.replace(m[0],"");break;}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));
Selector._cache[this.expression]=this.matcher;},compileXPathMatcher:function(){var E=this.expression,F=Selector.patterns,B=Selector.xpath,D,A;
if(Selector._cache[E]){this.xpath=Selector._cache[E];return ;}this.matcher=[".//*"];while(E&&D!=E&&(/\S/).test(E)){D=E;
for(var C in F){if(A=E.match(F[C])){this.matcher.push(Object.isFunction(B[C])?B[C](A):new Template(B[C]).evaluate(A));
E=E.replace(A[0],"");break;}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath;
},findElements:function(A){A=A||document;if(this.xpath){return document._getElementsByXPath(this.xpath,A);
}return this.matcher(A);},match:function(H){this.tokens=[];var L=this.expression,A=Selector.patterns,E=Selector.assertions;
var B,D,F;while(L&&B!==L&&(/\S/).test(L)){B=L;for(var I in A){D=A[I];if(F=L.match(D)){if(E[I]){this.tokens.push([I,Object.clone(F)]);
L=L.replace(F[0],"");}else{return this.findElements(document).include(H);}}}}var K=true,C,J;for(var I=0,G;
G=this.tokens[I];I++){C=G[0],J=G[1];if(!Selector.assertions[C](H,J)){K=false;break;}}return K;},toString:function(){return this.expression;
},inspect:function(){return"#<Selector:"+this.expression.inspect()+">";}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(A){if(A[1]=="*"){return"";
}return"[local-name()='"+A[1].toLowerCase()+"' or local-name()='"+A[1].toUpperCase()+"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(A){A[1]=A[1].toLowerCase();
return new Template("[@#{1}]").evaluate(A);},attr:function(A){A[1]=A[1].toLowerCase();A[3]=A[5]||A[6];
return new Template(Selector.xpath.operators[A[2]]).evaluate(A);},pseudo:function(A){var B=Selector.xpath.pseudos[A[1]];
if(!B){return"";}if(Object.isFunction(B)){return B(A);}return new Template(Selector.xpath.pseudos[A[1]]).evaluate(A);
},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]","empty":"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]","checked":"[@checked]","disabled":"[@disabled]","enabled":"[not(@disabled)]","not":function(B){var H=B[6],G=Selector.patterns,A=Selector.xpath,E,C;
var F=[];while(H&&E!=H&&(/\S/).test(H)){E=H;for(var D in G){if(B=H.match(G[D])){C=Object.isFunction(A[D])?A[D](B):new Template(A[D]).evaluate(B);
F.push("("+C.substring(1,C.length-1)+")");H=H.replace(B[0],"");break;}}}return"[not("+F.join(" and ")+")]";
},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A);
},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A);
},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A);},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A);
},"first-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-of-type"](A);},"last-of-type":function(A){A[6]="1";
return Selector.xpath.pseudos["nth-last-of-type"](A);},"only-of-type":function(A){var B=Selector.xpath.pseudos;
return B["first-of-type"](A)+B["last-of-type"](A);},nth:function(E,C){var F,G=C[6],B;if(G=="even"){G="2n+0";
}if(G=="odd"){G="2n+1";}if(F=G.match(/^(\d+)$/)){return"["+E+"= "+F[1]+"]";}if(F=G.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(F[1]=="-"){F[1]=-1;
}var D=F[1]?Number(F[1]):1;var A=F[2]?Number(F[2]):0;B="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";
return new Template(B).evaluate({fragment:E,a:D,b:A});}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(A){A[3]=(A[5]||A[6]);
return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(A);},pseudo:function(A){if(A[6]){A[6]=A[6].replace(/"/g,'\\"');
}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(A);},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase();
},className:function(A,B){return Element.hasClassName(A,B[1]);},id:function(A,B){return A.id===B[1];},attrPresence:function(A,B){return Element.hasAttribute(A,B[1]);
},attr:function(B,C){var A=Element.readAttribute(B,C[1]);return A&&Selector.operators[C[2]](A,C[5]||C[6]);
}},handlers:{concat:function(B,A){for(var C=0,D;D=A[C];C++){B.push(D);}return B;},mark:function(A){var D=Prototype.emptyFunction;
for(var B=0,C;C=A[B];B++){C._countedByPrototype=D;}return A;},unmark:function(A){for(var B=0,C;C=A[B];
B++){C._countedByPrototype=undefined;}return A;},index:function(A,D,G){A._countedByPrototype=Prototype.emptyFunction;
if(D){for(var B=A.childNodes,E=B.length-1,C=1;E>=0;E--){var F=B[E];if(F.nodeType==1&&(!G||F._countedByPrototype)){F.nodeIndex=C++;
}}}else{for(var E=0,C=1,B=A.childNodes;F=B[E];E++){if(F.nodeType==1&&(!G||F._countedByPrototype)){F.nodeIndex=C++;
}}}},unique:function(B){if(B.length==0){return B;}var D=[],E;for(var C=0,A=B.length;C<A;C++){if(!(E=B[C])._countedByPrototype){E._countedByPrototype=Prototype.emptyFunction;
D.push(Element.extend(E));}}return Selector.handlers.unmark(D);},descendant:function(A){var D=Selector.handlers;
for(var C=0,B=[],E;E=A[C];C++){D.concat(B,E.getElementsByTagName("*"));}return B;},child:function(A){var E=Selector.handlers;
for(var D=0,C=[],F;F=A[D];D++){for(var B=0,G;G=F.childNodes[B];B++){if(G.nodeType==1&&G.tagName!="!"){C.push(G);
}}}return C;},adjacent:function(A){for(var C=0,B=[],E;E=A[C];C++){var D=this.nextElementSibling(E);if(D){B.push(D);
}}return B;},laterSibling:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,Element.nextSiblings(E));
}return B;},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A;}}return null;
},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A;}}return null;
},tagName:function(A,H,C,B){var I=C.toUpperCase();var E=[],G=Selector.handlers;if(A){if(B){if(B=="descendant"){for(var F=0,D;
D=A[F];F++){G.concat(E,D.getElementsByTagName(C));}return E;}else{A=this[B](A);}if(C=="*"){return A;}}for(var F=0,D;
D=A[F];F++){if(D.tagName.toUpperCase()===I){E.push(D);}}return E;}else{return H.getElementsByTagName(C);
}},id:function(B,A,H,F){var G=$(H),D=Selector.handlers;if(!G){return[];}if(!B&&A==document){return[G];
}if(B){if(F){if(F=="child"){for(var C=0,E;E=B[C];C++){if(G.parentNode==E){return[G];}}}else{if(F=="descendant"){for(var C=0,E;
E=B[C];C++){if(Element.descendantOf(G,E)){return[G];}}}else{if(F=="adjacent"){for(var C=0,E;E=B[C];C++){if(Selector.handlers.previousElementSibling(G)==E){return[G];
}}}else{B=D[F](B);}}}}for(var C=0,E;E=B[C];C++){if(E==G){return[G];}}return[];}return(G&&Element.descendantOf(G,A))?[G]:[];
},className:function(B,A,C,D){if(B&&D){B=this[D](B);}return Selector.handlers.byClassName(B,A,C);},byClassName:function(C,B,F){if(!C){C=Selector.handlers.descendant([B]);
}var H=" "+F+" ";for(var E=0,D=[],G,A;G=C[E];E++){A=G.className;if(A.length==0){continue;}if(A==F||(" "+A+" ").include(H)){D.push(G);
}}return D;},attrPresence:function(C,B,A,G){if(!C){C=B.getElementsByTagName("*");}if(C&&G){C=this[G](C);
}var E=[];for(var D=0,F;F=C[D];D++){if(Element.hasAttribute(F,A)){E.push(F);}}return E;},attr:function(A,I,H,J,C,B){if(!A){A=I.getElementsByTagName("*");
}if(A&&B){A=this[B](A);}var K=Selector.operators[C],F=[];for(var E=0,D;D=A[E];E++){var G=Element.readAttribute(D,H);
if(G===null){continue;}if(K(G,J)){F.push(D);}}return F;},pseudo:function(B,C,E,A,D){if(B&&D){B=this[D](B);
}if(!B){B=A.getElementsByTagName("*");}return Selector.pseudos[C](B,E,A);}},pseudos:{"first-child":function(B,F,A){for(var D=0,C=[],E;
E=B[D];D++){if(Selector.handlers.previousElementSibling(E)){continue;}C.push(E);}return C;},"last-child":function(B,F,A){for(var D=0,C=[],E;
E=B[D];D++){if(Selector.handlers.nextElementSibling(E)){continue;}C.push(E);}return C;},"only-child":function(B,G,A){var E=Selector.handlers;
for(var D=0,C=[],F;F=B[D];D++){if(!E.previousElementSibling(F)&&!E.nextElementSibling(F)){C.push(F);}}return C;
},"nth-child":function(B,C,A){return Selector.pseudos.nth(B,C,A);},"nth-last-child":function(B,C,A){return Selector.pseudos.nth(B,C,A,true);
},"nth-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,false,true);},"nth-last-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,true,true);
},"first-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,false,true);},"last-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,true,true);
},"only-of-type":function(B,D,A){var C=Selector.pseudos;return C["last-of-type"](C["first-of-type"](B,D,A),D,A);
},getIndices:function(B,A,C){if(B==0){return A>0?[A]:[];}return $R(1,C).inject([],function(D,E){if(0==(E-A)%B&&(E-A)/B>=0){D.push(E);
}return D;});},nth:function(A,L,N,K,C){if(A.length==0){return[];}if(L=="even"){L="2n+0";}if(L=="odd"){L="2n+1";
}var J=Selector.handlers,I=[],B=[],E;J.mark(A);for(var H=0,D;D=A[H];H++){if(!D.parentNode._countedByPrototype){J.index(D.parentNode,K,C);
B.push(D.parentNode);}}if(L.match(/^\d+$/)){L=Number(L);for(var H=0,D;D=A[H];H++){if(D.nodeIndex==L){I.push(D);
}}}else{if(E=L.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(E[1]=="-"){E[1]=-1;}var O=E[1]?Number(E[1]):1;var M=E[2]?Number(E[2]):0;
var P=Selector.pseudos.getIndices(O,M,A.length);for(var H=0,D,F=P.length;D=A[H];H++){for(var G=0;G<F;
G++){if(D.nodeIndex==P[G]){I.push(D);}}}}}J.unmark(A);J.unmark(B);return I;},"empty":function(B,F,A){for(var D=0,C=[],E;
E=B[D];D++){if(E.tagName=="!"||(E.firstChild&&!E.innerHTML.match(/^\s*$/))){continue;}C.push(E);}return C;
},"not":function(A,D,I){var G=Selector.handlers,J,C;var H=new Selector(D).findElements(I);G.mark(H);for(var F=0,E=[],B;
B=A[F];F++){if(!B._countedByPrototype){E.push(B);}}G.unmark(H);return E;},"enabled":function(B,F,A){for(var D=0,C=[],E;
E=B[D];D++){if(!E.disabled){C.push(E);}}return C;},"disabled":function(B,F,A){for(var D=0,C=[],E;E=B[D];
D++){if(E.disabled){C.push(E);}}return C;},"checked":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.checked){C.push(E);
}}return C;}},operators:{"=":function(B,A){return B==A;},"!=":function(B,A){return B!=A;},"^=":function(B,A){return B.startsWith(A);
},"$=":function(B,A){return B.endsWith(A);},"*=":function(B,A){return B.include(A);},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ");
},"|=":function(B,A){return("-"+B.toUpperCase()+"-").include("-"+A.toUpperCase()+"-");}},split:function(B){var A=[];
B.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(C){A.push(C[1].strip());});return A;},matchElements:function(F,G){var E=$$(G),D=Selector.handlers;
D.mark(E);for(var C=0,B=[],A;A=F[C];C++){if(A._countedByPrototype){B.push(A);}}D.unmark(E);return B;},findElement:function(B,C,A){if(Object.isNumber(C)){A=C;
C=false;}return Selector.matchElements(B,C||"*")[A||0];},findChildElements:function(E,G){G=Selector.split(G.join(","));
var D=[],F=Selector.handlers;for(var C=0,B=G.length,A;C<B;C++){A=new Selector(G[C].strip());F.concat(D,A.findElements(E));
}return(B>1)?F.unique(D):D;}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(B,A){for(var C=0,D;
D=A[C];C++){if(D.tagName!=="!"){B.push(D);}}return B;},unmark:function(A){for(var B=0,C;C=A[B];B++){C.removeAttribute("_countedByPrototype");
}return A;}});}function $$(){return Selector.findChildElements(document,$A(arguments));}var Form={reset:function(A){$(A).reset();
return A;},serializeElements:function(G,B){if(typeof B!="object"){B={hash:!!B};}else{if(Object.isUndefined(B.hash)){B.hash=true;
}}var C,F,A=false,E=B.submit;var D=G.inject({},function(H,I){if(!I.disabled&&I.name){C=I.name;F=$(I).getValue();
if(F!=null&&(I.type!="submit"||(!A&&E!==false&&(!E||C==E)&&(A=true)))){if(C in H){if(!Object.isArray(H[C])){H[C]=[H[C]];
}H[C].push(F);}else{H[C]=F;}}}return H;});return B.hash?D:Object.toQueryString(D);}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A);
},getElements:function(A){return $A($(A).getElementsByTagName("*")).inject([],function(B,C){if(Form.Element.Serializers[C.tagName.toLowerCase()]){B.push(Element.extend(C));
}return B;});},getInputs:function(G,C,D){G=$(G);var A=G.getElementsByTagName("input");if(!C&&!D){return $A(A).map(Element.extend);
}for(var E=0,H=[],F=A.length;E<F;E++){var B=A[E];if((C&&B.type!=C)||(D&&B.name!=D)){continue;}H.push(Element.extend(B));
}return H;},disable:function(A){A=$(A);Form.getElements(A).invoke("disable");return A;},enable:function(A){A=$(A);
Form.getElements(A).invoke("enable");return A;},findFirstElement:function(B){var C=$(B).getElements().findAll(function(D){return"hidden"!=D.type&&!D.disabled;
});var A=C.findAll(function(D){return D.hasAttribute("tabIndex")&&D.tabIndex>=0;}).sortBy(function(D){return D.tabIndex;
}).first();return A?A:C.find(function(D){return["input","select","textarea"].include(D.tagName.toLowerCase());
});},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A;},request:function(B,A){B=$(B),A=Object.clone(A||{});
var D=A.parameters,C=B.readAttribute("action")||"";if(C.blank()){C=window.location.href;}A.parameters=B.serialize(true);
if(D){if(Object.isString(D)){D=D.toQueryParams();}Object.extend(A.parameters,D);}if(B.hasAttribute("method")&&!A.method){A.method=B.method;
}return new Ajax.Request(C,A);}};Form.Element={focus:function(A){$(A).focus();return A;},select:function(A){$(A).select();
return A;}};Form.Element.Methods={serialize:function(A){A=$(A);if(!A.disabled&&A.name){var B=A.getValue();
if(B!=undefined){var C={};C[A.name]=B;return Object.toQueryString(C);}}return"";},getValue:function(A){A=$(A);
var B=A.tagName.toLowerCase();return Form.Element.Serializers[B](A);},setValue:function(A,B){A=$(A);var C=A.tagName.toLowerCase();
Form.Element.Serializers[C](A,B);return A;},clear:function(A){$(A).value="";return A;},present:function(A){return $(A).value!="";
},activate:function(A){A=$(A);try{A.focus();if(A.select&&(A.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(A.type))){A.select();
}}catch(B){}return A;},disable:function(A){A=$(A);A.blur();A.disabled=true;return A;},enable:function(A){A=$(A);
A.disabled=false;return A;}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B);
default:return Form.Element.Serializers.textarea(A,B);}},inputSelector:function(A,B){if(Object.isUndefined(B)){return A.checked?A.value:null;
}else{A.checked=!!B;}},textarea:function(A,B){if(Object.isUndefined(B)){return A.value;}else{A.value=B;
}},select:function(D,A){if(Object.isUndefined(A)){return this[D.type=="select-one"?"selectOne":"selectMany"](D);
}else{var C,F,G=!Object.isArray(A);for(var B=0,E=D.length;B<E;B++){C=D.options[B];F=this.optionValue(C);
if(G){if(F==A){C.selected=true;return ;}}else{C.selected=A.include(F);}}}},selectOne:function(B){var A=B.selectedIndex;
return A>=0?this.optionValue(B.options[A]):null;},selectMany:function(D){var A,E=D.length;if(!E){return null;
}for(var C=0,A=[];C<E;C++){var B=D.options[C];if(B.selected){A.push(this.optionValue(B));}}return A;},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text;
}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,B,C){$super(C,B);
this.element=$(A);this.lastValue=this.getValue();},execute:function(){var A=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(A)?this.lastValue!=A:String(this.lastValue)!=String(A)){this.callback(this.element,A);
this.lastValue=A;}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element);
}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element);
}});Abstract.EventObserver=Class.create({initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);
}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);
this.lastValue=A;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this);
},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));
break;default:Event.observe(A,"change",this.onElementEvent.bind(this));break;}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element);
}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element);
}});if(!window.Event){var Event={};}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(B){var A;
switch(B.type){case"mouseover":A=B.fromElement;break;case"mouseout":A=B.toElement;break;default:return null;
}return Element.extend(A);}});Event.Methods=(function(){var A;if(Prototype.Browser.IE){var B={0:1,1:4,2:2};
A=function(D,C){return D.button==B[C];};}else{if(Prototype.Browser.WebKit){A=function(D,C){switch(C){case 0:return D.which==1&&!D.metaKey;
case 1:return D.which==1&&D.metaKey;default:return false;}};}else{A=function(D,C){return D.which?(D.which===C+1):(D.button===C);
};}}return{isLeftClick:function(C){return A(C,0);},isMiddleClick:function(C){return A(C,1);},isRightClick:function(C){return A(C,2);
},element:function(D){var C=Event.extend(D).target;return Element.extend(C.nodeType==Node.TEXT_NODE?C.parentNode:C);
},findElement:function(D,F){var C=Event.element(D);if(!F){return C;}var E=[C].concat(C.ancestors());return Selector.findElement(E,F,0);
},pointer:function(C){return{x:C.pageX||(C.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:C.pageY||(C.clientY+(document.documentElement.scrollTop||document.body.scrollTop))};
},pointerX:function(C){return Event.pointer(C).x;},pointerY:function(C){return Event.pointer(C).y;},stop:function(C){Event.extend(C);
C.preventDefault();C.stopPropagation();C.stopped=true;}};})();Event.extend=(function(){var A=Object.keys(Event.Methods).inject({},function(B,C){B[C]=Event.Methods[C].methodize();
return B;});if(Prototype.Browser.IE){Object.extend(A,{stopPropagation:function(){this.cancelBubble=true;
},preventDefault:function(){this.returnValue=false;},inspect:function(){return"[object Event]";}});return function(B){if(!B){return false;
}if(B._extendedByPrototype){return B;}B._extendedByPrototype=Prototype.emptyFunction;var C=Event.pointer(B);
Object.extend(B,{target:B.srcElement,relatedTarget:Event.relatedTarget(B),pageX:C.x,pageY:C.y});return Object.extend(B,A);
};}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,A);
return Prototype.K;}})();Object.extend(Event,(function(){var B=Event.cache;function C(J){if(J._prototypeEventID){return J._prototypeEventID[0];
}arguments.callee.id=arguments.callee.id||1;return J._prototypeEventID=[++arguments.callee.id];}function G(J){if(J&&J.include(":")){return"dataavailable";
}return J;}function A(J){return B[J]=B[J]||{};}function F(L,J){var K=A(L);return K[J]=K[J]||[];}function H(K,J,L){var O=C(K);
var N=F(O,J);if(N.pluck("handler").include(L)){return false;}var M=function(P){if(!Event||!Event.extend||(P.eventName&&P.eventName!=J)){return false;
}Event.extend(P);L.call(K,P);};M.handler=L;N.push(M);return M;}function I(M,J,K){var L=F(M,J);return L.find(function(N){return N.handler==K;
});}function D(M,J,K){var L=A(M);if(!L[J]){return false;}L[J]=L[J].without(I(M,J,K));}function E(){for(var K in B){for(var J in B[K]){B[K][J]=null;
}}}if(window.attachEvent){window.attachEvent("onunload",E);}return{observe:function(L,J,M){L=$(L);var K=G(J);
var N=H(L,J,M);if(!N){return L;}if(L.addEventListener){L.addEventListener(K,N,false);}else{L.attachEvent("on"+K,N);
}return L;},stopObserving:function(L,J,M){L=$(L);var O=C(L),K=G(J);if(!M&&J){F(O,J).each(function(P){L.stopObserving(J,P.handler);
});return L;}else{if(!J){Object.keys(A(O)).each(function(P){L.stopObserving(P);});return L;}}var N=I(O,J,M);
if(!N){return L;}if(L.removeEventListener){L.removeEventListener(K,N,false);}else{L.detachEvent("on"+K,N);
}D(O,J,M);return L;},fire:function(L,K,J){L=$(L);if(L==document&&document.createEvent&&!L.dispatchEvent){L=document.documentElement;
}var M;if(document.createEvent){M=document.createEvent("HTMLEvents");M.initEvent("dataavailable",true,true);
}else{M=document.createEventObject();M.eventType="ondataavailable";}M.eventName=K;M.memo=J||{};if(document.createEvent){L.dispatchEvent(M);
}else{L.fireEvent(M.eventType,M);}return Event.extend(M);}};})());Object.extend(Event,Event.Methods);
Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});
(function(){var B;function A(){if(document.loaded){return ;}if(B){window.clearInterval(B);}document.fire("dom:loaded");
document.loaded=true;}if(document.addEventListener){if(Prototype.Browser.WebKit){B=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){A();
}},0);Event.observe(window,"load",A);}else{document.addEventListener("DOMContentLoaded",A,false);}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");
$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;
A();}};}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;
var Insertion={Before:function(A,B){return Element.insert(A,{before:B});},Top:function(A,B){return Element.insert(A,{top:B});
},Bottom:function(A,B){return Element.insert(A,{bottom:B});},After:function(A,B){return Element.insert(A,{after:B});
}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C);
}this.xcomp=A;this.ycomp=C;this.offset=Element.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth);
},withinIncludingScrolloffsets:function(B,A,D){var C=Element.cumulativeScrollOffset(B);this.xcomp=A+C[0]-this.deltaX;
this.ycomp=D+C[1]-this.deltaY;this.offset=Element.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth);
},overlap:function(B,A){if(!B){return 0;}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight;
}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth;}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare();
return Element.absolutize(A);},relativize:function(A){Position.prepare();return Element.relativize(A);
},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(B,C,A){A=A||{};
return Element.clonePosition(C,B,A);}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(C){return C.blank()?null:"[contains(concat(' ', @class, ' '), ' "+C+" ')]";
}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(C,E){E=E.toString().strip();var D=/\s/.test(E)?$w(E).map(A).join(""):A(E);
return D?document._getElementsByXPath(".//*"+D,C):[];}:function(E,F){F=F.toString().strip();var G=[],H=(/\s/.test(F)?$w(F):null);
if(!H&&!F){return G;}var C=$(E).getElementsByTagName("*");F=" "+F+" ";for(var D=0,J,I;J=C[D];D++){if(J.className&&(I=" "+J.className+" ")&&(I.include(F)||(H&&H.all(function(K){return !K.toString().blank()&&I.include(" "+K+" ");
})))){G.push(Element.extend(J));}}return G;};return function(D,C){return $(C||document.body).getElementsByClassName(D);
};}(Element.Methods);}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(A){this.element=$(A);
},_each:function(A){this.element.className.split(/\s+/).select(function(B){return B.length>0;})._each(A);
},set:function(A){this.element.className=A;},add:function(A){if(this.include(A)){return ;}this.set($A(this).concat(A).join(" "));
},remove:function(A){if(!this.include(A)){return ;}this.set($A(this).without(A).join(" "));},toString:function(){return $A(this).join(" ");
}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();(function(){var _nQ=window.nQ,_$=window.$;
var nQ=window.nQ=window.$=function(selector,context){return new nQ.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;
nQ.fn=nQ.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;
this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){selector=nQ.clean([match[1]],context);
}else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3]){return nQ().find(selector);
}return nQ(elem);}selector=[];}}else{return nQ(context).find(selector);}}else{if(nQ.isFunction(selector)){return nQ(document)[nQ.fn.ready?"ready":"load"](selector);
}}return this.setArray(nQ.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?nQ.makeArray(this):this[num];
},pushStack:function(elems){var ret=nQ(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;
Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return nQ.each(this,callback,args);
},index:function(elem){var ret=-1;return nQ.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;
if(name.constructor==String){if(value===undefined){return this[0]&&nQ[type||"attr"](this[0],name);}else{options={};
options[name]=value;}}return this.each(function(i){for(name in options){nQ.attr(type?this.style:this,name,nQ.prop(this,options[name],type,i,name));
}});},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined;
}return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));
}var ret="";nQ.each(text||this,function(){nQ.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:nQ.fn.text([this]);
}});});return ret;},wrapAll:function(html){if(this[0]){nQ(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;
while(elem.firstChild){elem=elem.firstChild;}return elem;}).append(this);}return this;},wrapInner:function(html){return this.each(function(){nQ(this).contents().wrapAll(html);
});},wrap:function(html){return this.each(function(){nQ(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem);
}});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild);
}});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);
});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);
});},end:function(){return this.prevObject||nQ([]);},find:function(selector){var elems=nQ.map(this,function(elem){return nQ.find(selector,elem);
});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?nQ.unique(elems):elems);
},clone:function(events){var ret=this.map(function(){if(nQ.browser.msie&&!nQ.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");
container.appendChild(clone);return nQ.clean([container.innerHTML])[0];}else{return this.cloneNode(true);
}});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null;
}});if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return ;}var events=nQ.data(this,"events");
for(var type in events){for(var handler in events[type]){nQ.event.add(clone[i],type,events[type][handler],events[type][handler].data);
}}});}return ret;},filter:function(selector){return this.pushStack(nQ.isFunction(selector)&&nQ.grep(this,function(elem,i){return selector.call(elem,i);
})||nQ.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(nQ.multiFilter(selector,this,true));
}else{selector=nQ.multiFilter(selector,this);}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;
return this.filter(function(){return isArrayLike?nQ.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(nQ.unique(nQ.merge(this.get(),typeof selector=="string"?nQ(selector):nQ.makeArray(selector))));
},is:function(selector){return !!selector&&nQ.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);
},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(nQ.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";
if(index<0){return null;}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];
if(option.selected){value=nQ.browser.msie&&!option.attributes.value.specified?option.text:option.value;
if(one){return value;}values.push(value);}}return values;}else{return(this[0].value||"").replace(/\r/g,"");
}}return undefined;}if(value.constructor==Number){value+="";}return this.each(function(){if(this.nodeType!=1){return ;
}if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(nQ.inArray(this.value,value)>=0||nQ.inArray(this.name,value)>=0);
}else{if(nQ.nodeName(this,"select")){var values=nQ.makeArray(value);nQ("option",this).each(function(){this.selected=(nQ.inArray(this.value,values)>=0||nQ.inArray(this.text,values)>=0);
});if(!values.length){this.selectedIndex=-1;}}else{this.value=value;}}});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);
},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);
},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(nQ.map(this,function(elem,i){return callback.call(elem,i,elem);
}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");
parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);
if(data===undefined&&this.length){data=nQ.data(this[0],key);}return data===undefined&&parts[1]?this.data(parts[0]):data;
}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){nQ.data(this,key,value);
});}},removeData:function(key){return this.each(function(){nQ.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;
return this.each(function(){if(!elems){elems=nQ.clean(args,this.ownerDocument);if(reverse){elems.reverse();
}}var obj=this;if(table&&nQ.nodeName(this,"table")&&nQ.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));
}var scripts=nQ([]);nQ.each(elems,function(){var elem=clone?nQ(this).clone(true)[0]:this;if(nQ.nodeName(elem,"script")){scripts=scripts.add(elem);
}else{if(elem.nodeType==1){scripts=scripts.add(nQ("script",elem).remove());}callback.call(obj,elem);}});
scripts.each(evalScript);});}};nQ.fn.init.prototype=nQ.fn;function evalScript(i,elem){if(elem.src){nQ.ajax({url:elem.src,async:false,dataType:"script"});
}else{nQ.globalEval(elem.text||elem.textContent||elem.innerHTML||"");}if(elem.parentNode){elem.parentNode.removeChild(elem);
}}function now(){return +new Date;}nQ.extend=nQ.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;
if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function"){target={};
}if(length==i){target=this;--i;}for(;i<length;i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name];
if(target===copy){continue;}if(deep&&copy&&typeof copy=="object"&&!copy.nodeType){target[name]=nQ.extend(deep,src||(copy.length!=null?[]:{}),copy);
}else{if(copy!==undefined){target[name]=copy;}}}}}return target;};var expando="nQ"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};
nQ.extend({noConflict:function(deep){window.$=_$;if(deep){window.nQ=_nQ;}return nQ;},isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");
},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;
},globalEval:function(data){data=nQ.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");
script.type="text/javascript";if(nQ.browser.msie){script.text=data;}else{script.appendChild(document.createTextNode(data));
}head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();
},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;if(!!elem.tagName&&(elem.tagName.toLowerCase()=="applet")){return false;
}var id=elem[expando];if(!id){id=elem[expando]=++uuid;}if(name&&!nQ.cache[id]){nQ.cache[id]={};}if(data!==undefined){nQ.cache[id][name]=data;
}return name?nQ.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;
if(!!elem.tagName&&(elem.tagName.toLowerCase()=="applet")){return false;}var id=elem[expando];if(name){if(nQ.cache[id]){delete nQ.cache[id][name];
name="";for(name in nQ.cache[id]){break;}if(!name){nQ.removeData(elem);}}}else{try{delete elem[expando];
}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando);}}delete nQ.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;
if(args){if(length==undefined){for(name in object){if(callback.apply(object[name],args)===false){break;
}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break;}}}}else{if(length==undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break;
}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object;
},prop:function(elem,value,type,i,name){if(nQ.isFunction(value)){value=value.call(elem,i);}return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;
},className:{add:function(elem,classNames){nQ.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!nQ.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className;
}});},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!=undefined?nQ.grep(elem.className.split(/\s+/),function(className){return !nQ.className.has(classNames,className);
}).join(" "):"";}},has:function(elem,className){return nQ.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;
}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];
elem.style[name]=options[name];}callback.call(elem);for(var name in options){elem.style[name]=old[name];
}},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];
function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;nQ.each(which,function(){padding+=parseFloat(nQ.curCSS(elem,"padding"+this,true))||0;
border+=parseFloat(nQ.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);
}if(nQ(elem).is(":visible")){getWH();}else{nQ.swap(elem,props,getWH);}return Math.max(0,val);}return nQ.curCSS(elem,name,force);
},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!nQ.browser.safari){return false;
}var ret=defaultView.getComputedStyle(elem,null);return !ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&nQ.browser.msie){ret=nQ.attr(style,"opacity");
return ret==""?"1":ret;}if(nQ.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";
style.outline=save;}if(name.match(/float/i)){name=styleFloat;}if(!force&&style&&style[name]){ret=style[name];
}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float";}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();
var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem)){ret=computedStyle.getPropertyValue(name);
}else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode){stack.unshift(a);}for(;i<stack.length;
i++){if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";
for(i=0;i<swap.length;i++){if(swap[i]!=null){stack[i].style.display=swap[i];}}}if(name=="opacity"&&ret==""){ret="1";
}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();
});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;
elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;
elem.runtimeStyle.left=rsLeft;}}}}return ret;},clean:function(elems,context){var ret=[];context=context||document;
if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;
}nQ.each(elems,function(i,elem){if(!elem){return ;}if(elem.constructor==Number){elem+="";}if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";
});var tags=nQ.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||nQ.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];
div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--){div=div.lastChild;}if(nQ.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];
for(var j=tbody.length-1;j>=0;--j){if(nQ.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);
}}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);
}}elem=nQ.makeArray(div.childNodes);}if(elem.length===0&&(!nQ.nodeName(elem,"form")&&!nQ.nodeName(elem,"select"))){return ;
}if(elem[0]==undefined||nQ.nodeName(elem,"form")||elem.options){ret.push(elem);}else{ret=nQ.merge(ret,elem);
}});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined;
}var notxml=!nQ.isXMLDoc(elem),set=value!==undefined,msie=nQ.browser.msie;name=notxml&&nQ.props[name]||name;
if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&nQ.browser.safari){elem.parentNode.selectedIndex;
}if(name in elem&&notxml&&!special){if(set){if(name=="type"&&nQ.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed";
}elem[name]=value;}if(nQ.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue;
}return elem[name];}if(msie&&notxml&&name=="style"){return nQ.attr(elem.style,"cssText",value);}if(set){elem.setAttribute(name,""+value);
}var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;
}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")");
}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":"";
}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set){elem[name]=value;
}return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];
if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call){ret[0]=array;
}else{while(i){ret[--i]=array[i];}}}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;
i<length;i++){if(array[i]===elem){return i;}}return -1;},merge:function(first,second){var i=0,elem,pos=first.length;
if(nQ.browser.msie){while(elem=second[i++]){if(elem.nodeType!=8){first[pos++]=elem;}}}else{while(elem=second[i++]){first[pos++]=elem;
}}return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;
i++){var id=nQ.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;
},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i]);
}}return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);
if(value!=null){ret[ret.length]=value;}}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();
nQ.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};
var styleFloat=nQ.browser.msie?"styleFloat":"cssFloat";nQ.extend({boxModel:!nQ.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});
nQ.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return nQ.dir(elem,"parentNode");
},next:function(elem){return nQ.nth(elem,2,"nextSibling");},prev:function(elem){return nQ.nth(elem,2,"previousSibling");
},nextAll:function(elem){return nQ.dir(elem,"nextSibling");},prevAll:function(elem){return nQ.dir(elem,"previousSibling");
},siblings:function(elem){return nQ.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return nQ.sibling(elem.firstChild);
},contents:function(elem){return nQ.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:nQ.makeArray(elem.childNodes);
}},function(name,fn){nQ.fn[name]=function(selector){var ret=nQ.map(this,fn);if(selector&&typeof selector=="string"){ret=nQ.multiFilter(selector,ret);
}return this.pushStack(nQ.unique(ret));};});nQ.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){nQ.fn[name]=function(){var args=arguments;
return this.each(function(){for(var i=0,length=args.length;i<length;i++){nQ(args[i])[original](this);
}});};});nQ.each({removeAttr:function(name){nQ.attr(this,name,"");if(this.nodeType==1){this.removeAttribute(name);
}},addClass:function(classNames){nQ.className.add(this,classNames);},removeClass:function(classNames){nQ.className.remove(this,classNames);
},toggleClass:function(classNames){nQ.className[nQ.className.has(this,classNames)?"remove":"add"](this,classNames);
},remove:function(selector){if(!selector||nQ.filter(selector,[this]).r.length){nQ("*",this).add(this).each(function(){nQ.event.remove(this);
nQ.removeData(this);});if(this.parentNode){this.parentNode.removeChild(this);}}},empty:function(){nQ(">*",this).remove();
while(this.firstChild){this.removeChild(this.firstChild);}}},function(name,fn){nQ.fn[name]=function(){return this.each(fn,arguments);
};});nQ.each(["Height","Width"],function(i,name){var type=name.toLowerCase();nQ.fn[type]=function(size){return this[0]==window?nQ.browser.opera&&document.body["client"+name]||nQ.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?nQ.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");
};});function num(elem,prop){return elem[0]&&parseInt(nQ.curCSS(elem[0],prop,true),10)||0;}var chars=nQ.browser.safari&&parseInt(nQ.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");
nQ.extend({expr:{"":function(a,i,m){return m[2]=="*"||nQ.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];
},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;
},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;
},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;
},"last-child":function(a){return nQ.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return !nQ.nth(a.parentNode.lastChild,2,"previousSibling");
},parent:function(a){return a.firstChild;},empty:function(a){return !a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||nQ(a).text()||"").indexOf(m[3])>=0;
},visible:function(a){return"hidden"!=a.type&&nQ.css(a,"display")!="none"&&nQ.css(a,"visibility")!="hidden";
},hidden:function(a){return"hidden"==a.type||nQ.css(a,"display")=="none"||nQ.css(a,"visibility")=="hidden";
},enabled:function(a){return !a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;
},selected:function(a){return a.selected||nQ.attr(a,"selected");},text:function(a){return"text"==a.type;
},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;
},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;
},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||nQ.nodeName(a,"button");
},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return nQ.find(m[3],a).length;
},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return nQ.grep(nQ.timers,function(fn){return a==fn.elem;
}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];
while(expr&&expr!=old){old=expr;var f=nQ.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:nQ.merge(cur,f.r);
}return cur;},find:function(t,context){if(typeof t!="string"){return[t];}if(context&&context.nodeType!=1&&context.nodeType!=9){return[];
}context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;
t=nQ.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;
ret[i];i++){for(var c=ret[i].firstChild;c;c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c);
}}}ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0){continue;}foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;
if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;
j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling){if(n.nodeType==1){var id=nQ.data(n);
if(m=="~"&&merge[id]){break;}if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true;
}r.push(n);}if(m=="+"){break;}}}}ret=r;t=nQ.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift();
}done=nQ.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);
if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];
if(m[1]=="#"&&elem&&elem.getElementById&&!nQ.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((nQ.browser.msie||nQ.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=nQ('[@id="'+m[2]+'"]',elem)[0];
}ret=r=oid&&(!m[3]||nQ.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];
if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param";}r=nQ.merge(r,ret[i].getElementsByTagName(tag));
}if(m[1]=="."){r=nQ.classFilter(r,m[2]);}if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];
break;}}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=nQ.filter(t,r);ret=r=val.r;t=nQ.trim(val.t);
}}if(t){ret=[];}if(ret&&context==ret[0]){ret.shift();}done=nQ.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";
var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass){tmp.push(r[i]);
}}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=nQ.parse,m;for(var i=0;
p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m){break;
}if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?nQ.filter(m[3],r,true).r:nQ(r).not(m[3]);}else{if(m[1]=="."){r=nQ.classFilter(r,m[2],not);
}else{if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[nQ.props[m[2]]||m[2]];
if(z==null||/href|src|selected/.test(m[2])){z=nQ.attr(a,m[2])||"";}if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){tmp.push(a);
}}r=tmp;}else{if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;
for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=nQ.data(parentNode);if(!merge[id]){var c=1;
for(var n=parentNode.firstChild;n;n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++;}}merge[id]=true;
}var add=false;if(first==0){if(node.nodeIndex==last){add=true;}}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true;
}}if(add^not){tmp.push(node);}}r=tmp;}else{var fn=nQ.expr[m[1]];if(typeof fn=="object"){fn=fn[m[2]];}if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}");
}r=nQ.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}}}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];
while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur);}cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;
var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType==1&&++num==result){break;}}return cur;},sibling:function(n,elem){var r=[];
for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n);}}return r;}});nQ.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return ;
}if(nQ.browser.msie&&elem.setInterval){elem=window;}if(!handler.guid){handler.guid=this.guid++;}if(data!=undefined){var fn=handler;
handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=nQ.data(elem,"events")||nQ.data(elem,"events",{}),handle=nQ.data(elem,"handle")||nQ.data(elem,"handle",function(){if(typeof nQ!="undefined"&&!nQ.event.triggered){return nQ.event.handle.apply(arguments.callee.elem,arguments);
}});handle.elem=elem;nQ.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];
handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!nQ.event.special[type]||nQ.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false);
}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle);}}}}handlers[handler.guid]=handler;nQ.event.global[type]=true;
});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return ;
}var events=nQ.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""));
}}else{if(types.type){handler=types.handler;types=types.type;}nQ.each(types.split(/\s+/),function(index,type){var parts=type.split(".");
type=parts[0];if(events[type]){if(handler){delete events[type][handler.guid];}else{for(handler in events[type]){if(!parts[1]||events[type][handler].type==parts[1]){delete events[type][handler];
}}}for(ret in events[type]){break;}if(!ret){if(!nQ.event.special[type]||nQ.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener){elem.removeEventListener(type,nQ.data(elem,"handle"),false);
}else{if(elem.detachEvent){elem.detachEvent("on"+type,nQ.data(elem,"handle"));}}}ret=null;delete events[type];
}}});}for(ret in events){break;}if(!ret){var handle=nQ.data(elem,"handle");if(handle){handle.elem=null;
}nQ.removeData(elem,"events");nQ.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=nQ.makeArray(data);
if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type]){nQ("*").add([window,document]).trigger(type,data);
}}else{if(elem.nodeType==3||elem.nodeType==8){return undefined;}var val,ret,fn=nQ.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;
if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});
data[0][expando]=true;}data[0].type=type;if(exclusive){data[0].exclusive=true;}var handle=nQ.data(elem,"handle");
if(handle){val=handle.apply(elem,data);}if((!fn||(nQ.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false;
}if(event){data.shift();}if(extra&&nQ.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));
if(ret!==undefined){val=ret;}}if(fn&&donative!==false&&val!==false&&!(nQ.nodeName(elem,"a")&&type=="click")){this.triggered=true;
try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;
event=arguments[0]=nQ.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];
namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(nQ.data(this,"events")||{})[event.type];
for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;
event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false){val=ret;}if(ret===false){event.preventDefault();
event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true){return event;}var originalEvent=event;
event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");
for(var i=props.length;i;i--){event[props[i]]=originalEvent[props[i]];}event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault();
}originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation();
}originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target){event.target=event.srcElement||document;
}if(event.target.nodeType==3){event.target=event.target.parentNode;}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;
}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);
event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode;
}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey;}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));
}return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;
},special:{ready:{setup:function(){bindReady();return ;},teardown:function(){return ;}},mouseenter:{setup:function(){if(nQ.browser.msie){return false;
}nQ(this).bind("mouseover",nQ.event.special.mouseenter.handler);return true;},teardown:function(){if(nQ.browser.msie){return false;
}nQ(this).unbind("mouseover",nQ.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this)){return true;
}event.type="mouseenter";return nQ.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(nQ.browser.msie){return false;
}nQ(this).bind("mouseout",nQ.event.special.mouseleave.handler);return true;},teardown:function(){if(nQ.browser.msie){return false;
}nQ(this).unbind("mouseout",nQ.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this)){return true;
}event.type="mouseleave";return nQ.event.handle.apply(this,arguments);}}}};nQ.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){nQ.event.add(this,type,fn||data,fn&&data);
});},one:function(type,data,fn){var one=nQ.event.proxy(fn||data,function(event){nQ(this).unbind(event,one);
return(fn||data).apply(this,arguments);});return this.each(function(){nQ.event.add(this,type,one,fn&&data);
});},unbind:function(type,fn){return this.each(function(){nQ.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){nQ.event.trigger(type,data,this,true,fn);
});},triggerHandler:function(type,data,fn){return this[0]&&nQ.event.trigger(type,data,this[0],false,fn);
},toggle:function(fn){var args=arguments,i=1;while(i<args.length){nQ.event.proxy(fn,args[i++]);}return this.click(nQ.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;
event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind("mouseenter",fnOver).bind("mouseleave",fnOut);
},ready:function(fn){bindReady();if(nQ.isReady){fn.call(document,nQ);}else{nQ.readyList.push(function(){return fn.call(this,nQ);
});}return this;}});nQ.extend({isReady:false,readyList:[],ready:function(){if(!nQ.isReady){nQ.isReady=true;
if(nQ.readyList){nQ.each(nQ.readyList,function(){this.call(document);});nQ.readyList=null;}nQ(document).triggerHandler("ready");
}}});var readyBound=false;function bindReady(){if(readyBound){return ;}readyBound=true;if(document.addEventListener&&!nQ.browser.opera){document.addEventListener("DOMContentLoaded",nQ.ready,false);
}if(nQ.browser.msie&&window==top){(function(){if(nQ.isReady){return ;}try{document.documentElement.doScroll("left");
}catch(error){setTimeout(arguments.callee,0);return ;}nQ.ready();})();}if(nQ.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(nQ.isReady){return ;
}for(var i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);
return ;}}nQ.ready();},false);}if(nQ.browser.safari){var numStyles;(function(){if(nQ.isReady){return ;
}if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return ;
}if(numStyles===undefined){numStyles=nQ("style, link[rel=stylesheet]").length;}if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);
return ;}nQ.ready();})();}nQ.event.add(window,"load",nQ.ready);}nQ.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){nQ.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);
};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem){try{parent=parent.parentNode;
}catch(error){parent=elem;}}return parent==elem;};nQ(window).bind("unload",function(){nQ("*:not('applet,object')").add(document).unbind();
});nQ.fn.extend({_load:nQ.fn.load,load:function(url,params,callback){if(typeof url!="string"){return this._load(url);
}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};
var type="GET";if(params){if(nQ.isFunction(params)){callback=params;params=null;}else{params=nQ.param(params);
type="POST";}}var self=this;nQ.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?nQ("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);
}self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return nQ.param(this.serializeArray());
},serializeArray:function(){return this.map(function(){return nQ.nodeName(this,"form")?nQ.makeArray(this.elements):this;
}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));
}).map(function(i,elem){var val=nQ(this).val();return val==null?null:val.constructor==Array?nQ.map(val,function(val,i){return{name:elem.name,value:val};
}):{name:elem.name,value:val};}).get();}});nQ.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){nQ.fn[o]=function(f){return this.bind(o,f);
};});var jsc=now();nQ.extend({get:function(url,data,callback,type){if(nQ.isFunction(data)){callback=data;
data=null;}return nQ.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return nQ.get(url,null,callback,"script");
},getJSON:function(url,data,callback){return nQ.get(url,data,callback,"json");},post:function(url,data,callback,type){if(nQ.isFunction(data)){callback=data;
data={};}return nQ.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){nQ.extend(nQ.ajaxSettings,settings);
},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=nQ.extend(true,s,nQ.extend(true,{},nQ.ajaxSettings,s));
var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string"){s.data=nQ.param(s.data);
}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";
}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";}}s.dataType="json";
}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");
}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();
complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head){head.removeChild(script);
}};}if(s.dataType=="script"&&s.cache==null){s.cache=false;}if(s.cache===false&&type=="GET"){var ts=now();
var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");
}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!nQ.active++){nQ.event.trigger("ajaxStart");
}var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&(s.url.substring(0,5)=="https"||remote.exec(s.url)[1]!=location.host)){var head=document.getElementsByTagName("head")[0];
var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset;
}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;
success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;
var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username){xhr.open(type,s.url,s.async,s.username,s.password);
}else{xhr.open(type,s.url,s.async);}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType);
}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",nQ.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");
}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);
}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&nQ.active--;xhr.abort();return false;
}if(s.global){nQ.event.trigger("ajaxSend",[xhr,s]);}var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;
if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!nQ.httpSuccess(xhr)&&"error"||s.ifModified&&nQ.httpNotModified(xhr,s.url)&&"notmodified"||"success";
if(status=="success"){try{data=nQ.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";
}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes){nQ.lastModified[s.url]=modRes;
}if(!jsonp){success();}}else{nQ.handleError(s,xhr,status);}complete();if(s.async){xhr=null;}}};if(s.async){var ival=setInterval(onreadystatechange,13);
if(s.timeout>0){setTimeout(function(){if(xhr){xhr.abort();if(!requestDone){onreadystatechange("timeout");
}}},s.timeout);}}try{xhr.send(s.data);}catch(e){nQ.handleError(s,xhr,null,e);}if(!s.async){onreadystatechange();
}function success(){if(s.success){s.success(data,status);}if(s.global){nQ.event.trigger("ajaxSuccess",[xhr,s]);
}}function complete(){if(s.complete){s.complete(xhr,status);}if(s.global){nQ.event.trigger("ajaxComplete",[xhr,s]);
}if(s.global&&!--nQ.active){nQ.event.trigger("ajaxStop");}}return xhr;},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e);
}if(s.global){nQ.event.trigger("ajaxError",[xhr,s,e]);}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||nQ.browser.safari&&xhr.status==undefined;
}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");
return xhr.status==304||xhrRes==nQ.lastModified[url]||nQ.browser.safari&&xhr.status==undefined;}catch(e){}return false;
},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;
if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror";}if(filter){data=filter(data,type);
}if(type=="script"){nQ.globalEval(data);}if(type=="json"){data=eval("("+data+")");}return data;},param:function(a){var s=[];
if(a.constructor==Array||a.jquery){nQ.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));
});}else{for(var j in a){if(a[j]&&a[j].constructor==Array){nQ.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));
});}else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(nQ.isFunction(a[j])?a[j]():a[j]));}}}return s.join("&").replace(/%20/g,"+");
}});nQ.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";
if(nQ.css(this,"display")=="none"){var elem=nQ("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");
if(this.style.display=="none"){this.style.display="block";}elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||nQ.css(this,"display");
this.style.display="none";}).end();},_toggle:nQ.fn.toggle,toggle:function(fn,fn2){return nQ.isFunction(fn)&&nQ.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){nQ(this)[nQ(this).is(":hidden")?"show":"hide"]();
});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);
},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);
},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);
},animate:function(prop,speed,easing,callback){var optall=nQ.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false;
}var opt=nQ.extend({},optall),p,hidden=nQ(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this);
}if(p=="height"||p=="width"){opt.display=nQ.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null){this.style.overflow="hidden";
}opt.curAnim=nQ.extend({},prop);nQ.each(prop,function(name,val){var e=new nQ.fx(self,opt,name);if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop);
}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";
if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;
}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start;}e.custom(start,end,unit);}else{e.custom(start,val,"");
}}});return true;});},queue:function(type,fn){if(nQ.isFunction(type)||(type&&type.constructor==Array)){fn=type;
type="fx";}if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type);}return this.each(function(){if(fn.constructor==Array){queue(this,type,fn);
}else{queue(this,type).push(fn);if(queue(this,type).length==1){fn.call(this);}}});},stop:function(clearQueue,gotoEnd){var timers=nQ.timers;
if(clearQueue){this.queue([]);}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true);
}timers.splice(i,1);}}});if(!gotoEnd){this.dequeue();}return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";
var q=nQ.data(elem,type+"queue");if(!q||array){q=nQ.data(elem,type+"queue",nQ.makeArray(array));}}return q;
};nQ.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();
if(q.length){q[0].call(this);}});};nQ.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||nQ.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};
opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:nQ.fx.speeds[opt.duration])||nQ.fx.speeds.def;
opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){nQ(this).dequeue();}if(nQ.isFunction(opt.old)){opt.old.call(this);
}};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;
}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;
if(!options.orig){options.orig={};}}});nQ.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this);
}(nQ.fx.step[this.prop]||nQ.fx.step._default)(this);if(this.prop=="height"||this.prop=="width"){this.elem.style.display="block";
}},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop];
}var r=parseFloat(nQ.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(nQ.curCSS(this.elem,this.prop))||0;
},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";
this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);
}t.elem=this.elem;nQ.timers.push(t);if(nQ.timerId==null){nQ.timerId=setInterval(function(){var timers=nQ.timers;
for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1);}}if(!timers.length){clearInterval(nQ.timerId);
nQ.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=nQ.attr(this.elem.style,this.prop);
this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px";
}nQ(this.elem).show();},hide:function(){this.options.orig[this.prop]=nQ.attr(this.elem.style,this.prop);
this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;
this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false;
}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;
if(nQ.css(this.elem,"display")=="none"){this.elem.style.display="block";}}if(this.options.hide){this.elem.style.display="none";
}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){nQ.attr(this.elem.style,p,this.options.orig[p]);
}}}if(done){this.options.complete.call(this.elem);}return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;
this.pos=nQ.easing[this.options.easing||(nQ.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);
this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};nQ.extend(nQ.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;
},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){nQ.attr(fx.elem.style,"opacity",fx.now);
},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});nQ.fn.offset=function(){var left=0,top=0,elem=this[0],results;
if(elem){with(nQ.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=nQ.curCSS,fixed=css(elem,"position")=="fixed";
if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));
add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);
while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent);
}if(!fixed&&css(offsetParent,"position")=="fixed"){fixed=true;}offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;
offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop);
}if(mozilla&&css(parent,"overflow")!="visible"){border(parent);}parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop);
}if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));
}}results={top:top,left:left};}}function border(elem){add(nQ.curCSS(elem,"borderLeftWidth",true),nQ.curCSS(elem,"borderTopWidth",true));
}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};nQ.fn.extend({position:function(){var left=0,top=0,results;
if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();
offset.top-=num(this,"marginTop");offset.left-=num(this,"marginLeft");parentOffset.top+=num(offsetParent,"borderTopWidth");
parentOffset.left+=num(offsetParent,"borderLeftWidth");results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};
}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&nQ.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent;
}return nQ(offsetParent);}});nQ.each(["Left","Top"],function(i,name){var method="scroll"+name;nQ.fn[method]=function(val){if(!this[0]){return ;
}return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:nQ(window).scrollLeft(),i?val:nQ(window).scrollTop()):this[method]=val;
}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||nQ.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];
};});nQ.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";nQ.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);
};nQ.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);
};});})();var historyData=null;nQ.autocomplete=function(D,T){var O=this;var Y=nQ(D).attr("autocomplete","off");
if(T.inputClass){Y.addClass(T.inputClass);}var P=document.createElement("div");var H=nQ(P);H.hide().addClass(T.resultsClass).css("position","absolute");
if(T.width>0){H.css("width",T.width);}nQ("body").append(P);D.autocompleter=O;var o=null;var X="";var q=-1;
var I={};var e=false;var J=false;var A=null;function L(){I={};I.data={};I.length=0;}L();if(T.data!=null){var R="",z={},M=[];
if(typeof T.url!="string"){T.cacheLength=1;}for(var w=0;w<T.data.length;w++){M=((typeof T.data[w]=="string")?[T.data[w]]:T.data[w]);
if(M[0].length>0){R=M[0].substring(0,1).toLowerCase();if(!z[R]){z[R]=[];}z[R].push(M);}}for(var u in z){T.cacheLength++;
E(u,z[u]);}}Y.keydown(function(k){A=k.keyCode;switch(k.keyCode){case 38:k.preventDefault();g(-1);break;
case 40:k.preventDefault();g(1);break;case 9:if(l()){if(!T.multiple){event.keyCode=KEY.TAB;}else{event.preventDefault();
}}break;case 13:if(l()){k.preventDefault();}Y.get(0).blur();break;default:D.lastSelected=null;q=-1;if(o){clearTimeout(o);
}o=setTimeout(function(){S();},T.delay);break;}}).focus(function(){J=true;}).blur(function(){J=false;
C();});U();function S(){if(A==46||(A>8&&A<32)){return H.hide();}var k=Y.val();if(k==X){return ;}X=k;if(k.length>=T.minChars){Y.addClass(T.loadingClass);
f(k);}else{Y.removeClass(T.loadingClass);H.hide();}}function g(AA){var k=nQ("li",P);if(!k){return ;}q+=AA;
if(q<0){q=0;}else{if(q>=k.size()){q=k.size()-1;}}k.removeClass("ac_over");nQ(k[q]).addClass("ac_over");
}function l(){var k=nQ("li.ac_over",P)[0];if(!k){var AA=nQ("li",P);if(T.selectOnly){if(AA.length==1){k=AA[0];
}}else{if(T.selectFirst){k=AA[0];}}}if(k){Q(k);return true;}else{return false;}}function Q(k){if(!k){k=document.createElement("li");
k.extra=[];k.selectValue="";}var AA=nQ.trim(k.selectValue?k.selectValue:k.innerHTML);if(k.selectValue){if(k.innerHTML.length>k.selectValue.length){AA=k.innerHTML;
}}D.lastSelected=AA;X=AA;H.html("");if(T.formatItem){Y.val(T.formatItem(AA));}Nvt.Core.NvtAnalytics.virtual("/virtual/search/autocompleteselected/"+T.formatItem(AA));
U();if(T.onItemSelect){setTimeout(function(){T.onItemSelect(k);},1);}}function B(AC,AA){var AB=Y.get(0);
if(AB.createTextRange){var k=AB.createTextRange();k.collapse(true);k.moveStart("character",AC);k.moveEnd("character",AA);
k.select();}else{if(AB.setSelectionRange){AB.setSelectionRange(AC,AA);}else{if(AB.selectionStart){AB.selectionStart=AC;
AB.selectionEnd=AA;}}}AB.focus();}function W(k){if(A!=8){Y.val(Y.val()+k.substring(X.length));B(X.length,k.length);
}}function h(){var AB=Z(D);var AA=(T.width>0)?T.width:Y.width();H.css({width:parseInt(AA)+"px",top:(AB.y+D.offsetHeight)+"px",left:AB.x+"px"}).show();
var k=nQ(P).height();nQ("#"+Y.attr("id")+"Shim").show().height(k);}function C(){if(o){clearTimeout(o);
}o=setTimeout(U,200);}function U(){if(o){clearTimeout(o);}Y.removeClass(T.loadingClass);if(H.is(":visible")){H.hide();
nQ("#"+Y.attr("id")+"Shim").hide();}if(T.mustMatch){var k=Y.val();if(k!=D.lastSelected){Q(null);}}}function G(AD,AC,AB){if(AC){var AA=historyData.length;
if(!AB){var AE=AC.length;for(var k=0;k<AE;k++){historyData[AA+k]=AC[k];}AC=historyData;historyData=[];
}Y.removeClass(T.loadingClass);P.innerHTML="";if(!J||AC.length==0){return U();}if(nQ.browser.msie){H.append(document.createElement("iframe"));
}P.appendChild(t(AC));if(T.autoFill&&(Y.val().toLowerCase()==AD.toLowerCase())){W(AC[0][0]);}h();Nvt.Util.zebraStripe();
}else{U();}}function F(){var AC=autoComplete;if(!AC){return null;}var k=[];var AB=AC.presentationObjects.roads;
for(var AA=0;AA<AB.length;AA++){var AD=nQ.trim(AB[AA].name+" "+K(AB[AA].direction)+"$"+AB[AA].id);if(AD){k[k.length]=AD.split(T.cellSeparator);
}}return k;}function K(k){if(k.toUpperCase().indexOf("INBOUND")==-1&&k.toUpperCase().indexOf("OUTBOUND")==-1){k=k.replace(/BOUND/i,"");
k=k.substring(0,1)+k.substring(1).toLowerCase();}else{k=k.substring(0,1)+k.substring(1).toLowerCase();
}return k;}function t(AF){var AE=document.createElement("ul");nQ(AE).addClass("nvt_striped");nQ(AE).attr("id","nvt_acResults");
var AC=AF.length;if((T.maxItemsToShow>0)&&(T.maxItemsToShow<AC)){AC=T.maxItemsToShow;}for(var AD=0;AD<AC;
AD++){var AG=AF[AD];if(!AG){continue;}var AA=document.createElement("li");nQ(AA).addClass("selectionItem");
if(T.formatItem){AA.innerHTML=T.formatItem(AG,AD,AC);AA.selectValue=AG[0];}else{AA.innerHTML=AG[0];AA.selectValue=AG[0];
}var k=null;if(AG.length>1){k=[];for(var AB=1;AB<AG.length;AB++){k[k.length]=AG[AB];}}AA.extra=k;AE.appendChild(AA);
nQ(AA).hover(function(){nQ("li",AE).removeClass("ac_over");nQ(this).addClass("ac_over");q=nQ("li",AE).indexOf(nQ(this).get(0));
},function(){nQ(this).removeClass("ac_over");}).click(function(AH){AH.preventDefault();AH.stopPropagation();
Q(this);});}return AE;}function f(AA){if(!T.matchCase){AA=AA.toLowerCase();}var k=T.cacheLength?y(AA):null;
G(AA,V(AA),true);if(k){G(AA,k);}else{if((typeof T.url=="string")&&(T.url.length>0)){nQ.getScript(N(AA),function(){k=F();
E(AA,k);G(AA,k);});}else{Y.removeClass(T.loadingClass);}}}function V(AC){var k=Nvt.Util.readCookie("RouteHistory");
historyData=[];if(k!=null){k=new String(k);while(k.indexOf("|")>-1){k=k.replace("|",",");}try{if(k.isJSON()){var AB=k.evalJSON();
}for(var AA=0;AA<AB.length;AA++){if(AB[AA].display.toLowerCase().indexOf(AC)!=-1){historyData[AA]=AB[AA].display+"$"+AB[AA].display;
}}}catch(AD){}}return historyData.compact();}function N(AB){var k=T.url+(T.url.indexOf("?")>-1?"&":"?")+"q="+encodeURI(AB);
if(T.extraParams){k=k+"&"+T.extraParams();}for(var AA in T.extraParams){k+="&"+AA+"="+encodeURI(T.extraParams[AA]);
}return k;}function y(AF){if(!AF){return null;}if(I.data[AF]){return I.data[AF];}if(T.matchSubset){for(var AD=AF.length-1;
AD>=T.minChars;AD--){var AA=AF.substr(0,AD);var AG=I.data[AA];if(AG){var AE=[];for(var AB=0;AB<AG.length;
AB++){var k=AG[AB];var AC=k[0];if(b(AC,AF)){AE[AE.length]=k;}}return AE;}}}return null;}function b(AB,AA){if(!T.matchCase){AB=AB.toLowerCase();
}var k=AB.indexOf(AA);if(k==-1){return false;}return k==0||T.matchContains;}this.flushCache=function(){L();
};this.setExtraParams=function(k){T.extraParams=k;};this.findValue=function(){var AA=Y.val();if(!T.matchCase){AA=AA.toLowerCase();
}var k=T.cacheLength?y(AA):null;if(k){n(AA,k);}else{if((typeof T.url=="string")&&(T.url.length>0)){nQ.getScript(N(AA),function(){k=F();
E(AA,k);G(AA,k);});}else{n(AA,null);}}};function n(AF,AE){if(AE){Y.removeClass(T.loadingClass);}var AC=(AE)?AE.length:0;
var AA=null;for(var AD=0;AD<AC;AD++){var AG=AE[AD];if(AG[0].toLowerCase()==AF.toLowerCase()){AA=document.createElement("li");
if(T.formatItem){AA.innerHTML=T.formatItem(AG,AD,AC);AA.selectValue=AG[0];}else{AA.innerHTML=AG[0];AA.selectValue=AG[0];
}var k=null;if(AG.length>1){k=[];for(var AB=1;AB<AG.length;AB++){k[k.length]=AG[AB];}}AA.extra=k;}}if(T.onFindValue){setTimeout(function(){T.onFindValue(AA);
},1);}}function E(AA,k){if(!k||!AA||!T.cacheLength){return ;}if(!I.length||I.length>T.cacheLength){L();
I.length++;}else{if(!I[AA]){I.length++;}}I.data[AA]=k;}function Z(AA){var AB=AA.offsetLeft||0;var k=AA.offsetTop||0;
while(AA=AA.offsetParent){AB+=AA.offsetLeft;k+=AA.offsetTop;}return{x:AB,y:k};}};nQ.fn.autocomplete=function(B,A,C){A=A||{};
A.url=B;A.data=((typeof C=="object")&&(C.constructor==Array))?C:null;A.inputClass=A.inputClass||"ac_input";
A.resultsClass=A.resultsClass||"ac_results";A.lineSeparator=A.lineSeparator||"\n";A.cellSeparator=A.cellSeparator||"|";
A.minChars=A.minChars||1;A.delay=A.delay||400;A.matchCase=A.matchCase||0;A.matchSubset=A.matchSubset||1;
A.matchContains=A.matchContains||0;A.cacheLength=A.cacheLength||1;A.mustMatch=A.mustMatch||0;A.extraParams=A.extraParams||{};
A.loadingClass=A.loadingClass||"ac_loading";A.selectFirst=A.selectFirst||false;A.selectOnly=A.selectOnly||false;
A.maxItemsToShow=A.maxItemsToShow||-1;A.autoFill=A.autoFill||false;A.width=parseInt(A.width,10)||0;this.each(function(){var D=this;
new nQ.autocomplete(D,A);});return this;};nQ.fn.autocompleteArray=function(B,A){return this.autocomplete(null,A,B);
};nQ.fn.indexOf=function(B){for(var A=0;A<this.length;A++){if(this[A]==B){return A;}}return -1;};nQ.extend({historyCurrentHash:undefined,historyCallback:undefined,historyInit:function(D){nQ.historyCallback=D;
var C=location.hash;nQ.historyCurrentHash=C;if(nQ.browser.msie){if(nQ.historyCurrentHash==""){nQ.historyCurrentHash="#";
}nQ("body").prepend('<iframe id="nQ_history" style="display: none; height: 0px; width: 0px; overflow: hidden; position: absolute;"></iframe>');
var A=nQ("#nQ_history")[0];var B=A.contentWindow.document;B.open();B.close();B.location.hash=C;}else{if(nQ.browser.safari){nQ.historyBackStack=[];
nQ.historyBackStack.length=history.length;nQ.historyForwardStack=[];nQ.isFirst=true;}}nQ.historyCallback(C.replace(/^#/,""));
setInterval(nQ.historyCheck,100);},historyAddHistory:function(A){nQ.historyBackStack.push(A);nQ.historyForwardStack.length=0;
this.isFirst=true;},historyCheck:function(){if(nQ.browser.msie){var A=nQ("#nQ_history")[0];var E=A.contentDocument||A.contentWindow.document;
var G=E.location.hash;if(G!=nQ.historyCurrentHash){location.hash=G;nQ.historyCurrentHash=G;nQ.historyCallback(G.replace(/^#/,""));
}}else{if(nQ.browser.safari){if(!nQ.dontCheck){var B=history.length-nQ.historyBackStack.length;if(B){nQ.isFirst=false;
if(B<0){for(var C=0;C<Math.abs(B);C++){nQ.historyForwardStack.unshift(nQ.historyBackStack.pop());}}else{for(var C=0;
C<B;C++){nQ.historyBackStack.push(nQ.historyForwardStack.shift());}}var F=nQ.historyBackStack[nQ.historyBackStack.length-1];
if(F!=undefined){nQ.historyCurrentHash=location.hash;nQ.historyCallback(F);}}else{if(nQ.historyBackStack[nQ.historyBackStack.length-1]==undefined&&!nQ.isFirst){if(document.URL.indexOf("#")>=0){nQ.historyCallback(document.URL.split("#")[1]);
}else{var G=location.hash;nQ.historyCallback("");}nQ.isFirst=true;}}}}else{var G=location.hash;if(G!=nQ.historyCurrentHash){nQ.historyCurrentHash=G;
var D=G.replace(/^#/,"");if(D.length>0){nQ.historyCallback(G.replace(/^#/,""));}}}}},historyLoad:function(D){var E;
if(nQ.browser.safari){E=D;}else{E="#"+D;location.hash=E;}nQ.historyCurrentHash=E;if(nQ.browser.msie){var A=nQ("#nQ_history")[0];
var C=A.contentWindow.document;C.open();C.close();C.location.hash=E;nQ.historyCallback(D);}else{if(nQ.browser.safari){nQ.dontCheck=true;
this.historyAddHistory(D);var B=function(){nQ.dontCheck=false;};window.setTimeout(B,200);nQ.historyCallback(D);
location.hash=E;}else{Nvt.console.log("history callback");nQ.historyCallback(D);}}}});(function(A){nQ.fn.marquee=function(B){var E=[],D=this.length;
function C(L,K,J,H,G){var I=0;if(K=="alternate"){I=L==1?J.scrollWidth-(H*2):H;}else{if(K=="slide"){if(L==-1){I=G==-1?J.scrollWidth:H;
}else{I=G==-1?J.scrollWidth-(H*2):0;}}else{I=L==-1?J.scrollWidth:0;}}return I;}function F(){var H=E.length,I=null,L=null,K={},J=[],G=false;
while(H--){I=E[H];L=A(I);K=L.data("marqueeState");if(K==null){continue;}if(L.data("paused")!==true){I.scrollLeft+=(K.scrollamount*K.dir);
G=K.dir==-1?I.scrollLeft<=C(K.dir*-1,K.behavior,I,K.width,K.dir):I.scrollLeft>=C(K.dir*-1,K.behavior,I,K.width,K.dir);
if((K.behavior=="scroll"&&K.last==I.scrollLeft)||(K.behavior=="alternate"&&G&&K.last!=-1)||(K.behavior=="slide"&&G&&K.last!=-1)){if(K.behavior=="alternate"){K.dir*=-1;
}K.last=-1;L.trigger("stop");K.loops--;if(K.loops===0){if(K.behavior!="slide"){I.scrollLeft=C(K.dir,K.behavior,I,K.width,K.dir);
}else{I.scrollLeft=C(K.dir*-1,K.behavior,I,K.width,K.dir);}L.trigger("end");}else{J.push(I);L.trigger("start");
I.scrollLeft=C(K.dir,K.behavior,I,K.width,K.dir);}}else{J.push(I);}K.last=I.scrollLeft;L.data("marqueeState",K);
}else{J.push(I);}}E=J;if(E.length){setTimeout(F,25);}}this.each(function(I){var G=A(this),J=G.attr("width")||G.width(),M=G.after("<div "+(B?'class="'+B+'" ':"")+'style="display: block-inline; width: '+J+'px; overflow: hidden;"><div style="padding: 0 '+J+'px; float: left; white-space: nowrap;">'+G.html()+"</div></div>").next(),K=M.get(0),H=0,L={dir:G.attr("direction")=="right"?-1:1,last:-1,loops:G.attr("loop")||-1,scrollamount:G.attr("scrollamount")||this.scrollAmount||2,behavior:(G.attr("behavior")||"scroll").toLowerCase(),width:J};
G.remove();M.bind("stop",function(){M.data("paused",true);}).bind("pause",function(){M.data("paused",true);
}).bind("start",function(){M.data("paused",false);}).bind("unpause",function(){M.data("paused",false);
}).data("marqueeState",L);E.push(K);K.scrollLeft=C(L.dir,L.behavior,K,L.width,L.dir);M.trigger("start");
if(I+1==D){F();}});return A(E);};}(nQ));nQ.fn.dump=function(A,B){nQ.dump($(this),A,B);return this;};nQ.dump=function(R,E,Q,D){var F="";
var K=typeof Q=="undefined"?true:Q;var B=typeof D=="undefined"?true:D;var M="dumpWin";var H=760;var N=500;
var J=screen.width?(screen.width-H)/2:0;var A=screen.height?(screen.height-N)/2:0;var O="height="+N+",width="+H+",top="+A+",left="+J+",scrollbars=yes,menubar=yes,status=yes,resizable=yes";
var S="Dump";var P='function tRow(s) {t = s.parentNode.lastChild;tTarget(t, tSource(s)) ;}function tTable(s) {var switchToState = tSource(s) ;var table = s.parentNode.parentNode;for (var i = 1; i < table.childNodes.length; i++) {t = table.childNodes[i] ;if (t.style) {tTarget(t, switchToState);}}}function tSource(s) {if (s.style.fontStyle == "italic" || s.style.fontStyle == null) {s.style.fontStyle = "normal";s.title = "click to collapse";return "open";} else {s.style.fontStyle = "italic";s.title = "click to expand";return "closed" ;}}function tTarget (t, switchToState) {if (switchToState == "open") {t.style.display = "";} else {t.style.display = "none";}}';
var I=function(U,Z){var W;var V=0;var T="";Z=G(U);switch(Z){case"regexp":var e=Z;T+="<table"+C(e,"table")+'><tr><th colspan="2"'+C(e,"th")+">"+e+"</th></tr>";
T+='<tr><td colspan="2"'+C(e,"td-value")+"><table"+C("arguments","table")+"><tr><td"+C("arguments","td-key")+"><i>RegExp: </i></td><td"+C(Z,"td-value")+">"+U+"</td></tr></table>";
V++;break;case"date":var e=Z;T+="<table"+C(e,"table")+'><tr><th colspan="2"'+C(e,"th")+">"+e+"</th></tr>";
T+='<tr><td colspan="2"'+C(e,"td-value")+"><table"+C("arguments","table")+"><tr><td"+C("arguments","td-key")+"><i>Date: </i></td><td"+C(Z,"td-value")+">"+U+"</td></tr></table>";
V++;break;case"function":var e=Z;var b=U.toString().match(/^.*function.*?\((.*?)\)/im);var Y=(b==null||typeof b[1]=="undefined"||b[1]=="")?"none":b[1];
T+="<table"+C(e,"table")+'><tr><th colspan="2"'+C(e,"th")+">"+e+"</th></tr>";T+='<tr><td colspan="2"'+C(e,"td-value")+"><table"+C("arguments","table")+"><tr><td"+C("arguments","td-key")+"><i>Arguments: </i></td><td"+C(Z,"td-value")+">"+Y+"</td></tr><tr><td"+C("arguments","td-key")+"><i>Function: </i></td><td"+C(Z,"td-value")+">"+U+"</td></tr></table>";
V++;break;case"domelement":var e=Z;var X="";if(B){for(W in U){if(!/innerHTML|outerHTML/i.test(W)){X+=W+": "+U[W]+"<br />";
}}}T+="<table"+C(e,"table")+'><tr><th colspan="2"'+C(e,"th")+">"+E+" - "+e+"</th></tr>";T+="<tr><td"+C(e,"td-key")+"><i>Node Name: </i></td><td"+C(Z,"td-value")+">"+U.nodeName.toLowerCase()+"</td></tr>";
T+="<tr><td"+C(e,"td-key")+"><i>Node Type: </i></td><td"+C(Z,"td-value")+">"+U.nodeType+"</td></tr>";
T+="<tr><td"+C(e,"td-key")+"><i>Node Value: </i></td><td"+C(Z,"td-value")+">"+U.nodeValue+"</td></tr>";
if(B){T+="<tr><td"+C(e,"td-key")+"><i>Attributes: </i></td><td"+C(Z,"td-value")+">"+X+"</td></tr>";T+="<tr><td"+C(e,"td-key")+"><i>innerHTML: </i></td><td"+C(Z,"td-value")+">"+U.innerHTML+"</td></tr>";
if(typeof U.outerHTML!="undefined"){T+="<tr><td"+C(e,"td-key")+"><i>outerHTML: </i></td><td"+C(Z,"td-value")+">"+U.outerHTML+"</td></tr>";
}}V++;break;}if(/object|array/.test(Z)){for(W in U){var e=G(U[W]);if(V<1){T+="<table"+C(Z,"table")+'><tr><th colspan="2"'+C(Z,"th")+">"+E+" - "+Z+"</th></tr>";
V++;}if(typeof U[W]=="object"&&U[W]!=null){T+="<tr><td"+C(Z,"td-key")+">"+W+(K?" ["+e+"]":"")+"</td><td"+C(Z,"td-value")+">"+I(U[W],e)+"</td></tr>";
}else{if(typeof U[W]=="function"){T+="<tr><td"+C(Z,"td-key")+">"+W+(K?" ["+e+"]":"")+"</td><td"+C(Z,"td-value")+">"+I(U[W],e)+"</td></tr>";
}else{if((""+U[W]).length>0){T+="<tr><td"+C(Z,"td-key")+">"+W+(K?" ["+e+"]":"")+"</td><td"+C(Z,"td-value")+">"+U[W]+"</td></tr>";
}}}}}if(V==0){T+="<table"+C(Z,"table")+'><tr><th colspan="2"'+C(Z,"th")+">"+Z+" [empty]</th></tr>";}T+="</table>";
return T;};var C=function(U,T){var X="";var W="font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;cell-spacing:2px;";
var V="font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;text-align:left;color: white;padding: 5px;vertical-align :top;cursor:hand;cursor:pointer;";
var b="font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;vertical-align:top;padding:3px;";
var Z='onClick="tTable(this);" title="click to collapse"';var Y='onClick="tRow(this);" title="click to collapse"';
switch(U){case"string":case"number":case"boolean":case"undefined":case"object":switch(T){case"table":X=' style="'+W+'background-color:#0000cc;"';
break;case"th":X=' style="'+V+'background-color:#4444cc;"'+Z;break;case"td-key":X=' style="'+b+'background-color:#ccddff;cursor:hand;cursor:pointer;"'+Y;
break;case"td-value":X=' style="'+b+'background-color:#fff;"';break;}break;case"array":switch(T){case"table":X=' style="'+W+'background-color:#006600;"';
break;case"th":X=' style="'+V+'background-color:#009900;"'+Z;break;case"td-key":X=' style="'+b+'background-color:#ccffcc;cursor:hand;cursor:pointer;"'+Y;
break;case"td-value":X=' style="'+b+'background-color:#fff;"';break;}break;case"function":switch(T){case"table":X=' style="'+W+'background-color:#aa4400;"';
break;case"th":X=' style="'+V+'background-color:#cc6600;"'+Z;break;case"td-key":X=' style="'+b+'background-color:#fff;cursor:hand;cursor:pointer;"'+Y;
break;case"td-value":X=' style="'+b+'background-color:#fff;"';break;}break;case"arguments":switch(T){case"table":X=' style="'+W+'background-color:#dddddd;cell-spacing:3;"';
break;case"td-key":X=' style="'+V+'background-color:#eeeeee;color:#000000;cursor:hand;cursor:pointer;"'+Y;
break;}break;case"regexp":switch(T){case"table":X=' style="'+W+'background-color:#CC0000;cell-spacing:3;"';
break;case"th":X=' style="'+V+'background-color:#FF0000;"'+Z;break;case"td-key":X=' style="'+V+'background-color:#FF5757;color:#000000;cursor:hand;cursor:pointer;"'+Y;
break;case"td-value":X=' style="'+b+'background-color:#fff;"';break;}break;case"date":switch(T){case"table":X=' style="'+W+'background-color:#663399;cell-spacing:3;"';
break;case"th":X=' style="'+V+'background-color:#9966CC;"'+Z;break;case"td-key":X=' style="'+V+'background-color:#B266FF;color:#000000;cursor:hand;cursor:pointer;"'+Y;
break;case"td-value":X=' style="'+b+'background-color:#fff;"';break;}break;case"domelement":case"document":case"window":switch(T){case"table":X=' style="'+W+'background-color:#FFCC33;cell-spacing:3;"';
break;case"th":X=' style="'+V+'background-color:#FFD966;"'+Z;break;case"td-key":X=' style="'+V+'background-color:#FFF2CC;color:#000000;cursor:hand;cursor:pointer;"'+Y;
break;case"td-value":X=' style="'+b+'background-color:#fff;"';break;}break;}return X;};var G=function(U){var e=typeof (U);
if(e=="function"){var W=U.toString();if((/^\/.*\/[gi]??[gi]??$/).test(W)){return"regexp";}else{if((/^\[object.*\]$/i).test(W)){e="object";
}}}if(e!="object"){return e;}switch(U){case null:return"null";case window:return"window";case document:return"document";
case window.event:return"event";}if(window.event&&(event.type==U.type)){return"event";}var Y=U.constructor;
if(Y!=null){switch(Y){case Array:e="array";break;case Date:return"date";case RegExp:return"regexp";case Object:e="object";
break;case ReferenceError:return"error";default:var Z=Y.toString();var T=Z.match(/\s*function (.*)\(/);
if(T!=null){return"object";}}}var b=U.nodeType;if(b!=null){switch(b){case 1:return"domelement";case 3:return"string";
}}if(U.toString!=null){var X=U.toString();var V=X.match(/^\[object (.*)\]$/i);if(V!=null){var V=V[1];
switch(V.toLowerCase()){case"event":return"event";case"nodelist":case"htmlcollection":case"elementarray":return"array";
case"htmldocument":return"htmldocument";}}}return e;};F+=(/string|number|undefined|boolean/.test(typeof (R))||R==null)?R:I(R,typeof R);
M=window.open("","",O);if(nQ.browser.msie||nQ.browser.browser=="opera"||nQ.browser.browser=="safari"){M.document.write("<html><head><title> "+S+' </title><script type="text/javascript">'+P+"<\/script><head>");
M.document.write("<body>"+F+"</body></html>");}else{M.document.body.innerHTML=F;M.document.title=S;var L=M.document.createElement("script");
L.setAttribute("type","text/javascript");L.appendChild(document.createTextNode(P));M.document.getElementsByTagName("head")[0].appendChild(L);
}M.focus();};var wt_dm="wdm.map24.com";var wt_ci="537758979624293";var wt_ln="standard";var wt_fm="";
var wt_cookie="1";var wt_is;var wt_c=new Array();var wt_version=183;var wt_va=Array("wt_t1","wt_t2","wt_ln","wt_fm","wt_ba","wt_co","wt_qn","wt_ca","wt_pi","wt_ov","wt_cr","wt_oi","wt_cd","wt_cg","wt_st","wt_linktrack_be","wt_mc","wt_mcvalue","wt_mcv","wt_cookie","wt_cookie_sid","wt_cookie_eid","wt_cookie_l_v","wt_cookie_one","wt_cookie_sid_timeout","wt_cookie_eid_timeout","wt_linktrack_params","wt_lp","wt_hm","wt_pa","wt_be","wt_dm","wt_ci","wt_kw","wt_ln_attribute","wt_fm_anonymous","wt_reporturl","wt_is","wt_fm_full_content","wt_fm_attribute","wt_ep","wt_ccParams","wt_sc");
for(var i=0;i<wt_va.length;i++){eval("if(typeof("+wt_va[i]+")!='string')var "+wt_va[i]+"='';");}var wt_browserName=navigator.appName,wt_browserName=(wt_indexOf(wt_browserName,"Microsoft")?wt_browserName:"MSIE"),wt_browserNameNS=(wt_browserName=="Netscape"),wt_browserNameIE=(wt_browserName=="MSIE");
if(!wt_be){wt_be=wt_url2contentid(document.location.href);}function wt_href(){return wt_location().href;
}function wt_location(){var r=document.location;if(!document.layers&&document.getElementById){eval("try {r=top.document.location;}catch(e){};");
}else{r=top.document.location;}return r;}function wt_length(A){return A!="undefined"?A.length:0;}function wt_url2contentid(A){if(!A){return"no_content";
}var B=new RegExp("//(.*)").exec(A);if(B.length<1){return"no_content";}return B[1].split("?")[0].replace(/\./g,"_").replace(/\//g,".").replace(/\.{2,};/g,".").toLowerCase();
}function wt_include(B){if(!document.createElement){return false;}var A=document.getElementsByTagName("head").item(0);
var C=document.createElement("script");C.setAttribute("language","javascript");C.setAttribute("type","text/javascript");
C.setAttribute("src",B);A.appendChild(C);return true;}function wt_indexOf(B,A,C){return B.indexOf(A,C?C:0);
}function wt_typeof(A){return(typeof A!="undefined")?1:0;}function wt_registerEvent(C,B,A){if(C.addEventListener){C.addEventListener(B,A,false);
}else{if(C.attachEvent){C.attachEvent("on"+B,A);}}}function wt_maxlen(B,A){if(B&&B.length>A){return B.substring(0,A-1);
}return B;}function wt_escape(A){if(typeof (encodeURIComponent)=="function"){return encodeURIComponent(A);
}return escape(A);}function wt_unescape(A){if(typeof (decodeURIComponent)=="function"){return decodeURIComponent(A);
}return unescape(A);}function wt_decoder(u){var tmp=unescape(u);if(document.layers){return wt_escape(tmp);
}if(document.getElementById){eval("try {tmp=decodeURIComponent(u);}catch(e){};");}else{tmp=decodeURIComponent(u);
}return wt_escape(tmp);}function wt_encoding(){var A="";if(typeof (encodeURIComponent)!="function"){A+="&enc0=old";
}A+="&enc1=�&enc2=";if(document.characterSet){A+=document.characterSet.toLowerCase();}if(document.charset){A+=document.charset.toLowerCase();
}return A;}function wt_crypt(A){var C="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var B="NOPQRSTUVWXYZABCDEFGHIJKLM5678901234";
A=A.replace(new RegExp("[A-Z]|[a-z]|[0-9]","gi"),function(D){var E=new RegExp("[A-Z]","g");var F=C.indexOf(D.toUpperCase());
if(E.test(D)){return B.charAt(F);}else{return B.charAt(F).toLowerCase();}});return A;}function wt_decrypt(x){if(x){return eval("try {wt_unescape(x.replace(/([0-9a-fA-F][0-9a-fA-F])/g,'%$1'));}catch(e){''};");
}}function wt_encrypt(x){var str="";for(var i=0;i<x.length;i++){if(x.charCodeAt(i)<255){str+=x.charCodeAt(i).toString(16);
}else{eval("try {str += encodeURIComponent(x[i]).replace(/%/g,'');}catch(e){};");}}return str;}function wt_checkSC(A){var C=wt_sc.split(";");
for(var B=0;B<C.length;B++){if(C[B]==A){return true;}}return false;}function wt_zeroPad(C,B){var A=C+"";
return"000000000000".substring(0,(B-A.length))+A;}function wt_sid(){return"2"+wt_zeroPad(Math.floor(new Date().getTime()/1000),10)+wt_zeroPad(Math.floor(Math.random()*1000000),8);
}function wt_getexpirydate(B){var A;var C=new Date();var D=Date.parse(C);C.setTime(D+B*60*1000);A=C.toUTCString();
return A;}function wt_setCookie(A,B,C){var D=location.hostname.split(".");D=D[D.length-2]+"."+D[D.length-1];
var E;if(C){E=A+"="+escape(B)+";domain="+D+";path=/;expires="+wt_getexpirydate(C);}else{E=A+"="+escape(B)+";path=/;domain="+D;
}document.cookie=E;}function wt_getCookie(A){var D=""+document.cookie;var C=D.indexOf(A);if(C==-1||A==""){return"";
}var B=D.indexOf(";",C);if(B==-1){B=D.length;}return unescape(D.substring(C+A.length+1,B));}function wt_urlParam(A,E,C){var D=new Array();
if(A.indexOf("?")>0){D=A.substring(A.indexOf("?")+1).replace(/&amp;/,"&").split("&");}for(var B=0;B<D.length;
B++){if(D[B].indexOf(E+"=")==0){return wt_unescape(D[B].substring(E.length+1).replace(/\+/,"%20"));}}return C;
}function wt_checkCookie(){if(wt_getCookie("wt_cookietest")=="1"){return true;}wt_setCookie("wt_cookietest","1",0);
return wt_getCookie("wt_cookietest")=="1";}var wt_linktrack_p="";var wt_linktrack_namedlinks_only;if(wt_ln=="auto"||wt_ln=="link"){wt_linktrack_namedlinks_only=false;
}else{wt_linktrack_namedlinks_only=true;}if(wt_ln){wt_registerEvent(window,"load",wt_ltinstall);}function wt_ltinstall(){for(c=0;
c<document.links.length;c++){var name=document.links[c].name;if(wt_ln_attribute!=""){var tmp="";eval("tmp = (document.links[c].getAttribute(wt_ln_attribute)?document.links[c].getAttribute(wt_ln_attribute):'')");
if(tmp){name=tmp;}}if(name||!wt_linktrack_namedlinks_only){wt_registerEvent(document.links[c],"mousedown",wt_linktrack);
}}}function wt_linktrack(e){if((e.which&&e.which==1)||(e.button&&e.button==1)){var a=document.all?window.event.srcElement:this;
for(var i=0;i<4;i++){if(a.tagName&&a.tagName.toLowerCase()!="a"&&a.tagName.toLowerCase()!="area"){a=a.parentElement;
}}a.lname=(a.name?a.name:"");wt_getCCParams(a);if(wt_ln_attribute!=""){var tmp="";eval("tmp = (a.getAttribute(wt_ln_attribute)?a.getAttribute(wt_ln_attribute):'')");
if(tmp){a.lname=tmp;}}a.lpos=0;if(!wt_length(a.lpos)&&a.tagName){c=document.links;for(d=0;d<wt_length(c);
d++){if(a==c[d]){a.lpos=d+1;break;}}}if(a.lpos){if(wt_ln=="link"){var y=a.href.indexOf("//");var y=(y>=0?a.href.substr(y+2):a.href);
if(typeof (wt_linktrack_pattern)!="undefined"){if(typeof (wt_linktrack_replace)!="string"){wt_linktrack_replace="";
}y=y.replace(wt_linktrack_pattern,wt_linktrack_replace);}wt_linktrack_p=wt_be.split(";")[0]+"."+(a.lname?(a.lname+"."):"")+y.split("?")[0].replace(/\//g,".");
var p=wt_linktrack_params.replace(/;/g,",").split(",");for(var i=0;i<p.length;i++){var v=wt_urlParam(y,p[i],"");
if(v){wt_linktrack_p+="."+p[i]+"."+v;}}}else{if(wt_ln=="auto"){if(!a.lname){wt_linktrack_p=(wt_linktrack_be?(wt_linktrack_be+"."):(wt_be.split(";")[0]+".link."))+a.lpos;
}else{wt_linktrack_p=wt_be.split(";")[0]+"."+a.lname;}}else{if(wt_ln=="standard"&&a.lname){wt_linktrack_p=a.lname;
}}}if(wt_linktrack_p&&a.target!=""&&a.target!="_self"){wt_send();}}}}function wt_getCCParams(A){var D="";
var C="";if(typeof (wt_cc)=="object"){if(typeof (wt_cc[A.name])=="string"){D=wt_cc[A.name];}if(typeof (wt_cc[A.id])=="string"){D=wt_cc[A.id];
}}if(D){D=D.split(/;/);for(var E=0;E<D.length;E++){if(typeof (D[E])!="undefined"){var B=D[E].split(/=/);
if(wt_checkSC("custom")){B[1]=wt_decrypt(B[1]);}B[1]=wt_escape(B[1]);C+="&"+B[0]+"="+B[1];}}}wt_ccParams=C;
return ;}var wt_gatherforms_p="";var wt_form=null;var wt_form_focus="";var wt_form_submit=false;if(wt_fm){wt_registerEvent(window,"load",wt_ftinstall);
}function wt_ftinstall(){wt_findform();if(!wt_form){return ;}for(var A=0;A<wt_form.elements.length;A++){var B=wt_form.elements[A];
wt_registerEvent(B,"focus",wt_formfocus);}wt_registerEvent(wt_form,"submit",wt_formsubmit);}function wt_findform(){wt_form=null;
if(document.forms){wt_form=document.forms[0];}var C=document.forms;for(var A=0;A<C.length;A++){var B=C[A];
if(wt_typeof(B.elements["wt_form"])){wt_form=B;return ;}}}function wt_formsubmit(){wt_form_submit=true;
}function wt_formfocus(B){var A=document.all?window.event.srcElement:B.target;if(!A.name||A.type=="submit"||A.type=="image"){return ;
}wt_form_focus=(wt_form.name?wt_form.name:wt_be.split(";")[0])+"."+A.name+"."+A.type;}function wt_gatherForm(){var del=";";
if(!wt_form){return ;}var f=wt_form;var p=wt_form.name?wt_form.name:wt_be.split(";")[0];if(wt_fm_attribute){var tmp="";
eval("tmp = (f.getAttribute(wt_fm_attribute)?f.getAttribute(wt_fm_attribute):'')");if(tmp){p=tmp;}}var fl="";
if(wt_typeof(f.elements["wt_fields"])){fl=f.elements["wt_fields"].value;}if(!fl){for(var i=0;i<f.elements.length;
i++){var e=f.elements[i];if(e.name){fl+=e.name+del;}}fl=fl.substring(0,fl.lastIndexOf(del));}var fields=fl.split(del);
var fields_length=fields.length;var full_fields=wt_fm_full_content.split(del);var pa="";var emptyradios=new Array();
for(var i=0;i<f.elements.length;i++){var e=f.elements[i],value,value2,use=false;if(fl){for(var j=0;j<fields_length;
j++){if(e.name==fields[j]){use=true;}}}else{if(e.name){use=true;}}if(use){value=null;if(e.type=="select-multiple"){for(var j=0;
j<e.options.length;j++){var found=false;if(e.options[j].selected){found=true;pa+=";"+p+".select-multiple."+e.name.replace(/[\.|;]/,"_")+"."+e.options[j].value.replace(/[\.|;]/,"_");
}if(!found){value="empty";}}}if(e.type=="select-one"){if(e.selectedIndex!=-1){value=e.options[e.selectedIndex].value.replace(/[\.|;]/,"_");
if(!value){value="empty";}}}if(e.type=="checkbox"){if(!e.checked){value="empty";}else{value=e.value.replace(/[\.|;]/,"_");
}}if(e.type=="radio"){if(e.checked){value=e.value.replace(/[\.|;]/,"_");}emptyradios[emptyradios.length]=e.name;
}if(e.type=="password"||e.type=="text"||e.type=="textarea"){value=(e.value?"filled_out":"empty");for(var k=0;
k<full_fields.length;k++){if(full_fields[k]==e.name){value=wt_maxlen(e.value,30);}}if(!value){value="empty";
}}if(value){name=e.name.replace(/[\.|;]/,"_");value2=";"+p+"."+name+"."+e.type+"|";if(pa.indexOf(value2)==-1){pa+=value2+(wt_fm_anonymous!=""?"anon":value);
}}}}for(var i=0;i<emptyradios.length;i++){var n=";"+p+"."+emptyradios[i].replace(/[\.|;]/,"_")+".radio|";
if(pa.indexOf(n)==-1){pa+=n+(wt_fm_anonymous!=""?"anon":"empty");}}if(pa){pa=pa.substring(1);}return pa;
}if(wt_fm||wt_ln){wt_registerEvent(window,(wt_browserNameIE&&wt_typeof(window.onbeforeunload))?"beforeunload":"unload",wt_unload);
}function wt_unload(){if(wt_form){wt_gatherforms_p=wt_gatherForm();}var A="";if(wt_linktrack_p){A+="&ct="+wt_escape(wt_maxlen(wt_linktrack_p,255));
}if(wt_gatherforms_p){A+="&ft="+wt_escape(wt_gatherforms_p);A+="&fs="+(wt_form_submit?"1":"0")+"&ff="+wt_escape(wt_form_focus);
}if(A){if(typeof (wt_ep)=="string"&&wt_ep!=""){wt_ep=wt_ep.split(/;/);for(var B=0;B<wt_ep.length;B++){if(typeof (wt_ep[B])!="undefined"){wtep=wt_ep[B].split(/=/);
if(wt_checkSC("custom")){wtep[1]=wt_decrypt(wtep[1]);}wtep[1]=wt_escape(wtep[1]);A+="&"+wtep[0]+"="+wtep[1];
}}}if(typeof (wt_ccParams)=="string"&&wt_ccParams!=""){A+=wt_ccParams;}wt_quicksend(wt_escape(wt_be.split(";")[0])+",1,"+wt_baseparams(),A+wt_encoding());
wt_linktrack_p="";wt_gatherforms_p="";}}if(typeof (time_start)=="number"&&typeof (wt_be)=="string"&&!document.layers){var time_stop=(new Date()).getTime();
wt_registerEvent(window,"load",wt_ttonload);}function wt_ttonload(){if(typeof (time_start)=="number"){wt_t1=time_stop-time_start;
var A=new Date().getTime();wt_t2=A-time_start;wt_send();time_start="";wt_t1="";wt_t2="";}}if(wt_mc){var m=wt_mc.split(";");
var v="";if(wt_mcv!=""){v=wt_mcv.split(";");}wt_mcvalue="";for(var i=0;i<m.length;i++){if(wt_mcvalue!=""){wt_mcvalue+="|";
}if(typeof (v[i])!="undefined"&&v[i]!=""){wt_mcvalue+=v[i];}else{wt_mcvalue+=wt_urlParam(wt_href(),m[i]," ");
}}}var wt_tmp=wt_urlParam(wt_href(),"wt_lp","");if(wt_tmp!=""){wt_lp=wt_tmp;}wt_tmp=wt_urlParam(wt_href(),"wt_kw","");
if(wt_tmp!=""){wt_kw=wt_tmp;}if(wt_hm){var exit=false;if(typeof (wt_heatmap_sites)=="object"&&typeof (wt_heatmap_sites_ini)=="string"){wt_registerEvent(window,"load",wt_hminstall);
exit=true;}else{if(!document.layers&&document.getElementById){var stags=document.getElementsByTagName("script");
for(var i=0;i<stags.length;i++){if(stags[i].src.match(/webtrekk.*\.js/g)&&!exit){wt_include(wt_hm_config_file=stags[i].src.replace(/webtrekk[a-z|A-Z|0-9|_]*\.js/g,"")+"heatmap_config.js?"+Math.random());
wt_registerEvent(window,"load",wt_hminstall);exit=true;}}}}}function wt_hminstall(){if(typeof (wt_heatmap_sites)=="object"&&typeof (wt_heatmap_sites_ini)=="string"){for(var A=0;
A<wt_heatmap_sites.length;A++){if(wt_heatmap_sites[A].toLowerCase()==wt_be.split(";")[0].toLowerCase()&&wt_heatmap_sites_ini.toLowerCase()==wt_crypt(wt_heatmap_sites.join("")).replace(/\./g,"").toLowerCase()&&wt_heatmap_on==false){wt_registerEvent(document,"mousedown",wt_recordClick);
}}}else{if(typeof (wt_heatmap_retry)=="undefined"){wt_heatmap_retry=0;}wt_heatmap_retry++;if(wt_heatmap_retry<60){window.setTimeout("wt_hminstall()",100);
}}}function wt_recordClick(E){if(typeof (wt_refpoint_id)!="string"){wt_refpoint_id="wt_refpoint";}else{if(wt_refpoint_id==""){wt_refpoint_id="wt_refpoint";
}}var A=(navigator.userAgent.indexOf("Opera")!=-1);var C=(!A&&navigator.userAgent.indexOf("MSIE")!=-1);
var H={left:-1,top:-1};if(document.getElementById(wt_refpoint_id)){var D=document.getElementById(wt_refpoint_id);
if(typeof D.offsetLeft!="undefined"){while(D){H.left+=D.offsetLeft;H.top+=D.offsetTop;D=D.offsetParent;
}}}var G=0;var F=0;if(!E){var E=window.event;}if(E.pageX||E.pageY){G=E.pageX;F=E.pageY;}else{if(E.clientX||E.clientY){G=E.clientX;
F=E.clientY;if(C){if(document.body.scrollLeft>0||document.body.scrollTop>0){G+=document.body.scrollLeft;
F+=document.body.scrollTop;}else{if(document.documentElement.scrollLeft>0||document.documentElement.scrollTop>0){G+=document.documentElement.scrollLeft;
F+=document.documentElement.scrollTop;}}}}}var B=0;if(C){B=document.body.clientWidth;}else{B=self.innerWidth-16;
}var I=true;if(G>=B){I=false;}if((H.top>=0||H.left>=0)&&G>H.left&&F>H.top){G="-"+(G-H.left);F="-"+(F-H.top);
}if(I){wt_quicksend(wt_escape(wt_be.split(";")[0])+","+G+","+F,"","hm.pl");}}var wt_heatmap_on=(wt_href().indexOf("wt_heatmap=1")>=0);
function wt_heatmap0(){if(typeof (wt_heatmap)!="undefined"){window.setTimeout("wt_heatmap()",1000);}else{if(typeof (wt_heatmap_retry)=="undefined"){wt_heatmap_retry=0;
}wt_heatmap_retry++;if(wt_heatmap_retry<60){window.setTimeout("wt_heatmap0()",1000);}}}if(wt_href().indexOf("wt_heatmap=0")>=0){wt_heatmap_on=false;
}if(wt_heatmap_on){if(wt_reporturl==""){wt_reporturl="report.webtrekk.de/cgi-bin/wt";}if(wt_include(location.protocol+"//"+wt_reporturl+"/heatmap.pl?wt_be="+wt_escape(wt_be.split(";")[0])+"&x="+new Date().getTime()+wt_encoding())){if(navigator.userAgent.indexOf("MSIE 6")!=-1&&navigator.userAgent.indexOf("Windows NT 5.0")!=-1){alert("Click OK to start heatmap.");
}}wt_registerEvent(window,"load",wt_heatmap0);}function wt_overlay0(){if(typeof (wt_overlay)!="undefined"){wt_overlay();
}else{if(typeof (wt_overlay_retry)=="undefined"){wt_overlay_retry=0;}wt_overlay_retry++;if(wt_overlay_retry<60){window.setTimeout("wt_overlay0()",1000);
}}}var wt_overlay_on=(wt_href().indexOf("wt_overlay=1")>=0||document.cookie.indexOf("wt_overlay=1")>=0);
if(wt_href().indexOf("wt_overlay=0")>=0){wt_overlay_on=false;document.cookie="wt_overlay=0; expires=Thu, 01-Jan-70 00:00:01 GMT;";
}if(wt_overlay_on){document.cookie="wt_overlay=1";if(wt_reporturl==""){wt_reporturl="report.webtrekk.de/cgi-bin/wt";
}if(wt_include(location.protocol+"//"+wt_reporturl+"/overlay.pl?wt_be="+wt_escape(wt_be.split(";")[0])+"&x="+new Date().getTime()+wt_encoding())){wt_registerEvent(window,"load",wt_overlay0);
}}if(wt_cookie=="1"){var wt_cookie_one=false;var wt_cookie_sid=wt_getCookie("wt_sid");var wt_cookie_l_v=wt_getCookie("wt_l_v");
var wt_cookie_eid=wt_getCookie("wt_eid");if(!wt_cookie_eid_timeout){wt_cookie_eid_timeout=60;}if(!wt_cookie_sid_timeout){wt_cookie_sid_timeout=30;
}var tmp=parseInt(wt_cookie_sid);var tmp2=Math.floor(new Date().getTime()/1000);if(tmp>0&&(tmp+wt_cookie_sid_timeout*60)<tmp2){wt_cookie_sid="";
}if(!wt_cookie_sid){wt_cookie_sid=wt_sid();wt_cookie_one=true;}if(!wt_cookie_eid){wt_cookie_eid=wt_cookie_sid;
wt_setCookie("wt_eid",wt_cookie_eid,wt_cookie_eid_timeout*30*24*60);}wt_cookie_l_v=new Date().getTime();
wt_setCookie("wt_l_v",wt_cookie_l_v);wt_setCookie("wt_sid",wt_cookie_sid);}function wt_sendinfo(B,C,A){if((typeof (time_start)!="number"&&(wt_be!=""||B!=""))||document.layers){wt_send(B,C,A);
}}function wt_quicksend(B,E,C){if(!wt_dm||!wt_ci){return ;}if(!C){C="wt.pl";}if(wt_cookie=="1"){E="&sid="+wt_cookie_sid+"&l_v="+wt_cookie_l_v+"&eid="+wt_cookie_eid+"&one="+(wt_cookie_one?"1":"0")+E;
}if(wt_cookie!="1"&&(typeof (wt_cookie_eid_timeout)!="undefined"||typeof (wt_cookie_sid_timeout)!="undefined")){if(typeof (wt_cookie_eid_timeout)!="undefined"&&wt_cookie_eid_timeout!=""){E="&cet="+wt_cookie_eid_timeout+E;
}if(typeof (wt_cookie_sid_timeout)!="undefined"&&wt_cookie_sid_timeout!=""){E="&cst="+wt_cookie_sid_timeout+E;
}}var A=(location.protocol=="https:"?"https:":"http:")+"//"+wt_dm+"/"+wt_ci+"/"+C+"?p="+wt_version+","+B+E;
if(document.images){if(typeof (wt_i)=="undefined"){wt_i=new Array();}var D=wt_i.length;wt_i[D]=new Image();
wt_i[D].src=A;}else{document.write("<img src='"+A+"' height='1' width='1'>");}}function wt_baseparams(){var wt_c=screen.width+"x"+screen.height+","+(navigator.appName!="Netscape"?screen.colorDepth:screen.pixelDepth)+",";
wt_c+=((navigator.cookieEnabled==true)?"1,":((navigator.cookieEnabled==false)?"0,":((document.cookie.indexOf("=")!=-1)?"1,":"0,")));
wt_c+=new Date().getTime()+",";var wt_ref=0;if(!wt_ref&&document.referrer.length>0){wt_ref=wt_decoder(document.referrer);
}wt_c+=wt_ref;var h=0;if(!document.layers&&document.getElementById){eval("try {h = top.window.innerHeight;}catch(e){};");
}else{h=top.window.innerHeight;}if(!h){eval("try {h = top.document.body.clientHeight;}catch(e){};");}if(!h){eval("try {h = top.document.documentElement.clientHeight;}catch(e){};");
}var w=0;if(!document.layers&&document.getElementById){eval("try {w = top.window.innerWidth;}catch(e){};");
}else{w=top.window.innerWidth;}if(!w){eval("try {w = top.document.body.clientWidth;}catch(e){};");}if(w=="undefined"){w=-1;
}if(h=="undefined"){h=-1;}wt_c+=","+w+"x"+h;wt_c+=","+(navigator.javaEnabled()?"1":"0");return wt_c;}function wt_send(A,I,N){if(I=="link"){wt_linktrack_p=A;
wt_ln="manual";wt_ep=N;wt_registerEvent(window,(wt_browserNameIE&&wt_typeof(window.onbeforeunload))?"beforeunload":"unload",wt_unload);
return ;}if(I=="click"){wt_linktrack_p=A;wt_ep=N;wt_unload();return ;}var L=(A?A:wt_be);if(!L){L="no_content";
}var E=wt_escape(L)+",1,";E+=wt_baseparams();var B=wt_encoding();var D="";if(typeof (navigator.language)=="string"){D=navigator.language;
}else{if(typeof (navigator.userLanguage)=="string"){D=navigator.userLanguage;}}var C=navigator.plugins.length,M="";
if(C>0){var F=Array();var M="";for(var H=0;H<C;H++){if(navigator.plugins&&navigator.appName!="Microsoft Internet Explorer"){if(navigator.plugins[H].name=="Shockwave Flash"){M=navigator.plugins[H].description;
}else{M=navigator.plugins[H].name;}for(var G=0;G<F.length;G++){if(M==F[G]){M="";}}if(M!=""){F.push(M);
}}}M=F.join("|");}var K="";if(typeof (wt_c)=="object"){for(var J=0;J<wt_c.length;J++){if(typeof (wt_c[J])!="undefined"){if(wt_checkSC("custom")){wt_c[J]=wt_decrypt(wt_c[J]);
}K+="&c"+J+"="+wt_escape(wt_c[J]);}}}if(wt_ov){B+="&ov="+wt_escape(wt_ov);}if(wt_cr){B+="&cr="+wt_escape(wt_cr);
}if(wt_oi){B+="&oi="+wt_escape(wt_oi);}if(wt_ba){B+="&ba="+wt_escape(wt_ba);}if(wt_co){B+="&co="+wt_escape(wt_co);
}if(wt_qn){B+="&qn="+wt_escape(wt_qn);}if(wt_ca){B+="&ca="+wt_escape(wt_ca);}if(wt_pi){B+="&pi="+wt_escape(wt_pi);
}if(wt_st){B+="&st="+wt_escape(wt_st);}if(wt_cd){B+="&cd="+wt_escape(wt_cd);}if(wt_t1){B+="&t1="+wt_escape(wt_t1);
}if(wt_t2){B+="&t2="+wt_escape(wt_t2);}if(D){B+="&la="+wt_escape(D);}if(wt_cg){B+="&cg="+wt_escape(wt_cg);
}if(wt_mcvalue){B+="&mcv="+wt_escape(wt_mcvalue);}if(wt_length(wt_mcvalue)){B+="&mc="+wt_mc;B+="&mcd="+wt_location().hostname;
}if(wt_pa){B+="&pa="+wt_escape(wt_maxlen(wt_pa,255));}if(wt_lp){B+="&lp="+wt_escape(wt_maxlen(wt_lp,255));
}if(wt_kw){B+="&kw="+wt_escape(wt_maxlen(wt_kw,255));}if(wt_is){B+="&is="+wt_escape(wt_maxlen(wt_is,255));
}if(K){B+=K;}if(wt_cookie=="1"){if(wt_cookie_one){B+="&np="+wt_escape(M);}}else{B+="&np="+wt_escape(M);
}wt_quicksend(E,B);}nQ(document).ready(function(){if(typeof (wt_sendinfo)!="undefined"){wt_sendinfo();
}});nQ.noConflict();var Nvt={};Nvt.Core={};Nvt.Control={};Nvt.Widget={};Nvt.Data={};Nvt.Formatter={};
Nvt.MapTp={};Nvt.Test={};var tcdebug=true;function trafficDebug(A){if(tcdebug&&navigator.userAgent.indexOf("Firefox")!=-1){console.info(A);
}}function clearInputField(B){var A="#"+B;if(!$(B).orig){$(B).orig=nQ("#"+B).attr("value");}if(nQ(A).attr("value")==$(B).orig){nQ(A).css("color","#000000");
nQ(A).attr("value","");}else{if(!nQ(A).attr("value")){}}}function branded(){brandingHeight=nQ("#nvt_partnerHeader").height();
var F=0;var B="top left";var G="";var E="block";var C=Nvt.Util.readCookie("AWOPARTNER");var D=Nvt.Util.readCookie("AWOSESSION");
var A=Nvt.Util.getQueryParamValue("AWOPARTNER");if((C&&C!="DEFAULT")||(D&&D!="DEFAULT")||(A&&A!="DEFAULT")){nQ("#nvt_logo").css("display","none");
F=(DEFAULT_HEADER_HEIGHT-BRANDED_TRAFFIC_HEADER-brandingHeight)*-1;B="0px "+F+"px";G={marginBottom:BRANDING_OFFSET,height:brandingHeight};
E="none";}nQ("#nvt_container").css("backgroundPosition",B);nQ("#nvt_partnerHeader").css(G);nQ("#nvt_leaderboardAd").css("display",E);
if(typeof (resetWidth)!="undefined"){resetWidth();}}var MINIMUM_PAGE_WIDTH=970;var NOTIFICATION_BAR_HEIGHT=0;
var DEFAULT_HEADER_HEIGHT=170;var DASHBOARD_HEIGHT=27;var MINIMUM_MAP_HEIGHT=375;var MAP_FOOTER_HEIGHT=30;
var MAP_FOOTER_PADDING=10;var INFO_WIDTH=430;var FOOTER_HEIGHT=70;var BRANDING_WIDTH=false;var BRANDED_TRAFFIC_HEADER=75;
var BRANDING_OFFSET=(DEFAULT_HEADER_HEIGHT-BRANDED_TRAFFIC_HEADER)*-1;var winHeight=getHeight();var brandingHeight=getBrandHeight();
function resetPage(){scrolled();resetWidth();resizeApplet();}function getHeight(){winHeight=document.viewport.getHeight();
}function getBrandHeight(){brandingHeight=nQ("#nvt_partnerHeader").height();}function resetWidth(){nQ("body").width(A);
if(!BRANDING_WIDTH){var A=document.viewport.getWidth();pageWidth=(A>=MINIMUM_PAGE_WIDTH)?A:MINIMUM_PAGE_WIDTH;
}else{pageWidth=MINIMUM_PAGE_WIDTH;}nQ("#nvt_container").width(pageWidth);nQ("#nvt_dashboard").width(pageWidth-INFO_WIDTH);
nQ("#nvt_map").width(pageWidth-INFO_WIDTH);nQ("#nvt_mapFooter").width(pageWidth-INFO_WIDTH-MAP_FOOTER_PADDING);
nQ("#nvt_notifyBar").width(nQ("#nvt_container").width()-parseInt(nQ("#nvt_notifyBar").css("padding-left"))-parseInt(nQ("#nvt_notifyBar").css("padding-right")));
}if(nQ("body").attr("id")!="nvt_home"&&nQ("body").attr("id")!="nvt_std_ws"){nQ(document).ready(function(){window.setInterval("scrolled()",500);
});}function scrolled(){winHeight=document.viewport.getHeight();brandingHeight=nQ("#nvt_partnerHeader").height();
DASHBOARD_HEIGHT=nQ("#nvt_dashboard").height();var D=document.viewport.getScrollOffsets()[1];var E=winHeight-NOTIFICATION_BAR_HEIGHT-DEFAULT_HEADER_HEIGHT-DASHBOARD_HEIGHT+D;
var C=winHeight-NOTIFICATION_BAR_HEIGHT-DEFAULT_HEADER_HEIGHT+D;var H=0;var A=Nvt.Util.readCookie("AWOPARTNER");
var F=Nvt.Util.readCookie("AWOSESSION");var I=Nvt.Util.getQueryParamValue("AWOPARTNER");if((A&&A!="DEFAULT")||(F&&F!="DEFAULT")||(I&&I!="DEFAULT")){E=winHeight-NOTIFICATION_BAR_HEIGHT-BRANDED_TRAFFIC_HEADER-brandingHeight-DASHBOARD_HEIGHT+D;
C=winHeight-NOTIFICATION_BAR_HEIGHT-(BRANDED_TRAFFIC_HEADER+brandingHeight)+D;if(D>BRANDED_TRAFFIC_HEADER+brandingHeight){E=winHeight-DASHBOARD_HEIGHT;
H=D-BRANDED_TRAFFIC_HEADER-brandingHeight-NOTIFICATION_BAR_HEIGHT;}}else{if(D>NOTIFICATION_BAR_HEIGHT+DEFAULT_HEADER_HEIGHT){E=winHeight-DASHBOARD_HEIGHT;
H=D-DEFAULT_HEADER_HEIGHT-NOTIFICATION_BAR_HEIGHT;nQ("#nvt_mapWrap").height(winHeight);}}if(E<MINIMUM_MAP_HEIGHT){E=MINIMUM_MAP_HEIGHT;
}var B=nQ("#nvt_map").height();nQ("#nvt_map").height(E-MAP_FOOTER_HEIGHT);var G=nQ("#nvt_map").height();
nQ("#nvt_mapWrap").height(C-H);nQ("#nvt_mapWrap").animate({paddingTop:H},"fast");if(B!=G){resizeApplet();
}}function resizeApplet(){if(typeof trafficMap!="undefined"){var A=nQ("#nvt_map").height();var B=nQ("#nvt_map").width();
trafficMap.resize(A,B);}}function destroyLeaks(){document.widgetManager=null;document.nvtModalManager=null;
document.refreshAllWidgets=null;nQ("#nvt_map").empty();nQ("#nvt_map").remove();}function resizeRoutingForm(){var A=document.viewport.getWidth();
var A=document.viewport.getWidth();if(A>=1250){nQ("#nvt_routing").removeClass("nvt_small").addClass("nvt_big");
nQ("#nvt_nav").removeClass("nvt_small").addClass("nvt_big");nQ("#nvt_pointAShim").removeClass("nvt_small").addClass("nvt_big");
nQ("#nvt_pointBShim").removeClass("nvt_small").addClass("nvt_big");}else{nQ("#nvt_routing").removeClass("nvt_big").addClass("nvt_small");
nQ("#nvt_nav").removeClass("nvt_big").addClass("nvt_small");nQ("#nvt_pointAShim").removeClass("nvt_big").addClass("nvt_small");
nQ("#nvt_pointBShim").removeClass("nvt_big").addClass("nvt_small");}}function turnOffRouteHistory(){nQ("#RouteHistory").hide();
nQ("#nvt_pointAShim").hide();}nQ(window).resize(function(){if(nQ("body").attr("id")!="nvt_home"&&nQ("body").attr("id")!="nvt_std_ws"){resetPage();
resizeRoutingForm();turnOffRouteHistory();}});Nvt.Util=new Object();Nvt.Util.getQueryParamValue=function(C){var B=document.location.search;
var D=B.indexOf(C);var A=(B.indexOf("&",D)!=-1)?B.indexOf("&",D):B.length;if(B.length>1&&D!=-1){return B.substring(B.indexOf("=",D)+1,A);
}else{return"";}};Nvt.Util.createCookie=function(C,E,F,D){if(!D){D="traffic.com";}if(F){var B=new Date();
B.setTime(B.getTime()+(F*24*60*60*1000));var A="; expires="+B.toGMTString();}else{var A="";}document.cookie=C+"="+E+A+"; domain="+D+"; path=/";
};Nvt.Util.readCookie=function(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;
C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length);}if(E.indexOf(D)==0){return E.substring(D.length,E.length);
}}return null;};Nvt.Util.getAWOPartner=function(){if(Nvt.Util.readCookie("AWOSESSION")!=null){return Nvt.Util.readCookie("AWOSESSION");
}else{if(Nvt.Util.readCookie("AWOPARTNER")!=null){return Nvt.Util.readCookie("AWOPARTNER");}else{return"DEFAULT";
}}};Nvt.Util.getHomeMetro=function(){metroID=Nvt.Util.readCookie("homeMetro");return"NONE";};Nvt.Util.viewedKeyroute=function(D){var A=Nvt.Util.readCookie("recentlyViewed");
if(A){A=A.split(",");}else{A=new Array();}if(A.length==10){A[0]=null;}if(D.parentId){for(var B=0;B<A.length;
B++){if(A[B]==D.parentId){A[B]=null;}}}for(var B=0;B<A.length;B++){if(A[B]==D.id){A[B]=null;}}A.push(D.id);
A=A.compact();var C=A.join(",");Nvt.Util.createCookie("recentlyViewed",C,365);};Nvt.Util.getRecentlyViewed=function(){var A=Nvt.Util.readCookie("recentlyViewed");
if(A){A=A.split(",");}else{A=new Array();}A.reverse();var B=A.join(",");return B;};Nvt.Util.scrubBound=function(A){A=A.toLowerCase();
var B=A.substr(0,4);if(B=="nort"||B=="sout"||B=="east"||B=="west"){A=A.substr(0,A.indexOf("bound"));}A=A.substr(0,1).toUpperCase()+A.substr(1);
return A;};Nvt.Util.resolveTrend=function(A){var B="Holding";switch(parseFloat(A)){case -3:case -2:B="Clearing";
break;case -1:case 0:case 1:B="Holding";break;case 2:case 3:B="Building";break;}return B;};Nvt.Util.getJFImageString=function(C,B){var E=".png";
if(B){E=".gif";}var A=Nvt.Util.resolveTrend(C.trend);if(C.jamFactor==0&&A!="Holding"){A="Holding";}var D=new String(C.jamFactor)+A+E;
if(C.jamFactor!="10"){D="0"+D;}return D;};Nvt.Util.getJFClass=function(A){var B=new String(A.jamFactor)+Nvt.Util.resolveTrend(A.trend);
return B;};Nvt.Util.cap1stLetters=function(C){if(C){var D=C.split(" ");var A="";for(var B=0;B<D.length;
B++){A+=D[B].substr(0,1).toUpperCase()+D[B].substr(1).toLowerCase()+" ";}return A;}else{return C;}};Nvt.Util.getMonth=function(A){var B={};
switch(A){case 0:B.name=i18n.january;B.abbr=i18n.jan;break;case 1:B.name=i18n.february;B.abbr=i18n.feb;
break;case 2:B.name=i18n.march;B.abbr=i18n.mar;break;case 3:B.name=i18n.april;B.abbr=i18n.apr;break;case 4:B.name=i18n.may;
B.abbr=i18n.may;break;case 5:B.name=i18n.june;B.abbr=i18n.jun;break;case 6:B.name=i18n.july;B.abbr=i18n.jul;
break;case 7:B.name=i18n.august;B.abbr=i18n.aug;break;case 8:B.name=i18n.september;B.abbr=i18n.sep;break;
case 9:B.name=i18n.october;B.abbr=i18n.oct;break;case 10:B.name=i18n.november;B.abbr=i18n.nov;break;case 11:B.name=i18n.december;
B.abbr=i18n.dec;break;}return B;};Nvt.Util.get12Hour=function(A){if(A>12){A=A-12;}return A;};Nvt.Util.getAMPM=function(A){var B=i18n.afterMeridian;
if(A>=12){B=i18n.postMeridain;}return B;};Nvt.Util.getMinutes=function(A){if(A<10){A="0"+A;}return A;
};Nvt.Util.getDisplayTime=function(D){var C=D+" "+i18n.mins;if(D>60){var A=Math.floor(D/60);var B=D%60;
C=A+" "+i18n.hr+" "+B+" "+i18n.mins;}return C;};Nvt.Util.isLoggedIn=function(){if(Nvt.Util.readCookie("ticket")!=null&&Nvt.Util.readCookie("username")!=null){return true;
}if(Nvt.Util.readCookie("regticket")!=null&&Nvt.Util.readCookie("regusername")!=null){return true;}return false;
};Nvt.Util.getUserName=function(){var A="";if(Nvt.Util.readCookie("username")!=""&&Nvt.Util.readCookie("username")!=null){A=Nvt.Util.readCookie("username");
}if(Nvt.Util.readCookie("regusername")!=""&&Nvt.Util.readCookie("regusername")!=null){A=Nvt.Util.readCookie("regusername");
}if(A==""||A==null){A=i18n.newUserText;}return A;};Nvt.Util.getUserToken=function(){if(Nvt.Util.readCookie("ticket")!=""){return Nvt.Util.readCookie("ticket");
}if(Nvt.Util.readCookie("regticket")!=""){return Nvt.Util.readCookie("regticket");}return"";};Nvt.Util.staleThreshold=1000*60*5;
Nvt.Util.isValid=function(A){if(!A){return false;}if(!A.timeStamp){A.timeStamp=new Date().getTime();return true;
}return((new Date().getTime())-A.timeStamp)<=Nvt.Util.staleThreshold;};Nvt.Util.parseTimeToHoursAndMinutes=function(B){var C="";
if(!isNaN(B)){if(B>60){var A=Math.floor(B/60);B=B%60;C=A+" "+i18n.hr+" ";if(B!=0){C+=(B>1)?B+" "+i18n.mins:B+" "+i18n.min;
}}else{if(B>0&&B<60){C=(B>1)?B+" "+i18n.mins:B+" "+i18n.min;}else{C=i18n.nAAbbr;}}}else{if(isNaN(B)&&B!=""){C=B;
}else{C=i18n.nAAbbr;}}return C;};Nvt.Util.parseAverageSpeed=function(A){var B="";if(!isNaN(A)&&A>0){B=A+" "+i18n.mph;
}else{if(isNaN(A)&&A!=""){B=A;}else{B=i18n.nAAbbr;}}return B;};Nvt.Util.zebraStripe=function(){nQ(".nvt_rowAlt").removeClass("nvt_rowAlt").removeClass("nvt_rowLast");
nQ("table.nvt_striped").each(function(B){nQ("#"+this.id+" > tbody > tr:not(.nvt_twistHidden):odd").addClass("nvt_rowAlt");
nQ("#"+this.id+" > tbody > tr.nvt_rowAlt:last:even").addClass("nvt_rowLast");});nQ("ul.nvt_striped").each(function(B){nQ("#"+this.id+" li:odd").addClass("nvt_rowAlt");
nQ("#"+this.id+" > li.nvt_rowAlt:last:even").addClass("nvt_rowLast");});var A=nQ("table > tbody > tr.nvt_twistHidden").get();
nQ.each(A,function(B,C){var D=C.id.substr(0,C.id.length-7);if(nQ("#"+D).hasClass("nvt_rowAlt")){nQ("#"+C.id).addClass("nvt_rowAlt");
}});};Nvt.Util.roadToMapState=function(B){try{var E=new Nvt.Data.Coordinate();E.setCoords(B.startLocation.lat,B.startLocation.lon);
var A=new Nvt.Data.Coordinate();A.setCoords(B.endLocation.lat,B.endLocation.lon);var C=new Nvt.Data.MapState();
C.boundingBox.NWCoordinate=E;C.boundingBox.SECoordinate=A;return C;}catch(D){console.error("Error Converting Road to MapState",D);
console.trace();}return null;};Nvt.Util.driveToMapState=function(E){try{var H=E.routes[0].roads[0].startLocation;
var D=E.routes[0].roads.length;var B=E.routes[0].roads[D-1].endLocation;var G=new Nvt.Data.Coordinate();
G.setCoords(H.lat,H.lon);var A=new Nvt.Data.Coordinate();A.setCoords(B.lat,B.lon);var C=new Nvt.Data.MapState();
C.boundingBox.NWCoordinate=G;C.boundingBox.SECoordinate=A;return C;}catch(F){console.error("Error Converting Road to MapState",F);
console.trace();}return null;};Nvt.Util.logMapState=function(C,B){if(C){var A=C.boundingBox.NWCoordinate;
var D=C.boundingBox.SECoordinate;}else{}};Nvt.Util.getTableAd=function(C,F){var D=nQ('<div class="nvt_rightColAdTable nvt_ad"></div>');
var A=nQ('<div name="atlasMiddle2" id="atlasMiddle2" class="atlasAd"></div>');D.prepend(A);var B=nQ('<span class="nvt_adLabel">'+i18n.jsAdvertisement+"</span>");
if(typeof (NvtAds)!="undefined"){NvtAds.appendAd(A[0],"Middle2");}D.prepend(B);if(F){var E=nQ("<span class='nvt_moreLink'>"+C+"</span>");
E.click(function(){window.scroll(0,nQ("html,body").animate({scrollTop:nQ("#atlasMiddle2").offset().top+250},1000));
});D.prepend(E);}return D;};Nvt.Util.addCritSort=function(A){for(var B=0;B<A.length;B++){A[B].critSort=A[B].criticality*-1;
}return A;};Nvt.Util.getPrivacyPolicy=function(){return nQ('<div id="nvt_privacy"><h3>'+i18n.yourPrivacyIsImportant+"</h3><ul><li>"+i18n.weDoNotSellYourInformation+"</li><li>"+i18n.weProtectYourInformation+"</li><li>"+i18n.shareYourInformationOutsideWhenNecessary+" "+'<a target="_blank" href="'+commonData.helpServerName+'/privacy-policy">'+i18n.privacyPolicy+"</a>.</li></ul></div>");
};Nvt.Util.showHelp=function(A,C,D,B){helpURL=commonData.helpServerName+"/"+A;new Nvt.Widget.Modal(false,{"dimensions":B,"href":helpURL+"?modal=true","id":D,"title":C});
};Nvt.Util.removeArea=function(A){if(A.indexOf("Area")!=-1){A=A.substr(0,A.length-5);}return A;};Nvt.Util.formatPhone=function(A){var A=new String(A);
if(A.length==10){A="("+A.substr(0,3)+") "+A.substr(3,3)+"-"+A.substr(6,4);}return A;};Nvt.Util.bookmark=function(A,B){if(nQ.browser.msie){window.external.AddFavorite(A,B);
}else{if(nQ.browser.mozilla){window.sidebar.addPanel(B,A,"");}else{if(nQ.browser.safari){alert("You need to press CTRL + D to bookmark our site.");
}}}};Nvt.Util.decimalPrecision=function(B,A){var C=Math.pow(10,A);B=Math.round(B*C);return(B/C).toFixed(A);
};Nvt.Util.getJslibVersion=function(){var B=document.getElementsByTagName("script");for(var C=0;C<B.length;
++C){if(B[C].src.indexOf("trafficDotCom-min.js")!=-1){var A=B[C].src.lastIndexOf("/");var D=B[C].src.substr(0,A);
A=D.lastIndexOf("/");return(D.substr(A+1));}}return"";};Nvt.Widget.WidgetBase=Class.create();Nvt.Widget.WidgetBase.prototype={initializeWidget:function(){this.backLinkText=i18n.goback;
this.inSlider=false;this.DOM=document.createElement("div");if(!document.widgetManager){document.widgetManager=new Nvt.Widget.WidgetManager();
}this.cssClassName=this.CLASS_NAME.substr(this.CLASS_NAME.lastIndexOf(".")+1);this.cssClassName="nvt_"+this.cssClassName.substr(0,1).toLowerCase()+this.cssClassName.substr(1);
nQ(this.DOM).addClass(this.cssClassName);this.id="nvt_widget"+document.widgetManager.getWidgetId();this.DOM.setAttribute("id",this.id);
if(this.refreshCallback){Nvt.Core.RefreshManager.getInstance().addWidgetCallback(this);}this.spinner=nQ('<div class="nvt_loader"><span class="nvt_bold_text">'+i18n.loadingDots+"</span></div>");
this.hasSpinner=true;nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){if(this.displayDivId&&nQ("#"+this.displayDivId).size()>0){nQ("#"+this.displayDivId).empty();
nQ("#"+this.displayDivId).remove();}this.backLinkText=null;this.DOM=null;this.cssClassName=null;this.id=null;
this.spinner=null;this.displayDivId=null;},display:function(A){this.displayDivId=A;if(nQ("#"+A).size()>0){nQ("#"+A)[0].appendChild(this.DOM);
}if(nQ("#nvt_slideWidget #"+this.id).size()>0){nQ("#"+this.id).addClass("nvt_insideSlideWidget "+this.cssClassName);
this.inSlider=true;if(A!=null&&A.substr(0,14)=="nvt_widgetWrap"){var C=A.substr(26);var B="nvt_widgetWrap"+C;
}}if(this.postDisplay){this.postDisplay();}else{this.finalExecution();}},readClick:function(B){if(B){this.displayDivId=B;
}if(nQ("#"+this.displayDivId).size()>0){var E=(this.parentWidgetName&&this.parentWidgetName.startsWith("Nvt.Widget."))?this.parentWidgetName:this.CLASS_NAME;
E=E.substring(E.lastIndexOf(".")+1);E=E.substring(0,E.indexOf("Widget"));var A="/virtual/click/"+E+"/";
var D=nQ("#"+this.displayDivId).find("a");for(var C=0;C<D.length;C++){nQ(D[C]).click(function(){var H=A;
var G="";if(this.id){G=this.id;}else{if(nQ(this).html().length>0){G=nQ(this).html();}}H+=G.stripTags();
Nvt.Core.NvtAnalytics.virtual(H);});}var F=nQ("#"+this.displayDivId+" .nvt_analytics");for(var C=0;C<F.length;
C++){nQ(F[C]).click(function(){Nvt.Core.NvtAnalytics.virtual(A+nQ(this).html().stripTags());});}}},finalExecution:function(A){this.readClick(A);
},getData:function(B){if(this.divId){this.display(this.divId);}if(this.data){this.cleanUp();this.postInit();
}else{if(this.getRestUrl){var A=this.getRestUrl();if(!document.widgetManager.isCachedUrl(A)||B){this.loadData(A,this.checkDataIntegrity.bind(this));
}else{this.checkDataIntegrity();}}else{Nvt.console.error("There is no getRestUrl method defined");}}},setPageTitle:function(A){document.title=A;
},checkDataIntegrity:function(){if(!eval(this.id+".thrown")){this.data=eval(this.id+".presentationObjects");
if(!this.data){this.data=eval(this.id);}}else{this.DOM.innerHTML='<h1 class="nvt_error">'+i18n.restAPIFailureMessage+"</h1>";
this.display(this.divId);return ;}this.cleanUp();this.postInit();},cleanUp:function(){this.hasSpinner=false;
this.spinner.remove();},redisplay:function(){nQ("#"+this.displayDivId).empty();nQ(this.DOM).empty();this.display(this.displayDivId);
},destroy:function(){if(this.refreshCallback){Nvt.Core.RefreshManager.getInstance().removeWidgetCallback(this);
}},addContents:function(A){this.DOM.appendChild(A);},loadData:function(A,B){if(this.hasSpinner){nQ(this.DOM).append(this.spinner);
}if(document.widgetManager.authKey){A=A+"&auth="+document.widgetManager.authKey;}nQ.getScript(A,B);}};
Nvt.Core.Atlas=Class.create();Nvt.Core.Atlas.prototype={initialize:function(D,H,C,G,A){this.refreshAdsCounter=0;
this.lastRefreshTime=new Date().getTime();if(A!=null&&A.length>0){this.refreshInterval=A;}else{this.refreshInterval=30000;
}this.a_server="http://adbureau.traffic.com/bserver";this.a_area=G;this.a_env=D;this.a_homemetro=Nvt.Util.getHomeMetro();
this.a_partner=Nvt.Util.getAWOPartner();this.a_site=C;this.a_allAds="AAMALL";if(this.a_homemetro){this.a_allAds+="/homemetro="+this.a_homemetro;
}if(D){this.a_allAds+="/env="+D;}if(C){this.a_allAds+="/site="+C;}if(this.a_partner){this.a_allAds+="/partner="+this.cleanTextForTag(this.a_partner);
}this.a_allAds+="/expandable=true";this.a_url=this.a_server+"/"+this.a_allAds;this.a_pos=H;this.a_posL=H.length;
this.a_AAMBs=new Array();for(var F=0;F<this.a_posL;F++){var E=H[F];var B="AAMB"+(F+1);this.a_AAMBs[E]=B;
}},appendAdPositions:function(A){var C="";var B=null;if(A!=null&&A.length!=0){B=A.split(",");}for(var D=0;
D<this.a_posL;D++){if(A==null||this.isAdPosIncluded(this.a_pos[D],B)){C+="/AAMB"+(D+1)+"/position="+this.a_pos[D]+"/aamsz="+this.getAtlasSize(this.a_pos[D]);
}}return C;},isAdPosIncluded:function(D,C){var B=false;for(var A=0;A<C.length;A++){if(D==C[A].replace(/^\s+|\s+$/g,"")){B=true;
break;}}return B;},cleanTextForTag:function(C){var B=/[^A-Za-z0-9_.]/g;var A=C.replace(B,"_");return A;
},parseOAS_sitepage:function(D){var A=D.split("/");var B=A[1];for(var C=2;C<A.length;C++){B+="."+A[C];
}return B;},isElementVisible:function(B){if(B!=null&&(B.style.display=="none"||B.style.visibility=="hidden")){return false;
}var A=null;if(navigator.userAgent.indexOf("MSIE")>-1){A=B.parentElement;}else{if(/Mozilla/i.test(navigator.userAgent)==true){A=B.parentNode;
}else{return true;}}if(A==null||A.tagName=="BODY"){return true;}return this.isElementVisible(A);},renderAd:function(divId,aambTag){var invObj="INV"+divId;
try{var code=eval(aambTag);}catch(aamErr){}var i=0;if(document.getElementsByName(divId).length>1){var adVisible=false;
for(;i<document.getElementsByName(divId).length;i++){if(this.isElementVisible(document.getElementsByName(divId)[i])){adVisible=true;
break;}}if(adVisible==false){return ;}nQ("#"+divId).empty();document.getElementsByName(divId)[i].innerHTML="";
if(typeof (code)!="undefined"){if(navigator.userAgent.indexOf("MSIE")>-1){document.getElementsByName(divId)[i].innerHTML+='<div id="TMP'+divId+i+'" style="display:none">'+escape('<body><div id="adDiv'+i+'">'+code+"</div>")+'</div><iframe name="'+invObj+i+'" width="0" height="0" frameborder="0" '+"onload=\"javascript:try { document.getElementsByName('"+divId+"')["+i+"]."+"insertAdjacentElement('beforeEnd', window.frames['"+invObj+i+"']."+"document.getElementById('adDiv"+i+"')) } catch(aamErr) { }\"></iframe>";
window.frames[invObj+i].document.location="javascript:unescape(parent.document.getElementById('TMP"+divId+i+"').innerHTML)";
}else{if(/Mozilla/i.test(navigator.userAgent)==true){document.getElementsByName(divId)[i].innerHTML+='<div id="TMP'+divId+i+'" style="display:none">'+escape('<body><div id="adDiv'+i+'">'+code+"</div>")+'</div><iframe id="'+invObj+i+'" width="0" height="0" frameborder="0" '+"onload=\"javascript:try { document.getElementsByName('"+divId+"')["+i+"].innerHTML +="+"document.getElementById('"+invObj+i+"')."+"contentDocument.getElementById('adDiv"+i+"').innerHTML } catch(aamErr) { }\"></iframe>";
document.getElementById(invObj+i).contentDocument.location="javascript:unescape(parent.document.getElementById('TMP"+divId+i+"').innerHTML)";
}else{return ;}}}}else{nQ("#"+divId).empty();document.getElementById(divId).innerHTML="";if(typeof (code)!="undefined"){if(navigator.userAgent.indexOf("MSIE")>-1){document.getElementById(divId).innerHTML+='<div id="TMP'+divId+'" style="display:none">'+escape('<body><div id="adDiv">'+code+"</div>")+'</div><iframe name="'+invObj+'" width="0" height="0" frameborder="0" '+"onload=\"javascript:try { document.getElementById('"+divId+"')."+"insertAdjacentElement('beforeEnd', window.frames['"+invObj+"']."+"document.getElementById('adDiv')) } catch(aamErr) { }\"></iframe>";
window.frames[invObj].document.location="javascript:unescape(parent.document.getElementById('TMP"+divId+"').innerHTML)";
}else{if(/Mozilla/i.test(navigator.userAgent)==true){document.getElementById(divId).innerHTML+='<div id="TMP'+divId+'" style="display:none">'+escape('<body><div id="adDiv'+divId+'">'+code+"</div>")+'</div><iframe id="'+invObj+'" width="0" height="0" frameborder="0" '+"onload=\"javascript:try { if(document.getElementById('"+divId+"').getElementsByTagName('*').length < 3) document.getElementById('"+divId+"').innerHTML +="+"document.getElementById('"+invObj+"')."+"contentDocument.getElementById('adDiv"+divId+"').innerHTML } catch(aamErr) { }\"></iframe>";
document.getElementById(invObj).contentDocument.location="javascript:unescape(parent.document.getElementById('TMP"+divId+"').innerHTML)";
}else{if(document.getElementById(invObj)){$(invObj).innerHTML=code;$(divId).innerHTML=$(invObj).innerHTML;
$(invObj).innerHTML="";}else{document.writeln('<div id="'+invObj+'" style="display:none">'+code+'<script type="text/javascript" defer="true">'+"document.getElementById('"+divId+"').innerHTML = "+"document.getElementById('"+invObj+"').innerHTML;"+"document.getElementById('"+invObj+"').innerHTML = '';</scr"+"ipt></div>");
}}}}}},renderAds:function(D){if(!Nvt.Core.SponsorSelect.hasCampId()){var H="";var F="";var A=null;if(D!=null&&D.length!=0){A=D.split(",");
}for(var C=0;C<this.a_posL;C++){var G=this.a_pos[C];if(A!=null&&A.length>0){var I=false;for(var B=0;B<A.length;
B++){if(G==A[B].replace(/^\s+|\s+$/g,"")){I=true;break;}}if(I==false){continue;}}H="atlas"+G;var E=document.getElementById(H);
if(!E){continue;}F=this.a_AAMBs[G];this.renderAd(H,F);}}},refreshAds:function(B,A){if(navigator.userAgent.indexOf("MSIE")==-1&&/Mozilla/i.test(navigator.userAgent)==false){return ;
}if(navigator.userAgent.indexOf("MSIE")!=-1){nQ("#atlasTop1 ~ *").remove();}var C=new Date();if(A==true||((C.getTime()-this.lastRefreshTime)>this.refreshInterval)){if(this.refreshAdsCounter>0){this.requestAds(B);
}this.refreshAdsCounter++;}},requestAds:function(A){var C=this.getUrl(A);Nvt.console.log("New Ad URL: "+C);
nQ.getScript(C+"?",function(){NvtAds.renderAds(A);});var B=new Date();this.lastRefreshTime=B.getTime();
},drawAd:function(G){if(!Nvt.Core.SponsorSelect.hasCampId()){var H="http://adbureau.traffic.com/hserver";
var K=this.a_env;var E=Math.round(Math.random()*1000000);var J=Math.round(Math.random()*1000000);var N=this.a_homemetro;
var B=this.a_site;var D=this.getArea();var C=this.a_partner;var F=new Date().getTime();var A=H;if(D){A+=D;
}if(N){A+="/homemetro="+N;}if(K){A+="/env="+K;}if(E){A+="/pageid="+E;}A+="/acc_random="+J;if(B){A+="/site="+B;
}if(C){A+="/partner="+C;}if(G.adSize){A+="/aamsz="+G.adSize;}if(G.incidentType){A+="/itype="+G.incidentType;
}if(G.criticality){A+="/icriticality="+G.criticality;}if(G.description){A+="/keyword="+this.parseIntoKeywords("DESC_",G.description,4,7);
}if(G.position){A+="/position="+G.position;}if(G.lat){A+="/lat="+G.lat;}if(G.lon){A+="/lon="+G.lon;}A+="?random="+F;
var M="";if(G.className){M='class="'+G.className+'"';}var I='<iframe name="adiframe'+F+'" id="adiframe'+F+'" height="'+G.adHeight+'" '+M+'allowtransparency="false" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" src="'+A+'"></iframe>';
if(G.adDiv){var L=G.adDiv;}else{var L=document.getElementById(G.adDivId);}L.innerHTML=I;}},parseIntoKeywords:function(E,J,C,I){if(!I){I=5;
}var F=/\W/g;var K=J.replace(F," ");var B="";var G=K.split(" ");var A="";var H=0;for(var D=0;D<G.length;
D++){A=G[D];if(A.length<C){continue;}B+=E+A+",";H++;if(H>=I){break;}}return B;},getAtlasSize:function(A){switch(A){case"Bottom1":return"468x60";
case"Bottom2":return"BOTTOM2";case"Bottom3":return"728x90";case"BottomRight":return"100x20";case"Middle":return"POPUNDER";
case"Middle1":return"300x250";case"Middle2":return"300x250";case"Middle3":return"720x300";case"Position1":return"180x150";
case"Position2":return"POSITION2";case"Position4":return"234x60";case"Right":return"160x600";case"Top":return"180x150";
case"Top1":return"728x90";case"Top3":return"728x90";case"TopRight":return"234x60";case"x04":return"125x14";
case"x05":return"144x14";case"x06":return"327x168";case"x10":return"ROUTINGAD";case"Jamcast":return"JAMCAST";
default:return"UNKNOWN";}},createAd:function(pos){var divId="atlas"+pos;document.writeln("<div id='"+divId+"' class='atlasAd'>");
document.writeln(eval(this.a_AAMBs[pos]));document.writeln("</div>");},appendAd:function(div,pos){div.html(eval(this.a_AAMBs[pos]));
},getUrl:function(C,D){var G=this.a_url.indexOf("/expandable=true");if(!D&&G>0){var H=this.a_url.substring(0,G);
var B=this.a_url.substring(G+"/expandable=true".length,this.a_url.length);this.a_url=H+B;}var A="/pageid="+Math.round(Math.random()*1000000);
var F="/acc_random="+Math.round(Math.random()*1000000);var E=new Date().getTime();return this.a_url+this.getArea()+A+F+this.appendAdPositions(C)+"?random="+E;
},getArea:function(){return"/area="+this.parseOAS_sitepage(this.a_area);},setArea:function(A){this.a_area=A;
}};Nvt.Core.GeoPoint=Class.create();Nvt.Core.GeoPoint.prototype={initialize:function(B,A){this.latitude=B;
this.longitude=A;},getLatitude:function(){return this.latitude;},getLongitude:function(){return this.longitude;
},toString:function(){return this.getLatitude()+" "+this.getLongitude();}};Nvt.Core.RefreshManager=(function(){var J;
var G=new Array();var L=new Hash();var A;function D(M){G=new Array();if(M){E(M);}return{callbacks:G,map:A,refresh:H,addCallback:K,addWidgetCallback:F,removeWidgetCallback:I,setMap:E,getMetroName:C};
}function E(M){A=M;A.registerMetroChangeCallback(H);}function H(R){try{var O=null;if(A){O=A.getCurrentMapState();
}var Q=null;var M=null;if(typeof (restMetros)!="undefined"&&R){Q=C(R,restMetros);M=B(R,restMetros);metroWSUrl=commonData.appServerName+"/"+Q;
}for(var N=0;N<G.length;N++){try{if(G[N]!=null){G[N](R,O,Q,M);}}catch(P){Nvt.console.error("Error in refresh callback");
Nvt.console.error(P);}}}catch(P){Nvt.console.error("Error in refresh: "+P);Nvt.console.error(P);console.trace();
}}function C(O,N){for(var M=0;M<N.presentationObjects.metros.length;M++){if(N.presentationObjects.metros[M].metroId==(""+O)){return N.presentationObjects.metros[M].metroName;
}}return"";}function B(O,N){for(var M=0;M<N.presentationObjects.metros.length;M++){if(N.presentationObjects.metros[M].metroId==(""+O)){return N.presentationObjects.metros[M].metroShortName;
}}return"";}function K(M){G.push(M);}function F(M){var N=M.refreshCallback.bind(M);G.push(N);L[M.id]=N;
}function I(M){var N=L[M.id];L[M.id]=null;G[G.indexOf(N)]=null;G.compact();}return{getInstance:function(M){if(!J){J=D(M);
}return J;}};})();Nvt.Core.Serializer={_initialize:function(){if(!this.PERSISTOR){this.PERSISTOR=this.CookiePersistor;
if(Prototype.Browser.IE){if(this.BehaviorPersistor.isValid()){this.PERSISTOR=this.BehaviorPersistor;return ;
}}else{if(this.StoragePersistor.isValid()){this.PERSISTOR=this.StoragePersistor;return ;}}if(this.FlashPersistor.isValid()){this.PERSISTOR=this.FlashPersistor;
}}},deserialize:function(A,B){if(B==null){return ;}this._initialize();try{return this.PERSISTOR.deserialize(A,B);
}catch(C){return null;}},serialize:function(A,C,D,B){if(C==null){return ;}this._initialize();try{this.PERSISTOR.serialize(A,C,D,B);
}catch(E){return ;}},remove:function(A,B){if(B==null){return ;}this._initialize();try{this.PERSISTOR.remove(A,B);
}catch(C){return ;}},FlashPersistor:{isValid:function(){try{this._FLASHSTORAGE=$("FlashPersistenceContainer");
if(this._FLASHSTORAGE){this._FLASHSTORAGE.getNamespaceData("traffic.com","init");return true;}}catch(A){}return false;
},deserialize:function(A,B){return this._FLASHSTORAGE.getNamespaceData(A,B);},serialize:function(A,C,D,B){this._FLASHSTORAGE.setNamespaceData(A,C,D);
},remove:function(A,B){this._FLASHSTORAGE.removeNamespaceData(A,B);}},StoragePersistor:{isValid:function(){try{var D=globalStorage[document.location.hostname];
var C="TestThis";D[C]=C;var A=globalStorage[document.location.hostname];if(A[C]!=C){return false;}return true;
}catch(B){return false;}},deserialize:function(A,B){var C=globalStorage[A];return C[B];},serialize:function(A,C,D,B){var E=globalStorage[A];
E[C]=D;},remove:function(A,B){var C=globalStorage[A];C[B]=null;}},BehaviorPersistor:{isValid:function(){if(!Prototype.Browser.IE){return false;
}try{this._IE_STORAGE=$("BehaviorPersistenceContainer");if(this._IE_STORAGE){this._IE_STORAGE.load("init");
return true;}}catch(A){}return false;},deserialize:function(A,B){this._IE_STORAGE.load(B);return this._IE_STORAGE.getAttribute(B);
},serialize:function(A,C,D,B){this._IE_STORAGE.load(C);this._IE_STORAGE.setAttribute(C,D);this._IE_STORAGE.save(C);
},remove:function(A,B){this._IE_STORAGE.load(B);this._IE_STORAGE.removeAttribute(B);this._IE_STORAGE.save(B);
}},CookiePersistor:{isValid:function(){return true;},deserialize:function(A,D){var E=document.cookie.split(";");
for(var C=0;C<E.length;C++){var B=E[C].strip();var F=B.split("=");if(D==F[0]){return unescape(F[1]);}}return null;
},serialize:function(A,D,F,B){var E=D+"="+F;if(B){var C=new Date();C.setTime(C.getTime()+(B*24*60*60*1000));
E=E+"; expires="+C.toGMTString();}document.cookie=E;},remove:function(A,B){document.cookie=B+"=;expires="+(new Date().getTime()-1000);
}}};Nvt.Core.BackButton=Class.create();Nvt.Core.BackButton.prototype={last:null,recording:true,initialize:function(){this.backClosures=new Array();
},registerCallback:function(C){var B=this.callback.bind(this);var A=function(){nQ.historyInit(B);this.initialized=true;
};nQ(document).ready(A.bind(this));this.back=C;},callback:function(A){if(!this.recording&&this.back&&(this.last!=A)){this.back(A);
var B=this.backClosures.pop();if(B){if(!nQ.browser.safari){B();}}}},record:function(B,C){var A=document.title;
if(this.initialized){this.recording=true;this.last=B;nQ.historyLoad("back_"+B);this.recording=false;this.backClosures.push(C);
}document.title=A;}};Nvt.Core.NvtAds=Class.create();Nvt.Core.NvtAds.prototype={initialize:function(C,B,A){this.pos_array=C.split(",");
this.pos_used_array=new Array(this.pos_array.length);this.domainPrefix=B;this.adServer=A;},drawAd:function(A){if(Nvt.Core.SponsorSelect.hasCampId()){if(this.recordPos(Nvt.Core.SponsorSelect.convertOASPosition(A))){this.adServer.OAS_AD(Nvt.Core.SponsorSelect.convertOASPosition(A));
}}else{if(this.recordPos(A)){this.adServer.createAd(A);}else{if("i"==this.domainPrefix||"localhost."==this.domainPrefix){Nvt.console.error("Page: - Missing Ad Setup for location: "+A);
}}}},appendAd:function(C,B){if(Nvt.Core.SponsorSelect.hasCampId()){if(this.recordPos(Nvt.Core.SponsorSelect.convertOASPosition(B))){this.adServer.OAS_AD(Nvt.Core.SponsorSelect.convertOASPosition(B));
}}else{var A=new Object();A.adDivId="atlas"+B;A.adDiv=C;A.adSize="300x250";A.adHeight="250";A.position=B;
this.adServer.drawAd(A);}},recordPos:function(B){var A=0;while(A<this.pos_array.length){if(this.pos_array[A].replace(/^\s+|\s+$/g,"")==B){if(this.pos_used_array[A]==true){if("i"==this.domainPrefix||"localhost."==this.domainPrefix){alert("Ad Location: "+B+" was called twice");
}}this.pos_used_array[A]=true;return true;}A++;}return false;},auditPos:function(){var B=0;var A="";while(B<this.pos_used_array.length){if(this.pos_used_array[B]==null||!this.pos_used_array[B]){A=A+" "+this.pos_array[B];
}B++;}if(A.length>0){if("i"==this.domainPrefix||"localhost."==this.domainPrefix){Nvt.console.error("The following ad locations were setup for this page and never referenced:"+A);
}}},refreshAds:function(B,A){this.adServer.refreshAds(B,A);this.refreshAWOIFrame();},renderAds:function(A){this.adServer.renderAds(A);
},getUrl:function(A,B){return this.adServer.getUrl(A,B);},refreshAWOIFrame:function(){var D=Math.floor(Math.random()*10000000);
var A=nQ("#nvt_partnerHeader > iframe:first");if(A.size()>0){var B=A.attr("src");if(typeof (B)!="undefined"){if(B.indexOf("aworand")>0){B=B.substring(0,B.indexOf("aworand")-1);
}var C="?";if(B.indexOf(C)>0){C="&";}B=B+C+"aworand="+D;A.attr("src",B);}}},locationAd:function(B,A,C){},setArea:function(A){this.adServer.setArea(A);
}};Nvt.Core.NvtAnalytics=new Object();Nvt.Core.NvtAnalytics.virtual=function(A){if(typeof (wt_sendinfo)!="undefined"){if(A.indexOf("/virtual/search")==-1){wt_sendinfo(A,"click");
}else{wt_sendinfo();}}if(typeof (pageTracker)!="undefined"){pageTracker._trackPageview(A);}if(typeof ss_sitespectClickTrackOn!="undefined"&&ss_sitespectClickTrackOn!=null){var B=nQ.trim(ss_sitespectClickTrackOn).toLowerCase();
if(B==="true"){Nvt.Core.NvtAnalytics.SSClickTrack(A);}}};Nvt.Core.NvtAnalytics.SSClickTrack=function(E,G){var F="";
if(G){F="&value="+G;}var B="/clicktrack.png?event="+E+F+"&x="+(new Date().getTime())+Math.floor(Math.random()*99999999);
var D;var A=0;if(window.XMLHttpRequest){try{D=new XMLHttpRequest();D.open("GET",B,false);D.send(null);
}catch(C){A=1;}}else{if(window.ActiveXObject){try{D=new ActiveXObject("Microsoft.XMLHTTP");if(D){D.open("GET",B,false);
D.send();}}catch(C){A=1;}}else{D=new Image();D.src=B;A=0;}}if(A==1){D=new Image();D.src=B;}return true;
};Nvt.Core.URI=Class.create();Nvt.Core.URI.prototype={initialize:function(D,G){if(D!=null&&"string"==typeof D&&D.length>0){this.isURI=true;
this.protocol=null;this.domain=null;this.port=null;this.path=null;this.hash=null;this.parameters={};var E=D.split("?");
D=E[0];if(E.length>1){var A=E[1].split("&");for(var C=0;C<A.length;C++){var F=A[C].split("=");if(F.length>1){this.addParameter(decodeURIComponent(F[0]),decodeURIComponent(F[1]));
}}}E=D.split("#");D=E[0];if(E.length>1){this.hash=E[1];}E=D.split(":");if(E.length>1){this.protocol=E[0];
E[1]=E[1].substring(2);if(E.length>2){this.domain=E[1];var B=E[2].indexOf("/");if(B>=0){this.port=B>0?E[2].substring(0,B):null;
this.path=E[2].substring(B);}else{this.port=E[2];}}else{var B=E[1].indexOf("/");if(B>=0){this.domain=B>0?E[1].substring(0,B):null;
this.path=E[1].substring(B);}else{this.domain=E[1];}}}else{this.path=E[0];}if(G){this.makeAbsolute();
}}else{throw"The 'Nvt.Core.URI' requires a valid source URI string.";}},addParameterHash:function(B){var A=$H(B);
A.each(function(C){this.addParameter(C.key,C.value);});},addParameter:function(B,A){if(B&&A){if(this.parameters[B]){this.parameters[B][this.parameters[B].length]=A;
}else{this.parameters[B]=[A];}}return this;},setParameter:function(B,A){if(B&&A){this.parameters[B]=[A];
}return this;},removeParameter:function(B){if(B){if(this.parameters[B]){this.parameters[B]=null;try{this.parameters[B]=undefined;
delete this.parameters[B];}catch(A){}}}return this;},makeAbsolute:function(){if(!this.protocol){this.protocol=document.location.protocol;
if(this.protocol.endsWith(":")){this.protocol=this.protocol.substring(0,(this.protocol.length-1));}}if(!this.domain){this.domain=document.location.hostname;
}if(!this.port&&document.location.host!=document.location.hostname){this.port=document.location.port;
}if(!this.path.startsWith("/")){if(document.location.pathname&&document.location.pathname.length>0){var B=document.location.pathname;
var A=B.lastIndexOf("/");if(A>1){this.path=B.substring(0,A+1)+this.path;}}if(!this.path.startsWith("/")){this.path="/"+this.path;
}}return this;},isWithinDomain:function(A){if(this.domain&&this.domain.length>0){if(A&&A.length>0){if(A==this.domain||A.endsWith(this.domain)){return true;
}else{return false;}}else{return false;}}return true;},isHttpsProtocol:function(){if(this.protocol=="https"){return true;
}return false;},forceRequest:function(){var A=new Date().getTime();this.addParameter("force"+A,A);return this;
},replaceDomain:function(D,C){if(D&&D.length>0){if(!this.domain){this.makeAbsolute();}for(var B=0;B<D.length;
B++){var A=D[B];if(this.domain==A){this.domain=C;return ;}if(this.domain.endsWith(A)){this.domain=this.domain.substring(0,(this.domain.length-A.length))+C;
return ;}}}return this;},toString:function(){var A="";if(this.protocol&&this.domain){A+=this.protocol+"://"+this.domain;
if(this.port){A+=":"+this.port;}}A+=this.path;if(this.hash){A+="#"+this.hash;}var B=$H(this.parameters);
if(B.keys()&&B.keys().length>0){A+="?"+B.toQueryString();}return A;}};Nvt.Core.OAS=Class.create();Nvt.Core.OAS.prototype={initialize:function(A){this.OAS_url="http://sp.sponsorselect.com/RealMedia/ads/";
this.OAS_targetparams="";this.OAS_sitepage="www.sptraffic.com/ContentPage";this.OAS_targetparams="spcampid="+Nvt.Core.SponsorSelect.getCampId();
this.OAS_listpos="ssn1,ssn2,ssn3";this.OAS_query="RM_Exclude=Airlines,Alcohol,Automobiles,Banking,BizDev,Careers,ComputerHardware,ComputerSoftware,ConsumerGoods,Dental,Education,Entertainment,FinancialServices,Fitness,Government,Health,Healthcare,Insurance,Music,Pharmaceutical,RealEstate,Restaurants,Retail,Services,Technology,Telecommunications,Television,Tobacco,Travel,Utilities,WebSites";
this.OAS_creativeparams="";this.OAS_target="_blank";this.OAS_rn=new String(Math.random());this.OAS_rns=this.OAS_rn.substring(2,11);
this.OAS_version=11;if((navigator.userAgent.indexOf("Mozilla/3")!=-1)||(navigator.userAgent.indexOf("Mozilla/4.0 WebTV")!=-1)){this.OAS_version=10;
}if(this.OAS_version>=11){document.write("<SCR"+'IPT LANGUAGE=JavaScript1.1 SRC="'+this.OAS_url+"adstream_mjx.ads/"+this.OAS_sitepage+"/1"+this.OAS_rns+"@"+this.OAS_listpos+"?"+this.OAS_targetparams+"&"+this.OAS_query+'"></SCRIPT>');
}this.lastRefreshTime=new Date().getTime();if(A!=null&&A.length>0){this.refreshInterval=A;}else{this.refreshInterval=30000;
}},refreshAds:function(B,A){if(navigator.userAgent.indexOf("MSIE")==-1){return ;}var C=new Date();if(A==true||((C.getTime()-this.lastRefreshTime)>this.refreshInterval)){Nvt.Core.SponsorSelect.incrementSponsorSelectCookie();
this.lastRefreshTime=C.getTime();}},drawAd:function(A){},renderAds:function(A){},locationAd:function(B,A,C){},OAS_NORMAL:function(A){document.write('<A HREF="'+this.OAS_url+"click_nx.ads/"+this.OAS_sitepage+"/1"+this.OAS_rns+"@"+this.OAS_listpos+"!"+A+"?"+this.OAS_targetparams+"&"+this.OAS_query+'" TARGET='+this.OAS_target+">");
document.write('<IMG SRC="'+this.OAS_url+"adstream_nx.ads/"+this.OAS_sitepage+"/1"+this.OAS_rns+"@"+this.OAS_listpos+"!"+A+"?"+this.OAS_targetparams+"&"+this.OAS_query+'" BORDER=0></A>');
},OAS_AD:function(A){if(this.OAS_version>=11){OAS_RICH(A);}else{this.OAS_NORMAL(A);}},getUrl:function(A,B){return null;
},setArea:function(A){}};Nvt.Core.SponsorSelect={removeCookie:function(A){document.cookie=A+"=; domain=traffic.com; path=/; expires="+(new Date().getTime()-1000);
},exceedsSponsorSelectHits:function(){var A=Nvt.Util.readCookie("incSponsorSelect");if(!A){return true;
}if(A>sponsorSelectConfig.impressions){return true;}return false;},getCampId:function(){var A=null;if(!this.exceedsSponsorSelectHits()){A=Nvt.Util.readCookie("campid");
}if(A==null){return 0;}return A;},hasCampId:function(){if(this.getCampId()==0){return false;}return true;
},convertOASPosition:function(A){if(A=="Top1"){return"ssn1";}if(A=="Middle1"){return"ssn2";}if(A=="Right"){return"ssn3";
}return A;}};Nvt.Core.Utility={garbageCollect:function(D,B,A){if(A){try{if(D[B].tagName&&D[B].remove){D[B].remove();
}}catch(C){}}try{D[B]=undefined;}catch(C){}try{delete D[B];}catch(C){}},newEventCache:function(){return{_events:[],add:function(B,E,D){var C=this._events.length;
var A=$(B);this._events[C]={target:A,event:E,pointer:D};if(A.addEventListener){A.addEventListener(E,D,false);
}else{if(A.attachEvent){A.attachEvent("on"+E,D);}}A=null;return C;},clear:function(){if(this._events&&this._events.length>0){for(var A=0;
A<this._events.length;A++){var B=this._events[A];if(B.target.removeEventListener){B.target.removeEventListener(B.event,B.pointer,false);
}else{if(B.target.detachEvent){try{B.target.detachEvent("on"+B.event,B.pointer);}catch(C){alert(C);}}}Nvt.Core.Utility.garbageCollect(B,"target");
Nvt.Core.Utility.garbageCollect(B,"event");Nvt.Core.Utility.garbageCollect(B,"pointer");}}this._events=[];
},remove:function(A){if(A>=0&&A<this._events.length){var C=this._events[A];if(C!=null){if(C.target.removeEventListener){C.target.removeEventListener(C.event,C.pointer,false);
}else{if(C.target.detachEvent){try{C.target.detachEvent("on"+C.event,C.pointer);}catch(B){}}}Nvt.Core.Utility.garbageCollect(C,"target");
Nvt.Core.Utility.garbageCollect(C,"event");Nvt.Core.Utility.garbageCollect(C,"pointer");Nvt.Core.Utility.garbageCollect(this._events,A);
}this._events[A]=null;}}};},newItemSelector:function(E,D,C,B){var A={index:-1,selectedClass:D,nonSelectedClass:C,_nextVisibleNodeIndex:function(F){var H=this.index;
var G=H+1;while(G!=H){if(H<0){H=0;}if(G>=F.length){G=0;}if(!F[G].IsHidden){return G;}G=G+1;}return null;
},_previousVisibleNodeIndex:function(F){var H=this.index;var G=H-1;while(G!=H){if(H<0){H=0;}if(G<0){G=F.length-1;
}if(!F[G].IsHidden){return G;}G=G-1;}return null;},next:function(F){var G=this._nextVisibleNodeIndex(F);
if(G!=null){this.select(F,G);}},previous:function(F){var G=this._previousVisibleNodeIndex(F);if(G!=null){this.select(F,G);
}},select:function(F,G){if(G>=0&&G<F.length&&G!=this.index){if(this.index>=0&&F[this.index]){F[this.index].className=this.selectedClass;
}this.index=G;F[this.index].className=this.nonSelectedClass;}},selected:function(F){if(this.index>=0&&this.index<F.length){return F[this.index];
}return null;},filter:function(F,G){if(G&&G.length>0){var H=G.toString();F.each(function(I){var J=I.innerHTML;
if(J&&J.startsWith(H)){I.style.display="block";I.IsHidden=false;}else{I.style.display="none";I.IsHidden=true;
}});}else{F.each(function(I){I.style.display="block";I.IsHidden=false;});}}};if(B>=0){A.select(E,B);}return A;
}};Nvt.Data.Coordinate=Class.create();Nvt.Data.Coordinate.prototype={initialize:function(){this.latitude="";
this.longitude="";this.latitudeInMins="";this.longitudeInMins="";this.valid=false;},clone:function(){var A=new Nvt.Data.Coordinate();
A.setCoords(this.latitude,this.longitude);return A;},isValid:function(){return this.valid;},setCoords:function(B,A){this.setLatitude(B);
this.setLongitude(A);this.valid=true;},setCoordsInMinutes:function(B,A){this.setLatitudeInMins(B);this.setLongitudeInMins(A);
this.valid=true;},setLatitude:function(A){this.latitude=A;this.latitudeInMins=this.convertDegreesToMinutes(this.latitude);
},setLongitude:function(A){this.longitude=A;this.longitudeInMins=this.convertDegreesToMinutes(this.longitude);
},setLatitudeInMins:function(A){this.latitudeInMins=A;this.latitude=this.convertMinutesToDegrees(this.latitudeInMins);
},setLongitudeInMins:function(A){this.longitudeInMins=A;this.longitude=this.convertMinutesToDegrees(this.longitudeInMins);
},convertDegreesToMinutes:function(A){return(parseFloat(A)*60);},convertMinutesToDegrees:function(A){return(parseFloat(A)/60);
}};Nvt.Data.AddressLocation=Class.create();Nvt.Data.AddressLocation.prototype={initialize:function(){this.coodinates="";
this.houseNo="";this.street="";this.city="";this.state="";this.zip="";this.country="";this.county="";
this.district="";this.valid=false;},clone:function(){var A=new Nvt.Data.AddressLocation();A.setCoords(this.coodinates);
A.street=this.street;A.city=this.city;A.state=this.state;A.zip=this.zip;A.country=this.country;A.county=this.county;
A.district=this.district;A.houseNo=this.houseNo;A.coodinates=this.coodinates;return A;},isValid:function(){return this.valid;
},setCoords:function(A){this.coodinates=A;this.valid=true;},toBasicAddress:function(){var A="";if(typeof (this.houseNo)!="undefined"&&this.houseNo!=null){A=A+this.houseNo+" ";
}if(typeof (this.street)!="undefined"&&this.street!=null){A=A+this.street+", ";}if(typeof (this.city)!="undefined"&&this.city!=null){A=A+this.city+", ";
}if(typeof (this.state)!="undefined"&&this.state!=null){A=A+this.state+" ";}if(typeof (this.zip)!="undefined"&&this.zip!=null){A=A+this.zip;
}return A;}};Nvt.Data.MapState=Class.create();Nvt.Data.MapState.prototype={initialize:function(){this.boundingBox=[];
this.boundingBox.NWCoordinate=new Nvt.Data.Coordinate();this.boundingBox.SECoordinate=new Nvt.Data.Coordinate();
this.centerPoint=new Nvt.Data.Coordinate();},clone:function(){var A=new Nvt.Data.MapState();A.boundingBox.NWCoordinate=this.boundingBox.NWCoordinate.clone();
A.boundingBox.SECoordinate=this.boundingBox.SECoordinate.clone();A.centerPoint=this.centerPoint.clone();
return A;},isValid:function(){return this.boundingBox.NWCoordinate.isValid()&&this.boundingBox.SECoordinate.isValid();
}};Nvt.Widget.HotspotWidget=Class.create();Nvt.Widget.HotspotWidget.prototype={initialize:function(H,J,C,K,F,I,L,A,G,B,D){this.initializeWidget();
this.customNoDataClosure=D;this.metroId=H;this.divId=J;this.data=C;this.overRideHeight=K;this.coord=F;
this.minJF=4;this.min=10;this.max=100;if(I){this.max=I;}if(L==false){this.displayAd=false;}else{this.displayAd=true;
}this.backLinkText=i18n.hotspots;this.defaultSortField="jamFactor";this.defaultSortOrder="desc";var E=["name","direction","jamFactor","incidents"];
this.formatter=new Nvt.Formatter.RoadFormatter(E,A,G,B);this.formatter.parentWidgetName="Hotspot";nQ("#"+J).append(this.spinner);
this.finished=false;this.getData();},getRestUrl:function(){var A=commonData.restServerName+"/roads?sortBy=driveReport.jamFactor.jamFactor&sortOrder=desc&var="+this.id+"&filter=child,jamFactor";
if(this.coord){A=A+",boundingBoxRoad&lat="+this.coord.latitude+"&lon="+this.coord.longitude+"&radius=5";
}else{A=A+"&metroId="+this.metroId;}if(this.max){A=A+"&max="+this.max;}A=A+"&filterParams=minJF="+this.minJF+"&min="+this.min;
return A;},postInit:function(){if(this.data.roads){this.data=this.data.roads;}this.filterData();this.table=new Nvt.Widget.TableWidget(this.formatter,this.data,this.defaultSortField,this.defaultSortOrder,this.displayAd,i18n.moreHotspotsBelow);
this.table.parentWidgetName="Nvt.Widget.HotspotWidget";this.table.display(this.id);if(this.overRideHeight){document.widgetManager.getSlideWidget().elementHeight=document.widgetManager.getSlideWidget().browseTrafficHeight+nQ("#"+this.id).height();
}document.widgetManager.getSlideWidget().animateHeight();this.finished=true;},filterData:function(){var B=new Array();
var A=/^\d+?/;for(i=0;i<this.data.length;i++){if(i<10||(A.test(this.data[i].driveReport.jamFactor.jamFactor)&&parseInt(this.data[i].driveReport.jamFactor.jamFactor)>this.minJF)){B[i]=this.data[i];
}else{break;}}if(B.length==0&&this.customNoDataClosure!=null){this.customNoDataClosure();return ;}this.data=B;
},postDisplay:function(){this.pageTitle=i18n.hotspots+" :: "+metroSummary.metros[0].metroName+" :: "+i18n.trafficDotCom;
this.setPageTitle(this.pageTitle);},refreshCallback:function(B,A){nQ(this.DOM).empty();if(B){this.metroId=B;
}this.data=null;this.divId=null;this.getData(true);},CLASS_NAME:"Nvt.Widget.HotspotWidget"};Object.extend(Nvt.Widget.HotspotWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.SlideWidget=Class.create();Nvt.Widget.SlideWidget.prototype={initialize:function(A,D,C,B){this.initializeWidget();
document.widgetManager.setSlideWidget(this);this.id="nvt_slideWidget";this.DOM.setAttribute("id",this.id);
this.parentDivId=A;this.elements=new Array();this.widgets=new Array();this.states=new Array();this.backClosures=new Array();
this.elementWidth=nQ("#"+A).width();if(B){this.elementWidth=B;}this.DOM.style.cssFloat="left";this.DOM.style.styleFloat="left";
this.DOM.style.width=this.elementWidth;this.DOM.style.position="relative";this.DOM.style.left="0";wrap=this.createWrap(D,false);
this.states.push(C);if(C){}this.DOM.appendChild(wrap[0]);this.display(A);D.display("nvt_widgetWrapWidgetHolder0");
this.elementHeight=nQ("#"+A).height();},browserBackButtonPress:function(A){var B=this.backClosures.pop();
this.backClosures.push(B);B();},push:function(F,H,G,E){var D=null;if(trafficMap){if(trafficMap.getCurrentMapState()){D=trafficMap.getCurrentMapState().clone();
if(H){trafficMap.setMapState(H);}}}Nvt.Util.logMapState(D,"State about to be pushed");F.parent=this;nQ("#"+this.elements[this.elements.length-1].id+" .nvt_ad").css("visibility","hidden").css("display","none");
wrap=this.createWrap(F,true);F.wrap=wrap;this.backClosures.push((G?G:this.pop.bind(this)));this.states.push(D);
nQ("#"+this.id).css("width",this.elements.length*parseFloat(this.elementWidth));nQ("#"+this.id).append(wrap);
F.display("nvt_widgetWrapWidgetHolder"+(this.elements.length-1));this.slide();var C=this.pop.bind(this);
var A=nQ(".nvt_widgetBackLink"+(this.elements.length-1));if(G){C=G;if(E){var B="&laquo; "+i18n.backTo+" "+E;
A.html(B);}}A.click(C);document.widgetManager.backButton.record(F.id,C);if(NvtAds){NvtAds.refreshAds(null,true);
}return wrap.id;},pop:function(){var B=this.elements.pop();var F=this.widgets.pop();var E=this.backClosures.pop();
F.destroy();var A=this.elementHeight;A=nQ("#"+this.elements[this.elements.length-1].id).height();var D=this.widgetsPeek();
if(F.pageTitle){this.setPageTitle(D.backLinkText.substring(D.backLinkText.indexOf("Back to ")+8)+" :: "+i18n.trafficDotCom);
}var H=this.elements[this.elements.length-1].id;nQ("#"+this.id).animate({height:A,left:"-"+(this.elementWidth*(this.elements.length-1))},1500,function(){nQ("#"+B.id).remove();
nQ("#"+H+" .nvt_ad").css("visibility","visible").css("display","table-row");if(F.pageTitle){this.setPageTitle(D.backLinkText.substring(D.backLinkText.indexOf("Back to ")+8)+" :: "+i18n.trafficDotCom);
}A=nQ("#"+this.elements[this.elements.length-1].id).height();nQ("#"+this.id).animate({height:A},1000);
}.bind(this));try{var C=this.states.pop();Nvt.Util.logMapState(C,"Popped Map State");if(trafficMap){trafficMap.setMapState(C);
}}catch(G){Nvt.console.error("Error trying to restore the map state: ",G);}},animateSlider:function(C,A,H){var I=document.widgetManager.getTabWidget();
if(I&&commonData.pageType=="metro"&&H!=true){I.clickTab(null,i18n.browseTraffic,true);}var D=C?C:0;var L=nQ("#"+this.elements[this.elements.length-1].id).height()+D;
var B="-"+(this.elementWidth*(this.elements.length-1));if(A==false){nQ("#"+this.id).css({height:L,left:""+B+"px"});
}else{nQ("#"+this.id).animate({height:L,left:B},1500);}var E=document.viewport.getScrollOffsets();var G=nQ("#nvt_header").height();
var K=E[1];if(K>G){var J=K-G;for(var F=0;F<J;F++){F=F+3;window.scrollTo(0,K-F);}}},slide:function(){var A="-"+(this.elementWidth*(this.elements.length-1));
nQ("#"+this.id).animate({left:A},1500);},animateHeight:function(B){var A=0;if(B){A=B;}B=nQ("#"+this.elements[this.elements.length-1].id).height()+A+"px";
nQ("#"+this.id).animate({height:B},1500);},animateHeightTwisty:function(C){var B=0;if(C){B=C;}C=nQ("#"+this.elements[this.elements.length-1].id).height()+B;
var A="+";if(C<0){A="-";C=Math.abs(C);}var D=A+"="+C+"px";nQ("#"+this.id).animate({height:D},1500);},createWrap:function(D,C){var B=nQ('<div id="nvt_widgetWrap'+this.elements.length+'" class="nvt_widgetWrap" style="width: '+this.elementWidth+'px; float: left;"></div>');
D.DOM.style.display="none";if(C){B.append(this.createBackLink("Upper"));}var A=nQ('<div id="nvt_widgetWrapWidgetHolder'+this.elements.length+'"></div>');
B.append(A);if(C){B.append(this.createBackLink("Lower"));}this.elements.push(B[0]);this.widgets.push(D);
return B;},createBackLink:function(B,D){var C=this.widgetsPeek().backLinkText;if(D){C=D;}var A=nQ('<a id="nvt_widgetBackLink'+B+this.elements.length+'" class="nvt_widgetBackLink'+B+" nvt_widgetBackLink"+this.elements.length+'">&laquo; '+C+"</a>");
return A;},widgetsPeek:function(){var A=this.widgets.pop();this.widgets.push(A);return A;},getCurrentState:function(){if(this.states.length>0){return this.states[this.states.length-1];
}else{return null;}},toggleDisplay:function(A){if(nQ("#"+this.id+" #"+A).size()>0){nQ("#"+A).show();}},resetSlider:function(){if(nQ.browser=="msie"&&nQ.browser.version=="7.0"){nQ(this.DOM).css("left",0);
}else{nQ(this.DOM).css("left","0px");}if(this.elements.length>1){nQ(this.DOM).css("height",height);height=nQ("#"+this.elements[0].id).height();
while(this.elements.length>1){var A=this.elements.pop();nQ("#"+A.id).remove();}while(this.widgets.length>1){this.widgets.pop();
}while(this.states.length>1){this.states.pop();}nQ("#"+this.elements[0].id+" .nvt_ad").css("visibility","visible");
if(trafficMap){trafficMap.setMapState(this.states[0]);}}},CLASS_NAME:"Nvt.Widget.SlideWidget"};Object.extend(Nvt.Widget.SlideWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.AllRoadsWidget=Class.create();Nvt.Widget.AllRoadsWidget.prototype={initialize:function(D,A,B){this.initializeWidget();
this.metroId=D;this.divId=A;this.data=B;var C=["signText1","direction"];this.formatter=new Nvt.Formatter.AllRoadsFormatter(C);
this.getData();},getRestUrl:function(){var A=commonData.restServerName+"/roads?var="+this.id+"&filter=parent&sortBy=signText1,direction&sortOrder=asc&dataset=all&metroId="+this.metroId;
return A;},postInit:function(){this.data=this.data.roads;var D={};for(var C=0;C<this.data.length;C++){var A=this.data[C];
if(!D[A.name]){D[A.name]={"name":A.name,"direction":{}};}D[A.name].direction[A.direction]=A;A="";}var B=new Array();
for(var A in D){B.push(D[A]);}this.pageTitle=i18n.allRoads+" :: "+metroSummary.metros[0].metroName+" :: "+i18n.trafficDotCom;
this.setPageTitle(this.pageTitle);var E=new Nvt.Widget.TableWidget(this.formatter,B,null,null,true,i18n.moreRoadsBelow);
E.parentWidgetName="Nvt.Widget.AllRoadsWidget";E.display(this.id);document.widgetManager.getSlideWidget().animateHeight();
},refreshCallback:function(B,A){this.divId=null;this.data=null;this.metroId=B;this.getData();this.redisplay();
},CLASS_NAME:"Nvt.Widget.AllRoadsWidget"};Object.extend(Nvt.Widget.AllRoadsWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.DirectionsWidget=Class.create();Nvt.Widget.DirectionsWidget.prototype={initialize:function(B,A){this.initializeWidget();
this.index=A;this.routeInfo=B;this.routeDirections=this.routeInfo.directions;this.directionsTableWidget={};
this.prepData();this.defaultSortFieldDirections=null;this.defaultSortOrderDirections=null;includeList=["orderId","text","distance"];
this.directionsFormatter=new Nvt.Formatter.DirectionsFormatter(includeList);this.createGeneralInfoHtml();
this.createTable();},postInit:function(){},createGeneralInfoHtml:function(){var B=Math.round(this.routeInfo.timeSecAtSpeedLimit/60);
var E=Math.round(this.routeInfo.timeSecTrafficBased/60);var C=E-B;if(C<0){C=0;}var F=Nvt.MapTp.RouteManagerHtmlBase.convertMeter(this.routeInfo.lengthMeterTrafficBased);
var D="";D+="  <div>";D+='   <table class="nvt_roadDetails">';D+="    <tbody>";D+="     <tr>";D+="      <th>"+i18n.currentDriveTimeColon+"</th>";
D+="      <td>"+Nvt.Util.getDisplayTime(E)+"</td>";D+="     </tr>";D+="     <tr>";D+="      <th>"+i18n.delayTimeColon+"</th>";
D+="      <td>"+Nvt.Util.getDisplayTime(C)+"</td>";D+="     </tr>";D+="     <tr>";D+="      <th>"+i18n.distanceColon+"</th>";
D+="      <td>"+F+" "+i18n.milesAbbr+"</td>";D+="     </tr>";D+="    </tbody>";D+="   </table>";D+='   <a href="#" class="nvt_btn_printDrive" id="nvt_btn_printDriveDirections'+this.index+'">'+i18n.printThisDrive+"</a>";
D+='   <div id="nvt_directionsStart'+this.index+'" class="nvt_directionsStart">';D+='    <ul id="nvt_drivePoints">';
D+='      <li id="nvt_driveStart" class="nvt_bold_text">'+this.routeInfo.startDisplay+"</li>";D+="    </ul>";
D+="   </div>";D+='   <div id="nvt_directionsTable'+this.index+'"></div>';D+="  </div>";var A=nQ(D);this.DOM.innerHTML+=A[0].innerHTML;
},createTable:function(){this.directionsTableWidget=new Nvt.Widget.TableWidget(this.directionsFormatter,this.routeDirections,this.defaultSortFieldDirections,this.defaultSortOrderDirections);
this.DOM.innerHTML+=this.directionsTableWidget.DOM.innerHTML;var A="";A+='   <div id="nvt_directionsEnd'+this.index+'" class="nvt_directionsEnd">';
A+='    <ul id="nvt_drivePoints"">';A+='      <li id="nvt_driveEnd" class="nvt_bold_text">'+this.routeInfo.endDisplay+"</li>";
A+="    </ul>";A+="   </div>";this.DOM.innerHTML+=A;},postDisplay:function(){this.directionsTableWidget.postDisplay();
var A=this.index;var B=nQ("#nvt_btn_printDriveDirections"+A);var C=this.printEvent.bind(this,A);B.click(C);
this.finalExecution();},printEvent:function(A){openPrintPage("route"+A);},prepData:function(){var A=this.routeDirections.length;
for(var B=0;B<A;B++){this.routeDirections[B].orderId=B+1;}},CLASS_NAME:"Nvt.Widget.DirectionsWidget"};
Object.extend(Nvt.Widget.DirectionsWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.MetroSummaryWidget=Class.create();
Nvt.Widget.MetroSummaryWidget.prototype={initialize:function(C,A,B){this.initializeWidget();this.data=B;
this.divId=A;this.metros=new Array();this.metroId=C;this.content=nQ('<ul class="nvt_ts">'+'<li class="nvt_tsHeader">'+i18n.areaTrafficSummary+"</li>"+'<li class="nvt_tsJamfactor"></li>'+'<li class="nvt_tsIncidents"></li>'+'<li class="nvt_tsConstruction"></li>'+'<li class="nvt_tsEvents"></li>'+'<li class="nvt_tsWeather"></li>'+'<li class="nvt_tsFooter">'+"<span>"+i18n.completeTrafficConditionsMyArea+"</span>"+'<a class="nvt_button">'+'<span class="nvt_buttonLeft"></span>'+"<h1>"+i18n.seeTheDetails+"</h1>"+'<span class="nvt_buttonRight"></span>'+"</a>"+"</li>"+"</ul>"+'<a id="nvt_tsWhatsThis" class="nvt_tsWhatsThis" class="nvt_darkSmallLink">'+i18n.whatIsThis+"</a>");
this.getData(true);},getRestUrl:function(){var A=commonData.restServerName+"/metroSummary?var="+this.id+"&dataset=all&metroId="+this.metroId;
return A;},postInit:function(){this.metro=this.data.metroSummary[0];if(this.metro.metro.metroJamFactor<10){this.metro.metro.metroJamFactor="0"+this.metro.metro.metroJamFactor;
}var F=this.metro.metro.metroName;var C=this.metro.metro.legacyDir;var B=commonData.appServerName+"/"+C+"/"+C+"-Reports.html";
var D=i18n.clickToView+" "+F+" "+i18n.traffic;this.content.find("li").attr("title",D);this.content.find("li").bind("click",function(){window.location.href=B;
});nQ("#nvt_metroArea").attr("title",D);nQ("#nvt_metroArea").bind("click",function(){window.location.href=B;
});nQ("#nvt_metroArea").text(Nvt.Util.removeArea(this.metro.metro.metroName)+" "+i18n.area);var A='<div id="inlineHelp" style="display:none;">'+"This will be added in the TextPattern milestone."+"</div>";
var E=this.metro.metro.metroJamFactor+".gif";this.content.find(".nvt_tsJamfactor").html(A+i18n.areaJamFactor+' <img alt="'+this.metro.metro.metroJamFactor+'" src="'+commonData.staticServer(E)+i18n.imagesPath+i18n.imagesPathJamfactor+E+'"/>');
if(Nvt.Util.getAWOPartner()=="DEFAULT"){this.content.find(".nvt_tsWeather").html(this.metro.weather.currentTemp+"&deg;"+i18n.symbolF+" - "+this.metro.weather.textDescription+' <img alt="'+this.metro.weather.textDescription+'" src="'+commonData.staticServer(this.metro.weather.imageURL)+i18n.imagesPath+i18n.imagesPathWeatherIcons+this.metro.weather.imageURL+'"/>');
}this.content.find(".nvt_tsIncidents").html(this.metro.congestionCount+" "+i18n.incident+this.appendPlural(this.metro.congestionCount));
this.content.find(".nvt_tsConstruction").html(this.metro.constructionCount+" "+i18n.constructionZone+this.appendPlural(this.metro.constructionCount));
this.content.find(".nvt_tsEvents").html(this.metro.eventsCount+" "+i18n.majorEvent+this.appendPlural(this.metro.eventsCount));
nQ(this.DOM).append(this.content);nQ(this.DOM).find("#nvt_tsWhatsThis").bind("mouseover",function(){var G=nQ("#nvt_tsWhatsThis");
var H=G.offset();H.triggerHeight=G.height();H.triggerWidth=G.width();document.nvtModalManager.displayContextual(H,"what-is-the-trafficcom-jam-factors",275);
});nQ(this.DOM).find("#nvt_tsWhatsThis").bind("mouseout",function(){document.nvtModalManager.hideContextual();
});this.finalExecution(this.divId);},appendPlural:function(A){return(A>1||A==0?i18n.pluralS:"");},hide:function(){this.content.fadeOut("slow");
},show:function(){this.content.fadeIn("slow");},refresh:function(A){this.metro=A.metroSummary[0];this.display();
},refreshCallback:function(){this.data=null;this.divId=null;nQ(this.DOM).empty();this.getData(true);},CLASS_NAME:"Nvt.Widget.MetroSummaryWidget"};
Object.extend(Nvt.Widget.MetroSummaryWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.AlertActionWidget=Class.create();
Nvt.Widget.AlertActionWidget.prototype={initialize:function(C,E,D,B){this.initializeWidget();if(E!=""){this.metroId=E;
}if(D!=""){this.commuteId=D;}this.krId=B;var A='<div class="nvt_alertAction">'+"<h1>"+i18n.freeTrafficAlerts+"</h1>"+"<h2>"+i18n.findWhenTrafficGetsBad+"</h2>"+"<ul>"+'<li class="nvt_alertActionEmail nvt_analytics"><a id="nvt_email">'+i18n.createEmailAlert+"</a>";
if(B==null){A+='&nbsp;<a id="nvt_emailAddLink" class="nvt_analytics nvt_addlink">'+i18n.addAlert+"</a></li>";
}else{A+="</li>";}A+='<li class="nvt_alertActionPhone nvt_analytics"><a id="nvt_phone">'+i18n.createPhoneAlert+"</a>";
if(B==null){A+='&nbsp;<a class="nvt_analytics" id="nvt_phoneAddLink">'+i18n.addAlert+"</a></li>";}else{A+="</li>";
}A+='<li class="nvt_alertActionSMS nvt_analytics"><a id="nvt_text">'+i18n.createTextMessageAlert+"</a>";
if(B==null){A+='&nbsp;<a class="nvt_analytics" id="nvt_textAddLink">'+i18n.addAlert+"</a></li>";}else{A+="</li>";
}A+="</ul>"+"</div>";this.content=nQ(A);if(C==null&&E&&(D||B)){if(B==null){this.content.find("#nvt_email").bind("click",this.addAlertsClosure("EMAIL","HTML"));
this.content.find("#nvt_emailAddLink").bind("click",this.addAlertsAddModalClosure("EMAIL","HTML"));this.content.find("#nvt_phone").bind("click",this.addAlertsClosure("PHONE","LAND"));
this.content.find("#nvt_phoneAddLink").bind("click",this.addAlertsAddModalClosure("PHONE","LAND"));this.content.find("#nvt_text").bind("click",this.addAlertsClosure("PHONE","MOBILE"));
this.content.find("#nvt_textAddLink").bind("click",this.addAlertsAddModalClosure("PHONE","MOBILE"));}else{this.content.find("#nvt_email").bind("click",this.addAlertsAddModalClosure("EMAIL","HTML"));
this.content.find("#nvt_phone").bind("click",this.addAlertsAddModalClosure("PHONE","LAND"));this.content.find("#nvt_text").bind("click",this.addAlertsAddModalClosure("PHONE","MOBILE"));
}}if(C){this.postInit(C);}},addAlertsClosure:function(B,A,D){var C=function(E){tabs.clickTab(null,i18n.hAlerts,true);
};return C;},addAlertsAddModalClosure:function(C,A,G){var E=this.metroId;var B=commonData.pageType;if(typeof (this.commuteId)!="undefined"&&this.commuteId!=null&&this.commuteId!=""){var D=commonData.appServerName+"/controller/showAlerts?metroId="+E+"&type="+C+"&subtype="+A+"&commuteId="+this.commuteId+"&pageType="+B;
}else{var D=commonData.appServerName+"/controller/showKRAlerts?metroId="+E+"&krId="+this.krId+"&type="+C+"&subtype="+A+"&pageType="+B;
}var F=function(J){var H=i18n.addAlert;var I={"height":9000,"width":620};var K=H;if(!Nvt.Util.isLoggedIn()){I={"height":175,"width":600};
K=i18n.signIn;}new Nvt.Widget.Modal(false,{"dimensions":I,"href":D,"id":"AddEditAlert","noBind":true,"title":K});
document.nvtModalManager.toggle("AddEditAlert");};return F;},postInit:function(C){var E=C.EMAIL?C.EMAIL:0;
var B=C.PHONE?C.PHONE:0;var D=C.SMS?C.SMS:0;var A=parseInt(E)+parseInt(B)+parseInt(D);this.content.find("h1").html(i18n.yourTrafficAlerts);
this.content.find("h2").html(i18n.youHave+" "+A+" "+i18n.alert+this.appendPlural(A)+" "+i18n.forThisDrive);
this.content.find("#nvt_email").html(this.deviceStringFormatter(i18n.emailText,E));this.content.find("#nvt_emailAddLink").html("("+i18n.addAlert+")");
this.content.find("#nvt_phone").html(this.deviceStringFormatter(i18n.phoneText,B));this.content.find("#nvt_phoneAddLink").html("("+i18n.addAlert+")");
this.content.find("#nvt_text").html(this.deviceStringFormatter(i18n.textText,D));this.content.find("#nvt_textAddLink").html("("+i18n.addAlert+")");
if(this.metroId!=""){this.content.find("#nvt_email").bind("click",this.addAlertsClosure("EMAIL","HTML",E));
this.content.find("#nvt_emailAddLink").bind("click",this.addAlertsAddModalClosure("EMAIL","HTML",E));
this.content.find("#nvt_phone").bind("click",this.addAlertsClosure("PHONE","LAND",B));this.content.find("#nvt_phoneAddLink").bind("click",this.addAlertsAddModalClosure("PHONE","LAND",B));
this.content.find("#nvt_text").bind("click",this.addAlertsClosure("PHONE","MOBILE",D));this.content.find("#nvt_textAddLink").bind("click",this.addAlertsAddModalClosure("PHONE","MOBILE",D));
}else{this.content.find("li").click(function(){alert("This feature is not yet implemented.  Look for it in a future milestone.");
});}},deviceStringFormatter:function(B,C){var A=C+" "+B+" "+i18n.alert+this.appendPlural(C);return(A);
},deviceStringFormatterOriginal:function(B,C){var A=C+" "+B+" "+i18n.alert+this.appendPlural(C)+" ";if(C>1){A+="("+i18n.viewAlerts+")";
}else{if(C==1){A+="("+i18n.editAlert+")";}else{A+="("+i18n.addAlerts+")";}}return(A);},appendPlural:function(A){return(A>1||A==0?i18n.pluralS:"");
},CLASS_NAME:"Nvt.Widget.AlertActionWidget"};Object.extend(Nvt.Widget.AlertActionWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.AlertActionWidget.prototype.display=function(A){nQ("#"+A).append(this.content);this.finalExecution();
};Nvt.Widget.TabWidget=Class.create();Nvt.Widget.TabWidget.prototype={initialize:function(A){this.initializeWidget();
this.ulId=A;this.ul=nQ('<ul id="'+A+'"></ul>');nQ(this.DOM).append(this.ul);this.tabCounter=0;this.tabMap={};
document.widgetManager.setTabWidget(this);},addTab:function(E,D,C){this.tabCounter++;var G=this.id+"_tab"+this.tabCounter;
var A=nQ('<li id="'+G+'" class="nvt_tab nvt_analytics"><a>'+E+"</a></li>");A.click(this.clickTab.bind(this));
if(C){A.click(C);}this.ul.append(A);this.tabMap[E]=G;var B=this.id+"_tab"+this.tabCounter+"_content";
var F=nQ('<div id="'+B+'" class="nvt_tabContents" style="display:none;"></div>');nQ(this.DOM).append(F);
if(D){D.display(B);}this.pos;return B;},addWidgetToTab:function(A,B){$(A).appendChild(B.DOM);},clickTab:function(B,D,A){if(B){var C=Event.element(B).id;
}else{var C=this.tabMap[D];}if(!C){C=Event.element(B).ancestors()[0].id;}if(!A){this.setPageTitle(nQ("#"+C+" > a").html()+" :: "+i18n.trafficDotCom);
}nQ("#"+this.id+" div.nvt_tabContents").hide();nQ("#"+C+"_content").show();nQ("#"+this.id+" .nvt_tab").removeClass("nvt_selected").addClass("nvt_notSelected");
nQ("#"+this.ulId).removeClass("nvt_firstSelected nvt_middleSelected nvt_lastSelected");nQ("#"+C).addClass("nvt_selected").removeClass("nvt_notSelected");
if(!A&&typeof (document.widgetManager.getSlideWidget())!="undefined"){document.widgetManager.getSlideWidget().resetSlider();
}this.handleSelectedTab();if(document.widgetManager.getSlideWidget()&&!A){document.widgetManager.getSlideWidget().animateHeight();
}resetWidth();},postDisplay:function(){nQ("#"+this.id+" .nvt_tabContents:first").css("display","block");
this.handleSelectedTab();this.finalExecution();},handleSelectedTab:function(){if(!nQ("#"+this.id+" .nvt_tab").hasClass("nvt_selected")){nQ("#"+this.ulId+" .nvt_tab:first").addClass("nvt_selected");
nQ("#"+this.ulId+" .nvt_tab:not(:first)").addClass("nvt_notSelected");}var B=nQ("#"+this.ulId);var D=nQ("#"+this.id+" .nvt_tab:first").addClass("nvt_first");
if(D.hasClass("nvt_selected")){B.addClass("nvt_firstSelected");}var C=nQ("#"+this.id+" .nvt_tab:last").addClass("nvt_last");
if(C.hasClass("nvt_selected")){B.addClass("nvt_lastSelected");}var A=nQ("#"+this.id+" .nvt_tab:not(.nvt_tab:last):not(.nvt_tab:first)").addClass("nvt_middle");
if(A.hasClass("nvt_selected")){B.addClass("nvt_middleSelected");}},CLASS_NAME:"Nvt.Widget.TabWidget"};
Object.extend(Nvt.Widget.TabWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.RoutingDisambiguationWidget=Class.create();
Nvt.Widget.RoutingDisambiguationWidget.prototype={initialize:function(D,B,A,C){this.initializeWidget();
this.geocodeResponses=D;this.resultsDivId=A;this.searchString=B;this.renderer=this.buildGeoLocationResultObj.bind(this);
this.type=C;this.resultsDivJQ=nQ("<div class='nvt_routingDisambiguation'></div>");this.disambiguate(this.geocodeResponses,this.searchString,this.resultsDivJQ,this.renderer);
this.DOM.appendChild(this.resultsDivJQ[0]);},disambiguate:function(D,M,C,G){var B=nQ("<div></div>").attr("class","nvt_selected");
var N="nvt_driveStart";if(this.type=="B"){N="nvt_driveEnd";}var F="";var I=i18n.weReSorryButWeWereNotAbleToFindColon;
F+="<h2 class='nvt_error'>"+I+'&nbsp;<span class="nvt_userEnteredData">'+M+"</span></h2>";var E=nQ(F);
B.append(E);C.append(B);if(D.length>1){var L=nQ("<h2 class='nvt_error'>"+i18n.didYouMeanColon+"</h2>");
C.append(L);var J=nQ("<ul></ul>").attr("class","nvt_striped");J.attr("id","nvt_roadList"+this.type);for(var A=0;
A<D.length;A++){var H=document.createElement("li");var K=G(D[A]);H.appendChild(K[0]);J.append(H);}C.append(J);
}else{var L=nQ("<h2 class='nvt_error'>"+i18n.pleaseTryAnotherAddress+"</h2>");C.append(L);}},postDisplay:function(){Nvt.Util.zebraStripe();
this.cleanUp();this.finalExecution();},buildGeoLocationResultObj:function(D){var C=Nvt.MapTp.RouteManagerHtml.getDescriptionsFromGeocodeResponse(D);
var E=C.DisplayDescription;var B=(nQ('<a href="#" class="nvt_roadLink">'+E.strip()+"</a>"));var A=this.clickEvent.bind(this,C);
B.click(A);return B;},clickEvent:function(B){console.log(B);var A=this.type;nQ("#"+this.resultsDivId).empty();
nQ("#"+this.resultsDivId).html("");var C=new Nvt.Data.Coordinate();C.setCoordsInMinutes(B.Latitude,B.Longitude);
saveAddressAndCoordinate(B.DisplayDescription,C);$("nvt_point"+A).value=B.DisplayDescription;$("nvt_point"+A+"FullValue").value=B.FullDescription;
getRoutes();},CLASS_NAME:"Nvt.Widget.RoutingDisambiguationWidget"};Object.extend(Nvt.Widget.RoutingDisambiguationWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.Map=Class.create();Nvt.Widget.Map.prototype={initialize:function(B,A){this.initializeWidget();
this.options={};this.metroId=B;if(B==null){alert(i18n.passInmetroId);}this.theTrafficMap=null;this.registeredCallback=null;
this.registeredMetroChangeCallback=null;this.workspace=A;Nvt.Core.RefreshManager.getInstance().setMap(this);
nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.options=null;this.theTrafficMap=null;
this.registeredCallback=null;this.registeredMetroChangeCallback=null;this.workspace=null;},registerCallback:function(A){this.registeredCallback=A;
if(this.theTrafficMap!=null){this.theTrafficMap.registeredCallback=A;}},registerMetroChangeCallback:function(A){this.registeredMetroChangeCallback=A;
if(this.theTrafficMap!=null){this.theTrafficMap.registeredMetroChangeCallback=A;}},drawKeyRoute:function(A){},zoomToMetroId:function(E){if(!restMetros){throw"restMetros not loaded.  Cannot zoom to metro id.";
}var D=restMetros.presentationObjects.metros;var A=new Nvt.Data.Coordinate();var C=new Nvt.Data.Coordinate();
for(i=0;i<D.length;i++){var B=D[i];if(B.metroId==E){A.setCoords(parseFloat(B.boundingBox.latNW),parseFloat(B.boundingBox.longNW));
C.setCoords(parseFloat(B.boundingBox.latSE),parseFloat(B.boundingBox.longSE));this.zoomToBounds(A,C);
break;}}},zoomToBounds:function(B,D){Nvt.console.debug("Map.zoomToBounds");var E="";isMapClientReady=this.theTrafficMap.isMapClientReady;
var A=this.theTrafficMap;var C=function(){Nvt.console.log("Map.zoomToBounds.startZoom");isMapClientReady=A.isMapClientReady;
if(isMapClientReady){clearInterval(E);A.zoomToBounds(B,D);}};if(isMapClientReady){A.zoomToBounds(B,D);
}else{E=setInterval(C,750);}},zoomToLatLong:function(A,B){this.theTrafficMap.zoomToLatLong(A,B);},setMapState:function(A){Nvt.Util.logMapState(A,"setMapState on Map.js");
if(A&&A.isValid()){this.zoomToBounds(A.boundingBox.NWCoordinate,A.boundingBox.SECoordinate);}},turnOnFilterButtonCategory:function(A){itemType=Nvt.MapTp.Common.incident;
if(A==Nvt.Widget.TrafficItemConstants.CONSTRUCTION){itemType=Nvt.MapTp.Common.roadwork;}else{if(A==Nvt.Widget.TrafficItemConstants.EVENT){itemType=Nvt.MapTp.Common.event;
}else{if(A==Nvt.Widget.TrafficItemConstants.MASSTRANSIT){itemType=Nvt.MapTp.Common.masstransit;}}}if(this.theTrafficMap!=null){this.theTrafficMap.turnOnFilterButtonCategory(itemType);
}},popUpTrafficItem:function(A){this.theTrafficMap.popUpTrafficItem(A);},popUpGeoLocation:function(B){isMapClientReady=this.theTrafficMap.isMapClientReady;
var D;var A=this.theTrafficMap;var C=function(){isMapClientReady=A.isMapClientReady;if(isMapClientReady){clearInterval(D);
A.popUpGeoLocation(B);}};if(isMapClientReady){A.popUpGeoLocation(B);}else{D=setInterval(C,750);}},clearPopUpGeoLocation:function(){if(this.theTrafficMap!=null){this.theTrafficMap.clearPopUpGeoLocation();
}},popUpMetro:function(A){isMapClientReady=this.theTrafficMap.isMapClientReady;var B=this.theTrafficMap;
var C=function(){isMapClientReady=B.isMapClientReady;if(isMapClientReady){clearInterval(intervalHandle);
B.popUpMetro(A);}};if(isMapClientReady){B.popUpMetro(A);}else{intervalHandle=setInterval(C,750);}},clearPopUpMetro:function(){if(this.theTrafficMap!=null){this.theTrafficMap.clearPopUpMetro();
}},getCurrentMapState:function(){if(this.theTrafficMap!=null){Nvt.Util.logMapState(this.theTrafficMap.currentMapState,"getCurrentMapState on Map.js");
return this.theTrafficMap.currentMapState;}return null;},resize:function(A,B){if(this.theTrafficMap!=null){this.theTrafficMap.resize(A,B);
}},refreshCallback:function(E){var C=false;if(isNaN(E)){C=true;}this.theTrafficMap.refreshData(C);if(C==true&&typeof (commonData.pageType)!="undefined"&&commonData.pageType=="routing"){if($F("nvt_pointA")&&i18n.addressCityStateZIP!=$F("nvt_pointA")&&$F("nvt_pointB")&&i18n.addressCityStateZIP!=$F("nvt_pointB")){var D="";
var B=this.theTrafficMap.metroLoaderWrapper;var A=function(){if(B!=null&&B.dataLoadComplete==true){clearInterval(D);
getRoutes();}};if(B!=null&&B.dataLoadComplete==true){getRoutes();}else{D=setInterval(A,150);}}}},adDisplayComplete:function(){var C="";
var B=this.theTrafficMap;var A=function(){if(B!=null){clearInterval(C);B.setAdDisplayCompleted();}};if(B!=null){B.setAdDisplayCompleted();
}else{C=setInterval(A,1000);}},hideMap:function(){this.theTrafficMap.hideMap();},showMap:function(){this.theTrafficMap.showMap();
},setModalDisplay:function(A){this.theTrafficMap.modalDisplay=A;},getVisibleClient:function(){return this.theTrafficMap.visibleClient;
},CLASS_NAME:"Nvt.Widget.Map"};Object.extend(Nvt.Widget.Map.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.Map.prototype.display=function(A){this.options.mapDivId=A;this.options.registeredCallback=this.registeredCallback;
this.options.registeredMetroChangeCallback=this.registeredMetroChangeCallback;this.theTrafficMap=new Nvt.MapTp.TrafficMap(this.metroId,this.options,this.workspace);
this.finalExecution();};Nvt.Widget.Map.METRO_WORKSPACE="traffic_com_metro";Nvt.Widget.Map.MYTRAFFIC_WORKSPACE="traffic_com_mytraffic",Nvt.Widget.Map.ROUTING_WORKSPACE="traffic_com_routing";
Nvt.Widget.AlertTickerWidget=Class.create();Nvt.Widget.AlertTickerWidget.prototype={initialize:function(D,B,A,F,E,C){this.initializeWidget();
this.popUp=B;this.metroId=F;this.metroName=E;this.hideWhenNoAlerts=C;this.hasSpinner=false;this.data=D;
if(this.data&&!this.data.thrown){this.metroId=this.data.metros[0].metroId;this.metroName=this.data.metros[0].metroName;
}if(A&&"metro"==A){this.onMetroWorkspace=true;}},handleData:function(B){marqueeWrapper=nQ('<div class="nvt_marqueeWrapper"></div>');
var G=metroSummary;if(B){G=B;}if(!G.metroSummary){this.DOM.innerHTML='<h1 class="nvt_error">'+i18n.restAPIFailureMessage+"</h1>";
return ;}var E=new Array();for(i=0;i<G.metroSummary.length;i++){for(j=0;j<G.metroSummary[i].alertsList.length;
j++){E.push(G.metroSummary[i].alertsList[j]);}if(G.metroSummary[i].severeTrafficItemsList){for(x=0;x<G.metroSummary[i].severeTrafficItemsList.length;
x++){E.push(G.metroSummary[i].severeTrafficItemsList[x]);}}}var H="";if(E.length>0){H='<marquee behavior="scroll" scrollamount="1" direction="left" loop="3"><a>';
for(p=0;p<E.length;p++){H+="<strong>"+Nvt.Util.cap1stLetters(E[p].headerDesc)+"</strong> "+E[p].locationName+" - "+E[p].description+" | ";
}H+="</a></marquee>";}else{if(this.hideWhenNoAlerts){this.DOM.innerHTML="";return ;}H="<div>"+i18n.forUpToDateTrafficCall+"</div>";
marqueeWrapper=nQ("<div></div>");}marquee=nQ(H);marqueeWrapper.append(marquee);marqueeWrapper.css("left",marqueeWrapper.parent().width());
nQ(this.DOM).append(marqueeWrapper);var F=nQ('<div id="nvt_alertTable" style="display: none;"></div>');
var C='<table id="nvt_alertTickerTable" class="nvt_striped nvt_modalAlertTable">';var D="<thead><tr><th>Type</th><th>Description</th></tr></thead>";
D+="<tbody>";for(x=0;x<E.length;x++){var I="";if(x==0){I="nvt_first";}D+='<tr class="'+I+'">';D+='<td class="nvt_modalCol1">'+Nvt.Util.cap1stLetters(E[x].headerDesc)+"</td>";
D+='<td class="nvt_modalCol2">'+E[x].description+"</td>";D+="</tr>";}D+="</tbody></table>";var A=nQ(C+D);
F.append(A);nQ(this.DOM).append(F);if(this.popUp){this.popup();}this.finalExecution();if(E.length>0){marquee.marquee().mouseover(function(){nQ(this).trigger("stop");
}).mouseout(function(){nQ(this).trigger("start");}).mousemove(function(J){if(nQ(this).data("drag")==true){this.scrollLeft=nQ(this).data("scrollX")+(nQ(this).data("x")-J.clientX);
}}).mousedown(function(J){nQ(this).data("drag",true).data("x",J.clientX).data("scrollX",this.scrollLeft);
}).mouseup(function(){nQ(this).data("drag",false);}).bind("end",function(J){nQ(this).html("<a>"+i18n.clickHereToViewAlerts+"</a>");
}).attr("title","Click here for breaking traffic news.");}},popup:function(){var A=this.metroName;Nvt.Core.NvtAnalytics.virtual("/virtual/click/AlertTicker/AreaAlerts");
new Nvt.Widget.Modal(false,{"dimensions":{"width":600,"height":600},"href":"#nvt_alertTable","id":"nvt_alertTicker","noBind":true,"title":Nvt.Util.cap1stLetters(A)+" "+i18n.areaAlerts});
document.nvtModalManager.toggle("nvt_alertTicker");},postDisplay:function(){var A=function(){if(!this.onMetroWorkspace){window.location.href="../controller/workspace/"+this.metroName+"?showAlerts=true";
}else{this.popup();}};nQ("#"+this.id).click(A.bind(this));if(this.data){this.handleData(this.data);}else{this.loadData(commonData.restServerName+"/metroSummary?metroId="+this.metroId+"&dataset=all&var=metroSummary",this.handleData.bind(this));
}},refreshCallback:function(B,A){if(B){this.metroId=B;}this.data=null;this.redisplay();},CLASS_NAME:"Nvt.Widget.AlertTickerWidget"};
Object.extend(Nvt.Widget.AlertTickerWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.LeaveBehindAdWidget=Class.create();
Nvt.Widget.LeaveBehindAdWidget.prototype={initialize:function(A,B){this.initializeWidget();this.adContainer=nQ("#"+A);
this.adContainerParent=this.adContainer.parent();this.ad=this.adContainer.find("div");this.leaveBehind=nQ("#"+B);
},animate:function(A,B){if(!B){B=3000;}this.animationTime=B;nQ("#nvt_map").css("margin-left",-10000);
trafficMap.adDisplayComplete();if(this.checkForAd()==true){runFunc=this.run.bind(this);setTimeout("runFunc()",A);
}},run:function(){var G=null;var H=this.adContainer;var E=function(){if(trafficMap.theTrafficMap.currentlyDisplayedMap!=null){if(G!=null){clearInterval(G);
}H.remove();nQ("#nvt_map").css("margin-left",0);}};if(trafficMap.theTrafficMap.currentlyDisplayedMap!=null){E();
}else{G=setInterval(E,80);}return ;var A=this.ad.offset();var D=this.adContainerParent.offset();var B=this.leaveBehind.offset();
var F={"left":A["left"]-D["left"],"top":A["top"]-D["top"]};this.adContainer.css({"border-color":"#000","border-style":"solid","border-width":"1px","height":this.ad.height(),"width":this.ad.width(),"left":F["left"],"top":F["top"],"padding":"0px","margin":"0px"});
var C=this.adContainer.find("iframe");if(C[0]){C.remove();}var H=this.adContainer;this.adContainer.animate({left:B["left"]-A["left"]+F["left"],top:B["top"]-A["top"]+F["top"],width:this.leaveBehind.width(),height:this.leaveBehind.height()},this.animationTime,function(){H.remove();
});},checkForAd:function(A){return true;if(!A){A=0;}if(this.adContainer.find("iframe")[0].contentWindow.document.body){return true;
}else{A++;if(A<5){return setTimeout(this.checkForAd.bind(this,A),1000);}else{return false;}}},CLASS_NAME:"Nvt.Widget.LeaveBehindAdWidget"};
Object.extend(Nvt.Widget.LeaveBehindAdWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.ChildKeyRouteWidget=Class.create();
Nvt.Widget.ChildKeyRouteWidget.prototype={initialize:function(C,B,E,D,A){this.initializeWidget();this.metroId=D;
this.childKRId=E;this.animate=A;this.url=commonData.restServerName+"/roads?var=parentKR&filter=parent&dataset=all&sortby=driveReport.jamFactor.jamFactor&metroId="+this.metroId+"&roadList=";
this.parentKRId=(C!=null)?C.id:B;if(C!=null&&Nvt.Util.isValid(C)){this.postInit(C);}else{this.makeRestCall();
}},makeRestCall:function(){var A=this.url+this.parentKRId;Nvt.console.log("url = "+A);this.loadData(A,this.postInit.bind(this));
},postInit:function(A){if(A){this.parentDTO=A;}else{this.parentDTO=parentKR.presentationObjects.roads[0];
}this.dto=this.getChildDTO();if(trafficMap&&!this.redisplaying){trafficMap.setMapState(Nvt.Util.roadToMapState(this.dto));
}this.createChildKRData();this.cleanUp();},getChildDTO:function(){var B=this.parentDTO.children.length;
for(var A=0;A<B;A++){if(this.parentDTO.children[A].id==this.childKRId){return this.parentDTO.children[A];
}}},createChildKRData:function(){this.pageTitle=this.dto.name+" - "+Nvt.Util.scrubBound(this.dto.direction)+": "+Nvt.I18N.resolveString("roadsFromTo",new Array(this.dto.startPointName,this.dto.endPointName))+" :: "+i18n.trafficDotCom;
this.setPageTitle(this.pageTitle);var C=nQ('<div class="nvt_roadName"><span class="nvt_roadSignAndNumber nvt_'+this.dto.roadType+'">'+this.dto.signText1+"</span></div>");
var B=nQ('<div class="nvt_roadInfo" id="nvt_childKRDetails"><h1 class="nvt_bold_text">'+this.dto.name+" - "+Nvt.Util.scrubBound(this.dto.direction)+"</h1></div>");
var O=this.dto.parentId;var J=this.metroId;var A=this.dto.siblingId;var K=this.parentDTO.siblingId;var M=nQ('<span class="nvt_roadLinks"></span>');
var D=nQ("<span> | </span>");var G=nQ("<span> | </span>");var F=nQ("<a onclick=\"Nvt.Util.bookmark('"+commonData.appServerName+"/controller/workspace?krId="+this.dto.id+"&krPId="+O+"', '"+this.dto.name+"');\">"+i18n.bookmarkRoad+"</a>");
B.append(this.getSiblingList()).append(M);M.append(this.getFullRoadLink(O,J)).append(D).append(this.getReverseRoadLink(K,A,J)).append(G).append(F);
C.append(B);var Q=nQ('<table class="nvt_roadDetails"></table>');var S=Nvt.Util.getJFImageString(this.dto.driveReport.jamFactor);
var H=nQ("<tr><th>"+i18n.jamFactorColon+'</th><td><div class="nvt_jamFactor nvt_jamFactor'+Nvt.Util.getJFClass(this.dto.driveReport.jamFactor)+'"><img src="'+commonData.staticServer(S)+i18n.imagesPath+i18n.imagesPathJamfactor+S+'" /></div></td></tr>');
Q.append(H);Q.append(this.getTrafficReportAttributeTR(i18n.currentDriveTimeColon,Nvt.Util.parseTimeToHoursAndMinutes(this.dto.driveReport.driveTime)));
Q.append(this.getTrafficReportAttributeTR(i18n.atSpeedLimitColon,Nvt.Util.parseTimeToHoursAndMinutes(this.dto.driveReport.driveTime-this.dto.driveReport.delay)));
Q.append(this.getTrafficReportAttributeTR(i18n.delayColon,Nvt.Util.parseTimeToHoursAndMinutes(this.dto.driveReport.delay)));
Q.append(this.getTrafficReportAttributeTR(i18n.averageSpeedColon,Nvt.Util.parseAverageSpeed(this.dto.driveReport.averageSpeed)));
this.DOM.appendChild(C[0]);this.DOM.appendChild(Q[0]);var R=new Nvt.Widget.AlertActionWidget(null,this.metroId,null,this.childKRId);
R.display(this.id);var I=false;if(this.dto.driveReport.trafficItems.length>0){I=true;}this.DOM.appendChild(Nvt.Util.getTableAd(i18n.moreDetailsBelow,I)[0]);
this.displayId=this.id;if(this.dto.driveReport&&this.dto.driveReport.trafficItems&&this.dto.driveReport.trafficItems.length>0){var E=["itemType","headerDesc","description"];
var N=new Nvt.Formatter.TrafficItemFormatter(E);this.dto.driveReport.trafficItems=Nvt.Util.addCritSort(this.dto.driveReport.trafficItems);
var Q=new Nvt.Widget.TableWidget(N,this.dto.driveReport.trafficItems,null,null,false);Q.parentWidgetName="Nvt.Widget.ChildKeyRouteWidget";
Q.display(this.displayId);}var P=nQ("<ul id='nvt_sectionLinks'></ul>");if(this.dto.previousSibling&&this.dto.previousSibling!=""){P.append(this.getSectionLink(i18n.previousSection,this.dto.previousSibling.startPointName,this.dto.previousSibling.endPointName,this.dto.parentId,this.dto.previousSibling.id,J));
}if(this.dto.nextSibling&&this.dto.nextSibling!=""){P.append(this.getSectionLink(i18n.nextSection,this.dto.nextSibling.startPointName,this.dto.nextSibling.endPointName,this.dto.parentId,this.dto.nextSibling.id,J));
}this.DOM.appendChild(P[0]);var L={};L.id=this.dto.id;L.parentId=this.dto.parentId;Nvt.Util.viewedKeyroute(L);
if(!this.redisplaying){document.widgetManager.getSlideWidget().toggleDisplay(this.id);document.widgetManager.getSlideWidget().animateSlider(0,this.animate);
}},getFullRoadLink:function(C,B){var A=nQ("<a href='javascript: void(0);'>"+i18n.fullRoad+"</a>");A.click(function(){var D=new Nvt.Widget.ParentKeyRouteWidget(null,C,B,true);
document.widgetManager.getSlideWidget().push(D,null);});return A;},getReverseRoadLink:function(B,C,D){var A=nQ("<a href='javascript: void(0);'>"+i18n.reverseDirection+"</a>");
A.click(function(){var E=new Nvt.Widget.ChildKeyRouteWidget(null,B,C,D);document.widgetManager.getSlideWidget().push(E,null);
});return A;},getTrafficReportAttributeTR:function(A,B){return nQ("<tr><th>"+A+"</th><td>"+B+"</td></tr>");
},getSectionLink:function(A,B,C,D,G,H){var F=nQ("<li><h3>"+A+"</h3></li>");var E=nQ('<a href="javascript: void(0);">'+B+" "+i18n.cTo+" "+C+"</a>");
E.click(function(){var I=new Nvt.Widget.ChildKeyRouteWidget(null,D,new String(G),H);document.widgetManager.getSlideWidget().push(I,null);
});F.append(E);return F;},getSiblingList:function(){var H=nQ("<select name='siblings'></select>");var G=this.metroId;
var F="";var D="";var J="";if(this.parentDTO.children){for(var C=0;C<this.parentDTO.children.length;C++){var I=this.parentDTO.children[C].startPointName+" "+i18n.cTo+" "+this.parentDTO.children[C].endPointName;
var B="";var A=this.parentDTO.children[C].id;if(this.dto.id==A){B="selected";D=A;J=I;}var E=nQ('<option value="'+A+'" '+B+">"+I+"</option>");
F=this.parentDTO.children[C].parentId;H.append(E);}}else{if(siblingsData.presentationObjects.roads&&siblingsData.presentationObjects.roads.length==0){var I=this.dto.startPointName+" "+i18n.cTo+" "+this.dto.endPointName;
H=nQ("<p>"+I+"</p>");J=I;}}this.backLinkText=i18n.backToColon+" "+J;H.change(function(){var M=this.value;
for(var K=0;K<this.length;K++){if(this[K].value==D){this[K].selected="true";}}var L=new Nvt.Widget.ChildKeyRouteWidget(null,F,M,G);
document.widgetManager.getSlideWidget().push(L,null);});return H;},refreshCallback:function(B,A){if(!B){this.redisplaying=true;
this.makeRestCall();this.redisplay();}},CLASS_NAME:"Nvt.Widget.ChildKeyRouteWidget"};Object.extend(Nvt.Widget.ChildKeyRouteWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.UserDevicesWidget=Class.create();Nvt.Widget.UserDevicesWidget.prototype={initialize:function(C,F,D,A,E){this.initializeWidget();
this.widgets=new Array();this.callback=E;this.metroId=F;if(D&&A){var B=this.getDeviceByType(C,D,A);}this.DOM.appendChild(nQ('<div id="allDevices"></div>')[0]);
C.each(this.addDTO.bind(this));if(!this.phoneFound){this.widgets.push(new Nvt.Widget.UserDeviceWidget(null,this.selectCallback.bind(this),"PHONE","LAND",1,F));
}if(!this.textMessageFound){this.widgets.push(new Nvt.Widget.UserDeviceWidget(null,this.selectCallback.bind(this),"PHONE","MOBILE",1,F));
}this.selectWidget(D,A);},addDTO:function(A){this.widgets.push(new Nvt.Widget.UserDeviceWidget(A,this.selectCallback.bind(this),null,null,null,this.metroId));
if(A.type=="PHONE"){if(A.subType=="LAND"){this.phoneFound=true;}if(A.subType=="MOBILE"){this.textMessageFound=true;
}}},selectCallback:function(A){if(this.boundId){nQ("#"+this.boundId).val(A.id);}if(this.callback){this.callback(A);
}},bindToInput:function(B){this.boundId=B;var A=nQ("#"+B).val();if(A&&A.length>0){this.widgets.each(function(C){C.checkSelectId(A);
});}},selectWidget:function(B,A){this.widgets.each(function(C){if(C.dto.type==B&&C.dto.subType==A){C.select();
}});},getDeviceByType:function(B,D,A){for(var C=0;C<B.length;C++){if(B[C].type==D&&B[C].subType==A&&B[C].status!="DELETED"){return B[C];
}}return null;},postDisplay:function(){var B=nQ(this.DOM);for(var A=0;A<this.widgets.length;A++){B.append(nQ('<div id="device'+A+'"></div>'));
this.widgets[A].display("device"+A);}},CLASS_NAME:"Nvt.Widget.UserDevicesWidget"};Object.extend(Nvt.Widget.UserDevicesWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.SaveDriveWidget=Class.create();Nvt.Widget.SaveDriveWidget.prototype={initialize:function(B,A){Nvt.console.debug(B);
Nvt.console.debug(A);this.initializeWidget();this.startPoint=B[1].startDisplay;this.endPoint=B[1].endDisplay;
this.drive1SerializedCommuteObject=B[1].serializedCommute;this.drive1Saveable=B[1].isSaveable;this.drive1NumVias=B[1].route.Vias.length;
this.drive1Display=B[1].display;this.drive2SerializedCommuteObject=B[2].serializedCommute;this.drive2Saveable=B[2].isSaveable;
this.drive2NumVias=B[2].route.Vias.length;this.drive2Display=B[2].display;this.selectedDrive=A;this.createMarkup();
},createMarkup:function(){var F=nQ("<div id='nvt_buildDriveStep2' class='nvt_buildDriveStep'></div>");
F.append(nQ("<h1 class='nvt_headline'>"+i18n.saveYourDrive+"</h1>"));var P=nQ("<ul id='nvt_drivePoints'></ul>");
P.append(nQ("<li id='nvt_driveStart' class='nvt_bold_text'>"+this.startPoint+"</li>"));P.append(nQ("<li id='nvt_driveEnd' class='nvt_bold_text'>"+this.endPoint+"</li>"));
F.append(P);var L=nQ("<div id='nvt_step1' class='nvt_step'></div>");L.append(nQ("<h2 class='nvt_bold_text'>"+i18n.Step1Colon+"</h2>"));
L.append(nQ("<h3 class='nvt_main_content'>"+i18n.selectTheDrivesYouWantSave+"</h3>"));L.append(nQ("<div id='nvt_step1_error' class='nvt_error'></div>"));
ulDriveDetails=nQ("<ul id='nvt_foundDrives' class='nvt_drive1Selected'></ul>");var A=this;liFastestDriveDetails=nQ("<li id='nvt_drive1' class='nvt_drive' title='"+i18n.fastesDriveWhenTraffic+".'></li>");
liFastestDriveDetails.click(function(){A.driveClick("drive1",A.drive1Saveable);});if(this.drive1NumVias>0){liFastestDriveDetails.append(nQ('<h2 id="nvt_fastestDriveLabel" class="nvt_driveLabel nvt_customLabel"><strong>'+i18n.customDrive+"</strong></h2>"));
}else{liFastestDriveDetails.append(nQ('<h2 id="nvt_fastestDriveLabel" class="nvt_driveLabel"><strong>'+i18n.fastestNow+"</strong></h2>"));
}liFastestDriveDetails.append(this.getDriveDetailsTable(this.drive1Display));ulDriveDetails.append(liFastestDriveDetails);
var B=nQ("<div class='nvt_driveSelect' title='"+i18n.checkThisBoxToSaveDrive1+".'></div>");var O=nQ("<input id='nvt_drive1Checkbox' type='checkbox'/>");
O.click(function(){A.driveClick("drive1",A.drive1Saveable);});B.append(O);B.append(nQ("<label for='nvt_drive1Checkbox'>"+i18n.drive1+"</label>"));
liFastestDriveDetails.append(B);liDirectDriveDetails=nQ("<li id='nvt_drive2' class='nvt_drive'  title='"+i18n.fastesDriveWithoutTraffic+".'>");
liDirectDriveDetails.click(function(){A.driveClick("drive2",A.drive2Saveable);});if(this.drive2NumVias>0){liDirectDriveDetails.append(nQ('<h2 id="nvt_directDriveLabel" class="nvt_driveLabel nvt_customLabel"><strong>'+i18n.customDrive+"</strong></h2>"));
}else{liDirectDriveDetails.append(nQ('<h2 id="nvt_directDriveLabel" class="nvt_driveLabel"><strong>'+i18n.directDrive+"</strong></h2>"));
}liDirectDriveDetails.append(this.getDriveDetailsTable(this.drive2Display));var J=nQ("<div class='nvt_driveSelect' title='"+i18n.checkThisBoxToSaveDrive2+".'></div>");
var N=nQ("<input id='nvt_drive2Checkbox' type='checkbox'/>");N.click(function(){A.driveClick("drive2",A.drive2Saveable);
});J.append(N);J.append(nQ("<label for='nvt_drive2Checkbox'>"+i18n.drive2+"</label>"));liDirectDriveDetails.append(J);
ulDriveDetails.append(liDirectDriveDetails);L.append(ulDriveDetails);L.append(nQ("<p>"+i18n.pleaseNoteWeOnlySaveMajorRoads+"</p>"));
F.append(L);var K=nQ("<div id='nvt_step2' class='nvt_step'></div>");K.append(nQ("<h2 class='nvt_bold_text'>"+i18n.Step2Colon+"</h2>"));
K.append(nQ("<h3 class='nvt_main_content'>"+i18n.nameYourDrives+" "+i18n.max30Characters+"</h3>"));K.append(nQ("<div id='nvt_step2_error' class='nvt_error'></div>"));
var E=nQ("<ul></ul>");var I=this.textFieldKeypress.bind(this);var H="<li title='"+i18n.enterNameForDrive1Here+"'><label for='nvt_drive1Name' id='nvt_drive1NameLabel'>"+i18n.drive1+": </label>";
H+="<input id='nvt_drive1Name' type='text' class='nvt_text' maxlength='30' /></li>";var M=nQ(H);E.append(M);
var D="<li title='"+i18n.enterNameForDrive2Here+"'><label for='nvt_drive2Name' id='nvt_drive2NameLabel' class='nvt_disabled'>"+i18n.drive2+": </label>";
D+="<input id='nvt_drive2Name' type='text' class='nvt_text nvt_disabled' disabled='disabled' maxlength='30' /></li>";
var Q=nQ(D);E.append(Q);K.append(E);F.append(K);var C=nQ("<a href='#' class='nvt_cancel'>"+i18n.buttonCancel+"</a>");
C.click(function(){document.widgetManager.getSlideWidget().pop();return false;});F.append(C);var G=nQ("<a href='#' class='nvt_button'><span class='nvt_buttonLeft'></span><h1>"+i18n.buttonSave+"</h1><span class='nvt_buttonRight'></span></a>");
G.click(function(){A.saveDrives();});F.append(G);this.DOM.appendChild(F[0]);document.saveDriveWidget=this;
},textFieldKeypress:function(C,B){Nvt.console.log(C);Nvt.console.log(B);var A=30;var F=nQ(B);var E=F.find("input");
var D=E.val().trim();Nvt.console.log(D.length);if(D.length>30){nQ("#nvt_step2_error")[0].innerHTML="Drive names are limited to "+A+" characters.";
nQ("#nvt_step2_error").css("display","block");E.val(D.slice(0,A));document.widgetManager.getSlideWidget().animateSlider();
}},driveClick:function(B,A){nQ("#nvt_step1_error")[0].innerHTML="";if(A){this.selectDrive(B);nQ("#nvt_step1_error").css("display","none");
}else{nQ("#nvt_step1_error")[0].innerHTML=i18n.driveCanNotBeSaved;nQ("#nvt_step1_error").css("display","block");
document.widgetManager.getSlideWidget().animateSlider();return false;}},postDisplay:function(){if(this.selectedDrive==1){nQ("#nvt_drive1Checkbox").get(0).checked=false;
nQ("#nvt_drive2Checkbox").get(0).checked=true;}else{nQ("#nvt_drive1Checkbox").get(0).checked=true;nQ("#nvt_drive2Checkbox").get(0).checked=false;
}this.selectDrive("drive1");this.selectDrive("drive2");document.widgetManager.getSlideWidget().toggleDisplay(this.id);
document.widgetManager.getSlideWidget().animateSlider();this.finalExecution();},saveDrives:function(){if(this.getSaveDriveURLData()){var B=this.getSaveDriveURLData();
}else{document.widgetManager.getSlideWidget().animateSlider();return false;}if(Nvt.Util.isLoggedIn()){headerLinks.postDisplay();
var C=document.nvtModalManager;var A=C.modalContainers;Nvt.console.debug(C);Nvt.console.debug(A);if(A&&A.nvt_overlayModal){Nvt.console.debug("hide");
C.hide("nvt_overlayModal");}Nvt.console.debug("Save drive workflow URL data is:");Nvt.console.debug(B);
if(this.hasSpinner){Nvt.console.log("adding spinner");nQ(this.DOM).append(this.spinner);}try{nQ.ajax({type:"POST",url:commonData.appServerName+"/controller/saveDrives",data:B,success:this.postSaveDrives.bind(this)});
}catch(D){Nvt.console.log(D);}}else{new Nvt.Widget.Modal(false,{"dimensions":{"height":235,"width":600},"href":commonData.appServerName+"/controller/notLoggedIn","id":"nvt_notLoggedIn","noBind":true,"title":i18n.myTrafficSignIn});
document.nvtModalManager.toggle("nvt_notLoggedIn");}},getSaveDriveURLData:function(){nQ("#nvt_step2_error")[0].innerHTML="";
nQ("#nvt_step1_error")[0].innerHTML="";var C=nQ("#nvt_drive1Name").get(0).value;var A=nQ("#nvt_drive2Name").get(0).value;
if(nQ("#nvt_drive1Checkbox").attr("checked")&&nQ("#nvt_drive2Checkbox").attr("checked")){if(C!=""&&A!=""){var B={driveList:"drive1,drive2",drive1Name:C,drive1Commute:this.drive1SerializedCommuteObject,drive2Name:A,drive2Commute:this.drive2SerializedCommuteObject};
}else{nQ("#nvt_step2_error")[0].innerHTML=i18n.pleaseEnterNamesForDrive1AndDrive2;nQ("#nvt_step2_error").css("display","block");
document.widgetManager.getSlideWidget().animateSlider();return false;}}else{if(nQ("#nvt_drive1Checkbox").attr("checked")){if(C!=""){var B={driveList:"drive1",drive1Name:C,drive1Commute:this.drive1SerializedCommuteObject};
}else{nQ("#nvt_step2_error")[0].innerHTML=i18n.pleaseEnterTheNamesDrive1;nQ("#nvt_step2_error").css("display","block");
document.widgetManager.getSlideWidget().animateSlider();return false;}}else{if(nQ("#nvt_drive2Checkbox").attr("checked")){if(A!=""){var B={driveList:"drive2",drive2Name:A,drive2Commute:this.drive2SerializedCommuteObject};
}else{nQ("#nvt_step2_error")[0].innerHTML=i18n.pleaseEnterTheNamesDrive2;nQ("#nvt_step2_error").css("display","block");
document.widgetManager.getSlideWidget().animateSlider();return false;}}else{nQ("#nvt_step1_error")[0].innerHTML=i18n.pleaseSelectDriveToSave;
nQ("#nvt_step1_error").css("display","block");document.widgetManager.getSlideWidget().animateSlider();
return false;}}}return B;},postSaveDrives:function(data){var saveDrivesResponse=eval("("+data+")");Nvt.console.debug("Save Drives workflow response JSON is:");
Nvt.console.debug(saveDrivesResponse);var errorMessage="";var unsaved=saveDrivesResponse.unsaved;Nvt.console.debug("unsaved drives are:");
Nvt.console.debug(unsaved);if(unsaved.length>0){if(saveDrivesResponse.limitExceeded=="true"){errorMessage+=i18n.driveLimitExceeded;
}else{errorMessage+=i18n.drivesNotSaved;for(var i=0;i<unsaved.length;i++){if(i==0){errorMessage+=" "+unsaved[i];
}else{errorMessage+=", "+unsaved[i];}}}nQ("#nvt_step1_error")[0].innerHTML=errorMessage;nQ("#nvt_step1_error").css("display","block");
document.widgetManager.getSlideWidget().animateSlider();}else{var saved=saveDrivesResponse.saved;Nvt.console.debug(saved);
var commuteIds=new Array();for(var i=0;i<Object.keys(saved).length;i++){commuteIds[i]=Object.keys(saved)[i];
}Nvt.console.debug("Save Drive Commute Ids:");Nvt.console.debug(commuteIds);var driveNames=new Array();
for(var i=0;i<Object.values(saved).length;i++){driveNames[i]=Object.values(saved)[i];}Nvt.console.debug("Saved drive Names are:");
Nvt.console.debug(driveNames);var nextStepsWidget=new Nvt.Widget.NextStepsWidget(driveNames,commuteIds);
nQ("#nvt_routingResults")[0].innerHTML="";nQ("#nvt_routingResults")[0].appendChild(nextStepsWidget.DOM);
}},getDriveDetailsTable:function(A){var B='<ul class="nvt_routeInfoLabels nvt_routeTabList">';B+='<li class="nvt_driveTime">'+i18n.currentDriveTimeColon+"</li>";
B+="<li>"+i18n.atSpeedLimitColon+"</li>";B+="<li>"+i18n.delayTimeColon+"</li>";B+="<li>"+i18n.averageSpeedColon+"</li>";
B+="<li>"+i18n.distanceColon+"</li>";if(A.viaString&&nQ.trim(A.viaString).length>0){B+='<li class="nvt_viaText">'+i18n.viaColon+"</li>";
}B+="</ul>";B+='<ul class="nvt_routeInfo nvt_routeTabList">';B+="      <li>"+A.trafficBasedTime+"</li>";
B+="      <li>"+A.atSpeedLimitTime+"</li>";B+="      <li>"+A.delayTime+"</li>";B+="      <li>"+A.avgSpeed+"</li>";
B+="      <li>"+A.distance+"</li>";if(A.viaString&&nQ.trim(A.viaString).length>0){B+='<li class="nvt_viaData">'+A.viaString+"</li>";
}B+="</ul>";return B;},selectDrive:function(B){var A=nQ("#nvt_"+B+"Checkbox").attr("checked");if(!A){nQ("#nvt_"+B+"Checkbox").get(0).checked=true;
nQ("#nvt_"+B+"Name").removeAttr("disabled");nQ("#nvt_"+B+"Name").removeClass("nvt_disabled");nQ("#nvt_"+B+"NameLabel").removeClass("nvt_disabled");
}else{nQ("#nvt_"+B+"Checkbox").get(0).checked=false;nQ("#nvt_"+B+"Name").attr("disabled","disabled");
nQ("#nvt_"+B+"Name").addClass("nvt_disabled");nQ("#nvt_"+B+"NameLabel").addClass("nvt_disabled");}if(nQ("#nvt_buildDriveStep2 #nvt_drive1Checkbox").attr("checked")&&!nQ("#nvt_drive2Checkbox").attr("checked")){nQ("#nvt_buildDriveStep2 #nvt_foundDrives").removeClass().addClass("nvt_drive1Selected");
nQ("#nvt_buildDriveStep2 #nvt_drive1").removeClass("nvt_unselected");nQ("#nvt_buildDriveStep2 #nvt_drive2").addClass("nvt_unselected");
}else{if(!nQ("#nvt_drive1Checkbox").attr("checked")&&nQ("#nvt_drive2Checkbox").attr("checked")){nQ("#nvt_buildDriveStep2 #nvt_foundDrives").removeClass().addClass("nvt_drive2Selected");
nQ("#nvt_buildDriveStep2 #nvt_drive1").addClass("nvt_unselected");nQ("#nvt_buildDriveStep2 #nvt_drive2").removeClass("nvt_unselected");
}else{if(nQ("#nvt_drive1Checkbox").attr("checked")&&nQ("#nvt_drive2Checkbox").attr("checked")){nQ("#nvt_buildDriveStep2 #nvt_foundDrives").removeClass().addClass("nvt_bothSelected");
nQ("#nvt_buildDriveStep2 #nvt_drive1").removeClass("nvt_unselected");nQ("#nvt_buildDriveStep2 #nvt_drive2").removeClass("nvt_unselected");
}else{nQ("#nvt_buildDriveStep2 #nvt_foundDrives").removeClass().addClass("nvt_noneSelected");nQ("#nvt_buildDriveStep2 #nvt_drive1").addClass("nvt_unselected");
nQ("#nvt_buildDriveStep2 #nvt_drive2").addClass("nvt_unselected");}}}},CLASS_NAME:"Nvt.Widget.SaveDriveWidget"};
Object.extend(Nvt.Widget.SaveDriveWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.Modal=Class.create();
Nvt.Widget.Modal.prototype={initialize:function(A,D){if(!D){D={};}this.overrides=D;var B=this;this.modals=[];
if(A){nQ(A).each(function(){var G=nQ(this);if(!G.attr("id")){return ;}var E={"id":G.attr("id"),"source":B.getSource(G.attr("href"),D.innerHTML),"target":G.attr("target"),"title":G.attr("title"),"random":G.attr("random")};
for(var F in D){E[F]=D[F];}G.attr("href","javascript: void(0)");G.attr("target","");B.setAttributes(E);
});}else{if(!D.id){return ;}if(D.random){var C=new Date().getTime();D.href+="&random="+C;}D.source=B.getSource(D.href,D.innerHTML);
B.setAttributes(D);}},setAttributes:function(A){if(!A.target){A.target="nvt_overlayModal";}if(typeof (document.nvtModalManager)=="undefined"){document.nvtModalManager=new Nvt.Widget.Modal.Manager();
}document.nvtModalManager.add(A);if(!A.noBind){nQ("#"+A.id).unbind("click").bind("click",function(){document.nvtModalManager.toggle(A.id);
}).bind("click",function(){var B=new Date().getTime();nQ(".nvt_modalContents iframe").attr("src",A.href+"&random="+B);
});}this.modals.push(A.id);},getSource:function(A,C){var B={"type":A.substring(0,1)=="#"?"element":"iframe"};
if(B.type=="iframe"){B.data=nQ('<iframe onload="javascript: document.nvtModalManager.iframeReady()" src="'+A+'" frameborder="0" style="display: inline; border: 0px; height: 100%; width: 100%;"></iframe>');
}else{if(C){B.data=nQ(nQ(A).html());}else{B.data=nQ(A);}}return B;},CLASS_NAME:"Nvt.Widget.Modal"};Object.extend(Nvt.Widget.Modal.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.Modal.Manager=Class.create();Nvt.Widget.Modal.Manager.prototype={initialize:function(A,B){this.modalAttributes={};
this.modalContainers={};this.windowDetails={};this.modal=nQ('<div class="nvt_modalContainer">'+'<div class="nvt_modalOverlay"></div>'+'<div class="nvt_modal">'+'<div class="nvt_modalConfirmCloseContainer">'+'<a class="nvt_modalCancelClose nvt_button red">'+'<span class="nvt_buttonLeft"/>'+"<h1>No</h1>"+'<span class="nvt_buttonRight"/>'+"</a>"+'<a class="nvt_modalConfirmClose nvt_button">'+'<span class="nvt_buttonLeft"/>'+"<h1>Yes</h1>"+'<span class="nvt_buttonRight"/>'+"</a>"+"</div>"+'<div class="nvt_modalTop">'+'<span class="nvt_modalUpArrow"></span>'+'<span class="nvt_modalLeft"></span>'+'<span class="nvt_modalRight"></span>'+"</div>"+'<div class="nvt_modalMiddle">'+'<div class="nvt_modalHeader">'+'<div id="nvt_modalLogo"><img class="nvt_modalHeaderLogo" src="'+commonData.staticServer("header_logo_modal.png")+i18n.imagesPath+i18n.imagesPathModal+'header_logo_modal.png"/></div>'+'<div class="nvt_modalHeaderTitles">'+'<span class="nvt_modalTitle"></span>'+'<span class="nvt_modalSubTitle"></span>'+"</div>"+'<img class="nvt_modalClose" src="'+commonData.staticServer("modalCloseBtn.gif")+i18n.imagesPath+i18n.imagesPathModal+'modalCloseBtn.gif"/>'+"</div>"+'<div class="nvt_modalLoading">'+'<div id="nvt_loader" class="nvt_loader">'+'<span class="nvt_bold_text">Loading</span>'+"</div>"+"</div>"+'<div class="nvt_modalContents">'+"</div>"+'<span class="nvt_modalRight"></span>'+"</div>"+'<div class="nvt_modalBottom">'+'<span class="nvt_modalLeft"></span>'+'<span class="nvt_modalRight"></span>'+"</div>"+"</div>"+"</div>");
nQ().ready(function(){nQ("body").append(nQ('<div id="nvt_modalContentsStorage" style="display: none"></div>'));
});},toggle:function(C){var B=this.modalAttributes[C];var A=this.modalContainers[B.target];if(A.state=="inactive"||A.activeModal!=C){this.setHeader(B,A);
this.setContent(B,A);this.hide(null,true);this.show(B,A);this.setDimensions(B,A);this.center(B,A);}else{this.hide(B.target);
}},show:function(D,A){Nvt.console.log("Nvt.Widget.Modal.Manager.show");var B=this;A.state="active";A.activeModal=D.id;
var C=A.container.find(".nvt_modalOverlay");A.container.find(".nvt_modalUpArrow").css("display","none");
if(D.arrow){A.container.find(".nvt_modalUpArrow").css({"display":"block","left":D.arrow.left});}A.container.find(".nvt_modalLoading").css("display","none");
if(D.target=="nvt_overlayModal"){Nvt.console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ hiding ads");nQ(".atlasAd").hide();
C.css("display","block");if(D.source.type=="iframe"){A.container.find(".nvt_modalLoading").css("display","block");
}else{A.container.find(".nvt_modalLoading").css("display","none");}C.unbind();C.bind("click",function(){A.container.find(".nvt_modalConfirmCloseContainer").fadeIn("slow");
A.container.find(".nvt_modalConfirmCloseContainer").animate({"top":"-40"});});nQ("html").css("overflow","hidden");
nQ("body").find("embed").css("visibility","hidden");nQ("body").find("object").css("visibility","hidden");
nQ("body").find("select").css("visibility","hidden");if(typeof (trafficMap)!="undefined"){if(trafficMap.getVisibleClient()=="applet"){trafficMap.hideMap();
trafficMap.setModalDisplay(true);}nQ("#nvt_map").css("left",-100000000);}A.container.css("display","block");
A.container.addClass("nvt_activeModal");}else{C.css("display","none");A.container.css("position","relative");
A.container.css("display","block");nQ(D.target).fadeIn("slow");nQ(D.target).addClass("nvt_activeModal");
}if(D.target=="nvt_overlayModal"){nQ(window).resize(function(){B.setDimensions(D,A);B.center(D,A);});
}},refreshData:function(A){},iframeReady:function(A,D,C){for(target in this.modalContainers){var B=this.modalContainers[target];
if(B.state=="active"){var E=this.modalAttributes[B.activeModal];if(E.source.type=="iframe"){if(C){this.setDimensions(E,B,{"height":A,"width":D});
this.center(E,B);}B.container.find(".nvt_modalLoading").css("display","none");}}}},hide:function(D,C){var B=this;
nQ(".nvt_activeModal").each(function(){B.hideOne(nQ(this),C);});Nvt.console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ showing ads");
nQ(".atlasAd").show();for(target in this.modalContainers){var A=this.modalContainers[target];A.state="inactive";
A.activeModal="";}},hideOne:function(A,D){var B=this;if(D){A.css("display","none");this.enableObjects();
}else{A.fadeOut("slow",function(){B.enableObjects();});}A.removeClass("nvt_activeModal");if(A.activeModal){var C=this.modalAttributes[A.activeModal];
if(C.source.type=="iframe"){C.source.data.attr("src","");C.source.css("display","none");A.container.find(".nvt_modalContents iframe").remove();
}}nQ("html").css("overflow","");A.state="inactive";A.activeModal="";},enableObjects:function(){nQ("body").find("embed").css("visibility","visible");
nQ("body").find("object").css("visibility","visible");nQ("body").find("select").css("visibility","visible");
if(typeof (trafficMap)!="undefined"){nQ("#nvt_map").css("left",0);if(trafficMap.getVisibleClient()=="applet"){trafficMap.showMap();
trafficMap.setModalDisplay(false);}}if(typeof (trafficMap)!="undefined"){nQ("#nvt_map").css("left",0);
}},displayContextual:function(D,F,A,C){if(!this.contextualModal){this.contextualModal=this.modal.clone(true);
this.contextualModal.css("width","300px");this.contextualModal.find(".nvt_modalConfirmCloseContainer").remove();
this.contextualModal.find(".nvt_modalUpArrow").remove();this.contextualModal.find(".nvt_modalHeader").remove();
this.contextualModal.find(".nvt_modalOverlay").remove();this.contextualModal.find(".nvt_modal").prepend(nQ('<span class="nvt_modalLeftArrow"></span>'));
this.contextualModal.find(".nvt_modal").css({"left":"0px","top":"0px"});this.contextualModal.find(".nvt_modal").addClass("nvt_inPlaceModal");
nQ("body").append(this.contextualModal);}var E={"left":0,"top":0};if(C){for(target in this.modalContainers){var B=this.modalContainers[target];
if(B.state=="active"){E=this.modalAttributes[B.activeModal].source.data.offset();}}}D.triggerHeight=D.triggerHeight?D.triggerHeight:1;
D.triggerWidth=D.triggerWidth?D.triggerWidth:1;this.contextualModal.triggerOffset=D;this.contextualModal.addedOffset=E;
this.contextualModal.height=A;this.contextualModal.find(".nvt_modalContents").css("height",0);this.contextualModal.find(".nvt_modalContents").html(nQ('<iframe onload="document.nvtModalManager.resizeContextual()" scrolling="no" style="visibility: hidden; position: absolute; display: inline; width: 275px;" frameborder="0" src="'+commonData.helpServerName+"/"+F+'?modal=true&contextualModal=true"></iframe>'));
this.contextualModal.find(".nvt_modalLoading").css("display","block");this.contextualModal.css({"display":"block","visibility":"hidden","z-index":3010});
this.contextualModal.find(".nvt_modalLeftArrow").css("top",19);this.contextualModal.css({"left":D.left+E.left+D.triggerWidth+5,"top":D.top+E.top-26+(D.triggerHeight/2),"visibility":"visible"});
},resizeContextual:function(){this.contextualModal.find(".nvt_modalLoading").css("display","none");var C=this.contextualModal.height;
var A=C/2-10;var D=this.contextualModal.triggerOffset.top+this.contextualModal.addedOffset.top-(C/2)+(this.contextualModal.triggerOffset.triggerHeight/2)+5;
var B=nQ("#nvt_container").height();if(D+C>B){A=A+(D+C-B);D=D-(D+C-B);}this.contextualModal.find(".nvt_modal iframe").css({"height":C,"position":"relative","visibility":"visible"});
this.contextualModal.find(".nvt_modalLeftArrow").css("top",A);this.contextualModal.find(".nvt_modalContents").css({"height":C,"padding":"0px"});
this.contextualModal.css({"top":D,"visibility":"visible"});},hideContextual:function(){this.contextualModal.css("display","none");
},setTitle:function(D,C,B){var A=this.modalContainers[D];A.container.find(".nvt_modalTitle").text(" ");
A.container.find(".nvt_modalTitle").text(C);A.container.find(".nvt_modalSubTitle").text(" ");A.container.find(".nvt_modalSubTitle").text(B);
},resize:function(C,A,B){this.setDimensions(C,A);},changeDimensions:function(D,C){var B=this.modalAttributes[D];
var A=this.modalContainers[B.target];this.setDimensions(B,A,C);},setDimensions:function(G,B,D){var F=G.source.data;
var E={"calculated":{},"container":{},"content":{},"header":{},"padding":{}};E.override=D?D:G.dimensions;
E.override=E.override?E.override:{};E.padding={"height":B.container.find(".nvt_modalHeader").height()+20,"width":18};
if(G.target!="nvt_overlayModal"){var A=nQ(G.target);E.container=E.override;}else{E.container={"height":document.viewport.getHeight(),"width":document.viewport.getWidth()};
B.container.css({"height":E.container.height,"width":E.container.width});B.container.find(".nvt_modalOverlay").css({"height":E.container.height,"width":E.container.width});
E.container.height-=100;E.container.width-=80;}E.override.height=E.override.height?E.override.height:E.container.height;
E.override.width=E.override.width?E.override.width:E.container.width;E.calculated={"height":this.maxSize(E.override.height,E.padding.height,E.container.height),"width":this.maxSize(E.override.width,E.padding.width,E.container.width)};
E.calculated.width=E.calculated.width<300?300:E.calculated.width;var C=B.container.find(".nvt_modal");
C.css("height",E.calculated.height+E.padding.height);C.find(".nvt_modalContents").css("height",E.calculated.height);
C.css("width",E.calculated.width+E.padding.width);},maxSize:function(A,B,C){if(B+A>C){return C-B;}else{return A;
}},center:function(B,A){var C=A.container.find(".nvt_modal");if(B.target!="nvt_overlayModal"){C.css({"top":"0px","left":"0px"});
}else{A.container.css({"top":nQ(window).scrollTop(),"left":nQ(window).scrollLeft()});C.css({"margin-top":-C.height()/2,"margin-left":-C.width()/2});
}},setContent:function(C,A){var B=A.container.find(".nvt_modalContents");for(var D in this.modalAttributes){this.modalAttributes[D].source.data.css({display:"none",left:"9000px",position:"absolute",top:"0px"});
}B.find("iframe").remove();C.source.data.css({display:"none",left:"0px",position:"relative",top:"0px"});
B.append(C.source.data);if(C.source.type=="iframe"){C.source.data.css("display","inline");}else{C.source.data.fadeIn("slow");
}},setHeader:function(D,A){var B=this;var C={"container":A.container.find(".nvt_modalHeader"),"close":A.container.find(".nvt_modalClose"),"confirmClose":A.container.find(".nvt_modalConfirmCloseContainer")};
A.container.find(".nvt_modal").addClass("nvt_inPlaceModal");if(D.target=="nvt_overlayModal"){A.container.find(".nvt_modal").removeClass("nvt_inPlaceModal");
}if(D.hideHeader){C.container.css("display","none");}else{C.container.css("display","block");if(D.hideClose){C.close.css("display","none");
}else{C.close.css("display","block");}C.confirmClose.css("top","0px");A.container.find(".nvt_modalOverlay").bind("click",function(){C.confirmClose.animate({"top":"-45"});
C.confirmClose.fadeIn();});D.title=D.title?D.title:" ";D.subTitle=D.subTitle?D.subTitle:" ";A.container.find(".nvt_modalTitle").html(D.title);
A.container.find(".nvt_modalSubTitle").html(D.subTitle);}},compareWindowDetails:function(){windowDetails={"height":nQ().height(),"width":nQ().width(),"scrollTop":nQ().scrollTop(),"scrollLeft":nQ().scrollLeft()};
if(this.windowDetails.height!=windowDetails.height||this.windowDetails.width!=windowDetails.width||this.windowDetails.scrollTop!=windowDetails.scrollTop||this.windowDetails.scrollLeft!=windowDetails.scrollLeft){var A=this.modalContainers["nvt_overlayModal"];
var B=this.modalAttributes[A.activeModal];this.resize(B,A);this.center(B,A);this.windowDetails=windowDetails;
}},add:function(A){this.modalAttributes[A.id]=A;if(!this.modalContainers[A.target]||A.refresh){var B={"container":this.buildModal(A.target),"state":"inactive","trigger":""};
if(A.target!="nvt_overlayModal"){nQ(A.target).append(B.container);}else{nQ("body").prepend(B.container);
}this.modalContainers[A.target]=B;}},buildModal:function(C){var A=this;var B=this.modal.clone(true);B.find(".nvt_modalClose").bind("click",function(){A.hide(C);
if(typeof (self.parent.logoncomplete)!="undefined"&&self.parent.logoncomplete==true){self.parent.logoncomplete="";
myURL=commonData.appServerName+"/controller/myTraffic";self.parent.location.href=myURL;}});B.find(".nvt_modalConfirmClose").bind("click",function(){A.hide(C);
});B.find(".nvt_modalCancelClose").bind("click",function(){B.find(".nvt_modalConfirmCloseContainer").animate({"top":"0"});
B.find(".nvt_modalConfirmCloseContainer").fadeOut();});return B;},CLASS_NAME:"Nvt.Widget.Modal.Manager"};
Object.extend(Nvt.Widget.Modal.Manager.prototype,Nvt.Widget.WidgetBase.prototype);NvtModal=Class.create();
NvtModal.prototype={initialize:function(){this.id=Math.floor(Math.random()*300);this.element=nQ('<a href="" id="'+this.id+'" target="" title="" style="display: none"></a>');
nQ("body").append(this.element);this.element.attr("id",this.id);},showDiv:function(A){this.show(A);},showHideDiv:function(A){this.show(A);
},showExtIFrame:function(A){this.show(A);},show:function(A){this.element.attr("href",A);new Nvt.Widget.Modal("#"+this.id,{"dimensions":{"height":this.height,"width":this.width},"title":modal.nvtHeader,"subTitle":modal.nvtSubHeader,"target":this.target});
document.nvtModalManager.toggle(this.id);},deactivate:function(){document.nvtModalManager.deactivate();
this.element.remove();document.modal=null;},CLASS_NAME:"NvtModal"};Object.extend(NvtModal.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.ColumnListWidget=Class.create();Nvt.Widget.ColumnListWidget.prototype={initialize:function(A){this.data=A;
},generateColumns:function(C,B,H){if(C){var G=this.data.sort(function(K,J){return(K[C]>J[C])?1:-1;});
}else{var G=this.data.sort();}if(B){this.columns=B;}if(!H){H=function(J){return"<td>"+J+"</td>";};}var F=new Array();
this.html="<table>";var I=Math.ceil(G.length/this.columns);while(F.length<G.length){for(var E=0;E<I;E++){this.html+="<tr>";
var D=E;for(var A=1;A<=this.columns;A++){if(G[D]){this.html+=H(G[D]);F.push(G[D]);}else{this.html+="<td></td>";
F.push({});}D+=I;}this.html+="</tr>";}}this.html+="</table>";F="";I="";},returnHtml:function(){return this.html;
},CLASS_NAME:"Nvt.Widget.ColumnListWidget"};Object.extend(Nvt.Widget.ColumnListWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.ColumnListWidget.prototype.display=function(A){nQ("#"+A).append(this.html);this.finalExecution();
};Nvt.Widget.HeaderLinksWidget=Class.create();Nvt.Widget.HeaderLinksWidget.prototype={initialize:function(A,B,C){this.initializeWidget();
this.divId=A;this.isHomePage=B;this.isWorkspace=C;document.widgetManager.headerLinks=this;},logout:function(A){this.loadData(commonData.appServerName+"/controller/logout?var=logoutResp",this.logoutResponse.bind(this,A));
},logoutResponse:function(A){if(!A){window.location.href=commonData.appServerName+"/controller/home";
}else{headerLinks.display("nvt_userRegLinks",true);commonData.userCity="";refreshHomePage(true);}},displayNotLoggedIn:function(A){fullDomain="http://"+document.domain;
if(A){this.DOM.innerHTML='<li><a id="nvt_signInLink" class="light_green" onclick="javascript: nQ(\'#errmsg\').html(\' \');">'+i18n.signIn+"</a> |&nbsp;&nbsp;</li><li>"+i18n.newUser+'&nbsp;<a class="light_green" onclick="headerLinks.showSignUp();">'+i18n.signUp+"</a></li>";
}else{if(fullDomain==commonData.appServerName){this.DOM.innerHTML='<li><a class="light_green" onclick="headerLinks.showSignIn();">'+i18n.signIn+"</a> |&nbsp;&nbsp;</li><li>"+i18n.newUser+'&nbsp;<a id="nvt_signUpLink" class="light_green" onclick="headerLinks.showSignUp();">'+i18n.signUp+"</a></li>";
}else{this.DOM.innerHTML='<li><a class="light_green" href="'+commonData.appServerName+'/controller/myTraffic">'+i18n.signIn+"</a> |&nbsp;&nbsp;</li><li>"+i18n.newUser+'&nbsp;<a id="nvt_signUpLink" class="light_green" href="'+commonData.appServerName+'/controller/myTraffic">'+i18n.signUp+"</a></li>";
}}},registerEnterKey:function(A){if(A.keyCode==13){this.submitLogin();}},displayLoggedIn:function(A){this.DOM.innerHTML='<li><a href="'+commonData.appServerName+'/controller/myTraffic?tab=account" id="nvt_username" title="'+i18n.editAccountInformation+'">'+Nvt.Util.getUserName()+"</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>";
if(A){this.DOM.innerHTML+="<li><a class='light_green' href='"+commonData.appServerName+"/controller/myTraffic'>"+i18n.myTraffic+"</a> |&nbsp;&nbsp;</li>";
}this.DOM.innerHTML+="<li><a class='light_green' href='javascript:headerLinks.logout("+A+");'>"+i18n.logout+"</a></li>";
},showSignIn:function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":175,"width":600},"href":commonData.appServerName+"/controller/notLoggedIn","id":"nvt_signInLinkOverlay","noBind":true,"title":i18n.myTrafficSignIn});
document.nvtModalManager.toggle("nvt_signInLinkOverlay");},showSignUp:function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":590,"width":570},"href":commonData.appServerName+"/controller/showCreateAccount?metroId="+metro_id,"id":"nvt_signUpLink","noBind":true,"title":i18n.signUp});
document.nvtModalManager.toggle("nvt_signUpLink");},showForgotPassword:function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":130,"width":600},"href":commonData.appServerName+"/controller/dispatch?jspName=userregistration/forgotPassword","id":"nvt_forgotPassword","title":i18n.resetYourPassword});
document.nvtModalManager.toggle("nvt_forgotPassword");},submitLogin:function(){nQ("#errmsg").html("");
var B=commonData.secureServerName+"/controller/doLogin?";if(document.trafficlogin.rememberMe.checked){document.trafficlogin.rememberMe.value="checked";
}for(var C=0;C<document.trafficlogin.elements.length;C++){B+=document.trafficlogin.elements[C].name+"=";
B+=document.trafficlogin.elements[C].value+"&";}var A={method:"get",onComplete:this.handleLoginResponse.bind(this),onException:this.handleLoginError.bind(this)};
var D=nQ.getScript(B,this.handleLoginResponse.bind(this));},handleLoginResponse:function(A){this.handleLoginError(loginResponse);
if(Nvt.Util.isLoggedIn()){document.location.href=commonData.appServerName+"/controller/myTraffic";}},handleLoginError:function(){if(loginResponse.ERRORMAP&&loginResponse.ERRORMAP.InvalidUsernameOrPassword){nQ("#errmsg").html(loginResponse.ERRORMAP.InvalidUsernameOrPassword);
}document.nvtModalManager.changeDimensions("nvt_signInLink",{"height":190,"width":300});},postDisplay:function(){if(Nvt.Util.isLoggedIn()){this.displayLoggedIn(this.isHomePage);
}else{this.displayNotLoggedIn(this.isHomePage);}nQ("#"+this.divId).html("");nQ("#"+this.divId).append(this.DOM.innerHTML);
if(this.isHomePage&&!Nvt.Util.isLoggedIn()){nQ("#nvt_header").append(nQ('<div id="nvt_signInForm" style="display: none">'+'<span id="errmsg" class="nvt_error"></span>'+'<form name="trafficlogin" method="post" onsubmit=\'return false;\'>'+'<input type="hidden" name="var" value="loginResponse">'+"<table>"+"<tr>"+'<td><label for="username">'+i18n.loginpageUsername+"</label></td>"+'<td><input type="text" name="username" class="nvt_text" size="20" maxlength="20" id="username" /></td>'+"</tr>"+"<tr>"+'<td><label for="password">'+i18n.loginpagePassword+"</label></td>"+'<td><input type="password" name="password" class="nvt_text" size="20" maxlength="20" id="password" /></td>'+"</tr>"+"<tr>"+"<td></td>"+"<td>"+'<input type="checkbox" name="rememberMe" checked="checked" class="checkbox" id="checkbox" />'+'<label for="checkbox" id="nvt_rememberMeLabel">'+i18n.rememberMe+"</label>"+"</td>"+"</tr>"+"</table>"+"</form>"+'<a id="nvt_login_submit" href="javascript:headerLinks.submitLogin();" style="right: 10px" class="nvt_button">'+'<span class="nvt_buttonLeft"></span>'+"<h1>"+i18n.signIn+"</h1>"+'<span class="nvt_buttonRight"></span>'+"</a>"+'<a id="nvt_login_forgotPass" href="javascript:headerLinks.showForgotPassword();">'+i18n.loginpageForgotPassword+"</a>              "+"</div>"+'<div id="nvt_inPlaceSignIn" style="display: none; position: absolute; left: 420px; top: 30px; z-index: 2997; width: 300px; height: 200px;"></div>'));
new Nvt.Widget.Modal(false,{"arrow":{"left":160},"dimensions":{"height":170,"width":300},"href":"#nvt_signInForm","id":"nvt_signInLink","target":"#nvt_inPlaceSignIn","title":i18n.myTrafficSignIn});
}this.finalExecution(this.divId);nQ("#password").keydown(this.registerEnterKey.bind(this));nQ("#username").keydown(this.registerEnterKey.bind(this));
nQ("#checkbox").keydown(this.registerEnterKey.bind(this));nQ("#nvt_signInLink").click(function(){nQ("#username").focus();
});},refreshCallback:function(){this.postDisplay();},CLASS_NAME:"Nvt.Widget.HeaderLinksWidget"};Object.extend(Nvt.Widget.HeaderLinksWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.UserDeviceWidget=Class.create();Nvt.Widget.UserDeviceWidget.prototype={initialize:function(H,E,D,V,W,K,e){this.initializeWidget();
this.dto=H;if(!this.dto){this.dto={type:D,priority:W,address:"",subType:V,id:"",status:e};}Nvt.console.log(this.dto);
this.callback=E;this.metroId=K;this.wrap=nQ('<div id="device'+this.dto.id+'" class="nvt_device"></div>');
this.DOM.appendChild(this.wrap[0]);var G=nQ("<div></div>");var L=nQ('<input type="radio" name="userDevice" id="radio'+this.dto.id+'" class="'+this.dto.type+'"/>');
this.radio=L;L.click(this.select.bind(this));this.wrap.append(L);this.wrap.append(G);this.wrap=G;this.wrap.append(this.getTypeText(this.dto,"radio"+this.dto.id));
if(this.dto.type=="PHONE"){this.dto.address=Nvt.Util.formatPhone(this.dto.address);}var X=nQ('<span id="address'+this.id+'">'+this.dto.address+"</span>");
this.wrap.append(X);var P=nQ("<a>"+i18n.editText+"</a>");P.click(this.edit.bind(this));var B=nQ("<a>Delete</a>");
B.click(this.askToDelete.bind(this));var U=this.getNewDeviceText(this.dto);var N=nQ("<a>"+(this.dto.id?i18n.addAnother+" "+U:i18n.addA+" "+U)+"</a>");
N.click(this.showAddDevice.bind(this));var S=this.getSample(this.dto);S.click(this.showSample.bind(this));
var M=nQ('<div class="nvt_hideable" id="content'+this.dto.id+'"></div>');M.hide();var R=nQ('<span class="nvt_deviceLinks"></span>');
var Q=nQ('<span class="nvt_pipe">|</span>');var A=nQ('<span class="nvt_pipe">|</span>');var b=nQ('<span class="nvt_pipe">|</span>');
this.wrap.append(R);R.append(P).append(Q).append(B).append(A).append(N).append(b).append(S);if(this.dto.subType=="MOBILE"&&this.dto.status=="UNVERIFIED"){var Z=nQ("<a id='nvt_sendVerificationLink' class='nvt_error'>"+i18n.verifyThisDevice+"</a>"+'<img id="nvt_whyVerifyPhone" onMouseOver="javascript: displayContextual(\'nvt_whyVerifyPhone\', \'why-must-i-verify-my-phone\', 275);" onMouseOut="javascript: hideContextual();" class="nvt_modal_contextualHelp" style="display: inline" src="'+commonData.staticServer("questionMark.gif")+i18n.imagesPath+i18n.imagesPathModal+'questionMark.gif"/>');
Z.click(this.sendVerification.bind(this));this.radio.attr("disabled","disabled");R.append(nQ("<br/>")).append(Z);
}this.wrap.append(M);this.content=M;var J=nQ('<input id="input'+this.id+'"type="text"/ class="nvt_text">');
J.keyup(this.keyPress.bind(this));var T=nQ("<a>"+i18n.saveText+"</a>");T.click(this.saveDevice.bind(this));
M.append(J).append(T);var F=nQ('<div class="nvt_hideable" id="add'+this.dto.id+'"></div>');this.addDiv=F;
F.hide();this.wrap.append(F);var J=nQ('<input type="text"/>');var N=nQ("<a>"+i18n.addText+"</a>");var Y=nQ('<span class="nvt_pipe">|</span>');
var C=nQ("<a>"+i18n.buttonCancel+"</a>");C.click(this.cancelAdd.bind(this));N.click(this.newDevice.bind(this));
F.append(J).append(N).append(Y).append(C);var I=nQ('<div class="nvt_hideable" id="sample'+this.dto.id+'"></div>');
this.sampleDiv=I;I.hide();this.wrap.append(I);var M=nQ('<div class="nvt_sampleAlertWrap"></div>');var O=this.getSampleContent(this.dto);
M.append(O);I.append(M);},cancelAdd:function(){this.addDiv.hide("fast");},checkSelectId:function(A){if(this.dto.id==A){this.select();
}},select:function(){this.radio.attr("checked","checked");if(this.callback){this.callback(this.dto);}if(this.dto.address.length==0){this.edit();
}},edit:function(){this.hideAll();this.content.find("input").val(this.dto.address);this.content.show("fast");
},askToDelete:function(){this.deleteDiv=nQ('<div class="nvt_deleteDevice nvt_hideable"></div>');if(this.dto.type=="EMAIL"&&nQ("input.EMAIL").length==1){var H=nQ('<span class="nvt_error">'+i18n.oneEmailRequired+"</span>");
var D=nQ("<a>"+i18n.closeText+"</a>");var E=function(){this.deleteDiv.remove();};D.click(E.bind(this));
this.deleteDiv.append(H).append(D);this.wrap.append(this.deleteDiv);}else{var A=nQ("<span>"+i18n.areYouSureYouWantToDeleteThisDevice+"</span>");
var G=nQ("<a>"+i18n.noText+"</a>");var F=nQ("<a>"+i18n.yesText+"</a>");var C=nQ('<span class="nvt_pipe">|</span>');
this.deleteDiv.append(A).append(G).append(C).append(F);this.wrap.append(this.deleteDiv);var B=function(){this.deleteDiv.remove();
};G.click(B.bind(this));F.click(this.deleteDevice.bind(this,this.dto.id));}},deleteDevice:function(B){this.dto.address="";
var A=$H(this.dto);A.unset("date");this.loadData(commonData.restServerName+"/updateDevice?var=dev&"+A.toQueryString(),this.deleteDeviceResponse.bind(this));
},showAddDevice:function(){this.hideAll();this.addDiv.show("fast");},updateAddress:function(A){this.dto.address=A;
this.wrap.find("#address"+this.id).html(A);},hideAll:function(){nQ(".nvt_hideable").hide("fast");},showSample:function(){this.hideAll();
this.sampleDiv.show("fast");},newDevice:function(){var A=this.addDiv.find("input").val();var B=false;
if(this.dto.type=="EMAIL"){B=this.validateEmail(A);}else{B=this.validatePhone(A);A=this.stripCharsInBag(A);
}if(B){this.hideAll();Nvt.console.log("New Device");var C=new Nvt.Widget.UserDeviceWidget(null,this.callback,this.dto.type,this.dto.subType,parseInt(this.dto.priority)+1,this.metroId,"UNVERIFIED");
C.updateAddress(A);var D=i18n.newText+C.DOM.id;nQ(this.DOM).after(nQ('<div id="'+D+'"></div>'));C.display(D);
C.saveDevice();}else{this.addDiv.prepend(nQ('<div class="nvt_error">'+i18n.malformed+" "+this.getNewDeviceText(this.dto)+"</div>"));
}},getDeviceText:function(A){if(A.type=="EMAIL"){return i18n.emailText;}if(A.type=="PHONE"){if(A.subType=="LAND"){return i18n.voicePhoneCall;
}if(A.subType=="MOBILE"){return i18n.textMessage;}}return i18n.deviceText;},getNewDeviceText:function(A){if(A.type=="EMAIL"){return i18n.emailAddress;
}if(A.type=="PHONE"){return i18n.phoneNumber;}return i18n.deviceText;},getSample:function(B){var A=i18n.viewSample;
if(B.type=="PHONE"){Nvt.console.log("SAMPLE: "+B.subType);if(B.subType=="LAND"){A=i18n.hearSample;return nQ('<a href="'+commonData.staticServer("TrafficHotlineSample.mp3")+i18n.audioPath+'TrafficHotlineSample.mp3" target="_blank">'+A+"</a>");
}}return nQ("<a>"+A+"</a>");},getSampleContent:function(A){if(A.type=="PHONE"){if(A.subType=="LAND"){return ;
}else{return nQ('<div id="nvt_sampleText"><img class="nvt_modal_tabContents" src="'+commonData.staticServer("sampleTextAlert.jpg")+i18n.imagesPath+'sampleTextAlert.jpg" alt="'+i18n.sampleTextMessageAlert+'" /></div>');
}}else{return nQ('<div id="nvt_sampleEmail"><img class="nvt_modal_tabContents" src="'+commonData.staticServer("sampleEmailAlert.jpg")+i18n.imagesPath+'sampleEmailAlert.jpg" alt="'+i18n.sampleEmailAlert+'" /></div>');
}},getUserDevice:function(A,D,C){for(var B=0;B<A.length;B++){Nvt.console.log(A[B].type+" "+A[B].priority);
if(A[B].type==D&&A[B].priority==C&&A[B].status!="DELETED"){return A[B];}}return null;},addEmailOptions:function(){var A=nQ('<div><input id="text'+this.dto.id+'" type="checkbox" '+((this.dto.subType=="TEXT")?"checked":"")+"/>"+i18n.textOnly+"</div>");
A.click(this.textChanged.bind(this));this.wrap.append(A[0]);},textChanged:function(){var A=nQ("#text"+this.dto.id);
Nvt.console.log(A.is(":checked"));if(A.is(":checked")){this.dto.subType="TEXT";}else{this.dto.subType="HTML";
}Nvt.console.log(this.dto.subType);},phoneTypeChanged:function(){var A=nQ("input[@name='phoneType"+this.dto.priority+"']:checked");
Nvt.console.log(A[0]);Nvt.console.log(A.val());this.dto.subType=A.val();Nvt.console.log(this.dto.subType);
this.showVerification();},addPhoneOptions:function(){var B=nQ('<div><input type="radio" name="phoneType'+this.dto.priority+'" value="LAND" id="phoneLand'+this.dto.id+'"'+((this.dto.subType=="LAND")?" checked ":"")+"/>"+i18n.phoneCall+"</div>");
var A=nQ('<div><input type="radio" name="phoneType'+this.dto.priority+'" value="MOBILE" id="phoneMobile'+this.dto.id+'"'+((this.dto.subType=="MOBILE")?" checked ":"")+"/>"+i18n.textMessage+"</div>");
B.click(this.phoneTypeChanged.bind(this));A.click(this.phoneTypeChanged.bind(this));this.wrap.append(B[0]);
this.wrap.append(A[0]);this.showVerification(false);},showVerification:function(C){if(C||(this.dto.subType=="MOBILE"&&this.dto.status!="VERIFIED"&&this.dto.statusCircumstances!="EXPLICIT")){var B=nQ('<div id="verification"></div>');
this.wrap.append(B);B.append(nQ(i18n.pleaseverifyphone));var A=nQ("<a>"+i18n.sendVerification+"</a>");
A.click(this.sendVerification.bind(this));B.append(A);B.append(nQ(i18n.enterVerificationCode));B.append(nQ('<input type="text" name="vCode"/>'));
var D=nQ('<a class="nvt_button"><span class="nvt_buttonLeft"></span>'+"<h1>"+i18n.buttonSave+"</h1>"+'<span class="nvt_buttonRight"></span></a>');
D.click(this.saveVerification.bind(this));B.append(D);}else{nQ("#verification").remove();}},sendVerification:function(){Nvt.console.log("send: "+$H(this.dto).toQueryString());
this.loadData(commonData.appServerName+"/controller/smsSendVerification?var=smsVerify&isUpdate=true&metroId="+this.metroId+"&"+$H(this.dto).toQueryString(),this.sendResponse.bind(this));
},sendResponse:function(C){Nvt.console.log("Got response from server");Nvt.console.log(smsVerify);nQ(".nvt_loader").hide("fast");
if(smsVerify.ERRORMAP){alert(smsVerify.ERRORMAP.SMS_DEVICE_ERROR);}else{var A=nQ('<div id="verification"></div>');
this.wrap.append(A);A.append(nQ("<p id='nvt_sendVerificationLabel' class='nvt_error'>"+smsVerify.SMS_VERIFICATION_SENT+"</p>"));
A.append(nQ("<p class='nvt_error'>"+i18n.enterVerificationCode+"</p>"));A.append(nQ('<input type="text" name="vCode"/ size="4">'));
var B=nQ('<a class="nvt_button"><span class="nvt_buttonLeft"></span>'+"<h1>"+i18n.buttonSave+"</h1>"+'<span class="nvt_buttonRight"></span></a>');
B.click(this.saveVerification.bind(this));A.append(B);nQ("#nvt_sendVerificationLink").parent().append(A);
}},saveVerification:function(){Nvt.console.log("save");var A=nQ("input[@name = 'vCode']").val();Nvt.console.log("code: "+A);
this.loadData(commonData.appServerName+"/controller/smsVerificationValidator?var=verify&isUpdate=true&smsVerificationCode="+A+"&"+$H(this.dto).toQueryString(),this.saveResponse.bind(this));
},saveResponse:function(){Nvt.console.log("Got response from server");if(verify.ERRORMAP){alert(verify.ERRORMAP.SMS_DEVICE_VERIFICATION_ERROR);
}else{nQ("#verification").remove();nQ("#nvt_sendVerificationContent").remove();nQ("#nvt_sendVerificationLink").remove();
nQ("#nvt_sendVerificationLabel").remove();this.radio.removeAttr("disabled");this.radio.attr("checked","checked");
}nQ(".nvt_loader").hide("fast");},saveDevice:function(){Nvt.console.log("saveDevice");if(this.validate(this.dto)){if(this.dto.type=="PHONE"){this.dto.address=this.stripCharsInBag(this.dto.address);
}var A=$H(this.dto);A.unset("date");this.loadData(commonData.restServerName+"/updateDevice?var=dev&"+A.toQueryString(),this.saveDeviceResponse.bind(this));
}else{this.content.prepend(nQ('<div class="nvt_error">'+i18n.malformed+" "+this.getNewDeviceText(this.dto)+"</div>"));
}},validate:function(A){if(A.type=="EMAIL"){return this.validateEmail(A.address);}else{return this.validatePhone(A.address);
}},validateEmail:function(A){Nvt.console.log("validating:"+A);return/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(A);
},validatePhone:function(A){var B="0123456789";var C=10;s=this.stripCharsInBag(A);return this.isInteger(s)&&s.length==C;
},stripCharsInBag:function(C){var D="()- ext.+";var B;var A="";for(B=0;B<C.length;B++){var E=C.charAt(B);
if(D.indexOf(E)==-1){A+=E;}}return A;},isInteger:function(B){var A;for(A=0;A<B.length;A++){var C=B.charAt(A);
if(((C<"0")||(C>"9"))){return false;}}return true;},saveDeviceResponse:function(){nQ(".nvt_loader").hide("fast");
if(dev){if(dev.thrown){alert(dev.thrown);}else{this.hideAll();this.dto=dev.presentationObjects.devices[0];
if(this.dto.type=="PHONE"){this.dto.address=Nvt.Util.formatPhone(this.dto.address);}this.updateAddress(this.dto.address);
}}},deleteDeviceResponse:function(){if(dev){if(dev.thrown){alert(dev.thrown);}else{nQ(this.DOM).empty();
}}},postDisplay:function(){this.hideAll();},getDeviceId:function(){return this.dto.id;},getTypeText:function(A,B){return nQ('<label for="'+B+'">'+this.getDeviceText(A)+" - </label>")[0];
},keyPress:function(A){switch(A.keyCode){case 13:Nvt.console.log("User press enter");this.saveDevice();
break;default:this.dto.address=nQ("#input"+this.id)[0].value;break;}},CLASS_NAME:"Nvt.Widget.UserDeviceWidget"};
Object.extend(Nvt.Widget.UserDeviceWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.BrowseTrafficWidget=Class.create();
Nvt.Widget.BrowseTrafficWidget.prototype={initialize:function(G){this.initializeWidget();this.backLinkText=i18n.backBrowseTraffic;
this.metroId=G;var F=this.id+"_widgetContainer";this.widgetContainerId=F;var E=this;var B=nQ('<h1 class="nvt_headline">'+i18n.browseTrafficInfo+"</h1>");
var A=new Nvt.Widget.BrowseTrafficLinksWidget(this.metroId,this.widgetContainerId,this);var A=nQ(A.DOM);
var C=nQ('<div id="'+F+'"></div>');nQ(this.DOM).append(B).append(A).append(C);this.widget=new Nvt.Widget.HotspotWidget(G,null,null,true);
var D=this.getBrowseParam();if(D!=""){if(D=="2"){this.widget=new Nvt.Widget.AllRoadsWidget(G);}else{if(D=="3"){this.widget=new Nvt.Widget.RecentlyViewedWidget(G);
}else{if(D=="4"){this.widget=new Nvt.Widget.TrafficItemsWidget(Nvt.Widget.TrafficItemConstants.INCIDENT,null,null,G,true);
}else{if(D=="5"){this.widget=new Nvt.Widget.TrafficItemsWidget(Nvt.Widget.TrafficItemConstants.CONSTRUCTION,null,null,G,true);
}else{if(D=="6"){this.widget=new Nvt.Widget.TrafficItemsWidget(Nvt.Widget.TrafficItemConstants.EVENT,null,null,G,true);
}else{if(D=="7"){this.widget=new Nvt.Widget.TrafficItemsWidget(Nvt.Widget.TrafficItemConstants.MASSTRANSIT,null,null,G,true);
}}}}}}}else{D=1;}A.find("#nvt_browseLink"+D).addClass("nvt_selected");document.widgetManager.browseTrafficHeight=nQ("#"+this.id).height();
},getBrowseParam:function(){var A=Nvt.Util.getQueryParamValue("browse");if(A!=""){return A;}else{if(commonData.widget=="roads"){return"2";
}else{if(commonData.widget=="hotspots"){return"1";}else{if(commonData.widget=="incidents"){return"4";
}else{if(commonData.widget=="construction"){return"5";}else{if(commonData.widget=="events"){return"6";
}else{if(commonData.widget=="masstransit"){return"7";}}}}}}}},postDisplay:function(){this.widget.display(this.widgetContainerId);
document.widgetManager.getSlideWidget().toggleDisplay(this.id);nQ("#"+this.id+" li:first").addClass("nvt_selected");
this.finalExecution();},refreshCallback:function(B,A){if(B){this.metroId=B;}},CLASS_NAME:"Nvt.Widget.BrowseTrafficWidget"};
Object.extend(Nvt.Widget.BrowseTrafficWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.SelectHistoryWidget={LEFT_BELOW:0,LEFT_ABOVE:1,RIGHT_BELOW:2,RIGHT_ABOVE:3,showList:function(H,F,I,C){Nvt.Core.NvtAnalytics.virtual("/virtual/click/routing/selectHistory");
if(F==null){return false;}F=$(F);var J=I!=null?this.generateOptions(I,C,F):this.generateOptions(F,C,F);
var A=this.generateList(H,J);if(F.id=="nvt_pointA"&&A){var E=nQ(A).height();nQ("#nvt_pointAShim").show().height(E);
}if(F.id=="nvt_pointB"&&A){var E=nQ(A).height();nQ("#nvt_pointBShim").show().height(E);}F.focus();if(A){var G=Position.cumulativeOffset(F);
A.style.position="absolute";A.style.top=(G[1]+F.offsetHeight-1)+"px";A.style.left=G[0]+"px";A.style.display="block";
if(F&&F.getWidth){var B=F.getWidth();A.style.width=B+"px";var D=A.getWidth();if(D>B){B=B-(D-B);A.style.width=B+"px";
}}}Nvt.Util.zebraStripe();},validateOptions:function(A){if(A==null||A.target==null){return false;}return true;
},generateOptions:function(E,C,A){var F={target:"function"==typeof E?E:$(E),containerStyle:"ac_results",selectionStyle:"selectionItem",selectionHoverStyle:"selectionHover",selectionSelectedStyle:"selectionSelected",position:this.LEFT_BELOW,control:A};
if(C&&"object"==typeof C){var D=Object.keys(C);for(var B=0;B<D.length;B++){F[D[B]]=C[D[B]];}}return F;
},generateList:function(D,B){if(!this.validateOptions(B)){return null;}var A=this.getItems(D);if(A.count()>0){var E=A.getItems();
var G=$(D);if(G){G.isInDOM=true;G.innerHTML="";}else{G=document.createElement("ul");G.id=D;document.body.appendChild(G);
}G.className=B.containerStyle;nQ(G).addClass("nvt_striped");G.SelectListItemStyle=B.selectionStyle;G.SelectListHoverStyle=B.selectionHoverStyle;
for(var C=0;C<E.length;C++){var F=document.createElement("li");F.id=D+C;F.innerHTML=E[C].display;F.SelectListItem=E[C];
F.className=B.selectionStyle;F.TargetInput=B.control;F.TargetFunction="function"==typeof B.target?B.target:null,F.coordinate=E[C].data;
G.appendChild(F);}G.EventCache=Nvt.Core.Utility.newEventCache();G.ItemSelector=Nvt.Core.Utility.newItemSelector(G.childNodes,B.selectionStyle,B.selectionSelectedStyle,-1);
Nvt.Widget.SelectHistoryWidget.Events.decorate(G,B.control);return G;}return null;},_itemList:[],getItems:function(A){if(this._itemList[A]==null){this._itemList[A]=new Nvt.Widget.SelectHistoryWidget.Items(A);
}return this._itemList[A];},clearDisplay:function(D,B){var C=(B==null);if(D!=null&&!C){if(!D.focusIsOnDiv){C=true;
}}if(C){nQ("#nvt_pointAShim").hide();nQ("#nvt_pointBShim").hide();if(D.EventCache){D.EventCache.clear();
Nvt.Core.Utility.garbageCollect(D,"EventCache");}if(D.ItemSelector){Nvt.Core.Utility.garbageCollect(D,"ItemSelector");
}var A=$A(D.childNodes);A.each(function(E){Nvt.Core.Utility.garbageCollect(E,"TargetInput");Nvt.Core.Utility.garbageCollect(E,"TargetFunction");
Nvt.Core.Utility.garbageCollect(E,"SelectListItem");});D.innerHTML="";D.style.display="none";}},readCookie:function(B){var A=Nvt.Util.readCookie(B);
if(A){var C=this.decodeCookieString(A);return C;}else{return null;}},encodeCookieString:function(A){var B=A.replace(/;/g,"%3B");
return B;},decodeCookieString:function(B){var A=B.replace(/%3B/g,";");return A;},createCookie:function(B,D,E,C){var A=this.encodeCookieString(D);
Nvt.Util.createCookie(B,A,E,C);},trimCookie:function(C,B){var A=C;temp=new String(C.toJSON());temp=this.encodeCookieString(temp);
Nvt.console.log(temp.length,B);if(temp.length>B){return this.trimCookie(A.without(A.last()),B);}else{return temp;
}},maxCookieLength:1800};Nvt.Widget.SelectHistoryWidget.Items=Class.create();Nvt.Widget.SelectHistoryWidget.Items.prototype={key:null,initialize:function(B){this.key=B;
this.list=[];var A=Nvt.Widget.SelectHistoryWidget.readCookie(this.key);if(A!=null){A=new String(A);while(A.indexOf("|")>-1){A=A.replace("|",",");
}try{if(A.isJSON()){this.list=A.evalJSON();}}catch(C){Nvt.Widget.SelectHistoryWidget.createCookie(this.key,"[]",360);
this.list=[];}}},count:function(){if(this.list){return this.list.length;}return 0;},addItem:function(D,A,E){if(D==null){return ;
}var B=null;if(!E){var E="";}if("string"==typeof D){if(D.length<1){return ;}D=D.strip();B={display:D,data:E};
}else{if(D.display&&D.data){B=D;}}for(var C=0;C<this.list.length;C++){if(B.display==this.list[C].display){B.data=this.list[C].data;
}}if(this.list){for(var C=(this.list.length-1);C>=0;C--){if(B.display==this.list[C].display){this.list.splice(C,1);
}}this.list=[B].concat(this.list);}else{this.list=[B];}if(A&&A>0&&this.list.length>A){this.list=this.list.slice(0,A);
}},getItems:function(){var A=Nvt.Widget.SelectHistoryWidget.readCookie("RouteHistory");if(A!=null){A=new String(A);
while(A.indexOf("|")>-1){A=A.replace("|",",");}try{if(A.isJSON()){this.list=A.evalJSON();}}catch(B){this.list=[];
}return this.list;}return[];},save:function(){try{var B=Nvt.Widget.SelectHistoryWidget.maxCookieLength-document.cookie.length;
var D=Nvt.Util.readCookie(this.key);if(D){B=B+D.length;}var A=Nvt.Widget.SelectHistoryWidget.trimCookie($A(this.list),B);
while(A.indexOf(",")>-1){A=A.replace(",","|");}Nvt.Widget.SelectHistoryWidget.createCookie(this.key,A,360);
}catch(C){}},clear:function(){Nvt.Util.createCookie(this.key,[]);this.list=[];}};Nvt.Widget.SelectHistoryWidget.Events={decorate:function(D,A){var C=$A(D.childNodes);
for(var B=0;B<C.length;B++){D.EventCache.add(C[B],"click",this._childClick);D.EventCache.add(C[B],"mouseover",this._childMouseOver);
D.EventCache.add(C[B],"mouseout",this._childMouseOut);}C=null;if(A){A.SelectListDivID=D.id;D.EventCache.add(A,"blur",this._inputBlur);
D.EventCache.add(A,"keydown",this._inputKeyDown);D.EventCache.add(A,"keyup",this._inputKeyUp);}D.EventCache.add(D,"mousedown",this._divMouseDownOver);
D.EventCache.add(D,"mouseover",this._divMouseDownOver);D.EventCache.add(D,"mouseout",this._divMouseOut);
},_childClick:function(B){var A=Event.element(B);if(A.TargetFunction){A.TargetFunction(A.SelectListItem);
}else{if(A.TargetInput){A.TargetInput.value=A.innerHTML;A.TargetInput.SelectListItem=A.SelectListItem;
}}Nvt.Widget.SelectHistoryWidget.clearDisplay(A.parentNode,null);},_childMouseOver:function(B){var A=Event.element(B);
A.focusIsOnDiv=true;if(A.className==A.parentNode.SelectListItemStyle){A.className=A.parentNode.SelectListHoverStyle;
}},_childMouseOut:function(B){var A=Event.element(B);if(A.className==A.parentNode.SelectListHoverStyle){A.className=A.parentNode.SelectListItemStyle;
}},_inputBlur:function(B){var A=Event.element(B);var C=$(A.SelectListDivID);Nvt.Widget.SelectHistoryWidget.clearDisplay(C,B);
A=null;C=null;},_inputKeyDown:function(C){var B=Event.element(C);var D=$(B.SelectListDivID);var A=$A(D.childNodes);
if(A.length){if(C.keyCode==Event.KEY_DOWN){D.ItemSelector.next(A);}else{if(C.keyCode==Event.KEY_UP){D.ItemSelector.previous(A);
}else{if(C.keyCode==Event.KEY_RETURN){if(D.ItemSelector.selected(A)){D.focusIsOnDiv=false;B.value=D.ItemSelector.selected(A).innerHTML;
B.SelectListItem=D.ItemSelector.selected(A).SelectListItem;Nvt.Widget.SelectHistoryWidget.clearDisplay(D,C);
}}else{if(C.keyCode==Event.KEY_TAB){D.focusIsOnDiv=false;Nvt.Widget.SelectHistoryWidget.clearDisplay(D,C);
}}}}}B=null;D=null;A=null;},_inputKeyUp:function(D){var C=[Event.KEY_TAB,Event.KEY_RETURN,Event.KEY_ESC,Event.KEY_LEFT,Event.KEY_UP,Event.KEY_RIGHT,Event.KEY_DOWN,Event.KEY_HOME,Event.KEY_END,Event.KEY_PAGEUP,Event.KEY_PAGEDOWN,16];
var B=Event.element(D);var E=$(B.SelectListDivID);var A=$A(E.childNodes);if(C.indexOf(D.keyCode)<0){E.ItemSelector.filter(A,B.value);
}B=null;E=null;A=null;},_divMouseDownOver:function(B){var A=Event.element(B);if(A.ItemSelector){A.focusIsOnDiv=true;
}else{if(A.parentNode.ItemSelector){A.parentNode.focusIsOnDiv=true;}}A=null;},_divMouseOut:function(B){var A=Event.element(B);
if(A.ItemSelector){A.focusIsOnDiv=false;}else{if(A.parentNode.ItemSelector){A.parentNode.focusIsOnDiv=false;
}}A=null;}};Nvt.Widget.BrowseTrafficLinksWidget=Class.create();Nvt.Widget.BrowseTrafficLinksWidget.prototype={initialize:function(J,P,O,C){this.initializeWidget();
this.metroId=J;this.widgetContainerId=P;var Q="";if(O){this.browseTrafficWidget=O;}var F=nQ('<div id="nvt_browseTrafficNav"></div>');
var H=nQ("<h2>"+i18n.byRoad+"</h2>");var G=nQ('<ul class="nvt_info_subNav"></ul>');var N=nQ('<li><a id="nvt_browseLink1" class="'+Q+'">'+i18n.hotspots+"</a>|</li>").click(this.createClosure(i18n.hotspots,"HotspotWidget",1,C));
var M=nQ('<li><a id="nvt_browseLink2">'+i18n.allRoads+"</a>|</li>").click(this.createClosure(i18n.allRoads,"AllRoadsWidget",2,C));
var L=nQ('<li><a id="nvt_browseLink3">'+i18n.recentlyViewed+"</a></li>").click(this.createClosure(i18n.recentlyViewed,"RecentlyViewedWidget",3,C));
G.append(N).append(M).append(L);var A=nQ("<h2>"+i18n.byType+"</h2>");var I=nQ('<ul class="nvt_info_subNav"></ul>');
var E=nQ('<li><a id="nvt_browseLink4">'+i18n.incidents+"</a>|</li>").click(this.createItemClosure(Nvt.Widget.TrafficItemConstants.INCIDENT,4,C));
var B=nQ('<li><a id="nvt_browseLink5">'+i18n.roadwork+"</a>|</li>").click(this.createItemClosure(Nvt.Widget.TrafficItemConstants.CONSTRUCTION,5,C));
var K=nQ('<li><a id="nvt_browseLink6">'+i18n.events+"</a>|</li>").click(this.createItemClosure(Nvt.Widget.TrafficItemConstants.EVENT,6,C));
var D=nQ('<li><a id="nvt_browseLink7">'+i18n.massTransit+"</a></li>").click(this.createItemClosure(Nvt.Widget.TrafficItemConstants.MASSTRANSIT,7,C));
I.append(E).append(B).append(K).append(D);F.append(H).append(G).append(A).append(I);nQ(this.DOM).append(F);
},postDisplay:function(){var A=document.widgetManager.getSlideWidget();if(A){A.toggleDisplay(this.id);
A.animateSlider(null,null,true);}this.finalExecution();},createClosure:function(widgetName,widgetText,num,clickOveride){if(clickOveride){return clickOveride.bind(this,num);
}var widgetContainerId=this.widgetContainerId;var context=this;var closure=function(event){if(context.browseTrafficWidget){context.browseTrafficWidget.backLinkText=i18n.backTo+" "+widgetName;
}nQ("a").removeClass("nvt_selected");Event.element(event).addClassName("nvt_selected");document.widgetManager.getTabWidget().clickTab(null,i18n.browseTraffic,true);
nQ("#"+widgetContainerId).empty();if(context.widget){context.widget.destroy();}context.widget=eval("new Nvt.Widget."+widgetText+"("+context.metroId+',"'+widgetContainerId+'", null, false)');
};return closure;},createItemClosure:function(D,B,A){if(A){return A.bind(this,B);}var C=this;var E=function(F){var G="";
if(D==Nvt.Widget.TrafficItemConstants.INCIDENT){G=i18n.incidents;}else{if(D==Nvt.Widget.TrafficItemConstants.CONSTRUCTION){G=i18n.roadwork;
}else{if(D==Nvt.Widget.TrafficItemConstants.EVENT){G=i18n.events;}else{if(D==Nvt.Widget.TrafficItemConstants.MASSTRANSIT){G=i18n.massTransit;
}}}}if(trafficMap){trafficMap.turnOnFilterButtonCategory(D);}if(C.browseTrafficWidget){C.browseTrafficWidget.backLinkText=i18n.backTo+" "+G;
}nQ("a").removeClass("nvt_selected");Event.element(F).addClassName("nvt_selected");document.widgetManager.getTabWidget().clickTab(null,i18n.browseTraffic,true);
nQ("#"+C.widgetContainerId).empty();if(C.widget){C.widget.destroy();}C.widget=new Nvt.Widget.TrafficItemsWidget(D,C.widgetContainerId,null,C.metroId,true);
};return E;},refreshCallback:function(B,A){if(B){this.metroId=B;}},CLASS_NAME:"Nvt.Widget.BrowseTrafficLinksWidget"};
Object.extend(Nvt.Widget.BrowseTrafficLinksWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.TwistyWidget=Class.create();
Nvt.Widget.TwistyWidget.prototype={initialize:function(A,B){this.initializeWidget();this.shownContent=A;
this.hiddenDiv=document.createElement("div");this.hiddenDiv.setAttribute("id",this.id+"_hidden");this.hiddenDiv.style.display="none";
this.hiddenDiv.style.overflow="hidden";this.hiddenDiv.innerHTML='<div class="twistyContent">'+B+"</div>";
this.shownDiv=nQ("<div></div>");this.twisty=nQ('<div class="nvt_twistyCarrot"></div>');this.shownDiv.append(this.twisty);
this.shownDiv.append(A);this.shownDiv.click(this.twist.bind(this));nQ(this.DOM).append(this.shownDiv).append(this.hiddenDiv);
},twist:function(){var A=0;if(nQ("#"+this.id+"_hidden:hidden").size()==1){nQ("#"+this.id).addClass("nvt_expanded");
A=nQ(this.hiddenDiv).height();if(document.widgetManager){document.widgetManager.getSlideWidget().animateHeight(A);
}nQ("#"+this.id+"_hidden").slideDown(1000);}else{nQ("#"+this.id).removeClass("nvt_expanded");A=nQ(this.hiddenDiv).height()*-1;
if(document.widgetManager){document.widgetManager.getSlideWidget().animateHeight();}nQ("#"+this.id+"_hidden").slideUp(1000);
}if(this.parent){this.parent.adjustHeight(this.wrap.id,A);}A=nQ("#"+this.id+"_hidden div.twistyContent").height();
},CLASS_NAME:"Nvt.Widget.TwistyWidget"};Object.extend(Nvt.Widget.TwistyWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.TimeStampWidget=Class.create();Nvt.Widget.TimeStampWidget.prototype={timezoneAbbreviations:["GMT","CVT","NST","AST","EST","CST","MST","PST","AKST","HAST"],initialize:function(A){this.initializeWidget();
this.refreshFunctionName=A;this.content=nQ("");var B=new Date();var D="<h4>"+(i18n.timestampPageUpdated+" |</h4> <span id='nvt_updateTime'>"+this.getTime(B)+"</span>");
var C=nQ("<a>"+i18n.timestampRefresh+"</a>");Nvt.Core.RefreshManager.getInstance().addCallback(function(){NvtAds.refreshAds(null,false);
});C.click(this.refresh.bind(this));nQ(this.DOM).append(nQ(D));nQ(this.DOM).append(C);},getTime:function(A){return this.getTwelveHourFormat(A.getHours())+":"+Nvt.Util.getMinutes(A.getMinutes()+"")+Nvt.Util.getAMPM(A.getHours())+" "+this.timezoneAbbreviations[((A.getTimezoneOffset()/60)-1)+this.calcDaylightSavings(A)];
},refresh:function(){nQ("#nvt_updateTime")[0].innerHTML=this.getTime(new Date());Nvt.Core.RefreshManager.getInstance().refresh();
},getTwelveHourFormat:function(A){modHours=A%12;if(modHours==0){return 12;}return modHours;},calcDaylightSavings:function(C){var E=new Date;
E.setMonth(2);E.setDate(1);var B=E.getDay();var A=8;if(B!=0){A+=(7-B);}E.setDate(A);var F=new Date;F.setMonth(10);
F.setDate(1);B=F.getDay();var A=1;if(B!=0){A+=(7-B);}F.setDate(A);var D=0;if(C>E&&C<F){D=1;}return D;
},CLASS_NAME:"Nvt.Widget.TimeStampWidget"};Object.extend(Nvt.Widget.TimeStampWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.AlertListWidget=Class.create();Nvt.Widget.AlertListWidget.prototype={initialize:function(B,A,D){this.initializeWidget();
this.divId=A;this.data=B;if(D){this.metroId=D;}this.confirmationMessage=null;var C=["name","drive","type","status"];
this.formatter=new Nvt.Formatter.AlertListFormatter(C);this.modals=new Array();this.getData();},getRestUrl:function(){var A=commonData.restServerName+"/alerts?var="+this.id+"&dataset=all";
return A;},postInit:function(){this.data=this.data.alerts;if(this.divId){this.display(this.divId);}var E=new Array();
for(i=0;i<this.data.length;i++){var I=this.data[i];try{I.drives[0].name;a=E.push(I);}catch(H){Nvt.console.log("Clean up data - do not add alert to list: "+H);
}}this.data=E;var L=nQ('<h1 class="nvt_replace nvt_headline">'+i18n.youHave+" "+this.data.length+" "+i18n.alert+this.appendPlural(this.data.length)+"</h1>");
var N=nQ('<a id="addAlert" class="nvt_button"><span class="nvt_buttonLeft"/><h1>'+i18n.addAnAlert+'</h1><span class="nvt_buttonRight"/></a>');
if(this.data.length==0){var A=nQ('<div id="nvt_noAlerts" class="nvt_nothingSetup"></div>');var J=nQ('<h2 class="nvt_bold_text">'+i18n.getStarted+"</h1>");
A.append(L).append(J).append(N);var B=commonData.restServerName+"/drives?var=alertDriveList";this.loadData(B,function(){if(alertDriveList.presentationObjects.drives.length==0){N.bind("click",function(){A.append(nQ("<div id=\"nvt_nodrive\" class =\"nvt_error\">To create an Alert, you first need to save a Drive, Use the 'Check your Drive Time' form above to enter a start and end point, press 'Go', and then save your Drive. You will then be able to set up an Alert.</div>"));
});}});var F=nQ('<img src="'+commonData.staticServer("alertSample.gif")+i18n.imagesPath+'ws-my/alertSample.gif" alt="" />');
A.append(F);nQ(this.DOM).append(A);}else{var D=nQ('<div id="nvt_alertHead"></div>').hide();if(this.confirmationMessage){D.addClass("nvt_error").html(this.confirmationMessage).show();
this.confirmationMessage=null;}nQ(this.DOM).append(L).append(D).append(N);this.tableWidget=new Nvt.Widget.TableWidget(this.formatter,this.data);
this.tableWidget.parentWidgetName="Nvt.Widget.AlertListWidget";this.tableWidget.display(this.id);var M=nQ("#"+this.tableWidget.id);
var G=M.find("tbody tr:not(.nvt_twistyHidden)");var C=this;G.each(function(P,Q){var R=C.getAlertDetails(C.data[P],P,Q.id);
var O=C.twistyFactory(Q.id,4,R);O.display();});Nvt.Util.zebraStripe();}var K=this.metroId;nQ().ready(function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":9000,"width":620},"href":commonData.appServerName+"/controller/showAlerts?metroId="+K,"id":"addAlert","title":i18n.addAlert});
});for(i=0;i<this.modals.length;i++){this.modals[i]();}Nvt.Util.zebraStripe();},appendPlural:function(A){return(A>1||A==0?i18n.pluralS:"");
},postDisplay:function(){Nvt.Util.zebraStripe();this.finalExecution();},twistyFactory:function(B,D,C){var A=new Nvt.Widget.TableTwistyWidget(B,D,C);
return A;},getAlertDetails:function(F,H,I){var Y=nQ("#"+I);var Z=Y.find(".nvt_alertStatus");var T=nQ('<div class="nvt_alertDetails"></div>');
var S=nQ('<ul class="nvt_info_subNav"></ul>');var P=nQ('<li><a id="editAlertLink'+H+'">'+i18n.hEditAlert+"</a>|</li>");
var M=nQ('<li><a id="renameAlertLink'+H+'">'+i18n.hRenameAlert+"</a>|</li>");var W=true;if(F.active!="true"){W=false;
}var h=function(){W=!W;var q;var o;var n;if(!W){q=i18n.isNowsuspended;o="Suspended";n=true;}else{q=i18n.isNowactivated;
o="Active";n=false;}var l=commonData.appServerName+"/controller/suspendReactivateAlert?isActive="+n+"&commuteReportId="+F.id+"&metroId="+F.metroId+"&var=alertstatus";
this.loadData(l,k(q,o));};var f=function(){var n=i18n.activeAlert;var l=i18n.alertSuspended;if(W){n=i18n.suspendAlert;
l=i18n.alertActivated;}nQ("#nvt_alertListInplace"+H+" .nvt_modalTitle").html(l);R.html(n);};var L=nQ("<li>|</li>").click(h.bind(this));
var R=nQ('<a id="suspendAlertLink'+H+'"></a>');L.prepend(R);f();var k=function(n,l){nQ("#nvt_activealertNav"+H).html("<p>"+i18n.yourAlert+" <strong>"+F.name+"</strong> "+n+"</p>");
Z.html(l);f();};var K=nQ('<li><a id="deleteAlertLink'+H+'">'+i18n.hDeleteAlert+"</a></li>");S.append(P).append(M).append(L).append(K);
var Q="";var O=Math.floor(F.startTimeMoD/60);var e=F.startTimeMoD%60;var J=Math.floor(F.endTimeMoD/60);
var N=F.endTimeMoD%60;var V="";var G="";if(commonData.locale=="en_US"){if(O>11){O=O%12;O=O==0?12:O;V=O+":"+(e>0?e:"00")+" "+i18n.postMeridain;
}else{O=O==0?12:O;V=O+":"+(e>0?e:"00")+" "+i18n.afterMeridian;}if(J>11){J=J%12;J=J==0?12:J;G=J+":"+(N>0?N:"00")+" "+i18n.postMeridain;
}else{J=J==0?12:J;G=J+":"+(N>0?N:"00")+" "+i18n.afterMeridian;}}else{V=O+":"+(e>0?e:"00");G=J+":"+(N>0?N:"00");
}if(F.endTimeMoD!="null"){Q=i18n.between+" <strong>"+V+"</strong> "+i18n.andText+" <strong>"+G+"</strong>";
}else{Q=i18n.atText+" <strong>"+V+"</strong>";}var b="";if(F.criteria.initialJamFactorThreshold!=""){b=i18n.ifText+" <strong>"+i18n.jamFactorexceeds+" "+F.criteria.initialJamFactorThreshold+"</strong>";
}if(F.criteria.hasAdvancedConditionalSettings=="true"){b="";}var X=nQ("<p>"+i18n.anAlertWillBeSentOn+" <strong>"+this.getAlertFrequency(F.daysOfWeek)+"</strong> "+Q+" "+b+" "+i18n.viaColon+"</p>");
var A=nQ("<ul><li><strong>"+Nvt.Util.cap1stLetters(F.deviceType)+":</strong> "+F.deviceAddress+"</li></ul>");
var E=nQ("<div></div>").attr({id:"nvt_activealertNav"+H,style:"display:none"});var D=nQ("<div></div>").attr({id:"nvt_renameAlertNav"+H,style:"display:none"});
D.append(nQ('<label id="nvt_labelalertname'+H+'" for="nvt_renameAlert">'+i18n.newAlertnameColon+' </label><input id="nvt_renameAlert'+H+'" type="text" class="nvt_text" value="'+F.name+'" />'));
var U=function(){metroid=F.metroId;commutereportid=F.id;this.alertname=F.name;var l=commonData.appServerName+"/controller/renameAlert?commuteReportId="+commutereportid+"&alertName="+nQ("#nvt_renameAlert"+H).val()+"&metroId="+metroid+"&var=renameDeleteAlert";
this.loadData(l,this.handleRenameDeleteAlert.bind(this));D.hide();};D.append(nQ("<a class='nvt_button goLink'><span class='nvt_buttonLeft'></span><h1>"+i18n.buttonGo+"</h1><span class='nvt_buttonRight'></span></a>").click(U.bind(this)));
var C=nQ('<div id="nvt_deleteAlertNav'+H+'" style="display: none;"></div>');C.append(nQ("<p> "+i18n.areYouSureWantToDeleteTheAlert+" <b>"+F.name+"</b>?</p>"));
var B=function(){metroid=F.metroId;commutereportid=F.id;this.alertname=F.name;var l=commonData.appServerName+"/controller/deleteAlert?commuteReportId="+commutereportid+"&metroId="+metroid+"&var=renameDeleteAlert";
this.loadData(l,this.handleRenameDeleteAlert.bind(this));C.hide();};C.append(nQ("<a class='nvt_button deleteLink'><span class='nvt_buttonLeft'></span><h1>"+i18n.hDeleteAlert+"</h1><span class='nvt_buttonRight'></span></a>").click(B.bind(this)));
var g=nQ('<div id="nvt_alertListInplace'+H+'" class="nvt_inPlaceModalWrapper"></div>');T.append(S).append(g).append(E).append(D).append(C).append(X).append(A);
this.modals.push(function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":9000,"width":620},"href":commonData.appServerName+"/controller/showAlerts?metroId="+F.metroId+"&commuteId="+F.drives[0].id+"&commuteReportId="+F.id+"&isEdit=yes","id":"editAlertLink"+H,"title":i18n.hEditAlert});
});this.modals.push(function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":84,"width":385},"href":"#nvt_renameAlertNav"+H,"id":"renameAlertLink"+H,"refresh":true,"target":"#nvt_alertListInplace"+H,"title":i18n.hRenameAlert});
});this.modals.push(function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":55,"width":385},"href":"#nvt_activealertNav"+H,"id":"suspendAlertLink"+H,"refresh":true,"target":"#nvt_alertListInplace"+H,"title":i18n.alertSuspended});
});this.modals.push(function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":85,"width":385},"href":"#nvt_deleteAlertNav"+H,"id":"deleteAlertLink"+H,"refresh":true,"target":"#nvt_alertListInplace"+H,"title":i18n.hDeleteAlert});
});return T;},getAlertFrequency:function(B){var D="";for(var A=0;A<B.length;A++){D+=B[A].dayName+", ";
}D=D.substr(0,D.length-2);var C="";if(D=="Monday, Tuesday, Wednesday, Thursday, Friday"){C="Weekdays";
}else{if(D=="Saturday, Sunday"){C="Weekends";}else{C=D;}}return C;},handleRenameDeleteAlert:function(){var A=null;
if(renameDeleteAlert.deleteAlertSuccess){A=i18n.hasBeenDeleted;}else{if(renameDeleteAlert.renameAlertSuccess){A=i18n.hasBeenRenamed;
}}if(A){this.refreshCallback();this.confirmationMessage=i18n.yourAlert+" <strong>"+this.alertname+"</strong> "+A;
}},refreshCallback:function(){this.data=null;this.divId=null;nQ(this.DOM).empty();this.getData(true);
},CLASS_NAME:"Nvt.Widget.AlertListWidget"};Object.extend(Nvt.Widget.AlertListWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.SearchWidget=Class.create();Nvt.Widget.SearchWidget.prototype={initialize:function(G,F,I){this.initializeWidget();
this.metroId=G;this.metroName=F;this.divId=I;this.hotpots=null;var H=nQ('<h1 class="nvt_replace nvt_headline">'+i18n.findRoadOrPlace+"</h1>");
var A=nQ('<input type="text" class="nvt_text" id="nvt_searchText" value="'+i18n.addressCityStateZIP+'" onfocus="isMapReadyFocusInput(this)">');
var J=nQ('<div id="nvt_userEnteredSearch" class="nvt_userEntered" title="'+i18n.viewPreviousSearchEntries+'" onclick="showListHistory(\'nvt_searchText\')"></div>');
A.focus(clearInputField.bind(this,"nvt_searchText"));var E=this.onClickGo.bind(this,"nvt_searchText");
A.keydown(function(K){switch(K.keyCode){case 13:setTimeout(E,200);break;}});var B=nQ('<a class="nvt_button nvt_go" id="searchGoInline" ><span class="nvt_buttonLeft"></span><h1>'+i18n.buttonGo+'</h1><span class="nvt_buttonRight"></span></a>');
nQ(B).click(this.onClickGo.bind(this,"nvt_searchText"));var C=nQ('<label class="nvt_hint">'+i18n.exampleText+'<a id="nvt_hint_tsHelp" class="nvt_tsHelp" href="javascript:Nvt.Util.showHelp(\'how-do-i-view-personalized-drives-on-wireless-trafficcom\',i18n.whatIsJamFactor, \'nvt_hint_tsHelp\');" class="nvt_darkSmallLink"><img id="nvt_helpImg" src="'+commonData.staticServer("questionMark.gif")+i18n.imagesPath+i18n.imagesPathModal+'questionMark.gif"/></a></label>');
var D=nQ('<div id="nvt_search_results"></div>');nQ(this.DOM).append(H).append(A).append(J).append(B).append(C).append(D);
D.append(Nvt.Util.getTableAd());this.bindToControl("nvt_searchText",this.metroId);},postDisplay:function(){nQ("#nvt_searchText")[0].focus();
},bindToControl:function(C,B){var A=function(){return"metroId="+this.metroId;};A=A.bind(this);nQ(document).ready(function(){var D=commonData.restServerName+"/search?dataType=roads&match=contains&filter=parent&var=autoComplete&max=10";
nQ("#"+C).autocomplete(D,{delay:200,minChars:2,matchSubset:2,matchContains:2,cacheLength:1,autoFill:false,extraParams:A,formatItem:function(E){var F=""+E;
return F.split("$")[0];}});});},bindGo:function(B,A,D){var C=this.onClickGo.bind(this,B,A);if(B){this.bindToControl(B,this.metroId);
nQ("#"+B).keydown(function(E){switch(E.keyCode){case 13:if(nQ("#nvt_acResults:visible").size()!=0){break;
}else{setTimeout(C,200);break;}}});}if(A){this.bindToControl(A,this.metroId);nQ("#"+A).keydown(function(E){switch(E.keyCode){case 13:if(nQ("#nvt_acResults:visible").size()!=0&&nQ("#nvt_pointA").val()==""){break;
}else{setTimeout(C,200);break;}}});}if(D){nQ("#"+D).click(C);}},onClickGo:function(X,V,G){this.aBox=X;
if(X){var C=nQ($(X)).val();var S=$(X).lastSelected;var D=$(X).orig;saveAddressHistory(X);}if(V){var N=nQ($(V)).val();
var K=$(V).lastSelected;var J=$(V).orig;}if(X!="nvt_searchText"){var W=C;var L=N;if(W==i18n.addressCityStateZIP){W="";
}if(L==i18n.addressCityStateZIP){L="";}saveAddressHistory(V);if((W==null||W.length==0||!D)&&(L==null||L.length==0||!J)){if(typeof (commonData.pageType)!="undefined"&&commonData.pageType=="routing"){var R=nQ($("nvt_routingResults"));
R.empty();R.html("");var U=nQ($("nvt_search_results"));U.empty();U.html("");var Q=nQ("<h2 class='nvt_error'>"+i18n.sorryDidnotEnterStartPointOrEndPoint+"<br>"+i18n.PleaseEnterStartPointAndEndPoint+"</h2>");
var H=nQ("<div id='nvt_routingError'></div>");H.append(Q);var f=nQ('<label id="nvt_labelA" for="nvt_pointA1" onclick="clearInputField(\'nvt_pointA1\');">'+i18n.labelA+"</label>");
H.append(f);var Z=document.createElement("input");Z.setAttribute("type","text");nQ(Z).addClass("nvt_text");
Z.setAttribute("id","nvt_pointA1");Z.setAttribute("value",i18n.addressCityStateZIP);nQ(Z).focus(clearInputField.bind(this,"nvt_pointA1"));
var F=this.onClickGo.bind(this,"nvt_pointA1");nQ(Z).keydown(function(b){switch(b.keyCode){case 13:break;
}});H.append(Z);var E=nQ(' <div id="nvt_userHistA" class="nvt_userEntered" title="'+i18n.viewPreviousSearchEntries+'"></div>');
H.append(E);var M=document.createElement("label");nQ(M).addClass("nvt_hint");M.innerHTML=i18n.exampleText;
H.append(M);H.append(nQ("<p />"));var B=nQ('<label id="nvt_labelB" for="nvt_pointB1" onclick="clearInputField(\'nvt_pointB1\');">'+i18n.labelB+"</label>");
H.append(B);var Z=document.createElement("input");Z.setAttribute("type","text");nQ(Z).addClass("nvt_text");
Z.setAttribute("id","nvt_pointB1");Z.setAttribute("value",i18n.addressCityStateZIP);nQ(Z).focus(clearInputField.bind(this,"nvt_pointB1"));
var F=this.onClickGo.bind(this,"nvt_pointB1");nQ(Z).keydown(function(b){switch(b.keyCode){case 13:break;
}});H.append(Z);var Y=nQ(' <div id="nvt_userHistB" class="nvt_userEntered" title="'+i18n.viewPreviousSearchEntries+'"></div>');
H.append(Y);var P=nQ('<a class="nvt_button nvt_go" id="searchRouting"  ><span class="nvt_buttonLeft"></span><h1>'+i18n.buttonGo+'</h1><span class="nvt_buttonRight"></span></a>');
nQ(P).click(this.onClickGo.bind(this,"nvt_pointA1","nvt_pointB1"));H.append(P);var A=document.createElement("label");
nQ(A).addClass("nvt_hint");A.innerHTML=i18n.exampleText;H.append(A);R.append(H);nQ("#nvt_pointAFullValue").attr("value","");
nQ("#nvt_pointBFullValue").attr("value","");var I=metroSummary.metroSummary[0].metro.metroName;try{var O=nQ("<h1 class='nvt_bold_text'>"+Nvt.I18N.resolveString("orBrowserMetroAreaWithLinks",new Array(I))+"</h1>");
H.append(O);browseWidget=new Nvt.Widget.BrowseTrafficLinksWidget(metro_id,"nvt_routingError",null,function(b){document.location=metroWSUrl+"?browse="+b;
});browseWidget.display("nvt_routingError");}catch(T){}H.append(Nvt.Util.getTableAd()[0]);resetWidth();
historyEvent("nvt_userHistA","nvt_pointA1");historyEvent("nvt_userHistB","nvt_pointB1");}else{if(C.length==0){C=i18n.addressCityStateZIP;
}if(N.length==0){N=i18n.addressCityStateZIP;}document.location=commonData.appServerName+"/controller/routing?nvt_pointA="+escape(C)+"&nvt_pointB="+escape(N);
}return ;}}if(C!=null&&C.length>0&&D){if(N!=null&&N.length>0&&J){if(typeof (commonData.pageType)!="undefined"&&commonData.pageType=="routing"){nQ("#nvt_pointA").attr("value",C);
nQ("#nvt_pointB").attr("value",N);getRoutes();}else{document.location=commonData.appServerName+"/controller/routing?nvt_pointA="+escape(C)+"&nvt_pointB="+escape(N);
}}else{if(S&&!isNaN(S)){this.keyRouteSelected(S);}else{this.query(C);}}}else{if(N!=null&&N.length>0&&J){if(K){this.keyRouteSelected(K);
}else{this.query(N);}}}},keyRouteSelected:function(B){if(B.indexOf("$")>0){B=B.split("$")[1];}var A=document.widgetManager.getTabWidget();
if(A){var D=new Nvt.Widget.ParentKeyRouteWidget(null,B,this.metroId,true,false);var C=function(){A.clickTab(null,i18n.searchTraffic,true);
};document.widgetManager.getSlideWidget().push(D,null,C,i18n.searchTraffic);}else{document.location=commonData.appServerName+"/"+this.metroName+"?krId="+B;
}},postInit:function(){this.allData=allData;this.metroName=allData.metros[0].metroName;this.displayResults(this.divId);
},query:function(C,D){this.hasSpinner=false;nQ("#nvt_search_results").prepend(this.spinner);if(nQ("#nvt_searchText")[0]){nQ("#nvt_searchText")[0].value=unescape(C);
}this.searchQuery=C;if(!this.divId){document.location=commonData.appServerName+"/"+this.metroName+"?q="+C;
return ;}var B=document.widgetManager.getTabWidget();if(B){B.clickTab(null,i18n.searchTraffic);}if(this.aBox&&$(this.aBox).value!=""&&$(this.aBox).value!=i18n.addressCityStateZIP){$(this.aBox).value=C;
}var A="";if(D){A=commonData.restServerName+"/search?query="+C+"&dataType=roads,trafficItems,metros&match=contains&lat="+D.latitude+"&lon="+D.longitude+"&filter=parent,boundingBoxGeoLoc&var=allData&max=20";
}else{A=commonData.restServerName+"/search?query="+C+"&dataType=roads,trafficItems,metros&match=contains&metroId="+this.metroId+"&filter=parent&var=allData&max=20";
}this.analyticsSearchQuery=C;wt_c[1]=metroSummary.metroSummary[0].metro.metroName;wt_is=this.analyticsSearchQuery;
Nvt.Core.NvtAnalytics.virtual("/virtual/search/"+metroSummary.metroSummary[0].metro.metroName+"/query/"+this.analyticsSearchQuery);
this.loadData(A,this.postInit.bind(this));},refreshCallback:function(D,A,C){if(D){this.metroId=D;if(C){this.metroName=C;
try{nQ("#moreHotspots").html(i18n.viewAll+" "+Nvt.Util.removeArea(this.metroName)+" "+i18n.areaHotSpots);
}catch(B){}try{nQ("#moreIncidents").html(i18n.viewAll+" "+Nvt.Util.removeArea(this.metroName)+" "+i18n.areaIncidents);
}catch(B){}nQ("#nvt_noResultsMetro").text(this.metroName);}}},buildGeoLocationResultObj:function(D,E){var H=new Nvt.Data.Coordinate();
H.setCoords(E.location.lat,E.location.lon);var F=function(K,J){if(J){return K+" "+J;}return K;};var A=E.name?(E.name+", "):"";
var B=(E.street&&E.street!="")?E.street+", ":"";var I=F("",A);I=F(I,B);I=F(I,E.city+", ");I=F(I,E.state+" ");
I=F(I,E.zipCode);var C=(nQ('<a href="#" class="nvt_roadLink">'+I.strip()+"</a>"));var G=function(){saveAddressAndCoordinate(I,H);
this.showNearby(D,E,H,true);document.widgetManager.backButton.record(this.id,this.displayResults.bind(this));
};C.click(G.bind(this));return C;},buildKeyRouteResultObj:function(C){var B=(nQ('<a href="#" class="nvt_roadLink">'+C.name+" "+Nvt.Util.cap1stLetters(Nvt.Util.scrubBound(C.direction))+"</a>"));
var A=this.keyRouteSelected.bind(this,C.id);B.click(A);return B;},buildMetroResultObj:function(B,A){var E=new Nvt.Data.Coordinate();
E.setCoords(A.boundingBox.centerPoint.lat,A.boundingBox.centerPoint.lon);var D=(nQ('<a href="#" class="nvt_roadLink">'+A.metroName+", "+A.metroStateName+"</a>"));
var C=function(){document.location=commonData.appServerName+"/"+A.metroName;};D.click(C);return D;},reset:function(B){var A=nQ("#nvt_search_results");
A.empty();A.html("");if(B!=false){A.append(Nvt.Util.getTableAd()[0]);}if(trafficMap){trafficMap.clearPopUpGeoLocation();
trafficMap.clearPopUpMetro();}},displayGeoLocation:function(D,E){var I=new Nvt.Data.Coordinate();var G=document.createElement("h1");
nQ(G).addClass("nvt_replace nvt_headline");var C=document.createElement("div");nQ(C).addClass("nvt_directionsLinks");
var F=commonData.appServerName+"/controller/routing?";if(E.metroName){G.innerHTML=E.metroName+", "+E.metroStateName;
var H=escape(E.metroName+", "+E.metroStateName);C.innerHTML=i18n.DirectionsColon+" <a href=\"javascript:document.location='"+F+"nvt_pointB="+H+"';\">"+i18n.tohere+"</a>, <a href=\"javascript:document.location='"+F+"nvt_pointA="+H+"';\">"+i18n.fromHere+"</a>";
I.setCoords(E.boundingBox.centerPoint.lat,E.boundingBox.centerPoint.lon);this.metroName=E.metroName;if(trafficMap){trafficMap.popUpMetro(E);
}}else{if(E.itemType){this.showTrafficItems(D,[E],"foundItem");}else{var A=E.name?(E.name+", "):"";var B=(E.street&&E.street!="")?E.street+", ":"";
G.innerHTML=(A+B+E.city+", "+E.state+" "+E.zipCode).strip();var H=E.street;if(H!=""){H+=", ";}H+=E.city+", "+E.state+" "+E.zipCode;
H=escape(H);C.innerHTML=i18n.DirectionsColon+" <a href=\"javascript:document.location='"+F+"nvt_pointB="+H+"';\">"+i18n.tohere+"</a>, <a href=\"javascript:document.location='"+F+"nvt_pointA="+H+"';\">"+i18n.fromHere+"</a>";
I.setCoords(E.location.lat,E.location.lon);if(trafficMap){trafficMap.popUpGeoLocation(E);}}}D.append(G);
D.append(C);return I;},displayResults:function(C){this.reset(false);this.cleanUp();var E=this.allData.presentationObjects;
if(E){var G=E.metros;var D=E.trafficItems;var F=E.roads;var B=E.geoLocation;}var A=nQ("#nvt_search_results");
if(F&&F.length==1){Nvt.Core.NvtAnalytics.virtual("/virtual/click/search/exactMatch");this.keyRouteSelected(F[0].id);
return ;}if(F&&F.length>1){if(trafficMap){trafficMap.setMapState(Nvt.Util.roadToMapState(F[0]));}this.disambiguate(A,F,this.buildKeyRouteResultObj.bind(this));
return ;}if(B&&(B.length==1||(B.length>0&&this.checkExact(B)))){Nvt.Core.NvtAnalytics.virtual("/virtual/click/search/exactMatch");
var H=new Nvt.Data.Coordinate();H.setCoords(B[0].location.lat,B[0].location.lon);this.showNearby(A,B[0],H);
return ;}if(B&&B.length>1){if(trafficMap){trafficMap.popUpGeoLocation(B[0]);}this.disambiguate(A,B,this.buildGeoLocationResultObj.bind(this,A));
return ;}if(G&&(G.length==1)){var H=new Nvt.Data.Coordinate();H.setCoords(G[0].boundingBox.centerPoint.lat,G[0].boundingBox.centerPoint.lon);
document.location=commonData.appServerName+"/"+G[0].metroName;return ;}if(G&&G.length>1){if(trafficMap){trafficMap.popUpMetro(G[0]);
}this.disambiguate(A,G,this.buildMetroResultObj.bind(this,A));return ;}if(D&&D.length==1){if(trafficMap){trafficMap.popUpTrafficItem(D[0]);
}var H=new Nvt.Data.Coordinate();H.setCoords(D[0].location.lat,D[0].location.lon);this.displayGeoLocation(A,D[0]);
return ;}if(D&&D.length>1){this.showTrafficItems(A,D);return ;}this.noResultsText(A);},checkExact:function(B){for(var A=0;
A<B.length;A++){if(B[A].exact&&B[A].exact=="true"){B.unshift(B[A]);return true;}}return false;},disambiguate:function(E,C,F){Nvt.Core.NvtAnalytics.virtual("/virtual/click/search/didYouMean");
var B=nQ("<div></div>").attr("class","nvt_selected");var D=F(C[0]);B.append(D);E.append(B);if(C.length>1){var J=nQ("<h2 class='nvt_error'>"+i18n.didYouMeanColon+'<a id="nvt_error_tsHelp" class="nvt_tsHelp" href="javascript:Nvt.Util.showHelp(\'helpDoYouMean\',\'Do you mean\', \'nvt_error_tsHelp\');" class="nvt_darkSmallLink"><img id="nvt_helpImg" src="'+commonData.staticServer("questionMark.gif")+i18n.imagesPath+i18n.imagesPathModal+'questionMark.gif"/></a>'+"</h2>");
E.append(J);var H=nQ("<ul></ul>").attr("class","nvt_striped");H.attr("id","nvt_roadList");for(var A=1;
A<C.length;A++){var G=document.createElement("li");var I=F(C[A]);G.appendChild(I[0]);H.append(G);}}E.append(H).append(Nvt.Util.getTableAd());
Nvt.Util.zebraStripe();},noResultsText:function(B){Nvt.Core.NvtAnalytics.virtual("/virtual/click/search/noResults");
var F=nQ("<h2 class='nvt_error'>"+i18n.sorryNotAbleToFindAnyResults+"<br> "+i18n.pleaseCheckYourSearchTryAgain+"</h2>");
B.append(F);var E=document.createElement("h3");E.innerHTML=i18n.OrBrowse+' <span id="nvt_noResultsMetro">'+this.metroName+"</span> "+i18n.areaTrafficLinksBelow;
B.append(E);var A=document.createElement("div");nQ(A).addClass("nvt_bTDiv ");A.setAttribute("id","nvt_bTDiv");
B.append(A).append(Nvt.Util.getTableAd());var D=new Nvt.Widget.BrowseTrafficLinksWidget(this.metroId,browseWidget.widgetContainerId,null,function(G){document.location=metroWSUrl+"?browse="+G;
});var C=new Nvt.Widget.SlideWidget("nvt_bTDiv",D,null,null);},showNearby:function(D,C,J,B){if(B){this.reset(false);
D.append(nQ('<a class="nvt_widgetBackLinkUpper">&laquo; '+i18n.backToSearchResults+"</a>").click(this.displayResults.bind(this)));
}this.displayGeoLocation(D,C);var G=nQ('<h3 class="nvt_subHeader" id="nvt_hsHeader">'+i18n.nearbyHotspots+"</h3>");
var A=nQ('<div class="nvt_hsDiv" id="nvt_hsDiv"></div>');D.append(G);D.append(A);var K=function(){document.widgetManager.getTabWidget().clickTab(null,i18n.searchTraffic,true);
};var I=function(){var M=metroSummary.metroSummary[0].metro.metroName;nQ("#nvt_hsDiv").empty();nQ("#nvt_hsHeader").empty();
nQ("#moreHotspots").empty();nQ("#nvt_tiSubHeader").empty();nQ("#nvt_tiDiv").empty();nQ("#moreIncidents").empty();
nQ(".nvt_moreLink").empty();try{nQ("#nvt_hsHeader").replaceWith('<h2 class="nvt_error nvt_noResults">'+i18n.noHotSpotsInArea+'</h2> <h3 class="nvt_bold_text">'+i18n.wouldYouLikeToBrowse+' <span id="nvt_noResultsMetro">'+M+"</span> "+i18n.areaTrafficLinksBelow+"</h3>");
}catch(N){Nvt.console.log(N);}var L=new Nvt.Widget.BrowseTrafficLinksWidget(metro_id,"nvt_hsDiv",null,function(O){document.location=metroWSUrl+"?browse="+O;
});L.display("nvt_hsDiv");};if(this.hotpots!=null){Nvt.Core.RefreshManager.getInstance().removeWidgetCallback(this.hotpots);
this.hotpots=null;}this.hotpots=new Nvt.Widget.HotspotWidget(this.metroId,"nvt_hsDiv",null,null,J,3,false,false,K,i18n.searchTraffic,I);
context=this;var H=nQ('<a id="moreHotspots" class="nvt_key_module">'+i18n.viewAll+" "+Nvt.Util.removeArea(this.metroName)+" "+i18n.areaHotSpots+"</a>");
H.click(function(){document.widgetManager.getTabWidget().clickTab(null,i18n.browseTraffic,false);context.createCustomBackLinks();
nQ("#"+browseWidget.widgetContainerId).empty();nQ("#nvt_browseTrafficNav a").removeClass("nvt_selected");
nQ("#nvt_browseTrafficNav a:contains('Hotspots')").addClass("nvt_selected");var L=new Nvt.Widget.HotspotWidget(this.metroId,browseWidget.widgetContainerId,null,null,J,null,false,false);
});D.append(H[0]);D.append(Nvt.Util.getTableAd(i18n.moreResultsBelow,true));var F=document.createElement("h3");
nQ(F).addClass("nvt_subHeader");F.innerHTML=i18n.nearbyIncidents;F.setAttribute("id","nvt_tiSubHeader");
D.append(F);var E=document.createElement("div");nQ(E).addClass("nvt_tiDiv");E.setAttribute("id","nvt_tiDiv");
D.append(E);this.trafficItems=new Nvt.Widget.TrafficItemsWidget(null,"nvt_tiDiv",null,null,false,J,3);
var H=nQ('<a id="moreIncidents" class="nvt_key_module">'+i18n.viewAll+" "+Nvt.Util.removeArea(this.metroName)+" "+i18n.areaIncidents+"</a>");
H.click(function(){document.widgetManager.getTabWidget().clickTab(null,i18n.browseTraffic,false);context.createCustomBackLinks();
nQ("#"+browseWidget.widgetContainerId).empty();nQ("#nvt_browseTrafficNav a").removeClass("nvt_selected");
nQ("#nvt_browseTrafficNav a:contains('Incidents')").addClass("nvt_selected");var L=new Nvt.Widget.TrafficItemsWidget(Nvt.Widget.TrafficItemConstants.INCIDENT,browseWidget.widgetContainerId,null,null,false,J);
});D.append(H);if(B){D.append(nQ('<a class="nvt_widgetBackLinkLower">&laquo; '+i18n.backToSearchResults+"</a>").click(this.displayResults.bind(this)));
}},createCustomBackLinks:function(){if(!this.backLinksCreated){var C=document.widgetManager.getSlideWidget();
var A=C.createBackLink("upper","Back to Search Traffic");var B=C.createBackLink("lower","Back to Search Traffic");
nQ(C.DOM).find("#nvt_widgetWrap0").prepend(A);nQ(C.DOM).find("#nvt_widgetWrap0").append(B);var D=function(){document.widgetManager.getTabWidget().clickTab(null,i18n.searchTraffic,false);
};A.click(D);B.click(D);this.backLinksCreated=true;}},showTrafficItems:function(A,C,F){if(!F){var F="nvt_tiDiv";
}var D=nQ('<h3 class="nvt_subHeader">'+i18n.foundIncidents+"</h3>");var B=nQ('<div class="nvt_tiDiv" id="'+F+'"></div>');
var E=nQ('<a class="nvt_key_module noLink" id="moreIncidents">'+i18n.viewAll+" "+Nvt.Util.removeArea(this.metroName)+" "+i18n.areaIncidents+"</a>");
E.click(function(){document.widgetManager.getTabWidget().clickTab(null,i18n.browseTraffic,true);});A.append(D).append(B).append(E);
this.trafficItems=new Nvt.Widget.TrafficItemsWidget(null,F,C,null,true,null,3);},AIRPORT_CODE:3,CLASS_NAME:"Nvt.Widget.SearchWidget"};
Object.extend(Nvt.Widget.SearchWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.SearchWidget.DELIMITER="|";
Nvt.Widget.DriveListWidget=Class.create();Nvt.Widget.DriveListWidget.prototype={initialize:function(B,A,C){this.initializeWidget();
this.backLinkText=i18n.backtoMyDrives;this.divId=A;this.metroId=C;this.data=B;this.displayAd=true;this.defaultSortField="name";
this.defaultSortOrder="alpha";includeList=["name","jamFactor","driveTime","delay","incidents"];this.formatter=new Nvt.Formatter.DriveListFormatter(includeList,C);
this.formatter.parentWidgetName="DriveList";this.deletedDrive="";this.getData();},getRestUrl:function(){var A=commonData.restServerName+"/drives?var="+this.id;
return A;},postInit:function(){this.data=this.data.drives;var N=i18n.drives;if(this.data.length==1){var N=i18n.drive;
}var J=nQ('<h1 class="nvt_headline">'+i18n.youHave+" "+this.data.length+" "+N+"</h1>");var B=this;if(this.data.length==0){var A=nQ('<div id="nvt_noDrives" class="nvt_nothingSetup"></div>');
var I=nQ('<h2 class="nvt_bold_text">'+i18n.getStarted+"</h2>");var C=nQ('<a href="#" class="nvt_button"><span class="nvt_buttonLeft"/><h1>'+i18n.addADrive+'</h1><span class="nvt_buttonRight"/></a>');
C.click(function(){B.loadData(commonData.appServerName+"/controller/checkDriveLimit?var=response",B.addDriveLinkClickResponse.bind(this));
nQ("#nvt_driveLimitError").empty();});var D=nQ('<img src="'+commonData.staticServer("driveSample.gif")+i18n.imagesPath+'ws-my/driveSample.gif" alt="" />');
nQ(this.DOM).append(A);A.append(J).append(I).append(C).append(D);}else{var H=nQ('<div id="nvt_status"></div>').hide();
var F=nQ('<div id="nvt_driveNav"></div>');var E=nQ('<div id="nvt_deletedDrive"></div>').hide();var G=nQ('<ul class="nvt_info_subNav"></ul>');
var M=nQ('<li><a id="AddDriveLink" href="#">'+i18n.addADrive+"</a>|</li>");M.click(function(){B.loadData(commonData.appServerName+"/controller/checkDriveLimit?var=response",B.addDriveLinkClickResponse.bind(this));
nQ("#nvt_driveLimitError").empty();});if(this.data.length>1){var L=nQ('<li><a id="ReorderDriveLink">'+i18n.reorderDrives+"</a>|</li>").click(this.openDriveModel.bind(this));
}var K=nQ('<li><a id="RssFeedLink">'+i18n.myTrafficNews+"</a></li>").click(this.slideInMyRssModal.bind(this));
G.append(M).append(L).append(K);F.append(G);nQ(this.DOM).append(J).append(H).append(F).append(E);this.table=new Nvt.Widget.TableWidget(this.formatter,this.data,this.defaultSortField,this.defaultSortOrder,this.displayAd,i18n.moreDrivesBelow);
this.table.parentWidgetName="Nvt.Widget.DriveListWidget";this.table.display(this.id);if(this.deletedDrive!=""){nQ("#nvt_deletedDrive").addClass("nvt_error").html(i18n.yourDrive+" <strong>"+this.deletedDrive+"</strong> "+i18n.hasBeenDeleted+".").show();
this.deletedDrive="";document.widgetManager.getSlideWidget().animateHeight();}}},addDriveLinkClickResponse:function(){if(response.limitExceeded=="true"){if(nQ("#nvt_driveLimitError").length>0){nQ("#nvt_driveLimitError")[0].innerHTML=i18n.driveLimitExceeded;
}else{nQ("#nvt_driveNav").append(nQ("<ul ><li id='nvt_driveLimitError' class='nvt_error'>"+i18n.driveLimitExceeded+"</li></ul>"));
}return false;}else{window.location.href="/controller/routing";}},slideInMyRssModal:function(){var A=new Nvt.Widget.MyRssWidget();
document.widgetManager.getSlideWidget().push(A,null);},openDriveModel:function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":290,"width":300},"href":commonData.appServerName+"/controller/getDriveOrder?metroId="+this.metroId,"id":"ReorderDriveLink","noBind":true,"title":i18n.reorderDrives});
document.nvtModalManager.toggle("ReorderDriveLink");},postDisplay:function(){document.widgetManager.getSlideWidget().toggleDisplay(this.id);
this.finalExecution();},refreshCallback:function(B,A){this.data=null;this.divId=null;nQ(this.DOM).empty();
if(B){this.metroId=B;}this.getData(true);},CLASS_NAME:"Nvt.Widget.DriveListWidget"};Object.extend(Nvt.Widget.DriveListWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.CitySelectWidget=Class.create();Nvt.Widget.CitySelectWidget.prototype={initialize:function(D,B,C,A){this.content={"us":"<div id='nvt_us'><map name='nvt_regions'><area id='us_northeast' shape='polygon' coords='220,55,227,45,239,32,263,5,272,5,283,20,274,49,255,71,245,67,223,71'><area id='us_southeast' shape='polygon' coords='226,72,250,68,257,74,260,97,232,133,247,162,246,171,239,173,225,157,218,144,210,146,195,143,195,136,209,136,203,108,210,107,222,96,213,97,219,89,216,85,223,71'><area id='us_south' shape='polygon' coords='104,96,151,96,151,100,220,93,208,107,202,108,207,135,192,136,195,143,185,143,188,151,154,151,138,175,123,169,99,151,91,145,81,129,102,128,104,96'><area id='us_west' shape='polygon' coords='12,0,105,12,101,67,112,68,112,97,105,96,104,131,74,130,74,133,58,132,36,119,22,118,0,92,0,63'><area id='us_midwest' shape='polygon' coords='106,14,149,13,179,20,205,32,212,44,214,55,223,57,225,75,218,84,221,89,215,97,153,103,152,99,112,99,113,71,104,70'></map><img id='nvt_usRegions' usemap='#nvt_regions' border='2' src='"+commonData.staticServer(i18n.citySelectTransparentPixel)+i18n.citySelectTransparentPixel+"'/></div>","cityList":"<div class='nvt_cityList'><div class='nvt_innerCityList'><h1>"+i18n.region+"</h1><h2>"+i18n.clickCityBelowToViewYourMetroRegion+"<span><a><img border='0' src='"+commonData.staticServer(i18n.citySelectMetroClose)+i18n.citySelectMetroClose+"'/></a></span></h2></div></div>"};
this.initializeWidget();this.divId=B;this.mapId=D;this.activeMetroId=A;this.data=C;if(this.data&&!this.data.thrown&&Nvt.Util.isValid(C)){this.postInit(C.presentationObjects.metros);
}else{this.retrieveDtos(this.mapId);}},postInit:function(A){this.dtos=A;this.mapContent=nQ(this.retrieveMap(this.mapId));
this.hoverDiv=nQ('<div id="nvt_mapHover"><span>&nbsp;</span></div>');this.activeDiv=nQ('<div id="nvt_mapActive"><span>&nbsp;</span></div>');
this.mapContent.prepend(this.activeDiv);this.mapContent.prepend(this.hoverDiv);this.mapPoints=new Array();
this.mapPointIds=new Array();for(var B=0;B<this.dtos.length;B++){this.addMapPoint(this.dtos[B]);}if(this.divId){this.display(this.divId);
}},retrieveMap:function(A){return this.content[A];},retrieveDtos:function(B){var A=this;this.loadData(commonData.restServerName+"/metros?var=metros&dataSet=all&mapId="+B,function(C){A.postInit(metros.presentationObjects.metros);
});},mapPointStatus:function(A,C){var B;if(C){B=this.mapPointIds[C];}else{B=this;}B.div.removeClass();
B.div.addClass("nvt_mapPoint");if(B.activeMapPoint){B.div.addClass("current");}else{B.div.addClass(A);
}},addMapPoint:function(A){if(A.metroId==this.activeMetroId){A.activeMapPoint=1;this.activeMapPointRegion=A.metroMap.region;
}coordinates=A.metroMap.coordinates.split(",");A.div=nQ('<div title="'+A.metroName+'" class="nvt_mapPoint" style="left:'+coordinates[0]+"px; top:"+coordinates[1]+'px"><span></span></div>');
A.div.bind("click",function(){Nvt.Util.createCookie("sessionMetroId",A.metroId,30);Nvt.Core.NvtAnalytics.virtual("/virtual/click/CitySelect/"+A.metroName);
var B=A.legacyDir;window.location.href=commonData.appServerName+"/"+B+"/"+B+"-Reports.html";});this.mapContent.append(A.div);
A.status=this.mapPointStatus;A.status();this.mapPointIds[A.metroId]=A;this.mapPoints.push(A);},regionHover:function(A){if(A){if(this.currentHover){this.hoverDiv.removeClass(this.currentHover);
}this.hoverDiv.addClass(A);this.hoverDiv.css("visibility","visible");this.currentHover=A;}else{this.hoverDiv.css("visibility","hidden");
}},regionActive:function(B){if(this.metroSummaryWidget){this.metroSummaryWidget.hide();}if(B){if(this.currentRegion){this.activeDiv.removeClass(this.currentRegion);
}this.activeDiv.addClass(B);this.activeDiv.css("visibility","visible");this.currentRegion=B;this.mapPointList(B);
for(var A=0;A<this.mapPoints.length;A++){mapPoint=this.mapPoints[A];if(typeof (mapPoint)=="function"){continue;
}if(mapPoint.metroMap.region==B){mapPoint.status("active");}else{mapPoint.status();}}this.cityListDiv.fadeIn("slow");
}else{this.activeDiv.css("visibility","hidden");this.cityListDiv.fadeOut("slow");this.cityListDiv.css("display","none");
for(var A=0;A<this.mapPoints.length;A++){mapPoint=this.mapPoints[A];if(typeof (mapPoint)=="function"){continue;
}mapPoint.status("");}if(this.metroSummaryWidget){this.metroSummaryWidget.show();}}},mapPointList:function(H){var E=nQ("<ul></ul>");
var F=new Array();for(var D=0;D<this.mapPoints.length;D++){mapPoint=this.mapPoints[D];if(mapPoint.metroMap.region==H){F.push(mapPoint);
}}var G=new Nvt.Widget.ColumnListWidget(F);G.generateColumns("metroName",3,function(K){var J=K.legacyDir;
var I=commonData.appServerName+"/"+J+"/"+J+"-Reports.html";return"<td id='"+K.metroId+"'><a href='"+I+"' onclick=\"Nvt.Util.createCookie('sessionMetroId', "+K.metroId+',30);">'+K.metroName+"</a></td>";
});var B=nQ(G.returnHtml());var C=this;B.find("tr td").each(function(){if(this.id){nQ(this).bind("mouseover",function(){C.mapPointStatus("hover",this.id);
});nQ(this).bind("mouseout",function(){C.mapPointStatus("active",this.id);});nQ(this).bind("click",function(){});
}});var A=(H.split("_"))[1];A=A.substr(0,1).toUpperCase()+A.substr(1);this.cityListDiv.find(".nvt_innerCityList table").remove();
this.cityListDiv.find(".nvt_innerCityList h1").text(A);this.cityListDiv.find(".nvt_innerCityList").append(B);
},CLASS_NAME:"Nvt.Widget.CitySelectWidget"};Object.extend(Nvt.Widget.CitySelectWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.CitySelectWidget.prototype.display=function(A){this.containerDiv=nQ("#"+A);this.containerDiv.append(this.mapContent);
this.containerDiv.append(this.content["cityList"]);this.containerDiv.find(".nvt_innerCityList span").bind("click",function(){B.regionActive();
});var B=this;this.containerDiv.find("map area").bind("mouseover",function(){B.regionHover(this.id);});
this.containerDiv.find("map area").bind("mouseout",function(){B.regionHover();});this.containerDiv.find("map area").bind("click",function(){B.regionActive(this.id);
});this.cityListDiv=this.containerDiv.find(".nvt_cityList");this.finalExecution();};Nvt.Widget.NotLoggedInWidget=Class.create();
Nvt.Widget.NotLoggedInWidget.prototype={initialize:function(N){this.resultPath="";if(N){this.resultPath=N;
}this.initializeWidget();var L=nQ('<span id="errmsg" class="nvt_error"></span>');var J=nQ("<div id='nvt_login'></div>");
var C=nQ('<form name="myTrafficLogin" id="myTrafficLogin" method="post" ></form>');C.bind("onsubmit",this.submitLogin.bind(this));
C.append(nQ('<input type="hidden" name="resultPath" value="'+this.resultPath+'">'));C.append(nQ('<input type="hidden" name="var" value="loginResponse">'));
if(commonData.pageType=="metro"){C.append(nQ("<h1 class='nvt_error'>"+i18n.accessEvenMoreRecentlyViewdRoadSignin+"</h1>"));
}else{C.append(nQ("<h2 class='nvt_bold_text nvt_headline'>"+i18n.registeredUser+"</h2>"));}C.append(nQ("<div id='nvt_usernameField'><label id='nvt_labelUsername' for='nvt_username' >"+i18n.usernameColon+"</label><input id='nvt_username' name=\"username\" type='text' class='nvt_text' /></div>"));
C.append(nQ("<div id='nvt_passwordField'><label id='nvt_labelPassword' for='nvt_password'>"+i18n.passwordColon+"</label><input id='nvt_password' name=\"password\" type='password' class='nvt_text' /></div>"));
var D=nQ("<div id='nvt_rememberMeField'><input type='checkbox' checked='checked' name=\"rememberMe\" id='nvt_rememberMe' align='left'></input><label id='nvt_labelRememberMe' for='nvt_rememberMe'>"+i18n.rememberMe+"</label></div>");
C.append(D);var S=nQ("<a class='nvt_button' ><span class='nvt_buttonLeft'></span><h1>"+i18n.signIn+"</h1><span class='nvt_buttonRight'></span></a>");
S.click(this.submitLogin.bind(this));C.append(S);var I=nQ("<a class='nvt_forgotPassword' >"+i18n.forgotyourpassword+"</a>");
I.click(headerLinks.showForgotPassword);C.append(I);nQ(this.DOM).append(L);J.append(C);J.appendTo(nQ(this.DOM));
var A=nQ("<div></div>").attr("id","nvt_register");A.append(nQ("<h2 class='nvt_bold_text nvt_headline'>"+i18n.notRegisteredUser+"</h2>"));
A.append(nQ("<h3 class='nvt_bold_text'>"+i18n.signUpFree+"</h3>"));var O=nQ("<a class='nvt_button'><span class='nvt_buttonLeft'></span><h1>"+i18n.buttonGo+"</h1><span class='nvt_buttonRight'></span></a>");
O.click(this.showSignUp.bind(this));A.append(O);var R=nQ("<ul id='nvt_featureList'></ul>");var F=nQ('<li id="nvt_feature1"><h4>'+i18n.setUpRoutes+"</h4></li>");
var B=nQ("<ul></ul>");var E=nQ("<li>"+i18n.currentConditionsRouteYouDrive+"</li>");B.append(E);var Q=nQ("<li>"+i18n.TodayBestCommuteBasedOnSecondInfo+"</li>");
B.append(Q);F.append(B);R.append(F);var G=nQ('<li id="nvt_feature2"><h4>'+i18n.cReceive+"<br/>"+i18n.hAlerts+"</h4></li>");
var T=nQ("<ul></ul>");var H=nQ("<li>"+i18n.stayConnectedMostCurrentTrafficNews+"</li>");T.append(H);var M=nQ("<li>"+i18n.notifiedWhenTingsHappenOnYouRoute+"</li>");
T.append(M);G.append(T);R.append(G);var K=nQ('<li id="nvt_feature3"><h4>'+i18n.getDetoursAlternates+"</h4></li>");
var P=nQ("<ul></ul>");var H=nQ("<li>"+i18n.getDetoursOnTheSpotChangingConditions+"</li>");P.append(H);
var M=nQ("<li>"+i18n.giveYourselfOptionsWhenGetGridlocked+"</li>");P.append(M);K.append(P);R.append(K);
A.append(R);A.appendTo(this.DOM);nQ(this.DOM).append(Nvt.Util.getPrivacyPolicy());},registerEnterKey:function(A){if(A.keyCode==13){this.submitLogin();
}},submitLogin:function(){nQ("#errmsg").html("");var B=commonData.secureServerName+"/controller/doLogin?";
Nvt.console.log(document.myTrafficLogin.elements);for(var C=0;C<document.myTrafficLogin.elements.length;
C++){B+=document.myTrafficLogin.elements[C].name+"="+document.myTrafficLogin.elements[C].value+"&";}Nvt.console.log("url is"+B);
var A={method:"get",onComplete:this.handleLoginResponse.bind(this),onException:this.handleLoginError.bind(this)};
var D=nQ.getScript(B,this.handleLoginResponse.bind(this));Nvt.console.log("request is"+D);},handleLoginResponse:function(A){Nvt.console.log("in response"+loginResponse);
this.handleLoginError();if(Nvt.Util.isLoggedIn()){Nvt.console.log("Logged in.");if(loginResponse&&loginResponse.resultPath){Nvt.console.log("Result Path: "+loginResponse.resultPath);
document.location.href=commonData.appServerName+loginResponse.resultPath;}else{Nvt.console.log("Redirecting to myTraffic");
document.location.href=commonData.appServerName+"/controller/myTraffic";}}else{Nvt.console.log("Not logged in.");
}},handleLoginError:function(){nQ("#errmsg").css("display","block");if(loginResponse.ERRORMAP&&loginResponse.ERRORMAP.InvalidUsernameOrPassword){nQ("#errmsg").html(loginResponse.ERRORMAP.InvalidUsernameOrPassword);
document.widgetManager.getSlideWidget().animateHeight();}else{if(loginResponse.thrown){nQ("#errmsg").html(loginResponse.thrown);
document.widgetManager.getSlideWidget().animateHeight();}}},showSignUp:function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":590,"width":560},"href":commonData.appServerName+"/controller/showCreateAccount?metroId="+metro_id+"&resultPath="+this.resultPath,"id":"nvt_signUp","noBind":true,"title":i18n.signUp});
document.nvtModalManager.toggle("nvt_signUp");},showForgotPassword:function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":235,"width":600},"href":commonData.appServerName+"/controller/dispatch?jspName=userregistration/forgotPassword","id":"nvt_forgotPassword","noBind":true,"title":i18n.loginpageForgotPassword});
document.nvtModalManager.toggle("nvt_forgotPassword");},CLASS_NAME:"Nvt.Widget.NotLoggedInWidget"};Object.extend(Nvt.Widget.NotLoggedInWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.NotLoggedInWidget.prototype.display=function(A){nQ("#"+A).append(this.DOM);this.finalExecution(A);
nQ("#"+A).find("input").keydown(this.registerEnterKey.bind(this));};Nvt.Widget.WidgetManager=Class.create();
Nvt.Widget.WidgetManager.prototype={initialize:function(){this.widgetCount=0;this.tableCount=0;this.browseTrafficHeight=0;
if(Nvt.Widget.WidgetManager.authKey){this.authKey=Nvt.Widget.WidgetManager.authKey;}this.backButton=new Nvt.Core.BackButton();
this.backButton.registerCallback(this.browserBackButtonPress.bind(this));},getWidgetId:function(){return this.widgetCount++;
},getTableId:function(){return this.tableCount++;},setSlideWidget:function(A){this.slideWidget=A;},getSlideWidget:function(){return this.slideWidget;
},setTabWidget:function(A){this.tabWidget=A;},getTabWidget:function(){return this.tabWidget;},setAuthKey:function(A){this.authKey=A;
},getHash:function(){if(!this.restUrlHash){this.restUrlHash=new Hash();}return this.restUrlHash;},refreshHeaderLinks:function(){this.headerLinks.refreshCallback();
},isCachedUrl:function(B){restUrlHash=this.getHash();var E=B.split("?");var D=E[1].split("&");D.sort();
var F=E[0];for(var C=0;C<D.length;C++){F+=D[C];}var A=restUrlHash.get(F);if(A){if(new Date()-A<this.CACHE_TIMEOUT){return true;
}}restUrlHash.set(F,new Date());return false;},browserBackButtonPress:function(A){Nvt.console.log("Widget Manager: back button");
},CACHE_TIMEOUT:60000,CLASS_NAME:"Nvt.Widget.WidgetManager"};Nvt.Widget.TableTwistyWidget=Class.create();
Nvt.Widget.TableTwistyWidget.prototype={initialize:function(A,C,B){this.initializeWidget();this.rowId=A;
this.colspan=C;this.hiddenDiv=nQ('<div id="'+this.id+'_hidden" class="nvt_twistyContent" style="display: none;overflow: hidden;">').append(B);
nQ(this.DOM).append(this.hiddenDiv);this.twisty=nQ('<div class="nvt_twistyCarrot"></div>');nQ("#"+A+" td:first").prepend(this.twisty);
nQ("#"+A).click(this.twist.bind(this));},twist:function(){var A=0;if(nQ("#"+this.id+"_hidden:hidden").size()==1){nQ("#"+this.rowId).addClass("nvt_expanded");
nQ("#"+this.rowId+" + tr:first").show();var A=nQ("#"+this.id+"_hidden").height();if(document.widgetManager){document.widgetManager.getSlideWidget().animateHeightTwisty(A);
}nQ("#"+this.id+"_hidden").show();var C=this.id;if(nQ.browser.msie&&parseInt(nQ.browser.version)==6){nQ("html table.nvt_striped tbody tr.nvt_twistHidden td .nvt_roadDetails").css("margin-left","10px");
}}else{nQ("#"+this.rowId).removeClass("nvt_expanded");var A=nQ("#"+this.id+"_hidden").height()*-1;if(document.widgetManager){document.widgetManager.getSlideWidget().animateHeightTwisty(A);
}nQ("#"+this.id+"_hidden").hide();var B=this;setTimeout(function(){nQ("#"+B.rowId+" + tr:first").hide();
},1000);}},CLASS_NAME:"Nvt.Widget.TableTwistyWidget"};Object.extend(Nvt.Widget.TableTwistyWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.TableTwistyWidget.prototype.display=function(){var B=nQ('<tr id="'+this.rowId+'_hidden" class="nvt_twistHidden" style="display:none;"></tr>');
var A=nQ("<td colspan='"+this.colspan+'\' class="nvt_last"></td>');A.append(this.DOM);B.append(A);nQ("#"+this.rowId).after(B);
if(nQ("#"+this.rowId).hasClass("nvt_rowAlt")){B.addClass("nvt_rowAlt");}};Nvt.Widget.MyRssWidget=Class.create();
Nvt.Widget.MyRssWidget.prototype={initialize:function(){this.initializeWidget();},postDisplay:function(){var A=nQ("<iframe name='myRssIFrame' scrolling='no' allowtransparency='true' frameborder='0' src='"+commonData.appServerName+"/controller/myrss'></IFRAME>");
nQ(this.DOM).append(A);document.widgetManager.getSlideWidget().toggleDisplay(this.id);document.widgetManager.getSlideWidget().animateSlider();
this.finalExecution();},CLASS_NAME:"Nvt.Widget.MyRssWidget"};Object.extend(Nvt.Widget.MyRssWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.AccountSettingsWidget=Class.create();Nvt.Widget.AccountSettingsWidget.prototype={initialize:function(){this.initializeWidget();
var A=nQ('<div id="nvt_accountSettingsContent">'+'<div id="nvt_accountSettingsContent">'+'<h1 class="nvt_headline">'+i18n.manageAccount+"</h1>"+'<ul id="nvt_accountSettingLinks">'+"<li>"+'<h2><a id="nvt_changePassword" onclick="Nvt.Core.NvtAnalytics.virtual(\'/virtual/click/accountmanagement/changepassword\')">'+i18n.changePassword+"</a></h2>"+'<p class="nvt_hint">'+i18n.changePasswordHint+"</p>"+"</li>"+"<li>"+'<h2><a id="nvt_changeContactInformation" onclick="Nvt.Core.NvtAnalytics.virtual(\'/virtual/click/accountmanagement/contactinfo\')">'+i18n.changeContactInformation+"</a></h2>"+'<p class="nvt_hint">'+i18n.changeContactInformationHint+"</p>"+"</li>"+"<li>"+'<h2><a id="nvt_cancelAccount" onclick="Nvt.Core.NvtAnalytics.virtual(\'/virtual/click/accountmanagement/cancelaccount\');">'+i18n.cancelAccount+"</a></h2>"+'<p class="nvt_hint">'+i18n.cancelAccountHint+"</p>"+"</li>"+"</ul>"+"</div>"+"</div>");
this.DOM.appendChild(A[0]);this.DOM.appendChild(Nvt.Util.getPrivacyPolicy()[0]);},postDisplay:function(){new Nvt.Widget.Modal(false,{"dimensions":{"height":170,"width":500},"href":commonData.appServerName+"/controller/dispatch?jspName=userregistration/changePassword","id":"nvt_changePassword","title":i18n.changePassword});
new Nvt.Widget.Modal(false,{"dimensions":{"height":540,"width":500},"href":commonData.appServerName+"/controller/showMyContactInfo?isUpdate=true","id":"nvt_changeContactInformation","title":i18n.changeContactInformation,"random":true});
new Nvt.Widget.Modal(false,{"dimensions":{"height":50,"width":550},"href":commonData.appServerName+"/controller/dispatch?jspName=userregistration/deactivate_account","id":"nvt_cancelAccount","title":i18n.cancelAccount});
this.finalExecution();},openModal:function(C,A,B,D){new self.parent.Nvt.Widget.Modal(false,{"dimensions":{"height":A,"width":B},"href":commonData.appServerName+C,"id":D,"noBind":true,"title":D});
self.parent.document.nvtModalManager.toggle(D);},CLASS_NAME:"Nvt.Widget.AccountSettingsWidget"};Object.extend(Nvt.Widget.AccountSettingsWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.DriveDetailsWidget=Class.create();Nvt.Widget.DriveDetailsWidget.prototype={initialize:function(C,A,D,B){this.initializeWidget();
this.divId=A;this.driveId=D;this.data=C;this.options=B;this.userTicket=Nvt.Util.readCookie("regticket");
this.pageTitle=i18n.hdrive+" :: "+i18n.trafficDotCom;this.setPageTitle(this.pageTitle);this.getData();
},getRestUrl:function(){var A=commonData.restServerName+"/drives?var="+this.id+"&userTicket="+this.userTicket+"&driveList="+this.driveId;
return A;},postInit:function(){if(this.data.drives){this.data=this.data.drives[0];}if(this.options&&this.options.moveMap){var K=Nvt.Util.driveToMapState(this.data);
if(trafficMap){trafficMap.setMapState(K);}}var e=this.data.name;var A=this.data.id;var F=this.data.alertTypeCount;
this.metroId=this.data.metroId;this.dataroutes=this.data.routes[0];var U=F.EMAIL?F.EMAIL:0;var Q=F.PHONE?F.PHONE:0;
var R=F.SMS?F.SMS:0;var O=parseInt(U)+parseInt(Q)+parseInt(R);if(O<1){var G=i18n.addAlert;}else{var G=i18n.hEditAlert;
}var J=nQ('<h1 id="nvt_driveHead">'+e+"</h1>");var N=nQ('<ul class="nvt_info_subNav"></ul>');N.append(nQ('<li><a id="AddEditAlertsLink">'+G+"</a>|</li>").bind("click",this.addAlertsClosure(G)));
N.append(nQ('<li><a id="RenameLink">'+i18n.renameDrive+"</a>|</li>").bind("click",this.renameDriveClosure()));
N.append(nQ('<li><a id="PrintDriveLink">'+i18n.printDrive+"</a>|</li>").bind("click",this.drivePrintClosure(A)));
N.append(nQ('<li><a id="BookmarkDriveLink">'+i18n.bookmarkDrive+"</a>|</li>").click(this.bookmarkDrive(A,e)));
N.append(nQ('<li><a id="DeleteDriveLink">'+i18n.deleteDrive+"</a></li>").bind("click",this.deleteDriveClosure()));
var E=nQ('<div id="nvt_renameDriveModal" style="display: none">'+"<span><input id='nvt_renameDrive' type='text' class='nvt_text' value=\""+e+'" maxlength="30"/></span>'+"<a class='nvt_button goLink'><span class='nvt_buttonLeft'></span><h1>"+i18n.buttonGo+"</h1><span class='nvt_buttonRight'></span></a>"+"</div>");
var P=function(){var g=nQ("#nvt_renameDrive").val();nQ("#nvt_renameDriveModalError").hide();if(g!=""){var f=commonData.appServerName+"/controller/renameDrive?commuteId="+A+"&driveName="+g+"&metroId="+this.metroId+"&userTicket="+this.userTicket+"&var=renameDrive";
this.loadData(f,this.handleRenameDrive.bind(this));}else{nQ("#nvt_renameDriveModalError").addClass("nvt_error").html("You must enter a drive name").show();
}};E.find(".nvt_button").click(P.bind(this));var C=nQ('<div id="nvt_deleteDriveModal" style="display: none">'+"<span>"+i18n.areYouSureWantDeleteDrive+" <b>"+e+"</b>? "+i18n.alertsAssociatedWithThisDriveDeleted+"</span>"+"<span><a id='nvt_deleteDriveCancel' onclick='javascript:document.nvtModalManager.hide(\"#nvt_driveDetailsInplace\");'>"+i18n.buttonCancel+"</a></span>"+"<a class='nvt_button goLink'><span class='nvt_buttonLeft'></span><h1>"+i18n.buttonGo+"</h1><span class='nvt_buttonRight'></span></a>"+"</div>");
var D=function(){var g=A;var f=commonData.appServerName+"/controller/deleteDrive?commuteId="+g+"&metroId="+this.metroId+"&userTicket="+this.userTicket+"&var=deleteDrive";
this.loadData(f,this.handleDeleteDrive.bind(this));C.find(".nvt_button").unbind("click",D);};C.find(".nvt_button").click(D.bind(this));
var Y=nQ('<table class="nvt_roadDetails"></table>');var b=Nvt.Util.getJFImageString(this.dataroutes.driveReport.jamFactor);
var I=Nvt.Util.getJFImageString(this.dataroutes.driveReport.jamFactor,true);var L=nQ("<tr><th>"+i18n.jamFactorColon+'</td><td><div class="nvt_jamFactor nvt_jamFactor'+Nvt.Util.getJFClass(this.dataroutes.driveReport.jamFactor)+'"><img src="'+commonData.staticServer(b)+i18n.imagesPath+i18n.imagesPathJamfactor+b+'" /></div><div class="nvt_jamFactorPrint"><img src="'+commonData.staticServer(I)+i18n.imagesPath+i18n.imagesPathJamfactor+I+'" /></div></td></tr>');
var W=nQ("<tr><th>"+i18n.currentDriveTimeColon+"</td><td>"+Nvt.Util.parseTimeToHoursAndMinutes(this.dataroutes.driveReport.driveTime)+"</td></tr>");
var B=nQ("<tr><th>"+i18n.atSpeedLimitColon+"</td><td>"+Nvt.Util.parseTimeToHoursAndMinutes(this.dataroutes.driveReport.driveTime-this.dataroutes.driveReport.delay)+"</td></tr>");
var T=nQ("<tr><th>"+i18n.delayColon+"</td><td>"+Nvt.Util.parseTimeToHoursAndMinutes(this.dataroutes.driveReport.delay)+"</td></tr>");
var S=nQ("<tr><th>"+i18n.averageSpeedColon+"</td><td>"+Nvt.Util.parseAverageSpeed(this.dataroutes.driveReport.averageSpeed)+"</td></tr>");
Y.append(L).append(W).append(B).append(T).append(S);var Z=nQ('<div id="nvt_driveDetailsInplace" class="nvt_inPlaceModalWrapper"></div>');
nQ(this.DOM).append(J).append(N).append(Z).append(E).append(C).append(Y);var X=new Nvt.Widget.AlertActionWidget(F,this.metroId,this.data.id);
X.display(this.id);nQ(this.DOM).append(X.content);var M=false;if(this.dataroutes.roads&&this.dataroutes.roads.length>0){M=true;
}nQ(this.DOM).append(Nvt.Util.getTableAd("More drive details below",M));if(this.dataroutes.roads&&this.dataroutes.roads.length>0){var H=["name","jamFactor","incidents"];
var V=new Nvt.Formatter.DriveDetailsFormatter(H);this.tableWidget=new Nvt.Widget.TableWidget(V,this.dataroutes.roads);
this.DOM.appendChild(this.tableWidget.DOM);this.tableWidget.display(this.id);if(this.driveId){this.afterRestCall();
}}},twistyFactory:function(B,D,C){var A=new Nvt.Widget.TableTwistyWidget(B,D,C);return A;},addAlertsClosure:function(B){var C=this.metroId;
var A=this.data.id;var D=function(E){new Nvt.Widget.Modal(false,{"dimensions":{"height":9000,"width":620},"href":commonData.appServerName+"/controller/showAlerts?metroId="+C+"&commuteId="+A,"id":"AddEditAlertsLink","noBind":true,"title":B});
document.nvtModalManager.toggle("AddEditAlertsLink");};return D;},handleRenameDrive:function(){var B=renameDrive;
if(B.renameDriveSuccess=="TRUE"){var A=nQ("#nvt_renameDrive").val();nQ("#nvt_driveHead").html(A);document.widgetManager.getSlideWidget().widgets[0].refreshCallback();
}document.nvtModalManager.hide("#nvt_driveDetailsInplace");},handleDeleteDrive:function(){var A=deleteDrive;
if(typeof (A.driveName)!="undefined"){document.widgetManager.getSlideWidget().widgets[0].deletedDrive=A.driveName;
document.widgetManager.getSlideWidget().pop();}if(typeof (A.thrown)!="undefined"){alert("There was a problem deleting your drive.  Please contact customer support.");
}alertList.refreshCallback();document.nvtModalManager.hide("#nvt_driveDetailsInplace");},renameDriveClosure:function(){var A=function(B){setTimeout(function(){document.widgetManager.getSlideWidget().animateHeight();
},1000);};return A;},bookmarkDrive:function(C,B){var A=function(){Nvt.Util.bookmark(commonData.appServerName+"/controller/myTraffic?driveId="+C,B);
};return A;},drivePrintClosure:function(B){var A=function(){if(trafficMap.theTrafficMap.isMapClientReady==null){Nvt.console.debug("map not ready, retry...");
setTimeout("printClosure",5000);}else{var D=trafficMap.getCurrentMapState();var C=commonData.appServerName+"/controller/drivePrint?driveId="+B+"&NWLat="+D.boundingBox.NWCoordinate.latitude+"&NWLon="+D.boundingBox.NWCoordinate.longitude+"&SELat="+D.boundingBox.SECoordinate.latitude+"&SELon="+D.boundingBox.SECoordinate.longitude;
window.open(C,"","width=800,height="+screen.availHeight+",resizable=yes,scrollbars=yes");}};return A;
},deleteDriveClosure:function(){var A=function(B){setTimeout(function(){document.widgetManager.getSlideWidget().animateHeight();
},1000);};return A;},postDisplay:function(){if(!this.driveId){this.afterRestCall();}new Nvt.Widget.Modal(false,{"dimensions":{"height":80,"width":410},"href":"#nvt_renameDriveModal","id":"RenameLink","refresh":true,"target":"#nvt_driveDetailsInplace","title":i18n.renameDrive});
new Nvt.Widget.Modal(false,{"dimensions":{"height":118,"width":410},"href":"#nvt_deleteDriveModal","id":"DeleteDriveLink","refresh":true,"target":"#nvt_driveDetailsInplace","title":i18n.deleteDrive});
},afterRestCall:function(){Nvt.Util.zebraStripe();var A=nQ("#"+this.tableWidget.id+" tbody tr");var B=this;
A.each(function(D,E){var F=B.createDriveReport(B.dataroutes.roads[D].driveReport);var C=B.twistyFactory(E.id,3,F);
C.display();});if(!this.redisplaying){document.widgetManager.getSlideWidget().toggleDisplay(this.id);
document.widgetManager.getSlideWidget().animateSlider();}this.tableWidget.postDisplay();this.finalExecution();
},createDriveReport:function(D){var A=nQ("<div></div>");var I="-";var G="-";var B="-";var J;var H=/^[0-9.]+$/;
J=D.driveTime;I=J.match(H)?Nvt.Util.getDisplayTime(parseInt(J)):J;J=D.delay;G=J.match(H)?Nvt.Util.getDisplayTime(parseInt(J)):J;
J=D.averageSpeed;B=J.match(H)?J+" "+i18n.mph:J;var K=nQ('<table class="nvt_roadDetails"></table>');var F=nQ("<tr><th>"+i18n.travelimeColon+"</th><td>"+I+"</td></tr>");
var E=nQ("<tr><th>"+i18n.delayColon+"</th><td>"+G+"</td></tr>");var C=nQ("<tr><th>"+i18n.averageSpeedColon+"</th><td>"+B+"</td></tr>");
K.append(F).append(E).append(C);A.append(K);if(D.trafficItems.length>0){D.incidents=Nvt.Util.addCritSort(D.trafficItems);
incidentsTable=new Nvt.Widget.TrafficItemsWidget(Nvt.Widget.TrafficItemConstants.INCIDENT,null,D.trafficItems,null,null,null,null,true);
A.append(nQ(incidentsTable.DOM));}return A;},refreshCallback:function(B,A){if(!B){this.driveId=this.data.id;
this.data=null;this.redisplaying=true;this.getData(true);this.redisplay();}},CLASS_NAME:"Nvt.Widget.DriveDetailsWidget"};
Object.extend(Nvt.Widget.DriveDetailsWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.MapImageWidget=Class.create();
Nvt.Widget.MapImageWidget.prototype={initialize:function(B){this.initializeWidget();var A=commonData.restServerName+"/mapImages?"+$H(B).toQueryString();
if(document.widgetManager.authKey){A=A+"&auth="+document.widgetManager.authKey;}var C=nQ('<img src="'+A+'"/>');
this.DOM.appendChild(C[0]);},CLASS_NAME:"Nvt.Widget.MapImageWidget"};Object.extend(Nvt.Widget.MapImageWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.TrafficItemsWidget=Class.create();Nvt.Widget.TrafficItemsWidget.prototype={initialize:function(I,G,A,D,F,B,E,H){this.initializeWidget();
this.metroId=D;this.divId=G;this.data=A;this.incidentType=I;this.max=E;this.showAds=F;this.coord=B;this.noSlide=H;
try{if(G!=null){nQ("#"+G).append(this.spinner);}}catch(C){}this.getData();},getRestUrl:function(){var A=commonData.restServerName+"/trafficItems?var="+this.id+"&sortBy=criticality&sortOrder=asc&dataset=all"+((this.incidentType==null||this.incidentType=="generic")?"":("&filter="+this.incidentType));
if(this.coord){A=A+"&lat="+this.coord.latitude+"&lon="+this.coord.longitude+"&radius=5&filter=boundingBoxTI";
}else{A=A+"&metroId="+this.metroId;}if(this.max){A=A+"&max="+this.max;}return A;},postInit:function(C){if(this.data.trafficItems){this.data=this.data.trafficItems;
}var F=null;var B=null;var D=null;var A=i18n.clickToSeeItemOnMap;if(this.incidentType==Nvt.Widget.TrafficItemConstants.INCIDENT){this.pageTitle=i18n.labelIncidents+" :: "+metroSummary.metros[0].metroName+" :: "+i18n.trafficDotCom;
var E=["criticality","itemType","description"];this.formatter=new Nvt.Formatter.TrafficItemIncidentFormatter(E,this.noSlide);
F="criticality";B="desc";D=i18n.moreIncidentsBelow;}else{if(this.incidentType==Nvt.Widget.TrafficItemConstants.CONSTRUCTION){this.pageTitle=i18n.roadwork+" :: "+metroSummary.metros[0].metroName+" :: "+i18n.trafficDotCom;
var E=["criticality","description","status","endDate"];this.formatter=new Nvt.Formatter.TrafficItemConstructionFormatter(E);
F="description";B="asc";D=i18n.moreRoadworkBelow;}else{if(this.incidentType==Nvt.Widget.TrafficItemConstants.EVENT){this.pageTitle=i18n.events+" :: "+metroSummary.metros[0].metroName+" :: "+i18n.trafficDotCom;
var E=["criticality","description","municipality"];this.formatter=new Nvt.Formatter.TrafficItemEventFormatter(E);
F="startDate";B="asc";D=i18n.moreEventsBelow;}else{if(this.incidentType==Nvt.Widget.TrafficItemConstants.MASSTRANSIT){this.pageTitle=i18n.massTransit+" :: "+metroSummary.metros[0].metroName+" :: "+i18n.trafficDotCom;
var E=["criticality","serviceDesc","description"];this.formatter=new Nvt.Formatter.TrafficItemMassTransitFormatter(E);
F="serviceDesc";B="asc";D=i18n.moreMassTransitBelow;A="";}else{this.pageTitle=i18n.labelIncidents+" :: "+metroSummary.metros[0].metroName+" :: "+i18n.trafficDotCom;
var E=["criticality","itemType","description"];this.formatter=new Nvt.Formatter.TrafficItemIncidentFormatter(E);
}}}}this.setPageTitle(this.pageTitle);Nvt.console.log("data before sending to table widget");Nvt.console.log(this.data);
this.data=Nvt.Util.addCritSort(this.data);this.table=new Nvt.Widget.TableWidget(this.formatter,this.data,F,B,this.showAds,D,A);
this.table.postDisplay();nQ(this.DOM).append(this.table.DOM);document.widgetManager.getSlideWidget().animateHeight();
if(this.incidentType==null){this.incidentType="generic";}nQ(this.DOM).removeClass(this.cssClassName).addClass(this.cssClassName+"_"+this.incidentType);
Nvt.Util.zebraStripe();},postDisplay:function(){this.finalExecution();},refreshCallback:function(B,A){Nvt.console.log("in trafficItemsWidget in refresh Callback metroId="+B);
if(B){this.metroId=B;}this.divId=null;this.data=null;nQ("#"+this.displayDivId).empty();nQ(this.DOM).empty();
this.getData(true);this.display(this.displayDivId);},CLASS_NAME:"Nvt.Widget.TrafficItemsWidget"};Object.extend(Nvt.Widget.TrafficItemsWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.ParentKeyRouteWidget=Class.create();Nvt.Widget.ParentKeyRouteWidget.prototype={initialize:function(D,C,E,A,B){this.initializeWidget();
this.metroId=E;this.animate=B;if(C!=null){this.krId=C;}else{this.krId=D.id;}this.makeRestCall();},makeRestCall:function(){var A=commonData.restServerName+"/roads?var=parentKRData&filter=parent&sortby=driveReport.jamFactor.jamFactor&dataset=all&metroId="+this.metroId+"&roadList="+this.krId;
this.loadData(A,this.postInit.bind(this));},postInit:function(H){if(H){this.dto=H;}else{this.dto=parentKRData.presentationObjects.roads[0];
}if(trafficMap&&!this.redisplaying){trafficMap.setMapState(Nvt.Util.roadToMapState(this.dto));}this.pageTitle=this.dto.name+" - "+Nvt.Util.scrubBound(this.dto.direction)+" :: "+i18n.trafficDotCom;
this.setPageTitle(this.pageTitle);this.backLinkText=i18n.backToFullRoad+" "+this.dto.name+" "+i18n.cTo+" "+Nvt.Util.scrubBound(this.dto.direction);
var C=nQ('<div class="nvt_roadName"><span class="nvt_roadSignAndNumber nvt_'+this.dto.roadType+'">'+this.dto.signText1+"</span></div>");
siblingsList=nQ("<p>"+this.dto.startPointName+" "+i18n.cTo+" "+this.dto.endPointName+"</p>");this.krId=this.dto.id;
var B=nQ('<div class="nvt_roadInfo" id="nvt_parentKRDetails"><h1 class="nvt_bold_text">'+this.dto.name+" - "+Nvt.Util.scrubBound(this.dto.direction)+"</h1></div>");
var R=nQ("<a>"+i18n.reverseDirection+"</a>");var K=nQ("<span>|</span>");var E=nQ("<a onclick=\"Nvt.Util.bookmark('"+commonData.appServerName+"/controller/workspace?krId="+this.dto.id+"', '"+this.dto.name+"');\">"+i18n.bookmarkRoad+"</a>");
var A=this.dto.siblingId;var I=this.metroId;R.click(function(){var S=new Nvt.Widget.ParentKeyRouteWidget(null,new String(A),I,true);
document.widgetManager.getSlideWidget().push(S,null);});var M=nQ('<span class="nvt_roadLinks"></span>');
M.append(R).append(K).append(E);B.append(siblingsList);B.append(M);C.append(B);var O=nQ('<table class="nvt_roadDetails"></table>');
var F=nQ("<tr></tr>");var G=nQ("<th>"+i18n.jamFactorColon+"</th>");F.append(G);var Q=Nvt.Util.getJFImageString(this.dto.driveReport.jamFactor);
var J=nQ('<td><div class="nvt_jamFactor nvt_jamFactor'+Nvt.Util.getJFClass(this.dto.driveReport.jamFactor)+'"><img src="'+commonData.staticServer(Q)+i18n.imagesPath+i18n.imagesPathJamfactor+Q+'" /></div><div class="nvt_jamFactorPrint"><img src="'+commonData.staticServer(Q)+i18n.imagesPath+i18n.imagesPathJamfactor+Q+'" /></div></td>');
F.append(J);O.append(F);O.append(this.getTrafficReportAttributeTR(i18n.currentDriveTimeColon,Nvt.Util.parseTimeToHoursAndMinutes(this.dto.driveReport.driveTime)));
O.append(this.getTrafficReportAttributeTR(i18n.atSpeedLimitColon,Nvt.Util.parseTimeToHoursAndMinutes(this.dto.driveReport.driveTime-this.dto.driveReport.delay)));
O.append(this.getTrafficReportAttributeTR(i18n.delayColon,Nvt.Util.parseTimeToHoursAndMinutes(this.dto.driveReport.delay)));
O.append(this.getTrafficReportAttributeTR(i18n.averageSpeedColon,Nvt.Util.parseAverageSpeed(this.dto.driveReport.averageSpeed)));
this.DOM.appendChild(C[0]);this.DOM.appendChild(O[0]);this.displayId=this.id;var P=new Nvt.Widget.AlertActionWidget(null,this.metroId,null,this.krId);
P.display(this.displayId);this.DOM.appendChild(P.content[0]);if(this.dto.children&&this.dto.children.length>0){for(var N=1;
N<=this.dto.children.length;N++){this.dto.children[N-1].orderId=N;}var D=["orderId","name","jamFactor","incidents"];
var L=new Nvt.Formatter.ParentKeyrouteRoadFormatter(D);L.parentWidgetName="ParentKeyRoute";var O=new Nvt.Widget.TableWidget(L,this.dto.children,"orderId","asc",false);
O.parentWidgetName="Nvt.Widget.ParentKeyRouteWidget";this.DOM.appendChild(O.DOM);O.display(this.displayId);
}Nvt.Util.viewedKeyroute(this.dto);if(!this.redisplaying){document.widgetManager.getSlideWidget().toggleDisplay(this.id);
document.widgetManager.getSlideWidget().animateSlider(0,this.animate);}document.widgetManager.getSlideWidget().animateHeight();
this.cleanUp();},getTrafficReportAttributeTR:function(B,D){var A=nQ("<tr></tr>");var C=nQ("<th>"+B+"</th>");
A.append(C);var E=nQ("<td></td>");E.append(D);A.append(E);return A;},refreshCallback:function(B,A){if(!B){this.redisplaying=true;
this.makeRestCall();this.redisplay();}},CLASS_NAME:"Nvt.Widget.ParentKeyRouteWidget"};Object.extend(Nvt.Widget.ParentKeyRouteWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.TrafficItemConstants={INCIDENT:"incidents",MASSTRANSIT:"massTransit",CONSTRUCTION:"construction",EVENT:"events"};
Nvt.Widget.RoutingWidget=Class.create();Nvt.Widget.RoutingWidget.prototype={initialize:function(H){this.initializeWidget();
if(!H[0].commuteSegmentSummaryList){H[0].commuteSegmentSummaryList=[];}if(!H[1].commuteSegmentSummaryList){H[1].commuteSegmentSummaryList=[];
}this.isDrive1Saveable=(H[0].commuteSegmentSummaryList.length>0);this.isDrive2Saveable=(H[1].commuteSegmentSummaryList.length>0);
this.routeInfos=[];this.routeInfos[1]=H[0];this.routeInfos[2]=H[1];this.routeInfos[1].isSaveable=this.isDrive1Saveable;
this.routeInfos[2].isSaveable=this.isDrive2Saveable;this.calculateVias();this.majorRoadTableWidgets=[];
this.majorRoadTableWidgets[1]=null;this.majorRoadTableWidgets[2]=null;this.directionsWidgets=[];this.directionsWidgets[1]=null;
this.directionsWidgets[2]=null;this.twistyWidgets=[];this.twistyWidgets[1]=null;this.twistyWidgets[2]=null;
var G=[];this.defaultSortFieldMajorRoads="jamFactor";this.defaultSortOrderMajorRoads="desc";G=["name","jamFactor","incidents"];
this.majorRoadsFormatter=new Nvt.Formatter.MajorRoadsFormatter(G);this.defaultSortFieldDirections="step";
this.defaultSortOrderDirections="desc";G=["orderId","text","distance"];this.directionsFormatter=new Nvt.Formatter.DirectionsFormatter(G);
this.backLinkText=i18n.buttonCancel;var B=[];if(this.routeInfos[1].route.Vias.length>0){B[1]='  <h2 id="nvt_fastestDriveLabel" class="nvt_driveLabel nvt_customLabel"><strong>'+i18n.customDrive+"</strong></h2>";
}else{B[1]='  <h2 id="nvt_fastestDriveLabel" class="nvt_driveLabel"><strong>'+i18n.fastestNow+"</strong></h2>";
}if(this.routeInfos[2].route.Vias.length>0){B[2]='  <h2 id="nvt_directDriveLabel" class="nvt_driveLabel nvt_customLabel"><strong>'+i18n.customDrive+"</strong></h2>";
}else{B[2]='  <h2 id="nvt_directDriveLabel" class="nvt_driveLabel"><strong>'+i18n.directDrive+"</strong></h2>";
}var F="";F+='<div id="nvt_buildDriveStep1" class="nvt_buildDriveStep" style="display: block">';F+=' <h1 class="nvt_headline">'+i18n.weFoundTwoDrives+"</h1>";
F+=' <ul id="nvt_foundDrives" class="nvt_drive1Selected">';F+='  <li id="nvt_drive1" class="nvt_drive" onclick="viewDrive(\'drive1\');" title="'+i18n.fastesDriveWhenTraffic+'">';
F+=B[1];F+=this.getTabInfoHtml(this.routeInfos[1]);F+='   <ul class="nvt_driveTools">';F+='    <li><a href="#" class="nvt_btn_printDrive" id="nvt_btn_printDrive1">'+i18n.printThisDrive+"</a></li>";
F+='    <li><a href="#" class="nvt_btn_viewDrive" onclick="viewDrive(\'drive1\');">'+i18n.viewThisDrive+"</a></li>";
if(this.isDrive1Saveable){F+='    <li><a href="#" class="nvt_btn_saveDrive" id="nvt_btn_saveDrive1">'+i18n.saveThisDrive+"</a></li>";
}F+="   </ul>";F+="  </li>";F+='  <li id="nvt_drive2" class="nvt_drive nvt_unselected" onclick="viewDrive(\'drive2\');" title="'+i18n.fastesDriveWithoutTraffic+'">';
F+=B[2];F+=this.getTabInfoHtml(this.routeInfos[2]);F+='   <ul class="nvt_driveTools">';F+='    <li><a href="#" class="nvt_btn_printDrive" id="nvt_btn_printDrive2">'+i18n.printThisDrive+"</a></li>";
F+='    <li><a href="#" class="nvt_btn_viewDrive" onclick="viewDrive(\'drive2\');">'+i18n.viewThisDrive+"</a></li>";
if(this.isDrive2Saveable){F+='    <li><a href="#" class="nvt_btn_saveDrive" id="nvt_btn_saveDrive2">'+i18n.saveThisDrive+"</a></li>";
}F+="   </ul>";F+="  </li>";F+=" </ul> ";F+=' <div id="nvt_drive1Details" class="nvt_driveDetails">';
F+='  <div id="nvt_majorRoads1"><h3 class="nvt_subHeader">'+i18n.majorRoads+"</h3></div>";F+='  <div id="nvt_directions1" class="nvt_directions"></div>';
F+=" </div>";F+=' <div id="nvt_drive2Details" class="nvt_driveDetails">';F+='  <div id="nvt_majorRoads2"><h3 class="nvt_subHeader">'+i18n.majorRoads+"</h3></div>";
F+='  <div id="nvt_directions2" class="nvt_directions"></div>';F+=" </div>";F+=' <div id="nvt_saveDrive">';
F+='  <h2 class="nvt_headline">'+i18n.saveYourDrive+"</h2>";F+='  <a href="#" class="nvt_button">';F+='    <span class="nvt_buttonLeft"></span>';
F+="    <h1>"+i18n.buttonGo+"</h1>";F+='    <span class="nvt_buttonRight"></span>';F+="  </a>";F+="  <ul>";
F+="   <li>"+i18n.easyAccessUpToTheMinuteTrafficInfo+"</li>";F+="   <li>"+i18n.setupCustomAlertsSendDirectlyToPhone+"</li>";
F+="   <li>"+i18n.getAlternateRoutesDetoursAsConditionsChange+"</li>";F+="  </ul>";F+=" </div>";F+="</div>";
var J=nQ(F);J.append(Nvt.Util.getTableAd());var E=J.find("#nvt_btn_printDrive1");E.click(function(){openPrintPage("route1");
});var I=J.find("#nvt_btn_printDrive2");I.click(function(){openPrintPage("route2");});var M=this.processSaveDriveWidget.bind(this);
if(this.isDrive1Saveable){var N=J.find("#nvt_btn_saveDrive1");N.click(function(){M(1);});}if(this.isDrive2Saveable){var C=J.find("#nvt_btn_saveDrive2");
C.click(function(){M(2);});}var L=J.find("#nvt_saveDrive > a:first");L.click(function(){M(activeDriveIndex);
});var K=this.displayDriveDiv.bind(this);var A=J.find("#nvt_drive1");A.click(this.displayDriveDiv.bind(this,this.isDrive1Saveable));
var D=J.find("#nvt_drive2");D.click(this.displayDriveDiv.bind(this,this.isDrive2Saveable));nQ(this.DOM).append(J);
},processSaveDriveWidget:function(B){var A=new Nvt.Widget.SaveDriveWidget(this.routeInfos,B);document.widgetManager.getSlideWidget().push(A);
resetWidth();},displayDriveDiv:function(A){var B=nQ("#nvt_saveDrive");if(A){B.show();}else{B.hide();}},postInit:function(){},getTabInfoHtml:function(D){var A=Math.round(D.timeSecAtSpeedLimit/60);
var F=Math.round(D.timeSecTrafficBased/60);var B=F-A;if(B<0){B=0;A=F;}var H=Nvt.MapTp.RouteManagerHtmlBase.convertMeter(D.lengthMeterTrafficBased);
var G=Math.round(H/F*60);var E={};E.trafficBasedTime=Nvt.Util.getDisplayTime(F);E.atSpeedLimitTime=Nvt.Util.getDisplayTime(A);
E.avgSpeed=G+" "+i18n.mph;E.delayTime=Nvt.Util.getDisplayTime(B);E.distance=H+" "+i18n.milesAbbr;if(D.viaString){E.viaString=D.viaString;
}H=Nvt.MapTp.RouteManagerHtmlBase.decimalPrecision(H,1);var C="";C+='   <ul class="nvt_routeInfoLabels nvt_routeTabList">';
C+='      <li class="nvt_driveTime">'+i18n.currentDriveTimeColon+"</li>";C+="      <li>"+i18n.atSpeedLimitColon+"</li>";
C+="      <li>"+i18n.delayTimeColon+"</li>";C+="      <li>"+i18n.averageSpeedColon+"</li>";C+="      <li>"+i18n.distanceColon+"</li>";
if(D.viaString){C+='      <li class="nvt_viaText">'+i18n.viaColon+"</li>";}C+="   </ul>";C+='   <ul class="nvt_routeInfo nvt_routeTabList">';
C+="      <li>"+E.trafficBasedTime+"</li>";C+="      <li>"+E.atSpeedLimitTime+"</li>";C+="      <li>"+E.delayTime+"</li>";
C+="      <li>"+E.avgSpeed+"</li>";C+="      <li>"+E.distance+"</li>";if(D.viaString){C+='      <li class="nvt_viaData">'+E.viaString+"</li>";
}C+="   </ul>";D.display=E;return C;},calculateVias:function(){var J=null;var D=null;var A=[];var L=[];
var G=null;var O=null;var B=this.routeInfos[1].commuteSegmentSummaryList;var E=this.routeInfos[2].commuteSegmentSummaryList;
var K=null;var Q=null;var F=new Hash();var C=new Hash();K=this.getHashFromSegmentList(B,"roadName");Q=this.getHashFromSegmentList(E,"roadName");
A=K.keys().sort();L=Q.keys().sort();for(var P=0;P<A.length;P++){var R=A[P];for(var N=0;N<L.length;N++){key2=L[N];
if(R==key2){var I=K.get(R);var H=Q.get(key2);var M=this.diffRoads(I,H,["startPointName","endPointName"]);
if(M[0].length>0){F.set(R,M[0]);}if(M[1].length>0){C.set(key2,M[1]);}K.unset(R);Q.unset(key2);}}}this.routeInfos[1].viaString=this.getViaString(K,F,B,Q,E,["startPointName","endPointName"]);
this.routeInfos[2].viaString=this.getViaString(Q,C,E,K,B,["startPointName","endPointName"]);},getViaString:function(E,N,F,I,C,B){var J=E.keys();
var H=I.keys();var P=null;var L=null;if(J.length>0){var M=new Array();for(var G=0;G<J.length;G++){var K=E.get(J[G]);
M=M.concat(K);}P=this.getLongestSegment(M);L=P.roadName;return L;}else{if(F!=null&&F.length==0){L=null;
return L;}if(J.length==0&&F.length>0&&H.length>0){P=this.getLongestSegment(F);L=P.roadName;return L;}var O=N.keys();
if(O.length>0&&J.length==0&&H.length==0&&F.length>0&&C.length>0){var M=new Array();for(var G=0;G<O.length;
G++){var K=N.get(O[G]);M=M.concat(K);}P=this.getLongestSegment(M);for(var G=0;G<B.length;G++){var A=B[G];
var D=P["isDifferent_"+A];if(D){L=P[A];return L;}}}P=this.getLongestSegment(F);L=P.roadName;return L;
}},diffRoads:function(J,I,B){var H=true;for(var G=0;G<J.length;G++){var D=J[G];for(var F=0;F<I.length;
F++){var C=I[F];for(var E=0;E<B.length;E++){var A=B[E];if(C[A]!=D[A]){H=false;D["isDifferent_"+A]=true;
C["isDifferent_"+A]=true;}}if(H){I.splice(F,1);J.splice(G,1);}}}return[J,I];},getLongestSegment:function(F){var D=-1;
var C=-1;var E={};var B=null;for(var A=0;A<F.length;A++){E=F[A];C=E.distance;if(C>D){B=E;}}return B;},getHashFromSegmentList:function(F,E){var D=new Hash();
if((typeof F=="undefined")||F==null){return D;}for(var B=0;B<F.length;B++){var A=F[B][E];var C=D.get(A);
if(!C){C=new Array();D.set(A,C);}C.push(F[B]);}return D;},createMajorRoadsTableWidget:function(A){if(this.routeInfos[A].commuteSegmentSummaryList.length>0){this.majorRoadTableWidgets[A]=new Nvt.Widget.TableWidget(this.majorRoadsFormatter,this.routeInfos[A].commuteSegmentSummaryList,this.defaultSortFieldMajorRoads,this.defaultSortOrderMajorRoads);
this.majorRoadTableWidgets[A].parentWidgetName="Nvt.Widget.RoutingWidget";this.majorRoadTableWidgets[A].display("nvt_majorRoads"+A);
}else{var B='<table class="noRoads"><tbody><tr><td>'+i18n.dontProvideDetailedTrafficReports+"</td></tr></tbody></table>";
nQ("#nvt_majorRoads"+A).append(B);}},createDirectionsWidget:function(C,B){this.directionsWidgets[B]=new Nvt.Widget.DirectionsWidget(C,B);
var D=this.directionsWidgets[B].DOM.innerHTML;var A='<a class="nvt_subHeader">'+i18n.turnByTurnDirections+"</a>";
this.twistyWidgets[B]=new Nvt.Widget.TwistyWidget(A,D);this.twistyWidgets[B].display("nvt_directions"+B);
this.directionsWidgets[B].postDisplay();},postDisplay:function(){this.createMajorRoadsTableWidget(1);
this.createMajorRoadsTableWidget(2);this.createDirectionsWidget(this.routeInfos[1],1);this.createDirectionsWidget(this.routeInfos[2],2);
if(this.majorRoadTableWidgets[1]){this.addTableTwistyWidgetsForMajorRoadsTableWidget(this.routeInfos[1],1);
}if(this.majorRoadTableWidgets[2]){this.addTableTwistyWidgetsForMajorRoadsTableWidget(this.routeInfos[2],2);
}document.widgetManager.getSlideWidget().toggleDisplay(this.id);Nvt.Util.zebraStripe();if(this.incidentsTable){this.incidentsTable.postDisplay();
}if(activeDriveIndex===1){this.displayDriveDiv(this.isDrive1Saveable);}else{this.displayDriveDiv(this.isDrive2Saveable);
}this.finalExecution();},addTableTwistyWidgetsForMajorRoadsTableWidget:function(D,B){var A=nQ("#"+this.majorRoadTableWidgets[B].id+" tbody tr");
var C=this;A.each(function(F,G){var H=C.createDriveReport(D.commuteSegmentSummaryList[F]);var E=C.twistyFactory(G.id,3,H);
E.display();});},twistyFactory:function(B,D,C){var A=new Nvt.Widget.TableTwistyWidget(B,D,C);return A;
},createDriveReport:function(F){var A=nQ("<div></div>");var L;var K="-";var J="-";var B="-";var C="-";
var H=parseInt(F.jamFactor);if(H==10){K=i18n.roadClosed;J=i18n.roadClosed;C=i18n.roadClosed;}L=parseInt(F.travelTime);
if(!isNaN(L)){K=Nvt.Util.getDisplayTime(L);}L=parseInt(F.delay);if(!isNaN(L)){if(L<0){L=0;}J=Nvt.Util.getDisplayTime(L);
}L=parseInt((new Number(F.distance)).toFixed(1));if(!isNaN(L)){B=L+" "+i18n.milesAbbr;}L=F.avgSpeed;if(!isNaN(L)){C=L+" "+i18n.mph;
}var M=nQ('<table class="nvt_roadDetails"></table>');var I=nQ("<tr><th>"+i18n.currentDriveTimeColon+"</th><td>"+K+"</td></tr>");
var G=nQ("<tr><th>"+i18n.delayTimeColon+"</th><td>"+J+"</td></tr>");var E=nQ("<tr><th>"+i18n.distanceColon+"</th><td>"+B+"</td></tr>");
var D=nQ("<tr><th>"+i18n.averageSpeedColon+"</th><td>"+C+"</td></tr>");M.append(I).append(G).append(E).append(D);
A.append(M);if(F.incidentList&&F.incidentList.length>0){this.prepData(F.incidentList);F.incidentList=Nvt.Util.addCritSort(F.incidentList);
this.incidentsTable=new Nvt.Widget.RoutingTrafficItemsWidget(Nvt.Widget.TrafficItemConstants.INCIDENT,null,F.incidentList);
A.append(nQ(this.incidentsTable.DOM));}return A;},prepData:function(D){var B=function(E){E=E.toLowerCase();
if(E.indexOf("incident")!=-1){return Nvt.Widget.TrafficItemConstants.INCIDENT;}if(E.indexOf("construction")!=-1){return Nvt.Widget.TrafficItemConstants.CONSTRUCTION;
}if(E.indexOf("event")!=-1){return Nvt.Widget.TrafficItemConstants.EVENT;}if(E.indexOf("mass")!=-1){return Nvt.Widget.TrafficItemConstants.MASSTRANSIT;
}};for(var A=0;A<D.length;A++){var C=D[A];C.criticality=C.incidentCriticality;C.itemType=B(C["class"]);
C.headerDesc=C.incidentType;C.description=C.incidentDesc;}},CLASS_NAME:"Nvt.Widget.RoutingWidget"};Object.extend(Nvt.Widget.RoutingWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.NvtWeatherWidget=Class.create();Nvt.Widget.NvtWeatherWidget.prototype={weekDay:{"SUN":i18n.sunday,"MON":i18n.monday,"TUE":i18n.tuesday,"WED":i18n.wednesday,"THU":i18n.thursday,"FRI":i18n.friday,"SAT":i18n.saturday},initialize:function(A,D,E,C){var B=Nvt.Util.getAWOPartner();
if(typeof (C)!="undefined"){this.options=C;}else{this.options={};}if(navbar._show_weather||B=="DEFAULT"){this.initializeWidget();
this.divId=A;this.dto=D;this.metroId=E;this.modalNumber=0;if(this.dto!=null&&Nvt.Util.isValid(this.dto)){this.postInit(this.dto);
}else{if(E!=null){this.makeRestCall();}else{Nvt.console.error("Error: No weather data or metroId provided");
}}}else{return ;}},postInit:function(){if(this.dto!=null){this.metroId=this.dto.metros[0].metroId;this.data=this.dto.metroSummary[0].weather;
}else{if(typeof (weather)=="undefined"||weather==null||weather.presentationObjects==null||weather.presentationObjects.weather[this.metroId]==null){if(typeof (weather)=="undefined"){Nvt.console.error("ERROR: Failed retrieving weather data - weather variable undefined.");
}else{if(weather==null){Nvt.console.error("ERROR: Failed retrieving weather data - weather variable is null.");
}else{if(weather.presentationObjects==null){Nvt.console.error("ERROR: Failed retrieving weather data - weather.presentationObjects is null.");
}else{if(weather.presentationObjects.weather[this.metroId]==null){Nvt.console.error("ERROR: Failed retrieving weather data - weather.presentationObjects.weather["+this.metroId+"] is null.");
}}}}return ;}else{this.dto=weather;this.data=this.dto.presentationObjects.weather[this.metroId];}}this.display(this.divId);
if(this.refresh!=true){nQ("#"+this.divId).click(this.refreshAndOpenModal.bind(this));}else{this.openModal();
}},openModal:function(A){this.modalNumber++;new Nvt.Widget.Modal(false,{"dimensions":{"height":285,"width":610},"href":"#weatherWidgetModalDiv","id":"nvt_weatherModal"+this.modalNumber,"noBind":true,"refresh":true,"title":this.dto.metros[0].metroName+" "+i18n.areaWeather,"innerHTML":true});
document.nvtModalManager.toggle("nvt_weatherModal"+this.modalNumber);},makeRestCall:function(){var A=commonData.restServerName+"/weather?var=weather&metroId="+this.metroId+"&dataset=all";
this.loadData(A,this.postInit.bind(this));},getTimeStamp:function(C){var A=new Date();if(C.timeStamp){var B=Date.parse(C.timeStamp);
A=new Date(B);}return Nvt.Util.get12Hour(A.getHours())+":"+Nvt.Util.getMinutes(A.getMinutes())+" "+Nvt.Util.getAMPM(A.getHours());
},getModalContent:function(){var tempStr='<div class="nvt_modal_section">'+'<span id="nvt_weatherTimestamp" class="nvt_bold_text">'+i18n.currentConditions+" ("+i18n.asOf+" "+this.getTimeStamp(this.data)+")</span>"+'<div id="nvt_modal_weather_lgImg">'+'<img src="'+commonData.staticServer(this.data.imageURL)+i18n.imagesPath+i18n.imagesPathWeatherIcons+this.data.imageURL+'"/>'+'<div class="nvt_grey_text">'+this.data.textDescription+"</div>"+'<div class="nvt_grey_text nvt_modal_weather_temp">'+this.data.currentTemp+"\u00B0"+i18n.symbolF+"</div>"+"</div>"+'<div id="nvt_modal_weather_lgTxt">'+'<div class="nvt_bold_text">'+i18n.highColon+" "+this.data.highTemp+"\u00B0"+i18n.symbolF+"</div>"+'<div class="nvt_bold_text">'+i18n.lowColon+" "+this.data.lowTemp+"\u00B0"+i18n.symbolF+"</div>"+"</div>"+'<div id="nvt_modal_weather_links">'+'<a id="nvt_modal_weather_wcLink" href="http://www.weather.com/?par=mobility&site=www.traffic.com&promo=0&cm_ven=Mobility&cm_cat=www.traffic.com&cm_pla=WxPage&cm_ite=HomePage">'+'<img src=" '+commonData.staticServer(this.data.providerImageLarge)+i18n.imagesPath+i18n.imagesPathWeatherIcons+this.data.providerImageLarge+'"/>'+"</a>"+'<ul id="nvt_modal_weather_wcLinks">'+'<li><a target="_blank" title="Link will open content in new tab or window" href="'+this.dto.presentationObjects.weatherResources["Airport Conditions"]+'">'+i18n.airportConditions+"</a></li>"+'<li><a target="_blank" title="Link will open content in new tab or window" href="'+this.dto.presentationObjects.weatherResources["Interstate Forecast"]+'">'+i18n.interstateForecast+"</a></li>"+'<li><a target="_blank" title="Link will open content in new tab or window" href="'+this.dto.presentationObjects.weatherResources["Precipitation Map"]+'">'+i18n.precipitationMap+"</a></li>"+"</ul>"+"</div>"+'<div style="clear:both;"></div>'+"</div>";
var fdf=this.data.fiveDayForecast;tempStr+='<div class="nvt_modal_section">'+'<div class="nvt_bold_text nvt_modal_sectHead">'+i18n.fiveDayForecast+"</div>"+'<div class="nvt_modal_weatherTable">'+'<div class="nvt_modal_weatherBold">'+eval("this.weekDay."+fdf[0].dayText)+"</div>"+'<div class="nvt_modal_weatherCond">'+fdf[0].textDescription+"</div>"+"<div>"+i18n.highColon+" "+fdf[0].highTemp+"\u00B0"+i18n.symbolF+"</div>"+"<div>"+i18n.lowColon+" "+fdf[0].lowTemp+"\u00B0"+i18n.symbolF+"</div>"+'<div><img src="'+commonData.staticServer(fdf[0].imageURL)+i18n.imagesPath+i18n.imagesPathWeatherIcons+fdf[0].imageURL+'"/></div>'+"</div>"+'<div class="nvt_modal_weatherTable">'+'<div class="nvt_modal_weatherBold">'+eval("this.weekDay."+fdf[1].dayText)+"</div>"+'<div class="nvt_modal_weatherCond">'+fdf[1].textDescription+"</div>"+"<div>"+i18n.highColon+" "+fdf[1].highTemp+"\u00B0"+i18n.symbolF+"</div>"+"<div>"+i18n.lowColon+" "+fdf[1].lowTemp+"\u00B0"+i18n.symbolF+"</div>"+'<div><img src="'+commonData.staticServer(fdf[1].imageURL)+i18n.imagesPath+i18n.imagesPathWeatherIcons+fdf[1].imageURL+'"/></div>'+"</div>"+'<div class="nvt_modal_weatherTable">'+'<div class="nvt_modal_weatherBold">'+eval("this.weekDay."+fdf[2].dayText)+"</div>"+'<div class="nvt_modal_weatherCond">'+fdf[2].textDescription+"</div>"+"<div>"+i18n.highColon+" "+fdf[2].highTemp+"\u00B0"+i18n.symbolF+"</div>"+"<div>"+i18n.lowColon+" "+fdf[2].lowTemp+"\u00B0"+i18n.symbolF+"</div>"+'<div><img src="'+commonData.staticServer(fdf[2].imageURL)+i18n.imagesPath+i18n.imagesPathWeatherIcons+fdf[2].imageURL+'"/></div>'+"</div>"+'<div class="nvt_modal_weatherTable">'+'<div class="nvt_modal_weatherBold">'+eval("this.weekDay."+fdf[3].dayText)+"</div>"+'<div class="nvt_modal_weatherCond">'+fdf[3].textDescription+"</div>"+"<div>"+i18n.highColon+" "+fdf[3].highTemp+"\u00B0"+i18n.symbolF+"</div>"+"<div>"+i18n.lowColon+" "+fdf[3].lowTemp+"\u00B0"+i18n.symbolF+"</div>"+'<div><img src="'+commonData.staticServer(fdf[3].imageURL)+i18n.imagesPath+i18n.imagesPathWeatherIcons+fdf[3].imageURL+'"/></div>'+"</div>"+'<div class="nvt_modal_weatherTable nvt_modal_weatherTableLast">'+'<div class="nvt_modal_weatherBold">'+eval("this.weekDay."+fdf[4].dayText)+"</div>"+'<div class="nvt_modal_weatherCond">'+fdf[4].textDescription+"</div>"+"<div>"+i18n.highColon+" "+fdf[4].highTemp+"\u00B0"+i18n.symbolF+"</div>"+"<div>"+i18n.lowColon+" "+fdf[4].lowTemp+"\u00B0"+i18n.symbolF+"</div>"+'<div><img src="'+commonData.staticServer(fdf[4].imageURL)+i18n.imagesPath+i18n.imagesPathWeatherIcons+fdf[4].imageURL+'"/></div>'+"</div>";
return tempStr;},refreshAndOpenModal:function(){this.dto=null;this.refresh=true;this.makeRestCall();},refreshCallback:function(B,A){this.dto=null;
this.refresh=false;if(B){this.metroId=B;}this.makeRestCall();},CLASS_NAME:"Nvt.Widget.NvtWeatherWidget"};
Object.extend(Nvt.Widget.NvtWeatherWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.NvtWeatherWidget.prototype.display=function(A){var B=nQ("#"+A);
B.empty();B.append("<a href='#' id='WeatherInfo'><img src='"+commonData.staticServer(this.data.imageURL)+i18n.imagesPath+i18n.imagesPathWsCommonWeatherwidget+this.data.imageURL+"' title='"+this.data.textDescription+"' alt='"+this.data.textDescription+"'/></a>");
B.append("<a class='nvt_details' href='#' id='WeatherInfo'>"+this.data.currentTemp+"\u00B0"+i18n.symbolF+"</a>");
B.append("<a href='#' id='WeatherInfo'><img src='"+commonData.staticServer(this.data.providerImageSmall)+i18n.imagesPath+i18n.imagesPathWsCommonWeatherwidget+this.data.providerImageSmall+"' title='"+i18n.theWeatherChannel+"' alt='"+i18n.theWeatherChannel+"'/></a>");
if(this.options.noFirstShow){var C="<p>Loading weather data</p>";this.options.noFirstShow=false;}else{var C=this.getModalContent();
}B.append("<div style='display:none;' id='weatherWidgetModalDiv'>"+C+"</div>");this.finalExecution(A);
};Nvt.Widget.TableWidget=Class.create();Nvt.Widget.TableWidget.prototype={initialize:function(formatter,data,defaultSortField,defaultSortOrder,displayAd,adText,titleText,sortable){var i=0;
this.initializeWidget();this.adText=adText;if(!this.adText){this.adText=i18n.moreDetailsBelow;}this.titleText=titleText;
if(!this.titleText){this.titleText="";}if(!defaultSortOrder){defaultSortOrder="asc";}this.formatter=formatter;
this.sortable=true;if(typeof (sortable)!="undefined"){this.sortable=sortable;}nQ(this.DOM).addClass("nvt_tableWidgetWrapper");
var fields=this.formatter.getFields();var includeList=this.formatter.includeList;if(typeof (data)=="string"){data=eval("("+data+")");
}var table=nQ('<table class="nvt_striped" cellspacing="0" id="nvt_table'+document.widgetManager.getTableId()+'"></table>');
var head=nQ("<thead></thead>");var headTr=nQ('<tr id="'+this.id+'_row0"></tr>');var context=this;nQ.each(includeList,function(i,v){for(i=0;
i<fields.length;i++){if(fields[i].field==v){break;}}var sortOrder="nvt_desc";if(defaultSortField==fields[i].field){sortOrder="nvt_"+defaultSortOrder+" nvt_sorted nvt_sorted"+Nvt.Util.cap1stLetters(defaultSortOrder);
}var altText="";if(context.sortable){altText=i18n.clickToSort;}headTr.append("<th class='nvt_"+fields[i].sortType+" "+sortOrder+" nvt_"+fields[i].field+"'><span title=\""+altText+'">'+fields[i].label+"</span></th>");
});head.append(headTr);table.append(head);var body=nQ("<tbody></tbody>");table.append(body);var values=new Array();
for(i=0;i<includeList.length;i++){var array=new Array();values.push(array);}var widgetId=this.id;for(x=0;
x<data.length;x++){nQ.each(includeList,function(i,v){for(j=0;j<fields.length;j++){if(fields[j].field==v){break;
}}if(typeof (fields[j].sortValue)=="undefined"){Nvt.console.error("sortValue is not defined on your formatter");
}var secondHalf=fields[j].renderer(data[x]);var sortOn=eval("data[x]"+fields[j].sortValue);var firstHalf=nQ('<span id="'+widgetId+"_row"+(x+1)+"_col"+i+'_span" class="nvt_sortable" style="display:none;">'+sortOn+"</span>");
var div=nQ("<div></div>");div.append(firstHalf).append(secondHalf);var rendererHasAnalyticsLink=secondHalf.find("a").hasClass("nvt_analyticsLink");
if(formatter.getClickClosure(data[x])!=null){div.click(formatter.getClickClosure(data[x],rendererHasAnalyticsLink));
}values[i].push(div);});}for(i=0;i<data.length;i++){if(i==3&&displayAd){this.displayAd(values.length,body,true);
this.adPosition=i;}var tr=nQ('<tr id="'+this.id+"_row"+(i+1)+'" title="'+this.titleText+'"></tr>');for(j=0;
j<values.length;j++){var td=nQ('<td id="'+this.id+"_row"+(i+1)+"_col"+j+'"></td>');td.append(values[j][i]);
tr.append(td);}body.append(tr);}if(data.length<=3&&displayAd){this.displayAd(values.length,body,false);
this.adPosition=data.length+1;}this.DOM.appendChild(table[0]);},displayAd:function(D,A,F){var B=nQ('<tr id="'+this.id+'_rowAd" class="nvt_ad"></tr>');
var E=nQ('<td id="'+this.id+'_rowAd_col1" colspan="'+D+'"></td>');B.append(E);var C=Nvt.Util.getTableAd(this.adText,F);
E.append(C);A.append(B);},postDisplay:function(){var D=this.id;var B=this.adPosition-1;var A=0;var C=false;
if(this.sortable){nQ("#"+D+" > table > thead > tr > th").each(function(E){nQ(this).click(function(){if(!C){C=true;
nQ("#"+D+" table tbody tr:first").removeClass("nvt_first");var G=nQ("#"+D+" > table > thead > tr > th:eq("+E+")");
var F=nQ("#"+D+" > table > tbody > tr.nvt_ad").remove();var H=nQ("#"+D+" > table > tbody > tr:not(.nvt_twistHidden)").get();
nQ.each(H,function(K,M){var L=nQ("#"+nQ(M).children("td").eq(E)[0].id+"_span").text();if(G.hasClass("nvt_alpha")){M.sortKey=L.toUpperCase();
}else{M.sortKey=parseFloat(L);}});H.sort(function(L,K){var M=0;if(L.sortKey<K.sortKey){M=-1;}if(L.sortKey>K.sortKey){M=1;
}if(G.hasClass("nvt_asc")){M=M*-1;}return M;});nQ.each(H,function(K,L){nQ("#"+D+" > table > tbody").append(L);
L.sortKey=null;});var I=nQ("#"+D+" > table > tbody > tr.nvt_twistHidden").get();nQ.each(I,function(K,L){var M=L.id.substr(0,L.id.length-7);
nQ("#"+M).after(L);});nQ("#"+D+" > table > tbody > tr:eq("+B+")").after(F);if(G.hasClass("nvt_asc")){G.addClass("nvt_desc").removeClass("nvt_asc");
}else{G.addClass("nvt_asc").removeClass("nvt_desc");}nQ("#"+D+"  table  thead  tr  th").removeClass("nvt_sorted").removeClass("nvt_sortedAsc").removeClass("nvt_sortedDesc");
var J="nvt_sortedAsc";if(G.hasClass("nvt_desc")){J="nvt_sortedDesc";}G.addClass("nvt_sorted").addClass(J);
nQ("#"+D+" table tbody tr:first").addClass("nvt_first");Nvt.Util.zebraStripe();C=false;}});});}nQ("#"+D+" table tr").each(function(E,F){nQ("#"+F.id+" td:last, #"+F.id+" th:last").addClass("nvt_last");
});nQ("#"+D+" table tbody tr:first").addClass("nvt_first");Nvt.Util.zebraStripe();this.finalExecution();
},CLASS_NAME:"Nvt.Widget.TableWidget"};Object.extend(Nvt.Widget.TableWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.RoutingTrafficItemsWidget=Class.create();Nvt.Widget.RoutingTrafficItemsWidget.prototype={initialize:function(E,B,D,H,C,G,A,F){this.initializeWidget();
this.metroId=H;this.divId=B;this.data=D;this.incidentType=E;this.max=A;this.showAds=C;this.coord=G;this.noSlide=F;
if(B){nQ("#"+B).append(this.spinner);}this.getData();},postInit:function(C){if(this.data.trafficItems){this.data=this.data.trafficItems;
}var F=null;var B=null;var D=null;var A="";if(this.incidentType==Nvt.Widget.TrafficItemConstants.INCIDENT){var E=["criticality","itemType","description"];
this.formatter=new Nvt.Formatter.RoutingTrafficItemIncidentFormatter(E,this.noSlide);F="criticality";
B="desc";D=i18n.moreIncidentsBelow;}else{var E=["criticality","itemType","description"];this.formatter=new Nvt.Formatter.RoutingTrafficItemIncidentFormatter(E);
}this.data=Nvt.Util.addCritSort(this.data);this.table=new Nvt.Widget.TableWidget(this.formatter,this.data,F,B,this.showAds,D,A);
nQ(this.DOM).append(this.table.DOM);Nvt.Util.zebraStripe();},postDisplay:function(){if(this.incidentType==null){this.incidentType="generic";
}nQ("#"+this.id).removeClass(this.cssClassName).addClass(this.cssClassName+"_"+this.incidentType);this.finalExecution();
},CLASS_NAME:"Nvt.Widget.RoutingTrafficItemsWidget"};Object.extend(Nvt.Widget.RoutingTrafficItemsWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.RecentlyViewedWidget=Class.create();Nvt.Widget.RecentlyViewedWidget.prototype={initialize:function(D,A,B){this.initializeWidget();
this.metroId=D;this.divId=A;this.data=B;this.backLinkText=i18n.backToRecentlyViewed;this.defaultSortField=null;
this.defaultSortOrder=null;var C=["name","direction","jamFactor","incidents"];this.formatter=new Nvt.Formatter.RoadFormatter(C);
this.formatter.parentWidgetName="RecentlyViewed";this.getData();},getRestUrl:function(){var A=commonData.restServerName+"/roads?roadList="+Nvt.Util.getRecentlyViewed()+"&var="+this.id+"&dataset=all&metroId="+this.metroId;
return A;},postInit:function(){this.pageTitle=i18n.recentlyViewed+" :: "+metroSummary.metros[0].metroName+" :: "+i18n.trafficDotCom;
this.setPageTitle(this.pageTitle);this.data=this.data.roads;var A=Nvt.Util.isLoggedIn();var E=true;var D=false;
if(!A&&this.data.length>3){E=false;D=true;var C=new Array();for(var B=0;B<3;B++){C.push(this.data[B]);
}this.data=C;}if(this.data.length>0){this.table=new Nvt.Widget.TableWidget(this.formatter,this.data,this.defaultSortField,this.defaultSortOrder,E);
this.table.parentWidgetName="Nvt.Widget.RecentlyViewedWidget";this.table.display(this.id);}else{nQ(this.DOM).append(nQ('<p id="nvt_noRecentRoads">'+i18n.noRecentRoads+"</p>"));
var G=Nvt.Util.getTableAd();nQ(this.DOM).append(G);}if(D){var F=new Nvt.Widget.NotLoggedInWidget(escape("/controller/workspace?browse=3"));
F.display(this.id);}document.widgetManager.getSlideWidget().animateHeight();},refreshCallback:function(B,A){if(B){this.metroId=B;
}this.divId=null;this.retrieveDtos(this.metroId);this.redisplay();},CLASS_NAME:"Nvt.Widget.RecentlyViewedWidget"};
Object.extend(Nvt.Widget.RecentlyViewedWidget.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.Widget.DOTLogosWidget=Class.create();
Nvt.Widget.DOTLogosWidget.prototype={initialize:function(B,D,C,A){this.initializeWidget();this.metroId=D;
this.divId=B;this.metroName=C;this.metroShortName=A;this.makeRestCall();},makeRestCall:function(){url=commonData.appServerName+"/controller/dotLogos?&metroId="+this.metroId;
nQ.getJSON(url,null,this.postInit.bind(this));},postInit:function(B){if(B){var E=B.dotlogos;}var G=E.length?E.length:0;
var F=nQ("<p>"+i18n.trafficBroughtCooperation+"</p>");var D=nQ('<div id="nvt_dotLogos"></div>');for(var C=0;
C<E.length;C++){D.append("<img src='"+commonData.staticServer(E[C])+i18n.imagesPath+"/ws-metro/agencyLogo/"+E[C]+"'/>");
}var A=nQ("<a href='"+commonData.helpServerName+"/Resources_for_"+this.metroShortName+"'>"+i18n.more+" "+this.metroName+" "+i18n.areaTrafficResources+"</a>");
this.DOM.appendChild(F[0]);this.DOM.appendChild(D[0]);this.DOM.appendChild(A[0]);},postDisplay:function(){this.cleanUp();
},CLASS_NAME:"Nvt.Widget.DOTLogosWidget"};Object.extend(Nvt.Widget.DOTLogosWidget.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.Widget.NextStepsWidget=Class.create();Nvt.Widget.NextStepsWidget.prototype={initialize:function(B,A){this.initializeWidget();
this.drive1=B[0];if(B.length>1){this.drive2=B[1];}this.drive1CommuteId=A[0];if(A.length>1){this.drive2CommuteId=A[1];
}this.metroId=metroId;document.saveDriveWidget=null;this.createMarkUp();},createMarkUp:function(){var E=commonData.appServerName+"/controller/myTraffic";
var K=nQ("<div id='nvt_buildDriveStep3' class='nvt_buildDriveStep'></div>");K.append(nQ("<h1 class='nvt_replace nvt_headline'>"+i18n.nextSteps+"</h1>"));
var I=(this.drive2)?" and <span id='nvt_drive2' class='nvt_drive'>"+this.drive2+"</span>":"";var B=nQ("<div id='nvt_saveDriveConfirm'><h2>"+i18n.yourDrive+" <span id='nvt_drive1' class='nvt_drive'>"+this.drive1+"</span>"+I+" "+i18n.hasBeenSucessfullySavedTo+" <a href='"+E+"'>"+i18n.myTraffic+"</a></h2></div>");
K.append(B);Nvt.Core.NvtAnalytics.virtual("/virtual/click/saveDrive/routing/nextStepsWidget");var O=nQ("<div id='nvt_nextSteps'></div>");
var G=nQ("<ul></ul>");var N=nQ('<li id="nvt_addAlertsInfo"></li>');N.append(nQ("<h3 class='nvt_replace'>"+i18n.scheduleAlerts+"</h3>"));
N.append(nQ("<p>"+i18n.getRealTimeTrafficAlertsForThisDrive+"</p>"));var F=nQ("<a href='#' id='nvt_sampleAlerts'>"+i18n.viewSampleAlerts+"</a>");
F.click(function(){Nvt.Core.NvtAnalytics.virtual("/virtual/click/nextsteps/samplealerts");new Nvt.Widget.Modal(false,{"dimensions":{"width":600},"href":commonData.helpServerName+"/SampleAlerts?modal=true","id":"nvt_sampleAlerts","noBind":true,"title":i18n.sampleAlerts});
document.nvtModalManager.toggle("nvt_sampleAlerts");});N.append(F);N.append(nQ("<h4 class='nvt_main_content_link'>"+i18n.setUpAlertsForColon+"</h4>"));
var M=nQ("<ul id='nvt_alertDriveList'></ul>");var D=nQ("<li><a href='#'>"+this.drive1+"</a></li>").bind("click",this.getAddAlertsClosure(this.drive1CommuteId,metroId));
M.append(D);if(this.drive2){var C=nQ("<li><a href='#'>"+this.drive2+"</a></li>").bind("click",this.getAddAlertsClosure(this.drive2CommuteId,metroId));
M.append(C);}N.append(M);G.append(N);var J=nQ('<li id="nvt_reverseDrive"></li>');J.append("<h3 class='nvt_replace'>"+i18n.reverseDrive+"</h3>");
J.append("<p>"+i18n.swapYourStartEndPointsFindBestWay+"</p>");var A=nQ("<a href='#''>"+i18n.reverseThisDrive+"</a>");
A.click(function(){Nvt.Core.NvtAnalytics.virtual("/virtual/click/nextsteps/reverserdrive");reverseRoute();
});J.append(A);G.append(J);var H=nQ("<li></li>");H.append(nQ("<h3 class='nvt_replace'>"+i18n.seeYourDrive+"</h3>"));
H.append(nQ("<p>"+i18n.checkCurrentTafficConditionsOnYourDrives+"</p>"));var L=nQ("<a href='#'>"+i18n.goToMyTraffic+"</a>");
L.click(function(){Nvt.Core.NvtAnalytics.virtual("/virtual/click/nextsteps/mytraffic");window.location.href=E;
});H.append(L);G.append(H);O.append(G);K.append(O);this.DOM.appendChild(K[0]);},getAddAlertsClosure:function(C,B){var A=function(){Nvt.Core.NvtAnalytics.virtual("/virtual/click/nextsteps/setupalerts");
new Nvt.Widget.Modal(false,{"dimensions":{"height":9000,"width":620},"href":commonData.appServerName+"/controller/showAlerts?metroId="+B+"&commuteId="+C,"id":"nvt_addAlert","noBind":true,"title":i18n.scheduleAlerts});
document.nvtModalManager.toggle("nvt_addAlert");Nvt.console.debug("Setup alerts Link:"+link);};return A;
},CLASS_NAME:"Nvt.Widget.NextStepsWidget"};Object.extend(Nvt.Widget.NextStepsWidget.prototype,Nvt.Widget.WidgetBase.prototype);
var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];
var logLevelCookieName="www.traffic.com:LogLevel";if(!("console" in window)||!("firebug" in console)){(function(){var logLevel=Nvt.Util.getQueryParamValue("logLevel");
var cookieLogLevel=Nvt.Util.readCookie(logLevelCookieName);if(logLevel!=""){if(cookieLogLevel!=logLevel){Nvt.Util.createCookie(logLevelCookieName,logLevel,365);
}}else{logLevel="error";if(cookieLogLevel!=null){logLevel=cookieLogLevel;}}window.console={log:function(){if(logLevel=="all"||logLevel=="log"){logFormatted(arguments,"");
}},debug:function(){if(logLevel=="all"||logLevel=="debug"){logFormatted(arguments,"debug");}},info:function(){if(logLevel=="all"||logLevel=="info"){logFormatted(arguments,"info");
}},warn:function(){if(logLevel=="all"||logLevel=="warn"){logFormatted(arguments,"warning");}},error:function(){if(logLevel=="all"||logLevel=="error"){logFormatted(arguments,"error");
}},assert:function(truth,message){if(logLevel=="all"||logLevel=="assert"){if(!truth){var args=[];for(var i=1;
i<arguments.length;++i){args.push(arguments[i]);}logFormatted(args.length?args:["Assertion Failure"],"error");
throw message?message:"Assertion Failure";}}},dir:function(object){var html=[];var pairs=[];for(var name in object){try{pairs.push([name,object[name]]);
}catch(exc){}}pairs.sort(function(a,b){return a[0]<b[0]?-1:1;});html.push("<table>");for(var i=0;i<pairs.length;
++i){var name=pairs[i][0],value=pairs[i][1];html.push("<tr>",'<td class="propertyNameCell"><span class="propertyName">',escapeHTML(name),"</span></td>",'<td><span class="propertyValue">');
appendObject(value,html);html.push("</span></td></tr>");}html.push("</table>");logRow(html,"dir");},dirxml:function(node){var html=[];
appendNode(node,html);logRow(html,"dirxml");},group:function(){logRow(arguments,"group",pushGroup);},groupEnd:function(){logRow(arguments,"",popGroup);
},time:function(name){timeMap[name]=(new Date()).getTime();},timeEnd:function(name){if(name in timeMap){var delta=(new Date()).getTime()-timeMap[name];
logFormatted([name+":",delta+"ms"]);delete timeMap[name];}},count:function(){this.warn(["count() not supported."]);
},trace:function(){this.warn(["trace() not supported."]);},profile:function(){this.warn(["profile() not supported."]);
},profileEnd:function(){},clear:function(){consoleBody.innerHTML="";},open:function(){toggleConsole(true);
},close:function(){if(frameVisible){toggleConsole();}}};var consoleFrame=null;var consoleBody=null;var commandLine=null;
var frameVisible=false;var messageQueue=[];var groupStack=[];var timeMap={};var clPrefix=">>> ";var isFirefox=navigator.userAgent.indexOf("Firefox")!=-1;
var isIE=navigator.userAgent.indexOf("MSIE")!=-1;var isOpera=navigator.userAgent.indexOf("Opera")!=-1;
var isSafari=navigator.userAgent.indexOf("AppleWebKit")!=-1;function toggleConsole(forceOpen){frameVisible=forceOpen||!frameVisible;
if(consoleFrame){consoleFrame.style.visibility=frameVisible?"visible":"hidden";}else{waitForBody();}}function focusCommandLine(){toggleConsole(true);
if(commandLine){commandLine.focus();}}function waitForBody(){if(document.body){createFrame();}else{setTimeout(waitForBody,200);
}}function createFrame(){if(consoleFrame){return ;}window.onFirebugReady=function(doc){window.onFirebugReady=null;
var toolbar=doc.getElementById("toolbar");toolbar.onmousedown=onSplitterMouseDown;commandLine=doc.getElementById("commandLine");
addEvent(commandLine,"keydown",onCommandLineKeyDown);addEvent(doc,isIE||isSafari?"keydown":"keypress",onKeyDown);
consoleBody=doc.getElementById("log");layout();flush();};var baseURL=getTrafficdotcomURL();consoleFrame=document.createElement("iframe");
consoleFrame.setAttribute("frameBorder","0");consoleFrame.style.visibility=(frameVisible?"visible":"hidden");
consoleFrame.style.zIndex="2147483647";consoleFrame.style.position="absolute";consoleFrame.style.width="100%";
consoleFrame.style.left="0";consoleFrame.style.bottom="0";consoleFrame.style.height="200px";document.body.appendChild(consoleFrame);
consoleFrame.contentWindow.document.write(getConsoleHtml(baseURL));consoleFrame.contentWindow.document.close();
}function getConsoleHtml(url){var html='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
html+='<html xmlns="http://www.w3.org/1999/xhtml">';html+="<head>";html+="<title>Firebug</title>";html+='<link rel="stylesheet" type="text/css" href="'+url+'/css/console.css">';
html+="</head>";html+="<body>";html+='<div id="toolbar" class="toolbar">';html+='<a href="#" onclick="parent.console.clear()">Clear</a>';
html+='<span class="toolbarRight">';html+='<a href="#" onclick="parent.console.close()">Close</a>';html+="</span>";
html+="</div>";html+='<div id="log"></div>';html+='<input type="text" id="commandLine">';html+="<scr"+"ipt>parent.onFirebugReady(document);</scr"+"ipt>";
html+="</body>";html+="</html>";return html;}function getTrafficdotcomURL(){var scripts=document.getElementsByTagName("script");
for(var i=0;i<scripts.length;++i){if(scripts[i].src.indexOf("trafficDotCom-min.js")!=-1){var lastSlash=scripts[i].src.lastIndexOf("/");
var path=scripts[i].src.substr(0,lastSlash);lastSlash=path.lastIndexOf("/");return path.substr(0,lastSlash);
}}}function evalCommandLine(){var text=commandLine.value;commandLine.value="";logRow([clPrefix,text],"command");
var value;try{value=eval(text);}catch(exc){}}function layout(){var toolbar=consoleBody.ownerDocument.getElementById("toolbar");
var height=consoleFrame.offsetHeight-(toolbar.offsetHeight+commandLine.offsetHeight);consoleBody.style.top=toolbar.offsetHeight+"px";
consoleBody.style.height=height+"px";commandLine.style.top=(consoleFrame.offsetHeight-commandLine.offsetHeight)+"px";
}function logRow(message,className,handler){if(consoleBody){writeMessage(message,className,handler);}else{messageQueue.push([message,className,handler]);
waitForBody();}}function flush(){var queue=messageQueue;messageQueue=[];for(var i=0;i<queue.length;++i){writeMessage(queue[i][0],queue[i][1],queue[i][2]);
}}function writeMessage(message,className,handler){var isScrolledToBottom=consoleBody.scrollTop+consoleBody.offsetHeight>=consoleBody.scrollHeight;
if(!handler){handler=writeRow;}handler(message,className);if(isScrolledToBottom){consoleBody.scrollTop=consoleBody.scrollHeight-consoleBody.offsetHeight;
}}function appendRow(row){var container=groupStack.length?groupStack[groupStack.length-1]:consoleBody;
container.appendChild(row);}function writeRow(message,className){var row=consoleBody.ownerDocument.createElement("div");
row.className="logRow"+(className?" logRow-"+className:"");row.innerHTML=message.join("");appendRow(row);
}function pushGroup(message,className){logFormatted(message,className);var groupRow=consoleBody.ownerDocument.createElement("div");
groupRow.className="logGroup";var groupRowBox=consoleBody.ownerDocument.createElement("div");groupRowBox.className="logGroupBox";
groupRow.appendChild(groupRowBox);appendRow(groupRowBox);groupStack.push(groupRowBox);}function popGroup(){groupStack.pop();
}function logFormatted(objects,className){var html=[];var format=objects[0];var objIndex=0;if(typeof (format)!="string"){format="";
objIndex=-1;}var parts=parseFormat(format);for(var i=0;i<parts.length;++i){var part=parts[i];if(part&&typeof (part)=="object"){var object=objects[++objIndex];
part.appender(object,html);}else{appendText(part,html);}}for(var i=objIndex+1;i<objects.length;++i){appendText(" ",html);
var object=objects[i];if(typeof (object)=="string"){appendText(object,html);}else{appendObject(object,html);
}}logRow(html,className);}function parseFormat(format){var parts=[];var reg=/((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/;
var appenderMap={s:appendText,d:appendInteger,i:appendInteger,f:appendFloat};for(var m=reg.exec(format);
m;m=reg.exec(format)){var type=m[8]?m[8]:m[5];var appender=type in appenderMap?appenderMap[type]:appendObject;
var precision=m[3]?parseInt(m[3]):(m[4]=="."?-1:0);parts.push(format.substr(0,m[0][0]=="%"?m.index:m.index+1));
parts.push({appender:appender,precision:precision});format=format.substr(m.index+m[0].length);}parts.push(format);
return parts;}function escapeHTML(value){function replaceChars(ch){switch(ch){case"<":return"&lt;";case">":return"&gt;";
case"&":return"&amp;";case"'":return"&#39;";case'"':return"&quot;";}return"?";}return String(value).replace(/[<>&"']/g,replaceChars);
}function objectToString(object){try{return object+"";}catch(exc){return null;}}function appendText(object,html){html.push(escapeHTML(objectToString(object)));
}function appendNull(object,html){html.push('<span class="objectBox-null">',escapeHTML(objectToString(object)),"</span>");
}function appendString(object,html){html.push('<span class="objectBox-string">&quot;',escapeHTML(objectToString(object)),"&quot;</span>");
}function appendInteger(object,html){html.push('<span class="objectBox-number">',escapeHTML(objectToString(object)),"</span>");
}function appendFloat(object,html){html.push('<span class="objectBox-number">',escapeHTML(objectToString(object)),"</span>");
}function appendFunction(object,html){var reName=/function ?(.*?)\(/;var m=reName.exec(objectToString(object));
var name=m?m[1]:"function";html.push('<span class="objectBox-function">',escapeHTML(name),"()</span>");
}function appendObject(object,html){try{if(object==undefined){appendNull("undefined",html);}else{if(object==null){appendNull("null",html);
}else{if(typeof object=="string"){appendString(object,html);}else{if(typeof object=="number"){appendInteger(object,html);
}else{if(typeof object=="function"){appendFunction(object,html);}else{if(object.nodeType==1){appendSelector(object,html);
}else{if(typeof object=="object"){appendObjectFormatted(object,html);}else{appendText(object,html);}}}}}}}}catch(exc){}}function appendObjectFormatted(object,html){var text=objectToString(object);
var reObject=/\[object (.*?)\]/;var m=reObject.exec(text);html.push('<span class="objectBox-object">',m?m[1]:text,"</span>");
}function appendSelector(object,html){html.push('<span class="objectBox-selector">');html.push('<span class="selectorTag">',escapeHTML(object.nodeName.toLowerCase()),"</span>");
if(object.id){html.push('<span class="selectorId">#',escapeHTML(object.id),"</span>");}if(object.className){html.push('<span class="selectorClass">.',escapeHTML(object.className),"</span>");
}html.push("</span>");}function appendNode(node,html){if(node.nodeType==1){html.push('<div class="objectBox-element">','&lt;<span class="nodeTag">',node.nodeName.toLowerCase(),"</span>");
for(var i=0;i<node.attributes.length;++i){var attr=node.attributes[i];if(!attr.specified){continue;}html.push('&nbsp;<span class="nodeName">',attr.nodeName.toLowerCase(),'</span>=&quot;<span class="nodeValue">',escapeHTML(attr.nodeValue),"</span>&quot;");
}if(node.firstChild){html.push('&gt;</div><div class="nodeChildren">');for(var child=node.firstChild;
child;child=child.nextSibling){appendNode(child,html);}html.push('</div><div class="objectBox-element">&lt;/<span class="nodeTag">',node.nodeName.toLowerCase(),"&gt;</span></div>");
}else{html.push("/&gt;</div>");}}else{if(node.nodeType==3){html.push('<div class="nodeText">',escapeHTML(node.nodeValue),"</div>");
}}}function addEvent(object,name,handler){if(document.all){object.attachEvent("on"+name,handler);}else{object.addEventListener(name,handler,false);
}}function removeEvent(object,name,handler){if(document.all){object.detachEvent("on"+name,handler);}else{object.removeEventListener(name,handler,false);
}}function cancelEvent(event){if(document.all){event.cancelBubble=true;}else{event.stopPropagation();
}}function onError(msg,href,lineNo){var html=[];var lastSlash=href.lastIndexOf("/");var fileName=lastSlash==-1?href:href.substr(lastSlash+1);
html.push('<span class="errorMessage">',msg,"</span>",'<div class="objectBox-sourceLink">',fileName," (line ",lineNo,")</div>");
logRow(html,"error");}function onKeyDown(event){if(event.keyCode==123){toggleConsole();}else{if((event.keyCode==108||event.keyCode==76)&&event.shiftKey&&(event.metaKey||event.ctrlKey)){focusCommandLine();
}else{return ;}}cancelEvent(event);}function onSplitterMouseDown(event){if(isSafari||isOpera){return ;
}addEvent(document,"mousemove",onSplitterMouseMove);addEvent(document,"mouseup",onSplitterMouseUp);for(var i=0;
i<frames.length;++i){addEvent(frames[i].document,"mousemove",onSplitterMouseMove);addEvent(frames[i].document,"mouseup",onSplitterMouseUp);
}}function onSplitterMouseMove(event){var win=document.all?event.srcElement.ownerDocument.parentWindow:event.target.ownerDocument.defaultView;
var clientY=event.clientY;if(win!=win.parent){clientY+=win.frameElement?win.frameElement.offsetTop:0;
}var height=consoleFrame.offsetTop+consoleFrame.clientHeight;var y=height-clientY;consoleFrame.style.height=y+"px";
layout();}function onSplitterMouseUp(event){removeEvent(document,"mousemove",onSplitterMouseMove);removeEvent(document,"mouseup",onSplitterMouseUp);
for(var i=0;i<frames.length;++i){removeEvent(frames[i].document,"mousemove",onSplitterMouseMove);removeEvent(frames[i].document,"mouseup",onSplitterMouseUp);
}}function onCommandLineKeyDown(event){if(event.keyCode==13){evalCommandLine();}else{if(event.keyCode==27){commandLine.value="";
}}}window.onerror=onError;addEvent(document,isIE||isSafari?"keydown":"keypress",onKeyDown);if(document.documentElement.getAttribute("debug")=="true"){toggleConsole(true);
}})();}else{var logLevel=Nvt.Util.getQueryParamValue("logLevel");var cookieLogLevel=Nvt.Util.readCookie(logLevelCookieName);
if(logLevel!=""){if(cookieLogLevel!=logLevel){Nvt.Util.createCookie(logLevelCookieName,logLevel,365);
}}else{logLevel="error";if(cookieLogLevel!=null){logLevel=cookieLogLevel;}}if(logLevel!="all"){for(var i=0;
i<names.length;++i){if(names[i]!=logLevel){window.console[names[i]]=function(){};}}}}(function(){Nvt.console={};
if("console" in window){Nvt.console={log:function(){console.log.apply(window,arguments);},debug:function(){console.debug.apply(window,arguments);
},error:function(){console.error.apply(window,arguments);},time:function(){console.time.apply(window,arguments);
},timeEnd:function(){console.timeEnd.apply(window,arguments);}};if(("firebug" in console)){if(logLevel!="all"){for(var A=0;
A<names.length;++A){if(names[A]!=logLevel){Nvt.console[names[A]]=function(){};}}}}}})();function showListHistory(A){clearInputField(A);
Nvt.Widget.SelectHistoryWidget.showList("RouteHistory",$(A),null);}function saveAddressHistory(A){var B=Nvt.Widget.SelectHistoryWidget.getItems("RouteHistory");
var C=($F(A));if(C&&i18n.addressCityStateZIP!=C){B.addItem(C,20);}B.save();}function saveAddressAndCoordinate(B,F){var D=Nvt.Util.decimalPrecision(F.latitudeInMins,4);
var E=Nvt.Util.decimalPrecision(F.longitudeInMins,4);var A="lat|"+F.latitudeInMins+"|lon|"+F.longitudeInMins;
var C=Nvt.Widget.SelectHistoryWidget.getItems("RouteHistory");C.addItem(B,20,A);C.save();}function historyEvent(A,B){if($(A)){Event.observe($(A),"click",function(){showListHistory(B);
});}}Nvt.I18N=new Object();Nvt.I18N.resolveString=function(E,B){var F="${";var G="}";var C=i18n[E];for(var D=0;
D<B.length;D++){var A=F+D+G;C=C.replace(A,B[D]);}return C;};Nvt.Formatter.AllRoadsFormatter=Class.create();
Nvt.Formatter.AllRoadsFormatter.prototype={initialize:function(E){this.fields=new Array();this.includeList=E;
var A={};A.field="signText1";A.label=i18n.labelRoadway;A.sortValue="";A.sortType="numeric";A.renderer=function(H){var F;
for(key in H.direction){F=H.direction[key];this.sortValue=".direction['"+key+"'].signText1";break;}var G="<div class='nvt_roadName'><span class=\"nvt_roadSignAndNumber nvt_"+F.roadType+'" >'+F.signText1+'</span><div class="nvt_roadInfo">'+H.name;
if(F.startPointName&&F.endPointName){G+="<p>"+Nvt.I18N.resolveString("roadsFromTo",new Array(F.startPointName,F.endPointName))+"</p>";
}G+="</div></div>";A.sortValue;return nQ(G);};this.fields.push(A);var C={};C.field="incidents";C.label=i18n.labelIncidents;
C.sortValue=".driveReport.trafficItems.length";C.sortType="numeric";C.renderer=function(F){return nQ('<div class="nvt_incidentCount">'+F.driveReport.trafficItems.length+"</div>");
};this.fields.push(C);var D={};D.field="direction";D.label=i18n.labelDirection;D.sortType="alpha";D.sortValue="";
D.renderer=function(H){var G=nQ("<div class='nvt_direction'></div>");if(typeof (H.direction)=="object"){var F=0;
for(key in H.direction){this.sortValue=".direction['"+key+"'].direction";var I=nQ("<a href='#' id="+key+">"+Nvt.Util.scrubBound(key.charAt(0).toUpperCase()+key.substr(1).toLowerCase())+"</a>");
I.click(function(){Nvt.Core.NvtAnalytics.virtual("/virtual/click/AllRoads/"+H.name+"-"+this.id);var J=new Nvt.Widget.ParentKeyRouteWidget(H.direction[this.id],null,H.direction[this.id].metroId);
document.widgetManager.getSlideWidget().push(J);});G.append(I[0]);if(F==0){G.append(' <span class="nvt_pipe">|</span> ');
}F++;}}else{G.append(H.direction);}return G;};this.fields.push(D);var B={};B.field="roadNo";B.label="";
B.sortValue="";B.sortType="numeric";B.renderer=function(G){var F;for(key in G.direction){F=G.direction[key];
break;}this.sortValue=".direction['"+F.direction+"'].signText1";return nQ('<div id="roadNo" class='+F.roadType+">"+F.signText1+"</div>");
};this.fields.push(B);},getFields:function(){return this.fields;},getClickClosure:function(A){return null;
},setParent:function(A){this.parentWidget=A;},CLASS_NAME:"Nvt.Formatter.AllRoadsFormatter"};Nvt.Formatter.MajorRoadsFormatter=Class.create();
Nvt.Formatter.MajorRoadsFormatter.prototype={initialize:function(D){this.fields=new Array();this.includeList=D;
var B={};B.field="jamFactor";B.label=i18n.labelJamFactorReg;B.sortType="numeric";B.sortValue=".jamFactor";
B.altText=i18n.altTextClickToSortOn+" "+i18n.labelJamFactor;B.renderer=function(F){var G=Nvt.Formatter.MajorRoadsFormatter.getJFImageString(F.jamFactor,F.jamFactorTrend);
var E=Nvt.Formatter.MajorRoadsFormatter.getJFImageString(F.jamFactor,F.jamFactorTrend,2);return nQ('<div class="nvt_jamFactor nvt_jamFactor'+Nvt.Formatter.MajorRoadsFormatter.getJFClass(F.jamFactor,F.jamFactorTrend)+'"><img src="'+commonData.staticServer(G)+i18n.imagesPath+i18n.imagesPathJamfactor+G+'" /></div><div class="nvt_jamFactorPrint"><img src="'+commonData.staticServer(E)+i18n.imagesPath+i18n.imagesPathJamfactor+E+'" /></div>');
};this.fields.push(B);var A={};A.field="name";A.label=i18n.labelRoadway;A.sortType="alpha";A.sortValue=".roadName";
A.altText=i18n.altTextClickToSortOn+" "+i18n.labelRoadway;A.renderer=function(F){var E="<div class='nvt_roadName'><div class=\"nvt_roadInfo\"><a class='nvt_childLink' href='javascript: void(0)'>"+F.roadName+"</a>";
if(F.startPointName&&F.endPointName){E+="<p>"+F.startPointName+" "+i18n.cTo+" "+F.endPointName+"</p>";
}E+="</div></div>";return nQ(E);};this.fields.push(A);var C={};C.field="incidents";C.label=i18n.labelIncidents;
C.sortType="numeric";C.sortValue=".incidentList.length";C.altText=i18n.altTextClickToSortOn+" "+i18n.labelIncidents;
C.renderer=function(E){return nQ('<div class="nvt_incidentCount">'+E.incidentList.length+"</div>");};
this.fields.push(C);},getFields:function(){return this.fields;},getClickClosure:function(A){},CLASS_NAME:"Nvt.Formatter.MajorRoadsFormatter"};
Nvt.Formatter.MajorRoadsFormatter.getJFImageString=function(B,A,D){var E={};E.jamFactor=Math.round(B);
E.trend=Math.round(A);var C=Nvt.Util.getJFImageString(E,D);return C;};Nvt.Formatter.MajorRoadsFormatter.getJFClass=function(B,A){B=Math.round(B);
var C=new String(B)+Nvt.Util.resolveTrend(A);return C;};Nvt.Formatter.AlertListFormatter=Class.create();
Nvt.Formatter.AlertListFormatter.prototype={initialize:function(E){this.fields=new Array();this.includeList=E;
var B={};B.field="name";B.label=i18n.labelAlertName;B.sortType="alpha";B.sortValue=".name";B.renderer=function(F){return nQ('<div class="nvt_name"><a>'+F.name+"</a></div>");
};this.fields.push(B);var D={};D.field="drive";D.label=i18n.labelPrimaryDrive;D.sortType="alpha";D.sortValue=".drives[0].name";
D.renderer=function(F){return nQ("<div>"+F.drives[0].name+"</div>");};this.fields.push(D);var C={};C.field="type";
C.label=i18n.labelType;C.sortType="alpha";C.sortValue=".deviceType";C.renderer=function(G){var F=G.deviceType;
if(F=="PHONE"&&G.deviceSubType=="SMS"){F="TEXT";}return nQ("<div>"+Nvt.Util.cap1stLetters(F)+"</div>");
};this.fields.push(C);var A={};A.field="status";A.label=i18n.labelStatus;A.sortType="alpha";A.sortValue=".active";
A.renderer=function(G){var F="";if(G.active=="true"){F='<span class="nvt_active">'+i18n.alertStatusActive+"</span>";
}else{F='<span class="nvt_suspended">'+i18n.alertStatusSuspend+"</span>";}return nQ('<div class="nvt_alertStatus">'+F+"</div>");
};this.fields.push(A);},getFields:function(){return this.fields;},getClickClosure:function(A){return null;
},CLASS_NAME:"Nvt.Formatter.AlertListFormatter"};Nvt.Formatter.DirectionsFormatter=Class.create();Nvt.Formatter.DirectionsFormatter.prototype={initialize:function(B){this.fields=new Array();
this.includeList=B;var A={};A.field="orderId";A.label=i18n.labelStep;A.sortType="numeric";A.sortValue=".orderId";
A.altText="";A.renderer=function(E){return nQ('<div class="nvt_directionStep">'+E.orderId+"</div>");};
this.fields.push(A);var C={};C.field="text";C.label=i18n.labelDirection;C.sortType="numeric";C.sortValue=".orderId";
C.altText="";C.renderer=function(F){var E="<div class='nvt_directionText'>"+F.text;E+="</div>";return nQ(E);
};this.fields.push(C);var D={};D.field="distance";D.label=i18n.labelDistance;D.sortType="numeric";D.sortValue=".distance";
D.altText="";D.renderer=function(E){return nQ('<div class="nvt_directionDistance">'+E.distance+" mi</div>");
};this.fields.push(D);},getFields:function(){return this.fields;},getClickClosure:function(A){},CLASS_NAME:"Nvt.Formatter.DirectionsFormatter"};
Nvt.Formatter.RoutingTrafficItemIncidentFormatter=Class.create();Nvt.Formatter.RoutingTrafficItemIncidentFormatter.prototype={initialize:function(C,E){this.fields=new Array();
this.includeList=C;this.noSlide=E;var A={};A.field="criticality";A.label=i18n.labelLevel;A.sortValue=".critSort";
A.sortType="numeric";A.renderer=function(G){var H="";var I=G.itemType.toLowerCase();var F=Nvt.Widget.TrafficItemConstants.EVENT.toLowerCase().substr(0,Nvt.Widget.TrafficItemConstants.EVENT.toLowerCase().length-1);
if(I==Nvt.Widget.TrafficItemConstants.INCIDENT.toLowerCase()){H="icon_map_inc"+G.criticality+'_rest.png"';
}else{if(I==Nvt.Widget.TrafficItemConstants.CONSTRUCTION.toLowerCase()){H='icon_map_cons_rest.png"';}else{if(I==F){H='icon_map_event_rest.png"';
}else{if(I==Nvt.Widget.TrafficItemConstants.MASSTRANSIT.toLowerCase()){H='icon_map_mt_rest.png"';}else{H="icon_map_inc"+G.criticality+'_rest.png"';
}}}}return nQ('<div class="nvt_trafficItemIcon nvt_inc'+G.criticality+'"><img src="'+commonData.staticServer(H)+i18n.imagesPath+i18n.imagesPathMapIcons+H+"/></div>");
};this.fields.push(A);var D={};D.field="itemType";D.label=i18n.labelType;D.sortValue=".itemType";D.sortType="alpha";
D.renderer=function(F){return nQ("<div>"+Nvt.Util.cap1stLetters(F.headerDesc)+"</div>");};this.fields.push(D);
var B={};B.field="description";B.label=i18n.labelDescription;B.sortValue=".keyRouteName";B.sortType="alpha";
B.renderer=function(H){var G='<div class="nvt_description">';var F="";if(H.keyRouteId!=null&&H.keyRouteId.length!=0){F+="<a class=\"nvt_roadLink\" href='javascript:void(0);'>"+H.keyRouteName+" - "+Nvt.Util.scrubBound(H.direction)+"</a>";
}else{if(H.municipality!=null&&H.municipality.length!=0){F+="Municipality: "+H.municipality;}else{if(H.locationName!=null&&H.locationName.length!=0){F+=H.locationName;
}}}if(nQ.trim(F)!=""){F+="<br/>";}F+=H.description;G+=F+"</div>";return nQ(G);};this.fields.push(B);},getFields:function(){return this.fields;
},getClickClosure:function(B){var A=this;var C=function(){};return C.bind(B);},CLASS_NAME:"Nvt.Formatter.RoutingTrafficItemIncidentFormatter"};
Nvt.Formatter.DriveListFormatter=Class.create();Nvt.Formatter.DriveListFormatter.prototype={initialize:function(E,G){this.fields=new Array();
this.includeList=E;this.metroId=G;var C={};C.field="name";C.label=i18n.labelDriveName;C.sortType="alpha";
C.sortValue=".name";C.altText=i18n.altTextClickToSortOn+" "+i18n.labelRoadway;C.renderer=function(H){return nQ("<div class='nvt_name'><a class='childLink nvt_analyticsLink' href='#'>"+H.name+"</a></div>");
};this.fields.push(C);var B={};B.field="jamFactor";B.label=i18n.labelJamFactorReg;B.sortType="numeric";
B.sortValue=".routes[0].driveReport.jamFactor.jamFactor";B.altText=i18n.altTextClickToSortOn+" "+i18n.labelJamFactor;
B.renderer=function(I){var J=Nvt.Util.getJFImageString(I.routes[0].driveReport.jamFactor);var H=Nvt.Util.getJFImageString(I.routes[0].driveReport.jamFactor,true);
return nQ('<div class="nvt_jamFactor nvt_jamFactor'+Nvt.Util.getJFClass(I.routes[0].driveReport.jamFactor)+'"><img src="'+commonData.staticServer(J)+i18n.imagesPath+i18n.imagesPathJamfactor+J+'" /></div><div class="nvt_jamFactorPrint"><img src="'+commonData.staticServer(H)+i18n.imagesPath+i18n.imagesPathJamfactor+H+'" /></div>');
};this.fields.push(B);var F={};F.field="driveTime";F.label=i18n.labelTravelTime;F.sortType="numeric";
F.sortValue=".routes[0].driveReport.driveTime.length";F.altText=i18n.altTextClickToSortOn+" "+i18n.driveTime;
F.renderer=function(H){return nQ('<div class="nvt_driveTime">'+Nvt.Util.parseTimeToHoursAndMinutes(H.routes[0].driveReport.driveTime)+"</div>");
};this.fields.push(F);var A={};A.field="delay";A.label=i18n.labelDelay;A.sortType="numeric";A.sortValue=".routes[0].driveReport.delay.length";
A.altText=i18n.altTextClickToSortOn+" "+i18n.labelDelay;A.renderer=function(H){return nQ('<div class="nvt_delay">'+Nvt.Util.parseTimeToHoursAndMinutes(H.routes[0].driveReport.delay)+"</div>");
};this.fields.push(A);var D={};D.field="incidents";D.label=i18n.labelIncidents;D.sortType="numeric";D.sortValue=".routes[0].driveReport.trafficItems.length";
D.altText=i18n.altTextClickToSortOn+" "+i18n.labelIncidents;D.renderer=function(H){return nQ('<div class="nvt_incidentCount">'+H.routes[0].driveReport.trafficItems.length+"</div>");
};this.fields.push(D);},getFields:function(){return this.fields;},getClickClosure:function(B,A){var D=this.metroId;
var C=this.parentWidgetName;var E=function(){if(!A){Nvt.Core.NvtAnalytics.virtual("/virtual/click/"+C+"/"+B.name);
}var G=new Nvt.Widget.DriveDetailsWidget(B);var F=Nvt.Util.driveToMapState(this);document.widgetManager.getSlideWidget().push(G,F);
};return E.bind(B);},CLASS_NAME:"Nvt.Formatter.DriveListFormatter"};Nvt.Formatter.RoadFormatter=Class.create();
Nvt.Formatter.RoadFormatter.prototype={initialize:function(H,A,G,E){this.fields=new Array();this.includeList=H;
this.animate=A;this.customBackClosure=G;this.customBackText=E;var C={};C.field="jamFactor";C.label=i18n.labelJamFactorReg;
C.sortType="numeric";C.sortValue=".driveReport.jamFactor.jamFactor";C.altText=i18n.altTextClickToSortOn+" "+i18n.labelJamFactor;
C.renderer=function(J){var K=Nvt.Util.getJFImageString(J.driveReport.jamFactor);var I=Nvt.Util.getJFImageString(J.driveReport.jamFactor,true);
return nQ('<div class="nvt_jamFactor nvt_jamFactor'+Nvt.Util.getJFClass(J.driveReport.jamFactor)+'"><img src="'+commonData.staticServer(K)+i18n.imagesPath+i18n.imagesPathJamfactor+K+'" /></div><div class="nvt_jamFactorPrint"><img src="'+commonData.staticServer(I)+i18n.imagesPath+i18n.imagesPathJamfactor+I+'" /></div>');
};this.fields.push(C);var B={};B.field="name";B.label=i18n.labelRoadway;B.sortType="numeric";B.sortValue=".signText1";
B.altText=i18n.altTextClickToSortOn+" "+i18n.labelRoadway;B.renderer=function(J){var I="<div class='nvt_roadName'><span class=\"nvt_roadSignAndNumber nvt_"+J.roadType+'" >'+J.signText1+'</span><div class="nvt_roadInfo"><a id = \''+J.name+" "+i18n.cFrom+" "+J.startPointName+" "+i18n.cTo+" "+J.endPointName+" - "+Nvt.Util.scrubBound(J.direction)+"'class='nvt_childLink nvt_analyticsLink' href='javascript: void(0)'>"+J.name+"</a>";
if(J.startPointName&&J.endPointName){I+="<p>"+J.startPointName+" "+i18n.cTo+" "+J.endPointName+"</p>";
}I+="</div></div>";return nQ(I);};this.fields.push(B);var D={};D.field="incidents";D.label=i18n.labelIncidents;
D.sortType="numeric";D.sortValue=".driveReport.trafficItems.length";D.altText=i18n.altTextClickToSortOn+" "+i18n.labelIncidents;
D.renderer=function(I){return nQ('<div class="nvt_incidentCount">'+I.driveReport.trafficItems.length+"</div>");
};this.fields.push(D);var F={};F.field="direction";F.label=i18n.labelDirection;F.sortType="alpha";F.sortValue=".direction";
F.altText=i18n.altTextClickToSortOn+" "+i18n.labelDirection;F.renderer=function(I){return nQ('<div class="nvt_direction">'+Nvt.Util.scrubBound(I.direction)+"</div>");
};this.fields.push(F);},getFields:function(){return this.fields;},getClickClosure:function(B,A){var E=B.metroId;
var C=this.parentWidgetName;var D=function(F,I,G){if(!A){Nvt.Core.NvtAnalytics.virtual("/virtual/click/"+C+"/"+this.name+" "+i18n.cFrom+" "+this.startPointName+" "+i18n.cTo+" "+this.endPointName+"-"+Nvt.Util.scrubBound(this.direction));
}if(this.parentId&&this.parentId.length>0){var H=new Nvt.Widget.ChildKeyRouteWidget(null,this.parentId,this.id,E,F);
}else{var H=new Nvt.Widget.ParentKeyRouteWidget(this,null,E,true,F);}document.widgetManager.getSlideWidget().push(H,null,I,G);
};return D.bind(B,this.animate,this.customBackClosure,this.customBackText);},CLASS_NAME:"Nvt.Formatter.RoadFormatter"};
Nvt.Formatter.TrafficItemMassTransitFormatter=Class.create();Nvt.Formatter.TrafficItemMassTransitFormatter.prototype={initialize:function(D){this.fields=new Array();
this.includeList=D;var B={};B.field="criticality";B.label="";B.sortValue=".criticality";B.sortType="numeric";
B.renderer=function(E){return nQ('<div class="nvt_trafficItemIcon nvt_mt"><img src="'+commonData.staticServer("icon_map_mt_rest.png")+i18n.imagesPath+i18n.imagesPathMapIcons+'icon_map_mt_rest.png" /></div>');
};this.fields.push(B);var C={};C.field="description";C.label=i18n.labelDescription;C.sortValue=".description";
C.sortType="alpha";C.renderer=function(E){return nQ('<div class="nvt_description">'+E.description+"</div>");
};this.fields.push(C);var A={};A.field="serviceDesc";A.label=i18n.labelName;A.sortValue=".serviceDesc";
A.sortType="alpha";A.renderer=function(E){return nQ("<div>"+Nvt.Util.cap1stLetters(E.serviceDesc)+"</div>");
};this.fields.push(A);},getFields:function(){return this.fields;},getClickClosure:function(A){return function(){};
},CLASS_NAME:"Nvt.Formatter.TrafficItemMassTransitFormatter"};Nvt.Formatter.ParentKeyrouteRoadFormatter=Class.create();
Nvt.Formatter.ParentKeyrouteRoadFormatter.prototype={initialize:function(E){this.fields=new Array();this.includeList=E;
var A={};A.field="orderId";A.label="";A.sortType="numeric";A.sortValue=".orderId";A.renderer=function(F){return nQ('<div class="nvt_krOrder">'+F.orderId+"</div>");
};this.fields.push(A);var C={};C.field="jamFactor";C.label=i18n.labelJamFactorReg;C.sortType="numeric";
C.sortValue=".driveReport.jamFactor.jamFactor";C.renderer=function(G){var H=Nvt.Util.getJFImageString(G.driveReport.jamFactor);
var F=Nvt.Util.getJFImageString(G.driveReport.jamFactor,true);return nQ('<div class="nvt_jamFactor"><img src="'+commonData.staticServer(H)+i18n.imagesPath+i18n.imagesPathJamfactor+H+'" /></div><div class="nvt_jamFactorPrint"><img src="'+commonData.staticServer(F)+i18n.imagesPath+i18n.imagesPathJamfactor+F+'" /></div>');
};this.fields.push(C);var B={};B.field="name";B.label=i18n.labelSegmentName;B.sortType="alpha";B.sortValue=".startPointName";
B.renderer=function(G){var F="<div class='nvt_roadName'><p><a id='"+G.name+" "+i18n.cFrom+" "+G.startPointName+" "+i18n.cTo+" "+G.endPointName+" - "+Nvt.Util.scrubBound(G.direction)+"' class='nvt_childLink nvt_analyticsLink' href='javascript: void(0)'>"+G.startPointName+" "+i18n.cTo+" "+G.endPointName+"</a></p></div>";
return nQ(F);};this.fields.push(B);var D={};D.field="incidents";D.label=i18n.labelIncidents;D.sortType="numeric";
D.sortValue=".driveReport.trafficItems.length";D.renderer=function(F){return nQ('<div class="nvt_incidentCount">'+F.driveReport.trafficItems.length+"</div>");
};this.fields.push(D);},getFields:function(){return this.fields;},getClickClosure:function(B,A){var E=B.metroId;
var C=this.parentWidgetName;var D=function(){if(!A){Nvt.Core.NvtAnalytics.virtual("/virtual/click/"+C+"/"+this.name+"-"+Nvt.Util.scrubBound(this.direction));
}var F=new Nvt.Widget.ChildKeyRouteWidget(null,this.parentId,this.id,E);document.widgetManager.getTabWidget().clickTab(null,i18n.browseTraffic,true);
document.widgetManager.getSlideWidget().push(F);};return D.bind(B);},CLASS_NAME:"Nvt.Formatter.ParentKeyrouteRoadFormatter"};
Nvt.Formatter.TrafficItemConstructionFormatter=Class.create();Nvt.Formatter.TrafficItemConstructionFormatter.prototype={initialize:function(E){this.fields=new Array();
this.includeList=E;var C={};C.field="criticality";C.label="";C.sortValue=".criticality";C.sortType="numeric";
C.renderer=function(G){return nQ('<div class="nvt_cons nvt_trafficItemIcon"><img src="'+commonData.staticServer("icon_map_cons_rest.png")+i18n.imagesPath+i18n.imagesPathMapIcons+'icon_map_cons_rest.png" /></div>');
};this.fields.push(C);var F={};F.field="itemType";F.label=i18n.labelType;F.sortValue=".itemType";F.sortType="alpha";
F.renderer=function(G){return nQ("<div>"+G.headerDesc.substr(0,1).toUpperCase()+G.headerDesc.substr(1).toLowerCase()+"</div>");
};this.fields.push(F);var D={};D.field="description";D.label=i18n.labelDescription;D.sortValue=".keyRouteName";
D.sortType="alpha";D.renderer=function(H){var G='<div class="nvt_description">';if(H.keyRouteId!=null&&H.keyRouteId.length!=0){G+='<a class="nvt_roadLink">'+H.keyRouteName+" - "+Nvt.Util.scrubBound(H.direction)+"</a>";
}else{if(H.locationName!=null&&H.locationName.length!=0){G+='<p class="nvt_roadLink">'+Nvt.Util.cap1stLetters(H.locationName)+"</p>";
}}G+="<p>"+H.description+"</p></div>";return nQ(G);};this.fields.push(D);var A={};A.field="status";A.label=i18n.labelStatus;
A.sortValue=".status";A.sortType=".alpha";A.renderer=function(J){var I=new Date();var G=new Date(J.startDate);
var K=new Date(J.endDate);var H="";if(J.startDate>I){H=i18n.scheduled;}else{if(I.getHours()>G.getHours()&&I.getHours()<K.getHours()){H=i18n.current;
}else{H=i18n.ongoing;}}J.status=H;return nQ("<div>"+H+"</div>");};this.fields.push(A);var B={};B.field="endDate";
B.label=i18n.labelEnds;B.sortValue=".endDate";B.sortType="numeric";B.renderer=function(G){var H=new Date(parseFloat(G.endDate));
return nQ("<div>"+Nvt.Util.getMonth(H.getMonth()).abbr+" "+H.getFullYear()+"</div>");};this.fields.push(B);
},getFields:function(){return this.fields;},getClickClosure:function(A){var B=function(C){Nvt.Core.NvtAnalytics.virtual("/virtual/click/trafficitems/construction");
if(!C){C=window.event;}var D=(C.target)?C.target:C.srcElement;if(/A/i.test(D.tagName)==true&&A.keyRouteId!=""){var E=commonData.restServerName+"/roads?var=roads&metroId="+A.metroId+"&roadList="+A.keyRouteId+"&sortBy=id&sortOrder=asc&dataset=all";
nQ.getScript(E,function(){var F=roads.presentationObjects.roads[0];var G=new Nvt.Widget.ChildKeyRouteWidget(null,F.parentId,F.id,F.metroId);
document.widgetManager.getSlideWidget().push(G,Nvt.Util.roadToMapState(F));});}if(typeof (trafficMap)!="undefined"&&trafficMap!=null){trafficMap.popUpTrafficItem(A);
}};return B.bind(A);},CLASS_NAME:"Nvt.Formatter.TrafficItemConstructionFormatter"};Nvt.Formatter.TrafficItemIncidentFormatter=Class.create();
Nvt.Formatter.TrafficItemIncidentFormatter.prototype={initialize:function(C,E){this.fields=new Array();
this.includeList=C;this.noSlide=E;var A={};A.field="criticality";A.label="";A.sortValue=".critSort";A.sortType="numeric";
A.renderer=function(G){var H="";var I=G.itemType.toLowerCase();var F=Nvt.Widget.TrafficItemConstants.EVENT.toLowerCase().substr(0,Nvt.Widget.TrafficItemConstants.EVENT.toLowerCase().length-1);
if(I==Nvt.Widget.TrafficItemConstants.INCIDENT.toLowerCase()){H="icon_map_inc"+G.criticality+'_rest.png"';
}else{if(I==Nvt.Widget.TrafficItemConstants.CONSTRUCTION.toLowerCase()){H='icon_map_cons_rest.png"';}else{if(I==F){H='icon_map_event_rest.png"';
}else{if(I==Nvt.Widget.TrafficItemConstants.MASSTRANSIT.toLowerCase()){H='icon_map_mt_rest.png"';}else{H="icon_map_inc"+G.criticality+'_rest.png"';
}}}}return nQ('<div class="nvt_trafficItemIcon nvt_inc'+G.criticality+'"><img src="'+commonData.staticServer(H)+i18n.imagesPath+i18n.imagesPathMapIcons+H+"/></div>");
};this.fields.push(A);var D={};D.field="itemType";D.label=i18n.labelType;D.sortValue=".itemType";D.sortType="alpha";
D.renderer=function(F){return nQ("<div>"+Nvt.Util.cap1stLetters(F.headerDesc)+"</div>");};this.fields.push(D);
var B={};B.field="description";B.label=i18n.labelDescription;B.sortValue=".keyRouteName";B.sortType="alpha";
B.renderer=function(G){var F='<div class="nvt_description">';if(G.keyRouteId!=null&&G.keyRouteId.length!=0){F+='<a class="nvt_roadLink">'+G.keyRouteName+" - "+Nvt.Util.scrubBound(G.direction)+"</a>";
}else{if(G.municipality!=null&&G.municipality.length!=0){F+="Municipality: "+G.municipality;}else{if(G.locationName!=null&&G.locationName.length!=0){F+=G.locationName;
}}}F+="<br/>"+G.description+"</div>";return nQ(F);};this.fields.push(B);},getFields:function(){return this.fields;
},getClickClosure:function(B){var A=this;var C=function(){if(!A.noSlide){var D=commonData.restServerName+"/roads?var=roads&metroId="+B.metroId+"&roadList="+B.keyRouteId+"&sortBy=id&sortOrder=asc&dataset=all";
Nvt.Core.NvtAnalytics.virtual("/virtual/click/trafficitems/incidents");nQ.getScript(D,function(){if(typeof roads!="undefined"){var E=roads.presentationObjects.roads[0];
if(E){var F=null;if(E.parentId!=null&&E.parentId!=""){F=new Nvt.Widget.ChildKeyRouteWidget(null,E.parentId,E.id,B.metroId);
}else{F=new Nvt.Widget.ParentKeyRouteWidget(null,E.id,B.metroId);}document.widgetManager.getSlideWidget().push(F,Nvt.Util.roadToMapState(E));
}}else{alert("There was an error retrieving data from the server.");}});}if(typeof (trafficMap)!="undefined"&&trafficMap!=null){trafficMap.popUpTrafficItem(B);
}};return C.bind(B);},CLASS_NAME:"Nvt.Formatter.TrafficItemIncidentFormatter"};Nvt.Formatter.TrafficItemFormatter=Class.create();
Nvt.Formatter.TrafficItemFormatter.prototype={initialize:function(C){this.fields=new Array();this.includeList=C;
var D={};D.field="itemType";D.label="";D.sortValue=".itemType";D.sortType="alpha";D.renderer=function(F){var G="";
var E="";if(F.itemType.toLowerCase()==Nvt.Widget.TrafficItemConstants.INCIDENT.toLowerCase()){G="icon_map_inc"+F.criticality+'_rest.png"';
E="inc";}else{if(F.itemType.toLowerCase()==Nvt.Widget.TrafficItemConstants.CONSTRUCTION.toLowerCase()){G='icon_map_cons_rest.png"';
E="cons";}else{if(F.itemType.toLowerCase()==Nvt.Widget.TrafficItemConstants.EVENT.toLowerCase()){G='icon_map_event_rest.png"';
E="event";}else{if(F.itemType.toLowerCase()==Nvt.Widget.TrafficItemConstants.MASSTRANSIT.toLowerCase()){G='icon_map_mt_rest.png"';
E="mt";}else{G="icon_map_inc"+F.criticality+'_rest.png"';E="inc"+F.criticality;}}}}return nQ('<div class="nvt_trafficItemIcon nvt_'+E+'"><img src="'+commonData.staticServer(G)+i18n.imagesPath+i18n.imagesPathMapIcons+G+"/></div>");
};this.fields.push(D);var A={};A.field="headerDesc";A.label=i18n.labelType;A.sortValue=".headerDesc";
A.sortType="alpha";A.renderer=function(E){return nQ('<div class="nvt_type">'+Nvt.Util.cap1stLetters(E.headerDesc)+"</div>");
};this.fields.push(A);var B={};B.field="description";B.label=i18n.labelDescription;B.sortValue=".keyRouteName";
B.sortType="alpha";B.renderer=function(E){return nQ('<div class="nvt_description">'+Nvt.Util.cap1stLetters(E.description)+"</div>");
};this.fields.push(B);},getFields:function(){return this.fields;},getClickClosure:function(B){var A=commonData.restServerName;
var C=function(D){if(!D){D=window.event;}var E=(D.target)?D.target:D.srcElement;if(typeof (trafficMap)!="undefined"&&trafficMap!=null){trafficMap.popUpTrafficItem(B);
}};return C.bind(B);},CLASS_NAME:"Nvt.Formatter.TrafficItemFormatter"};Nvt.Formatter.DriveDetailsFormatter=Class.create();
Nvt.Formatter.DriveDetailsFormatter.prototype={initialize:function(D){this.fields=new Array();this.includeList=D;
var B={};B.field="jamFactor";B.label=i18n.labelJamFactorReg;B.sortType="numeric";B.sortValue=".driveReport.jamFactor.jamFactor";
B.altText=i18n.altTextClickToSortOn+" "+i18n.labelJamFactor;B.renderer=function(F){var G=Nvt.Util.getJFImageString(F.driveReport.jamFactor);
var E=Nvt.Util.getJFImageString(F.driveReport.jamFactor,true);return nQ('<div class="nvt_jamFactor"><img src="'+commonData.staticServer(G)+i18n.imagesPath+i18n.imagesPathJamfactor+G+'" /></div><div class="nvt_jamFactorPrint"><img src="'+commonData.staticServer(E)+i18n.imagesPath+i18n.imagesPathJamfactor+E+'" /></div>');
};this.fields.push(B);var A={};A.field="name";A.label=i18n.labelSegmentName;A.sortType="alpha";A.sortValue=".name";
A.altText=i18n.altTextClickToSortOn+" "+i18n.labelSegmentName;A.renderer=function(F){var E="<div class='nvt_roadName'><div class=\"nvt_roadInfo\"><a class='nvt_childLink' href='javascript: void(0)'>"+F.name+"</a>";
if(F.startPointName&&F.endPointName){E+="<p>"+F.startPointName+" "+i18n.cTo+" "+F.endPointName+"</p>";
}E+="</div>";return nQ(E);};this.fields.push(A);var C={};C.field="incidents";C.label=i18n.labelIncidents;
C.sortType="numeric";C.sortValue=".driveReport.trafficItems.length";C.altText=i18n.altTextClickToSortOn+" "+i18n.labelIncidents;
C.renderer=function(E){return nQ('<div class="nvt_incidentCount">'+E.driveReport.trafficItems.length+"</div>");
};this.fields.push(C);},getFields:function(){return this.fields;},getClickClosure:function(A){return null;
},CLASS_NAME:"Nvt.Formatter.DriveDetailsFormatter"};Nvt.Formatter.TrafficItemEventFormatter=Class.create();
Nvt.Formatter.TrafficItemEventFormatter.prototype={initialize:function(D){this.fields=new Array();this.includeList=D;
var A={};A.field="criticality";A.label="";A.sortValue=".criticality";A.sortType="numeric";A.renderer=function(E){return nQ('<div class="nvt_event nvt_trafficItemIcon"><img src="'+commonData.staticServer("icon_map_event_rest.png")+i18n.imagesPath+i18n.imagesPathMapIcons+'icon_map_event_rest.png" /></div>');
};this.fields.push(A);var B={};B.field="description";B.label=i18n.labelDescription;B.sortValue=".description";
B.sortType="alpha";B.renderer=function(F){var E=F.description;if(F.keyRouteName!=""){E=F.keyRouteName+" "+E;
}else{if(F.locationName!=""){E=F.locationName+" "+E;}}return nQ('<div class="nvt_description">'+E+"</div>");
};this.fields.push(B);var C={};C.field="municipality";C.label=i18n.labellocation;C.sortValue=".municipality";
C.sortType="alpha";C.renderer=function(E){return nQ("<div>"+Nvt.Util.cap1stLetters(E.municipality)+"</div>");
};this.fields.push(C);},getFields:function(){return this.fields;},getClickClosure:function(A){var B=function(C){Nvt.Core.NvtAnalytics.virtual("/virtual/click/trafficitems/events");
if(!C){C=window.event;}var D=(C.target)?C.target:C.srcElement;if(/A/i.test(D.tagName)==true&&A.keyRouteId!=""){var E=commonData.restServerName+"/roads?var=roads&metroId="+A.metroId+"&roadList="+A.keyRouteId+"&sortBy=id&sortOrder=asc&dataset=all";
nQ.getScript(E,function(){var F=roads.presentationObjects.roads[0];var G=new Nvt.Widget.ChildKeyRouteWidget(null,F.parentId,F.id,F.metroId);
document.widgetManager.getSlideWidget().push(G,Nvt.Util.roadToMapState(F));});}if(typeof (trafficMap)!="undefined"&&trafficMap!=null){trafficMap.popUpTrafficItem(A);
}};return B.bind(A);},CLASS_NAME:"Nvt.Formatter.TrafficItemEventFormatter"};Nvt.MapTp.RouteManagerHtmlBase=Class.create();
Nvt.MapTp.RouteManagerHtmlBase.prototype={initialize:function(A){},finishedRoutingCallback:function(){},beginRoutingCallback:function(){},drawDirectionsCallback:function(A,B){},displayDebugRoutingInfoCallback:function(){},finishedDragDropCallback:function(A){},printMapCallback:function(A){},startAddressCallback:function(C,A,B){},endAddressCallback:function(C,A,B){},zoomCallback:function(){}};
Object.extend(Nvt.MapTp.RouteManagerHtmlBase,{getDescriptionsFromGeocodeResponse:function(B){var G=B.PropertiesMajor;
var F=B.PropertiesMinor;var I=B.Coordinate;r=new Object();for(var A=0;A<G.length;A++){switch(G[A].getProperty("Key")){case"Hnrs":r.Hnrs=(G[A].getProperty("Value"));
break;case"Street":r.Street=(G[A].getProperty("Value"));break;case"Zip":r.Zip=(G[A].getProperty("Value"));
break;case"City":r.City=(G[A].getProperty("Value"));break;case"Cty":r.Cty=(G[A].getProperty("Value"));
break;case"Sta":r.Sta=(G[A].getProperty("Value"));break;case"Ctry":r.Ctry=(G[A].getProperty("Value"));
break;case"District":r.District=(G[A].getProperty("Value"));break;case"Name":r.Name=(G[A].getProperty("Value"));
break;default:}}for(var A=0;A<F.length;A++){var H=F[A].getProperty("Key");if(H==="FORMATTED"){var C=F[A].getProperty("Value");
if(C){r.Name=C;}break;}}r.Latitude=I.Latitude;r.Longitude=I.Longitude;var D="";var E=Nvt.MapTp.RouteManager.delim;
D+=r.Latitude+E;D+=r.Longitude+E;D+=(r.Hnrs)?r.Hnrs+E:E;D+=(r.Street)?r.Street+E:E;D+=(r.Zip)?r.Zip+E:E;
D+=(r.City)?r.City+E:E;D+=(r.Cty)?r.Cty+E:E;D+=(r.Sta)?r.Sta+E:E;D+=(r.Ctry)?r.Ctry+E:E;D+=(r.District)?r.District+E:E;
D+=(r.Name)?r.Name+E:E;r.FullDescription=D;D="";D+=(r.Name)?r.Name+" ":"";D+=(r.Hnrs)?r.Hnrs+" ":"";D+=(r.Street)?r.Street+", ":"";
D+=(r.City)?r.City+", ":"";D+=(r.Sta)?r.Sta+" ":"";D+=(r.Zip)?r.Zip+", ":"";D+=(r.Cty)?r.Cty+" County, ":"";
D+=(r.District)?r.District+" ":"";D+=(r.Ctry)?r.Ctry:"";r.DisplayDescription=D;return r;},convertTime:function(B){var C=B+" "+i18n.mins;
if(B>59){var A=Math.floor(B/60);B=B-(A*60);C=A+" "+i18n.hr+" "+B+" "+i18n.mins;}return C;},convertToReadableTime:function(C){var B=(C/60).toFixed(0);
var A=Math.floor(B/60);B=(B%60).toFixed(0);if(A>0){return A+" "+i18n.hr+" "+B+" "+i18n.mins;}else{return B+" "+i18n.mins;
}},roundDistance:function(A){return Math.round(A*10)/10;},displayDebugRoutingInfo:function(A){var D="";
var C=false;var B=function(){if($("routes").style.display!="none"){C=true;}if(C){clearInterval(D);Nvt.MapTp.RouteManagerHtml.writeDebugMaptpRoutingHtml(A);
}};D=setInterval(B,10000);},writeDebugMaptpRoutingHtml:function(D){var C=document.getElementById("debugMaptpRouting");
var F=-1;var E=D.route1Info;var A=D.route2Info;var F=D.metro.metroId;var B="<table border='0' height='100' width='300'>";
B+="<tr><td>metroId:</td><td>"+F+"</td></tr>";B+="<tr><td>*** Fastest Now ***</td><td></td></tr>";B+="<tr><td>lengthMeterAtSpeedLimit</td><td>"+E.lengthMeterAtSpeedLimit+"</td></tr>";
B+="<tr><td>lengthMeterTrafficBased</td><td>"+E.lengthMeterTrafficBased+"</td></tr>";B+="<tr><td>timeSecAtSpeedLimit</td><td>"+E.timeSecAtSpeedLimit+"</td></tr>";
B+="<tr><td>timeSectTrafficBased</td><td>"+E.timeSecTrafficBased+"</td></tr>";B+="<tr><td>tmcs</td><td>"+E.tmcs+"</td></tr>";
B+="<tr><td>edgeIds</td><td>"+E.edgeIds+"</td></tr>";B+="<tr><td>*** Direct Drive ***</td><td></td></tr>";
B+="<tr><td>lengthMeterAtSpeedLimit</td><td>"+A.lengthMeterAtSpeedLimit+"</td></tr>";B+="<tr><td>lengthMeterTrafficBased</td><td>"+A.lengthMeterTrafficBased+"</td></tr>";
B+="<tr><td>timeSecAtSpeedLimit</td><td>"+A.timeSecAtSpeedLimit+"</td></tr>";B+="<tr><td>timeSectTrafficBased</td><td>"+A.timeSecTrafficBased+"</td></tr>";
B+="<tr><td>tmcs</td><td>"+A.tmcs+"</td></tr>";B+="<tr><td>edgeIds</td><td>"+A.edgeIds+"</td></tr>";B+="</table>";
C.innerHTML=B;},zebraStripe:function(){nQ(".striped tbody tr:even").addClass("rowAlt");},convertMeter:function(D,A){if(!A){var A=commonData.locale;
}A=A.toLowerCase();if(A=="en_us"){var B=D*3.280399;var C=(B/5280).toFixed(1);return C;}else{return D/1000;
}},decimalPrecision:function(B,A){var C=Math.pow(10,A);B=Math.round(B*C);return(B/C).toFixed(A);}});Nvt.MapTp.MapBoundingBoxCoordinates=Class.create();
Nvt.MapTp.MapBoundingBoxCoordinates.prototype={initialize:function(A){this.topLeftLong="";this.topLeftLat="";
this.lowerRtLong="";this.lowerRtLat="";nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.topLeftLong=null;
this.topLeftLat=null;this.lowerRtLong=null;this.lowerRtLat=null;},setMapCoordinates:function(A){var B=A.Canvas["canvas"].MapClient.MapViewHistory.current();
this.setCoordinates(B.LowerRight.Longitude,B.LowerRight.Latitude,B.TopLeft.Longitude,B.TopLeft.Latitude);
},setCoordinates:function(B,D,C,A){this.topLeftLong=C;this.topLeftLat=A;this.lowerRtLong=B;this.lowerRtLat=D;
},setCoordinatesFromCoordinateDTO:function(B,A){this.topLeftLong=A.longitudeInMins;this.topLeftLat=A.latitudeInMins;
this.lowerRtLong=B.longitudeInMins;this.lowerRtLat=B.latitudeInMins;}};Nvt.MapTp.MetroPopUp=Class.create();
Nvt.MapTp.MetroPopUp.prototype={initialize:function(A,B,C){this.MapTpUtils=new Nvt.MapTp.Util(A,B);this.Tooltip=new Nvt.MapTp.Tooltip(A,B);
this.hostURL=C;this.currentMetroPopUp=null;Nvt.MapTp.MetroPopUp.closeMetroTooltip=new Map24.Callable(this,this.closeMetroTooltip);
Nvt.MapTp.MetroPopUp.openMetroTooltip=new Map24.Callable(this,this.openMetroTooltip);Nvt.MapTp.MetroPopUp.forwardToRouting=new Map24.Callable(this,this.forwardToRouting);
nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.MapTpUtils=null;this.Tooltip=null;
this.hostURL=null;this.currentMetroPopUp=null;Nvt.MapTp.MetroPopUp.closeMetroTooltip=null;Nvt.MapTp.MetroPopUp.openMetroTooltip=null;
Nvt.MapTp.MetroPopUp.forwardToRouting=null;},clearPopUpMetro:function(){this.closeMetroTooltip("fix_tooltip");
this.MapTpUtils.removeMapObject({MapObjectIDs:["MetroPopUp"]});this.MapTpUtils.execute();},hidePopUpMetro:function(){this.MapTpUtils.controlMapObject({Control:"DISABLE",MapObjectIDs:["MetroPopUp"]});
this.MapTpUtils.execute();},addALocation:function(D){this.currentMetroPopUp=D;var B=Nvt.MapTp.Common.imageIncidentUrl;
var A=D.itemType;var C=commonData.staticServer("pointA.gif")+B+"pointA.gif";if(D.boundingBox.centerPoint.lon!=0&&D.boundingBox.centerPoint.lat!=0){this.MapTpUtils.addLocation({MapObjectID:"MetroPopUp",Coordinate:new Map24.WebServices.Coordinate({Longitude:this.MapTpUtils.convertDegreesToMinutes(D.boundingBox.centerPoint.lon),Latitude:this.MapTpUtils.convertDegreesToMinutes(D.boundingBox.centerPoint.lat)}),LogoURL:C,MaxMPP:750,Events:[new Map24.WebServices.MapObjectEvent({ID:"OnClick",Commands:[new Map24.WebServices.XMLCommandWrapper({Surf:new Map24.WebServices.Surf({URL:"javascript:Nvt.MapTp.MetroPopUp.openMetroTooltip.invokeEx(['fix_tooltip']);",TargetFrame:"_self"})})]})]});
this.MapTpUtils.controlMapObject({Control:"ENABLE",MapObjectIDs:["MetroPopUp"]});this.MapTpUtils.execute();
}this.closeMetroTooltip("fix_tooltip");this.openMetroTooltip("fix_tooltip");},closeMetroTooltip:function(A){this.Tooltip.disableLocationTooltip(A);
},openMetroTooltip:function(A){this.Tooltip.drawMetroTooltip(this.currentMetroPopUp,A);},forwardToRouting:function(A){var B=this.currentMetroPopUp.metroName+", "+this.currentMetroPopUp.metroStateName;
document.location=commonData.appServerName+"/controller/routing?"+A+"="+escape(B);}};Object.extend(Nvt.MapTp.MetroPopUp.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.MapTp.RouteInfo=Class.create();Nvt.MapTp.RouteInfo.prototype={initialize:function(A){this.activeStyles={};
this.inactiveStyles={};this.mapObjectId="";this.routeStartMapObjectId="";this.routeEndMapObjectId="";
this.active=false;this.route=null;this.routeName="";this.directions=[];this.tmcs="";this.edgeIds=null;
this.commuteSegmentSummaryList=null;this.serializedCommute=null;this.reportSummary=null;this.lengthMeterAtSpeedLimit=Nvt.MapTp.RouteInfo.UNSET;
this.timeSecAtSpeedLimit=Nvt.MapTp.RouteInfo.UNSET;this.lengthMeterTrafficBased=Nvt.MapTp.RouteInfo.UNSET;
this.timeSecTrafficBased=Nvt.MapTp.RouteInfo.UNSET;this.routeId="";this.startCoordinate=null;this.endCoordinate=null;
this.viaPoints=[];this.startDisplay="";this.endDisplay="";if(!A){return ;}if(A.activeStyles){this.activeStyles=A.activeStyles;
}if(A.inactiveStyles){this.inactiveStyles=A.inactiveStyles;}if(A.mapObjectId){this.mapObjectId=A.mapObjectId;
}if(A.routeStartMapObjectId){this.routeStartMapObjectId=A.routeStartMapObjectId;}if(A.routeEndMapObjectId){this.routeEndMapObjectId=A.routeEndMapObjectId;
}if(A.active){this.active=A.active;}nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.activeStyles=null;
this.inactiveStyles=null;this.mapObjectId=null;this.routeStartMapObjectId=null;this.routeEndMapObjectId=null;
this.route=null;this.routeName=null;this.directions=null;this.edgeIds=null;this.commuteSegmentSummaryList=null;
this.serializedCommute=null;this.reportSummary=null;this.lengthMeterAtSpeedLimit=null;this.timeSecAtSpeedLimit=null;
this.lengthMeterTrafficBased=null;this.timeSecTrafficBased=null;this.routeId=null;this.startCoordinate=null;
this.endCoordinate=null;this.viaPoints=null;this.startDisplay=null;this.endDisplay=null;},getActiveStrokePaintRules:function(){var A=[new Map24.WebServices.PaintRuleSTROKE({MaxMPP:50000,DrawPhase:"INSCRIPTIONS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:2500,Width:3,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:2500,DrawPhase:"INSCRIPTIONS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:400,Width:4,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:400,DrawPhase:"INSCRIPTIONS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:47,Width:4,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:47,DrawPhase:"INSCRIPTIONS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:26,Width:3,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:26,DrawPhase:"INSCRIPTIONS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:13,Width:3,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:13,DrawPhase:"INSCRIPTIONS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:7,Width:4,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:7,DrawPhase:"INSCRIPTIONS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:2,Width:5,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:2,DrawPhase:"INSCRIPTIONS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:0,Width:10,Offset:2})]})];
return A;},getActiveStrokePaintRulesForApplet:function(){var A=this.getActiveStrokePaintRules();A.push(new Map24.WebServices.PaintRuleSTROKE({MaxMPP:2500,DrawPhase:"INSCRIPTIONS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:0,Width:4,Offset:0,Color:new Map24.WebServices.Color({red:255,green:255,blue:255,alpha:this.activeStyles.alpha}),Style:"ARROW"})]}));
return A;},getInactiveStrokePaintRules:function(){var A=[new Map24.WebServices.PaintRuleSTROKE({MaxMPP:50000,DrawPhase:"INSCRIPTIONS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:2500,Width:3,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:2500,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:400,Width:4,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:400,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:47,Width:4,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:47,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:26,Width:3,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:26,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:13,Width:3,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:13,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:7,Width:4,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:7,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:2,Width:5,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:2,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:0,Width:10,Offset:2})]})];
return A;},getInactiveStrokePaintRulesForApplet:function(){var A=this.getInactiveStrokePaintRules();A.push(new Map24.WebServices.PaintRuleSTROKE({MaxMPP:2500,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:0,Width:4,Offset:0,Color:new Map24.WebServices.Color({red:255,green:255,blue:255,alpha:this.inactiveStyles.alpha}),Style:"ARROW"})]}));
return A;}};Nvt.MapTp.RouteInfo.UNSET=-1;Nvt.MapTp.TrafficMap=Class.create();Nvt.MapTp.TrafficMap.prototype={initialize:function(F,D,B){this.metroId=F;
this.registeredCallback=D.registeredCallback;this.registeredMetroChangeCallback=D.registeredMetroChangeCallback;
this.coordinates=null;this.theme=B;this.options={};this.firstTimeLoadComplete=false;this.saveState=true;
this.smallMap=false;this.mapDivId="";this.staticOnly=true;this.zoomOnStartup=true;this.isMapClientReady=false;
this.isStaticMapClientReady=false;this.isAppletMapClientReady=false;this.isSessionReady=false;this.currentMapState=null;
this.mapTPDebugOn=false;this.map=null;this.filterControl=null;this.trafficGeoLocationWrapper=null;this.metroPopUp=null;
this.hasMapViewChanged=false;this.workspace=B;this.visibleClient=null;this.currentlyDisplayedMap=null;
this.appletMap=null;this.displayMapClient=false;this.restoreTheState=false;this.adDisplayCompleted=false;
this.modalDisplay=false;var C=new Date();var E=Math.round(Math.random()*100000);this.sid="TRAFFIC_"+C.getFullYear()+""+C.getMonth()+""+C.getDate()+"_"+C.getHours()+""+C.getMinutes()+""+C.getSeconds()+""+C.getMilliseconds()+"_"+E;
this.startTime=null;this.endTime=null;this.isLoggedStaticMap=false;this.isLoggedJavaMap=false;this.isLoggedBothMaps=false;
this.mapTpUtil={};this.localConnection={};this.remoteConnection={};this.mapViewChangedCounter=0;if(D!=null){this.tmpOptions=D;
if(D.mapDivId){this.mapDivId=D.mapDivId;}this.coordinates=D.coordinates;if(D.smallMap!=null){this.smallMap=D.smallMap;
}if(D.staticMap){this.staticOnly=true;}if(D.debugmaptp){this.mapTPDebugOn=true;}var A=D.saveState;if(A!=null){if(A==false){this.saveState=false;
}}if(D.useState!=null&&D.useState==true){this.restoreTheState=true;this.restoreState();}if(typeof D.zoomOnStartup!="undefined"&&D.zoomOnStartup!=null){this.zoomOnStartup=D.zoomOnStartup;
}}this.metroLoaderWrapper=new Nvt.MapTp.MetroLoaderWrapper(this.loadMetro.bind(this));this.metroLoaderWrapper.loadAllMetroData(false);
nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.registeredCallback=null;
this.registeredMetroChangeCallback=null;this.coordinates=null;this.theme=null;this.options=null;this.mapDivId=null;
this.currentMapState=null;this.filterControl=null;this.trafficGeoLocationWrapper=null;this.metroPopUp=null;
this.workspace=null;this.visibleClient=null;this.appletMap=null;this.mapTpUtil=null;this.localConnection=null;
this.remoteConnection=null;this.metro=null;this.staticMap=null;this.rsid=null;this.map.removeListener("MapViewChanged",[this,this.mapViewChanged]);
this.map.removeListener("Map24.Event.MapClientReady",[this,this.mapClientReady]);this.map.removeListener("Map24.Event.JavaDetectionTimeout",[this,this.noJavaAvailable]);
this.map.removeListener("JavaDetectionTimeout",[this,this.noJavaAvailable]);this.map.removeListener("Map24.Event.MapPanStart",[this,this.captureMapPanStart]);
this.map.removeListener("Map24.Event.MapPanUpdate",[this,this.captureMapPanUpdate]);this.map.removeListener("Map24.Event.MapPopupBlocked",[this,this.captureMapPopupBlocked]);
this.map.removeListener("Map24.Event.MapZoomRectStart",[this,this.captureMapZoomRectStart]);this.map.removeListener("Map24.Event.MapZoomRectUpdate",[this,this.captureZoomRectUpdate]);
this.map=null;},loadMetro:function(A){Nvt.console.debug("TrafficMap.loadMetro");this.metro=this.metroLoaderWrapper.loadById(this.metroId);
this.initializeMap24();},initializeMap24:function(){var G=Nvt.Util.getJslibVersion();var H="/jslib/"+G+"/lib/maptpapi";
Nvt.console.log("urlRoot: "+H);var B=this.main.bind(this);var D=true;try{if(navigator.userAgent.match(new RegExp("MSIE"))){var F=new RegExp("MSIE ([0-9])\\.([0-9])([0-9]{0,1})");
var C=F.exec(navigator.userAgent);if((C instanceof Array)&&(C.length>=2)){if(C[1]<6){D=false;}else{if(C[1]==6){F=new RegExp("(SV1)");
C=F.exec(navigator.userAgent);if(!(C instanceof Array)||(C.length<2)||(C[1]!="SV1")){D=false;}}}}}}catch(I){}if(D){var E=commonData.staticServer("traffic_com_obfuscated.js.jgz")+H+"/api/traffic_com_obfuscated.js.jgz";
if(this.mapTPDebugOn){E=commonData.staticServer("traffic_com.js.jgz")+H+"/api/traffic_com.js.jgz";}Map24.loadApi([E],B,Nvt.MapTp.Common.APIVersion,{IMAGES_BASE_URL:commonData.staticServer("IMAGES_BASE_URL")+H+"/images/"});
}else{Map24.loadApi(["traffic_com"],B,Nvt.MapTp.Common.APIVersion);}},initMap24PerformanceCode:function(){var A=Map24.MAPTP_HOST;
Map24.AppKeyConfig.prototype.getRandomWebServicesUrl=function(B){if(typeof B=="number"){B=""+B;}if(typeof B!="string"){B=new Date().getTime()+"_"+Math.random();
}return this.WebServicesBaseUrl.replace(A,Map24.hash(B)+".tl."+A);};},main:function(){var A=0;this.startTime=new Date();
this.initMap24PerformanceCode();this.javaEnabled=Map24.Browser.javaAvailable();if(this.javaEnabled){}else{this.staticOnly=true;
}Map24.Debug.enable(this.mapTPDebugOn,Map24.E_ALL_DEBUG);this.map=new Map24.Map({SessionId:this.sid});
this.map.addListener("Map24.Event.MapPanStart",[this,this.captureMapPanStart]);this.map.addListener("Map24.Event.MapPanUpdate",[this,this.captureMapPanUpdate]);
this.map.addListener("Map24.Event.MapPopupBlocked",[this,this.captureMapPopupBlocked]);this.map.addListener("Map24.Event.MapZoomRectStart",[this,this.captureMapZoomRectStart]);
this.map.addListener("Map24.Event.MapZoomRectUpdate",[this,this.captureZoomRectUpdate]);this.mapClientCount=0;
if(this.mapDivId==""){this.mapDivId="maparea";}this.map.addListener("MapViewChanged",[this,this.mapViewChanged]);
this.localConnection=this.map.Local.openConnection();this.remoteConnection=this.map.WebServices.openConnection();
this.mapTpUtil=new Nvt.MapTp.Util(this.localConnection,this.remoteConnection);this.mapClientReadyCount=0;
this.trafficGeoLocationWrapper=new Nvt.MapTp.GeoLocationLoaderWrapper(this.localConnection,this.remoteConnection,Nvt.MapTp.Common.hostUrl);
this.metroPopUp=new Nvt.MapTp.MetroPopUp(this.localConnection,this.remoteConnection,Nvt.MapTp.Common.hostUrl);
this.map.addListener("SessionReady",[this,this.sessionReady]);if(this.javaEnabled&&!this.staticOnly){this.map.addListener("Map24.Event.JavaDetectionTimeout",[this,this.noJavaAvailable]);
}var B=Nvt.Util.readCookie(Nvt.MapTp.TrafficMap.appletLoadSuccessful);this.mainApplet();},sessionReady:function(){console.log("sessionReady event fired");
this.isSessionReady=true;this.map.addCanvas(new Map24.Canvas({NodeName:this.mapDivId}),"canvas");this.mainStatic();
this.map.addListener("Map24.Event.MapClientReady",[this,this.mapClientReady]);},captureMapClick:function(B){var A=B.Coordinate.Latitude;
var C=B.Coordinate.Longitude;B.stop();},captureMapPanStart:function(A){},captureMapPanUpdate:function(A){},captureMapPopupBlocked:function(A){},captureMapZoomRectStart:function(A){},captureZoomRectUpdate:function(A){},mainStatic:function(){this.initializeStatic();
this.map.addMapClient(this.staticMap,"static");this.mapClientCount++;},mainApplet:function(){if(this.javaEnabled&&!this.staticOnly){this.initializeApplet();
this.map.addMapClient(this.appletMap,"applet");this.mapClientCount++;this.map.addListener("JavaDetectionTimeout",[this,this.noJavaAvailable]);
}},noJavaAvailable:function(){var A=0;if(!this.isStaticMapClientReady){this.mainStatic();}if(this.visibleClient!="static"){console.log("map_show 1");
this.map.show("static","canvas");if(this.isLoggedStaticMap==false){this.endTime=new Date();A=this.getTimeDifferenceBucket(this.startTime,this.endTime);
this.isLoggedStaticMap=true;}}this.staticOnly=true;},initializeStatic:function(){var A;if(this.smallMap){A={Frame:new Map24.TrafficCom.Frame({Theme:this.theme}),Copyright:new Map24.TrafficCom.Copyright(),MiniZoomBar:new Map24.TrafficCom.MiniZoomBar({OffsetLeft:5,OffsetTop:30})};
}else{var C=new Map24.TrafficCom.FilterBar({Theme:this.theme,UrlZoom:"javascript: Nvt.MapTp.FilterControl.urlZoomCallback.invokeEx()",SetLocation:"javascript: Nvt.MapTp.FilterControl.setLocationCallback.invokeEx();",OffsetLeft:4,OffsetBottom:-3});
A={Frame:new Map24.TrafficCom.Frame({Theme:this.theme}),Copyright:new Map24.TrafficCom.Copyright(),ZoomBar:new Map24.TrafficCom.ZoomBar(),Filter:C};
}var B={DEFAULT:'url( "'+this.map.getAppKeyConfig().ImagesBaseUrl+'patch/trafficcom/cursors/handOpen.cur" ), pointer',ACTION_MAPPAN:'url( "'+this.map.getAppKeyConfig().ImagesBaseUrl+'patch/trafficcom/cursors/handClosed.cur" ), pointer',ACTION_ZOOMRECT:"crosshair"};
this.staticMap=new Map24.MapClient.Static({Components:A,Cursors:B});this.mapTpUtil.controlComponent({Component:"MAPEVENTHANDLER",Control:"SET",Properties:[new Map24.WebServices.Property({Key:"MouseDrag(Left)+Shift",Value:"ZOOMRECT"}),new Map24.WebServices.Property({Key:"DblClick(Left)",Value:"ZOOMIN(true,true)"}),new Map24.WebServices.Property({Key:"DblClick(Right)",Value:"ZOOMOUT(true,true)"}),new Map24.WebServices.Property({Key:"MouseWheelUp",Value:"ZOOMIN"}),new Map24.WebServices.Property({Key:"MouseWheelDown",Value:"ZOOMOUT"})]});
this.mapTpUtil.execute({ConnectionType:"local"});},initializeApplet:function(){var C=Nvt.MapTp.Common.AppletCodeBase;
var F=this.theme;var A=["SHOWCOMPONENT&component?=TBAR","SHOWCOMPONENT&component?=COPYRIGHT"];var D="traffic_com_metro_3.6_NT_DEFAULT_en.zip";
if(F==Nvt.Widget.Map.MYTRAFFIC_WORKSPACE){D="traffic_com_mytraffic_3.6_NT_DEFAULT_en.zip";}else{if(F==Nvt.Widget.Map.ROUTING_WORKSPACE){D="traffic_com_routing_3.6_NT_DEFAULT_en.zip";
}}var B=nQ.trim(Nvt.Util.getQueryParamValue("appletCodebase"));if(B&&B.length>0){C=B;}if(this.smallMap){F="traffic_com_small";
A=["SHOWCOMPONENT&component?=TBAR","HIDECOMPONENT&component?=FILTERCONTROL","SHOWCOMPONENT&component?=COPYRIGHT"];
D="traffic_com_small_3.6_NT_DEFAULT_en.zip";}this.initializeAppletCoordinates();this.rsid="dev/namerica/routing";
var E={Codebase:C,rsid:this.rsid,Archive:D,mrcinitiator:"Map24Applet",startup_mlc:"skins/traffic_com/mlc",skin:F,xmid:"EVAL_TRAFFIC_COM",mid:"***",map24agentid:"map24/webservices1.5/map24agent",logbaseurl:"map24/webservices1.5/map24agent",redirectbaseurl:"map24/webservices1.5/map24agent",lang:"en",psym:"navteq/3.6/NT_AMERICA/symNT",pprop:"navteq/3.6/NT_AMERICA/NT",AppletCommands:A,URL_ZOOM:"javascript: Nvt.MapTp.FilterControl.urlZoomCallback.invokeEx()",URL_SETLOCATION:"javascript: Nvt.MapTp.FilterControl.setLocationCallback.invokeEx()",TTDELAY_MAP:600000,confirmreconnect:36000,sid:this.sid};
B=nQ.trim(Nvt.Util.getQueryParamValue("map24Console"));if(B&&B.length>0&&B==="true"){E.PRESHOW="MAP24_CONSOLE";
}this.appletMap=new Map24.MapClient.Applet(E);this.appletMap.Component={};},initializeAppletCoordinates:function(){if(this.restoreTheState){this.restoreState();
}var C=Map24.MAPTP_HOST;var A="";A="http://"+C+"/map24/webservices1.5?cgi=Map24MapletRemoteControl";if(this.coordinates!=null){A+="&cmd0=MOV&x0|0="+this.coordinates.topLeftLong+"&y0|0="+this.coordinates.topLeftLat+"&x0|1="+this.coordinates.lowerRtLong+"&y0|1="+this.coordinates.lowerRtLat+"&t=1226684070280&mid=EVAL_TRAFFIC_COM&sid="+this.sid;
}else{if(this.zoomOnStartup&&this.metro){A+="&cmd0=MOV&x0|0="+this.metro.boundingBox.longNWMins+"&y0|0="+this.metro.boundingBox.latNWMins+"&x0|1="+this.metro.boundingBox.longSEMins+"&y0|1="+this.metro.boundingBox.latSEMins+"&t=1226684070280&mid=EVAL_TRAFFIC_COM&sid="+this.sid;
}else{A+="&t=1226684070280&mid=EVAL_TRAFFIC_COM&sid="+this.sid;}}var B=nQ("#mapWebservice")[0];B.innerHTML="<img src='"+A+"' height='0' width='0'></img>";
},setAdDisplayCompleted:function(){Nvt.console.log("setAdDisplayCompleted");this.adDisplayCompleted=true;
},hideMap:function(){if(this.visibleClient=="applet"){this.map.hide("applet");}else{if(this.visibleClient=="static"){this.map.hide("static");
}}},showMap:function(){console.log("MapTP.TrafficMap.showMap");if(this.visibleClient=="static"){Nvt.console.debug("show Static");
console.log("map_show 2");this.map.show("static","canvas");}else{if(this.adDisplayCompleted&&this.visibleClient=="applet"&&this.isAppletMapClientReady){this.map.show("applet","canvas");
}}},displayMap:function(){var A=0;if(this.adDisplayCompleted&&this.visibleClient=="static"&&this.isStaticMapClientReady){if(this.currentlyDisplayedMap!=null){return ;
}Nvt.console.debug("display Static");console.log("map_show 3");this.map.show("static","canvas");this.currentlyDisplayedMap="static";
if(this.isLoggedStaticMap==false){this.endTime=new Date();A=this.getTimeDifferenceBucket(this.startTime,this.endTime);
this.isLoggedStaticMap=true;}this.delayLoadFilter();}else{if(this.adDisplayCompleted&&this.visibleClient=="applet"&&this.isAppletMapClientReady){if(this.currentlyDisplayedMap=="applet"){return ;
}Nvt.console.debug("display Applet");this.map.show("applet","canvas");this.currentlyDisplayedMap="applet";
if(this.isLoggedJavaMap==false){this.endTime=new Date();var A=this.getTimeDifferenceBucket(this.startTime,this.endTime);
this.isLoggedJavaMap=true;}if(!this.filterControl){this.filterControl=new Nvt.MapTp.FilterControl(this.localConnection,this.remoteConnection,this.map,this.metroId,this.tmpOptions,this.registeredCallback);
}Nvt.Util.createCookie(Nvt.MapTp.TrafficMap.appletLoadSuccessful,"true",7);}}if(this.isLoggedStaticMap&&this.isLoggedJavaMap){if(this.isLoggedBothMaps==false){this.isLoggedBothMaps=true;
}}},mapClientReady:function(A){console.log("mapClientReady event fired");if(this.modalDisplay&&this.isMapClientReady){return ;
}Nvt.console.debug("e.MapClient.Class="+A.MapClient.Class);Nvt.console.debug("mapClientReady");this.mapClientReadyCount++;
this.initializeMapContent();if(A.MapClient.Class=="Static"){this.initializeMapCoordinates();this.isStaticMapClientReady=true;
this.visibleClient="static";}else{if(A.MapClient.Class=="Applet"){this.isAppletMapClientReady=true;this.visibleClient="applet";
this.displayMap();}}if(this.mapClientReadyCount==this.mapClientCount){this.isMapClientReady=true;}},mapClientReadyStatic:function(A){if(!this.filterControl){this.filterControl=new Nvt.MapTp.FilterControl(this.localConnection,this.remoteConnection,this.map,this.metroId,this.tmpOptions,this.registeredCallback);
}},delayLoadFilter:function(A){var B=this.mapClientReadyStatic.bind(this);window.setTimeout(function(){B();
},"3000");},initializeMapCoordinates:function(){if(this.restoreTheState){this.restoreState();}if(this.coordinates!=null){Nvt.console.debug("this.coordinates not null");
Nvt.console.debug("this.coordinates.lowerRtLong="+this.coordinates.lowerRtLong);Nvt.console.debug("this.coordinates.lowerRtLat="+this.coordinates.lowerRtLat);
Nvt.console.debug("this.coordinates.topLeftLong="+this.coordinates.topLeftLong);Nvt.console.debug("this.coordinates.topLeftLat="+this.coordinates.topLeftLat);
this.mapTpUtil.setMapView({Coordinates:[new Map24.WebServices.Coordinate({Longitude:parseFloat(this.coordinates.topLeftLong),Latitude:parseFloat(this.coordinates.topLeftLat)}),new Map24.WebServices.Coordinate({Longitude:parseFloat(this.coordinates.lowerRtLong),Latitude:parseFloat(this.coordinates.lowerRtLat)})]});
}else{Nvt.console.debug("this.coordinates is null");if(this.zoomOnStartup&&this.metro){this.mapTpUtil.setMapView({Coordinates:[new Map24.WebServices.Coordinate({Longitude:this.metro.boundingBox.longNWMins,Latitude:this.metro.boundingBox.latNWMins}),new Map24.WebServices.Coordinate({Longitude:this.metro.boundingBox.longSEMins,Latitude:this.metro.boundingBox.latSEMins})]});
}}if(this.visibleClient=="applet"){this.mapTpUtil.execute({ConnectionType:"remote"});}else{var A=this.displayMap.bind(this);
this.mapTpUtil.executeNoCloning({ConnectionType:"local",CallBack:A});}},initializeMapContent:function(){this.mapTpUtil.controlComponent({Control:"SHOW",Component:"LOCEXPANSION"});
this.mapTpUtil.execute();this.mapTpUtil.controlLayer({Control:"DISABLE",LayerIDs:["9817","10219"],Map24Layers:false});
this.mapTpUtil.execute({ConnectionType:"remote"});this.mapTpUtil.controlComponent({Control:"SHOW",Properties:[new Map24.WebServices.Property({Key:"triggerAction",Value:"HAND"})]});
},mapViewChanged:function(D){var E=parseFloat((parseFloat(D.ClipRect.TopLeft.Longitude)+parseFloat(D.ClipRect.LowerRight.Longitude))/2);
var C=parseFloat((parseFloat(D.ClipRect.TopLeft.Latitude)+parseFloat(D.ClipRect.LowerRight.Latitude))/2);
var A=new Nvt.Data.Coordinate();A.setCoordsInMinutes(C,E);if(this.currentMapState==null){this.currentMapState=new Nvt.Data.MapState();
}this.currentMapState.boundingBox.NWCoordinate.setCoordsInMinutes(D.ClipRect.TopLeft.Latitude,D.ClipRect.TopLeft.Longitude);
this.currentMapState.boundingBox.SECoordinate.setCoordsInMinutes(D.ClipRect.LowerRight.Latitude,D.ClipRect.LowerRight.Longitude);
this.currentMapState.centerPoint=A;if(parseInt(D.Mpp)>500){return ;}var B=this.metroLoaderWrapper.getMetroForGeoPoint(A);
if(B!=null){if(B.metroId!=this.metroId){this.metroId=B.metroId;this.filterControl.changeMetro(this.metroId);
if(this.registeredMetroChangeCallback!=null&&(commonData.pageType!=null&&commonData.pageType!="routing")){this.registeredMetroChangeCallback(B.metroId);
}Nvt.Util.createCookie("sessionMetroId",this.metroId,30);if(commonData.pageType!="routing"){document.title=B.metroName+" Traffic Report";
}}if(this.saveState){this.saveMyState();}else{this.firstTimeLoadComplete=true;}}this.mapViewChangedCounter++;
if(this.registeredCallback!=null){this.registeredCallback();}this.hasMapViewChanged=true;},setHasMapViewChanged:function(A){this.hasMapViewChanged=A;
},execute:function(A){this.mapTpUtil.execute(A);},saveMyState:function(){Nvt.console.debug("TrafficMap.saveMyState");
var B=this.getMetroStateMap();var A=this.map.Canvas["canvas"].MapClient.MapViewHistory.current();topLeftLong=A.TopLeft.Longitude;
topLeftLat=A.TopLeft.Latitude;lowerRtLong=A.LowerRight.Longitude;lowerRtLat=A.LowerRight.Latitude;var C=lowerRtLong+"|"+lowerRtLat+"|"+topLeftLong+"|"+topLeftLat;
B.set(this.metroId,C);Nvt.Util.createCookie("mapState1",this.serializeMap(B,4,this.metroid));},getMetroStateMap:function(){Nvt.console.debug("TrafficMap.getMetroStateMap");
var C=Nvt.Util.readCookie("mapState1");var D=$H();if(C){C=C.split("^");for(var B=0;B<C.length;B++){var A=C[B].split("#");
D.set(A[0],A[1]);}}return D;},serializeMap:function(E,A,D){var C="";var B=0;E.each(function(F){if(F.key&&F.value){if(D==F.key||B<A){C=C+"^"+F.key+"#"+F.value;
B++;}}});return C;},printMap:function(D,I,H){Nvt.console.debug("printMap: "+D+" "+I);var G=null;var B=this.map;
function F(){var L=B.Canvas["canvas"].MapClient.MapViewHistory.current();var K=new Map24.Rectangle(new Map24.Coordinate(L.TopLeft.X,L.TopLeft.Y),new Map24.Coordinate(L.LowerRight.X,L.LowerRight.Y));
var J=print_map.getMapImageURL(K,D,I);J+="&cmd1=SHOWCOMPONENT&component1=MRC&key1:0=MGI.Draw.Map24Label&value1:0=false&key1:1=MGI.Draw.Map24Logo&value1:1=false&key1:2=MGI.Draw.Map24Copyright&value1:2=false&prop:mime=gif";
Nvt.console.debug(J);H(J);}function E(){var J=print_map.WebServices.openConnection();J.onSuccess=F;J.mapletRemoteControl(new Map24.WebServices.Message.mapletRemoteControlRequest({MapletRemoteControlRequest:new Map24.WebServices.MapletRemoteControlRequest({Map24MRC:new Map24.WebServices.Map24MRC({Commands:G})})}));
}function C(){var N=B.Session.serialize(true,true,true);var J=null;var O=null;var M=Map24.Dom.createDocument();
var L=M.createElement("rootnode");M.appendChild(L);for(var K=0;K<N.length;K++){J=N[K];if(J["_CommandName"]&&J[J._CommandName]){if(J._CommandName=="ControlMapObject"||J._CommandName=="ControlLayer"){O=M.createElement("XMLCommandWrapper");
J.appendDom(O,M);L.appendChild(O);}else{if((typeof J[J._CommandName].MapObjectID=="string")&&(J[J._CommandName].MapObjectID.indexOf("$$")<0)){O=M.createElement("XMLCommandWrapper");
J.appendDom(O,M);L.appendChild(O);}}}}return Map24.Dom.serializeDocument(M);}function A(){Nvt.console.debug("TrafficMap.createPrintImage");
var L=C();var K=[];var J=null;var Q=Map24.Dom.parseXML(L);var O=Q.getElementsByTagName("rootnode")[0];
for(var N=0;N<O.childNodes.length;N++){try{J=new Map24.WebServices.XMLCommandWrapper(O.childNodes[N]);
J.update(true);for(var M in J._TypeDef.Properties){if(J[M]){J._CommandName=M;J[M].Discard=false;}}K[K.length++]=J;
}catch(P){P.Method="map24ApiLoaded";P.Msg="Unexpected exception while parsing XML";Map24.e(P,Map24.E_ERROR);
}}G=K;print_map=new Map24.Map();if(print_map.Session.Authenticated){E();}else{print_map.onSessionReady=E;
}}setTimeout(A,1000);},restoreState:function(){if(!this.isSessionReady){return ;}Nvt.console.debug("TrafficMap.restoreState");
var A=this.getMetroStateMap();if(this.metroId&&A.get(this.metroId)){A=A.get(this.metroId).split("|");
console.log("restoreState: "+this.metroId);this.coordinates=new Nvt.MapTp.MapBoundingBoxCoordinates();
console.log(this.coordinates);this.coordinates.setCoordinates(A[0],A[1],A[2],A[3]);}},updateMap:function(A){this.mapTpUtil.updateMap();
},zoomToBounds:function(A,B){Nvt.console.debug("TrafficMap.zoomToBounds");Nvt.console.log(A);Nvt.console.log(B);
this.mapTpUtil.setMapView({Coordinates:[new Map24.WebServices.Coordinate({Longitude:A.longitudeInMins,Latitude:A.latitudeInMins}),new Map24.WebServices.Coordinate({Longitude:B.longitudeInMins,Latitude:B.latitudeInMins})]});
this.mapTpUtil.execute();},zoomToLatLong:function(A,B){Nvt.console.debug("TrafficMap.zoomToLatLong");
if(B==null||(B<0&&B>100)){B=50;}this.mapTpUtil.setMapView({Coordinates:[new Map24.WebServices.Coordinate({Longitude:A.longitudeInMins,Latitude:A.latitudeInMins})],ClippingWidth:new Map24.WebServices.SetMapViewClippingWidth({MinimumWidth:25000,ViewPercentage:B})});
this.mapTpUtil.execute({ConnectionType:"local"});},zoomToCurrentMetro:function(){Nvt.console.debug("``````````````````````````` zoomToCurrentMetro");
Nvt.console.debug(this.metro.boundingBox);this.mapTpUtil.setMapView({Coordinates:[new Map24.WebServices.Coordinate({Longitude:this.metro.boundingBox.longNWMins,Latitude:this.metro.boundingBox.latNWMins}),new Map24.WebServices.Coordinate({Longitude:this.metro.boundingBox.longSEMins,Latitude:this.metro.boundingBox.latSEMins})]});
this.mapTpUtil.execute({ConnectionType:"local"});},turnOnFilterButtonCategory:function(A){if(this.filterControl!=null){this.filterControl.turnOnFilterButtonCategory(A);
}},popUpTrafficItem:function(B){Nvt.console.debug("TrafficMap.popUpTrafficItem");this.filterControl.popUpTrafficItem(B);
var A=new Nvt.Data.Coordinate();A.setCoords(B.location.lat,B.location.lon);this.zoomToLatLong(A,50);},popUpGeoLocation:function(A){Nvt.console.debug("TrafficMap.popUpGeoLocation");
this.trafficGeoLocationWrapper.addALocation(A);var B=new Nvt.Data.Coordinate();B.setCoords(A.location.lat,A.location.lon);
this.zoomToLatLong(B,50);},clearPopUpGeoLocation:function(){if(this.trafficGeoLocationWrapper!=null){this.trafficGeoLocationWrapper.clearGeoLocation();
}},popUpMetro:function(A){this.metroPopUp.addALocation(A);var C=new Nvt.Data.Coordinate();C.setCoords(A.boundingBox.latNW,A.boundingBox.longNW);
var B=new Nvt.Data.Coordinate();B.setCoords(A.boundingBox.latSE,A.boundingBox.longSE);this.zoomToBounds(C,B);
},clearPopUpMetro:function(){if(this.metroPopUp!=null){this.metroPopUp.clearPopUpMetro();}},resize:function(A,C){if(this.appletMap!=null&&this.visibleClient=="applet"&&this.isAppletMapClientReady){try{this.restoreTheState=true;
var B=this.map.Canvas["canvas"];B.resizeTo(C,A);}catch(D){Nvt.console.debug("Exception in TrafficMap.resize "+D.message);
}}},refreshData:function(A){var B=new Date();var C=B.getHours()+":"+B.getMinutes()+":"+B.getSeconds();
try{this.metroLoaderWrapper=new Nvt.MapTp.MetroLoaderWrapper(this.refreshMetros.bind(this));this.metroLoaderWrapper.loadAllMetroData(true);
this.filterControl.refreshData(A);}catch(D){Nvt.console.debug("Exception in TrafficMap.refreshData");
}},refreshMetros:function(A){this.metro=this.metroLoaderWrapper.loadById(this.metroId);},getTimeDifferenceBucket:function(E,C){var F=E.getTime();
var H=C.getTime();var G=((H-F)/1000);if(G<0){return"NA";}var D=60;var A=5;for(var B=0;B<=D;B+=A){if(G<=B){return B;
}}return D+"+";}};Object.extend(Nvt.MapTp.TrafficMap.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.MapTp.TrafficMap.appletLoadSuccessful="appletLoadSuccessful";
Nvt.MapTp.Util=Class.create();Nvt.MapTp.Util.prototype={initialize:function(A,B){this.localConnection=A;
this.remoteConnection=B;this.CommandContainer=[];nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.localConnection=null;
this.remoteConnection=null;this.CommandContainer=null;},convertDegreesToMinutes:function(A){return(parseFloat(A)*60);
},addProperty:function(A){return new Map24.WebServices.Property(A);},addLocation:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({DeclareMap24Location:new Map24.WebServices.DeclareMap24Location(A)});
},addGroup:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({DeclareMapObjectGroup:new Map24.WebServices.DeclareMapObjectGroup(A)});
},removeMapObject:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({RemoveMapObject:new Map24.WebServices.RemoveMapObject(A)});
},controlLayer:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({ControlLayer:new Map24.WebServices.ControlLayer(A)});
},manipulateLayerPolygon:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({DeclareMap24Polygon:new Map24.WebServices.DeclareMap24Polygon(A)});
},controlMapObject:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({ControlMapObject:new Map24.WebServices.ControlMapObject(A)});
},modifyMapView:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({ModifyMapView:new Map24.WebServices.ModifyMapView(A)});
},setMapView:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({SetMapView:new Map24.WebServices.SetMapView(A)});
},addHtmlObject:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({DeclareMap24HTMLObject:new Map24.WebServices.DeclareMap24HTMLObject(A)});
},controlComponent:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({ControlComponent:new Map24.WebServices.ControlComponent(A)});
},controlBasemapLayerProperties:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({controlBasemapLayerProperties:new Map24.WebServices.ControlBasemapLayerProperties(A)});
},declareMap24RouteObject:function(A){this.CommandContainer[this.CommandContainer.length]=new Map24.WebServices.XMLCommandWrapper({DeclareMap24RouteObject:new Map24.WebServices.DeclareMap24RouteObject(A)});
},execute:function(A){if(this.CommandContainer.length>=1){var E=null;var B=null;var C=null;if(A){if(A.CallBack){E=A.CallBack;
}if(A.OnErrorCallBack){B=A.OnErrorCallBack;}if(A.OnTimeOutCallBack){C=A.OnTimeOutCallBack;}}if(A&&A.ConnectionType&&A.ConnectionType=="remote"){var D=this.remoteConnection;
}else{var D=this.localConnection;}D.mapletRemoteControl(new Map24.WebServices.Message.mapletRemoteControlRequest({MapletRemoteControlRequest:new Map24.WebServices.MapletRemoteControlRequest({Map24MRC:new Map24.WebServices.Map24MRC({Commands:this.CommandContainer})})}),E,B,C);
this.CommandContainer=[];}},executeNoCloning:function(A){if(this.CommandContainer.length>=1){var E=null;
var B=null;var C=null;if(A){if(A.CallBack){E=A.CallBack;}if(A.OnErrorCallBack){B=A.OnErrorCallBack;}if(A.OnTimeOutCallBack){C=A.OnTimeOutCallBack;
}}if(A&&A.ConnectionType&&A.ConnectionType=="remote"){var D=this.remoteConnection;}else{var D=this.localConnection;
if(E){D.disableCommandCloning();}}D.mapletRemoteControl(new Map24.WebServices.Message.mapletRemoteControlRequest({MapletRemoteControlRequest:new Map24.WebServices.MapletRemoteControlRequest({Map24MRC:new Map24.WebServices.Map24MRC({Commands:this.CommandContainer})})}),E,B,C);
if(E&&(A&&A.ConnectionType&&A.ConnectionType!="remote")){D.enableCommandCloning;}this.CommandContainer=[];
}},updateMap:function(A){try{A.Session.update();}catch(B){}},switchMapType:function(C,A){if(C!="Applet"&&C!="Static"){return ;
}if(A.Canvas["canvas"].MapClient.Class==C){return ;}var B=A.Canvas["canvas"].MapClient.MapViewHistory.current();
A.onMapClientReady=null;A.show(C,"canvas");this.setMapView({Coordinates:[new Map24.WebServices.Coordinate({Longitude:parseFloat(B.TopLeft.Longitude),Latitude:parseFloat(B.TopLeft.Latitude)}),new Map24.WebServices.Coordinate({Longitude:parseFloat(B.LowerRight.Longitude),Latitude:parseFloat(B.LowerRight.Latitude)})]});
this.execute();}};Nvt.MapTp.MetroLoaderWrapper=Class.create();Nvt.MapTp.MetroLoaderWrapper.prototype={initialize:function(A){this.metros=[];
this.callback=A;this.resturl=commonData.restServerName+"/metros?var=metros&dataset=all";this.dataLoadComplete=false;
nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.metros=null;this.callback=null;
this.dataLoadComplete=null;},loadAllMetroData:function(B){var A=this;this.dataLoadComplete=false;if(B!=null&&B){this.loadData(this.resturl,function(){A.postLoadMetros(metros);
});}else{if(typeof restMetros!="undefined"){A.postLoadMetros(restMetros);}else{this.loadData(this.resturl,function(){A.postLoadMetros(metros);
});}}},postLoadMetros:function(A){if(!A.thrown&&A.presentationObjects){this.metros=A.presentationObjects.metros;
}this.convertAllMetrosToDegrees();this.dataLoadComplete=true;if(this.callback){this.callback(this.metros);
}},loadById:function(C){var A=null;for(var B=0;B<this.metros.length;B++){A=this.metros[B];if(A.metroId==C){return A;
}}return A;},getMetroForGeoPoint:function(H){var E=H;var F=null;var A=100000000;var D=100000000;var B=false;
for(var C=0;C<this.metros.length;C++){var I=this.metros[C];if(I.metroId!=0){if(this.pointInMetro(I,E)){var G=this.metroDistance(I,E);
if(G<A){A=G;F=I;B=true;}}else{if(!B){var G=this.metroDistance(I,E);if(G<D){D=G;F=I;}}}}}return F;},pointInMetro:function(B,A){var C=A.latitude<B.superSetBoundingBox.latNW&&A.latitude>B.superSetBoundingBox.latSE;
var D=A.longitude<B.superSetBoundingBox.longSE&&A.longitude>B.superSetBoundingBox.longNW;return C&&D;
},metroDistance:function(D,A){var C=A.latitude-D.boundingBox.centerPoint.lat;var B=A.longitude-D.boundingBox.centerPoint.lon;
return(C*C)+(B*B);},convertAllMetrosToDegrees:function(){for(var B=0;B<this.metros.length;B++){var A=this.metros[B];
A.boundingBox.latNWMins=this.convertDegreesToMinutes(A.boundingBox.latNW);A.boundingBox.longNWMins=this.convertDegreesToMinutes(A.boundingBox.longNW);
A.boundingBox.latSEMins=this.convertDegreesToMinutes(A.boundingBox.latSE);A.boundingBox.longSEMins=this.convertDegreesToMinutes(A.boundingBox.longSE);
}},convertDegreesToMinutes:function(A){return(parseFloat(A)*60);}};Object.extend(Nvt.MapTp.MetroLoaderWrapper.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.MapTp.RouteManagerHtml=Class.create();Object.extend(Nvt.MapTp.RouteManagerHtml.prototype,Nvt.MapTp.RouteManagerHtmlBase.prototype);
Object.extend(Nvt.MapTp.RouteManagerHtml,Nvt.MapTp.RouteManagerHtmlBase);Object.extend(Nvt.MapTp.RouteManagerHtml.prototype,{initialize:function(A){this.disambiguationDivId=A.disambiguationDivId;
this.routingDivId=A.routingDivId;this.errorDivId="nvt_routingError";this.browseTrafficLinkDivId=this.errorDivId;
this.finishedStartAddressCallback=false;this.finishedEndAddressCallback=false;this.showBrowseWidgetTrafficLink=false;
},finishedRoutingCallback:function(){},beginRoutingCallback:function(){this.resetDivs();},drawDirectionsCallback:function(D,F){var C=this.routingDivId;
nQ("#"+this.routingDivId).empty();$(C).innerHTML="";nQ("#nvt_search_results").empty();$("nvt_search_results").innerHTML="";
var A=new Nvt.Widget.RoutingWidget(D);var E=430;var B=new Nvt.Widget.SlideWidget(C,A,null,E);if(activeDriveIndex===2){viewDrive("drive2",false);
}resetWidth();document.title=F.metroName+" "+wsTitle;},displayDebugRoutingInfoCallback:function(){},finishedDragDropCallback:function(A){},printMapCallback:function(A){},startAddressCallback:function(D,A,B){Nvt.console.debug(">RouteManagerHtml.startAddressCallback");
Nvt.console.debug("geocodeResponses: ");Nvt.console.debug(D);if(!B){nQ("#"+this.errorDivId).append("<div id='nvt_disambiguateA'></div>");
var C=new Nvt.Widget.RoutingDisambiguationWidget(D,A,"nvt_disambiguateA","A");C.display("nvt_disambiguateA");
this.showBrowseWidgetTrafficLink=true;}this.finishedStartAddressCallback=true;this.finishedAddresses();
},endAddressCallback:function(D,A,B){if(!B){nQ("#"+this.errorDivId).empty();nQ("#"+this.errorDivId).append("<div id='nvt_disambiguateB'></div>");
var C=new Nvt.Widget.RoutingDisambiguationWidget(D,A,"nvt_disambiguateB","B");C.display("nvt_disambiguateB");
this.showBrowseWidgetTrafficLink=true;}this.finishedEndAddressCallback=true;this.finishedAddresses();
},zoomCallback:function(){},resetDivs:function(){nQ("#"+this.disambiguationDivId).empty();nQ("#"+this.disambiguationDivId).html("");
nQ("#"+this.routingDivId).empty();nQ("#"+this.routingDivId).html("");$(this.disambiguationDivId).innerHTML="<div id='"+this.errorDivId+"'></div>";
},finishedAddresses:function(){if(this.finishedStartAddressCallback&&this.finishedEndAddressCallback){if(this.showBrowseWidgetTrafficLink){try{nQ("#nvt_search_results").empty();
$("nvt_search_results").innerHTML="";var A=metroSummary.metroSummary[0].metro.metroName;var D=nQ("<h1 class='nvt_bold_text'>"+Nvt.I18N.resolveString("orBrowserMetroAreaWithLinks",new Array(A))+"</h1>");
var B=nQ("#"+this.browseTrafficLinkDivId);B.append(D);var C=new Nvt.Widget.BrowseTrafficLinksWidget(metro_id,this.browseTrafficLinkDivId,null,function(F){document.location=metroWSUrl+"?browse="+F;
});C.display(this.browseTrafficLinkDivId);B.append(Nvt.Util.getTableAd()[0]);}catch(E){}}resetWidth();
this.finishedStartAddressCallback=false;this.finishedEndAddressCallback=false;this.showBrowseWidgetTrafficLink=false;
}}});Nvt.MapTp.CameraLoaderWrapper=Class.create();Nvt.MapTp.CameraLoaderWrapper.prototype={initialize:function(A,B,C){this.MapTpUtils=new Nvt.MapTp.Util(A,B);
this.Tooltip=new Nvt.MapTp.Tooltip(A,B);this.cameras=[];this.hostURL=C;this.smallMap=false;this.registeredCallback=null;
this.activeTooltipCameraId=-1;Nvt.MapTp.CameraLoaderWrapper.closeCameraTooltip=new Map24.Callable(this,this.closeCameraTooltip);
Nvt.MapTp.CameraLoaderWrapper.openCameraTooltip=new Map24.Callable(this,this.openCameraTooltip);Nvt.MapTp.CameraLoaderWrapper.openSmallCameraTooltip=new Map24.Callable(this,this.openSmallCameraTooltip);
Nvt.MapTp.CameraLoaderWrapper.openMiniCameraTooltip=new Map24.Callable(this,this.openMiniCameraTooltip);
Nvt.MapTp.CameraLoaderWrapper.executeCallback=new Map24.Callable(this,this.executeCallback);nQ(window).unload(this.destroyLeaks.bind(this));
},destroyLeaks:function(){this.MapTpUtils=null;this.Tooltip=null;this.cameras=null;this.hostURL=null;
this.registeredCallback=null;Nvt.MapTp.CameraLoaderWrapper.closeCameraTooltip=null;Nvt.MapTp.CameraLoaderWrapper.openCameraTooltip=null;
Nvt.MapTp.CameraLoaderWrapper.openSmallCameraTooltip=null;Nvt.MapTp.CameraLoaderWrapper.openMiniCameraTooltip=null;
Nvt.MapTp.CameraLoaderWrapper.executeCallback=null;},getCamera:function(D){var C=this.cameras.length;
for(var A=0;A<C;A++){var B=this.cameras[A];if(B.id==D){return B;}}return false;},loadCameraFeed:function(E,A,D){var B=this;
this.smallMap=A;var C=commonData.restServerName+"/cameras?var=cameras&metroId="+E+"&dataset=all";if(D!=null){this.loadData(C,function(){D(cameras);
});}else{this.loadData(C,function(){B.processCameras(cameras);});}},processCameras:function(D){var B=[];
if(!D.thrown&&D.presentationObjects){B=D.presentationObjects.cameras;}var G=B.length;this.cameras=B;var F=[];
if(G<1){return ;}for(var A=0;A<G;A++){var E=B[A];var H=E.inactive;var C=Nvt.MapTp.Common.cameraURL;if(H=="true"){C=Nvt.MapTp.Common.cameraDisableURL;
}if(E.location.lon!=0&&E.location.lat!=0){cameraURL="javascript:Nvt.MapTp.CameraLoaderWrapper.closeCameraTooltip.invokeEx(['ta_tooltip']);Nvt.MapTp.CameraLoaderWrapper.openCameraTooltip.invokeEx(["+E.id+",'fix_tooltip']);";
if(this.smallMap){cameraURL="javascript:Nvt.MapTp.CameraLoaderWrapper.closeCameraTooltip.invokeEx(['ta_tooltip']);Nvt.MapTp.CameraLoaderWrapper.openSmallCameraTooltip.invokeEx(["+E.id+",'fix_tooltip']);";
}miniCameraURL="javascript:Nvt.MapTp.CameraLoaderWrapper.openMiniCameraTooltip.invokeEx(["+E.id+",'ta_tooltip']);";
this.MapTpUtils.addLocation({MapObjectID:E.id,Coordinate:new Map24.WebServices.Coordinate({Longitude:this.MapTpUtils.convertDegreesToMinutes(E.location.lon),Latitude:this.MapTpUtils.convertDegreesToMinutes(E.location.lat)}),LogoURL:C,MaxMPP:750,Events:[new Map24.WebServices.MapObjectEvent({ID:"OnMouseOver",Commands:[new Map24.WebServices.XMLCommandWrapper({Surf:new Map24.WebServices.Surf({URL:miniCameraURL,TargetFrame:"_self"})})]}),new Map24.WebServices.MapObjectEvent({ID:"OnClick",Commands:[new Map24.WebServices.XMLCommandWrapper({Surf:new Map24.WebServices.Surf({URL:cameraURL+"Nvt.MapTp.TrafficItemLoaderWrapper.executeCallback.invokeEx();",TargetFrame:"_self"})})]}),new Map24.WebServices.MapObjectEvent({ID:"OnMouseOut",Commands:[new Map24.WebServices.XMLCommandWrapper({Surf:new Map24.WebServices.Surf({URL:"javascript:Nvt.MapTp.CameraLoaderWrapper.closeCameraTooltip.invokeEx(['ta_tooltip']);//",TargetFrame:"_self"})})]})]});
F[F.length]=E.id;}}this.MapTpUtils.addGroup({MapObjectGroupID:[Nvt.MapTp.Common.camera],MapObjectIDs:F});
this.MapTpUtils.controlMapObject({Control:"ENABLE",MapObjectIDs:[Nvt.MapTp.Common.camera]});this.MapTpUtils.execute();
},closeCameraTooltip:function(A){if(A=="fix_tooltip"){this.activeTooltipCameraId=-1;}this.Tooltip.disableLocationTooltip(A);
},openCameraTooltip:function(C,A){var B=this.getCamera(C);this.activeTooltipCameraId=C;this.Tooltip.drawCameraTooltip(B,A,0);
},openMiniCameraTooltip:function(C,A){var B=this.getCamera(C);if(this.activeTooltipCameraId!=C){this.Tooltip.drawMiniCameraTooltip(B,A);
}},openSmallCameraTooltip:function(C,A){var B=this.getCamera(C);this.activeTooltipCameraId=C;this.Tooltip.drawCameraTooltip(B,A,250);
},executeCallback:function(){if(this.registeredCallback!=null){this.registeredCallback();}}};Object.extend(Nvt.MapTp.CameraLoaderWrapper.prototype,Nvt.Widget.WidgetBase.prototype);
Nvt.MapTp.Direction=Class.create();Nvt.MapTp.Direction.prototype={initialize:function(A,B){this.text=A;
this.distance=B;},getText:function(){return this.text;},getDistance:function(){return this.distance;}};
Nvt.MapTp.Styles=Class.create();Nvt.MapTp.Styles.prototype={initialize:function(D,B,A,C){this.red=0;this.green=0;
this.blue=0;this.alpha=0;if(D){this.red=D;}if(B){this.green=B;}if(A){this.blue=A;}if(C){this.alpha=C;
}}};Nvt.MapTp.TrafficItemLoaderWrapper=Class.create();Nvt.MapTp.TrafficItemLoaderWrapper.prototype={initialize:function(A,B,C){this.MapTpUtils=new Nvt.MapTp.Util(A,B);
this.Tooltip=new Nvt.MapTp.Tooltip(A,B);this.trafficItems=new Array();this.hostURL=C;this.viewCategories=null;
this.registeredCallback=null;this.categoryLocs=new Array();this.categoryIds=new Array();this.category=new Array();
this.activeTooltipTrafficItemId=-1;Nvt.MapTp.TrafficItemLoaderWrapper.closeTrafficItemTooltip=new Map24.Callable(this,this.closeTrafficItemTooltip);
Nvt.MapTp.TrafficItemLoaderWrapper.openTrafficItemTooltip=new Map24.Callable(this,this.openTrafficItemTooltip);
Nvt.MapTp.TrafficItemLoaderWrapper.openExpTrafficItemTooltip=new Map24.Callable(this,this.openExpTrafficItemTooltip);
Nvt.MapTp.TrafficItemLoaderWrapper.openSmallTrafficItemTooltip=new Map24.Callable(this,this.openSmallTrafficItemTooltip);
Nvt.MapTp.TrafficItemLoaderWrapper.executeCallback=new Map24.Callable(this,this.executeCallback);Nvt.MapTp.TrafficItemLoaderWrapper.keyRouteSelected=new Map24.Callable(this,this.keyRouteSelected);
nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.MapTpUtils=null;this.Tooltip=null;
this.trafficItems=null;this.hostURL=null;this.viewCategories=null;this.registeredCallback=null;this.categoryLocs=null;
this.categoryIds=null;this.category=null;Nvt.MapTp.TrafficItemLoaderWrapper.closeTrafficItemTooltip=null;
Nvt.MapTp.TrafficItemLoaderWrapper.openTrafficItemTooltip=null;Nvt.MapTp.TrafficItemLoaderWrapper.openExpTrafficItemTooltip=null;
Nvt.MapTp.TrafficItemLoaderWrapper.openSmallTrafficItemTooltip=null;Nvt.MapTp.TrafficItemLoaderWrapper.executeCallback=null;
Nvt.MapTp.TrafficItemLoaderWrapper.keyRouteSelected=null;},clearTrafficItems:function(){for(var A=0;A<this.category.length;
A++){this.MapTpUtils.removeMapObject({MapObjectIDs:this.categoryIds[this.category[A]]});}if(this.category.length>0){this.MapTpUtils.execute();
}this.trafficItems=new Array();this.categoryLocs=new Array();this.categoryIds=new Array();this.category=new Array();
},getTrafficItem:function(F,C){var D=this.trafficItems.length;var A=this.trafficItems;if(C){A=this.categoryLocs[C];
if(A!=null){D=this.categoryLocs[C].length;}else{D=0;}}for(var B=0;B<D;B++){var E=A[B];if(E.id==F){return E;
}}return false;},loadFeed:function(D,C,B){var A=this;this.viewCategories=C;this.resturl=commonData.restServerName+"/trafficItems?var=trafficItems&metroId="+D+"&sortBy=criticality&sortOrder=asc&dataset=all";
if(B!=null&&B){this.loadData(this.resturl,function(){A.processTrafficItems(trafficItems);});}else{if(typeof restTrafficItems!="undefined"){A.processTrafficItems(restTrafficItems);
}else{this.loadData(this.resturl,function(){A.processTrafficItems(trafficItems);});}}},processTrafficItems:function(C){var A=[];
if(!C.thrown&&C.presentationObjects){A=C.presentationObjects.trafficItems;}this.clearTrafficItems();var E=A.length;
for(var B=0;B<E;B++){var D=A[B];this.addALocation(D);}for(var B=0;B<this.category.length;B++){this.MapTpUtils.addGroup({MapObjectGroupID:this.category[B],MapObjectIDs:this.categoryIds[this.category[B]]});
}this.MapTpUtils.controlMapObject({Control:"ENABLE",MapObjectIDs:this.viewCategories});this.MapTpUtils.execute();
},addALocation:function(G){this.trafficItems.push(G);var D=Nvt.MapTp.Common.imageIncidentUrl;var C=G.itemType;
var F=commonData.staticServer("n")+D;var E=G.criticality==0?1:G.criticality;if(C==Nvt.MapTp.Common.event){F=commonData.staticServer("icon_map_event_rest")+D+"icon_map_event_rest"+Nvt.MapTp.Common.imageExtention;
}else{if(C==Nvt.MapTp.Common.incident){F=commonData.staticServer("icon_map_inc")+D+"icon_map_inc"+E+"_rest"+Nvt.MapTp.Common.imageExtention;
}else{if(C==Nvt.MapTp.Common.roadwork){F=commonData.staticServer("icon_map_cons_rest")+D+"icon_map_cons_rest"+Nvt.MapTp.Common.imageExtention;
}else{F=commonData.staticServer("icon_map_more_rest")+D+"icon_map_more_rest"+Nvt.MapTp.Common.imageExtention;
}}}if(G.congestion=="true"){F=commonData.staticServer("icon_map_blank")+D+"icon_map_blank.gif";}if(G.location.lon!=0&&G.location.lat!=0){this.MapTpUtils.addLocation({MapObjectID:G.id,Coordinate:new Map24.WebServices.Coordinate({Longitude:this.MapTpUtils.convertDegreesToMinutes(G.location.lon),Latitude:this.MapTpUtils.convertDegreesToMinutes(G.location.lat)}),LogoURL:F,MaxMPP:750,Events:[new Map24.WebServices.MapObjectEvent({ID:"OnMouseOver",Commands:[new Map24.WebServices.XMLCommandWrapper({Surf:new Map24.WebServices.Surf({URL:"javascript:Nvt.MapTp.TrafficItemLoaderWrapper.openSmallTrafficItemTooltip.invokeEx(["+G.id+",'ta_tooltip']);//",TargetFrame:"_self"})})]}),new Map24.WebServices.MapObjectEvent({ID:"OnClick",Commands:[new Map24.WebServices.XMLCommandWrapper({Surf:new Map24.WebServices.Surf({URL:"javascript:Nvt.MapTp.TrafficItemLoaderWrapper.closeTrafficItemTooltip.invokeEx(['ta_tooltip']);Nvt.MapTp.TrafficItemLoaderWrapper.openTrafficItemTooltip.invokeEx(["+G.id+",'fix_tooltip']);Nvt.MapTp.TrafficItemLoaderWrapper.executeCallback.invokeEx();//",TargetFrame:"_self"})})]}),new Map24.WebServices.MapObjectEvent({ID:"OnMouseOut",Commands:[new Map24.WebServices.XMLCommandWrapper({Surf:new Map24.WebServices.Surf({URL:"javascript:Nvt.MapTp.TrafficItemLoaderWrapper.closeTrafficItemTooltip.invokeEx(['ta_tooltip']);//",TargetFrame:"_self"})})]})]});
var B=false;for(var A=0;A<this.category.length;A++){if(this.category[A]==G.itemType){B=true;break;}}if(!B){this.category[this.category.length]=G.itemType;
this.categoryLocs[G.itemType]=new Array();this.categoryIds[G.itemType]=new Array();}this.categoryLocs[G.itemType].push(G);
this.categoryIds[G.itemType].push(G.id);}},closeTrafficItemTooltip:function(A){if(A=="fix_tooltip"){this.activeTooltipTrafficItemId=-1;
}this.Tooltip.disableLocationTooltip(A);},openTrafficItemTooltip:function(C,A){var B=this.getTrafficItem(C);
Nvt.Core.NvtAnalytics.virtual("/virtal/click/map/"+B.itemType.toLowerCase()+"icon");this.activeTooltipTrafficItemId=C;
this.Tooltip.drawLocationTooltip(B,A);},openExpTrafficItemTooltip:function(C,A){var B=this.getTrafficItem(C);
this.Tooltip.drawLocationTooltip(B,A,true);},openSmallTrafficItemTooltip:function(C,A){var B=this.getTrafficItem(C);
if(this.activeTooltipTrafficItemId!=C){this.Tooltip.drawMiniLocationTooltip(B,A);}},executeCallback:function(){if(this.registeredCallback!=null){this.registeredCallback();
}},popUpTrafficItem:function(A){if(this.getTrafficItem(A.id,A.itemType)){this.closeTrafficItemTooltip("ta_tooltip");
this.closeTrafficItemTooltip("fix_tooltip");this.openTrafficItemTooltip(A.id,"fix_tooltip");this.executeCallback();
}else{this.addALocation(A);this.MapTpUtils.addGroup({MapObjectGroupID:A.itemType,MapObjectIDs:this.categoryIds[A.itemType]});
this.MapTpUtils.controlMapObject({Control:"ENABLE",MapObjectIDs:A.itemType});this.MapTpUtils.execute();
this.closeTrafficItemTooltip("ta_tooltip");this.closeTrafficItemTooltip("fix_tooltip");this.openTrafficItemTooltip(A.id,"fix_tooltip");
this.executeCallback();}},keyRouteSelected:function(B,E){var A=document.widgetManager.getTabWidget();
if(A&&typeof (commonData.pageType)!="undefined"&&commonData.pageType=="metro"){var D=null;if(E!=null&&E!=""){D=new Nvt.Widget.ChildKeyRouteWidget(null,E,B,metro_id);
}else{D=new Nvt.Widget.ParentKeyRouteWidget(null,B,metro_id,true,false);}var C=function(){A.clickTab(null,"Search Traffic",true);
};document.widgetManager.getSlideWidget().push(D,null,C,"Search Traffic");}else{document.location.href=commonData.appServerName+"/controller/workspace?krId="+B+"&krPId="+E;
}}};Object.extend(Nvt.MapTp.TrafficItemLoaderWrapper.prototype,Nvt.Widget.WidgetBase.prototype);Nvt.MapTp.Address=Class.create();
Nvt.MapTp.Address.prototype={initialize:function(B,A){this.display="";this.data="";if(B){this.display=B;
}if(A){this.data=A;}}};Nvt.MapTp.FilterControl=Class.create();Nvt.MapTp.FilterControl.prototype={initialize:function(C,K,A,F,L,H){this.localConnection=C;
this.remoteConnection=K;this.map=A;this.metroId=F;this.smallMap=false;this.registeredCallback=H;this.refreshFlowEnabled=nQ.trim(Nvt.Util.getQueryParamValue("refreshFlowEnabled"));
if(!this.refreshFlowEnabled||this.refreshFlowEnabled.length==0){this.refreshFlowEnabled="true";}if(L.smallMap!=null){this.smallMap=L.smallMap;
}this.turnCamerasOn=false;this.booleanFlowButtonOn=true;this.booleanIncidentButtonOn=true;this.booleanRoadworkButtonOn=false;
this.booleanCameraButtonOn=false;this.booleanEventButtonOn=true;this.booleanCameraButtonEnabled=false;
this.booleanTrafficItemsLoaded=false;this.booleanCameraItemsLoaded=false;this.booleanForceRestLoad=false;
this.trafficItemLoaderWrapper=new Nvt.MapTp.TrafficItemLoaderWrapper(C,K,Nvt.MapTp.Common.hostUrl);this.trafficItemLoaderWrapper.registeredCallback=H;
this.cameraLoaderWrapper=new Nvt.MapTp.CameraLoaderWrapper(C,K,Nvt.MapTp.Common.hostUrl);this.cameraLoaderWrapper.registeredCallback=H;
Nvt.MapTp.FilterControl.toggleFlowButton=new Map24.Callable(this,this.toggleFlowButton);Nvt.MapTp.FilterControl.toggleIncidentButton=new Map24.Callable(this,this.toggleIncidentButton);
Nvt.MapTp.FilterControl.toggleRoadworkButton=new Map24.Callable(this,this.toggleRoadworkButton);Nvt.MapTp.FilterControl.toggleCameraButton=new Map24.Callable(this,this.toggleCameraButton);
Nvt.MapTp.FilterControl.toggleEventButton=new Map24.Callable(this,this.toggleEventButton);Nvt.MapTp.FilterControl.urlZoomCallback=new Map24.Callable(this,this.urlZoomCallback);
Nvt.MapTp.FilterControl.setLocationCallback=new Map24.Callable(this,this.setLocationCallback);this.booleanZoomState=false;
this.booleanSetLocationState=false;this.mapTpUtil=new Nvt.MapTp.Util(this.localConnection,this.remoteConnection);
this.flowValue="0| |true|javascript:Nvt.MapTp.FilterControl.toggleFlowButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.flowColor+"|"+Nvt.MapTp.Common.flowColor+"|"+Nvt.MapTp.Common.flowGray+"|"+Nvt.MapTp.Common.flowColor+"|"+Nvt.MapTp.Common.flowLegend;
this.incidentValue="1|Incident|true|javascript:Nvt.MapTp.FilterControl.toggleIncidentButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.incidentColor+"|"+Nvt.MapTp.Common.incidentColor+"|"+Nvt.MapTp.Common.incidentGray+"|"+Nvt.MapTp.Common.incidentColor+"|"+Nvt.MapTp.Common.incidentLegend;
this.roadworkValue="2|Construction|true|javascript:Nvt.MapTp.FilterControl.toggleRoadworkButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.roadworkGray+"|"+Nvt.MapTp.Common.roadworkColor+"|"+Nvt.MapTp.Common.roadworkColor+"|"+Nvt.MapTp.Common.roadworkColor+"|"+Nvt.MapTp.Common.roadworkLegend;
this.cameraValue="4|Traffic Camera|true|javascript:Nvt.MapTp.FilterControl.toggleCameraButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.cameraGray+"|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraLegend;
this.eventValue="3|Events|true|javascript:Nvt.MapTp.FilterControl.toggleEventButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.eventColor+"|"+Nvt.MapTp.Common.eventColor+"|"+Nvt.MapTp.Common.eventGray+"|"+Nvt.MapTp.Common.eventColor+"|"+Nvt.MapTp.Common.eventLegend;
var E=new String(Nvt.Util.readCookie(Nvt.MapTp.Common.flow));if(E=="false"){this.booleanFlowButtonOn=false;
this.flowValue="0| |true|javascript:Nvt.MapTp.FilterControl.toggleFlowButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.flowGray+"|"+Nvt.MapTp.Common.flowGray+"|"+Nvt.MapTp.Common.flowColor+"|"+Nvt.MapTp.Common.flowGray+"|"+Nvt.MapTp.Common.flowLegend;
}var I=new String(Nvt.Util.readCookie(Nvt.MapTp.Common.incident));if(I=="false"){this.booleanIncidentButtonOn=false;
this.incidentValue="1|Incident|true|javascript:Nvt.MapTp.FilterControl.toggleIncidentButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.incidentGray+"|"+Nvt.MapTp.Common.incidentColor+"|"+Nvt.MapTp.Common.incidentColor+"|"+Nvt.MapTp.Common.incidentColor+"|"+Nvt.MapTp.Common.incidentLegend;
}var G=new String(Nvt.Util.readCookie(Nvt.MapTp.Common.event));if(G=="false"){this.booleanEventButtonOn=false;
this.eventValue="3|Events|true|javascript:Nvt.MapTp.FilterControl.toggleEventButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.eventGray+"|"+Nvt.MapTp.Common.eventColor+"|"+Nvt.MapTp.Common.eventColor+"|"+Nvt.MapTp.Common.eventColor+"|"+Nvt.MapTp.Common.eventLegend;
}var J=new String(Nvt.Util.readCookie(Nvt.MapTp.Common.roadwork));if(J=="true"){this.booleanRoadworkButtonOn=true;
this.roadworkValue="2|Construction|true|javascript:Nvt.MapTp.FilterControl.toggleRoadworkButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.roadworkColor+"|"+Nvt.MapTp.Common.roadworkColor+"|"+Nvt.MapTp.Common.roadworkGray+"|"+Nvt.MapTp.Common.roadworkColor+"|"+Nvt.MapTp.Common.roadworkLegend;
}var D=new String(Nvt.Util.readCookie(Nvt.MapTp.Common.camera));if(D=="true"){this.booleanCameraButtonOn=true;
this.cameraValue="4|Traffic Camera|true|javascript:Nvt.MapTp.FilterControl.toggleCameraButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraGray+"|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraLegend;
}this.turnOnCategories();if(!this.smallMap){var B=this.processInitialButtonLoad.bind(this);window.setTimeout(function(){B();
},"700");}nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.localConnection=null;
this.remoteConnection=null;this.map=null;this.registeredCallback=null;this.trafficItemLoaderWrapper.registeredCallback=null;
this.trafficItemLoaderWrapper=null;this.cameraLoaderWrapper.registeredCallback=null;this.cameraLoaderWrapper=null;
Nvt.MapTp.FilterControl.toggleFlowButton=null;Nvt.MapTp.FilterControl.toggleIncidentButton=null;Nvt.MapTp.FilterControl.toggleRoadworkButton=null;
Nvt.MapTp.FilterControl.toggleCameraButton=null;Nvt.MapTp.FilterControl.toggleEventButton=null;Nvt.MapTp.FilterControl.urlZoomCallback=null;
Nvt.MapTp.FilterControl.setLocationCallback=null;this.mapTpUtil=null;},changeMetro:function(A){this.booleanTrafficItemsLoaded=false;
this.booleanCameraItemsLoaded=false;this.booleanForceRestLoad=true;this.hideCategory([Nvt.MapTp.Common.incident,Nvt.MapTp.Common.event,Nvt.MapTp.Common.masstransit,Nvt.MapTp.Common.roadwork,Nvt.MapTp.Common.roadhazzard,Nvt.MapTp.Common.camera]);
this.metroId=A;if(!this.smallMap){this.checkCameraButtonEnabled();}this.turnOnCategories();},turnOnCategories:function(){if(!this.booleanFlowButtonOn){this.toggleFlowForCurrentMetro(false);
}else{this.toggleFlowForCurrentMetro(true);}var A=[];if(this.booleanIncidentButtonOn){A[A.length]=Nvt.MapTp.Common.incident;
}if(this.booleanRoadworkButtonOn){A[A.length]=Nvt.MapTp.Common.roadwork;}if(this.booleanEventButtonOn){A[A.length]=Nvt.MapTp.Common.event;
}if(A.length>0){this.showCategory(A);}if(this.booleanCameraButtonOn&&this.turnCamerasOn){this.showCamera();
}},toggleFlowButton:function(A){this.booleanFlowButtonOn=this.booleanFlowButtonOn?false:true;if(this.booleanFlowButtonOn){Nvt.Core.NvtAnalytics.virtual("/virtual/click/map/showflow");
}else{Nvt.Core.NvtAnalytics.virtual("/virtual/click/map/hideflow");}this.toggleFlowForCurrentMetro(this.booleanFlowButtonOn);
},toggleIncidentButton:function(A){this.booleanIncidentButtonOn=this.booleanIncidentButtonOn?false:true;
if(this.booleanIncidentButtonOn){Nvt.Core.NvtAnalytics.virtual("/virtual/click/map/showincidents");this.showCategory([Nvt.MapTp.Common.incident]);
}else{Nvt.Core.NvtAnalytics.virtual("/virtual/click/map/hideincidents");this.hideCategory([Nvt.MapTp.Common.incident]);
}},toggleRoadworkButton:function(A){this.booleanRoadworkButtonOn=this.booleanRoadworkButtonOn?false:true;
if(this.booleanRoadworkButtonOn){Nvt.Core.NvtAnalytics.virtual("/virtual/click/map/showroadwork");this.showCategory([Nvt.MapTp.Common.roadwork]);
}else{Nvt.Core.NvtAnalytics.virtual("/virtual/click/map/hideroadwork");this.hideCategory([Nvt.MapTp.Common.roadwork]);
}},toggleCameraButton:function(A){this.booleanCameraButtonOn=this.booleanCameraButtonOn?false:true;if(this.booleanCameraButtonOn){Nvt.Core.NvtAnalytics.virtual("/virtual/click/map/showcamera");
this.showCamera();}else{Nvt.Core.NvtAnalytics.virtual("/virtual/click/map/hidecamera");this.hideCategory([Nvt.MapTp.Common.camera]);
}},toggleEventButton:function(A){this.booleanEventButtonOn=this.booleanEventButtonOn?false:true;if(this.booleanEventButtonOn){Nvt.Core.NvtAnalytics.virtual("/virtual/click/map/showevents");
this.showCategory([Nvt.MapTp.Common.event]);}else{Nvt.Core.NvtAnalytics.virtual("/virtual/click/map/hideevents");
this.hideCategory([Nvt.MapTp.Common.event]);}},showCategory:function(A){currentMetroId=this.metroId;if(this.booleanTrafficItemsLoaded){this.mapTpUtil.controlMapObject({Control:"ENABLE",MapObjectIDs:A});
this.mapTpUtil.execute();}else{this.trafficItemLoaderWrapper.loadFeed(currentMetroId,A,this.booleanForceRestLoad);
this.booleanTrafficItemsLoaded=true;}for(var B=0;B<A.length;B++){Nvt.Util.createCookie(A[B],"true");}},hideCategory:function(A){this.mapTpUtil.controlMapObject({Control:"DISABLE",MapObjectIDs:A});
this.mapTpUtil.execute();for(var B=0;B<A.length;B++){Nvt.Util.createCookie(A[B],"false");}},showCamera:function(){currentMetroId=this.metroId;
if(this.booleanCameraItemsLoaded){this.mapTpUtil.controlMapObject({Control:"ENABLE",MapObjectIDs:[Nvt.MapTp.Common.camera]});
this.mapTpUtil.execute();}else{this.cameraLoaderWrapper.loadCameraFeed(currentMetroId,this.smallMap);
this.booleanCameraItemsLoaded=true;}Nvt.Util.createCookie(Nvt.MapTp.Common.camera,"true");},toggleFlow:function(B){var C="";
if(B){C="HIDE";Nvt.Util.createCookie(Nvt.MapTp.Common.flow,"true");}else{C="SHOW";Nvt.Util.createCookie(Nvt.MapTp.Common.flow,"false");
}this.mapTpUtil.controlLayer({Control:C,LayerIDs:[0],Map24Layers:false});this.mapTpUtil.execute();var A=this.updateMap.bind(this);
window.setTimeout(function(){A();},"1500");},toggleFlowForCurrentMetro:function(B){var D="";if(B){D="ENABLE";
Nvt.Util.createCookie(Nvt.MapTp.Common.flow,"true");}else{D="DISABLE";Nvt.Util.createCookie(Nvt.MapTp.Common.flow,"false");
}metroLayer=9950+parseInt(this.metroId);var C=[metroLayer];this.mapTpUtil.controlLayer({Control:D,LayerIDs:C,Map24Layers:false});
this.mapTpUtil.execute({ConnectionType:"remote"});var A=this.updateMap.bind(this);window.setTimeout(function(){A();
},"1500");},setFlowStyles:function(){this.mapTpUtil.manipulateLayerPolygon({MapObjectID:"$$TEMPLATE-US_TRAFFICDOTCOM_REALTIME_DMAP",StrokePaintRules:[new Map24.WebServices.PaintRuleSTROKE({MaxMPP:10000,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:2000,Width:1,Offset:0})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:2000,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:400,Width:1,Offset:-2})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:400,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:115,Width:2,Offset:-3})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:115,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:47,Width:3,Offset:-4})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:47,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:26,Width:4,Offset:-5})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:26,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:13,Width:4,Offset:-5})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:13,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:7,Width:5,Offset:-6})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:7,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:2,Width:6,Offset:-8})]}),new Map24.WebServices.PaintRuleSTROKE({MaxMPP:2,DrawPhase:"ROADS",Details:[new Map24.WebServices.PaintRuleSTROKEDetails({MinMPP:0,Width:11,Offset:-13})]})]});
this.mapTpUtil.execute();},updateMap:function(){this.mapTpUtil.updateMap(this.map);},processInitialButtonLoad:function(){if(this.turnCamerasOn){this.cameraLoaderWrapper.loadCameraFeed(this.metroId,this.smallMap,this.processButtonLoad.bind(this));
}else{this.processButtonLoad([]);}},checkCameraButtonEnabled:function(){if(this.turnCamerasOn){this.cameraLoaderWrapper.loadCameraFeed(this.metroId,this.smallMap,this.processCameras.bind(this));
}else{this.processCameras([]);}},processButtonLoad:function(C){var D=0;var B=[];if(!C.thrown&&C.presentationObjects){B=C.presentationObjects.cameras;
}var A=Nvt.Util.getAWOPartner();if((A!="DEFAULT"&&navbar._show_cams)||(A=="DEFAULT")){D=B.length;}if(D==0){this.booleanCameraButtonEnabled=false;
Nvt.console.log("FILTERCONTROL 1");this.mapTpUtil.controlComponent({Control:"SHOW",Component:"FILTERCONTROL",Properties:[new Map24.WebServices.Property({Key:"Button0",Value:this.flowValue}),new Map24.WebServices.Property({Key:"Button1",Value:this.incidentValue}),new Map24.WebServices.Property({Key:"Button2",Value:this.roadworkValue}),new Map24.WebServices.Property({Key:"Button3",Value:this.eventValue})]});
}else{this.booleanCameraButtonEnabled=true;Nvt.console.log("FILTERCONTROL 2");this.mapTpUtil.controlComponent({Control:"SHOW",Component:"FILTERCONTROL",Properties:[new Map24.WebServices.Property({Key:"Button0",Value:this.flowValue}),new Map24.WebServices.Property({Key:"Button1",Value:this.incidentValue}),new Map24.WebServices.Property({Key:"Button2",Value:this.roadworkValue}),new Map24.WebServices.Property({Key:"Button3",Value:this.eventValue}),new Map24.WebServices.Property({Key:"Button4",Value:this.cameraValue})]});
}this.mapTpUtil.execute();},processCameras:function(C){var B=[];if(!C.thrown&&C.presentationObjects){B=C.presentationObjects.cameras;
}var A=Nvt.Util.getAWOPartner();var D=0;if((A!="DEFAULT"&&navbar._show_cams)||(A=="DEFAULT")){D=B.length;
}if(D<1&&this.booleanCameraButtonEnabled){this.removeCameraButton();}else{if(D>0&&!this.booleanCameraButtonEnabled){this.addCameraButton();
}}},addCameraButton:function(){this.booleanCameraButtonEnabled=true;this.cameraValue="4|Traffic Camera|true|javascript:Nvt.MapTp.FilterControl.toggleCameraButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.cameraGray+"|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraLegend;
this.booleanCameraButtonOn=false;var A=new String(Nvt.Util.readCookie(Nvt.MapTp.Common.camera));if(A=="true"){this.booleanCameraButtonOn=true;
this.cameraValue="4|Traffic Camera|true|javascript:Nvt.MapTp.FilterControl.toggleCameraButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraGray+"|"+Nvt.MapTp.Common.cameraColor+"|"+Nvt.MapTp.Common.cameraLegend;
}Nvt.console.log("FILTERCONTROL 3");this.mapTpUtil.controlComponent({Control:"SHOW",Component:"FILTERCONTROL",Properties:[new Map24.WebServices.Property({Key:"Button4",Value:this.cameraValue})]});
this.mapTpUtil.execute({ConnectionType:"remote"});},removeCameraButton:function(){this.booleanCameraButtonEnabled=false;
Nvt.console.log("FILTERCONTROL 4");this.mapTpUtil.controlComponent({Control:"SHOW",Component:"FILTERCONTROL",Properties:[new Map24.WebServices.Property({Key:"Button4",Value:"NULL"})]});
this.mapTpUtil.execute();},urlZoomCallback:function(){if(this.booleanZoomState){this.booleanZoomState=false;
}else{this.booleanZoomState=true;}this.customizeEventActions((this.booleanZoomState));},customizeEventActions:function(C){if(typeof C!="boolean"){C=false;
}var B=(!C)?"MAPPAN":"ZOOMRECT";var A=(!C)?"ZOOMRECT":"MAPPAN";this.mapTpUtil.controlComponent({Component:"MAPEVENTHANDLER",Control:"SET",Properties:[new Map24.WebServices.Property({Key:"MouseDrag(Left)+Shift",Value:"ZOOMRECT"}),new Map24.WebServices.Property({Key:"MouseDrag(Left)",Value:B}),new Map24.WebServices.Property({Key:"MouseDrag(Right)",Value:A}),new Map24.WebServices.Property({Key:"DblClick(Left)",Value:"ZOOMIN(true,true)"}),new Map24.WebServices.Property({Key:"DblClick(Right)",Value:"ZOOMOUT(true,true)"}),new Map24.WebServices.Property({Key:"MouseWheelUp",Value:"ZOOMIN"}),new Map24.WebServices.Property({Key:"MouseWheelDown",Value:"ZOOMOUT"})]});
this.mapTpUtil.execute({ConnectionType:"local"});},setLocationCallback:function(){if(this.booleanSetLocationState){this.booleanSetLocationState=false;
}else{this.booleanSetLocationState=true;}if(this.booleanSetLocationState){this.map.addListener("Map24.Event.MapClick",[this,this.setTheLocation]);
}else{this.map.removeListener("Map24.Event.MapClick",[this,this.setTheLocation]);}},setTheLocation:function(B){var A=B.Coordinate.Latitude;
var C=B.Coordinate.Longitude;B.stop();if(this.booleanSetLocationState){this.mapTpUtil.addLocation({MapObjectID:"ALocation",Coordinate:new Map24.WebServices.Coordinate({Longitude:C,Latitude:A}),SymbolID:10281});
this.mapTpUtil.controlMapObject({Control:"ENABLE",MapObjectIDs:["ALocation"]});this.mapTpUtil.execute();
}},modifyButton:function(A,B){Nvt.console.log("FILTERCONTROL 5");this.mapTpUtil.controlComponent({Control:"SHOW",Component:"FILTERCONTROL",Properties:[new Map24.WebServices.Property({Key:A,Value:B})]});
this.mapTpUtil.execute();},turnOnFilterButtonCategory:function(A){var B=[];if(A==Nvt.MapTp.Common.incident){B[0]=Nvt.MapTp.Common.incident;
this.incidentValue="1|Incident|true|javascript:Nvt.MapTp.FilterControl.toggleIncidentButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.incidentColor+"|"+Nvt.MapTp.Common.incidentColor+"|"+Nvt.MapTp.Common.incidentGray+"|"+Nvt.MapTp.Common.incidentColor+"|"+Nvt.MapTp.Common.incidentLegend;
if(!this.booleanIncidentButtonOn){this.modifyButton("Button1","NULL");this.modifyButton("Button1",this.incidentValue);
this.booleanIncidentButtonOn=true;}}else{if(A==Nvt.MapTp.Common.roadwork){B[0]=Nvt.MapTp.Common.roadwork;
this.roadworkValue="2|Construction|true|javascript:Nvt.MapTp.FilterControl.toggleRoadworkButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.roadworkColor+"|"+Nvt.MapTp.Common.roadworkColor+"|"+Nvt.MapTp.Common.roadworkGray+"|"+Nvt.MapTp.Common.roadworkColor+"|"+Nvt.MapTp.Common.roadworkLegend;
if(!this.booleanRoadworkButtonOn){this.modifyButton("Button2","NULL");this.modifyButton("Button2",this.roadworkValue);
this.booleanRoadworkButtonOn=true;}}else{if(A==Nvt.MapTp.Common.event){B[0]=Nvt.MapTp.Common.event;this.eventValue="3|Events|true|javascript:Nvt.MapTp.FilterControl.toggleEventButton.invokeEx(['${State}'])|_self|"+Nvt.MapTp.Common.eventColor+"|"+Nvt.MapTp.Common.eventColor+"|"+Nvt.MapTp.Common.eventGray+"|"+Nvt.MapTp.Common.eventColor+"|"+Nvt.MapTp.Common.eventLegend;
if(!this.booleanEventButtonOn){this.modifyButton("Button3","NULL");this.modifyButton("Button3",this.eventValue);
this.booleanEventButtonOn=true;}}}}this.showCategory(B);},popUpTrafficItem:function(A){this.trafficItemLoaderWrapper.popUpTrafficItem(A);
this.turnOnFilterButtonCategory(A.itemType);},refreshFlow:function(){this.mapTpUtil.controlComponent({Control:"SHOW",Component:"MRC",Properties:[new Map24.WebServices.Property({Key:"ReopenDMaps",Value:"US_TRAFFICDOTCOM_REALTIME_DMAP"})]});
this.mapTpUtil.execute({ConnectionType:"remote"});var A=this.updateMap.bind(this);window.setTimeout(function(){A();
},"1500");},refreshData:function(A){var B=new Date();var C=B.getHours()+":"+B.getMinutes()+":"+B.getSeconds();
if(this.refreshFlowEnabled==="true"&&A===true){Nvt.console.debug(C+" FilterControl: refresh flow");this.refreshFlow();
}this.booleanTrafficItemsLoaded=false;this.booleanCameraItemsLoaded=false;this.booleanForceRestLoad=true;
this.turnOnCategories();}};Nvt.MapTp.Common=new Object();Nvt.MapTp.Common.hostUrl="http://"+window.location.host+"/";
var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);Nvt.MapTp.Common.imageExtention=".png";
var imageServer=commonData.staticServerName;if(imageServer.indexOf("localhost")>-1){imageServer="http://istatic.traffic.com";
}Nvt.MapTp.Common.imagesUrl=imageServer+i18n.imagesPath;Nvt.MapTp.Common.imageIncidentUrl=i18n.imagesPath+i18n.imagesPathMapIcons;
Nvt.MapTp.Common.modalImageUrl=i18n.imagesPath+i18n.imagesPathModal;Nvt.MapTp.Common.cameraURL=Nvt.MapTp.Common.imageIncidentUrl+"icon_map_cam_rest"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.cameraDisableURL=Nvt.MapTp.Common.imageIncidentUrl+"icon_map_cam_over"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.APIVersion=commonData.mapTPAjaxVersion;Nvt.MapTp.Common.AppletCodeBase=commonData.mapTPCodeBase;
Nvt.MapTp.Common.camera="CAMERA";Nvt.MapTp.Common.incident="INCIDENT";Nvt.MapTp.Common.roadwork="CONSTRUCTION";
Nvt.MapTp.Common.event="EVENT";Nvt.MapTp.Common.masstransit="MASSTRANSIT";Nvt.MapTp.Common.roadhazzard="ROADHAZZARD";
Nvt.MapTp.Common.flow="FLOW";Nvt.MapTp.Common.incidentColor=commonData.staticServer("icon_leg_inc_rest")+Nvt.MapTp.Common.imageIncidentUrl+"icon_leg_inc_rest"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.incidentGray=commonData.staticServer("icon_leg_inc_over")+Nvt.MapTp.Common.imageIncidentUrl+"icon_leg_inc_over"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.incidentLegend=commonData.staticServer("icon_map_inc1_rest")+Nvt.MapTp.Common.imageIncidentUrl+"icon_map_inc1_rest"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.roadworkColor=commonData.staticServer("icon_leg_cons_rest")+Nvt.MapTp.Common.imageIncidentUrl+"icon_leg_cons_rest"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.roadworkGray=commonData.staticServer("icon_leg_cons_over")+Nvt.MapTp.Common.imageIncidentUrl+"icon_leg_cons_over"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.roadworkLegend=commonData.staticServer("icon_map_cons_rest")+Nvt.MapTp.Common.imageIncidentUrl+"icon_map_cons_rest"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.eventColor=commonData.staticServer("icon_leg_event_rest")+Nvt.MapTp.Common.imageIncidentUrl+"icon_leg_event_rest"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.eventGray=commonData.staticServer("icon_leg_event_over")+Nvt.MapTp.Common.imageIncidentUrl+"icon_leg_event_over"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.eventLegend=commonData.staticServer("icon_map_event_rest")+Nvt.MapTp.Common.imageIncidentUrl+"icon_map_event_rest"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.cameraColor=commonData.staticServer("icon_leg_cam_rest")+Nvt.MapTp.Common.imageIncidentUrl+"icon_leg_cam_rest"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.cameraGray=commonData.staticServer("icon_leg_cam_over")+Nvt.MapTp.Common.imageIncidentUrl+"icon_leg_cam_over"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.cameraLegend=commonData.staticServer("icon_map_cam_rest")+Nvt.MapTp.Common.imageIncidentUrl+"icon_map_cam_rest"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.flowColor=commonData.staticServer("icon_leg_flow_rest")+Nvt.MapTp.Common.imageIncidentUrl+"icon_leg_flow_rest"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.flowGray=commonData.staticServer("icon_leg_flow_over")+Nvt.MapTp.Common.imageIncidentUrl+"icon_leg_flow_over"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.Common.flowLegend=commonData.staticServer("icon_map_blank")+Nvt.MapTp.Common.imageIncidentUrl+"icon_map_blank"+Nvt.MapTp.Common.imageExtention;
Nvt.MapTp.RouteManager=Class.create();Nvt.MapTp.RouteManager.prototype={initialize:function(D,C,A){Nvt.console.debug(">RouteManager.initialize");
var B=Nvt.Util.getQueryParamValue("test");this.testMode=false;if(B==="true"){this.testMode=true;}if(!D&&!this.testMode){writeRoutingError();
return ;}this.numAddresses=2;this.routeManagerHtml=C;if(!this.testMode){this.trafficMap=D;this.mapTpUtil=D.mapTpUtil;
this.staticOnly=this.trafficMap.staticOnly;if(this.staticOnly){this.allowDragDropCallback=true;}}this.route1Info={};
this.route2Info={};this.routePrintInfo={};this.startAddress=new Nvt.MapTp.Address();this.startGeocodeAddress={};
this.endAddress=new Nvt.MapTp.Address();this.endGeocodeAddress={};this.metro=null;this.activeMetroId=-1;
this.routeNameTrafficBased="TrafficBased";this.routeNameDirect="Direct";this.resetRouteData();this.processCounter=0;
this.processList=[];this.summaries=[];this.commutes=[];this.dragDropEvents=[];this.contextMenuVisibility=false;
this.allowDragDropCallback=false;this.isProcessingMetricsFinished=false;this.isInitialLoad=false;this.isPrinting=false;
this.printDelimiters=["!","~","|"];this.finishedRoutingCallback=null;this.beginRoutingCallback=null;this.drawDirectionsCallback=null;
this.displayDebugRoutingInfoCallback=null;this.finishedDragDropCallback=null;this.finishedProcessingMetricsCallback=null;
this.finishedDrawRoutesCallback=null;this.printMapCallback=null;this.showRouteFlight=false;this.show3DView=false;
this.options="";this.boolDisplayDebugRoutingInfo=false;this.finishedRoutingCallback=this.routeManagerHtml.finishedRoutingCallback.bind(this.routeManagerHtml);
this.beginRoutingCallback=this.routeManagerHtml.beginRoutingCallback.bind(this.routeManagerHtml);this.drawDirectionsCallback=this.routeManagerHtml.drawDirectionsCallback.bind(this.routeManagerHtml);
this.displayDebugRoutingInfoCallback=this.routeManagerHtml.displayDebugRoutingInfoCallback.bind(this.routeManagerHtml);
this.finishedDragDropCallback=this.routeManagerHtml.finishedDragDropCallback.bind(this.routeManagerHtml);
this.printMapCallback=this.routeManagerHtml.printMapCallback.bind(this.routeManagerHtml);this.startAddressCallback=this.routeManagerHtml.startAddressCallback.bind(this.routeManagerHtml);
this.endAddressCallback=this.routeManagerHtml.endAddressCallback.bind(this.routeManagerHtml);if(A){this.options=A;
if(typeof this.options.boolDisplayDebugRoutingInfo!="undefined"){this.boolDisplayDebugRoutingInfo=this.options.boolDisplayDebugRoutingInfo;
}if(typeof this.options.showRouteFlight!="undefined"||this.options.showRouteFlight==null){this.showRouteFlight=this.options.showRouteFlight;
}if(typeof this.options.show3DView!="undefined"||this.options.show3DView==null){this.show3DView=this.options.show3DView;
}}nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.trafficMap.map.removeListener("Map24.Event.MapClick",[this,this.mapClickHandler]);
this.trafficMap=null;this.mapTpUtil=null;this.route1Info=null;this.route2Info=null;this.routePrintInfo=null;
this.startAddress=null;this.startGeocodeAddress=null;this.endAddress=null;this.endGeocodeAddress=null;
this.metro=null;this.processList=null;this.summaries=null;this.commutes=null;this.dragDropEvents=null;
this.finishedRoutingCallback=null;this.beginRoutingCallback=null;this.drawDirectionsCallback=null;this.displayDebugRoutingInfoCallback=null;
this.finishedDragDropCallback=null;this.finishedProcessingMetricsCallback=null;this.finishedDrawRoutesCallback=null;
this.printMapCallback=null;this.options=null;this.boolDisplayDebugRoutingInfo=false;},resetRouteData:function(){var A={};
A.mapObjectId="route1";A.activeStyles=new Nvt.MapTp.Styles(255,100,255,255);A.inactiveStyles=new Nvt.MapTp.Styles(255,100,255,200);
A.active=true;this.route1Info=new Nvt.MapTp.RouteInfo(A);this.route1Info.routeName=this.routeNameTrafficBased;
this.route1Info.routeId="route1";var A={};A.mapObjectId="route2";A.activeStyles=new Nvt.MapTp.Styles(100,100,255,255);
A.inactiveStyles=new Nvt.MapTp.Styles(100,100,255,200);A.active=false;this.route2Info=new Nvt.MapTp.RouteInfo(A);
this.route2Info.routeName=this.routeNameDirect;this.route2Info.routeId="route2";this.startAddress=new Nvt.MapTp.Address();
this.startGeocodeAddress={};this.endAddress=new Nvt.MapTp.Address();this.endGeocodeAddress={};},processRoutes:function(C,G,F,J){Nvt.console.debug(">RouteManager.processRoutes");
if(this.beginRoutingCallback){this.beginRoutingCallback();}if(this.testMode){this.testRouteManager();
return ;}this.activeMetroId=F;this.metro=this.trafficMap.metroLoaderWrapper.loadById(this.activeMetroId);
Nvt.console.debug("active metroId: "+this.activeMetroId);Nvt.console.debug("metro:");Nvt.console.debug(this.metro);
this.resetRouteData();var A=this.trafficMap.map;A.addListener("Map24.Event.MapClick",[this,this.mapClickHandler]);
this.startAddress.display=nQ.trim(C.display);this.startAddress.data=nQ.trim(C.data);this.endAddress.display=nQ.trim(G.display);
this.endAddress.data=nQ.trim(G.data);this.route1Info.startDisplay=this.startAddress.display;this.route2Info.startDisplay=this.startAddress.display;
this.route1Info.endDisplay=this.endAddress.display;this.route2Info.endDisplay=this.endAddress.display;
var D=0;var B=this.geocode.bind(this);var H=this.onGeocodeStart.bind(this);var E=this.onGeocodeEnd.bind(this);
var I=this.zoom.bind(this);if(!J){var J=null;}if(this.startAddress.display!=""){D++;}if(this.endAddress.display!=""){D++;
}switch(D){case 0:alert("Please enter an address.");break;case 1:if(this.startAddress!=""){B(this.startAddress,I,J);
}else{B(this.endAddress,I,J);}break;case 2:B(this.startAddress,H,J);}},onGeocodeStart:function(D,B){Nvt.console.debug(">RouteManager.onGeocodeStart");
Nvt.console.debug("geocodeResponses: ");Nvt.console.debug(D);var C=false;if((D&&D.length>0)&&(D[0].Quality==="Exact"||D.length<=this.numAddresses)){this.startGeocodeAddress=D[0];
C=true;}else{this.startGeocodeAddress=null;}var A=this.onGeocodeEnd.bind(this);this.startAddressCallback(D,this.startAddress.display,C);
this.geocode(this.endAddress,A,B);},onGeocodeEnd:function(C,A){Nvt.console.debug(">RouteManager.onGeocodeEnd");
Nvt.console.debug("geocodeResponses: ");Nvt.console.debug(C);var B=false;if((C&&C.length>0)&&(C[0].Quality==="Exact"||C.length<=this.numAddresses)){this.endGeocodeAddress=C[0];
B=true;}else{this.endGeocodeAddress=null;}this.endAddressCallback(C,this.endAddress.display,B);if(this.startGeocodeAddress!=null&&this.endGeocodeAddress!=null){this.beginCalculateRoutes();
}},zoom:function(D,B){Nvt.console.debug(">RouteManager.zoom");if(D.length<=this.numAddresses){var E=D[0].Coordinate;
var A=[];A.push(new Map24.WebServices.XMLCommandWrapper({SetMapView:new Map24.WebServices.SetMapView({Coordinates:[E],ClippingWidth:new Map24.WebServices.SetMapViewClippingWidth({MinimumWidth:25000,ViewPercentage:50})})}));
A.push(new Map24.WebServices.XMLCommandWrapper({DeclareMap24RouteObject:new Map24.WebServices.DeclareMap24RouteObject({MapObjectID:this.route1Info.mapObjectId,Map24RoutingServiceID:this.trafficMap.rsid})}));
A.push(new Map24.WebServices.XMLCommandWrapper({DeclareMap24RouteObject:new Map24.WebServices.DeclareMap24RouteObject({MapObjectID:this.route2Info.mapObjectId,Map24RoutingServiceID:this.trafficMap.rsid})}));
var C=this.trafficMap.localConnection;C.mapletRemoteControl(new Map24.WebServices.Message.mapletRemoteControlRequest({MapletRemoteControlRequest:new Map24.WebServices.MapletRemoteControlRequest({Map24MRC:new Map24.WebServices.Map24MRC({Commands:A})})}));
}if(B){if(typeof B.zoomCallback!="undefined"&&B.zoomCallback!=null){B.zoomCallback();}}},geocode:function(C,I,J){Nvt.console.debug(">RouteManager.geocode");
Nvt.console.debug("searchAddress: ");Nvt.console.debug(C);var D=C.data.split(Nvt.MapTp.RouteManager.delim);
Nvt.console.debug("array:");Nvt.console.debug(D);if(D.length>1){var H=Nvt.MapTp.RouteManager.getMapSearchAlternativeFromArray(D);
var A=[];A.push(H);if(typeof J=="undefined"){I(A);}else{I(A,J);}}else{var B=this.trafficMap.map.WebServices.openConnection();
B.onSuccess=function(){Nvt.console.debug("searchFree.onSuccess");var K=this.Response.getProperty("MapSearchResponse");
K.update(true);if(typeof J=="undefined"){I(K.Alternatives);}else{I(K.Alternatives,J);}};var G=C.display.toLowerCase();
var F=this.metro.metroName.toLowerCase();if(F.indexOf(G)>-1){C.display=this.metro.metroNameAndStateAbbr;
}var E=[];E.push(new Map24.WebServices.Property({Key:"COUNTRY",Value:"US"}));E.push(new Map24.WebServices.Property({Key:"LANGUAGE",Value:"EN"}));
B.searchFree(new Map24.WebServices.Message.searchFreeRequest({MapSearchFreeRequest:new Map24.WebServices.MapSearchFreeRequest({SearchText:C.display,MaxNoOfAlternatives:20,Properties:E})}));
}},initRoutePrint:function(){this.trafficMap.zoomToCurrentMetro();this.trafficMap.setHasMapViewChanged(false);
this.isPrinting=true;},beginCalculateRoutes:function(){Nvt.console.debug(">RouteManager.beginCalculateRoutes");
var B=this.startGeocodeAddress.Coordinate.Longitude;var A=this.startGeocodeAddress.Coordinate.Latitude;
this.calculateRouteMain(1);this.calculateRouteMain(2);},beginCalculateRouteForPrinting:function(A){this.parseRouteDataString(A);
this.calculateRouteForPrinting();},calculateRouteMain:function(B){Nvt.console.debug(">RouteManager.calculateRouteMain "+B);
var C=this.startGeocodeAddress.getProperty("Coordinate");var A=this.endGeocodeAddress.getProperty("Coordinate");
var D=this["onSuccessCalculateRoute"].bind(this);var E="route"+B;this.calculateRoute(C,A,E,D);},calculateRouteForPrinting:function(){Nvt.console.debug(">RouteManager.calculateRouteForPrinting");
var E=this.routePrintInfo;var D=E.startCoordinate;var A=E.endCoordinate;var F=E.routeId;var B=E.viaPoints;
if(D==null||A==null){return ;}this.metro=this.trafficMap.metroLoaderWrapper.loadById(this.activeMetroId);
var C=this.onSuccessRouteForPrinting.bind(this);this.calculateRoute(D,A,F,C,B);},calculateRoute:function(H,C,F,I,K,G){Nvt.console.debug(">RouteManager.calculateRoute");
if(G){I(null,null,null);return ;}var J="Fastest";var B="";if(typeof K=="undefined"||K==null){K=[];}var D=1;
if(F==="route1"){B="LONG_TERM_ROAD_CLOSURE,SHORT_TERM_ROAD_CLOSURE,CURRENT_TRAFFIC_US,FREEFLOW_TRAFFIC_US";
D=1;}else{B="LONG_TERM_ROAD_CLOSURE,SHORT_TERM_ROAD_CLOSURE,FREEFLOW_TRAFFIC_US";D=2;}Nvt.console.debug("routeId: "+F);
Nvt.console.debug("constraints: "+B);var E=[];if(B!=""){E=[new Map24.WebServices.Property({Key:"constraints",Value:B})];
}var A=this.trafficMap.map.WebServices.openConnection();A.calculateRoute(new Map24.WebServices.Message.calculateRouteRequest({CalculateRouteRequest:new Map24.WebServices.CalculateRouteRequest({Start:new Map24.WebServices.CoordinateAndAddress({Coordinate:H}),Destination:new Map24.WebServices.CoordinateAndAddress({Coordinate:C}),ViaPoints:K,Properties:E,DescriptionLanguage:"en_US",CalculationMode:J,ReturnRouteChain:true,IgnoreWaypoints:false,IgnoreDescription:false,LoadTMCs:true,RoutingServiceID:"dev/namerica/routing"})}));
A.onSuccess=function(L,M,N){I(L,M,N,D);};},onSuccessCalculateRoute:function(C,E,F,D){Nvt.console.debug(">RouteManager.onSuccessCalculateRoute"+D);
if(F!=null){var B=F.getProperty("CalculateRouteResponse");Nvt.console.debug("response:");Nvt.console.debug(B);
var A=B.getProperty("Route");this.assignRouteResults("route"+D,A);Nvt.console.debug(this["route"+D+"Info"]);
}this.processCalculateRouteResults(true);},onSuccessRouteForPrinting:function(C,D,E){Nvt.console.debug(">RouteManager.onSuccessRouteForPrinting");
var B=E.getProperty("CalculateRouteResponse");var A=B.getProperty("Route");var F=this.routePrintInfo.routeId;
this.assignRouteResults(F,A);this.drawPrintRoute(true);},assignRouteResults:function(D,A){Nvt.console.debug(">RouteManager.assignRouteResults: "+D);
var B={};B=this.getRouteInfo(D);B.map24RouteId=A.getProperty("RouteID");B.route=A;var C=B.route.getProperty("RouteChain");
B.edgeIds=C;if(D==="route1"){B.lengthMeterTrafficBased=A.getProperty("TotalLength");B.timeSecTrafficBased=A.getProperty("TotalTime");
}else{B.lengthMeterAtSpeedLimit=A.getProperty("TotalLength");B.timeSecAtSpeedLimit=A.getProperty("TotalTime");
}},processCalculateRouteResults:function(B){Nvt.console.debug(">RouteManager.processCalculateRouteResults");
if(this.route1Info.route==null||this.route2Info.route==null){return ;}var E={};var D={};if(this.route1Info.active){E=this.route1Info;
D=this.route2Info;}else{E=this.route2Info;D=this.route1Info;}var C={};C.zoomToView=B;this.drawRoutes(E,D,C);
Nvt.console.time("areRouteGeometriesIdentical");var A=this.areRouteGeometriesIdentical();Nvt.console.timeEnd("areRouteGeometriesIdentical");
if(A){this.setupProcessingMetrics("identical");}else{this.setupProcessingMetrics("both");}this.beginProcessingMetrics();
},areRouteGeometriesIdentical:function(){if(this.route1Info.edgeIds&&this.route2Info.edgeIds){var B=new String(this.route1Info.edgeIds);
var A=new String(this.route2Info.edgeIds);var E=B.split(",");var D=A.split(",");if(E.length==D.length){for(var C=0;
C<E.length;C++){var G=E[C];var F=D[C];if(G!=F){Nvt.console.debug(">RouteManager.areRouteGeometriesIdentical: false");
return false;}}this.route2Info.lengthMeterTrafficBased=this.route1Info.lengthMeterTrafficBased;this.route2Info.timeSecTrafficBased=this.route1Info.timeSecTrafficBased;
this.route1Info.lengthMeterAtSpeedLimit=this.route2Info.lengthMeterAtSpeedLimit;this.route1Info.timeSecAtSpeedLimit=this.route2Info.timeSecAtSpeedLimit;
Nvt.console.debug(">RouteManager.areRouteGeometriesIdentical: true");return true;}}Nvt.console.debug(">RouteManager.areRouteGeometriesIdentical: false");
return false;},drawPrintRoute:function(A){var B={};B.zoomToView=A;var C=this.routePrintInfo.routeId;this.drawRoutes(this.routePrintInfo,null,B);
this.setupProcessingMetrics(C);this.beginProcessingMetrics();},activateRoute:function(A){Nvt.console.debug(">RouteManager.activateRoute"+A);
var C=2;if(A==2){C=1;}var B={};B.writeHtml=false;B.zoomToView=false;this.allowDragDropCallback=this.staticOnly;
this.drawRoutes(this["route"+A+"Info"],this["route"+C+"Info"],B);},drawRoutes:function(K,B,N){Nvt.console.debug(">RouteManager.drawRoutes");
if(null==K&&null==B){return ;}var J=true;if(N!=null){J=N.zoomToView;}var M=K.route;var E=null;var A=K.activeStyles;
var I=null;K.active=true;if(B!=null){B.active=false;E=B.route;I=B.inactiveStyles;}Nvt.MapTp.RouteManager.dragDropCallback=new Map24.Callable(this,this.dragDropCallback);
var F=this.staticOnly?K.getActiveStrokePaintRules():K.getActiveStrokePaintRulesForApplet();var G=Nvt.Util.getQueryParamValue("macdebug");
if(G=="true"){F=[];}var C=[];if(E!=null){var L=this.staticOnly?B.getInactiveStrokePaintRules():B.getInactiveStrokePaintRulesForApplet();
if(G=="true"){L=[];}C.push(new Map24.WebServices.XMLCommandWrapper({DeclareMap24RouteObject:new Map24.WebServices.DeclareMap24RouteObject({MapObjectID:B.mapObjectId,Map24RouteID:E.getProperty("RouteID"),Map24RoutingServiceID:this.trafficMap.rsid,Color:new Map24.WebServices.Color({red:I.red,green:I.green,blue:I.blue,alpha:I.alpha}),StrokePaintRules:L})}));
}C.push(new Map24.WebServices.XMLCommandWrapper({DeclareMap24RouteObject:new Map24.WebServices.DeclareMap24RouteObject({MapObjectID:K.mapObjectId,Map24RouteID:M.getProperty("RouteID"),Map24RoutingServiceID:this.trafficMap.rsid,Color:new Map24.WebServices.Color({red:A.red,green:A.green,blue:A.blue,alpha:A.alpha}),StrokePaintRules:F,Customize:new Map24.WebServices.MapObjectCustomSettings({Handler:"MAP24_ROUTE_DIGITIZER",Properties:[new Map24.WebServices.Property({Key:"CALLBACK_URL",Value:"javascript:Nvt.MapTp.RouteManager.dragDropCallback.invokeEx([ '${EVENTID}', '${ROUTEID}' ]);"}),new Map24.WebServices.Property({Key:"CALLBACK_TARGET",Value:"_self"}),new Map24.WebServices.Property({Key:"startLogoURL",Value:commonData.staticServer("pointA.gif")+Nvt.MapTp.Common.imageIncidentUrl+"pointA.gif#hotspot=9,50"}),new Map24.WebServices.Property({Key:"viaLogoURL",Value:commonData.staticServer("waypoint.gif")+Nvt.MapTp.Common.imageIncidentUrl+"waypoint.gif"}),new Map24.WebServices.Property({Key:"destLogoURL",Value:commonData.staticServer("pointB.gif")+Nvt.MapTp.Common.imageIncidentUrl+"pointB.gif#hotspot=9,50"})]})})}));
if(this.show3DView){C.push(new Map24.WebServices.XMLCommandWrapper({ControlComponent:new Map24.WebServices.ControlComponent({Component:"M3D",Control:"SHOW"})}),new Map24.WebServices.XMLCommandWrapper({ControlComponent:new Map24.WebServices.ControlComponent({Component:"SHOWM3D",Control:"SHOW"})}));
}if(this.showRouteFlight){C.push(new Map24.WebServices.XMLCommandWrapper({ControlComponent:new Map24.WebServices.ControlComponent({Component:"M3DROUTE",Control:"SHOW"})}),new Map24.WebServices.XMLCommandWrapper({ControlComponent:new Map24.WebServices.ControlComponent({Component:"SHOWM3DROUTE",Control:"SHOW"})}));
}var H=[];if(E!=null){H.push(B.mapObjectId);}H.push(K.mapObjectId);C.push(new Map24.WebServices.XMLCommandWrapper({ControlMapObject:new Map24.WebServices.ControlMapObject({MapObjectIDs:H,Control:"ENABLE"})}));
if(J){C.push(new Map24.WebServices.XMLCommandWrapper({SetMapView:new Map24.WebServices.SetMapView({MapObjectIDs:[K.mapObjectId],ClippingWidth:new Map24.WebServices.SetMapViewClippingWidth({MinimumWidth:2500,ViewPercentage:95})})}));
}var D=this.trafficMap.localConnection;D.mapletRemoteControl(new Map24.WebServices.Message.mapletRemoteControlRequest({MapletRemoteControlRequest:new Map24.WebServices.MapletRemoteControlRequest({Map24MRC:new Map24.WebServices.Map24MRC({Commands:C})})}));
this.finishedDrawRoutes();if(this.isPrinting){this.printMap();}},finishedDrawRoutes:function(){if(this.finishedDrawRoutesCallback==null){return ;
}this.finishedDrawRoutesCallback();},printMap:function(){Nvt.console.debug(">RouteManager.printMap");
Nvt.console.debug("routePrintInfo:");Nvt.console.debug(this.routePrintInfo);var D=726;var A=450;if(this.printMapCallback==null){return ;
}var C=this.trafficMap.hasMapViewChanged;var F="";var E=this.printMapCallback.bind(this);var G=this.trafficMap;
function B(){C=G.hasMapViewChanged;if(C){clearInterval(F);G.printMap(D,A,E);}}if(C){G.printMap(D,A,E);
}else{F=setInterval(B,1000);}},setupProcessingMetrics:function(E){Nvt.console.debug(">RouteManager.setupProcessingMetrics: "+E);
var D=this.processCommuteSummaryForRoute.bind(this,1);var B=this.processCommuteSummaryForRoute.bind(this,2);
var A=this.processCalculateLengthTimeForRoute.bind(this,1);var H=this.processCalculateLengthTimeForRoute.bind(this,2);
var G=this.finishedProcessingMetrics.bind(this);var C=this.copyCommuteSummary.bind(this,1,2);this.isProcessingMetricsFinished=false;
this.processList=[];if(E==="both"){this.processDirections([this.route1Info,this.route2Info]);this.processList=[A,H];
if(this.metro!=null){this.processList.push(D,B);}}else{if(E==="route1"){this.processDirections([this.route1Info]);
this.processList=[A];if(this.metro!=null){this.processList.push(D);}}else{if(E==="route2"){this.processDirections([this.route2Info]);
this.processList=[H];if(this.metro!=null){this.processList.push(B);}}else{if(E==="identical"){this.processDirections([this.route1Info,this.route2Info]);
if(this.metro!=null){this.processList.push(D,C);}}}}}this.processList.push(G);Nvt.console.debug("this.processList.length: "+this.processList.length);
var F=this.writeHtml.bind(this);this.processList.push(F);},finishedProcessingMetrics:function(){Nvt.console.debug(">RouteManager.finishedProcessingMetrics");
Nvt.console.debug("route1Info: ");Nvt.console.debug(this.route1Info);Nvt.console.debug("route2Info: ");
Nvt.console.debug(this.route2Info);this.isProcessingMetricsFinished=true;if(this.finishedProcessingMetricsCallback!=null){this.finishedProcessingMetricsCallback();
}this.processCounter++;if(this.processCounter<this.processList.length){this.processList[this.processCounter]();
}},processDirections:function(E){for(var C=0;C<E.length;C++){var J=E[C].route;var I=J.getProperty("Segments");
var G=[];for(var B=0;B<I.length;B++){var F=I[B].getProperty("Descriptions");var D=F[0].getProperty("Text").replace(/(\[|\[\/)[0-9A-Z_]+\]/g,"");
var A=Nvt.MapTp.RouteManagerHtmlBase.convertMeter(I[B].SegmentLength);var H=new Nvt.MapTp.Direction(D,A);
G.push(H);}E[C].directions=G;}},beginProcessingMetrics:function(){Nvt.console.debug(">RouteManager.beginProcessingMetrics");
Nvt.console.debug("this.processList.length: "+this.processList.length);this.processCounter=0;this.processList[this.processCounter]();
},processCommuteSummaryForRoute:function(A){Nvt.console.debug(">RouteManager.processCommuteSummaryForRoute: "+A);
var B=this["onSuccessProcessCommuteSummaryForRoute"].bind(this);this.processCommuteSummary(this["route"+A+"Info"],A,B,B);
},onSuccessProcessCommuteSummaryForRoute:function(C,B){Nvt.console.debug(">RouteManager.onSuccessProcessCommuteSummaryForRoute "+B);
if(typeof C!="undefined"&&C!=null&&C.length>0){if(typeof C[0].commuteSummary!="undefined"&&C[0].commuteSummary!=null){var A=C[0].commuteSummary.commuteSegmentSummaryList;
}else{var A=[];}this["route"+B+"Info"].commuteSegmentSummaryList=A;this["route"+B+"Info"].reportSummary=C[0].reportSummary;
var D=C[0].serializedCommute;this.commutes[this["route"+B+"Info"].routeName]=D;this["route"+B+"Info"].serializedCommute=D;
}this.processCounter++;if(this.processCounter<this.processList.length){this.processList[this.processCounter]();
}},copyCommuteSummary:function(B,A){Nvt.console.debug(">RouteManager.copyCommuteSummary "+B+" "+A);this["route"+A+"Info"].commuteSegmentSummaryList=this["route"+B+"Info"].commuteSegmentSummaryList;
this["route"+A+"Info"].reportSummary=this["route"+B+"Info"].reportSummary;this["route"+A+"Info"].serializedCommute=this["route"+B+"Info"].serializedCommute;
this.processCounter++;if(this.processCounter<this.processList.length){this.processList[this.processCounter]();
}},processCalculateLengthTimeForRoute:function(A){Nvt.console.debug(">RouteManager.processCalculateLengthTimeForRoute "+A);
var C=this["route"+A+"Info"].route.getProperty("RouteChain");this["route"+A+"Info"].edgeIds=C;var B=this.onSuccessCalculateLengthTimeForRoute.bind(this);
this.calculateLengthTime(C,B,"route"+A);},onSuccessCalculateLengthTimeForRoute:function(A,B){Nvt.console.debug(">RouteManager.onSuccessCalculateLengthTimeForRoute"+B);
Nvt.console.debug("calculateRouteTimeResponse:");Nvt.console.debug(A);if(B===1){this["route"+B+"Info"].lengthMeterAtSpeedLimit=A.getProperty("RouteLength");
this["route"+B+"Info"].timeSecAtSpeedLimit=A.getProperty("RouteTime");}else{this["route"+B+"Info"].lengthMeterTrafficBased=A.getProperty("RouteLength");
this["route"+B+"Info"].timeSecTrafficBased=A.getProperty("RouteTime");}Nvt.console.debug(this["route"+B+"Info"]);
this.processCounter++;if(this.processCounter<this.processList.length){this.processList[this.processCounter]();
}},calculateLengthTime:function(E,D,G){Nvt.console.debug(">RouteManager.calculateLengthTime");Nvt.console.debug("routeId: "+G);
var F=[];var B=1;var A="";if(G==="route1"){F=["LONG_TERM_ROAD_CLOSURE","SHORT_TERM_ROAD_CLOSURE","FREEFLOW_TRAFFIC_US"];
B=1;}else{F=["LONG_TERM_ROAD_CLOSURE","SHORT_TERM_ROAD_CLOSURE","CURRENT_TRAFFIC_US","FREEFLOW_TRAFFIC_US"];
B=2;}A=this["route"+B+"Info"].map24RouteId;Nvt.console.debug("map24RouteId: "+A);Nvt.console.debug("constraints: "+F);
Nvt.console.debug("edgeIds: "+E);var C=this.trafficMap.map.WebServices.openConnection();C.calculateRouteTime(new Map24.WebServices.Message.calculateRouteTimeRequest({CalculateRouteTimeRequest:new Map24.WebServices.CalculateRouteTimeRequest({RouteChain:E,RoutingServiceID:"dev/namerica/routing",RouteConstraintNames:F})}));
C.onSuccess=function(){var H=arguments[2].getProperty("CalculateRouteTimeResponse");D(H,B);};},dragDropCallback:function(C,D){Nvt.console.debug(">RouteManager.dragDropCallback");
Nvt.console.debug("eventId: "+C);this.dragDropEvents.push(C);if(C!=5){return ;}var B=this.dragDropEvents.length-1;
if(!this.trafficMap.staticOnly){if(!(this.dragDropEvents[B]==5&&this.dragDropEvents[B-1]==6&&this.dragDropEvents[B-2]==2)){return ;
}}this.dragDropEvents=[];var A={};if(this.route1Info.active){A=this.route1Info;}else{A=this.route2Info;
}this.updateRoute(A);},updateRoute:function(B){Nvt.console.debug(">RouteManager.updateRoute");var C="";
var A=this.trafficMap.map.Session.MapObjects[B.mapObjectId].getDescription().Route;B.route=A;if(B.routeName===this.routeNameTrafficBased){B.timeSecTrafficBased=A.TotalTime;
B.lengthMeterTrafficBased=A.TotalLength;C="route1";this.setupProcessingMetrics(C);this.beginProcessingMetrics();
}else{C="route2";B.timeSecAtSpeedLimit=A.TotalTime;B.lengthMeterAtSpeedLimit=A.TotalLength;this.setupProcessingMetrics(C);
this.beginProcessingMetrics();}if(this.finishedDragDropCallback!=null){this.finishedDragDropCallback(C);
}},writeHtml:function(){Nvt.console.debug(">RouteManager.writeHtml");this.drawDirectionsCallback([this.route1Info,this.route2Info,this.routePrintInfo],this.metro);
},processCommuteSummary:function(D,H,N,L){Nvt.console.debug(">RouteManager.processCommuteSummary");if(this.isPrinting){N(null);
}var E="";var B="/routing/controller/buildCommuteFromTMCs";var K=0;var G=D.route.getProperty("TMCLinks");
var O=nQ.trim(this.getTmcs(G));D.tmcs=O;var A=this.startGeocodeAddress.Coordinate.Longitude;var J=this.startGeocodeAddress.Coordinate.Latitude;
var M=new Nvt.Data.Coordinate();M.setCoordsInMinutes(J,A);this.metro=this.trafficMap.metroLoaderWrapper.getMetroForGeoPoint(M);
K=this.metro.metroId;var F=function(P){N(P,H);};var C=function(P){L(P,H);};if(O.length>0){try{nQ.ajax({type:"POST",url:B,data:{metroId:K,tmclist:O},dataType:"json",success:F,error:C});
}catch(I){Nvt.console.debug(I);}}else{N(null);}},cleanUrl:function(C){var A=2048;var D=C;var B=D.lastIndexOf(",");
while(B>A){D=D.substr(0,B);B=D.lastIndexOf(",");}D=C.substr(0,B);return D;},getTmcs:function(E){var A="";
for(var D=0;D<E.length;D++){var H=E[D].TMCCode;var G=E[D].EntryPointPos;var C=E[D].ExitPointPos;var F=E[D].TotalTMCLength;
var B=H+"|"+G+"|"+C+"|"+F;if(D<E.length-1){B+=",";}A+=B;}return A;},mapClickHandler:function(G){Nvt.console.debug(">RouteManager.mapClickHandler");
Nvt.console.debug(G);Nvt.MapTp.RouteManager.hideContextMenu=new Map24.Callable(this,this.hideContextMenu);
Nvt.MapTp.RouteManager.removeWaypoint=new Map24.Callable(this,this.removeWaypoint);Nvt.MapTp.RouteManager.setMapView=new Map24.Callable(this,this.setMapView);
var D="<div style='border: 0px; text-align: left; background-color: #f0f0ea'>";var M="</div>";if(G.TopDown){return true;
}this.hideContextMenu();if(G.Button==G.RIGHT_BUTTON){var K=G.ObjectStack[0];if(this.trafficMap.map.Session.MapObjects[K.TargetId] instanceof Map24.Session.Route){var E=null;
var J=null;var L=null;var H=null;var F="";var N=null;H=K.TargetId;N=K.TargetMap.toString().split("-");
if(K.TargetType.toLowerCase()=="routewaypoint"){J=this.trafficMap.map.Session.MapObjects[K.TargetId].getDescription();
L=J.Waypoints;E=parseInt(N[0]);if(E==0){}else{if(E==(L.length-1)){}else{var O=G.MapClient.MapView.getWidth(true);
var B=O*1.7;var C=O*5;O*=3;var I=G.Coordinate.Latitude;var A=G.Coordinate.Longitude;F=D+"<a href=\"javascript: Nvt.MapTp.RouteManager.removeWaypoint.invokeEx(['"+H+"', '"+E+"']); Nvt.MapTp.RouteManager.hideContextMenu.invokeEx();\" target='_self' alt='"+i18n.removeWaypoint+"' title='"+i18n.removeWaypoint+"'> "+i18n.removeWaypoint+"</a>"+"<br/><a href=\"javascript: Nvt.MapTp.RouteManager.setMapView.invokeEx(['"+A+"', '"+I+"', '"+B+"']); Nvt.MapTp.RouteManager.hideContextMenu.invokeEx();\" target='_self' alt='"+i18n.zoomIn+"' title='"+i18n.zoomIn+"'> "+i18n.zoomIn+"</a>"+"<br/><a href=\"javascript: Nvt.MapTp.RouteManager.setMapView.invokeEx(['"+A+"', '"+I+"', '"+C+"']); Nvt.MapTp.RouteManager.hideContextMenu.invokeEx();\" target='_self' alt='"+i18n.zoomOut+"' title='"+i18n.zoomOut+"'>"+i18n.zoomOut+"</a>"+"<br/><a href=\"javascript: Nvt.MapTp.RouteManager.setMapView.invokeEx(['"+A+"', '"+I+"', '"+O+"']); Nvt.MapTp.RouteManager.hideContextMenu.invokeEx();\" target='_self' alt='"+i18n.centerMap+"' title='"+i18n.centerMap+"'>"+i18n.centerMap+"</a>"+M;
this.showContextMenu(A,I,F);}}}}}},setMapView:function(E,C,D){Nvt.console.debug(">RouteManager.setMapView");
Nvt.console.debug(E+", "+C+", "+D);var A=[];A.push(new Map24.WebServices.XMLCommandWrapper({SetMapView:new Map24.WebServices.SetMapView({Coordinates:[new Map24.WebServices.Coordinate({Longitude:E,Latitude:C})],ClippingWidth:new Map24.WebServices.SetMapViewClippingWidth({MinimumWidth:D,ViewPercentage:100})})}));
var B=this.trafficMap.localConnection;B.mapletRemoteControl(new Map24.WebServices.Message.mapletRemoteControlRequest({MapletRemoteControlRequest:new Map24.WebServices.MapletRemoteControlRequest({Map24MRC:new Map24.WebServices.Map24MRC({Commands:A})})}));
},removeWaypoint:function(B,A){Nvt.console.debug(">RouteManager.removeWaypoint");Nvt.console.debug("waypointIndex: "+A);
this.trafficMap.map.Session.MapObjects[B].removeWaypoint(A);},hideContextMenu:function(){if(this.contextMenuVisibility==false){return ;
}var A=[new Map24.WebServices.XMLCommandWrapper({ControlMapObject:new Map24.WebServices.ControlMapObject({Control:"DISABLE",MapObjectIDs:["_ctxMenu"]})})];
var B=this.trafficMap.localConnection;B.mapletRemoteControl(new Map24.WebServices.Message.mapletRemoteControlRequest({MapletRemoteControlRequest:new Map24.WebServices.MapletRemoteControlRequest({Map24MRC:new Map24.WebServices.Map24MRC({Commands:A})})}));
this.contextMenuVisibility=false;},showContextMenu:function(E,D,B){var A=[new Map24.WebServices.XMLCommandWrapper({DeclareMap24HTMLObject:new Map24.WebServices.DeclareMap24HTMLObject({MapObjectID:"_ctxMenu",Coordinate:new Map24.WebServices.Coordinate({Longitude:E,Latitude:D}),Orientation:new Map24.WebServices.MapObjectOrientation({Horizontal:"RIGHT",Vertical:"BOTTOM",HOffset:10,VOffset:10}),HTML:B})}),new Map24.WebServices.XMLCommandWrapper({ControlMapObject:new Map24.WebServices.ControlMapObject({Control:"ENABLE",MapObjectIDs:["_ctxMenu"]})})];
var C=this.trafficMap.localConnection;C.mapletRemoteControl(new Map24.WebServices.Message.mapletRemoteControlRequest({MapletRemoteControlRequest:new Map24.WebServices.MapletRemoteControlRequest({Map24MRC:new Map24.WebServices.Map24MRC({Commands:A})})}));
this.contextMenuVisibility=true;},getRouteInfo:function(A){return this[A+"Info"];},getRouteDataString:function(N){var D=this.printDelimiters;
var O=D[0];var S=D[1];var Q=D[2];var F="";var E={};var K={};var J={};var H={};E=this.getRouteInfo(N);
var C="";var A="";var R="";var P="";var L="";var I="";var G="";K=this.startGeocodeAddress.getProperty("Coordinate");
C=this.compareCoordinates(E.route.Start,K)?this.startAddress.display:"Lat"+K.Latitude+" Lon"+K.Longitude;
K=this.endGeocodeAddress.getProperty("Coordinate");A=this.compareCoordinates(E.route.Destination,K)?this.endAddress.display:"Lat"+K.Latitude+" Lon"+K.Longitude;
J=E.route.Start;R=J.getProperty("Latitude");P=J.getProperty("Longitude");H=E.route.Destination;L=H.getProperty("Latitude");
I=H.getProperty("Longitude");G=this.activeMetroId;F="";F+=N+O;F+=C+O+A+O;F+=R+O+P+O;F+=L+O+I+O;F+=G+O;
var B=E.route.Vias;for(var M=0;M<B.length;M++){F+=B[M].Latitude+Q+B[M].Longitude;if(M<B.length-1){F+=S;
}}return F;},parseRouteDataString:function(A){A=decodeURI(A);var I=this.printDelimiters;var R=I[0];var W=I[1];
var U=I[2];var K=A.split(R);var Q=K[0];var E=K[1];var D=K[2];var V=K[3];var T=K[4];var N=K[5];var M=K[6];
var L=K[7];var G=K[8];var B=[];if(G!=""){var P=G.split(W);for(var O=0;O<P.length;O++){var F=P[O].split(U);
var H=F[0];var C=F[1];var S=new Map24.WebServices.Coordinate({Latitude:H,Longitude:C});B.push(new Map24.WebServices.CalculateRouteRequestViaPoint({Coordinate:S}));
}}var J=this.getRouteInfo(Q);J.startCoordinate=new Map24.WebServices.Coordinate({Latitude:V,Longitude:T});
J.endCoordinate=new Map24.WebServices.Coordinate({Latitude:N,Longitude:M});J.viaPoints=B;J.startDisplay=E;
J.endDisplay=D;this.routePrintInfo=J;this.activeMetroId=L;this.startGeocodeAddress={};this.startGeocodeAddress.Coordinate={};
this.startGeocodeAddress.Coordinate.Longitude=T;this.startGeocodeAddress.Coordinate.Latitude=V;},compareCoordinates:function(C,B){var A=0.1;
if(Math.abs(C.Latitude-B.Latitude)>0.1){return false;}if(Math.abs(B.Longitude-B.Longitude)>0.1){return false;
}return true;},testRouteManager:function(){Nvt.console.debug("testRouteManager");this.route1Info={"edgeIds":"16071462,16540220,16071012,16071010,16071009,16070989,16070983,16070982,16070952,16070947,16070888,1...","lengthMeterAtSpeedLimit":20875,"lengthMeterTrafficBased":20974,"map24RouteId":"WHUYEESJR3_RNA_NT_PRD_2_14_44_11_FASTA3F3_FTFETFT1.0ComVecpTrn_v3CoCtyVehtSTab3_nReg","mapObjectId":"route1","processMetrics":false,"routeName":"TrafficBased","timeSecAtSpeedLimit":1117,"timeSecTrafficBased":1172};
this.route1Info.routeName=this.routeNameTrafficBased;this.route1Info.routeId="route1";this.route1Info.commuteSegmentSummaryList=[];
this.route1Info.commuteSegmentSummaryList[0]={"avgSpeed":"54","delay":"0","desc":"I-476 Blue Route from Germantown Pk W. (#20) to St. Davids/Villanova (#13)","distance":"6.858751225155636","endPointName":"St. Davids/Villanova (#13)","freeFlowTravelTime":"7","incidentList":[],"isDefinedDigital":true,"isDigital":true,"isValid":true,"jamFactor":"0.9","jamFactorTrend":"0.28107677306454804","jamFactorTrendStyle":"WorseLevel1","lowerRightLat":40.03366,"lowerRightLon":-75.28871,"roadName":"I-476 Blue Route","segmentId":null,"segmentName":"Segment1","shieldText":"476","shieldText2":null,"shieldType":"interstate","slowestMPH":"49.42801428608879","slowestPointName":"The slowest point on this drive is located on I-476 Blue Route from I-76 Schuylkill Exwy (#16) to St...","startPointName":"Germantown Pk W. (#20) ","travelTime":"7","upperLeftLat":40.10607,"upperLeftLon":-75.36056};
this.route1Info.commuteSegmentSummaryList[1]={"avgSpeed":"54","delay":"0","desc":"I-476 Blue Route from Germantown Pk W. (#20) to St. Davids/Villanova (#13)","distance":"6.858751225155636","endPointName":"St. Davids/Villanova (#13)","freeFlowTravelTime":"7","incidentList":[],"isDefinedDigital":true,"isDigital":true,"isValid":true,"jamFactor":"0.9","jamFactorTrend":"0.28107677306454804","jamFactorTrendStyle":"WorseLevel1","lowerRightLat":40.03366,"lowerRightLon":-75.28871,"roadName":"I-476 Blue Route","segmentId":null,"segmentName":"Segment1","shieldText":"476","shieldText2":null,"shieldType":"interstate","slowestMPH":"49.42801428608879","slowestPointName":"The slowest point on this drive is located on I-476 Blue Route from I-76 Schuylkill Exwy (#16) to St...","startPointName":"Germantown Pk W. (#20) ","travelTime":"7","upperLeftLat":40.10607,"upperLeftLon":-75.36056};
this.route1Info.commuteSegmentSummaryList[2]={"avgSpeed":"54","delay":"10","desc":"I-476 Blue Route from Germantown Pk W. (#20) to St. Davids/Villanova (#13)","distance":"6.858751225155636","endPointName":"St. Davids/Villanova (#13)","freeFlowTravelTime":"17","incidentList":[{"class":"com.traffic.app.mytraffic.po.Incident","commuteSegmentSummaryParent":null,"incidentAbbreviationShortDescription":"ACC","incidentCriticality":"2","incidentDesc":" at Marsh Rd - accident on the shoulder - 4 vehicles","incidentIcon":"images/incident_icons/accident2.gif","incidentSeverity":"Moderate","incidentType":"ACCIDENT"},{"class":"com.traffic.app.mytraffic.po.Incident","commuteSegmentSummaryParent":null,"incidentAbbreviationShortDescription":"ACC","incidentCriticality":"2","incidentDesc":" at Marsh Rd - accident on the shoulder - 4 vehicles","incidentIcon":"images/incident_icons/accident2.gif","incidentSeverity":"Moderate","incidentType":"ACCIDENT"},{"class":"com.traffic.app.mytraffic.po.Incident","commuteSegmentSummaryParent":null,"incidentAbbreviationShortDescription":"ACC","incidentCriticality":"2","incidentDesc":" at Marsh Rd - accident on the shoulder - 4 vehicles","incidentIcon":"images/incident_icons/accident2.gif","incidentSeverity":"Moderate","incidentType":"ACCIDENT"}],"isDefinedDigital":true,"isDigital":true,"isValid":true,"jamFactor":"0.9","jamFactorTrend":"0.28107677306454804","jamFactorTrendStyle":"WorseLevel1","lowerRightLat":40.03366,"lowerRightLon":-75.28871,"roadName":"I-476 Blue Route","segmentId":null,"segmentName":"Segment1","shieldText":"476","shieldText2":null,"shieldType":"interstate","slowestMPH":"49.42801428608879","slowestPointName":"The slowest point on this drive is located on I-476 Blue Route from I-76 Schuylkill Exwy (#16) to St...","startPointName":"Germantown Pk W. (#20) ","travelTime":"7","upperLeftLat":40.10607,"upperLeftLon":-75.36056};
this.route1Info.directions=[{"distance":"1.7","text":"You start at the Penllyn Blue Bell Pike and head towards E Township Line Rd for 1.7 miles."},{"distance":"1.7","text":"You start at the Penllyn Blue Bell Pike and head towards E Township Line Rd for 1.7 miles."},{"distance":"1.7","text":"You start at the Penllyn Blue Bell Pike and head towards E Township Line Rd for 1.7 miles."},{"distance":"1.7","text":"You start at the Penllyn Blue Bell Pike and head towards E Township Line Rd for 1.7 miles."},{"distance":"1.7","text":"You start at the Penllyn Blue Bell Pike and head towards E Township Line Rd for 1.7 miles."}];
this.route1Info.startDisplay="12345 Starting Here Drive";this.route1Info.endDisplay="12345 Ending Here Drive";
this.route1Info.serializedCommute="rO0ABXNyACNjb20udHJhZmZpYy5zZXJ2aWNlLmNvbW11dGUuQ29tbXV0ZejqFWGZiuFIAgAGTAAP%0AbV9jQ29tbXV0ZU5hbWVzdAAQTGphdmEvdXRpbC9MaXN0O0wAEm1fY0NvbW11dGVTZWdtZW50c3QA%0AEExqYXZhL3V0aWwvTGlzdDtMAAxtX2lDb21tdXRlSWR0ABNMamF2YS9sYW5nL0ludGVnZXI7TAAK%0AbV9pTWV0cm9JZHQAE0xqYXZhL2xhbmcvSW50ZWdlcjtMABBtX3N0ckNvbW11dGVEZXNjdAASTGph%0AdmEvbGFuZy9TdHJpbmc7TAAUbV9zdHJDb21tdXRlVHlwZURlc2N0ABJMamF2YS9sYW5nL1N0cmlu%0AZzt4cHNyABNqYXZhLnV0aWwuQXJyYXlMaXN0eIHSHZnHYZ0DAAFJAARzaXpleHAAAAABdwQAAAAK%0Ac3IAJ2NvbS50cmFmZmljLnNlcnZpY2UuY29tbXV0ZS5Db21tdXRlTmFtZbvwQLBhLNbaAgADTAAW%0AbV9pQ29tbXV0ZU5hbWVTb3J0Q29kZXQAE0xqYXZhL2xhbmcvSW50ZWdlcjtMABBtX3N0ckNvbW11%0AdGVOYW1ldAASTGphdmEvbGFuZy9TdHJpbmc7TAAYbV9zdHJDb21tdXRlTmFtZVR5cGVEZXNjdAAS%0ATGphdmEvbGFuZy9TdHJpbmc7eHBwdAAPRHluYW1pYyBDb21tdXRlcHhzcQB%2BAAgAAAABdwQAAAAK%0Ac3IAKmNvbS50cmFmZmljLnNlcnZpY2UuY29tbXV0ZS5Db21tdXRlU2VnbWVudMTJRY5rjq31AgAI%0ATAANbV9jUm9hZHdheURpcnQAFUxqYXZhL2xhbmcvQ2hhcmFjdGVyO0wADG1faUNvbW11dGVJZHQA%0AE0xqYXZhL2xhbmcvSW50ZWdlcjtMABNtX2lDb21tdXRlU2VnbWVudElkdAATTGphdmEvbGFuZy9J%0AbnRlZ2VyO0wADW1faUVuZFBvaW50SWR0ABNMamF2YS9sYW5nL0ludGVnZXI7TAAKbV9pTWV0cm9J%0AZHQAE0xqYXZhL2xhbmcvSW50ZWdlcjtMAAxtX2lSb2Fkd2F5SWR0ABNMamF2YS9sYW5nL0ludGVn%0AZXI7TAAObV9pU2VxdWVuY2VOdW10ABNMamF2YS9sYW5nL0ludGVnZXI7TAAPbV9pU3RhcnRQb2lu%0AdElkdAATTGphdmEvbGFuZy9JbnRlZ2VyO3hwc3IAE2phdmEubGFuZy5DaGFyYWN0ZXI0i0fZaxom%0AeAIAAUMABXZhbHVleHAALXBwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1%0AZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAATZzcQB%2BAB0AAAACc3EAfgAdAAAA%0AgXNxAH4AHQAAAAFzcQB%2BAB0AAAE6eHBzcQB%2BAB0AAAACcHQADlBPSU5ULVRPLVBPSU5U%0A";
this.route2Info={"edgeIds":"16071462,16540220,16071012,16071010,16071009,16070989,16070983,16070982,16070952,16070947,16070888,1...","lengthMeterAtSpeedLimit":20875,"lengthMeterTrafficBased":20974,"map24RouteId":"WHUYEESJR3_RNA_NT_PRD_2_14_44_11_FASTA3F3_FTFETFT1.0ComVecpTrn_v3CoCtyVehtSTab3_nReg","mapObjectId":"route1","processMetrics":false,"routeName":"TrafficBased","timeSecAtSpeedLimit":1117,"timeSecTrafficBased":1172};
this.route2Info.routeName=this.routeNameDirect;this.route2Info.routeId="route2";this.route2Info.commuteSegmentSummaryList=[];
this.route2Info.commuteSegmentSummaryList[0]={"avgSpeed":"54","delay":"0","desc":"I-476 Blue Route TEST TEST TEST TEST TEST","distance":"6.858751225155636","endPointName":"TEST TEST TEST","freeFlowTravelTime":"7","incidentList":[],"isDefinedDigital":true,"isDigital":true,"isValid":true,"jamFactor":"0.9","jamFactorTrend":"0.28107677306454804","jamFactorTrendStyle":"WorseLevel1","lowerRightLat":40.03366,"lowerRightLon":-75.28871,"roadName":"I-476 Blue Route","segmentId":null,"segmentName":"Segment1","shieldText":"476","shieldText2":null,"shieldType":"interstate","slowestMPH":"49.42801428608879","slowestPointName":"The slowest point on this drive is located on I-476 Blue Route from I-76 Schuylkill Exwy (#16) to St...","startPointName":"Germantown Pk W. (#20) ","travelTime":"7","upperLeftLat":40.10607,"upperLeftLon":-75.36056};
this.route2Info.directions=[{"distance":"123.7","text":"You start at the Penllyn Blue Bell Pike and head towards E Township Line Rd for 1.7 miles."},{"distance":"1.7","text":"You start at the Penllyn Blue Bell Pike and head towards E Township Line Rd for 1.7 miles."},{"distance":"1.7","text":"You start at the Penllyn Blue Bell Pike and head towards E Township Line Rd for 1.7 miles."},{"distance":"1.7","text":"You start at the Penllyn Blue Bell Pike and head towards E Township Line Rd for 1.7 miles."},{"distance":"1.7","text":"You start at the Penllyn Blue Bell Pike and head towards E Township Line Rd for 1.7 miles."}];
this.route2Info.startDisplay="92345 Starting Here Drive";this.route2Info.endDisplay="92345 Ending Here Drive";
this.route2Info.serializedCommute="rO0ABXNyACNjb20udHJhZmZpYy5zZXJ2aWNlLmNvbW11dGUuQ29tbXV0ZejqFWGZiuFIAgAGTAAP%0AbV9jQ29tbXV0ZU5hbWVzdAAQTGphdmEvdXRpbC9MaXN0O0wAEm1fY0NvbW11dGVTZWdtZW50c3QA%0AEExqYXZhL3V0aWwvTGlzdDtMAAxtX2lDb21tdXRlSWR0ABNMamF2YS9sYW5nL0ludGVnZXI7TAAK%0AbV9pTWV0cm9JZHQAE0xqYXZhL2xhbmcvSW50ZWdlcjtMABBtX3N0ckNvbW11dGVEZXNjdAASTGph%0AdmEvbGFuZy9TdHJpbmc7TAAUbV9zdHJDb21tdXRlVHlwZURlc2N0ABJMamF2YS9sYW5nL1N0cmlu%0AZzt4cHNyABNqYXZhLnV0aWwuQXJyYXlMaXN0eIHSHZnHYZ0DAAFJAARzaXpleHAAAAABdwQAAAAK%0Ac3IAJ2NvbS50cmFmZmljLnNlcnZpY2UuY29tbXV0ZS5Db21tdXRlTmFtZbvwQLBhLNbaAgADTAAW%0AbV9pQ29tbXV0ZU5hbWVTb3J0Q29kZXQAE0xqYXZhL2xhbmcvSW50ZWdlcjtMABBtX3N0ckNvbW11%0AdGVOYW1ldAASTGphdmEvbGFuZy9TdHJpbmc7TAAYbV9zdHJDb21tdXRlTmFtZVR5cGVEZXNjdAAS%0ATGphdmEvbGFuZy9TdHJpbmc7eHBwdAAPRHluYW1pYyBDb21tdXRlcHhzcQB%2BAAgAAAACdwQAAAAK%0Ac3IAKmNvbS50cmFmZmljLnNlcnZpY2UuY29tbXV0ZS5Db21tdXRlU2VnbWVudMTJRY5rjq31AgAI%0ATAANbV9jUm9hZHdheURpcnQAFUxqYXZhL2xhbmcvQ2hhcmFjdGVyO0wADG1faUNvbW11dGVJZHQA%0AE0xqYXZhL2xhbmcvSW50ZWdlcjtMABNtX2lDb21tdXRlU2VnbWVudElkdAATTGphdmEvbGFuZy9J%0AbnRlZ2VyO0wADW1faUVuZFBvaW50SWR0ABNMamF2YS9sYW5nL0ludGVnZXI7TAAKbV9pTWV0cm9J%0AZHQAE0xqYXZhL2xhbmcvSW50ZWdlcjtMAAxtX2lSb2Fkd2F5SWR0ABNMamF2YS9sYW5nL0ludGVn%0AZXI7TAAObV9pU2VxdWVuY2VOdW10ABNMamF2YS9sYW5nL0ludGVnZXI7TAAPbV9pU3RhcnRQb2lu%0AdElkdAATTGphdmEvbGFuZy9JbnRlZ2VyO3hwc3IAE2phdmEubGFuZy5DaGFyYWN0ZXI0i0fZaxom%0AeAIAAUMABXZhbHVleHAALXBwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1%0AZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAACihzcQB%2BAB0AAAACc3EAfgAdAAAA%0AYnNxAH4AHQAAAAFzcQB%2BAB0AAVRQc3EAfgARcQB%2BABxwcHNxAH4AHQABVENxAH4AIHEAfgAhc3EA%0AfgAdAAAAA3NxAH4AHQAAAZJ4cHNxAH4AHQAAAAJwdAAOUE9JTlQtVE8tUE9JTlQ%3D%0A";
this.drawDirectionsCallback([this.route1Info,this.route2Info],this);}};Nvt.MapTp.RouteManager.delim="|~";
Nvt.MapTp.RouteManager.printParamName="print";Nvt.MapTp.RouteManager.roundDistance=function(A){return Math.round(A*10)/10;
};Nvt.MapTp.RouteManager.convertToReadableTime=function(C){var B=(C/60).toFixed(0);var A=Math.floor(B/60);
B=(B%60).toFixed(0);if(A>0){return A+" hr "+B+" min ";}else{return B+" min ";}};Nvt.MapTp.RouteManager.convertMeterToMile=function(A){feet=A*3.280399;
mile=(feet/5280).toFixed(1);return mile;};Nvt.MapTp.RouteManager.getMapSearchAlternativeFromArray=function(D){var C=new Map24.WebServices.Coordinate({Latitude:D[0],Longitude:D[1]});
var B=[];if(D[2]!=""){B.push(new Map24.WebServices.Property({Key:"Hnrs",Value:D[2]}));}if(D[3]!=""){B.push(new Map24.WebServices.Property({Key:"Street",Value:D[3]}));
}if(D[4]!=""){B.push(new Map24.WebServices.Property({Key:"Zip",Value:D[4]}));}if(D[5]!=""){B.push(new Map24.WebServices.Property({Key:"City",Value:D[5]}));
}if(D[6]!=""){B.push(new Map24.WebServices.Property({Key:"Cty",Value:D[6]}));}if(D[7]!=""){B.push(new Map24.WebServices.Property({Key:"Sta",Value:D[7]}));
}if(D[8]!=""){B.push(new Map24.WebServices.Property({Key:"Ctry",Value:D[8]}));}if(D[9]!=""){B.push(new Map24.WebServices.Property({Key:"District",Value:D[9]}));
}if(D[10]!=""){B.push(new Map24.WebServices.Property({Key:"Name",Value:D[10]}));}var A=new Map24.WebServices.MapSearchAlternative({PropertiesMajor:B,Coordinate:C});
return A;};Nvt.MapTp.RouteManager.createMapSearchAlternativeString=function(C){var A="";var B=Nvt.MapTp.RouteManager.delim;
A+=(C["Latitude"])?C["Latitude"]+B:B;A+=(C["Longitude"])?(C["Longitude"])+B:B;A+=(C["Hnrs"])?(C["Hnrs"])+B:B;
A+=(C["Street"])?(C["Street"])+B:B;A+=(C["Zip"])?(C["Zip"])+B:B;A+=(C["City"])?(C["City"])+B:B;A+=(C["Cty"])?(C["Cty"])+B:B;
A+=(C["Sta"])?(C["Sta"])+B:B;A+=(C["Ctry"])?(C["Ctry"])+B:B;A+=(C["District"])?(C["District"])+B:B;A+=(C["Name"])?(C["Name"])+B:B;
return A;};function $v(A){if(document.getElementById(A)&&document.getElementById(A).value){return document.getElementById(A).value;
}else{return"";}}Nvt.MapTp.Tooltip=Class.create();Nvt.MapTp.Tooltip.prototype={initialize:function(A,B){this.YELLOW="#ffcc00";
this.RED="#ff0000";this.BLACK="#000000";this.WHITE="#ffffff";this.BLUE="#0b416b";this.tooltipContent={};
this.tooltipContent["Expanded"]='<div style="padding: 0 0 5px; width: 190px; background-color: @{BGCOLOR}; border: 2px solid @{BORDERCOLOR}; font-family: Arial; font-size: 12px; nose-background-color: @{BGCOLOR}; nose-color: @{BORDERCOLOR}; nose-width: 2px; nose-offset: 2px;"><div style="border-bottom:1px solid @{BORDERCOLOR}; padding:0 5px"><table width="100%"><tr valign="middle"><td style="padding:5px 0;"><div style="color: @{FONTCOLOR}; font-size: 12px;"><b>@{HEADER}</b></div></td><td align="right"><a title="'+i18n.closeText+'" alt="'+i18n.closeText+'" href="@{CLOSEURL}"><img src="'+commonData.staticServer("modalCloseBtn.gif")+Nvt.MapTp.Common.modalImageUrl+'modalCloseBtn.gif" border="0"/></a></td></tr></table></div><div style="margin: 0px; margin-top: 2px; padding: 0px 5px; background-color: #ffffff; font-size: 11px;">@{CONTENT}</div><div style="margin: 0px; margin-top: 2px; padding: 0px 5px; background-color: #ffffff; font-size: 11px;">@{DIRECTION}</div><div style="padding:0 5px; text-align:right; color:#878c92;" class="nvt_popupSponsorAd">@{AD}</div></div>';
this.tooltipContent["Regular"]='<div style="padding: 0 0 5px; width: 190px; background-color: @{BGCOLOR}; border: 2px solid @{BORDERCOLOR}; font-family: Arial; font-size: 12px; nose-background-color: @{BGCOLOR}; nose-color: @{BORDERCOLOR}; nose-width: 2px; nose-offset: 2px;"><div style="border-bottom:1px solid @{BORDERCOLOR}; padding:0 5px"><table width="100%"><tr valign="middle"><td style="padding:5px 0;"><div style="color: @{FONTCOLOR}; font-size: 12px;"><b>@{HEADER}</b></div></td><td align="right"><a title="'+i18n.closeText+'" alt="'+i18n.closeText+'"  href="@{CLOSEURL}"><img src="'+commonData.staticServer("modalCloseBtn.gif")+Nvt.MapTp.Common.modalImageUrl+'modalCloseBtn.gif" border="0"/></a></td></tr></table></div><div style="margin: 0px; margin-top: 2px; padding: 0px 5px; background-color: #ffffff; font-size: 11px;">@{CONTENT}<p><a href="@{MOREINFOURL}">'+i18n.clickForMoreInformation+'</a></p></div><div style="margin: 0px; margin-top: 2px; padding: 0px 5px; background-color: #ffffff; font-size: 11px;">@{DIRECTION}</div></div>';
this.tooltipContent["Mini"]='<div style="padding: 0 0 5px; width: 190px; background-color: @{BGCOLOR}; border: 2px solid @{BORDERCOLOR}; font-family: Arial; font-size: 12px; nose-background-color: @{BGCOLOR}; nose-color: @{BORDERCOLOR}; nose-width: 2px; nose-offset: 2px;"><div style="border-bottom:1px solid @{BORDERCOLOR}; padding:0 5px"><table width="100%"><tr valign="middle"><td style="padding:5px 0;"><div style="color: @{FONTCOLOR}; font-size: 12px;"><b>@{HEADER}</b></div></td></tr></table></div><div style="margin: 0px; margin-top: 2px; padding: 0px 5px; background-color: #ffffff; font-size: 11px;">@{CONTENT}</div></div>';
this.MapTpUtils=new Nvt.MapTp.Util(A,B);Nvt.MapTp.Tooltip.disableLocationTooltip=new Map24.Callable(this,this.disableLocationTooltip);
Nvt.MapTp.Tooltip.drawLocationTooltip=new Map24.Callable(this,this.drawLocationTooltip);Nvt.MapTp.Tooltip.forwardToRouting=new Map24.Callable(this,this.forwardToRouting);
nQ(window).unload(this.destroyLeaks.bind(this));},destroyLeaks:function(){this.MapTpUtils=null;this.tooltipContent=null;
Nvt.MapTp.Tooltip.disableLocationTooltip=null;Nvt.MapTp.Tooltip.drawLocationTooltip=null;Nvt.MapTp.Tooltip.forwardToRouting=null;
},setTooltipColoring:function(D,E){var B=this.WHITE;var H=this.BLUE;var F=this.BLUE;if(D==3){H=this.BLUE;
}if(D==2){H=this.BLUE;}var A=E;var G="@{"+"BGCOLOR"+"}";var C=new RegExp(G,"g");A=A.replace(C,B);var G="@{"+"BORDERCOLOR"+"}";
var C=new RegExp(G,"g");A=A.replace(C,H);var G="@{"+"FONTCOLOR"+"}";var C=new RegExp(G,"g");A=A.replace(C,F);
return A;},getCriticallityName:function(A){if(A==3){return i18n.cMinor;}if(A==2){return i18n.cModerate;
}return i18n.cSevere;},drawLocationTooltip:function(D,B,A){if(!D){return ;}var F=new Nvt.Data.Coordinate();
F.setCoords(D.location.lat,D.location.lon);var C=trafficMap.theTrafficMap.map.WebServices.openConnection();
C.reverseGeocodeAddresses(new Map24.WebServices.Message.reverseGeocodeAddressesRequest({ReverseGeocodeAddressesRequest:new Map24.WebServices.ReverseGeocodeAddressesRequest({Coordinates:[new Map24.WebServices.Coordinate({Longitude:parseFloat(F.longitudeInMins),Latitude:parseFloat(F.latitudeInMins)})]})}));
var E=this.drawToolTipAfterGeolocation.bind(this);C.onSuccess=function(I,J,L){var H=this.Response.getProperty("GeocodeAddressesResponse").getProperty("GeocodedAddresses")[0].getProperty("Alternatives")[0];
var G=new Nvt.Data.AddressLocation();var M=new Nvt.Data.Coordinate();try{M.setCoordsInMinutes(H.getProperty("Coordinate").getProperty("Latitude"),H.getProperty("Coordinate").getProperty("Longitude"));
}catch(K){}G.setCoords(M);try{G.houseNo=H.getProperty("HouseNo");}catch(K){}try{G.street=H.getProperty("Street");
}catch(K){}try{G.city=H.getProperty("City");}catch(K){}try{G.state=H.getProperty("State");}catch(K){}try{G.zip=H.getProperty("ZIP");
}catch(K){}try{G.country=H.getProperty("Country");}catch(K){}try{G.county=H.getProperty("County");}catch(K){}E(G,D,B,A);
this.close();};},drawToolTipAfterGeolocation:function(A,I,F,K){var J=I.description;var E=J.length;var P=this.tooltipContent["Regular"];
if(K||E<=100){P=this.tooltipContent["Expanded"];}var M="@{"+"HEADER"+"}";var O=new RegExp(M,"g");var L=I.headerDesc+" - "+this.getCriticallityName(I.criticality)+" "+i18n.cImpact;
L=Nvt.Util.cap1stLetters(L);P=P.replace(O,L);P=this.setTooltipColoring(I.criticality,P);var B="javascript:Nvt.MapTp.Tooltip.disableLocationTooltip.invokeEx(['"+F+"']);";
var M="@{"+"CLOSEURL"+"}";var O=new RegExp(M,"g");var L=B;P=P.replace(O,L);var D={};if(I){D.incidentType=I.itemType;
D.criticality=I.criticality;D.description=I.description;D.lat=I.location.lat;D.lon=I.location.lon;}var Q=this.getAdHtml(D);
M="@{"+"AD"+"}";O=new RegExp(M,"g");L=Q;P=P.replace(O,L);var L=I.locationName;if(I.keyRouteName&&I.keyRouteName.length>0){L=I.keyRouteName;
}else{if(I.municipality&&I.municipality.length>0){L=I.municipality;}}var C=I.url;if(I.direction&&I.direction.length>0){L+=" "+Nvt.Util.cap1stLetters(I.direction);
}if(I.keyRouteId!=""&&L!=""){C='javascript:Nvt.MapTp.TrafficItemLoaderWrapper.keyRouteSelected.invokeEx(["'+I.keyRouteId+'","'+I.keyRouteParentId+'"]);';
L="<a alt='"+L+"' title='"+L+"' href='"+C+"' onclick=\"javascript:Nvt.Core.NvtAnalytics.virtual('/virtual/click/map/"+L+"');\">"+L+"</a>";
}L+="<p></p>";if(E==0){J=i18n.noInformationAvailableAtThisTime;}if(E>100&&!K){L+=J.substring(0,100)+"...";
}else{L+=J;}var M="@{"+"CONTENT"+"}";var O=new RegExp(M,"g");P=P.replace(O,L);var H="javascript:Nvt.MapTp.TrafficItemLoaderWrapper.openExpTrafficItemTooltip.invokeEx(["+I.id+",'"+F+"']);";
var M="@{"+"MOREINFOURL"+"}";var O=new RegExp(M,"g");var L=H;P=P.replace(O,L);var N=i18n.DirectionsColon+" <a href=\"javascript: Nvt.MapTp.Tooltip.forwardToRouting.invokeEx(['nvt_pointB','"+A.toBasicAddress()+"',"+A.coodinates.latitudeInMins+","+A.coodinates.longitudeInMins+']);">'+i18n.tohere+"</a>, <a href=\"javascript:Nvt.MapTp.Tooltip.forwardToRouting.invokeEx(['nvt_pointA','"+A.toBasicAddress()+"',"+A.coodinates.latitudeInMins+","+A.coodinates.longitudeInMins+']);">'+i18n.fromHere+"</a>";
var M="@{"+"DIRECTION"+"}";var O=new RegExp(M,"g");P=P.replace(O,N);var G=P;this.addHtml(G,this.MapTpUtils.convertDegreesToMinutes(I.location.lat),this.MapTpUtils.convertDegreesToMinutes(I.location.lon),F);
},disableLocationTooltip:function(A){this.MapTpUtils.controlMapObject({MapObjectIDs:[A],Control:"DISABLE"});
this.MapTpUtils.execute();},forwardToRouting:function(A,B,C,D){document.location=commonData.appServerName+"/controller/routing?"+A+"="+escape(B)+"&lat="+C+"&lon="+D;
},drawMiniLocationTooltip:function(G,D){if(!G){return ;}var C=this.tooltipContent["Mini"];var F="@{"+"HEADER"+"}";
var A=new RegExp(F,"g");var E=G.headerDesc+" - "+this.getCriticallityName(G.criticality)+" "+i18n.cImpact;
E=Nvt.Util.cap1stLetters(E);C=C.replace(A,E);var F="@{"+"CONTENT"+"}";A=new RegExp(F,"g");E=i18n.clickIconForMoreInformation;
C=C.replace(A,E);C=this.setTooltipColoring(G.criticality,C);var B=C;this.addHtml(B,this.MapTpUtils.convertDegreesToMinutes(G.location.lat),this.MapTpUtils.convertDegreesToMinutes(G.location.lon),D);
},drawCameraTooltip:function(H,E,M){var I=H.halfImage;var N=H.orientation;var A=H.location.lon;var J=H.location.lat;
var L=H.title;if(L==""){L=H.description;}var B=H.orientation;var K=H.provider;var D="width: "+M+"px;";
if(M==null||M==0){D="";}var C="javascript:Nvt.MapTp.Tooltip.disableLocationTooltip.invokeEx(['"+E+"']);";
var G=I.replace(/&/gi,"&amp;");var O=this.getAdHtml();var F='<div style="padding: 0 0 5px;'+D+' background-color: #ffffff; border: 2px solid #0b416b; font-family: Arial; font-size: 12px; nose-background-color: #ffffff; nose-color: #0b416b; nose-width: 2px; nose-offset: 2px;"><div style="border-bottom:1px solid #0b416b; padding:0 5px">'+'<table width="100%"><tr valign="middle"><td style="padding:5px 0;"><div style="color: #0b416b; font-size: 12px;"><b>'+L.replace(/&/gi,"&amp;")+'</b></div></td><td align="right"><a title="'+i18n.closeText+'" alt="'+i18n.closeText+'" href="'+C+'"><img src="'+commonData.staticServer("modalCloseBtn.gif")+Nvt.MapTp.Common.modalImageUrl+'modalCloseBtn.gif"/></a></td></tr></table></div>'+'<div style="margin: 0px; margin-top: 2px; padding: 0px 5px; background-color: #ffffff; font-size: 11px;">'+B+"<br />"+i18n.SourceColon+" "+K+" - "+i18n.updates2Seconds+'<p><a href="http://www.trafficland.com" target="_blank" title="Link will open content in new tab or window">'+i18n.poweredByrafficLand+"</a></p>"+'<img src="'+G+'" refreshinterval="2000" refreshtimeout="60000" '+'refreshimage="'+commonData.staticServer("refreshCamera.gif")+Nvt.MapTp.Common.modalImageUrl+'refreshCamera.gif" refreshhint="Refresh"/>'+'</div><div style="padding:0 5px;">'+O+"</div></div>";
this.addHtml(F,this.MapTpUtils.convertDegreesToMinutes(J),this.MapTpUtils.convertDegreesToMinutes(A),E);
},drawMiniCameraTooltip:function(F,C){var G=F.halfImage;var K=F.orientation;var A=F.location.lon;var H=F.location.lat;
var J=F.title;if(J==""){J=F.description;}var B=F.orientation;var I=F.provider;var E=G.replace(/&/gi,"&amp;");
J=J.replace(/&/gi,"&amp;");var D='<div style="background-color:#ffffff; border:2px solid #0b416b; font-size: 11px; font-family:Arial; nose-background-color: #ffffff}; nose-color: #0b416b; nose-width: 2px; nose-offset: 2px;"><b style="font-size:12px; color:#0b416b;">'+J+"</b><br /><span>"+i18n.clickIconToViewCamera+"</span></div>";
this.addHtml(D,this.MapTpUtils.convertDegreesToMinutes(H),this.MapTpUtils.convertDegreesToMinutes(A),C);
},drawGeoLocationTooltip:function(D,B){if(!D){return ;}var I=I=this.tooltipContent["Expanded"];var F="@{"+"HEADER"+"}";
var H=new RegExp(F,"g");var E=D.brand;if(!E||E.length==0){if(!D.name||D.name.length==0){E=D.city+" "+D.state;
}else{E=D.name;}}I=I.replace(H,E);I=this.setTooltipColoring(0,I);var A="javascript:Nvt.MapTp.Tooltip.disableLocationTooltip.invokeEx(['"+B+"']);";
var F="@{"+"CLOSEURL"+"}";var H=new RegExp(F,"g");var E=A;I=I.replace(H,E);var J=this.getAdHtml();F="@{"+"AD"+"}";
H=new RegExp(F,"g");E=J;I=I.replace(H,E);var E=D.street;E+="<br></br>";E+=D.city+", "+D.state+" "+D.zipCode;
E+="<br></br>";E+=D.country;var F="@{"+"CONTENT"+"}";var H=new RegExp(F,"g");I=I.replace(H,E);var G="<br></br>";
G+=i18n.DirectionsColon+" <a href=\"javascript: Nvt.MapTp.GeoLocationLoaderWrapper.forwardToRouting.invokeEx(['nvt_pointB']);\">"+i18n.tohere+"</a>, <a href=\"javascript:Nvt.MapTp.GeoLocationLoaderWrapper.forwardToRouting.invokeEx(['nvt_pointA']);\">"+i18n.fromHere+"</a>";
var F="@{"+"DIRECTION"+"}";var H=new RegExp(F,"g");I=I.replace(H,G);var C=I;this.addHtml(C,this.MapTpUtils.convertDegreesToMinutes(D.location.lat),this.MapTpUtils.convertDegreesToMinutes(D.location.lon),B);
},drawMetroTooltip:function(D,B){if(!D){return ;}var I=I=this.tooltipContent["Expanded"];var F="@{"+"HEADER"+"}";
var H=new RegExp(F,"g");var E="";I=I.replace(H,E);I=this.setTooltipColoring(0,I);var A="javascript:Nvt.MapTp.Tooltip.disableLocationTooltip.invokeEx(['"+B+"']);";
var F="@{"+"CLOSEURL"+"}";var H=new RegExp(F,"g");var E=A;I=I.replace(H,E);var J=this.getAdHtml();F="@{"+"AD"+"}";
H=new RegExp(F,"g");E=J;I=I.replace(H,E);var E=D.metroName;E+="<br></br>";E+=D.metroStateName;var F="@{"+"CONTENT"+"}";
var H=new RegExp(F,"g");I=I.replace(H,E);var G="<br></br>";G+=i18n.DirectionsColon+" <a href=\"javascript: Nvt.MapTp.MetroPopUp.forwardToRouting.invokeEx(['nvt_pointB']);\">"+i18n.tohere+"</a>, <a href=\"javascript:Nvt.MapTp.MetroPopUp.forwardToRouting.invokeEx(['nvt_pointA']);\"> "+i18n.fromHere+" </a>";
var F="@{"+"DIRECTION"+"}";var H=new RegExp(F,"g");I=I.replace(H,G);var C=I;this.addHtml(C,this.MapTpUtils.convertDegreesToMinutes(D.boundingBox.centerPoint.lat),this.MapTpUtils.convertDegreesToMinutes(D.boundingBox.centerPoint.lon),B);
},addHtml:function(A,C,D,B){this.MapTpUtils.addHtmlObject({MapObjectID:B,MaxMPP:750,Coordinate:new Map24.WebServices.Coordinate({Longitude:D,Latitude:C}),Orientation:new Map24.WebServices.MapObjectOrientation({Horizontal:"RIGHT",HOffset:35,Vertical:"TOP",VOffset:30}),Customize:new Map24.WebServices.MapObjectCustomSettings({Properties:[new Map24.WebServices.Property({Key:"NOSE",Value:"45"}),new Map24.WebServices.Property({Key:"STAY_IN_VIEW",Value:"10"})]}),HTML:A});
this.MapTpUtils.controlMapObject({MapObjectIDs:[B],Control:"ENABLE"});this.MapTpUtils.execute();},getAdHtml:function(C){var A=NvtAds.adServer;
var F="http://adbureau.traffic.com/adclick/";var B="http://adbureau.traffic.com/iserver/";var H="aamsz=88x31/site=beta.traffic.com";
if(A.a_env){H+="/env="+A.a_env;}if(A.getArea()){H+=A.getArea();}if(A.a_homemetro){H+="/homemetro="+A.a_homemetro;
}if(A.a_partner){H+="/partner="+A.a_partner;}var K="";if(C){if(C.incidentType){K+="/itype="+C.incidentType;
}if(C.criticality){K+="/icriticality="+C.criticality;}if(C.position){K+="/position="+C.position;}if(C.lat){K+="/lat="+C.lat;
}if(C.lon){K+="/lon="+C.lon;}if(C.description){K+="/keyword="+A.parseIntoKeywords("DESC_",C.description,4,7);
}}var G=Math.round(Math.random()*100000000);var L=H+"/GUID="+G+"/position=sponsoredby"+K;var I='<img src="'+B+L+'" alt="'+i18n.sponsoredBy+'" border="0"></img>';
G=Math.round(Math.random()*100000000);var D=H+"/GUID="+G+"/position=mapbubble"+K;var E='<a href="'+F+D+'">'+'<img src="'+B+D+'" border="0"></img>'+"</a>";
var J=I+" "+E;return J;}};Nvt.MapTp.RouteManagerPrintHtml=Class.create();Object.extend(Nvt.MapTp.RouteManagerPrintHtml.prototype,Nvt.MapTp.RouteManagerHtmlBase.prototype);
Object.extend(Nvt.MapTp.RouteManagerPrintHtml.prototype,{initialize:function(A){},finishedRoutingCallback:function(){},beginRoutingCallback:function(){},drawDirectionsCallback:function(I){var D=I[2];
var O=D.route;var K=D.directions;var P="directions";$(P).innerHTML="";this.populateHtml(D);dHTML='<table id="routedirections" class="striped"><tbody>';
var H=K.length;for(j=0;j<H;j++){dHTML+='<tr><td class="step">'+(j+1)+"</td>";dHTML+='<td class="directions">'+K[j].getText()+"</td>";
dHTML+='<td class="distance">'+K[j].getDistance()+" "+i18n.milesAbbr+"</td></tr>";}dHTML+="</tbody></table>";
nQ(dHTML).appendTo("#"+P);var C=D.commuteSegmentSummaryList;var G=0;var A=0;var E=Math.round(D.timeSecAtSpeedLimit/60);
var N=Math.round(D.timeSecTrafficBased/60);G=N-E;if(G<0){G=0;N=E;}if(isNaN(G)){delayDisplay="---";G=0;
}else{if(G<0){G=0;}delayDisplay=Nvt.MapTp.RouteManagerHtml.convertTime(G);}var A=Nvt.MapTp.RouteManagerHtmlBase.convertMeter(D.lengthMeterTrafficBased);
$("travelTime").innerHTML=Nvt.MapTp.RouteManagerHtmlBase.convertTime(N);$("distance").innerHTML=A+" "+i18n.milesAbbr;
$("avgSpeed").innerHTML=Math.round(A/(N/60))+" "+i18n.mph;$("delay").innerHTML=delayDisplay;$("nvt_atSpeedLimit").innerHTML=Nvt.MapTp.RouteManagerHtml.convertTime(E);
var L=D.reportSummary;if(L!=null){var F=L.jamFactor;var B=L.jamFactorTrendStyle;var M=F.indexOf(".");
var J=Nvt.Formatter.MajorRoadsFormatter.getJFImageString(F,B,true);$("jamFactor").innerHTML='<img src="'+commonData.staticServer(J)+i18n.imagesPath+i18n.imagesPathJamfactor+J+'" />';
}else{$("jamFactor").innerHTML=i18n.dontProvideDetailedTrafficReports;}Nvt.MapTp.RouteManagerHtmlBase.zebraStripe();
},displayDebugRoutingInfoCallback:function(){},finishedDragDropCallback:function(A){},printMapCallback:function(A){Nvt.console.debug("####################  printMapCallback");
Nvt.console.debug(A);nQ("#loader").empty();nQ("#ol_map").hide();$("ol_map_print").innerHTML='<img src="'+A+'" />';
setTimeout("window.print()",500);},startAddressCallback:function(C,A,B){},endAddressCallback:function(C,A,B){},zoomCallback:function(){},populateHtml:function(routePrintInfo){Nvt.console.log("!!!!!!!!!!!!!!!!!!!!!! populateHtml:");
var startDisplay=unescape(routePrintInfo.startDisplay);var endDisplay=unescape(routePrintInfo.endDisplay);
var now=new Date();$("updatedTime").innerHTML=formatTime(now);$("updatedDate").innerHTML=eval(now.getMonth()+1)+"/"+now.getDate()+"/"+now.getFullYear();
$("addr_start").innerHTML=startDisplay;$("addr_end").innerHTML=endDisplay;}});Nvt.MapTp.GeoLocationLoaderWrapper=Class.create();
Nvt.MapTp.GeoLocationLoaderWrapper.prototype={initialize:function(A,B,C){this.MapTpUtils=new Nvt.MapTp.Util(A,B);
this.Tooltip=new Nvt.MapTp.Tooltip(A,B);this.hostURL=C;this.currentGeoLocation=null;Nvt.MapTp.GeoLocationLoaderWrapper.closeGeoLocationTooltip=new Map24.Callable(this,this.closeGeoLocationTooltip);
Nvt.MapTp.GeoLocationLoaderWrapper.openGeoLocationTooltip=new Map24.Callable(this,this.openGeoLocationTooltip);
Nvt.MapTp.GeoLocationLoaderWrapper.forwardToRouting=new Map24.Callable(this,this.forwardToRouting);nQ(window).unload(this.destroyLeaks.bind(this));
},destroyLeaks:function(){this.MapTpUtils=null;this.Tooltip=null;this.currentGeoLocation=null;Nvt.MapTp.GeoLocationLoaderWrapper.closeGeoLocationTooltip=null;
Nvt.MapTp.GeoLocationLoaderWrapper.openGeoLocationTooltip=null;Nvt.MapTp.GeoLocationLoaderWrapper.forwardToRouting=null;
},clearGeoLocation:function(){this.closeGeoLocationTooltip("fix_tooltip");this.MapTpUtils.removeMapObject({MapObjectIDs:["GeoLocation"]});
this.MapTpUtils.execute();},hideGeoLocation:function(){this.MapTpUtils.controlMapObject({Control:"DISABLE",MapObjectIDs:["GeoLocation"]});
this.MapTpUtils.execute();},addALocation:function(D){this.currentGeoLocation=D;var B=Nvt.MapTp.Common.imageIncidentUrl;
var A=D.itemType;var C=commonData.staticServer("pointA.gif")+B+"pointA.gif#hotspot=9,50";if(D.location.lon!=0&&D.location.lat!=0){this.MapTpUtils.addLocation({MapObjectID:"GeoLocation",Coordinate:new Map24.WebServices.Coordinate({Longitude:this.MapTpUtils.convertDegreesToMinutes(D.location.lon),Latitude:this.MapTpUtils.convertDegreesToMinutes(D.location.lat)}),LogoURL:C,MaxMPP:750,Events:[new Map24.WebServices.MapObjectEvent({ID:"OnClick",Commands:[new Map24.WebServices.XMLCommandWrapper({Surf:new Map24.WebServices.Surf({URL:"javascript:Nvt.MapTp.GeoLocationLoaderWrapper.openGeoLocationTooltip.invokeEx(['fix_tooltip']);",TargetFrame:"_self"})})]})]});
this.MapTpUtils.controlMapObject({Control:"ENABLE",MapObjectIDs:["GeoLocation"]});this.MapTpUtils.execute();
}this.closeGeoLocationTooltip("fix_tooltip");this.openGeoLocationTooltip("fix_tooltip");},closeGeoLocationTooltip:function(A){this.Tooltip.disableLocationTooltip(A);
},openGeoLocationTooltip:function(A){this.Tooltip.drawGeoLocationTooltip(this.currentGeoLocation,A);},forwardToRouting:function(A){var B=this.currentGeoLocation.street;
if(B.length>0){B+=", ";}B+=this.currentGeoLocation.city+", "+this.currentGeoLocation.state+" "+this.currentGeoLocation.zipCode;
document.location=commonData.appServerName+"/controller/routing?"+A+"="+escape(B);}};Object.extend(Nvt.MapTp.GeoLocationLoaderWrapper.prototype,Nvt.Widget.WidgetBase.prototype);

