function resetMapViewer(){initialPoi="";initialFloor="";initialAnimation=1;zoom=135;placeBubble=!1;mapviewer.stop();mapviewer.destroy()}function addCloseAction(){$(".popUpSearch").click(function(n){n.target.className=="popUpSearch"&&(resetMapViewer(),$(this).remove())})}function load(){if(typeof visioweb=="undefined"){console.log(errors.SDKError);return}$("#visiowebContainer").load("/Content/visioglobe/VisioglobeTemplate.html",function(n,t){var i,r;if(t=="error"){console.log(errors.templateError);return}(navigator.platform.indexOf("iPhone")!=-1||navigator.platform.indexOf("iPad")!=-1||navigator.platform.indexOf("iPod")!=-1||navigator.userAgent.indexOf("ndroid")!=-1)&&(document.getElementById("container").addEventListener("gesturestart",function(n){n.preventDefault()},!1),document.getElementById("container").addEventListener("gesturechange",function(n){n.preventDefault()},!1),document.getElementById("container").addEventListener("gestureend",function(n){n.preventDefault()},!1),document.getElementById("container").addEventListener("touchmove",function(n){n.preventDefault()},!1));jQuery().knob!==undefined&&jQuery(".knob").knob();query=visioweb.Utils.getURLParameters();checkAttrs();i=mapURL;typeof query.bundle!="undefined"?i="../data.bundles/"+query.bundle+"/map.json":typeof query.url!="undefined"?i=query.url:typeof query.hash!="undefined"&&(i="https://mapserver.visioglobe.com/"+query.hash+"/descriptor.json");typeof query.initialfloor!="undefined"&&(initialFloor=query.initialfloor);typeof query.initialpoi!="undefined"&&(initialPoi=query.initialpoi);typeof query.initialanimation!="undefined"&&(initialAnimation=query.initialanimation);typeof query.cameratype!="undefined"&&(cameraType=query.cameratype);typeof query.sidebar!="undefined"&&(showSidebar=query.sidebar!="no");showSidebar&&jQuery("#vg_sidebar").show();typeof query.activeplacecolor=="string"&&(activePlaceColor="#"+query.activeplacecolor);r={logoPosition:"TOP_RIGHT",path:i,cameraType:cameraType,antialias:query.antialias,initialFloorName:initialFloor,onObjectMouseUp:onObjectMouseUp,progressHandler:updateProgress,optimizations:{batchIcons:{padding:0}}};(useMouseover||typeof query.mouseover!="undefined")&&(r.onObjectMouseOver=onObjectMouseOver,r.onObjectMouseOut=onObjectMouseOut);mapviewer=new visioweb.Mapviewer;mapviewer.initialize(jQuery("#container")[0],r).then(onLoadCompleted).then(addCloseAction,addCloseAction).catch(function(n){var t="Unknown map initialize error";typeof n!="undefined"&&typeof n.message!="undefined"&&(t="Map initialize error: "+n.message);alert(t)})})}function checkAttrs(){var i,n,t;for(i in attrs)n=attrs[i],t=$("#visiowebContainer").attr("data-"+n),t&&(typeof window[n]=="boolean"?window[n]=t.toLowerCase()=="true":n.split(".")[0]=="query"?window[n.split(".")[0]][n.split(".")[1]]=t:window[n]=t)}function onLoadCompleted(){var n,t,i;if(logVisioWebTitle(),jQuery("#progress").hide(),$("#vg_menu_button").show(),jQuery(window).resize(function(){mapviewer.resize(jQuery("#container").width(),jQuery("#container").height())}),typeof sendToMobileApp=="function")mapviewer.on("mouseup",sendToMobileApp);return mapviewer.start(),typeof enableStats=="boolean"&&enableStats&&(mapviewer.setLogStatistic(!0),typeof statURL!="undefined"&&mapviewer.setLogStatisticURL(statURL),mapviewer.camera.track=!0),n=mapviewer.getExtraData(),n&&typeof n.app_params!="undefined"&&(appParams=n.app_params),loadPlaces()||loadLabels(),useNavigation&&mapviewer.setupNavigationTranslator(vgPlaces),typeof query.viewtype!="undefined"&&(viewType=query.viewtype),t="translation",typeof query.animationtype!="undefined"&&(t=query.animationtype),i=["singlefloor","multifloor","multibuilding"],typeof viewType!="undefined"&&i.indexOf(viewType)!==-1?(cameraType==="orthographic"&&(viewType="singlefloor"),mapviewer.setupMultiBuildingView({containerDivSelector:"#container",viewType:viewType,animationType:t,imagePath:"/Content/visioglobe/media"}),mapviewer.multiBuildingView.buildingModeEnabled=viewType==="multifloor",cameraType!=="orthographic"&&typeof appParams.exploreParams!="undefined"&&(mapviewer.camera.pitch=appParams.exploreParams.pitch,mapviewer.multiBuildingView.floorModePitch=appParams.exploreParams.pitch),mapviewer.cameraDrivenExplorer.setEnabled(!0),mapviewer.cameraDrivenExplorer.maxExploreDistance=300,typeof appParams.cameraDrivenExplorer!="undefined"&&(mapviewer.cameraDrivenExplorer.setEnabled(appParams.cameraDrivenExplorer.enabled),mapviewer.cameraDrivenExplorer.maxExploreDistance=appParams.cameraDrivenExplorer.distanceThreshold),setupMultiBuildingUI(),mapviewer.multiBuildingView.goTo({mode:"global",buildingID:mapviewer.multiBuildingView.DEFAULT}).then(setupInitialPosition).then(doRoutingFromURLParameters)):(setupDefaultUI(),setupInitialPosition().then(doRoutingFromURLParameters))}function setupInitialPosition(){var t,n;if(initialPoi!=="")if(mapviewer.multiBuildingView)selectPlace(initialPoi);else return t=mapviewer.getPlace(initialPoi).vg.floor,mapviewer.changeFloor(t).then(function(){return mapviewer.camera.goTo(initialPoi,{animationDuration:initialAnimation*1e3})}).catch(function(){return mapviewer.changeFloor(mapviewer.getFloors()[0].name,{animationDuration:initialAnimation*1e3})});else return initialFloor!==""?mapviewer.multiBuildingView?(n={mode:"floor",floorID:initialFloor,animationDuration:initialAnimation},mapviewer.multiBuildingView.goTo(n).catch(function(){return mapviewer.multiBuildingView.goTo({mode:"global",buildingID:mapviewer.multiBuildingView.DEFAULT,floorID:mapviewer.multiBuildingView.DEFAULT,animationDuration:initialAnimation})})):mapviewer.changeFloor(initialFloor,{animationDuration:initialAnimation*1e3}).catch(function(){return mapviewer.changeFloor(mapviewer.getFloors()[0].name,{animationDuration:initialAnimation*1e3})}):mapviewer.multiBuildingView?(n={mode:"global",animationDuration:initialAnimation},mapviewer.multiBuildingView.goTo(n)):mapviewer.changeFloor(mapviewer.getFloors()[0].name,{animationDuration:initialAnimation*1e3})}function gotoFloorAndPosition(n,t,i){if(mapviewer.multiBuildingView)return typeof i=="function"&&i(),typeof t.vg!="undefined"&&typeof t.vg.radius!="undefined"&&(t.vg.radius=zoom),mapviewer.multiBuildingView.goTo({mode:"floor",floorID:n,viewpoint:{position:t}});var r=function(){return mapviewer.camera.goTo(t,{animationDuration:500}).then(i)};return mapviewer.getCurrentFloor()==n?r():mapviewer.changeFloor(n,{animationDuration:changeFloorAnimationDuration}).then(r)}function setupBubbleUI(){$("#place_bubble_set_destination").text(bubbleMenuButtons.setDestination);$("#place_bubble_set_origin").text(bubbleMenuButtons.setOrigin);$("#place_bubble_set_waypoint").text(bubbleMenuButtons.setWaypoint);requestAnimationFrame(function(){jQuery("#place_bubble_set_origin").on("click",null,function(){var r=jQuery(this).attr("vg_id"),t,i,u,n;return routeStartID=r,routeWaypointIDs=[],t=jQuery("#vg_route_from"),t.length==1&&(i=jQuery('option[value="'+r+'"]',t).index(),i!=-1&&(u=t[0],u.selectedIndex=i,jQuery("#vg_route_from-input").val(jQuery(u[i]).val()))),closePlaceBubble(),n=mapviewer.getPlace(r),n&&!routeEndID&&routePins.push(mapviewer.addPOI({floor:n.vg.floor,url:"/Content/visioglobe/media/track_start.png",onObjectMouseUp:onClickStart,id:"VGROUTE-START",position:{x:n.vg.position.x,y:n.vg.position.y,z:3},scale:4,overlay:!0})),doRouting(routeStartID,routeWaypointIDs.concat(routeEndID)),!1});jQuery("#place_bubble_set_destination").on("click",null,function(){var r=jQuery(this).attr("vg_id"),t,i,u,n;return routeEndID=r,t=jQuery("#vg_route_to"),t.length==1&&(i=jQuery('option[value="'+r+'"]',t).index(),i!=-1&&(u=t[0],u.selectedIndex=i,jQuery("#vg_route_to-input").val(jQuery(u[i]).val()))),closePlaceBubble(),n=mapviewer.getPlace(r),n&&!routeStartID&&routePins.push(mapviewer.addPOI({floor:n.vg.floor,url:"/Content/visioglobe/media/track_end.png",onObjectMouseUp:onClickEnd,id:"VGROUTE-END",position:{x:n.vg.position.x,y:n.vg.position.y,z:3},scale:4,overlay:!0})),doRouting(routeStartID,routeWaypointIDs.concat(routeEndID)),!1});jQuery("#place_bubble_set_waypoint").on("click",null,function(){var t=jQuery(this).attr("vg_id"),n;return routeWaypointIDs.push(t),closePlaceBubble(),n=mapviewer.getPlace(t),n&&routePins.push(mapviewer.addPOI({floor:n.vg.floor,url:"/Content/visioglobe/media/track_intermediate_destination.png",onObjectMouseUp:onClickWaypoint,id:"VGROUTE-WAYPOINT",position:{x:n.vg.position.x,y:n.vg.position.y,z:3},scale:4,overlay:!0})),!1});jQuery("#place_bubble_close_button").on("click",null,function(){return closePlaceBubble(),!1});jQuery("#place_bubble_info_button").on("click",null,function(){return jQuery("#place_bubble_description").is(":visible")?(jQuery("#place_bubble_description").hide(),jQuery("#place_bubble_set_origin").show(),jQuery("#place_bubble_set_destination").show(),jQuery("#place_bubble_set_waypoint").show()):(jQuery("#place_bubble_description").show(),jQuery("#place_bubble_set_origin").hide(),jQuery("#place_bubble_set_destination").hide(),jQuery("#place_bubble_set_waypoint").hide()),!1})})}function releaseBubbleUI(){jQuery("#place_bubble_set_origin").off("click");jQuery("#place_bubble_set_destination").off("click");jQuery("#place_bubble_set_waypoint").off("click");jQuery("#place_bubble_close_button").off("click");jQuery("#place_bubble_info_button").off("click")}function setupRouteUI(){mapviewer.on("routeComputed",function(){jQuery("#route_clear").show()});jQuery("#route_clear").on("click",function(){clearRouting()});jQuery("#vg_toggles").on("click","#toggle_handicap",function(){return accessibleRoute=!accessibleRoute,jQuery("#toggle_handicap").prop("checked",accessibleRoute),currentRoute!=null&&doRouting(),!0})}function releaseRouteUI(){mapviewer.off("routeComputed");jQuery("#route_clear").off("click");jQuery("#vg_toggles").off("click","#toggle_handicap")}function setupNavigationUI(){jQuery("#instructions_prev_button").on("click",null,function(){return typeof currentNavigation=="object"&&currentNavigation!==null&&(currentNavigation.displayPrevInstruction(),updateNavigationUI()),!1});jQuery("#instructions_next_button").on("click",null,function(){return typeof currentNavigation=="object"&&currentNavigation!==null&&(currentNavigation.displayNextInstruction(),updateNavigationUI()),!1});jQuery("#toggle_instructions").prop("checked",instructionsOverlayVisible);jQuery("#vg_toggles").on("click","#toggle_instructions",function(){return instructionsOverlayVisible=!instructionsOverlayVisible,jQuery("#toggle_instructions").prop("checked",instructionsOverlayVisible),toggleNavigationUI(),!0})}function releaseNavigationUI(){jQuery("#instructions_prev_button").off("click");jQuery("#instructions_next_button").off("click");jQuery("#vg_toggles").off("click")}function hideNavigationUI(n){var t=-(parseInt(jQuery("#instructions").height(),10)+2);jQuery("#instructions").animate({bottom:t+"px"},{complete:n})}function toggleNavigationUI(){instructionsOverlayVisible&&typeof currentNavigation=="object"&&currentNavigation!==null?(jQuery("#instructions").css("visibility","visible"),jQuery("#instructions").animate({bottom:"0px"})):hideNavigationUI(function(){jQuery("#instructions").css("visibility","hidden")})}function resetNavigationUI(){jQuery("#instructions_detail").html("");jQuery("#instructions_brief").html("");jQuery("#instructions_count").html("");jQuery("#instructions_time").html("");jQuery("#instructions_icon").attr("src","")}function updateNavigationUI(){var i=currentNavigation.getNbInstructions(),t=currentNavigation.getCurrentInstructionIndex(),n=currentNavigation.getInstructionData(t),r;n!==undefined&&(jQuery("#instructions_detail").html(n.detail),jQuery("#instructions_brief").html(n.brief),jQuery("#instructions_count").html(t+1+"/"+i),r=typeof n.durationString!="undefined"?n.durationString:n.duration,jQuery("#instructions_time").html(r),jQuery("#instructions_icon").attr("src","/Content/visioglobe/media/"+n.icon));jQuery("#instructions_prev_button").show();jQuery("#instructions_next_button").show();t==0&&jQuery("#instructions_prev_button").hide();t==i-1&&jQuery("#instructions_next_button").hide()}function setupSidebarUI(){if(jQuery().combobox!==undefined&&jQuery(".combobox").combobox(),mapviewer.getRoutingURL()!==""){jQuery("#vg_route_to").bind("comboboxselected",function(){doRouting()});jQuery("#vg_route_from").bind("comboboxselected",function(){doRouting()});jQuery("#vg_route_to").bind("comboboxcleared",function(){clearRouting();routeEndID=!1});jQuery("#vg_route_from").bind("comboboxcleared",function(){clearRouting();routeStartID=!1});jQuery("#vg_route_to ~ span > a > span.ui-icon-close").on("mouseup",function(){return clearRouting(),routeEndID=!1,!1});jQuery("#vg_route_from ~ span > a > span.ui-icon-close").on("mouseup",function(){return clearRouting(),routeStartID=!1,!1});jQuery("#vg_sidebar_routing").show()}else jQuery("#vg_sidebar_routing").hide();jQuery("#vg_search").bind("comboboxselected",function(){var n=jQuery("#vg_search")[0],i=n[n.selectedIndex],t=i.value;t!=""&&selectPlace(t)});jQuery("#vg_search").bind("comboboxcleared",function(){resetActivePlace()});jQuery("#vg_search ~ span > a > span.ui-icon-close").on("mouseup",function(){return resetActivePlace(),!1})}function releaseSidebarUI(){jQuery("#vg_route_to").unbind("comboboxselected");jQuery("#vg_route_from").unbind("comboboxselected");jQuery("#vg_route_to").unbind("comboboxcleared");jQuery("#vg_route_from").unbind("comboboxcleared");jQuery("#vg_route_to ~ span > a > span.ui-icon-close").off("mouseup");jQuery("#vg_route_from ~ span > a > span.ui-icon-close").off("mouseup");jQuery("#vg_search").unbind("comboboxselected");jQuery("#vg_search").unbind("comboboxcleared");jQuery("#vg_search ~ span > a > span.ui-icon-close").off("mouseup")}function setupDefaultUI(){var n,t,i;showSidebar&&setupSidebarUI();jQuery("#vg_footer").on("click",".change_floor",function(){var n=jQuery(this).attr("data-floor");return mapviewer.changeFloor(n,{animationDuration:changeFloorAnimationDuration}),!1});n=mapviewer.getFloors();for(t in n)i=n[t],createFloorButton(i.name);jQuery("#floor_container").show();updateActiveFloorButton(mapviewer.getCurrentFloor());mapviewer.on("floorChanged",function(n){var t=n.args.target;updateActiveFloorButton(t)});mapviewer.getRoutingURL()!==""&&(setupBubbleUI(),setupRouteUI(),useNavigation&&setupNavigationUI())}function setupMultiBuildingUI(){var r,i,c;showSidebar&&setupSidebarUI();mapviewer.getRoutingURL()!==""&&(setupBubbleUI(),setupRouteUI(),useNavigation&&setupNavigationUI());$("#route_clear_label").text(clearRouteText);addBuildingsToCategories();$("#floor_container").show();var o=$("#floor_mode_button"),n=$("#change_building_select"),s=$("#change_floor"),f=$("#places_select"),u=$("#change_floor_select"),t=mapviewer.multiBuildingView.getVenueLayout();n.on("change",function(){var i,n,f,r;this.value!==""&&(i=mapviewer.multiBuildingView.DEFAULT,n=mapviewer.multiBuildingView.getCurrentExploreState(),n.mode!=="global"&&(f=t.buildingByID[n.buildingID],r=f.floorByID[n.floorID],typeof r.connectedFloors[this.value]!="undefined"&&(i=r.connectedFloors[this.value].floor)),mapviewer.multiBuildingView.goTo({mode:"building",buildingID:this.value,floorID:i}),fillCategorySelector(u,this.value))});o.on("click",function(){var n=mapviewer.multiBuildingView.getCurrentExploreState();mapviewer.multiBuildingView.goTo({mode:"floor",buildingID:n.buildingID,floorID:n.floorID})});s.on("click",".change_floor",function(){var t=$(this).attr("data-floor"),n;t!==""&&(n=mapviewer.multiBuildingView.getCurrentExploreState(),mapviewer.cameraDrivenExplorer.isEnabled?mapviewer.multiBuildingView.goTo({mode:n.mode=="global"?"floor":n.mode,buildingID:n.buildingID,floorID:t,noViewpoint:n.mode=="floor"?!0:!1}):mapviewer.multiBuildingView.goTo({mode:n.mode=="global"?"building":n.mode,buildingID:n.buildingID,floorID:t,noViewpoint:!0}))});f.change(function(){var n=f[0],i=n[n.selectedIndex],t=i.value;t!=""&&selectPlace(t)});u.on("change",function(){fillPlaceSelector(n[0].value,this.value,f)});var l=!1,h=!1,a=!1;for(i in t.buildings)if(t.buildings[i].floors.length>1){l=!0;break}t.buildings.length>1?h=!0:t.buildings.length==1&&(a=!0);h||l?n.show():n.hide();a||h?o.show():o.hide();r=[];for(i in t.buildingByID)r.push(t.buildingByID[i]);r.sort(function(n,t){return(n.displayIndex||0)-(t.displayIndex||0)});var v=language||"default",p=mapviewer.getExtraData(),y=p.resources[v].localized.locale[v].venueLayout,e;n.empty();n.append($("<option/>",{value:"",text:placeholders.BuildingSelector}));for(i in r)c="",typeof y[r[i].id]!="undefined"&&(c=y[r[i].id].name),n.append($("<option/>",{value:r[i].id,text:c}));mapviewer.on("MultiBuildingView.exploreStateWillChange",function(i){var r=i.args.target,o,h;if(s.empty(),typeof r.buildingID!="undefined"){if(n.val(r.buildingID),s.empty(),o=t.buildingByID[r.buildingID],o)for(e=o.floors.length-1;e>=0;e--)h=o.floors[e].id,createFloorButton(h,mapviewer.multiBuildingView.getLocalizedName(h))}else n.val("");u[0].value==""&&fillCategorySelector(u,r.buildingID);fillPlaceSelector(r.buildingID,u[0].value,f)})}function fillPlaceSelector(n,t,i){var u,h,r,e,o,s;i.empty();i.append($("<option/>",{value:"",text:placeholders.PlaceSelector,selected:"selected"}));u=mapviewer.getPlaces();h=[];for(r in u)for(e=mapviewer.multiBuildingView.getVenueLayout().buildingByID[n],f=e.floors.length-1;f>=0;f--)if(o=e.floors[f].id,o==u[r].vg.floor&&vgPlaces[r].category==t){s=vgPlaces[r].name;i.append($("<option/>",{value:r,text:s}));break}}function fillCategorySelector(n,t){var r,i;n.empty();n.append($("<option/>",{value:"a",text:placeholders.CategorySelector,selected:"selected"}));for(r in vgCategories)i=vgCategories[r],typeof i.building!="undefined"&&i.building==t&&(name=i.name,n.append($("<option/>",{value:name,text:name})))}function addBuildingsToCategories(){var n=mapviewer.getExtraData(),i,t,r;if(!n||typeof n.resources=="undefined"||(language=language||"default",i=mapviewer.multiBuildingView.getVenueLayout(),t=n.resources[language].localized.locale[language].places,typeof t=="undefined"))return!1;r=n.resources[language].localized.locale[language].categories;Object.keys(t).forEach(function(n){var f=t[n],e,u,o;if(typeof f.categories!="undefined"&&typeof r[f.categories[0]]!="undefined"&&(e=f.categories[0]),e){if(u=mapviewer.getPlace(n),!u)return;if(typeof u.vg.floor=="undefined")return;if(o=i.buildingByFloorID[u.vg.floor],typeof o=="undefined")return;vgCategories[e].building=o.id}})}function releaseUI(){showSidebar&&releaseSidebarUI();mapviewer.getRoutingURL()!==""&&(releaseBubbleUI(),releaseRouteUI(),useNavigation&&releaseNavigationUI());jQuery("#vg_footer").off("click");jQuery("#global_mode_button").off("click");jQuery("#building_mode_button").off("click");jQuery("#floor_mode_button").off("click");jQuery("#change_building_select").off("change");jQuery("#change_floor_select").off("change")}function createFloorButton(n){var t="floor_link"+n,i='<button class="vg_button change_floor" type="button" data-floor="'+n+'" id="'+t+'">'+n+"<\/button> ";jQuery("#change_floor").append(i);floorButtonIDs["floor"+n]="#"+t}function createFloorButton(n,t){var i="floor_link"+n,r='<button class="vg_button change_floor" type="button" data-floor="'+n+'" id="'+i+'">'+t+"<\/button> ";jQuery("#change_floor").append(r);floorButtonIDs["floor"+n]="#"+i}function updateActiveFloorButton(n){for(var t in floorButtonIDs)jQuery(floorButtonIDs[t]).removeClass("selected");jQuery(floorButtonIDs["floor"+n]).addClass("selected")}function fillComboboxes(){var f=jQuery("#vg_search"),e=jQuery("#vg_route_from"),o=jQuery("#vg_route_to"),s,n,t,r,u,i;if((f.length!=0||e.length!=0||o.length!=0)&&Object.keys(vgPlaces).length!==0){s=mapviewer.getPlaces();n=[];for(t in s)r=t,u=vgPlaces[t],typeof u!="undefined"&&(r=u.name),n.push('<option value="',t,'">',r,"<\/option>");n.length>0&&(i=n.join(""),f.append(i),e.append(i),o.append(i))}}function loadIDs(){if(!doNotUseSetPlaceName){var n=mapviewer.getPlaces();Object.keys(n).forEach(function(n){mapviewer.setPlaceName(n,{text:n})})}fillComboboxes();doRoutingFromURLParameters()}function loadLabels(){var n="";typeof labelsURL!="undefined"&&(n=labelsURL);typeof query.labels!="undefined"&&(n=query.labels);language=language||"default";typeof query.language!="undefined"&&(language=query.language);n!==""&&jQuery.ajax(n,{dataType:"json",success:function(n){var t,i,r,u;if(n!=null){t=0;i="values";typeof n.languages!="undefined"?t=n.languages.indexOf(language):typeof n.targets!="undefined"&&(t=n.targets.indexOf(language)+1,i="labels");for(r in n[i])u=n[i][r][t],vgPlaces[r]={name:u},doNotUseSetPlaceName||mapviewer.setPlaceName(r,{text:u});fillComboboxes()}doRoutingFromURLParameters()},error:loadIDs})}function loadPlaces(){var n=mapviewer.getExtraData(),t,i,r;return!n||typeof n.resources=="undefined"?!1:(language=language||"default",language=visioweb.Utils.getLanguageMatch(language,Object.keys(n.resources)),typeof n.resources[language]=="undefined")?!1:(t=n.resources[language].localized.locale[language].categories,vgCategories=t,i=n.resources[language].localized.locale[language].places,r=n.resources["default"].localized.locale["default"].places,typeof i=="undefined"||typeof r=="undefined")?!1:(Object.keys(i).forEach(function(n){var f=i[n],u=r[n],e="",o;typeof u!="undefined"&&typeof u.categories!="undefined"&&typeof t[u.categories[0]]!="undefined"&&(e=t[u.categories[0]].name);vgPlaces[n]={name:f.name,description:f.description,category:e};doNotUseSetPlaceName||(o={text:f.name,textTextureHeight:64,zoomScaleFactor:1.5,multiline:!0},mapviewer.setPlaceName(n,o))}),fillComboboxes(),doRoutingFromURLParameters(),!0)}function setActivePlace(n){n!==!1&&(n.vg&&n.vg.poi&&(n=mapviewer.getPlace(n.options?n.options("id"):n.vg.id),n===!1)||n!=activePlace&&(resetActivePlace(),typeof n=="undefined"||n===!1||n.vg.poi||(mapviewer.setPlaceColor(n,activePlaceColor),activePlace=n,highlightedPlace==activePlace&&(highlightedPlace=null))))}function resetActivePlace(){activePlace===null||activePlace.vg.poi||(mapviewer.resetPlaceColor(activePlace),activePlace=null)}function setHighlightedPlace(n){n!==!1&&(n instanceof Array||n.vg&&n.vg.poi||n!=highlightedPlace&&(resetHighlightedPlace(),typeof n!="undefined"&&n!=activePlace&&(mapviewer.setPlaceColor(n,16777215-n.vg.originalColor),highlightedPlace=n)))}function resetHighlightedPlace(){highlightedPlace!==null&&(mapviewer.resetPlaceColor(highlightedPlace),highlightedPlace=null)}function selectPlace(n){var t=mapviewer.getPlace(n);resetActivePlace();t!==!1&&gotoFloorAndPosition(t.vg.floor,t,function(){setActivePlace(t);openPlaceBubble(t)})}function openPlaceBubble(n){var i=!1,t,r,u;if(typeof n!="undefined"&&n!==!1){if(typeof n=="string"&&(n=mapviewer.getPlace(n),n===!1))return i;if(closePlaceBubble(),typeof n.vg.id!="undefined")t=n.vg.id,r=n.vg.position,u=n.vg.floor;else if(n.vg.poi)t=n.options("id"),r=n.options("position"),u=n.options("floor");else return;placeBubble=mapviewer.addPOI({selector:"#place_bubble",floor:u,position:r,alignment:{x:0,y:1}});typeof vgPlaces[t]!="undefined"?(jQuery("#place_bubble_title").html(vgPlaces[t].name),typeof vgPlaces[t].description!="undefined"?(jQuery("#place_bubble_description").html(vgPlaces[t].description),jQuery("#place_bubble_info_button").show()):jQuery("#place_bubble_info_button").hide()):(jQuery("#place_bubble_title").html("ID: "+t),jQuery("#place_bubble_info_button").hide());jQuery("#place_bubble_description").hide();jQuery("#place_bubble_set_origin").show();jQuery("#place_bubble_set_destination").show();jQuery("#place_bubble_set_waypoint").show();mapviewer.getRoutingNode(t)!==!1?(jQuery("#place_bubble_set_origin").attr("vg_id",t).prop("disabled",!1).css("opacity","1.0"),jQuery("#place_bubble_set_destination").attr("vg_id",t).prop("disabled",!1).css("opacity","1.0"),jQuery("#place_bubble_set_waypoint").attr("vg_id",t).prop("disabled",!1).css("opacity","1.0")):(jQuery("#place_bubble_set_origin").attr("vg_id","").prop("disabled",!0).css("opacity","0.4"),jQuery("#place_bubble_set_destination").attr("vg_id","").prop("disabled",!0).css("opacity","0.4"),jQuery("#place_bubble_set_waypoint").attr("vg_id","").prop("disabled",!0).css("opacity","0.4"));i=!0}return i}function closePlaceBubble(){placeBubble&&(typeof placeBubble.remove=="function"&&placeBubble.remove(),placeBubble=!1)}function doRouting(n,t){var r,u,f,i;if(n===undefined||n===!1){if(r=jQuery("#vg_route_from")[0],typeof r=="undefined"||r.selectedIndex==-1)return;u=r[r.selectedIndex];f=u.value;n=f}if(t===undefined){if(r=jQuery("#vg_route_to")[0],r.selectedIndex==-1)return;u=r[r.selectedIndex];f=u.value;t=f}n==""||t==""||n===!1||t===!1||Array.isArray(t)&&t.length==1&&t[0]===!1||(i={},i.src=n,i.dst=t,i.routingParameters={},accessibleRoute&&(appParams!==null&&typeof appParams.routingParameters!="undefined"&&typeof appParams.routingParameters.excludedAttributes!="undefined"&&typeof appParams.routingParameters.excludedModalities!="undefined"?(i.routingParameters.excludedAttributes=appParams.routingParameters.excludedAttributes,i.routingParameters.excludedModalities=appParams.routingParameters.excludedModalities):i.routingParameters.excludedAttributes=["escalator","stairway"]),i.computeNavigation=useNavigation,useNavigation&&(i.navigationParameters=i.navigationParameters||{},i.navigationParameters.modalityParameters=i.navigationParameters.mModalityParameters||{},i.navigationParameters.modalityParameters.shuttle=i.navigationParameters.modalityParameters.shuttle||{},i.navigationParameters.modalityParameters.shuttle.straightAngleThreshold=i.navigationParameters.modalityParameters.shuttle.straightAngleThreshold||180,i.navigationParameters.modalityParameters.shuttle.distanceFromCouloirThreshold=i.navigationParameters.modalityParameters.shuttle.distanceFromCouloirThreshold||1e3),typeof query.firstnode!="undefined"&&(i.navigationParameters.firstNodeAsIntersection=!0),typeof query.nomerge!="undefined"&&(i.navigationParameters.mergeFloorChangeInstructions=!1),clearRoutePins(),mapviewer.computeRoute(i).then(function(t){if(currentRoute!=null&&(currentRoute.remove(),currentRoute=null),currentNavigation!=null&&resetNavigationUI(),t.data.status&&t.data.status!=200)return clearRouting(),Promise.reject(errors.routeError+t.request.src+" and "+t.request.dst+".");var i={images:{waypoint:"",up:"",down:"",modalityChange:"",layerChange:""},useLinks:!1,addGoBackPins:!1,onClickStart:null,onClickWaypoint:null,onClickEnd:null,imagePath:"/Content/visioglobe/media",showWaypointPin:!1,showStartPin:!1,showEndPin:!1,pathSegments:-1};return typeof query.pathcolor=="string"&&(i.pathColor={past:"#"+query.pathcolor,current:"#"+query.pathcolor,future:"#"+query.pathcolor}),currentRoute=new visioweb.Route(mapviewer,t.data,i),currentRoute.isValid()?currentRoute.show().then(function(){return useNavigation&&t.data.navigation!==undefined&&(currentNavigation=currentRoute.navigation,language=language||"default",language=visioweb.Utils.getLanguageMatch(language,mapviewer.navigationTranslator.getLanguageCodes()),mapviewer.navigationTranslator.translateInstructions(t.data.navigation,language),updateNavigationUI(),toggleNavigationUI()),currentRoute.hideLinks(),setActivePlace(mapviewer.getPlace(n)),gotoFloorAndPosition(currentRoute.initialFloor,currentRoute.getViewpointPosition("initialFloor"))}):Promise.reject(errors.routeProblem+t.request.src+" and "+t.request.dst+".")}).catch(function(n){return clearRouting(),Promise.reject(n)}))}function doRoutingFromURLParameters(){var n,t,i,r,u,f;if(typeof query.src!="undefined"&&typeof query.dst!="undefined")return routeStartID=query.src,routeEndID=query.dst,n=jQuery("#vg_route_from"),t=jQuery("#vg_route_to"),n.length==1&&t.length==1&&(i=jQuery('option[value="'+query.src+'"]',n).index(),r=jQuery('option[value="'+query.dst+'"]',t).index(),i!=-1&&r!=-1&&(u=n[0],f=t[0],u.selectedIndex=i,f.selectedIndex=r,jQuery("#vg_route_from-input").val(jQuery(u[i]).val()),jQuery("#vg_route_to-input").val(jQuery(f[r]).val()))),typeof query.waypoint!="undefined"?doRouting(query.src+"",[query.waypoint+"",query.dst+""]):doRouting(query.src+"",query.dst+"")}function clearRouting(){var n,t;currentRoute!=null&&(currentRoute.remove(),currentRoute=null);useNavigation&&hideNavigationUI(function(){jQuery("#instructions").css("visibility","hidden");currentNavigation!=null&&resetNavigationUI()});n=jQuery("#vg_route_from");n.length==1&&(n[0].selectedIndex=-1,jQuery("#vg_route_from-input").val(""));routeStartID=!1;t=jQuery("#vg_route_to");t.length==1&&(t[0].selectedIndex=-1,jQuery("#vg_route_to-input").val(""));routeEndID=!1;routeWaypointIDs=[];jQuery("#route_clear").hide()}function clearRoutePins(){routePins.forEach(function(n){n.remove()});routePins.length=0}function onObjectMouseUp(n,t){(t.vg&&typeof t.vg.id!="undefined"&&jQuery("#vg_search-input").val(t.vg.id),t.vg&&t.vg.cluster)||(openPlaceBubble(t),setActivePlace(t))}function onObjectMouseOver(n,t){var i,r;if(t.vg&&t.vg.poi&&(t=t.options&&mapviewer.getPlace(t.options("id")),!t))return!1;statusbarTimeout!==null&&(clearTimeout(statusbarTimeout),statusbarTimeout=null);jQuery("#vg_statusbar").animate({top:"-100px"});setHighlightedPlace(t);i="";typeof vgPlaces[t.vg.id]!="undefined"?(r=vgPlaces[t.vg.id].name,i+="<h4>Element name="+r+"<\/h4>"):i+="<h4>Element ID="+t.vg.id+"<\/h4>";jQuery("#vg_statusbar .info").html(i)}function onObjectMouseOut(){if(statusbarTimeout===null)statusbarTimeout=setTimeout(function(){jQuery("#vg_statusbar").clearQueue().animate({top:"70px"},{complete:function(){jQuery("#vg_statusbar .info").html("")}})},1e3);resetHighlightedPlace()}function onClickStart(n,t){return alert(t.options("id")),!1}function onClickWaypoint(n,t){return alert(t.options("id")),!1}function onClickEnd(n,t){return alert(t.options("id")),!1}function logVisioWebTitle(){console.log("%c VisioWeb %c v"+mapviewer.version+"-"+mapviewer.revision+" %c","background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px;  color: #fff","background:#00c5eb ; padding: 1px; border-radius: 0 3px 3px 0;  color: #fff","background:transparent")}function isWebGLSupported(){var t=!1,n,i;return window.WebGLRenderingContext&&(n=document.createElement("canvas"),i=n.getContext("webgl")||n.getContext("experimental-webgl"),i&&(t=!0)),t}function updateProgress(n){if(jQuery("#progress").show(),n){(animationValue||animationOffset)&&jQuery("#progress input.knob").trigger("configure",{angleOffset:0});animationValue&&(animationValue.stop(),animationValue=undefined);animationOffset&&(animationOffset.stop(),animationOffset=undefined);var t=(n*100).toFixed(2);jQuery("#progress input.knob").val(t).trigger("change")}}function checkMoreThanTwoTouches(n){n&&n.touches&&n.touches.length>2&&(alert(errors.phoneFingersError),document.removeEventListener("touchstart",checkMoreThanTwoTouches))}function initPOIsToCluster(){for(var u,t,r=function(){var t,i,n,r;do t=2*Math.random()-1,i=2*Math.random()-1,n=t*t+i*i;while(n>=1||n==0);return r=Math.sqrt(-2*Math.log(n)/n),t*r},i=Object.keys(pois),n=0;n<i.length;++n)pois[i[n]].poi.remove(),delete pois[i[n]];for(u=40,t=[{x:60,y:-70},{x:75,y:-100},{x:90,y:-110},{x:60,y:-120}],n=0;n<u;++n){var f="poi_"+n,e=Math.min(t.length-1,Math.round(Math.random()*t.length)),s={x:t[e].x+r(),y:t[e].y+r(),z:3},o={prop1:Math.round(Math.random()*10),prop2:Math.random()},h=mapviewer.addPOI({id:f,url:"/Content/visioglobe/media/track_start.png",text:query.clusters==="selectors"?""+o.prop1:"",floor:"B3-UL00",position:s,zoomScaleFactor:1,zoomScaleFast:!0});pois[f]={poi:h,properties:o}}}var mapviewer,floorButtonIDs,highlightedPlace,activePlace,placeBubble,statusbarTimeout,animationOffset,animationValue,pois;$(function(){function n(n,t){$.each(n.attributes,function(){this.specified&&this.name.indexOf("data-")>=0&&$(t).attr(this.name,this.value)})}$(".visiowebButton").click(function(){var r=this,t=document.createElement("div"),i;$(t).addClass("popUpWrapper").attr("id","visiowebContainer");i=document.createElement("div");$(i).addClass("popUpSearch").append($(t)).appendTo($(".content")).ready(function(){n(r,t);load()})})});var attrs=["mapURL","labelsURL","cameraType","showSidebar","accessibleRoute","useNavigation","changeFloorAnimationDuration","initialPoi","initialFloor","query.src","query.dst","zoom"],errors={templateError:"Ошибка: шаблон не загружен",SDKError:"ERROR: Missing VisioWeb SDK...probably missing script file vg.mapviewer.web.js or not loaded yet",WebGLError:"Your browser does not have WebGL support, update or try another browser, no map will be loaded or displayed",routeError:"Sorry, no route available between",routeProblem:"Problems rendering the route between",phoneFingersError:"For best user experience, use only two fingers"},placeholders={BuildingSelector:"Выберите здание",CategorySelector:"Выберите категорию",PlaceSelector:"Выберите место"},bubbleMenuButtons={setOrigin:"",setWaypoint:"",setDestination:""},selectMenus=["change_floor_select","change_building_select","change_category_select","places_select"],clearRouteText="",viewType="multibuilding",mapURL=mapURL,query={},useMouseover=!1,initialPoi="",initialFloor="",initialAnimation=1,cameraType="perspective",showSidebar=showSidebar||!1,activePlaceColor="#00FF00",appParams={},accessibleRoute=!1,useNavigation=!1,instructionsOverlayVisible=!0,changeFloorAnimationDuration=500,zoom=135;isWebGLSupported()?window.addEventListener("load",load):alert(errors.WebGLError);floorButtonIDs={};var vgPlaces={},vgCategories={},doNotUseSetPlaceName=!1;highlightedPlace=null;activePlace=null;var currentNavigation,currentRoute=null,routePins=[],routeStartID=!1,routeEndID=!1,routeWaypointIDs=[];statusbarTimeout=null;document.addEventListener("touchstart",checkMoreThanTwoTouches,!1);pois={},function(n){"use strict";var t={},i=Math.max,r=Math.min;t.c={};t.c.d=n(document);t.c.t=function(n){return n.originalEvent.touches.length-1};t.o=function(){var i=this;this.o=null;this.$=null;this.i=null;this.g=null;this.v=null;this.cv=null;this.x=0;this.y=0;this.$c=null;this.c=null;this.t=0;this.isInit=!1;this.fgColor=null;this.pColor=null;this.dH=null;this.cH=null;this.eH=null;this.rH=null;this.run=function(){var t=function(n,t){for(var r in t)i.o[r]=t[r];i.init();i._configure()._draw()};if(!this.$.data("kontroled"))return this.$.data("kontroled",!0),this.extend(),this.o=n.extend({min:this.$.data("min")||0,max:this.$.data("max")||100,stopper:!0,readOnly:this.$.data("readonly"),cursor:this.$.data("cursor")===!0&&30||this.$.data("cursor")||0,thickness:this.$.data("thickness")||.35,lineCap:this.$.data("linecap")||"butt",width:this.$.data("width")||200,height:this.$.data("height")||200,displayInput:this.$.data("displayinput")==null||this.$.data("displayinput"),displayPrevious:this.$.data("displayprevious"),fgColor:this.$.data("fgcolor")||"#87CEEB",inputColor:this.$.data("inputcolor")||this.$.data("fgcolor")||"#87CEEB",inline:!1,step:this.$.data("step")||1,draw:null,change:null,cancel:null,release:null},this.o),this.$.is("fieldset")?(this.v={},this.i=this.$.find("input"),this.i.each(function(t){var r=n(this);i.i[t]=r;i.v[t]=r.val();r.bind("change",function(){var n={};n[t]=r.val();i.val(n)})}),this.$.find("legend").remove()):(this.i=this.$,this.v=this.$.val(),this.v==""&&(this.v=this.o.min),this.$.bind("change",function(){i.val(i._validate(i.$.val()))})),this.o.displayInput||this.$.hide(),this.$c=n('<canvas width="'+this.o.width+'px" height="'+this.o.height+'px"><\/canvas>'),this.c=this.$c[0].getContext("2d"),this.$.wrap(n('<div style="'+(this.o.inline?"display:inline;":"")+"width:"+this.o.width+"px;height:"+this.o.height+'px;"><\/div>')).before(this.$c),this.v instanceof Object?(this.cv={},this.copy(this.v,this.cv)):this.cv=this.v,this.$.bind("configure",t).parent().bind("configure",t),this._listen()._configure()._xy().init(),this.isInit=!0,this._draw(),this};this._draw=function(){var t=!0,n=document.createElement("canvas");n.width=i.o.width;n.height=i.o.height;i.g=n.getContext("2d");i.clear();i.dH&&(t=i.dH());t!==!1&&i.draw();i.c.drawImage(n,0,0);n=null};this._touch=function(n){var r=function(n){var t=i.xy2val(n.originalEvent.touches[i.t].pageX,n.originalEvent.touches[i.t].pageY);t!=i.cv&&(i.cH&&i.cH(t)===!1||(i.change(i._validate(t)),i._draw()))};return this.t=t.c.t(n),r(n),t.c.d.bind("touchmove.k",r).bind("touchend.k",function(){(t.c.d.unbind("touchmove.k touchend.k"),i.rH&&i.rH(i.cv)===!1)||i.val(i.cv)}),this};this._mouse=function(n){var r=function(n){var t=i.xy2val(n.pageX,n.pageY);t!=i.cv&&(i.cH&&i.cH(t)===!1||(i.change(i._validate(t)),i._draw()))};return r(n),t.c.d.bind("mousemove.k",r).bind("keyup.k",function(n){if(n.keyCode===27){if(t.c.d.unbind("mouseup.k mousemove.k keyup.k"),i.eH&&i.eH()===!1)return;i.cancel()}}).bind("mouseup.k",function(){(t.c.d.unbind("mousemove.k mouseup.k keyup.k"),i.rH&&i.rH(i.cv)===!1)||i.val(i.cv)}),this};this._xy=function(){var n=this.$c.offset();return this.x=n.left,this.y=n.top,this};this._listen=function(){return this.o.readOnly?this.$.attr("readonly","readonly"):(this.$c.bind("mousedown",function(n){n.preventDefault();i._xy()._mouse(n)}).bind("touchstart",function(n){n.preventDefault();i._xy()._touch(n)}),this.listen()),this};this._configure=function(){return this.o.draw&&(this.dH=this.o.draw),this.o.change&&(this.cH=this.o.change),this.o.cancel&&(this.eH=this.o.cancel),this.o.release&&(this.rH=this.o.release),this.o.displayPrevious?(this.pColor=this.h2rgba(this.o.fgColor,"0.4"),this.fgColor=this.h2rgba(this.o.fgColor,"0.6")):this.fgColor=this.o.fgColor,this};this._clear=function(){this.$c[0].width=this.$c[0].width};this._validate=function(n){return~~((n<0?-.5:.5)+n/this.o.step)*this.o.step};this.listen=function(){};this.extend=function(){};this.init=function(){};this.change=function(){};this.val=function(){};this.xy2val=function(){};this.draw=function(){};this.clear=function(){this._clear()};this.h2rgba=function(n,t){var i;return n=n.substring(1,7),i=[parseInt(n.substring(0,2),16),parseInt(n.substring(2,4),16),parseInt(n.substring(4,6),16)],"rgba("+i[0]+","+i[1]+","+i[2]+","+t+")"};this.copy=function(n,t){for(var i in n)t[i]=n[i]}};t.Dial=function(){t.o.call(this);this.startAngle=null;this.xy=null;this.radius=null;this.lineWidth=null;this.cursorExt=null;this.w2=null;this.PI2=2*Math.PI;this.extend=function(){this.o=n.extend({bgColor:this.$.data("bgcolor")||"#EEEEEE",angleOffset:this.$.data("angleoffset")||0,angleArc:this.$.data("anglearc")||360,inline:!0},this.o)};this.val=function(n){if(null!=n)this.cv=this.o.stopper?i(r(n,this.o.max),this.o.min):n,this.v=this.cv,this.$.val(this.v),this._draw();else return this.v};this.xy2val=function(n,t){var u,f;return u=Math.atan2(n-(this.x+this.w2),-(t-this.y-this.w2))-this.angleOffset,this.angleArc!=this.PI2&&u<0&&u>-.5?u=0:u<0&&(u+=this.PI2),f=~~(.5+u*(this.o.max-this.o.min)/this.angleArc)+this.o.min,this.o.stopper&&(f=i(r(f,this.o.max),this.o.min)),f};this.listen=function(){var t=this,o=function(n){n.preventDefault();var i=n.originalEvent,r=i.detail||i.wheelDeltaX,u=i.detail||i.wheelDeltaY,f=parseInt(t.$.val())+(r>0||u>0?t.o.step:r<0||u<0?-t.o.step:0);t.cH&&t.cH(f)===!1||t.val(f)},f,u,e=1,s={37:-t.o.step,38:t.o.step,39:t.o.step,40:-t.o.step};this.$.bind("keydown",function(o){var h=o.keyCode,c;h>=96&&h<=105&&(h=o.keyCode=h-48);f=parseInt(String.fromCharCode(h));isNaN(f)&&(h!==13&&h!==8&&h!==9&&h!==189&&o.preventDefault(),n.inArray(h,[37,38,39,40])>-1&&(o.preventDefault(),c=parseInt(t.$.val())+s[h]*e,t.o.stopper&&(c=i(r(c,t.o.max),t.o.min)),t.change(c),t._draw(),u=window.setTimeout(function(){e*=2},30)))}).bind("keyup",function(){isNaN(f)?u&&(window.clearTimeout(u),u=null,e=1,t.val(t.$.val())):t.$.val()>t.o.max&&t.$.val(t.o.max)||t.$.val()<t.o.min&&t.$.val(t.o.min)});this.$c.bind("mousewheel DOMMouseScroll",o);this.$.bind("mousewheel DOMMouseScroll",o)};this.init=function(){(this.v<this.o.min||this.v>this.o.max)&&(this.v=this.o.min);this.$.val(this.v);this.w2=this.o.width/2;this.cursorExt=this.o.cursor/100;this.xy=this.w2;this.lineWidth=this.xy*this.o.thickness;this.lineCap=this.o.lineCap;this.radius=this.xy-this.lineWidth/2;this.o.angleOffset&&(this.o.angleOffset=isNaN(this.o.angleOffset)?0:this.o.angleOffset);this.o.angleArc&&(this.o.angleArc=isNaN(this.o.angleArc)?this.PI2:this.o.angleArc);this.angleOffset=this.o.angleOffset*Math.PI/180;this.angleArc=this.o.angleArc*Math.PI/180;this.startAngle=1.5*Math.PI+this.angleOffset;this.endAngle=1.5*Math.PI+this.angleOffset+this.angleArc;var n=i(String(Math.abs(this.o.max)).length,String(Math.abs(this.o.min)).length,2)+2;this.o.displayInput&&this.i.css({width:(this.o.width/2+4>>0)+"px",height:(this.o.width/3>>0)+"px",position:"absolute","vertical-align":"middle","margin-top":(this.o.width/3>>0)+"px","margin-left":"-"+(this.o.width*3/4+2>>0)+"px",border:0,background:"none",font:"bold "+(this.o.width/n>>0)+"px Arial","text-align":"center",color:this.o.inputColor||this.o.fgColor,padding:"0px","-webkit-appearance":"none"})||this.i.css({width:"0px",visibility:"hidden"})};this.change=function(n){this.cv=n;this.$.val(n)};this.angle=function(n){return(n-this.o.min)*this.angleArc/(this.o.max-this.o.min)};this.draw=function(){var n=this.g,e=this.angle(this.cv),r=this.startAngle,i=r+e,u,t,f=1;n.lineWidth=this.lineWidth;n.lineCap=this.lineCap;this.o.cursor&&(r=i-this.cursorExt)&&(i=i+this.cursorExt);n.beginPath();n.strokeStyle=this.o.bgColor;n.arc(this.xy,this.xy,this.radius,this.endAngle,this.startAngle,!0);n.stroke();this.o.displayPrevious&&(t=this.startAngle+this.angle(this.v),u=this.startAngle,this.o.cursor&&(u=t-this.cursorExt)&&(t=t+this.cursorExt),n.beginPath(),n.strokeStyle=this.pColor,n.arc(this.xy,this.xy,this.radius,u,t,!1),n.stroke(),f=this.cv==this.v);n.beginPath();n.strokeStyle=f?this.o.fgColor:this.fgColor;n.arc(this.xy,this.xy,this.radius,r,i,!1);n.stroke()};this.cancel=function(){this.val(this.v)}};n.fn.dial=n.fn.knob=function(i){return this.each(function(){var r=new t.Dial;r.o=i;r.$=n(this);r.run()}).parent()}}(jQuery)