-111 Removals
+435 Additions
1<!DOCTYPE html>1<!DOCTYPE html>
2<html>2<html>
3<head>3<head>
4 <meta http-equiv="cache-control" content="public">4 <meta http-equiv="cache-control" content="public">
5 <meta http-equiv="content-type" content="text/html; charset=UTF-8">5 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
6 <meta name="KEYWORDS" content="discovery navmap map freelancer space error sirius html5 css3 new">6 <meta name="KEYWORDS" content="discovery navmap map freelancer space error sirius html5 css3 new">
7 <meta name="DESCRIPTION" content="An online version of Discovery Freelancer's in-game navigation map with quite a few extras.">7 <meta name="DESCRIPTION" content="An online version of Discovery Freelancer's in-game navigation map with quite a few extras.">
8 <!--<link href="" rel="shortcut icon" type="image/x-icon">-->8 <!--<link href="" rel="shortcut icon" type="image/x-icon">-->
9 <title>Discovery Navmap</title>9 <title>Discovery Navmap</title>
10 <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>10 <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
11 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">11 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
12 <script>12 <script>
13 !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function o(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function t(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(c," ")),u.json?JSON.parse(e):e}catch(n){}}function r(n,o){var i=u.raw?n:t(n);return e.isFunction(o)?o(i):i}var c=/\+/g,u=e.cookie=function(t,c,s){if(arguments.length>1&&!e.isFunction(c)){if(s=e.extend({},u.defaults,s),"number"==typeof s.expires){var a=s.expires,d=s.expires=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*a)}return document.cookie=[n(t),"=",i(c),s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("")}for(var f=t?void 0:{},p=document.cookie?document.cookie.split("; "):[],l=0,m=p.length;m>l;l++){var x=p[l].split("="),g=o(x.shift()),j=x.join("=");if(t===g){f=r(j,c);break}t||void 0===(j=r(j))||(f[g]=j)}return f};u.defaults={},e.removeCookie=function(n,o){return e.cookie(n,"",e.extend({},o,{expires:-1})),!e.cookie(n)}});13 !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function o(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function t(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(c," ")),u.json?JSON.parse(e):e}catch(n){}}function r(n,o){var i=u.raw?n:t(n);return e.isFunction(o)?o(i):i}var c=/\+/g,u=e.cookie=function(t,c,s){if(arguments.length>1&&!e.isFunction(c)){if(s=e.extend({},u.defaults,s),"number"==typeof s.expires){var a=s.expires,d=s.expires=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*a)}return document.cookie=[n(t),"=",i(c),s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("")}for(var f=t?void 0:{},p=document.cookie?document.cookie.split("; "):[],l=0,m=p.length;m>l;l++){var x=p[l].split("="),g=o(x.shift()),j=x.join("=");if(t===g){f=r(j,c);break}t||void 0===(j=r(j))||(f[g]=j)}return f};u.defaults={},e.removeCookie=function(n,o){return e.cookie(n,"",e.extend({},o,{expires:-1})),!e.cookie(n)}});
14 var dataRootPath = "v48818/";14 var dataRootPath = "v48818/";
15 var nameRegex = /nickname = (.*)/g;15 var nameRegex = /nickname = (.*)/g;
16 var idsNameRegex = /ids_name = (.*)/g;16 var idsNameRegex = /ids_name = (.*)/g;
17 var idsSysNameRegex = /strid_name = (.*)/g;17 var idsSysNameRegex = /strid_name = (.*)/g;
18 var atmosphereRadiusRegex = /atmosphere_range = (.*)/g;18 var atmosphereRadiusRegex = /atmosphere_range = (.*)/g;
19 var sysNameRegex = /system = (.*)/g;19 var sysNameRegex = /system = (.*)/g;
20 var idsInfoRegex = /ids_info = (.*)/g;20 var idsInfoRegex = /ids_info = (.*)/g;
21 var scaleRegex = /navmapscale = (.*)/g;21 var scaleRegex = /navmapscale = (.*)/g;
22 var currentSystemNickname = "Sirius";22 var currentSystemNickname = "Sirius";
23 var baseNameFile = dataRootPath+"gamedata_bases.txt";23 var baseNameFile = dataRootPath+"gamedata_bases.txt";
24 var systemNameFile = dataRootPath+"special_systems.txt";24 var systemNameFile = dataRootPath+"special_systems.txt";
25 var factionNameFile = dataRootPath+"gamedata_factions.txt";25 var factionNameFile = dataRootPath+"gamedata_factions.txt";
26 var commodityNameFile = dataRootPath+"gamedata_cargo.txt";26 var commodityNameFile = dataRootPath+"gamedata_cargo.txt";
27 var systemPathFile = dataRootPath+"universe/systems_shortest_path.ini";27 var systemPathFile = dataRootPath+"universe/systems_shortest_path.ini";
28 var systemLegalPathFile = dataRootPath+"universe/shortest_legal_path.ini";28 var systemLegalPathFile = dataRootPath+"universe/shortest_legal_path.ini";
29 var infocardFile = dataRootPath+"infocards.txt";29 var infocardFile = dataRootPath+"infocards.txt";
30 var universeFile = dataRootPath+"universe/universe.ini";30 var universeFile = dataRootPath+"universe/universe.ini";
31 var objectRegex = /(\n[^\r\n;]*\[[Oo]bject\])([^;\[]*(?=\n\w*|$))/g;31 var objectRegex = /(\n[^\r\n;]*\[[Oo]bject\])([^;\[]*(?=\n\w*|$))/g;
32 var zoneRegex = /(\n[^\r\n;]*\[[Zz]one\])([^;\[]*(?=\n\w*|$))/g;32 var zoneRegex = /(\n[^\r\n;]*\[[Zz]one\])([^;\[]*(?=\n\w*|$))/g;
33 var zoneNicknameRegex = /zone = (.*)/g;33 var zoneNicknameRegex = /zone = (.*)/g;
34 var asteroidsRegex = /(\[Asteroids\])(\r\n.+)*/g;34 var asteroidsRegex = /(\[Asteroids\])(\r\n.+)*/g;
35 var lootableZoneRegex = /(\n[^\r\n;]*\[LootableZone\])([^;\[]*(?=\n\w*|$))/g;35 var lootableZoneRegex = /(\n[^\r\n;]*\[LootableZone\])([^;\[]*(?=\n\w*|$))/g;
36 var lootableZoneDynamicCommodityRegex = /dynamic_loot_commodity = (.*)/g;36 var lootableZoneDynamicCommodityRegex = /dynamic_loot_commodity = (.*)/g;
37 var lootableZoneDynamicDifficultyRegex = /dynamic_loot_difficulty = (.*)/g;37 var lootableZoneDynamicDifficultyRegex = /dynamic_loot_difficulty = (.*)/g;
38 var lootableZoneDynamicCountRegex = /dynamic_loot_count = (.*)/g;38 var lootableZoneDynamicCountRegex = /dynamic_loot_count = (.*)/g;
39 var lootableZoneAsteroidCommodityRegex = /asteroid_loot_commodity = (.*)/g;39 var lootableZoneAsteroidCommodityRegex = /asteroid_loot_commodity = (.*)/g;
40 var lootableZoneAsteroidDifficultyRegex = /asteroid_loot_difficulty = (.*)/g;40 var lootableZoneAsteroidDifficultyRegex = /asteroid_loot_difficulty = (.*)/g;
41 var lootableZoneAsteroidCountRegex = /asteroid_loot_count = (.*)/g;41 var lootableZoneAsteroidCountRegex = /asteroid_loot_count = (.*)/g;
42 var activeAsteroidGetRequests = -1;42 var activeAsteroidGetRequests = -1;
43 var ambientRegex = /(\[Ambient\])(\r\n.+)*/g;43 var ambientRegex = /(\[Ambient\])(\r\n.+)*/g;
44 var systemRegex = /(\[system\])(\r\n.+)*/g;44 var systemRegex = /(\[system\])(\r\n.+)*/g;
45 var baseRegex = /(\[Base\])(\r\n.+)*/g;45 var baseRegex = /(\[Base\])(\r\n.+)*/g;
46 var posRegex = /pos = (.*)/g;46 var posRegex = /pos = (.*)/g;
47 var sizeRegex = /size = (.*)/g;47 var sizeRegex = /size = (.*)/g;
48 var repRegex = /reputation = (.*)/g;48 var repRegex = /reputation = (.*)/g;
49 var pathRegex = /Path = (.*)/g;49 var pathRegex = /Path = (.*)/g;
50 var gotoRegex = /goto = (.*)/g;50 var gotoRegex = /goto = (.*)/g;
51 var burnColourRegex = /burn_color = (.*)/g;51 var burnColourRegex = /burn_color = (.*)/g;
52 var colourRegex = /color = (.*)/g52 var colourRegex = /color = (.*)/g
53 var fogColourRegex = /property_fog_color = (.*)/g;53 var fogColourRegex = /property_fog_color = (.*)/g;
54 var zoneTypeRegex = /property_flags = (.*)/g;54 var zoneTypeRegex = /property_flags = (.*)/g;
55 var nameRegex = /nickname = (.*)/g;55 var nameRegex = /nickname = (.*)/g;
56 var rotationRegex = /rotate = (.*)/g;56 var rotationRegex = /rotate = (.*)/g;
57 var textRegex = /(<(text|TEXT)>.+?<\/(text|TEXT)>|<(para|PARA)\/>)/g;57 var textRegex = /(<(text|TEXT)>.+?<\/(text|TEXT)>|<(para|PARA)\/>)/g;
58 var oorpArray = ["li11","br17","br19","ew63","ga11","ga13","ga09","ga12","ga05","ga06","ga10","ga14","br10","iw09","li06","ca01","ev01","bw14", "bw13","st02c","st03b","hi19","hi22","hi08","hi08","ew37", "ku15", "li07"];58 var oorpArray = ["li11","br17","br19","ew63","ga11","ga13","ga09","ga12","ga05","ga06","ga10","ga14","br10","iw09","li06","ca01","ev01","bw14", "bw13","st02c","st03b","hi19","hi22","hi08","hi08","ew37", "ku15", "li07"];
59 var systemScaleFactor = 1;59 var systemScaleFactor = 1;
60 var searchTimedOut = "nope";60 var searchTimedOut = "nope";
61 var universeFileGetResult;61 var universeFileGetResult;
62 var prevResponsiveState;
63 var lastSearch;
64 var longSystemName;
62 65
63 var baseNameArray = {};66 var baseNameArray = {};
64 var systemNameArray = {};67 var systemNameArray = {};
65 var systemClassArray = {};68 var systemClassArray = {};
66 var systemIdsNameArray = {};69 var systemIdsNameArray = {};
67 var systemIdsNameArrayState = "nope";70 var systemIdsNameArrayState = "nope";
68 var searchArray = {};71 var searchArray = {};
69 var matchArray = [];72 var matchArray = [];
70 var searchArrayState = "nope";73 var searchArrayState = "nope";
71 var systemPosArray = {};74 var systemPosArray = {};
72 var systemPosArrayState = "nope";75 var systemPosArrayState = "nope";
73 var systemInfoArray = {};76 var systemInfoArray = {};
74 var systemScaleFactorArray = {};77 var systemScaleFactorArray = {};
75 var systemScaleFactorArrayState = "nope";78 var systemScaleFactorArrayState = "nope";
76 var infocardArray = {};79 var infocardArray = {};
77 var infocardArrayState = "nope";80 var infocardArrayState = "nope";
78 var baseSystemArray = {};81 var baseSystemArray = {};
79 var baseSystemArrayState = "nope";82 var baseSystemArrayState = "nope";
80 var factionNameArray = {};83 var factionNameArray = {};
81 var factionNameArrayState = "nope";84 var factionNameArrayState = "nope";
82 var commodityNameArray = {};85 var commodityNameArray = {};
83 var commodityNameArrayState = "nope";86 var commodityNameArrayState = "nope";
84 var connectionArray = {};87 var connectionArray = {};
85 var connectionArrayState = "nope";88 var connectionArrayState = "nope";
86 var jgConnectionArray = {};89 var jgConnectionArray = {};
87 var jgConnectionArrayState = "nope";90 var jgConnectionArrayState = "nope";
88 var systemConnectionState = "nope";91 var systemConnectionState = "nope";
89 var universeMapState = "nope";92 var universeMapState = "nope";
90 var sysLootableZoneArray = {};93 var sysLootableZoneArray = {};
91 var asteroidsURIArray = {};94 var asteroidsURIArray = {};
92 var zoneFlagArray = {95 var zoneFlagArray = {
93 0: "zoneHidden",96 0: "zoneHidden",
94 64: "zoneRockAsteroids",97 64: "zoneRockAsteroids",
95 65: "zoneAlphaBigDust",98 65: "zoneAlphaBigDust",
96 66: "zoneRock",99 66: "zoneRock",
97 74: "zoneLeedsUraniumAsteroids",100 74: "zoneLeedsUraniumAsteroids",
98 82: "zoneDublinGoldField",101 82: "zoneDublinGoldField",
99 128: "zoneJerseyDebris",102 128: "zoneJerseyDebris",
100 129: "zoneDetroitDebrisNormal",103 129: "zoneDetroitDebrisNormal",
101 130: "zoneDetroitDebrisHigh",104 130: "zoneDetroitDebrisHigh",
102 132: "zoneDetroitDebrisLow",105 132: "zoneDetroitDebrisLow",
103 256: "zoneIceAsteroidsSmall",106 256: "zoneIceAsteroidsSmall",
104 257: "zoneIceAsteroidsTau37",107 257: "zoneIceAsteroidsTau37",
105 258: "zoneIceAsteroids1",108 258: "zoneIceAsteroids1",
106 512: "zoneLavaRocks",109 512: "zoneLavaRocks",
107 513: "zoneVonRoheBeltLavaRocks",110 513: "zoneVonRoheBeltLavaRocks",
108 514: "zoneDresdenLavaRocks",111 514: "zoneDresdenLavaRocks",
109 1024: "zoneGreenAsteroids",112 1024: "zoneGreenAsteroids",
110 1026: "zoneZetaGreenAsteroids",113 1026: "zoneZetaGreenAsteroids",
111 2049: "zoneIceAsteroids2",114 2049: "zoneIceAsteroids2",
112 4096: "zoneMinefield1",115 4096: "zoneMinefield1",
113 4128: "zoneMinefield2",116 4128: "zoneMinefield2",
114 8192: "zoneAsteroidField",117 8192: "zoneAsteroidField",
115 8200: "zoneAsteroids",118 8200: "zoneAsteroids",
116 16400: "zoneIceNebula",119 16400: "zoneIceNebula",
117 32768: "zoneDresdenFog",120 32768: "zoneDresdenFog",
118 32776: "zoneLeedsSmog",121 32776: "zoneLeedsSmog",
119 32833: "zoneChugokuCloud",122 32833: "zoneChugokuCloud",
120 62768: "zoneNebulaWithFogColour",123 62768: "zoneNebulaWithFogColour",
121 65536: "zoneExclusion1",124 65536: "zoneExclusion1",
122 131072: "zoneExclusion2",125 131072: "zoneExclusion2",
123 196608: "zoneExclusion3"126 196608: "zoneExclusion3"
124 };127 };
125 128
126 function updateCookie(){129 function updateCookie(){
127 var elementValues = {};130 var elementValues = {};
128 $(":checkbox").each(function(){131 $(":checkbox").each(function(){
129 elementValues[this.id] = this.checked;132 elementValues[this.id] = this.checked;
130 });133 });
131134
132 elementValues["buttonText"] = $("button").text();135 elementValues["buttonText"] = $("button").text();
133 $.cookie('elementValues', elementValues, { expires: 7, path: '/' })136 $.cookie('elementValues', elementValues, { expires: 7, path: '/' })
134 }137 }
135138
136 function repopulateFormElements(){139 function repopulateFormElements(){
137 var elementValues = $.cookie('elementValues');140 var elementValues = $.cookie('elementValues');
138 if (elementValues){141 if (elementValues){
139 Object.keys(elementValues).forEach(function(element) {142 Object.keys(elementValues).forEach(function(element) {
140 var checked = elementValues[element];143 var checked = elementValues[element];
141 $("#" + element).prop('checked', checked);144 $("#" + element).prop('checked', checked);
142 });145 });
143 $("button").text(elementValues["buttonText"]);146 $("button").text(elementValues["buttonText"]);
144 }147 }
145 }148 }
146 149
147 $(document).ready(function () {150 $(document).ready(function () {
148 $(":checkbox").on("change", function(){151 $(":checkbox").on("change", function(){
149 updateCookie();152 updateCookie();
150 updateConfigClasses();153 updateConfigClasses();
151 });154 });
152155
153 $("#configButton").click(function(event) {156 $("#configButton").click(function(event) {
154 toggleConfigMenu();157 toggleConfigMenu();
155 event.stopPropagation();158 event.stopPropagation();
156 });159 });
157 160
158 $("#screenshotButton").click(function(event) {161 $("#screenshotButton").click(function(event) {
159 $("body").toggleClass("screenshotMode");162 $("body").toggleClass("screenshotMode");
160 });163 });
161164
162 $.cookie.json = true;165 $.cookie.json = true;
163 repopulateFormElements();166 repopulateFormElements();
167 // initialise rising/falling edge detector
168 prevResponsiveState = "init";
169 /* if (document.querySelector(".configOption#responsive input").checked) {
170 prevResponsiveState = "checked";
171 } else {
172 prevResponsiveState = "unchecked";
173 } */
164 updateConfigClasses();174 updateConfigClasses();
165 });175 });
166 176
167 function toggleConfigMenu () {177 function toggleConfigMenu () {
168 $(".configMenu").toggleClass("closed");178 $(".configMenu").toggleClass("closed");
169 console.log("configMenu toggled");179 console.log("configMenu toggled");
170 if (document.querySelector(".configMenu").className.indexOf("closed") == -1) {180 if (document.querySelector(".configMenu").className.indexOf("closed") == -1) {
171 $('html').click(function() {181 $('html').click(function() {
172 $(".configMenu").addClass("closed");182 $(".configMenu").addClass("closed");
173 });183 });
174 $(".configMenu").click(function(event){184 $(".configMenu").click(function(event){
175 event.stopPropagation();185 event.stopPropagation();
176 });186 });
177 } else {187 } else {
178 $("html").unbind("click");188 $("html").unbind("click");
179 $(".configMenu").unbind("click");189 $(".configMenu").unbind("click");
180 }190 }
181 }191 }
182 192
183 function updateConfigClasses() {193 function updateConfigClasses() {
184 if (document.querySelector(".configOption#wrecks input").checked) {194 if (document.querySelector(".configOption#wrecks input").checked) {
185 $(".object.wreck").removeClass("hidden");195 $(".object.wreck").removeClass("hidden");
196 $(".map .object.wreck label").hAlign();
186 } else {197 } else {
187 $(".object.wreck").addClass("hidden");198 $(".object.wreck").addClass("hidden");
188 }199 }
200 if (document.querySelector(".configOption#wreckLabels input").checked) {
201 $(".object.wreck label").removeClass("hidden");
202 $(".map .object.wreck label").hAlign();
203 } else {
204 $(".object.wreck label").addClass("hidden");
205 }
206 console.log("prevResponsiveState = "+prevResponsiveState);
207 if (document.querySelector(".configOption#responsive input").checked && (prevResponsiveState == "unchecked" | prevResponsiveState == "init")) {
208 $(".systemConnection").remove();
209 $("body").addClass("responsive");
210 prevResponsiveState = "checked";
211 generateSystemConnections();
212 } else if (!document.querySelector(".configOption#responsive input").checked && prevResponsiveState == "checked" | prevResponsiveState == "init") {
213 $(".systemConnection").remove();
214 $("body").removeClass("responsive");
215 prevResponsiveState = "unchecked";
216 generateSystemConnections();
217 }
218 if (document.querySelector(".configOption#zoneLabels input").checked) {
219 $(".zone label").not($(".mineable label")).removeClass("hidden");
220 $(".map .zone label").hAlign();
221 } else {
222 $(".zone label").not($(".mineable label")).addClass("hidden");
223 }
189 if (document.querySelector(".configOption#zones input").checked) {224 if (document.querySelector(".configOption#zones input").checked) {
190 $(".zone").removeClass("hidden");225 $(".zone").removeClass("hidden");
226 $(".map .zone label").hAlign();
191 } else {227 } else {
192 $(".zone").addClass("hidden");228 $(".zone").addClass("hidden");
193 }229 }
194 if (document.querySelector(".configOption#connections input").checked230 if (document.querySelector(".configOption#connections input").checked
195 && document.querySelector(".systemConnectionProp") == null) {231 && document.querySelector(".systemConnectionProp") == null) {
196 generateSystemConnections();232 generateSystemConnections();
197 if (document.querySelector(".map .system") == null) {233 if (document.querySelector(".map .system") == null) {
198 $(".systemConnectionProp").hide();234 $(".systemConnectionProp").hide();
199 }235 }
200 } else if (!(document.querySelector(".configOption#connections input").checked)) {236 } else if (!(document.querySelector(".configOption#connections input").checked)) {
201 $(".systemConnectionProp").hide();237 $(".systemConnectionProp").hide();
202 } else if (document.querySelector(".configOption#connections input").checked238 } else if (document.querySelector(".configOption#connections input").checked
203 && document.querySelector(".map .system") !== null) {239 && document.querySelector(".map .system") !== null) {
204 $(".systemConnectionProp").show();240 $(".systemConnectionProp").show();
205 }241 }
206 if (document.querySelector(".configOption#oorp input").checked) {242 if (document.querySelector(".configOption#oorp input").checked) {
207 $(".oorp").removeClass("hidden");243 $(".oorp").removeClass("hidden");
208 $(".map .system.oorp label").hAlign();244 $(".map .system.oorp label").hAlign();
209 } else {245 } else {
210 $(".oorp").addClass("hidden");246 $(".oorp").addClass("hidden");
211 }247 }
212 generateSystemScale(currentSystem);248 generateSystemScale(currentSystem);
213 if (document.querySelector(".map .system") == null) {249 if (document.querySelector(".map .system") == null) {
214 $(".systemConnectionProp").hide();250 $(".systemConnectionProp").hide();
215 }251 }
252 console.log("config classes updated");
216 }253 }
217 254
218 var currentSystem;255 var currentSystem;
219 256
220 function generateSystemScale(system) {257 function generateSystemScale(system) {
221 if (document.querySelector(".mapScale") != null) {258 if (document.querySelector(".mapScale") != null) {
222 currentSystem = system;259 currentSystem = system;
223 if (document.querySelector(".configOption#scale input").checked) {260 if (document.querySelector(".configOption#scale input").checked) {
224 $(".mapScale").addClass("arrows");261 $(".mapScale").addClass("arrows");
225 baseSize = 30;262 baseSize = 30;
226 } else {263 } else {
227 $(".mapScale").removeClass("arrows");264 $(".mapScale").removeClass("arrows");
228 baseSize = 27.5;265 baseSize = 27.5;
229 }266 }
230 if (typeof systemScaleFactorArray[system.toLowerCase()] === "undefined") {267 if (typeof systemScaleFactorArray[system.toLowerCase()] === "undefined") {
231 document.querySelector(".mapScale h2").innerHTML = baseSize+"k";268 document.querySelector(".mapScale h2").innerHTML = baseSize+"k";
232 } else {269 } else {
233 document.querySelector(".mapScale h2").innerHTML = (Math.round(baseSize/systemScaleFactorArray[system.toLowerCase()]*10) / 10)+"K";270 document.querySelector(".mapScale h2").innerHTML = (Math.round(baseSize/systemScaleFactorArray[system.toLowerCase()]*10) / 10)+"K";
234 }271 }
235 }272 }
236 }273 }
237 274
238 function generateLookupArrays() {275 function generateLookupArrays() {
239 $.get(baseNameFile, function(data) {276 $.get(baseNameFile, function(data) {
240 var nameArray = data.split("\n");277 var nameArray = data.split("\n");
241 for (i = 0; i < nameArray.length; i++) { 278 for (i = 0; i < nameArray.length; i++) {
242 var keyPairArray = nameArray[i].split(" = ");279 var keyPairArray = nameArray[i].split(" = ");
243 baseNameArray[keyPairArray[0].toLowerCase()] = keyPairArray[1];280 baseNameArray[keyPairArray[0].toLowerCase()] = keyPairArray[1];
244 }281 }
245 });282 });
246 283
247 $.get(systemNameFile, function(data) {284 $.get(systemNameFile, function(data) {
248 var nameArray = data.split("\n");285 var nameArray = data.split("\n");
249 for (i = 0; i < nameArray.length; i++) { 286 for (i = 0; i < nameArray.length; i++) {
250 var keyPairArray = nameArray[i].split(" = ");287 var keyPairArray = nameArray[i].split(" = ");
251 systemNameArray[keyPairArray[0].toLowerCase()] = keyPairArray[1];288 systemNameArray[keyPairArray[0].toLowerCase()] = keyPairArray[1];
252 systemClassArray[keyPairArray[0].toLowerCase()] = keyPairArray[1].toString().slice(0,2).toLowerCase();289 systemClassArray[keyPairArray[0].toLowerCase()] = keyPairArray[1].toString().slice(0,2).toLowerCase();
253 }290 }
254 });291 });
255292
256 $.get(commodityNameFile, function(data) {293 $.get(commodityNameFile, function(data) {
257 var nameArray = data.split("\n");294 var nameArray = data.split("\n");
258 for (i = 0; i < nameArray.length; i++) { 295 for (i = 0; i < nameArray.length; i++) {
259 var keyPairArray = nameArray[i].substring(13).split(", ");296 var keyPairArray = nameArray[i].substring(13).split(", ");
260 commodityNameArray[keyPairArray[0].toLowerCase()] = keyPairArray[1];297 commodityNameArray[keyPairArray[0].toLowerCase()] = keyPairArray[1];
261 }298 }
262 });299 });
263300
264 $.get(factionNameFile, function(data) {301 $.get(factionNameFile, function(data) {
265 var nameArray = data.split("\n");302 var nameArray = data.split("\n");
266 for (i = 0; i < nameArray.length; i++) { 303 for (i = 0; i < nameArray.length; i++) {
267 var keyPairArray = nameArray[i].split(" = ");304 var keyPairArray = nameArray[i].split(" = ");
268 factionNameArray[keyPairArray[0].toLowerCase()] = keyPairArray[1].trim();305 factionNameArray[keyPairArray[0].toLowerCase()] = keyPairArray[1].trim();
269 }306 }
270 });307 });
271 308
272 $.get(infocardFile, function(data) {309 $.get(infocardFile, function(data) {
273 var rawInfocardArray = data.split("\r\n");310 var rawInfocardArray = data.split("\r\n");
274 for (i = 0; i < rawInfocardArray.length-1; i += 2) { 311 for (i = 0; i < rawInfocardArray.length-1; i += 2) {
275 infocardArray[rawInfocardArray[i].toString()] = rawInfocardArray[i+1].toString();312 infocardArray[rawInfocardArray[i].toString()] = rawInfocardArray[i+1].toString();
276 }313 }
277 infocardArrayState = "ready";314 infocardArrayState = "ready";
278 console.log("Infocard lookup array generated");315 console.log("Infocard lookup array generated");
279 });316 });
280 317
281 $.get(systemPathFile, function(data) {318 $.get(systemPathFile, function(data) {
282 var rawPathFileArray = data.split("\r\n");319 var rawPathFileArray = data.split("\r\n");
283 for (i = 0; i < rawPathFileArray.length; i++) { 320 for (i = 0; i < rawPathFileArray.length; i++) {
284 if (rawPathFileArray[i].indexOf("Path =") != -1) {321 if (rawPathFileArray[i].indexOf("Path =") != -1) {
285 var currentConnection = rawPathFileArray[i].match(pathRegex).join().substring(7).replace(/ /g,"").split(",");322 var currentConnection = rawPathFileArray[i].match(pathRegex).join().substring(7).replace(/ /g,"").split(",");
286 if (typeof currentConnection[3] !== "undefined") {323 if (typeof currentConnection[3] !== "undefined") {
287 var lowCurrentConnection = currentConnection[0].trim().toLowerCase();324 var lowCurrentConnection = currentConnection[0].trim().toLowerCase();
288 if (typeof connectionArray[lowCurrentConnection] == "undefined") {325 if (typeof connectionArray[lowCurrentConnection] == "undefined") {
289 connectionArray[lowCurrentConnection] = [currentConnection[3].trim().toLowerCase()];326 connectionArray[lowCurrentConnection] = [currentConnection[3].trim().toLowerCase()];
290 }327 }
291 if (connectionArray[lowCurrentConnection].indexOf(currentConnection[3].trim().toLowerCase()) == -1) {328 if (connectionArray[lowCurrentConnection].indexOf(currentConnection[3].trim().toLowerCase()) == -1) {
292 connectionArray[lowCurrentConnection].push(currentConnection[3].trim().toLowerCase());329 connectionArray[lowCurrentConnection].push(currentConnection[3].trim().toLowerCase());
293 }330 }
294 }331 }
295 }332 }
296 }333 }
297 connectionArrayState = "ready";334 connectionArrayState = "ready";
298 console.log("Connection lookup array generated");335 console.log("Connection lookup array generated");
299 });336 });
300 337
301 $.get(systemLegalPathFile, function(data) {338 $.get(systemLegalPathFile, function(data) {
302 var rawLegalPathFileArray = data.split("\r\n");339 var rawLegalPathFileArray = data.split("\r\n");
303 for (i = 0; i < rawLegalPathFileArray.length; i++) { 340 for (i = 0; i < rawLegalPathFileArray.length; i++) {
304 if (rawLegalPathFileArray[i].indexOf("Path =") != -1) {341 if (rawLegalPathFileArray[i].indexOf("Path =") != -1) {
305 var currentConnection = rawLegalPathFileArray[i].match(pathRegex).join().substring(7).replace(/ /g,"").split(",");342 var currentConnection = rawLegalPathFileArray[i].match(pathRegex).join().substring(7).replace(/ /g,"").split(",");
306 if (typeof currentConnection[3] !== "undefined") {343 if (typeof currentConnection[3] !== "undefined") {
307 var lowCurrentConnection = currentConnection[0].trim().toLowerCase();344 var lowCurrentConnection = currentConnection[0].trim().toLowerCase();
308 if (typeof jgConnectionArray[lowCurrentConnection] == "undefined") {345 if (typeof jgConnectionArray[lowCurrentConnection] == "undefined") {
309 jgConnectionArray[lowCurrentConnection] = [currentConnection[3].trim().toLowerCase()];346 jgConnectionArray[lowCurrentConnection] = [currentConnection[3].trim().toLowerCase()];
310 }347 }
311 if (jgConnectionArray[lowCurrentConnection].indexOf(currentConnection[3].trim().toLowerCase()) == -1) {348 if (jgConnectionArray[lowCurrentConnection].indexOf(currentConnection[3].trim().toLowerCase()) == -1) {
312 jgConnectionArray[lowCurrentConnection].push(currentConnection[3].trim().toLowerCase());349 jgConnectionArray[lowCurrentConnection].push(currentConnection[3].trim().toLowerCase());
313 }350 }
314 }351 }
315 }352 }
316 }353 }
317 jgConnectionArrayState = "ready";354 jgConnectionArrayState = "ready";
318 console.log("Jumpgate connection lookup array generated");355 console.log("Jumpgate connection lookup array generated");
319 });356 });
320 357
321 $.get(universeFile, function(data) {358 $.get(universeFile, function(data) {
322 universeFileGetResult = data;359 universeFileGetResult = data;
323 var universeArray = data.match(systemRegex);360 var universeArray = data.match(systemRegex);
324 for (i = 0; i < universeArray.length; i++) {361 for (i = 0; i < universeArray.length; i++) {
325 if (universeArray[i].toLowerCase().indexOf("strid_name =") != -1) {362 if (universeArray[i].toLowerCase().indexOf("strid_name =") != -1) {
326 var sysNameIds = universeArray[i].toLowerCase().match(idsSysNameRegex).join().substring(13);363 var sysNameIds = universeArray[i].toLowerCase().match(idsSysNameRegex).join().substring(13);
327 var nameString = universeArray[i].toLowerCase().match(nameRegex).join().substring(11);364 var nameString = universeArray[i].toLowerCase().match(nameRegex).join().substring(11);
328 systemIdsNameArray[nameString.toLowerCase()] = sysNameIds;365 systemIdsNameArray[nameString.toLowerCase()] = sysNameIds;
329 }366 }
330 if (universeArray[i].toLowerCase().indexOf("pos =") != -1) {367 if (universeArray[i].toLowerCase().indexOf("pos =") != -1) {
331 var sysPos = universeArray[i].toLowerCase().match(posRegex).join().substring(6).replace(/ /g,"").split(",");368 var sysPos = universeArray[i].toLowerCase().match(posRegex).join().substring(6).replace(/ /g,"").split(",");
332 var nameString = universeArray[i].toLowerCase().match(nameRegex).join().substring(11);369 var nameString = universeArray[i].toLowerCase().match(nameRegex).join().substring(11);
333 systemPosArray[nameString.toLowerCase()] = sysPos;370 systemPosArray[nameString.toLowerCase()] = sysPos;
334 }371 }
335 if (universeArray[i].toLowerCase().indexOf("navmapscale") != -1) {372 if (universeArray[i].toLowerCase().indexOf("navmapscale") != -1) {
336 var scaleFactor = universeArray[i].toLowerCase().match(scaleRegex).join().substring(14);373 var scaleFactor = universeArray[i].toLowerCase().match(scaleRegex).join().substring(14);
337 var nameString = universeArray[i].toLowerCase().match(nameRegex).join().substring(11);374 var nameString = universeArray[i].toLowerCase().match(nameRegex).join().substring(11);
338 systemScaleFactorArray[nameString.toLowerCase()] = parseFloat(scaleFactor);375 systemScaleFactorArray[nameString.toLowerCase()] = parseFloat(scaleFactor);
339 }376 }
340 }377 }
341 systemPosArray["ev01"] = [-1,17];378 systemPosArray["ev01"] = [-1,17];
342 systemIdsNameArrayState = "ready";379 systemIdsNameArrayState = "ready";
343 systemScaleFactorArrayState = "ready";380 systemScaleFactorArrayState = "ready";
344 systemPosArrayState = "ready";381 systemPosArrayState = "ready";
345 console.log("System scale lookup array generated");382 console.log("System scale lookup array generated");
346 console.log("Universe map position lookup array generated");383 console.log("Universe map position lookup array generated");
347 console.log("System name infocard number lookup array generated");384 console.log("System name infocard number lookup array generated");
348 });385 });
349 generateSearchArray();386 generateSearchArray();
350 }387 }
351 388
352 function generateSearchArray() {389 function generateSearchArray() {
353 if (infocardArrayState != "ready" | systemIdsNameArrayState != "ready") {390 if (infocardArrayState != "ready" | systemIdsNameArrayState != "ready") {
354 setTimeout(function(){generateSearchArray()},10);391 setTimeout(function(){generateSearchArray()},10);
355 } else {392 } else {
356 for (systemNickname in systemIdsNameArray) {393 for (systemNickname in systemIdsNameArray) {
357 if(systemNickname.toLowerCase().indexOf("sector") == -1) {394 if(systemNickname.toLowerCase().indexOf("sector") == -1) {
358 matchArray.push(infocardArray[systemIdsNameArray[systemNickname]]);395 matchArray.push(infocardArray[systemIdsNameArray[systemNickname]]);
359 searchArray[infocardArray[systemIdsNameArray[systemNickname]]] = systemNickname;396 searchArray[infocardArray[systemIdsNameArray[systemNickname]]] = systemNickname;
360 searchArray[infocardArray[systemIdsNameArray[systemNickname]].toLowerCase()] = systemNickname;397 searchArray[infocardArray[systemIdsNameArray[systemNickname]].toLowerCase()] = systemNickname;
361 }398 }
362 }399 }
363 var universeBaseArray = universeFileGetResult.match(baseRegex);400 var universeBaseArray = universeFileGetResult.match(baseRegex);
364 for (i = 0; i < universeBaseArray.length; i++) {401 for (i = 0; i < universeBaseArray.length; i++) {
365 if (universeBaseArray[i].toLowerCase().indexOf("proxy_base") == -1 402 if (universeBaseArray[i].toLowerCase().indexOf("proxy_base") == -1
366 && universeBaseArray[i].toLowerCase().indexOf("miners") == -1403 && universeBaseArray[i].toLowerCase().indexOf("miners") == -1
367 && universeBaseArray[i].toLowerCase().indexOf("system =") != -1404 && universeBaseArray[i].toLowerCase().indexOf("system =") != -1
368 && universeBaseArray[i].toLowerCase().indexOf("strid_name") != -1) {405 && universeBaseArray[i].toLowerCase().indexOf("strid_name") != -1) {
369 var baseName = infocardArray[universeBaseArray[i].toLowerCase().match(idsSysNameRegex).join().substring(13)];406 var baseName = infocardArray[universeBaseArray[i].toLowerCase().match(idsSysNameRegex).join().substring(13)];
370 var systemNickname = universeBaseArray[i].toLowerCase().match(sysNameRegex).join().substring(9);407 var systemNickname = universeBaseArray[i].toLowerCase().match(sysNameRegex).join().substring(9);
371 if (typeof baseName !== "undefined" && typeof systemNickname !== "undefined") {408 if (typeof baseName !== "undefined" && typeof systemNickname !== "undefined") {
372 baseSystemArray[baseName.toLowerCase()] = systemNickname.toLowerCase();409 baseSystemArray[baseName.toLowerCase()] = systemNickname.toLowerCase();
373 matchArray.push(baseName);410 matchArray.push(baseName);
374 searchArray[baseName] = systemNickname;411 searchArray[baseName] = systemNickname;
375 searchArray[baseName.toLowerCase()] = systemNickname;412 searchArray[baseName.toLowerCase()] = systemNickname;
376 } else {413 } else {
377 console.log(universeBaseArray[i] + " infocardNumber: "+universeBaseArray[i].toLowerCase().match(idsSysNameRegex).join().substring(13) + " systemNick: "+ systemNickname);414 console.log(universeBaseArray[i] + " infocardNumber: "+universeBaseArray[i].toLowerCase().match(idsSysNameRegex).join().substring(13) + " systemNick: "+ systemNickname);
378 }415 }
379 }416 }
380 }417 }
381 searchArrayState = "ready";418 searchArrayState = "ready";
382 console.log("Base system lookup array generated");419 console.log("Base system lookup array generated");
383 baseSystemArrayState = "ready";420 baseSystemArrayState = "ready";
384 console.log("Search array generated");421 console.log("Search array generated");
385 }422 }
386 }423 }
387 424
388 function parseInfocard(infocard) {425 function parseInfocard(infocard) {
389 console.log(infocard);426 console.log(infocard);
390 if (infocard.toLowerCase().indexOf("<text>") == -1) {427 if (infocard.toLowerCase().indexOf("<text>") == -1) {
391 return infocard;428 return infocard;
392 } else {429 } else {
393 return infocard.toString().match(textRegex).map(function (textElement) { 430 return infocard.toString().match(textRegex).map(function (textElement) {
394 if (textElement.toLowerCase().indexOf("<para") != -1) {431 if (textElement.toLowerCase().indexOf("<para") != -1) {
395 return "<br class='infocardBreak'>";432 return "<br class='infocardBreak'>";
396 } else {433 } else {
397 return "<span class='infocardText'>"+textElement.slice(6,-7)+"</span>";434 return "<span class='infocardText'>"+textElement.slice(6,-7)+"</span>";
398 }435 }
399 }).join("");436 }).join("");
400 }437 }
401 }438 }
402 439
403 function scrollUp() {440 function scrollUp() {
404 $('html, body').animate({ scrollTop: 0}, 150);441 history.replaceState(longSystemName, "Discovery Navmap for "+longSystemName, "#"+encodeURI(longSystemName));
442 $('html, body').animate({ scrollTop: 0}, 300, function(){
443 while (document.querySelector(".infocardContainer").firstChild) {
444 document.querySelector(".infocardContainer").removeChild(document.querySelector(".infocardContainer").firstChild);
445 }
446 document.querySelector(".infocardContainer").style.display = "none";
447 });
405 }448 }
406 449
407 function showObjectInfo(idsNameNumber, idsInfoNumber, classString, zPosition, factionNickname, systemNickname, dynamicCommodity, dynamicDifficulty, dynamicCount) {450 function showObjectInfo(idsNameNumber, idsInfoNumber, classString, zPosition, factionNickname, systemNickname, dynamicCommodity, dynamicDifficulty, dynamicCount) {
451 $(".highlighter").remove();
408 document.querySelector(".infocardContainer").style.display = "block";452 document.querySelector(".infocardContainer").style.display = "block";
409 var scaleFactor = 1;453 var scaleFactor = 1;
410 if (typeof systemScaleFactorArray[systemNickname] !== "undefined") {454 if (typeof systemScaleFactorArray[systemNickname] !== "undefined") {
411 scaleFactor = parseFloat(systemScaleFactorArray[systemNickname]);455 scaleFactor = parseFloat(systemScaleFactorArray[systemNickname]);
412 }456 }
413 var planePosition;457 var planePosition;
414 if (zPosition == 0) {458 if (zPosition == 0) {
415 planePosition = "on";459 planePosition = "on";
416 } else if (zPosition > 0) {460 } else if (zPosition > 0) {
417 planePosition = (Math.round(parseFloat(zPosition)/(scaleFactor*1000)*10) / 10)+"K above";461 planePosition = (Math.round(parseFloat(zPosition)/(scaleFactor*1000)*10) / 10)+"K above";
418 } else if (zPosition < 0) {462 } else if (zPosition < 0) {
419 planePosition = (Math.round(parseFloat(zPosition)/(scaleFactor*1000)*-10) / 10)+"K below";463 planePosition = (Math.round(parseFloat(zPosition)/(scaleFactor*1000)*-10) / 10)+"K below";
420 } else { 464 } else {
421 // :)))465 // :)))
422 planePosition = "non-standard in relation to";466 planePosition = "non-standard in relation to";
423 }467 }
424 if (typeof factionNickname !== "undefined") {468 if (typeof factionNickname !== "undefined") {
425 var ownerString = " It belongs to "+factionNameArray[factionNickname]+".";469 var ownerString = " It belongs to "+factionNameArray[factionNickname]+".";
426 } else {470 } else {
427 var ownerString = "";471 var ownerString = "";
428 }472 }
473 if (typeof searchArray[infocardArray[idsNameNumber]] !== "undefined"
474 && searchArray[infocardArray[idsNameNumber]].toLowerCase() == currentSystemNickname.toLowerCase()) {
475 history.replaceState(longSystemName, "Discovery Navmap for "+longSystemName, "#"+encodeURI(infocardArray[idsNameNumber]));
476 } else {
477 history.replaceState(longSystemName, "Discovery Navmap for "+longSystemName, "#"+encodeURI(longSystemName));
478 }
429 var infoString = "";479 var infoString = "";
430 var miningString = "";480 var miningString = "";
431 var scrollUpString = "<div class='scrollUpButton' onclick='scrollUp()'><i class='fa fa-arrow-circle-o-up'></i><p>Scroll up</p></div>";481 var scrollUpString = "<div class='scrollUpButton' onclick='scrollUp()'><i class='fa fa-arrow-circle-o-up'></i><p>Scroll up / Close</p></div>";
432 if (typeof dynamicCommodity !== "undefined") {482 if (typeof dynamicCommodity !== "undefined") {
433 if (dynamicCount.indexOf("1, 1") == -1) {483 if (dynamicCount.indexOf("1, 1") == -1) {
434 amountString = dynamicCount.replace(/\s/g, '').split(",").join(" to ")+" units";484 amountString = dynamicCount.replace(/\s/g, '').split(",").join(" to ")+" units";
435 } else {485 } else {
436 amountString = "one unit";486 amountString = "one unit";
437 }487 }
438 var commodityName = dynamicCommodity;488 var commodityName = dynamicCommodity;
439 var commodityArrayName = commodityNameArray[dynamicCommodity.toLowerCase()];489 var commodityArrayName = commodityNameArray[dynamicCommodity.toLowerCase()];
440 if (typeof commodityArrayName !== "undefined") {490 if (typeof commodityArrayName !== "undefined") {
441 commodityName = commodityArrayName;491 commodityName = commodityArrayName;
442 }492 }
443 miningString = "<p>This zone drops "+amountString+" of the commodity "+commodityName+" when mined using <a id='miningLink' href='http://discoverygc.com/forums/showthread.php?tid=132063' target='_BLANK'>appropriate equipment</a>.</p>";493 miningString = "<p>This zone drops "+amountString+" of the commodity "+commodityName+" when mined using <a id='miningLink' href='http://discoverygc.com/forums/showthread.php?tid=132063' target='_BLANK'>appropriate equipment</a>.</p>";
444 }494 }
445 if (typeof idsInfoNumber !== "undefined") {495 if (typeof idsInfoNumber !== "undefined") {
446 if ((classString.indexOf("base") != -1 | classString.indexOf("planet") != -1) && classString.indexOf("dockable") != -1 && typeof infocardArray[(parseInt(idsInfoNumber)+1).toString()] !== "undefined" && idsInfoNumber != 66140 && idsInfoNumber != 66143) {496 if ((classString.indexOf("base") != -1 | classString.indexOf("planet") != -1) && classString.indexOf("dockable") != -1 && typeof infocardArray[(parseInt(idsInfoNumber)+1).toString()] !== "undefined" && idsInfoNumber != 66140 && idsInfoNumber != 66143) {
447 var infocardURI = encodeURI(infocardArray[(parseInt(idsInfoNumber)+1).toString()]);497 var infocardURI = encodeURI(infocardArray[(parseInt(idsInfoNumber)+1).toString()]);
448 document.querySelector(".infocardContainer").innerHTML = "<h2>"+infocardArray[idsNameNumber]+"</h2>"+parseInfocard(infocardArray[idsInfoNumber])+parseInfocard(infocardArray[(parseInt(idsInfoNumber)+1).toString()])+"<h3>Technical info</h3><p class='technicalInfo'>This object is located "+planePosition+" the plane, and has infocard number "+idsInfoNumber+", base description infocard number "+(parseInt(idsInfoNumber)+1).toString()+" and name infocard number "+idsNameNumber+"."+ownerString+" "+"<a class='editLink' target='_blank'><i class='fa fa-pencil-square-o'></i></a></p>"+miningString+scrollUpString;498 document.querySelector(".infocardContainer").innerHTML = "<h2>"+infocardArray[idsNameNumber]+"</h2>"+parseInfocard(infocardArray[idsInfoNumber])+parseInfocard(infocardArray[(parseInt(idsInfoNumber)+1).toString()])+"<h3>Technical info</h3><p class='technicalInfo'>This object is located "+planePosition+" the plane, and has infocard number "+idsInfoNumber+", base description infocard number "+(parseInt(idsInfoNumber)+1).toString()+" and name infocard number "+idsNameNumber+"."+ownerString+" "+"<a class='editLink' target='_blank'><i class='fa fa-pencil-square-o'></i></a></p>"+miningString+scrollUpString;
449 document.querySelector(".editLink").href = "https://docs.google.com/forms/d/1bIYtQCx0lLgguEF6xWDm0RRFr0IIz-tM1Toh6SyB9wA/viewform?entry.515729986="+(parseInt(idsInfoNumber)+1).toString()+"&entry.628548621="+infocardURI+"&entry.899322418="+infocardURI;499 document.querySelector(".editLink").href = "https://docs.google.com/forms/d/1bIYtQCx0lLgguEF6xWDm0RRFr0IIz-tM1Toh6SyB9wA/viewform?entry.515729986="+(parseInt(idsInfoNumber)+1).toString()+"&entry.628548621="+infocardURI+"&entry.899322418="+infocardURI;
450 } else {500 } else {
451 var infocardURI = encodeURI(infocardArray[idsInfoNumber]);501 var infocardURI = encodeURI(infocardArray[idsInfoNumber]);
452 document.querySelector(".infocardContainer").innerHTML = "<h2>"+infocardArray[idsNameNumber]+"</h2>"+parseInfocard(infocardArray[idsInfoNumber])+"<h3>Technical info</h3><p class='technicalInfo'>This object is located "+planePosition+" the plane, and has infocard number "+idsInfoNumber+" and name infocard number "+idsNameNumber+"."+ownerString+" "+"<a class='editLink' target='_blank'><i class='fa fa-pencil-square-o'></i></a></p>"+miningString+scrollUpString;502 document.querySelector(".infocardContainer").innerHTML = "<h2>"+infocardArray[idsNameNumber]+"</h2>"+parseInfocard(infocardArray[idsInfoNumber])+"<h3>Technical info</h3><p class='technicalInfo'>This object is located "+planePosition+" the plane, and has infocard number "+idsInfoNumber+" and name infocard number "+idsNameNumber+"."+ownerString+" "+"<a class='editLink' target='_blank'><i class='fa fa-pencil-square-o'></i></a></p>"+miningString+scrollUpString;
453 document.querySelector(".editLink").href = "https://docs.google.com/forms/d/1bIYtQCx0lLgguEF6xWDm0RRFr0IIz-tM1Toh6SyB9wA/viewform?entry.515729986="+idsInfoNumber+"&entry.628548621="+infocardURI+"&entry.899322418="+infocardURI;503 document.querySelector(".editLink").href = "https://docs.google.com/forms/d/1bIYtQCx0lLgguEF6xWDm0RRFr0IIz-tM1Toh6SyB9wA/viewform?entry.515729986="+idsInfoNumber+"&entry.628548621="+infocardURI+"&entry.899322418="+infocardURI;
454 }504 }
455 } else if (typeof dynamicCommodity !== "undefined") {505 } else if (typeof dynamicCommodity !== "undefined") {
456 document.querySelector(".infocardContainer").innerHTML = miningString+scrollUpString;506 document.querySelector(".infocardContainer").innerHTML = miningString+scrollUpString;
457 }507 }
458 console.log("Infocard "+idsInfoNumber+" for "+infocardArray[idsNameNumber]+" fetched");508 console.log("Infocard "+idsInfoNumber+" for "+infocardArray[idsNameNumber]+" fetched");
459 if ($(".navContainer").css("position") == "fixed") {509 if ($(".navContainer").css("position") == "fixed") {
460 $('html, body').animate({ scrollTop: $("body").scrollTop()+document.querySelector(".infocardContainer *:first-child").getBoundingClientRect().top-document.querySelector(".navContainer").scrollHeight}, 150);510 $('html, body').animate({ scrollTop: $("body").scrollTop()+document.querySelector(".infocardContainer *:first-child").getBoundingClientRect().top-document.querySelector(".navContainer").scrollHeight}, 300);
461 } else {511 } else {
462 $('html, body').animate({ scrollTop: $("body").scrollTop()+document.querySelector(".infocardContainer *:first-child").getBoundingClientRect().top}, 150);512 $('html, body').animate({ scrollTop: $("body").scrollTop()+document.querySelector(".infocardContainer *:first-child").getBoundingClientRect().top}, 300);
463 }513 }
464 }514 }
465 515
466 function findObjectName(internalNickname, classString) {516 function findObjectName(internalNickname, classString) {
467 if (typeof classString !== "undefined" && typeof internalNickname !== "undefined" && classString.indexOf("jump") != -1) {517 if (typeof classString !== "undefined" && typeof internalNickname !== "undefined" && classString.indexOf("jump") != -1) {
468 if (classString.indexOf("hole") != -1) {518 if (classString.indexOf("hole") != -1) {
469 var jumpSystems = internalNickname.slice(0,-5).split("_to_");519 var jumpSystems = internalNickname.slice(0,-5).split("_to_");
470 return systemNameArray[jumpSystems[0].toLowerCase()] + " > " + systemNameArray[jumpSystems[1].toLowerCase()] + " Jump Hole";520 return systemNameArray[jumpSystems[0].toLowerCase()] + " > " + systemNameArray[jumpSystems[1].toLowerCase()] + " Jump Hole";
471 } else {521 } else {
472 var jumpSystems = internalNickname.split("_to_");522 var jumpSystems = internalNickname.split("_to_");
473 return systemNameArray[jumpSystems[0].toLowerCase()] + " > " + systemNameArray[jumpSystems[1].toLowerCase()] + " Jump Gate";523 return systemNameArray[jumpSystems[0].toLowerCase()] + " > " + systemNameArray[jumpSystems[1].toLowerCase()] + " Jump Gate";
474 }524 }
475 }525 }
476 if (baseNameArray[internalNickname.toLowerCase()] != null) {526 if (baseNameArray[internalNickname.toLowerCase()] != null) {
477 return baseNameArray[internalNickname.toLowerCase()];527 return baseNameArray[internalNickname.toLowerCase()];
478 } else if (baseNameArray[internalNickname.toLowerCase()+"_base"] != null) {528 } else if (baseNameArray[internalNickname.toLowerCase()+"_base"] != null) {
479 return baseNameArray[internalNickname.toLowerCase()+"_base"];529 return baseNameArray[internalNickname.toLowerCase()+"_base"];
480 } else {530 } else {
481 return internalNickname + "???";531 return internalNickname + "???";
482 }532 }
483 }533 }
484 534
485 function createLoadAnimation() {535 function createLoadAnimation() {
486 if (document.querySelector(".loadingOverlay") == null) {536 if (document.querySelector(".loadingOverlay") == null) {
487 $('html, body').animate({ scrollTop: 0 }, 150);537 $('html, body').animate({ scrollTop: 0 }, 300);
488 var loader = document.createElement("div");538 var loader = document.createElement("div");
489 loader.innerHTML = "<div class='loadTextContainer'><h2 class='loaderTitle'>Loading...</h2><div class='loader'></div></div>";539 loader.innerHTML = "<div class='loadTextContainer'><h2 class='loaderTitle'>Loading...</h2><div class='loader'></div></div>";
490 loader.className = "loadingOverlay";540 loader.className = "loadingOverlay";
491 document.querySelector("body").appendChild(loader);541 document.querySelector("body").appendChild(loader);
492 }542 }
493 }543 }
494 544
545 // case-insensitive contains filter
546 $.extend($.expr[":"], {
547 "containsNC": function(elem, i, match, array) {
548 return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
549 }
550 });
551
552 function createHighlightAnimation(element) {
553 $(".highlighter").remove();
554 var highlight = document.createElement("div");
555 highlight.className = "highlighter";
556 element.append(highlight);
557 $('html, body').animate({
558 scrollTop: $(".highlighter").offset().top-$(window).height()/2,
559 scrollLeft: $(".highlighter").offset().left-$(window).width()/2
560 }, 1000);
561 $(".highlighter").mouseover(function() {
562 $(".highlighter").remove();
563 });
564 }
565
495 function generateUniverseMap() {566 function generateUniverseMap() {
496 createLoadAnimation();567 createLoadAnimation();
497 document.querySelector(".navContainer #showUniverseMap").style.display = "none";568 document.querySelector(".navContainer #showUniverseMap").style.display = "none";
498 $(".grid").children().hide();569 $(".grid").children().hide();
499 document.querySelector(".mapLegend").style.display = "block";570 document.querySelector(".mapLegend").style.display = "block";
500 document.querySelector(".navContainer #helpLink").style.display = "block";571 document.querySelector(".navContainer #helpLink").style.display = "block";
501 document.querySelector("#navSystemTitle").style.display = "none";572 document.querySelector("#navSystemTitle").style.display = "none";
502 if (currentSystemNickname != "Sirius") {573 if (currentSystemNickname != "Sirius") {
503 history.replaceState("Sirius", "Discovery Navmap", ".");574 history.replaceState("Sirius", "Discovery Navmap", ".");
504 }575 }
505 if (document.querySelector(".configOption#connections input").checked) {576 if (document.querySelector(".configOption#connections input").checked) {
506 if (systemConnectionState = "ready") {577 if (systemConnectionState = "ready") {
507 var systemConnectionsEvaluated = true;578 var systemConnectionsEvaluated = true;
508 } else {579 } else {
509 var systemConnectionsEvaluated = false;580 var systemConnectionsEvaluated = false;
510 }581 }
511 } else {582 } else {
512 var systemConnectionsEvaluated = true;583 var systemConnectionsEvaluated = true;
513 }584 }
514 585
515 if (infocardArrayState != "ready" | systemScaleFactorArrayState != "ready" | searchArrayState != "ready" | systemConnectionsEvaluated != true) {586 if (infocardArrayState != "ready" | systemScaleFactorArrayState != "ready" | searchArrayState != "ready" | systemConnectionsEvaluated != true) {
516 setTimeout(function(){generateUniverseMap()},10);587 setTimeout(function(){generateUniverseMap()},10);
517 } else {588 } else {
518 if (document.querySelector(".configOption#connections input").checked) {589 if (document.querySelector(".configOption#connections input").checked) {
519 $(".systemConnectionProp").show();590 $(".systemConnectionProp").show();
520 }591 }
521 document.querySelector(".loaderTitle").innerHTML = "Generating map...";592 document.querySelector(".loaderTitle").innerHTML = "Generating map...";
522 document.querySelector("#searchField").value = "";593 document.querySelector("#searchField").value = "";
523 currentSystemNickname = "Sirius";594 currentSystemNickname = "Sirius";
524 document.querySelector(".grid").style.background = "url('SiriusMap.jpg') black"595 document.querySelector(".grid").style.background = "url('SiriusMap.jpg') black"
525 document.querySelector(".grid").style.backgroundSize = "cover !important"596 document.querySelector(".grid").style.backgroundSize = "cover !important"
526 // empty the map div before doing anything else597 // empty the map div before doing anything else
527 $(".map").children().not(".systemConnectionProp").remove();598 $(".map").children().not(".systemConnectionProp").remove();
528 while (document.querySelector(".infocardContainer").firstChild) {599 while (document.querySelector(".infocardContainer").firstChild) {
529 document.querySelector(".infocardContainer").removeChild(document.querySelector(".infocardContainer").firstChild);600 document.querySelector(".infocardContainer").removeChild(document.querySelector(".infocardContainer").firstChild);
530 }601 }
531 document.querySelector(".infocardContainer").style.display = "none";602 document.querySelector(".infocardContainer").style.display = "none";
532 if (document.querySelector(".systemTitle") == null) {603 if (document.querySelector(".systemTitle") == null) {
533 var systemTitle = document.createElement("h2");604 var systemTitle = document.createElement("h2");
534 document.querySelector(".grid").appendChild(systemTitle);605 document.querySelector(".grid").appendChild(systemTitle);
535 } else {606 } else {
536 var systemTitle = document.querySelector(".systemTitle");607 var systemTitle = document.querySelector(".systemTitle");
537 $(".systemTitle").show();608 $(".systemTitle").show();
538 }609 }
539 if (document.querySelector(".darkOverlay") == null) {610 if (document.querySelector(".darkOverlay") == null) {
540 var darkOverlay = document.createElement("div");611 var darkOverlay = document.createElement("div");
541 darkOverlay.className = "darkOverlay";612 darkOverlay.className = "darkOverlay";
542 document.querySelector(".grid").appendChild(darkOverlay);613 document.querySelector(".grid").appendChild(darkOverlay);
543 }614 }
544 if (document.querySelector(".mapScale") != null) {615 if (document.querySelector(".mapScale") != null) {
545 document.querySelector(".grid").removeChild(document.querySelector(".mapScale"));616 document.querySelector(".grid").removeChild(document.querySelector(".mapScale"));
546 }617 }
547 systemTitle.innerHTML = "Sirius";618 systemTitle.innerHTML = "Sirius";
548 systemTitle.className = "systemTitle";619 systemTitle.className = "systemTitle";
549 for (var systemName in systemPosArray) {620 for (var systemName in systemPosArray) {
550 if (systemPosArray.hasOwnProperty(systemName)) {621 if (systemPosArray.hasOwnProperty(systemName)) {
551 if (typeof systemIdsNameArray[systemName] !== "undefined" && systemName.toLowerCase().indexOf("sector") == -1) {622 if (typeof systemIdsNameArray[systemName] !== "undefined" && systemName.toLowerCase().indexOf("sector") == -1) {
552 var system = document.createElement("div");623 var system = document.createElement("div");
553 system.dataset.systemNickname = systemName;624 system.dataset.systemNickname = systemName;
554 system.className = "system " + systemClassArray[systemName.toLowerCase()];625 system.className = "system " + systemClassArray[systemName.toLowerCase()];
555 var systemLabel = document.createElement("label");626 var systemLabel = document.createElement("label");
556 systemLabel.innerHTML = infocardArray[systemIdsNameArray[systemName.toLowerCase()]];627 systemLabel.innerHTML = infocardArray[systemIdsNameArray[systemName.toLowerCase()]];
557 system.appendChild(systemLabel);628 system.appendChild(systemLabel);
558 if (oorpArray.indexOf(systemName) != -1) {629 if (oorpArray.indexOf(systemName) != -1) {
559 system.className += " oorp";630 system.className += " oorp";
560 }631 }
561 system.style.top = parseFloat(systemPosArray[systemName][1])*6.6-50 + "%";632 system.style.top = parseFloat(systemPosArray[systemName][1])*6.6-50 + "%";
562 system.style.left = parseFloat(systemPosArray[systemName][0])*6.6-50 + "%";633 system.style.left = parseFloat(systemPosArray[systemName][0])*6.6-50 + "%";
563 system.style.position = "absolute";634 system.style.position = "absolute";
564 document.querySelector(".map").appendChild(system);635 document.querySelector(".map").appendChild(system);
565 system.addEventListener("click", function() {636 system.addEventListener("click", function() {
566 generateMap(this.dataset.systemNickname);637 generateMap(this.dataset.systemNickname);
567 });638 });
568 }639 }
569 }640 }
570 }641 }
571 console.log("Universe map generated");642 console.log("Universe map generated");
572 updateConfigClasses();643 updateConfigClasses();
573 $(".map div label").hAlign();644 $(".map div label").hAlign();
574 document.querySelector("body").removeChild(document.querySelector(".loadingOverlay"));645 document.querySelector("body").removeChild(document.querySelector(".loadingOverlay"));
575 universeMapState = "ready";646 universeMapState = "ready";
576 $("#searchField").keyup();647 $("#searchField").keyup();
577 }648 }
578 }649 }
579 650
580 function generateSystemConnections() {651 function generateSystemConnections() {
581 if (document.querySelector(".systemConnectionProp") == null && document.querySelector(".configOption#connections input").checked) {652 if (document.querySelector(".systemConnectionProp") == null && document.querySelector(".configOption#connections input").checked) {
582 if (systemPosArrayState != "ready" | connectionArrayState != "ready" | jgConnectionArrayState != "ready") {653 if (systemPosArrayState != "ready" | connectionArrayState != "ready" | jgConnectionArrayState != "ready") {
583 setTimeout(function(){generateSystemConnections()},10);654 setTimeout(function(){generateSystemConnections()},10);
584 } else {655 } else {
585 for (var system in connectionArray) {656 for (var system in connectionArray) {
586 if (connectionArray.hasOwnProperty(system)) {657 if (connectionArray.hasOwnProperty(system)) {
587 for (i = 0; i < connectionArray[system].length; i++) {658 for (i = 0; i < connectionArray[system].length; i++) {
588 if (typeof systemPosArray[system] !== "undefined" 659 if (typeof systemPosArray[system] !== "undefined"
589 && typeof systemPosArray[connectionArray[system][i]] !== "undefined") {660 && typeof systemPosArray[connectionArray[system][i]] !== "undefined") {
590 if (document.querySelector("[data-connected-points~="+connectionArray[system][i]+"]"+"[data-connected-points~="+system+"]") == null) {661 if (document.querySelector("[data-connected-points~="+connectionArray[system][i]+"]"+"[data-connected-points~="+system+"]") == null) {
591 x1 = parseFloat(systemPosArray[system][1])*6.6-50;662 x1 = parseFloat(systemPosArray[system][1])*6.6-50;
592 x2 = parseFloat(systemPosArray[connectionArray[system][i]][1])*6.6-50;663 x2 = parseFloat(systemPosArray[connectionArray[system][i]][1])*6.6-50;
593 y1 = parseFloat(systemPosArray[system][0])*6.6-50;664 y1 = parseFloat(systemPosArray[system][0])*6.6-50;
594 y2 = parseFloat(systemPosArray[connectionArray[system][i]][0])*6.6-50;665 y2 = parseFloat(systemPosArray[connectionArray[system][i]][0])*6.6-50;
595 var propClass = "systemConnectionProp";666 var propClass = "systemConnectionProp";
596 if (oorpArray.indexOf(system) != -1 | oorpArray.indexOf(connectionArray[system][i]) != -1) {667 if (oorpArray.indexOf(system) != -1 | oorpArray.indexOf(connectionArray[system][i]) != -1) {
597 propClass += " oorp";668 propClass += " oorp";
598 }669 }
599 var connection = new Line(x1, x2, y1, y2, "systemConnection oneWayConnection", propClass, ".map", system, connectionArray[system][i]);670 var connection = new Line(x1, x2, y1, y2, "systemConnection oneWayConnection", propClass, ".map", system, connectionArray[system][i]);
600 } else {671 } else {
601 $("[data-connected-points~="+connectionArray[system][i]+"]"+"[data-connected-points~="+system+"]").removeClass("oneWayConnection").addClass("twoWayConnection");672 $("[data-connected-points~="+connectionArray[system][i]+"]"+"[data-connected-points~="+system+"]").removeClass("oneWayConnection").addClass("twoWayConnection");
602 }673 }
603 }674 }
604 }675 }
605 }676 }
606 }677 }
607 for (var system in jgConnectionArray) {678 for (var system in jgConnectionArray) {
608 if (jgConnectionArray.hasOwnProperty(system)) {679 if (jgConnectionArray.hasOwnProperty(system)) {
609 for (i = 0; i < jgConnectionArray[system].length; i++) {680 for (i = 0; i < jgConnectionArray[system].length; i++) {
610 if (typeof systemPosArray[system] !== "undefined" 681 if (typeof systemPosArray[system] !== "undefined"
611 && typeof systemPosArray[jgConnectionArray[system][i]] !== "undefined") {682 && typeof systemPosArray[jgConnectionArray[system][i]] !== "undefined") {
612 var currentSystemSelector = document.querySelector("[data-connected-points~="+jgConnectionArray[system][i]+"]"+"[data-connected-points~="+system+"]");683 var currentSystemSelector = document.querySelector("[data-connected-points~="+jgConnectionArray[system][i]+"]"+"[data-connected-points~="+system+"]");
613 if (currentSystemSelector == null) {684 if (currentSystemSelector == null) {
614 x1 = parseFloat(systemPosArray[system][1])*6.6-50;685 x1 = parseFloat(systemPosArray[system][1])*6.6-50;
615 x2 = parseFloat(systemPosArray[jgConnectionArray[system][i]][1])*6.6-50;686 x2 = parseFloat(systemPosArray[jgConnectionArray[system][i]][1])*6.6-50;
616 y1 = parseFloat(systemPosArray[system][0])*6.6-50;687 y1 = parseFloat(systemPosArray[system][0])*6.6-50;
617 y2 = parseFloat(systemPosArray[jgConnectionArray[system][i]][0])*6.6-50;688 y2 = parseFloat(systemPosArray[jgConnectionArray[system][i]][0])*6.6-50;
618 var propClass = "systemConnectionProp jgConnection";689 var propClass = "systemConnectionProp jgConnection";
619 if (oorpArray.indexOf(system) != -1 | oorpArray.indexOf(jgConnectionArray[system][i]) != -1) {690 if (oorpArray.indexOf(system) != -1 | oorpArray.indexOf(jgConnectionArray[system][i]) != -1) {
620 propClass += " oorp";691 propClass += " oorp";
621 }692 }
622 var connection = new Line(x1, x2, y1, y2, "systemConnection", propClass, ".map", system, connectionArray[system][i]);693 var connection = new Line(x1, x2, y1, y2, "systemConnection", propClass, ".map", system, connectionArray[system][i]);
623 } else if (currentSystemSelector.className.indexOf("jgConnection") == -1) {694 } else if (currentSystemSelector.className.indexOf("jgConnection") == -1) {
624 currentSystemSelector.className += " jgConnection";695 currentSystemSelector.className += " jgConnection";
625 }696 }
626 }697 }
627 }698 }
628 }699 }
629 }700 }
630 systemConnectionState = "ready";701 systemConnectionState = "ready";
631 updateConfigClasses();702 updateConfigClasses();
632 }703 }
633 }704 }
634 }705 }
635706
636 function generateMap(system) {707 function generateMap(system) {
637 if (infocardArrayState != "ready" | systemScaleFactorArrayState != "ready" | searchArrayState != "ready" | document.querySelector(".loadingOverlay") !== null) {708 if (infocardArrayState != "ready" | systemScaleFactorArrayState != "ready" | searchArrayState != "ready" | document.querySelector(".loadingOverlay") !== null) {
638 setTimeout(function(){generateMap(system)},10);709 setTimeout(function(){generateMap(system)},10);
639 } else {710 } else {
640 createLoadAnimation();711 createLoadAnimation();
641 document.querySelector(".navContainer #showUniverseMap").style.display = "block";712 document.querySelector(".navContainer #showUniverseMap").style.display = "block";
642 document.querySelector("#navSystemTitle").style.display = "block";713 document.querySelector("#navSystemTitle").style.display = "block";
643 document.querySelector(".navContainer #helpLink").style.display = "none";714 document.querySelector(".navContainer #helpLink").style.display = "none";
644 $(".grid").children().show();715 $(".grid").children().show();
645 $(".systemConnectionProp").hide();716 $(".systemConnectionProp").hide();
646 document.querySelector(".mapLegend").style.display = "none";717 document.querySelector(".mapLegend").style.display = "none";
647 document.querySelector(".loaderTitle").innerHTML = "Generating map...";718 document.querySelector(".loaderTitle").innerHTML = "Generating map...";
648 document.querySelector("#searchField").value = "";719 document.querySelector("#searchField").value = "";
649 currentSystemNickname = system;720 currentSystemNickname = system;
650 if (document.querySelector(".darkOverlay") != null) {721 if (document.querySelector(".darkOverlay") != null) {
651 var darkOverlay = document.createElement("div");722 var darkOverlay = document.createElement("div");
652 darkOverlay.classname = "darkOverlay";723 darkOverlay.classname = "darkOverlay";
653 document.querySelector(".grid").removeChild(document.querySelector(".darkOverlay"));724 document.querySelector(".grid").removeChild(document.querySelector(".darkOverlay"));
654 }725 }
655 document.querySelector(".grid").style.background = "black";726 document.querySelector(".grid").style.background = "black";
656 // to-do: parse system ini locations from universe.ini to avoid issues like this727 // to-do: parse system ini locations from universe.ini to avoid issues like this
657 if (system.toLowerCase() == "fp7_system") {728 if (system.toLowerCase() == "fp7_system") {
658 var systemFile = dataRootPath+"universe/systems/fp7/fp7_system.ini";729 var systemFile = dataRootPath+"universe/systems/fp7/fp7_system.ini";
659 } else {730 } else {
660 var systemFile = dataRootPath+"universe/systems/"+system+"/"+system+".ini";731 var systemFile = dataRootPath+"universe/systems/"+system+"/"+system+".ini";
661 }732 }
662 if (typeof systemScaleFactorArray[system.toLowerCase()] === "undefined") {733 if (typeof systemScaleFactorArray[system.toLowerCase()] === "undefined") {
663 systemScaleFactor = 1;734 systemScaleFactor = 1;
664 } else {735 } else {
665 systemScaleFactor = systemScaleFactorArray[system.toLowerCase()];736 systemScaleFactor = systemScaleFactorArray[system.toLowerCase()];
666 }737 }
667 // empty the map div before doing anything else738 // empty the map div before doing anything else
668 $(".map").children().not(".systemConnectionProp").remove();739 $(".map").children().not(".systemConnectionProp").remove();
669 while (document.querySelector(".infocardContainer").firstChild) {740 while (document.querySelector(".infocardContainer").firstChild) {
670 document.querySelector(".infocardContainer").removeChild(document.querySelector(".infocardContainer").firstChild);741 document.querySelector(".infocardContainer").removeChild(document.querySelector(".infocardContainer").firstChild);
671 }742 }
672 if (document.querySelector(".mapScale") == null) {743 if (document.querySelector(".mapScale") == null) {
673 var mapScale = document.createElement("div");744 var mapScale = document.createElement("div");
674 var mapScaleNumber = document.createElement("h2");745 var mapScaleNumber = document.createElement("h2");
675 var mapScaleArrowLeft = document.createElement("div");746 var mapScaleArrowLeft = document.createElement("div");
676 var mapScaleArrowRight = document.createElement("div");747 var mapScaleArrowRight = document.createElement("div");
677 mapScaleArrowLeft.className = "arrowHead arrowL";748 mapScaleArrowLeft.className = "arrowHead arrowL";
678 mapScaleArrowRight.className = "arrowHead arrowR";749 mapScaleArrowRight.className = "arrowHead arrowR";
679 mapScale.className = "mapScale";750 mapScale.className = "mapScale";
680 mapScale.appendChild(mapScaleArrowRight);751 mapScale.appendChild(mapScaleArrowRight);
681 mapScale.appendChild(mapScaleArrowLeft);752 mapScale.appendChild(mapScaleArrowLeft);
682 mapScale.appendChild(mapScaleNumber);753 mapScale.appendChild(mapScaleNumber);
683 document.querySelector(".grid").appendChild(mapScale);754 document.querySelector(".grid").appendChild(mapScale);
684 }755 }
685 generateSystemScale(system);756 generateSystemScale(system);
686 document.querySelector(".infocardContainer").style.display = "none";757 document.querySelector(".infocardContainer").style.display = "none";
687 if (document.querySelector(".systemTitle") == null) {758 if (document.querySelector(".systemTitle") == null) {
688 var systemTitle = document.createElement("h2");759 var systemTitle = document.createElement("h2");
689 } else {760 } else {
690 var systemTitle = document.querySelector(".systemTitle");761 var systemTitle = document.querySelector(".systemTitle");
691 document.querySelector(".grid").appendChild(systemTitle);762 document.querySelector(".grid").appendChild(systemTitle);
692 }763 }
693 longSystemName = infocardArray[systemIdsNameArray[system.toLowerCase()]];764 longSystemName = infocardArray[systemIdsNameArray[system.toLowerCase()]];
694 systemTitle.innerHTML = longSystemName;765 systemTitle.innerHTML = longSystemName;
695 encodedSystemName = encodeURI(longSystemName);
696 history.replaceState(longSystemName, "Discovery Navmap for "+longSystemName, "#"+encodedSystemName);
697 document.querySelector(".map").dataset.systemNickname = system.toLowerCase();766 document.querySelector(".map").dataset.systemNickname = system.toLowerCase();
698 document.querySelector("#navSystemTitle").innerHTML = "Current System: " + longSystemName;767 document.querySelector("#navSystemTitle").innerHTML = "Current System: " + longSystemName;
699 systemTitle.className = "systemTitle";768 systemTitle.className = "systemTitle";
700 var posArray = [];769 var posArray = [];
701 var nameArray = [];770 var nameArray = [];
702 sysLootableZoneArray = {};771 sysLootableZoneArray = {};
703 $.get(systemFile, function(data) {772 $.get(systemFile, function(data) {
704 var sysAmbientObject = data.match(ambientRegex);773 var sysAmbientObject = data.match(ambientRegex);
705 if (sysAmbientObject.join().indexOf("color") != -1) {774 if (sysAmbientObject.join().indexOf("color") != -1) {
706 var ambientColourString = sysAmbientObject.join().match(colourRegex).join().substring(8).replace(/ /g,"");775 var ambientColourString = sysAmbientObject.join().match(colourRegex).join().substring(8).replace(/ /g,"");
707 console.log(currentSystemNickname+" ambient colour: "+ambientColourString);776 console.log(currentSystemNickname+" ambient colour: "+ambientColourString);
708 var ambientColourArray = ambientColourString.split(",");777 var ambientColourArray = ambientColourString.split(",");
709 var ambientColourString = "rgba("+parseInt(ambientColourArray[0]*0.3)+","+parseInt(ambientColourArray[1]*0.3)+","+parseInt(ambientColourArray[2]*0.3)+",0.95)";778 var ambientColourString = "rgba("+parseInt(ambientColourArray[0]*0.3)+","+parseInt(ambientColourArray[1]*0.3)+","+parseInt(ambientColourArray[2]*0.3)+",0.95)";
710 document.querySelector(".grid").style.background = ambientColourString;779 document.querySelector(".grid").style.background = ambientColourString;
711 }780 }
712 //grab lootable field files781 //grab lootable field files
713 var asteroidsArray = {};782 var asteroidsArray = {};
714 asteroidsURIArray = {};783 asteroidsURIArray = {};
715 if (data.indexOf("[Asteroids]") != -1) {784 if (data.indexOf("[Asteroids]") != -1) {
716 var sysAsteroidsArray = data.match(asteroidsRegex);785 var sysAsteroidsArray = data.match(asteroidsRegex);
717 for (i = 0; i < sysAsteroidsArray.length; i++) {786 for (i = 0; i < sysAsteroidsArray.length; i++) {
718 if (sysAsteroidsArray[i].indexOf("file") != -1 && sysAsteroidsArray[i].indexOf("zone") != -1) {787 if (sysAsteroidsArray[i].indexOf("file") != -1 && sysAsteroidsArray[i].indexOf("zone") != -1) {
719 var asteroidsDataArray = sysAsteroidsArray[i].split("\n");788 var asteroidsDataArray = sysAsteroidsArray[i].split("\n");
720 var asteroidsNickname = asteroidsDataArray[2].split(" = ")[1].toLowerCase();789 var asteroidsNickname = asteroidsDataArray[2].split(" = ")[1].toLowerCase();
721 var asteroidsURI = asteroidsDataArray[1].split(" = ")[1];790 var asteroidsURI = asteroidsDataArray[1].split(" = ")[1];
722 asteroidsURIArray[asteroidsNickname] = dataRootPath+asteroidsURI.replace(/\\/g,"/").toLowerCase();791 asteroidsURIArray[asteroidsNickname] = dataRootPath+asteroidsURI.replace(/\\/g,"/").toLowerCase();
723 }792 }
724 }793 }
725 activeAsteroidGetRequests = 0;794 activeAsteroidGetRequests = 0;
726 for (var asteroidsNickname in asteroidsURIArray) {795 for (var asteroidsNickname in asteroidsURIArray) {
727 // most satisfying solution I've seen in years. two lines providing a scope for keeping the iteration variable fixes /everything/ that was wrong.796 // most satisfying solution I've seen in years. two lines providing a scope for keeping the iteration variable fixes /everything/ that was wrong.
728 (function(asteroidsNickname) {797 (function(asteroidsNickname) {
729 activeAsteroidGetRequests += 1;798 activeAsteroidGetRequests += 1;
730 console.log("Getting asteroid file for "+asteroidsNickname);799 console.log("Getting asteroid file for "+asteroidsNickname);
731 $.get(asteroidsURIArray[asteroidsNickname], function(data) {800 $.get(asteroidsURIArray[asteroidsNickname], function(data) {
732 zoneNicknameRegex.lastIndex = 0;801 zoneNicknameRegex.lastIndex = 0;
733 activeAsteroidGetRequests -= 1;802 activeAsteroidGetRequests -= 1;
734 console.log(data);803 console.log(data);
735 if (data.indexOf("[LootableZone]") != -1 804 if (data.indexOf("[LootableZone]") != -1
736 && ((data.indexOf("dynamic_loot_commodity = ") != -1 | data.indexOf("asteroid_loot_commodity = ") != -1)) && data.match(lootableZoneRegex)) {805 && ((data.indexOf("dynamic_loot_commodity = ") != -1 | data.indexOf("asteroid_loot_commodity = ") != -1)) && data.match(lootableZoneRegex)) {
737 // you've got loot and I want it now.806 // you've got loot and I want it now.
738 console.log("you've got loot and I want it now.");807 console.log("you've got loot and I want it now.");
739 var lootableZoneNickname = "";808 var lootableZoneNickname = "";
740 lootableZoneRegex.lastIndex = 0;809 lootableZoneRegex.lastIndex = 0;
741 var lootableZoneArray = data.match(lootableZoneRegex).join();810 var lootableZoneArray = data.match(lootableZoneRegex).join();
742 if (lootableZoneArray.indexOf("zone = ") == -1) {811 if (lootableZoneArray.indexOf("zone = ") == -1) {
743 lootableZoneNickname = asteroidsNickname;812 lootableZoneNickname = asteroidsNickname;
744 console.log("Using asteroidsNickname: "+asteroidsNickname);813 console.log("Using asteroidsNickname: "+asteroidsNickname);
745 } else {814 } else {
746 lootableZoneNickname = lootableZoneArray.match(zoneNicknameRegex).join().substring(7);815 lootableZoneNickname = lootableZoneArray.match(zoneNicknameRegex).join().substring(7);
747 console.log("Using found zone nickname: "+lootableZoneNickname);816 console.log("Using found zone nickname: "+lootableZoneNickname);
748 }817 }
749 if (data.indexOf("dynamic_loot_commodity = ") != -1) {818 if (data.indexOf("dynamic_loot_commodity = ") != -1) {
750 var lootableZoneDynamicCommodity = lootableZoneArray.match(lootableZoneDynamicCommodityRegex)[0].substring(25);819 var lootableZoneDynamicCommodity = lootableZoneArray.match(lootableZoneDynamicCommodityRegex)[0].substring(25);
751 var lootableZoneDynamicCount = lootableZoneArray.match(lootableZoneDynamicCountRegex)[0].substring(21);820 var lootableZoneDynamicCount = lootableZoneArray.match(lootableZoneDynamicCountRegex)[0].substring(21);
752 var lootableZoneDynamicDifficulty = lootableZoneArray.match(lootableZoneDynamicDifficultyRegex)[0].substring(26);821 var lootableZoneDynamicDifficulty = lootableZoneArray.match(lootableZoneDynamicDifficultyRegex)[0].substring(26);
753 console.log(asteroidsNickname);822 console.log(asteroidsNickname);
754 console.log(lootableZoneNickname);823 console.log(lootableZoneNickname);
755 console.log([lootableZoneDynamicCommodity, lootableZoneDynamicCount, lootableZoneDynamicDifficulty]);824 console.log([lootableZoneDynamicCommodity, lootableZoneDynamicCount, lootableZoneDynamicDifficulty]);
756 if (typeof sysLootableZoneArray[lootableZoneNickname.toLowerCase()] == "undefined") {825 if (typeof sysLootableZoneArray[lootableZoneNickname.toLowerCase()] == "undefined") {
757 sysLootableZoneArray[lootableZoneNickname.toLowerCase()] = [lootableZoneDynamicCommodity, lootableZoneDynamicCount, lootableZoneDynamicDifficulty];826 sysLootableZoneArray[lootableZoneNickname.toLowerCase()] = [lootableZoneDynamicCommodity, lootableZoneDynamicCount, lootableZoneDynamicDifficulty];
758 } else {827 } else {
759 sysLootableZoneArray[lootableZoneNickname.toLowerCase()].push([lootableZoneDynamicCommodity, lootableZoneDynamicCount, lootableZoneDynamicDifficulty]);828 sysLootableZoneArray[lootableZoneNickname.toLowerCase()].push([lootableZoneDynamicCommodity, lootableZoneDynamicCount, lootableZoneDynamicDifficulty]);
760 }829 }
761 }830 }
762 if (data.indexOf("asteroid_loot_commodity = ") != -1) {831 if (data.indexOf("asteroid_loot_commodity = ") != -1) {
763 var lootableZoneAsteroidCommodity = lootableZoneArray.match(lootableZoneAsteroidCommodityRegex)[0].substring(25);832 var lootableZoneAsteroidCommodity = lootableZoneArray.match(lootableZoneAsteroidCommodityRegex)[0].substring(25);
764 var lootableZoneAsteroidCount = lootableZoneArray.match(lootableZoneAsteroidCountRegex)[0].substring(21);833 var lootableZoneAsteroidCount = lootableZoneArray.match(lootableZoneAsteroidCountRegex)[0].substring(21);
765 var lootableZoneAsteroidDifficulty = lootableZoneArray.match(lootableZoneAsteroidDifficultyRegex)[0].substring(26);834 var lootableZoneAsteroidDifficulty = lootableZoneArray.match(lootableZoneAsteroidDifficultyRegex)[0].substring(26);
766 console.log(asteroidsNickname);835 console.log(asteroidsNickname);
767 console.log(lootableZoneNickname);836 console.log(lootableZoneNickname);
768 console.log([lootableZoneAsteroidCommodity, lootableZoneAsteroidCount, lootableZoneAsteroidDifficulty]);837 console.log([lootableZoneAsteroidCommodity, lootableZoneAsteroidCount, lootableZoneAsteroidDifficulty]);
769 if (typeof sysLootableZoneArray[lootableZoneNickname.toLowerCase()] == "undefined") {838 if (typeof sysLootableZoneArray[lootableZoneNickname.toLowerCase()] == "undefined") {
770 sysLootableZoneArray[lootableZoneNickname.toLowerCase()] = [].push([lootableZoneAsteroidCommodity, lootableZoneAsteroidCount, lootableZoneAsteroidDifficulty]);839 sysLootableZoneArray[lootableZoneNickname.toLowerCase()] = [].push([lootableZoneAsteroidCommodity, lootableZoneAsteroidCount, lootableZoneAsteroidDifficulty]);
771 } else {840 } else {
772 sysLootableZoneArray[lootableZoneNickname.toLowerCase()].push([lootableZoneAsteroidCommodity, lootableZoneAsteroidCount, lootableZoneAsteroidDifficulty]);841 sysLootableZoneArray[lootableZoneNickname.toLowerCase()].push([lootableZoneAsteroidCommodity, lootableZoneAsteroidCount, lootableZoneAsteroidDifficulty]);
773 }842 }
774 }843 }
775 }844 }
776 });845 });
777 })(asteroidsNickname);846 })(asteroidsNickname);
778 }847 }
779 console.log(asteroidsURIArray);848 console.log(asteroidsURIArray);
780 console.log(sysLootableZoneArray);849 console.log(sysLootableZoneArray);
781 }850 }
782 //generate zones851 //generate zones
783 var sysZoneArray = data.match(zoneRegex);852 var sysZoneArray = data.match(zoneRegex);
784 for (i = 0; i < sysZoneArray.length; i++) {853 for (i = 0; i < sysZoneArray.length; i++) {
785 var nameString = sysZoneArray[i].match(nameRegex).join().substring(11);854 var nameString = sysZoneArray[i].match(nameRegex).join().substring(11);
786 if (asteroidsURIArray[nameString.toLowerCase()] != null | sysZoneArray[i].indexOf("66170") == -1) {855 if (asteroidsURIArray[nameString.toLowerCase()] != null | sysZoneArray[i].indexOf("66170") == -1) {
787 var zoneName;856 var zoneName;
788 var zone = document.createElement("div");857 var zone = document.createElement("div");
789 zone.className += "zone";858 zone.className += "zone";
790 zone.dataset.internalNickname = nameString.toLowerCase();859 zone.dataset.internalNickname = nameString.toLowerCase();
791 if (sysZoneArray[i].indexOf("ids_name") != -1) {860 if (sysZoneArray[i].indexOf("ids_name") != -1) {
792 var idsNameNumber = sysZoneArray[i].match(idsNameRegex).join().substring(11);861 var idsNameNumber = sysZoneArray[i].match(idsNameRegex).join().substring(11);
793 zone.dataset.idsName = idsNameNumber;862 zone.dataset.idsName = idsNameNumber;
794 zoneName = infocardArray[idsNameNumber];863 zoneName = infocardArray[idsNameNumber];
795 } else {864 } else {
796 zone.className += " noName";865 zone.className += " noName";
797 }866 }
798 var zoneLabel = document.createElement("label");867 var zoneLabel = document.createElement("label");
799 zoneLabel.innerHTML = zoneName;868 zoneLabel.innerHTML = zoneName;
800 zone.appendChild(zoneLabel);869 zone.appendChild(zoneLabel);
801 var posString = sysZoneArray[i].match(posRegex).join().substring(6).replace(/ /g,"");870 var posString = sysZoneArray[i].match(posRegex).join().substring(6).replace(/ /g,"");
802 var zonePosArray = posString.split(",");871 var zonePosArray = posString.split(",");
803 zone.style.top = parseFloat(zonePosArray[2])/2000*systemScaleFactor + "%";872 zone.style.top = parseFloat(zonePosArray[2])/2000*systemScaleFactor + "%";
804 zone.style.left = parseFloat(zonePosArray[0])/2000*systemScaleFactor + "%";873 zone.style.left = parseFloat(zonePosArray[0])/2000*systemScaleFactor + "%";
805 zone.dataset.zPos = zonePosArray[1]*systemScaleFactor;874 zone.dataset.zPos = zonePosArray[1]*systemScaleFactor;
806 zone.style.position = "absolute";875 zone.style.position = "absolute";
807 if (sysZoneArray[i].indexOf("ids_info") != -1) {876 if (sysZoneArray[i].indexOf("ids_info") != -1) {
808 var idsInfoNumber = sysZoneArray[i].match(idsInfoRegex).join().substring(11);877 var idsInfoNumber = sysZoneArray[i].match(idsInfoRegex).join().substring(11);
809 zone.dataset.idsInfo = idsInfoNumber;878 zone.dataset.idsInfo = idsInfoNumber;
810 zone.addEventListener("click", function() {879 zone.addEventListener("click", function() {
811 showInfoEventHandler(this);880 showInfoEventHandler(this);
812 });881 });
813 } else {882 } else {
814 zone.className += " noInfo";883 zone.className += " noInfo";
815 }884 }
816 if (sysZoneArray[i].indexOf("rotate") != -1) {885 if (sysZoneArray[i].indexOf("rotate") != -1) {
817 var rotateString = sysZoneArray[i].match(rotationRegex).join().substring(10).replace(/ /g,"");886 var rotateString = sysZoneArray[i].match(rotationRegex).join().substring(10).replace(/ /g,"");
818 var zoneRotateArray = rotateString.split(",");887 var zoneRotateArray = rotateString.split(",");
819 zone.style.transform = "rotate("+-parseFloat(zoneRotateArray[1])+"deg)";888 zone.style.transform = "rotate("+-parseFloat(zoneRotateArray[1])+"deg)";
820 zone.style.webkitTransform = "rotate("+-parseFloat(zoneRotateArray[1])+"deg)";889 zone.style.webkitTransform = "rotate("+-parseFloat(zoneRotateArray[1])+"deg)";
821 zoneLabel.style.transform = "rotate("+parseFloat(zoneRotateArray[1])+"deg)";890 zoneLabel.style.transform = "rotate("+parseFloat(zoneRotateArray[1])+"deg)";
822 zoneLabel.style.webkitTransform = "rotate("+parseFloat(zoneRotateArray[1])+"deg)";891 zoneLabel.style.webkitTransform = "rotate("+parseFloat(zoneRotateArray[1])+"deg)";
823 }892 }
824 var sizeString = sysZoneArray[i].match(sizeRegex).join().substring(7).replace(/ /g,"");893 var sizeString = sysZoneArray[i].match(sizeRegex).join().substring(7).replace(/ /g,"");
825 var zoneSizeArray = sizeString.split(",");894 var zoneSizeArray = sizeString.split(",");
826 // 131072: exclusion zone type 2, these are weird895 // 131072: exclusion zone type 2, these are weird
827 if (sysZoneArray[i].indexOf("131072") != -1) {896 if (sysZoneArray[i].indexOf("131072") != -1) {
828 zone.style.height = systemScaleFactor*parseFloat(zoneSizeArray[2])/2000 + "%";897 zone.style.height = systemScaleFactor*parseFloat(zoneSizeArray[2])/2000 + "%";
829 zone.style.width = systemScaleFactor*parseFloat(zoneSizeArray[0])/2000 + "%";898 zone.style.width = systemScaleFactor*parseFloat(zoneSizeArray[0])/2000 + "%";
830 } else {899 } else {
831 zone.style.height = systemScaleFactor*parseFloat(zoneSizeArray[2])/1000 + "%";900 zone.style.height = systemScaleFactor*parseFloat(zoneSizeArray[2])/1000 + "%";
832 zone.style.width = systemScaleFactor*parseFloat(zoneSizeArray[0])/1000 + "%";901 zone.style.width = systemScaleFactor*parseFloat(zoneSizeArray[0])/1000 + "%";
833 }902 }
834 zone.style.zIndex = Math.floor(-systemScaleFactor*parseFloat(zoneSizeArray[2])/1000*systemScaleFactor*parseFloat(zoneSizeArray[0])/1000);903 zone.style.zIndex = Math.floor(-systemScaleFactor*parseFloat(zoneSizeArray[2])/1000*systemScaleFactor*parseFloat(zoneSizeArray[0])/1000);
835 if (sysZoneArray[i].toLowerCase().indexOf("ellipsoid") != -1) {904 if (sysZoneArray[i].toLowerCase().indexOf("ellipsoid") != -1) {
836 zone.className += " roundZone";905 zone.className += " roundZone";
837 } else if (sysZoneArray[i].toLowerCase().indexOf("sphere") != -1) {906 } else if (sysZoneArray[i].toLowerCase().indexOf("sphere") != -1) {
838 zone.style.height = zone.style.width;907 zone.style.height = zone.style.width;
839 zone.className += " roundZone";908 zone.className += " roundZone";
840 } else if (sysZoneArray[i].toLowerCase().indexOf("cylinder") != -1) {909 } else if (sysZoneArray[i].toLowerCase().indexOf("cylinder") != -1) {
841 zone.className += " cylinderZone";910 zone.className += " cylinderZone";
842 } else if (sysZoneArray[i].toLowerCase().indexOf("box") != -1) {911 } else if (sysZoneArray[i].toLowerCase().indexOf("box") != -1) {
843 zone.className += " boxZone";912 zone.className += " boxZone";
844 }913 }
845 if (sysZoneArray[i].indexOf("property_fog_color") != -1) {914 if (sysZoneArray[i].indexOf("property_fog_color") != -1) {
846 var fogColourString = sysZoneArray[i].match(fogColourRegex).join().substring(21).replace(/ /g,"");915 var fogColourString = sysZoneArray[i].match(fogColourRegex).join().substring(21).replace(/ /g,"");
847 console.log(zoneName+" fog colour: "+fogColourString);916 console.log(zoneName+" fog colour: "+fogColourString);
848 var fogColourArray = fogColourString.split(",");917 var fogColourArray = fogColourString.split(",");
849 var fogColourString = "rgba("+parseInt(fogColourArray[0])+","+parseInt(fogColourArray[1])+","+parseInt(fogColourArray[2])+",0.35)";918 var fogColourString = "rgba("+parseInt(fogColourArray[0])+","+parseInt(fogColourArray[1])+","+parseInt(fogColourArray[2])+",0.35)";
850 zone.style.backgroundColor = fogColourString;919 zone.style.backgroundColor = fogColourString;
851 }920 }
852 if (sysZoneArray[i].indexOf("property_flags") != -1) {921 if (sysZoneArray[i].indexOf("property_flags") != -1) {
853 var zoneTypeNumber = sysZoneArray[i].match(zoneTypeRegex).join().substring(17).replace(/ /g,"");922 var zoneTypeNumber = sysZoneArray[i].match(zoneTypeRegex).join().substring(17).replace(/ /g,"");
854 console.log(zoneName+" zone type: "+zoneFlagArray[zoneTypeNumber]+" "+zoneTypeNumber);923 console.log(zoneName+" zone type: "+zoneFlagArray[zoneTypeNumber]+" "+zoneTypeNumber);
855 zone.className += " "+zoneFlagArray[zoneTypeNumber];924 zone.className += " "+zoneFlagArray[zoneTypeNumber];
856 } else {925 } else {
857 zone.className += " noZoneType";926 zone.className += " noZoneType";
858 }927 }
859 if (sysZoneArray[i].indexOf("131072") != -1) {928 if (sysZoneArray[i].indexOf("131072") != -1) {
860 zone.style.marginTop = -systemScaleFactor*parseFloat(zoneSizeArray[2])/4000 + "%";929 zone.style.marginTop = -systemScaleFactor*parseFloat(zoneSizeArray[2])/4000 + "%";
861 zone.style.marginLeft = -systemScaleFactor*parseFloat(zoneSizeArray[0])/4000 + "%";930 zone.style.marginLeft = -systemScaleFactor*parseFloat(zoneSizeArray[0])/4000 + "%";
862 } else {931 } else {
863 zone.style.marginTop = -systemScaleFactor*parseFloat(zoneSizeArray[2])/2000 + "%";932 zone.style.marginTop = -systemScaleFactor*parseFloat(zoneSizeArray[2])/2000 + "%";
864 zone.style.marginLeft = -systemScaleFactor*parseFloat(zoneSizeArray[0])/2000 + "%";933 zone.style.marginLeft = -systemScaleFactor*parseFloat(zoneSizeArray[0])/2000 + "%";
865 }934 }
866 if (sysZoneArray[i].toLowerCase().indexOf("sphere") != -1) {935 if (sysZoneArray[i].toLowerCase().indexOf("sphere") != -1) {
867 zone.style.marginTop = zone.style.marginLeft;936 zone.style.marginTop = zone.style.marginLeft;
868 zone.style.zIndex = Math.floor(-systemScaleFactor*parseFloat(zoneSizeArray[0])/1000*systemScaleFactor*parseFloat(zoneSizeArray[0])/1000);937 zone.style.zIndex = Math.floor(-systemScaleFactor*parseFloat(zoneSizeArray[0])/1000*systemScaleFactor*parseFloat(zoneSizeArray[0])/1000);
869 }938 }
870 document.querySelector(".map").appendChild(zone);939 document.querySelector(".map").appendChild(zone);
871 }940 }
872 }941 }
873 942
874 // generate objects943 // generate objects
875 var sysObjectArray = data.match(objectRegex);944 var sysObjectArray = data.match(objectRegex);
876 for (i = 0; i < sysObjectArray.length; i++) { 945 for (i = 0; i < sysObjectArray.length; i++) {
877 var objectName;946 var objectName;
878 var object = document.createElement("div");947 var object = document.createElement("div");
879 var posString = sysObjectArray[i].match(posRegex).join().substring(6).replace(/ /g,"");948 var posString = sysObjectArray[i].match(posRegex).join().substring(6).replace(/ /g,"");
880 var nameString = sysObjectArray[i].match(nameRegex).join().substring(11);949 var nameString = sysObjectArray[i].match(nameRegex).join().substring(11);
881 var objectClasses = getObjectClasses(sysObjectArray[i]);950 var objectClasses = getObjectClasses(sysObjectArray[i]);
882 if (sysObjectArray[i].indexOf("ids_name") != -1) {951 if (sysObjectArray[i].indexOf("ids_name") != -1) {
883 var idsNameNumber = sysObjectArray[i].match(idsNameRegex).join().substring(11);952 var idsNameNumber = sysObjectArray[i].match(idsNameRegex).join().substring(11);
884 object.dataset.idsName = idsNameNumber;953 object.dataset.idsName = idsNameNumber;
885 objectName = infocardArray[idsNameNumber];954 objectName = infocardArray[idsNameNumber];
886 } else {955 } else {
887 objectName = findObjectName(nameString, objectClasses);956 objectName = findObjectName(nameString, objectClasses);
888 if (objectName.indexOf("???") != -1 && objectClasses.indexOf("tradelane") == -1) {957 if (objectName.indexOf("???") != -1 && objectClasses.indexOf("tradelane") == -1) {
889 object.style.display = "none";958 object.style.display = "none";
890 }959 }
891 }960 }
892 var objectLabel = document.createElement("label");961 var objectLabel = document.createElement("label");
893 objectLabel.innerHTML = objectName;962 objectLabel.innerHTML = objectName;
894 object.appendChild(objectLabel);963 object.appendChild(objectLabel);
895 if (sysObjectArray[i].indexOf("ids_info") != -1) {964 if (sysObjectArray[i].indexOf("ids_info") != -1) {
896 var idsInfoNumber = sysObjectArray[i].match(idsInfoRegex).join().substring(11);965 var idsInfoNumber = sysObjectArray[i].match(idsInfoRegex).join().substring(11);
897 object.dataset.idsInfo = idsInfoNumber;966 object.dataset.idsInfo = idsInfoNumber;
898 object.addEventListener("click", function() {967 object.addEventListener("click", function() {
899 if (this.className.indexOf("jump") != -1 && typeof this.dataset.jumpDest !== "undefined") {968 if (this.className.indexOf("jump") != -1 && typeof this.dataset.jumpDest !== "undefined") {
900 generateMap(this.dataset.jumpDest);969 generateMap(this.dataset.jumpDest);
901 } else {970 } else {
902 showObjectInfo(this.dataset.idsName, this.dataset.idsInfo, this.className, this.dataset.zPos, this.dataset.reputation, document.querySelector(".map").dataset.systemNickname);971 showObjectInfo(this.dataset.idsName, this.dataset.idsInfo, this.className, this.dataset.zPos, this.dataset.reputation, document.querySelector(".map").dataset.systemNickname);
903 }972 }
904 });973 });
905 } else if (sysObjectArray[i].indexOf("goto =") != -1) {974 } else if (sysObjectArray[i].indexOf("goto =") != -1) {
906 object.addEventListener("click", function() {975 object.addEventListener("click", function() {
907 generateMap(this.dataset.jumpDest);976 generateMap(this.dataset.jumpDest);
908 });977 });
909 }978 }
910 var objectPosArray = posString.split(",");979 var objectPosArray = posString.split(",");
911 object.style.top = parseFloat(objectPosArray[2])/2000*systemScaleFactor + "%";980 object.style.top = parseFloat(objectPosArray[2])/2000*systemScaleFactor + "%";
912 object.style.left = parseFloat(objectPosArray[0])/2000*systemScaleFactor + "%";981 object.style.left = parseFloat(objectPosArray[0])/2000*systemScaleFactor + "%";
913 object.dataset.zPos = objectPosArray[1]*systemScaleFactor;982 object.dataset.zPos = objectPosArray[1]*systemScaleFactor;
914 object.style.position = "absolute";983 object.style.position = "absolute";
915 object.className = objectClasses;984 object.className = objectClasses;
916 document.querySelector(".map").appendChild(object);985 document.querySelector(".map").appendChild(object);
917 if (sysObjectArray[i].indexOf("rotate =") != -1 && object.className.indexOf("tradelane") != -1) {986 if (sysObjectArray[i].indexOf("rotate =") != -1 && object.className.indexOf("tradelane") != -1) {
918 var rotateString = sysObjectArray[i].match(rotationRegex).join().substring(9).replace(/ /g,"");987 var rotateString = sysObjectArray[i].match(rotationRegex).join().substring(9).replace(/ /g,"");
919 var objectRotateArray = rotateString.split(",");988 var objectRotateArray = rotateString.split(",");
920 if (sysObjectArray[i].indexOf("ga_lane") != -1) {989 if (sysObjectArray[i].indexOf("ga_lane") != -1) {
921 object.style.transform = "rotate("+(-parseFloat(objectRotateArray[0]))+"deg)";990 object.style.transform = "rotate("+(-parseFloat(objectRotateArray[0]))+"deg)";
922 object.style.webkitTransform = "rotate("+(-parseFloat(objectRotateArray[0]))+"deg)";991 object.style.webkitTransform = "rotate("+(-parseFloat(objectRotateArray[0]))+"deg)";
923 } else {992 } else {
924 object.style.transform = "rotate("+(-parseFloat(objectRotateArray[1]))+"deg)";993 object.style.transform = "rotate("+(-parseFloat(objectRotateArray[1]))+"deg)";
925 object.style.webkitTransform = "rotate("+(-parseFloat(objectRotateArray[1]))+"deg)";994 object.style.webkitTransform = "rotate("+(-parseFloat(objectRotateArray[1]))+"deg)";
926 }995 }
927 }996 }
928 if (object.className.indexOf("jump") != -1 && sysObjectArray[i].indexOf("goto =") != -1) {997 if (object.className.indexOf("jump") != -1 && sysObjectArray[i].indexOf("goto =") != -1) {
929 object.dataset.jumpDest = sysObjectArray[i].match(gotoRegex).join().substring(7).replace(/ /g,"").split(",")[0].toLowerCase();998 object.dataset.jumpDest = sysObjectArray[i].match(gotoRegex).join().substring(7).replace(/ /g,"").split(",")[0].toLowerCase();
930 }999 }
931 if (sysObjectArray[i].indexOf("reputation =") != -1) {1000 if (sysObjectArray[i].indexOf("reputation =") != -1) {
932 object.dataset.reputation = sysObjectArray[i].match(repRegex).join().substring(13);1001 object.dataset.reputation = sysObjectArray[i].match(repRegex).join().substring(13);
933 }1002 }
934 if (object.className.indexOf("star") != -1) {1003 if (object.className.indexOf("star") != -1) {
935 var innerStar = document.createElement("div");1004 var innerStar = document.createElement("div");
936 innerStar.className = "star";1005 innerStar.className = "star";
937 innerStar.style.top = "50%";1006 innerStar.style.top = "50%";
938 innerStar.style.left = "50%";1007 innerStar.style.left = "50%";
939 innerStar.style.position = "absolute";1008 innerStar.style.position = "absolute";
940 object.appendChild(innerStar);1009 object.appendChild(innerStar);
941 }1010 }
942 if (sysObjectArray[i].indexOf("burn_color") != -1) {1011 if (sysObjectArray[i].indexOf("burn_color") != -1) {
943 var burnColourString = sysObjectArray[i].match(burnColourRegex).join().substring(13).replace(/ /g,"");1012 var burnColourString = sysObjectArray[i].match(burnColourRegex).join().substring(13).replace(/ /g,"");
944 console.log(objectName+" burn colour: "+burnColourString);1013 console.log(objectName+" burn colour: "+burnColourString);
945 var burnColourArray = burnColourString.split(",");1014 var burnColourArray = burnColourString.split(",");
946 var burnColourString = "rgb("+parseInt(burnColourArray[0])+","+parseInt(burnColourArray[1])+","+parseInt(burnColourArray[2])+")";1015 var burnColourString = "rgb("+parseInt(burnColourArray[0])+","+parseInt(burnColourArray[1])+","+parseInt(burnColourArray[2])+")";
947 object.style.backgroundColor = burnColourString;1016 object.style.backgroundColor = burnColourString;
948 if (object.className.indexOf("star") != -1) {1017 if (object.className.indexOf("star") != -1) {
949 object.style.boxShadow += " "+burnColourString;1018 object.style.boxShadow += " "+burnColourString;
950 innerStar.style.boxShadow += " "+burnColourString;1019 innerStar.style.boxShadow += " "+burnColourString;
951 innerStar.style.backgroundColor = burnColourString;1020 innerStar.style.backgroundColor = burnColourString;
952 }1021 }
953 }1022 }
954 if (sysObjectArray[i].indexOf("atmosphere_range =") != -1) {1023 if (sysObjectArray[i].indexOf("atmosphere_range =") != -1) {
955 var objectRadius = parseFloat(sysObjectArray[i].match(atmosphereRadiusRegex).join().substring(19))/2000*systemScaleFactor;1024 var objectRadius = parseFloat(sysObjectArray[i].match(atmosphereRadiusRegex).join().substring(19))/2000*systemScaleFactor;
956 object.style.width = objectRadius*2 + "%";1025 object.style.width = objectRadius*2 + "%";
957 object.style.height = objectRadius*2 + "%";1026 object.style.height = objectRadius*2 + "%";
958 object.style.marginTop = -objectRadius + "%";1027 object.style.marginTop = -objectRadius + "%";
959 object.style.marginLeft = -objectRadius + "%";1028 object.style.marginLeft = -objectRadius + "%";
960 object.style.zIndex = Math.floor(-objectRadius);1029 object.style.zIndex = Math.floor(-objectRadius);
961 if (object.className.indexOf("star") != -1) {1030 if (object.className.indexOf("star") != -1) {
962 object.style.borderSizing = "border-box";1031 object.style.borderSizing = "border-box";
963 object.style.border = "solid red 1px";1032 object.style.border = "solid red 1px";
964 object.style.boxShadow = "none";1033 object.style.boxShadow = "none";
965 object.style.backgroundColor = "transparent";1034 object.style.backgroundColor = "transparent";
966 object.style.background = "transparent";1035 object.style.background = "transparent";
967 }1036 }
968 }1037 }
969 if (object.className == "object") {1038 if (object.className == "object") {
970 object.style.display = "none";1039 object.style.display = "none";
971 }1040 }
972 }1041 }
973 console.log("Map for "+system+" generated");1042 console.log("Map for "+system+" generated");
974 updateConfigClasses();
975 $(".map div label").hAlign();1043 $(".map div label").hAlign();
976 addLootableZoneData();1044 addLootableZoneData();
977 generateTooltips();1045 generateTooltips();
978 // wait for asteroid get requests to finish1046 // wait for asteroid get requests to finish
979 removeLoadingOverlayWhenReady();1047 removeLoadingOverlayWhenReady();
980 $("#searchField").keyup();1048 $("#searchField").keyup();
1049 updateConfigClasses();
1050 console.log("lastSearch = "+lastSearch);
1051 if (lastSearch !== undefined) {
1052 history.replaceState(longSystemName, "Discovery Navmap for "+longSystemName, "#"+encodeURI(lastSearch));
1053 createHighlightAnimation($(".mapContainer").find(".object label").filter(function() {
1054 return $(this).text().toLowerCase() === lastSearch.toLowerCase();
1055 }).parent());
1056 lastSearch = undefined;
1057 } else {
1058 encodedSystemName = encodeURI(longSystemName);
1059 history.replaceState(longSystemName, "Discovery Navmap for "+longSystemName, "#"+encodedSystemName);
1060 }
981 });1061 });
982 }1062 }
983 }1063 }
984 1064
985 function removeLoadingOverlayWhenReady() {1065 function removeLoadingOverlayWhenReady() {
986 if (activeAsteroidGetRequests > 0) {1066 if (activeAsteroidGetRequests > 0) {
987 setTimeout(function(){removeLoadingOverlayWhenReady();},10);1067 setTimeout(function(){removeLoadingOverlayWhenReady();},10);
988 document.querySelector(".loaderTitle").innerHTML = "Fetching field data... ("+activeAsteroidGetRequests+" left)";1068 document.querySelector(".loaderTitle").innerHTML = "Fetching field data... ("+activeAsteroidGetRequests+" left)";
989 } else {1069 } else {
990 document.querySelector("body").removeChild(document.querySelector(".loadingOverlay"));1070 document.querySelector("body").removeChild(document.querySelector(".loadingOverlay"));
1071 updateConfigClasses();
991 }1072 }
992 }1073 }
993 1074
994 function showInfoEventHandler(currentObject) {1075 function showInfoEventHandler(currentObject) {
995 showObjectInfo(currentObject.dataset.idsName, currentObject.dataset.idsInfo, currentObject.className, currentObject.dataset.zPos, currentObject.dataset.reputation, document.querySelector(".map").dataset.systemNickname, currentObject.dataset.dynamicCommodity, currentObject.dataset.dynamicDifficulty, currentObject.dataset.dynamicCount);1076 showObjectInfo(currentObject.dataset.idsName, currentObject.dataset.idsInfo, currentObject.className, currentObject.dataset.zPos, currentObject.dataset.reputation, document.querySelector(".map").dataset.systemNickname, currentObject.dataset.dynamicCommodity, currentObject.dataset.dynamicDifficulty, currentObject.dataset.dynamicCount);
996 }1077 }
997 1078
998 function addLootableZoneData() {1079 function addLootableZoneData() {
999 if (activeAsteroidGetRequests !== 0) {1080 if (activeAsteroidGetRequests !== 0) {
1000 setTimeout(function(){addLootableZoneData();},10);1081 setTimeout(function(){addLootableZoneData();},10);
1001 } else {1082 } else {
1002 console.log("running loot thingy");1083 console.log("running loot thingy");
1003 for (var zoneNickname in sysLootableZoneArray) {1084 for (var zoneNickname in sysLootableZoneArray) {
1004 zoneNickname = zoneNickname.toLowerCase();1085 zoneNickname = zoneNickname.toLowerCase();
1005 console.log(zoneNickname);1086 console.log(zoneNickname);
1006 if (document.querySelector("[data-internal-nickname="+zoneNickname+"] label") !== null) {1087 if (document.querySelector("[data-internal-nickname="+zoneNickname+"] label") !== null) {
1007 console.log("adding mineable zone "+zoneNickname);1088 console.log("adding mineable zone "+zoneNickname);
1008 var currentZone = document.querySelector("[data-internal-nickname="+zoneNickname+"]");1089 var currentZone = document.querySelector("[data-internal-nickname="+zoneNickname+"]");
1009 var currentZoneLabel = document.querySelector("[data-internal-nickname="+zoneNickname+"] label");1090 var currentZoneLabel = document.querySelector("[data-internal-nickname="+zoneNickname+"] label");
1010 var mineIcon = '<svg class="mineableIcon" id="Слой_1" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M256.001,6C117.928,6,6,117.929,6,256c0,138.071,111.928,250,250.001,250 C394.072,506,506,394.071,506,256C506,117.929,394.072,6,256.001,6z M217.135,399.953c-1.43,3.027-5.043,4.315-8.068,2.881 l-32.872-15.559c-3.022-1.43-4.311-5.041-2.881-8.066l8.401-17.02c1.133,0.677,2.166,1.252,3.045,1.667 c8.685,4.096,29.274,7.318,44.631,9.271L217.135,399.953z M294.363,291.966c-2.992,6.319-10.547,9.021-16.873,6.029 c6.326,2.992,9.029,10.546,6.034,16.87c-2.992,6.321-10.547,9.023-16.873,6.029c6.326,2.994,9.028,10.544,6.032,16.868 c-2.991,6.324-10.548,9.021-16.87,6.029c6.323,2.992,9.028,10.546,6.032,16.87c-2.481,5.242-8.091,7.934-13.538,7.018l-0.007,0.056 c0,0-47.308-4.48-60.319-10.61c-0.008-0.007-0.015-0.008-0.028-0.016c-7.87-3.725-30.067-21.676-40.265-30.074 c-3.42-2.823-6.494-6.006-9.171-9.547c-1.74-2.305-5.301-5.199-7.909-6.434l-42.835-20.277c-5.457-2.584-8.383-8.585-7.046-14.469 c4.223-18.568,12.183-37.279,28.923-60.216c3.645-4.995,10.298-6.7,15.889-4.053l39.03,18.478 c10.448,4.945,27.898,5.808,38.78,1.918l6.535-2.334c4.491-1.606,11.68-1.249,15.99,0.79l7.516,3.56 c1.277,0.601,1.824,2.134,1.223,3.409l-2.233,4.72c-2.14,8.37,5.245,14.681,15.448,19.51c13.981,6.618,33.247,10.454,40.505,13.004 C294.655,278.088,297.355,285.64,294.363,291.966z M430.383,263.831c-1.004,0.586-2.281,0.384-3.056-0.482 c-30.99-34.623-67.257-63.727-108.513-86.006l-39.883,87.315c-8.446-2.268-19.427-5.299-27.916-9.317 c-4.489-2.126-11.708-6.194-11.494-10.263l42.138-85.371c-43.573-17.951-89.281-27.625-135.923-29.657 c-1.164-0.054-2.127-0.914-2.313-2.062c-0.181-1.144,0.469-2.263,1.556-2.674c52.527-19.817,106.815-22.695,156.165-5.084 l3.191-6.473c1.435-3.027,5.046-4.316,8.071-2.885l24.829,11.752c3.022,1.43,4.315,5.044,2.881,8.071l-3.03,6.634 c44.552,27.036,76.507,70.68,94.382,123.602C431.839,262.034,431.387,263.244,430.383,263.831z" style="fill:#FFFFFF;"/></svg>';1091 var mineIcon = '<svg class="mineableIcon" id="Слой_1" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M256.001,6C117.928,6,6,117.929,6,256c0,138.071,111.928,250,250.001,250 C394.072,506,506,394.071,506,256C506,117.929,394.072,6,256.001,6z M217.135,399.953c-1.43,3.027-5.043,4.315-8.068,2.881 l-32.872-15.559c-3.022-1.43-4.311-5.041-2.881-8.066l8.401-17.02c1.133,0.677,2.166,1.252,3.045,1.667 c8.685,4.096,29.274,7.318,44.631,9.271L217.135,399.953z M294.363,291.966c-2.992,6.319-10.547,9.021-16.873,6.029 c6.326,2.992,9.029,10.546,6.034,16.87c-2.992,6.321-10.547,9.023-16.873,6.029c6.326,2.994,9.028,10.544,6.032,16.868 c-2.991,6.324-10.548,9.021-16.87,6.029c6.323,2.992,9.028,10.546,6.032,16.87c-2.481,5.242-8.091,7.934-13.538,7.018l-0.007,0.056 c0,0-47.308-4.48-60.319-10.61c-0.008-0.007-0.015-0.008-0.028-0.016c-7.87-3.725-30.067-21.676-40.265-30.074 c-3.42-2.823-6.494-6.006-9.171-9.547c-1.74-2.305-5.301-5.199-7.909-6.434l-42.835-20.277c-5.457-2.584-8.383-8.585-7.046-14.469 c4.223-18.568,12.183-37.279,28.923-60.216c3.645-4.995,10.298-6.7,15.889-4.053l39.03,18.478 c10.448,4.945,27.898,5.808,38.78,1.918l6.535-2.334c4.491-1.606,11.68-1.249,15.99,0.79l7.516,3.56 c1.277,0.601,1.824,2.134,1.223,3.409l-2.233,4.72c-2.14,8.37,5.245,14.681,15.448,19.51c13.981,6.618,33.247,10.454,40.505,13.004 C294.655,278.088,297.355,285.64,294.363,291.966z M430.383,263.831c-1.004,0.586-2.281,0.384-3.056-0.482 c-30.99-34.623-67.257-63.727-108.513-86.006l-39.883,87.315c-8.446-2.268-19.427-5.299-27.916-9.317 c-4.489-2.126-11.708-6.194-11.494-10.263l42.138-85.371c-43.573-17.951-89.281-27.625-135.923-29.657 c-1.164-0.054-2.127-0.914-2.313-2.062c-0.181-1.144,0.469-2.263,1.556-2.674c52.527-19.817,106.815-22.695,156.165-5.084 l3.191-6.473c1.435-3.027,5.046-4.316,8.071-2.885l24.829,11.752c3.022,1.43,4.315,5.044,2.881,8.071l-3.03,6.634 c44.552,27.036,76.507,70.68,94.382,123.602C431.839,262.034,431.387,263.244,430.383,263.831z" style="fill:#FFFFFF;"/></svg>';
1011 if (currentZoneLabel.innerHTML.toLowerCase().indexOf("undefined") == -1) {1092 if (currentZoneLabel.innerHTML.toLowerCase().indexOf("undefined") == -1) {
1012 currentZoneLabel.innerHTML += mineIcon;1093 currentZoneLabel.innerHTML += mineIcon;
1013 } else {1094 } else {
1014 currentZoneLabel.innerHTML = "Mineable Zone"+mineIcon;1095 currentZoneLabel.innerHTML = "Mineable Zone"+mineIcon;
1015 }1096 }
1016 currentZone.className += " mineable";1097 currentZone.className += " mineable";
1017 currentZone.dataset.dynamicCommodity = sysLootableZoneArray[zoneNickname][0];1098 currentZone.dataset.dynamicCommodity = sysLootableZoneArray[zoneNickname][0];
1018 currentZone.dataset.dynamicDifficulty = sysLootableZoneArray[zoneNickname][2];1099 currentZone.dataset.dynamicDifficulty = sysLootableZoneArray[zoneNickname][2];
1019 currentZone.dataset.dynamicCount = sysLootableZoneArray[zoneNickname][1];1100 currentZone.dataset.dynamicCount = sysLootableZoneArray[zoneNickname][1];
1020 var eventData = $._data(this, 'events');1101 var eventData = $._data(this, 'events');
1021 if (!(eventData && eventData.click)) {1102 if (!(eventData && eventData.click)) {
1022 currentZone.addEventListener("click", function() {1103 currentZone.addEventListener("click", function() {
1023 showInfoEventHandler(this);1104 showInfoEventHandler(this);
1024 }); 1105 });
1025 }1106 }
1026 }1107 }
1027 }1108 }
1028 }1109 }
1029 }1110 }
1030 1111
1031 function getObjectClasses(objectString) {1112 function getObjectClasses(objectString) {
1032 var nameString = objectString.match(nameRegex).join().substring(11);1113 var nameString = objectString.match(nameRegex).join().substring(11);
1033 var baseRegex = /^\w+\d+_\d+$/g;1114 var baseRegex = /^\w+\d+_\d+$/g;
1034 var classArray = [];1115 var classArray = [];
1035 classArray.push("object");1116 classArray.push("object");
1036 if (objectString.toLowerCase().indexOf("atmosphere_range =") != -1 && objectString.toLowerCase().indexOf("star =") == -1) {1117 if (objectString.toLowerCase().indexOf("atmosphere_range =") != -1 && objectString.toLowerCase().indexOf("star =") == -1) {
1037 classArray.push("planet");1118 classArray.push("planet");
1038 } else if (objectString.toLowerCase().indexOf("base = ") != -1 | objectString.toLowerCase().indexOf("dock_with =") != -1) {1119 } else if (objectString.toLowerCase().indexOf("base = ") != -1 | objectString.toLowerCase().indexOf("dock_with =") != -1) {
1039 classArray.push("base");1120 classArray.push("base");
1040 }1121 }
1041 if (objectString.indexOf("base =") != -1) {1122 if (objectString.indexOf("base =") != -1) {
1042 classArray.push("dockable");1123 classArray.push("dockable");
1043 }1124 }
1044 if (nameString.toLowerCase().indexOf("trade_lane") != -1 1125 if (nameString.toLowerCase().indexOf("trade_lane") != -1
1045 | objectString.toLowerCase().indexOf("dsy_ga_lane") != -1 1126 | objectString.toLowerCase().indexOf("dsy_ga_lane") != -1
1046 | objectString.toLowerCase().indexOf("trade_lane_ring") != -1 1127 | objectString.toLowerCase().indexOf("trade_lane_ring") != -1
1047 | objectString.toLowerCase().indexOf("next_ring =") != -1) {1128 | objectString.toLowerCase().indexOf("next_ring =") != -1) {
1048 classArray.push("tradelane");1129 classArray.push("tradelane");
1049 }1130 }
1050 if (objectString.indexOf("loadout =") != -1 && (nameString.toLowerCase().indexOf("wplatform") != -1 | objectString.toLowerCase().indexOf("261164") != -1)) {1131 if (objectString.indexOf("loadout =") != -1 && (nameString.toLowerCase().indexOf("wplatform") != -1 | objectString.toLowerCase().indexOf("261164") != -1)) {
1051 classArray.push("wPlatform");1132 classArray.push("wPlatform");
1052 }1133 }
1053 if (objectString.indexOf("loadout =") != -1 && objectString.indexOf("reputation =") == -1) {1134 if (objectString.indexOf("loadout =") != -1 && objectString.indexOf("reputation =") == -1) {
1054 classArray.push("wreck");1135 classArray.push("wreck");
1055 }1136 }
1056 if (nameString.toLowerCase().indexOf("proxy_base") != -1) {1137 if (nameString.toLowerCase().indexOf("proxy_base") != -1) {
1057 classArray.push("proxyBase");1138 classArray.push("proxyBase");
1058 }1139 }
1059 if (nameString.toLowerCase().indexOf("_to_") != -1) {1140 if (nameString.toLowerCase().indexOf("_to_") != -1) {
1060 classArray.push("jump");1141 classArray.push("jump");
1061 if (nameString.toLowerCase().indexOf("_hole") != -1) {1142 if (nameString.toLowerCase().indexOf("_hole") != -1) {
1062 classArray.push("hole");1143 classArray.push("hole");
1063 } else {1144 } else {
1064 classArray.push("gate");1145 classArray.push("gate");
1065 }1146 }
1066 }1147 }
1067 if (objectString.toLowerCase().indexOf("star =") != -1 && objectString.toLowerCase().indexOf("atmosphere_range =") != -1) {1148 if (objectString.toLowerCase().indexOf("star =") != -1 && objectString.toLowerCase().indexOf("atmosphere_range =") != -1) {
1068 classArray.push("star");1149 classArray.push("star");
1069 }1150 }
1070 if (objectString.toLowerCase().indexOf("_dock_ring") != -1) {1151 if (objectString.toLowerCase().indexOf("_dock_ring") != -1) {
1071 classArray.push("dockingRing");1152 classArray.push("dockingRing");
1072 }1153 }
1073 if (objectString.toLowerCase().indexOf("docking_fixture") != -1) {1154 if (objectString.toLowerCase().indexOf("docking_fixture") != -1) {
1074 classArray.push("mooringFixture");1155 classArray.push("mooringFixture");
1075 }1156 }
1076 if (objectString.toLowerCase().indexOf("goto =") !=-1) {1157 if (objectString.toLowerCase().indexOf("goto =") !=-1) {
1077 }1158 }
1078 console.log("Object classes for "+nameString+" generated: "+classArray.join(" "));1159 console.log("Object classes for "+nameString+" generated: "+classArray.join(" "));
1079 return classArray.join(" ");1160 return classArray.join(" ");
1080 }1161 }
1081 1162
1082 function checkURL() {1163 function checkURL() {
1083 if (searchArrayState != "ready" | universeMapState != "ready" | document.querySelector(".loadingOverlay") !== null) {1164 if (searchArrayState != "ready" | universeMapState != "ready" | document.querySelector(".loadingOverlay") !== null) {
1084 setTimeout(function(){checkURL()},10);1165 setTimeout(function(){checkURL()},10);
1085 } else {1166 } else {
1086 if(window.location.hash) {1167 if(window.location.hash) {
1087 var input = decodeURI(window.location.hash.substring(1));1168 var input = decodeURI(window.location.hash.substring(1));
1088 if (typeof searchArray[input] !== "undefined" && searchArray[input].toLowerCase() !== currentSystemNickname.toLowerCase()) {1169 if (typeof searchArray[input] !== "undefined" && searchArray[input].toLowerCase() !== currentSystemNickname.toLowerCase()) {
1170 lastSearch = input;
1089 generateMap(searchArray[input]);1171 generateMap(searchArray[input]);
1090 }1172 }
1091 } else {1173 } else {
1092 // no URI hash input1174 // no URI hash input
1093 }1175 }
1094 }1176 }
1095 }1177 }
1096 1178
1097 function startSearchField() {1179 function startSearchField() {
1098 if (searchArrayState != "ready") {1180 if (searchArrayState != "ready") {
1099 setTimeout(function(){startSearchField()},10);1181 setTimeout(function(){startSearchField()},10);
1100 } else {1182 } else {
1101 $("#searchField").autoComplete({1183 $("#searchField").autoComplete({
1102 minChars: 2,1184 minChars: 2,
1103 source: function(term, suggest){1185 source: function(term, suggest){
1104 term = term.toLowerCase();1186 term = term.toLowerCase();
1105 var choices = matchArray;1187 var choices = matchArray;
1106 var matches = [];1188 var matches = [];
1107 for (i=0; i<choices.length; i++) {1189 for (i=0; i<choices.length; i++) {
1108 if (~choices[i].toLowerCase().indexOf(term)) {1190 if (~choices[i].toLowerCase().indexOf(term)) {
1109 matches.push(choices[i]);1191 matches.push(choices[i]);
1110 }1192 }
1111 }1193 }
1112 suggest(matches);1194 suggest(matches);
1113 },1195 },
1114 onSelect: function(e, term, item) {1196 onSelect: function(e, term, item) {
1115 $("#searchField").keyup();1197 $("#searchField").keyup();
1116 }1198 }
1117 });1199 });
1118 1200
1119 $("#searchField").keyup(function(event) {1201 $("#searchField").keyup(function(event) {
1120 if (event.keyCode != 38 && event.keyCode != 40) {1202 if (event.keyCode != 38 && event.keyCode != 40) {
1121 var search = $.trim(this.value).toLowerCase();1203 var search = $.trim(this.value).toLowerCase();
1122 if (search == "omega-5" && searchTimedOut == "nope") {1204 if (search == "omega-5" && searchTimedOut == "nope") {
1123 setTimeout(function() {if (searchTimedOut == "yup") {$("#searchField").keyup();}}, 550);1205 setTimeout(function() {if (searchTimedOut == "yup") {$("#searchField").keyup();}}, 550);
1124 searchTimedOut = "yup";1206 searchTimedOut = "yup";
1125 } else if (document.querySelector(".loadingOverlay") == null) {1207 } else if (document.querySelector(".loadingOverlay") == null) {
1126 searchTimedOut = "nope";1208 searchTimedOut = "nope";
1127 if (typeof searchArray[search] !== "undefined" && searchArray[search].toLowerCase() !== currentSystemNickname.toLowerCase()) {1209 if (typeof searchArray[search] !== "undefined" && searchArray[search].toLowerCase() !== currentSystemNickname.toLowerCase()) {
1210 lastSearch = search;
1128 generateMap(searchArray[search]);1211 generateMap(searchArray[search]);
1212 } else if (typeof searchArray[search] !== "undefined" && searchArray[search].toLowerCase() == currentSystemNickname.toLowerCase()) {
1213 createHighlightAnimation($(".mapContainer").find(".object label").filter(function() {
1214 return $(this).text().toLowerCase() === search.toLowerCase();
1215 }).parent());
1216 document.querySelector("#searchField").value = "";
1129 }1217 }
1130 }1218 }
1131 }1219 }
1132 });1220 });
1133 }1221 }
1134 }1222 }
1135 1223
1136 (function ($) {1224 (function ($) {
1137 $.fn.hAlign = function() {1225 $.fn.hAlign = function() {
1138 return this.each(function(i){1226 return this.each(function(i){
1139 var w = $(this).width();1227 var w = $(this).width();
1140 var ow = $(this).outerWidth(); 1228 var ow = $(this).outerWidth();
1141 var ml = (w + (ow - w)) / 2; 1229 var ml = (w + (ow - w)) / 2;
1142 $(this).css("margin-left", "-" + ml + "px");1230 $(this).css("margin-left", "-" + ml + "px");
1143 $(this).css("left", "50%");1231 $(this).css("left", "50%");
1144 $(this).css("position", "absolute");1232 $(this).css("position", "absolute");
1145 });1233 });
1146 };1234 };
1147 })(jQuery);1235 })(jQuery);
1148 1236
1149 var invertObject = function(object) {1237 var invertObject = function(object) {
1150 var invertedObject = {};1238 var invertedObject = {};
1151 for (var value in object) {1239 for (var value in object) {
1152 if(object.hasOwnProperty(value)) {1240 if(object.hasOwnProperty(value)) {
1153 invertedObject[object[value]] = value;1241 invertedObject[object[value]] = value;
1154 }1242 }
1155 }1243 }
1156 return invertedObject;1244 return invertedObject;
1157 }1245 }
1158 1246
1159 // line generator function1247 // line generator function
1160 function Line(x1, x2, y1, y2, classString, propString, container, object1, object2) {1248 function Line(x1, x2, y1, y2, classString, propString, container, object1, object2) {
1161 var lineObject = document.createElement("div");1249 var lineObject = document.createElement("div");
1162 var linePivot = document.createElement("div");1250 var linePivot = document.createElement("div");
1163 var parent = document.querySelector(container);1251 var parent = document.querySelector(container);
1164 xDiff = (x1 - x2);1252 xDiff = (x1 - x2);
1165 yDiff = (y1 - y2);1253 yDiff = (y1 - y2);
1166 xAvg = (x1 + x2) / 2.000;1254 xAvg = (x1 + x2) / 2.000;
1167 yAvg = (y1 + y2) / 2.000;1255 yAvg = (y1 + y2) / 2.000;
1168 lineLength = Math.sqrt(xDiff * xDiff + yDiff * yDiff);1256 lineLength = Math.sqrt(xDiff * xDiff + yDiff * yDiff);
1169 linePivot.className = classString + " " + propString;1257 linePivot.className = classString + " " + propString;
1170 linePivot.style.left = (yAvg) + "%";1258 linePivot.style.left = (yAvg) + "%";
1171 linePivot.style.top = (xAvg) + "%";1259 linePivot.style.top = (xAvg) + "%";
1172 linePivot.style.position = "absolute";1260 linePivot.style.position = "absolute";
1173 linePivot.dataset.connectedPoints = object1 + " " + object2;1261 linePivot.dataset.connectedPoints = object1 + " " + object2;
1174 lineObject.style.height = lineLength / 100 * parent.offsetHeight + "px";1262 lineObject.style.height = lineLength / 100 * parent.offsetHeight + "px";
1175 lineObject.style.transform = "translateY(-" + (lineLength / 200 * parent.offsetHeight) + "px)";1263 lineObject.style.transform = "translateY(-" + (lineLength / 200 * parent.offsetHeight) + "px)";
1176 lineObject.style.webkitTransform = "translateY(-" + (lineLength / 200 * parent.offsetHeight) + "px)";1264 lineObject.style.webkitTransform = "translateY(-" + (lineLength / 200 * parent.offsetHeight) + "px)";
1177 lineObject.style.position = "absolute";1265 lineObject.style.position = "absolute";
1178 lineObject.className = propString;1266 lineObject.className = propString;
1179 linePivot.style.transform = "rotate(" + (-Math.atan2(yDiff, xDiff)) + "rad)";1267 linePivot.style.transform = "rotate(" + (-Math.atan2(yDiff, xDiff)) + "rad)";
1180 linePivot.style.webkitTransform = "rotate(" + (-Math.atan2(yDiff, xDiff)) + "rad)";1268 linePivot.style.webkitTransform = "rotate(" + (-Math.atan2(yDiff, xDiff)) + "rad)";
1181 linePivot.appendChild(lineObject);1269 linePivot.appendChild(lineObject);
1182 document.querySelector(container).appendChild(linePivot);1270 document.querySelector(container).appendChild(linePivot);
1183 }1271 }
1184 1272
1185 function generateTooltips() {1273 function generateTooltips() {
1186 $( ".qtip" ).remove();1274 $( ".qtip" ).remove();
1187 $('.zone[data-z-pos!=""][data-z-pos!=0], .object[data-z-pos!=""][data-z-pos!=0]').qtip({1275 $('.zone[data-z-pos!=""][data-z-pos!=0], .object[data-z-pos!=""][data-z-pos!=0]').qtip({
1188 content: {1276 content: {
1189 text: function(event, api) {1277 text: function(event, api) {
1190 var scaleFactor = 1;1278 var scaleFactor = 1;
1191 var systemNickname = document.querySelector(".map").dataset.systemNickname;1279 var systemNickname = document.querySelector(".map").dataset.systemNickname;
1192 if (typeof systemScaleFactorArray[systemNickname] !== "undefined") {1280 if (typeof systemScaleFactorArray[systemNickname] !== "undefined") {
1193 scaleFactor = parseFloat(systemScaleFactorArray[systemNickname]);1281 scaleFactor = parseFloat(systemScaleFactorArray[systemNickname]);
1194 }1282 }
1195 var planePosition;1283 var planePosition;
1196 var zHeight = parseFloat((Math.round(parseFloat($(this).attr('data-z-pos'))/(scaleFactor*1000)*10) / 10).toFixed(2))1284 var zHeight = parseFloat((Math.round(parseFloat($(this).attr('data-z-pos'))/(scaleFactor*1000)*10) / 10).toFixed(2))
1197 if (zHeight > 0) {1285 if (zHeight > 0) {
1198 return Math.abs(zHeight)+"K up";1286 return Math.abs(zHeight)+"K up";
1199 } else {1287 } else {
1200 return Math.abs(zHeight)+"K down";1288 return Math.abs(zHeight)+"K down";
1201 }1289 }
1202 }1290 }
1203 },1291 },
1204 position: {1292 position: {
1205 viewport: $(".grid"),1293 viewport: $(".grid"),
1206 my: 'bottom center',1294 my: 'bottom center',
1207 at: 'top center',1295 at: 'top center',
1208 adjust: {1296 adjust: {
1209 method: 'shift flip'1297 method: 'shift flip'
1210 },1298 },
1211 position: {1299 position: {
1212 target: 'event'1300 target: 'event'
1213 }1301 }
1214 },1302 },
1215 style: {1303 style: {
1216 classes: 'qtip-dark qtip-shadow qtip-zMap',1304 classes: 'qtip-dark qtip-shadow qtip-zMap',
1217 tip: {1305 tip: {
1218 corner: true1306 corner: true
1219 }1307 }
1220 }1308 }
1221 });1309 });
1222 }1310 }
1223 1311
1224 /* filereader code start */1312 /* filereader code start */
1225 var lastMatch = "";1313 var lastMatch = "";
1226 var currentMatch = "";1314 var currentMatch = "";
1227 var rawFile = "";1315 var rawFile = "";
1228 var inputRegex = /\/map (.*)/g;1316 var inputRegex = /\/map (.*)/g;
1229 var openFile = function(event) {1317 var openFile = function(event) {
1230 var input = event.target;1318 var input = event.target;
1231 var reader = new FileReader();1319 var reader = new FileReader();
1232 reader.onload = function(){1320 reader.onload = function(){
1233 rawFile = reader.result;1321 rawFile = reader.result;
1234 currentMatch = rawFile.slice(rawFile.lastIndexOf("/map")).match(inputRegex)[0].slice(5);1322 currentMatch = rawFile.slice(rawFile.lastIndexOf("/map")).match(inputRegex)[0].slice(5);
1235 if (currentMatch != lastMatch && currentMatch !== null) {1323 if (currentMatch != lastMatch && currentMatch !== null) {
1236 $(".configMenu").addClass("closed");1324 $(".configMenu").addClass("closed");
1237 lastMatch = currentMatch;1325 lastMatch = currentMatch;
1238 if (currentMatch == "universe" | currentMatch == "sirius" | currentMatch == "universemap") {1326 if (currentMatch == "universe" | currentMatch == "sirius" | currentMatch == "universemap") {
1239 generateUniverseMap();1327 generateUniverseMap();
1240 } else {1328 } else {
1241 document.querySelector("#searchField").value = currentMatch;1329 document.querySelector("#searchField").value = currentMatch;
1242 $( "#searchField" ).keyup();1330 $( "#searchField" ).keyup();
1243 }1331 }
1244 }1332 }
1245 };1333 };
1246 reader.readAsText(input.files[0]);1334 reader.readAsText(input.files[0]);
1247 setInterval(function(){reader.readAsText(input.files[0]);},1000);1335 setInterval(function(){reader.readAsText(input.files[0]);},1000);
1248 };1336 };
1249 /* fieldreader code end */1337 /* fieldreader code end */
1250 1338
1339 (function($,sr){
1340
1341 // debouncing function from John Hann
1342 // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
1343 var debounce = function (func, threshold, execAsap) {
1344 var timeout;
1345
1346 return function debounced () {
1347 var obj = this, args = arguments;
1348 function delayed () {
1349 if (!execAsap)
1350 func.apply(obj, args);
1351 timeout = null;
1352 };
1353
1354 if (timeout)
1355 clearTimeout(timeout);
1356 else if (execAsap)
1357 func.apply(obj, args);
1358
1359 timeout = setTimeout(delayed, threshold || 100);
1360 };
1361 }
1362 // smartresize
1363 jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
1364
1365 })(jQuery,'smartresize');
1366
1367
1368 // usage:
1369 $(window).smartresize(function(){
1370 $(".systemConnection").remove();
1371 generateSystemConnections();
1372 });
1373
1251 // jQuery autoComplete v1.0.61374 // jQuery autoComplete v1.0.6
1252 // https://github.com/Pixabay/jQuery-autoComplete1375 // https://github.com/Pixabay/jQuery-autoComplete
1253 !function(e){e.fn.autoComplete=function(t){var o=e.extend({},e.fn.autoComplete.defaults,t);return"string"==typeof t?(this.each(function(){var o=e(this);"destroy"==t&&(e(window).off("resize.autocomplete",o.updateSC),o.off("blur.autocomplete focus.autocomplete keydown.autocomplete keyup.autocomplete"),o.data("autocomplete")?o.attr("autocomplete",o.data("autocomplete")):o.removeAttr("autocomplete"),e(o.data("sc")).remove(),o.removeData("sc").removeData("autocomplete"))}),this):this.each(function(){function t(e){var t=s.val();if(s.cache[t]=e,e.length&&t.length>=o.minChars){for(var a="",c=0;c<e.length;c++)a+=o.renderItem(e[c],t);s.sc.html(a),s.updateSC(0)}else s.sc.hide()}var s=e(this);s.sc=e('<div class="autocomplete-suggestions '+o.menuClass+'"></div>'),s.data("sc",s.sc).data("autocomplete",s.attr("autocomplete")),s.attr("autocomplete","off"),s.cache={},s.last_val="",s.updateSC=function(t,o){if(s.sc.css({top:s.offset().top+s.outerHeight(),left:s.offset().left,width:s.outerWidth()}),!t&&(s.sc.show(),s.sc.maxHeight||(s.sc.maxHeight=parseInt(s.sc.css("max-height"))),s.sc.suggestionHeight||(s.sc.suggestionHeight=e(".autocomplete-suggestion",s.sc).first().outerHeight()),s.sc.suggestionHeight))if(o){var a=s.sc.scrollTop(),c=o.offset().top-s.sc.offset().top;c+s.sc.suggestionHeight-s.sc.maxHeight>0?s.sc.scrollTop(c+s.sc.suggestionHeight+a-s.sc.maxHeight):0>c&&s.sc.scrollTop(c+a)}else s.sc.scrollTop(0)},e(window).on("resize.autocomplete",s.updateSC),s.sc.appendTo("body"),s.sc.on("mouseleave",".autocomplete-suggestion",function(){e(".autocomplete-suggestion.selected").removeClass("selected")}),s.sc.on("mouseenter",".autocomplete-suggestion",function(){e(".autocomplete-suggestion.selected").removeClass("selected"),e(this).addClass("selected")}),s.sc.on("mouseup",".autocomplete-suggestion",function(t){var a=e(this),c=a.data("val");(c||a.hasClass("autocomplete-suggestion"))&&(s.val(c),o.onSelect(t,c,a),s.sc.hide())}),s.on("blur.autocomplete",function(){try{over_sb=e(".autocomplete-suggestions:hover").length}catch(t){over_sb=0}over_sb?s.is(":focus")||s.focus():(s.last_val=s.val(),s.sc.hide())}),o.minChars||s.on("focus.autocomplete",function(){s.last_val="\n",s.trigger("keyup.autocomplete")}),s.on("keydown.autocomplete",function(t){if((40==t.which||38==t.which)&&s.sc.html()){var a,c=e(".autocomplete-suggestion.selected",s.sc);return c.length?(a=40==t.which?c.next(".autocomplete-suggestion"):c.prev(".autocomplete-suggestion"),a.length?(c.removeClass("selected"),s.val(a.addClass("selected").data("val"))):(c.removeClass("selected"),s.val(s.last_val),a=0)):(a=40==t.which?e(".autocomplete-suggestion",s.sc).first():e(".autocomplete-suggestion",s.sc).last(),s.val(a.addClass("selected").data("val"))),s.updateSC(0,a),!1}if(27==t.which)s.val(s.last_val).sc.hide();else if(13==t.which){var c=e(".autocomplete-suggestion.selected",s.sc);c.length&&(o.onSelect(t,c.data("val"),c),setTimeout(function(){s.sc.hide()},10))}}),s.on("keyup.autocomplete",function(a){if(!~e.inArray(a.which,[13,27,35,36,37,38,39,40])){var c=s.val();if(c.length>=o.minChars){if(c!=s.last_val){if(s.last_val=c,clearTimeout(s.timer),o.cache){if(c in s.cache)return void t(s.cache[c]);for(var l=1;l<c.length-o.minChars;l++){var i=c.slice(0,c.length-l);if(i in s.cache&&!s.cache[i].length)return void t([])}}s.timer=setTimeout(function(){o.source(c,t)},o.delay)}}else s.last_val=c,s.sc.hide()}})})},e.fn.autoComplete.defaults={source:0,minChars:3,delay:150,cache:1,menuClass:"",renderItem:function(e,t){var o=new RegExp("("+t.split(" ").join("|")+")","gi");return'<div class="autocomplete-suggestion" data-val="'+e+'">'+e.replace(o,"<b>$1</b>")+"</div>"},onSelect:function(e,t,o){}}}(jQuery);1376 !function(e){e.fn.autoComplete=function(t){var o=e.extend({},e.fn.autoComplete.defaults,t);return"string"==typeof t?(this.each(function(){var o=e(this);"destroy"==t&&(e(window).off("resize.autocomplete",o.updateSC),o.off("blur.autocomplete focus.autocomplete keydown.autocomplete keyup.autocomplete"),o.data("autocomplete")?o.attr("autocomplete",o.data("autocomplete")):o.removeAttr("autocomplete"),e(o.data("sc")).remove(),o.removeData("sc").removeData("autocomplete"))}),this):this.each(function(){function t(e){var t=s.val();if(s.cache[t]=e,e.length&&t.length>=o.minChars){for(var a="",c=0;c<e.length;c++)a+=o.renderItem(e[c],t);s.sc.html(a),s.updateSC(0)}else s.sc.hide()}var s=e(this);s.sc=e('<div class="autocomplete-suggestions '+o.menuClass+'"></div>'),s.data("sc",s.sc).data("autocomplete",s.attr("autocomplete")),s.attr("autocomplete","off"),s.cache={},s.last_val="",s.updateSC=function(t,o){if(s.sc.css({top:s.offset().top+s.outerHeight(),left:s.offset().left,width:s.outerWidth()}),!t&&(s.sc.show(),s.sc.maxHeight||(s.sc.maxHeight=parseInt(s.sc.css("max-height"))),s.sc.suggestionHeight||(s.sc.suggestionHeight=e(".autocomplete-suggestion",s.sc).first().outerHeight()),s.sc.suggestionHeight))if(o){var a=s.sc.scrollTop(),c=o.offset().top-s.sc.offset().top;c+s.sc.suggestionHeight-s.sc.maxHeight>0?s.sc.scrollTop(c+s.sc.suggestionHeight+a-s.sc.maxHeight):0>c&&s.sc.scrollTop(c+a)}else s.sc.scrollTop(0)},e(window).on("resize.autocomplete",s.updateSC),s.sc.appendTo("body"),s.sc.on("mouseleave",".autocomplete-suggestion",function(){e(".autocomplete-suggestion.selected").removeClass("selected")}),s.sc.on("mouseenter",".autocomplete-suggestion",function(){e(".autocomplete-suggestion.selected").removeClass("selected"),e(this).addClass("selected")}),s.sc.on("mouseup",".autocomplete-suggestion",function(t){var a=e(this),c=a.data("val");(c||a.hasClass("autocomplete-suggestion"))&&(s.val(c),o.onSelect(t,c,a),s.sc.hide())}),s.on("blur.autocomplete",function(){try{over_sb=e(".autocomplete-suggestions:hover").length}catch(t){over_sb=0}over_sb?s.is(":focus")||s.focus():(s.last_val=s.val(),s.sc.hide())}),o.minChars||s.on("focus.autocomplete",function(){s.last_val="\n",s.trigger("keyup.autocomplete")}),s.on("keydown.autocomplete",function(t){if((40==t.which||38==t.which)&&s.sc.html()){var a,c=e(".autocomplete-suggestion.selected",s.sc);return c.length?(a=40==t.which?c.next(".autocomplete-suggestion"):c.prev(".autocomplete-suggestion"),a.length?(c.removeClass("selected"),s.val(a.addClass("selected").data("val"))):(c.removeClass("selected"),s.val(s.last_val),a=0)):(a=40==t.which?e(".autocomplete-suggestion",s.sc).first():e(".autocomplete-suggestion",s.sc).last(),s.val(a.addClass("selected").data("val"))),s.updateSC(0,a),!1}if(27==t.which)s.val(s.last_val).sc.hide();else if(13==t.which){var c=e(".autocomplete-suggestion.selected",s.sc);c.length&&(o.onSelect(t,c.data("val"),c),setTimeout(function(){s.sc.hide()},10))}}),s.on("keyup.autocomplete",function(a){if(!~e.inArray(a.which,[13,27,35,36,37,38,39,40])){var c=s.val();if(c.length>=o.minChars){if(c!=s.last_val){if(s.last_val=c,clearTimeout(s.timer),o.cache){if(c in s.cache)return void t(s.cache[c]);for(var l=1;l<c.length-o.minChars;l++){var i=c.slice(0,c.length-l);if(i in s.cache&&!s.cache[i].length)return void t([])}}s.timer=setTimeout(function(){o.source(c,t)},o.delay)}}else s.last_val=c,s.sc.hide()}})})},e.fn.autoComplete.defaults={source:0,minChars:3,delay:150,cache:1,menuClass:"",renderItem:function(e,t){var o=new RegExp("("+t.split(" ").join("|")+")","gi");return'<div class="autocomplete-suggestion" data-val="'+e+'">'+e.replace(o,"<b>$1</b>")+"</div>"},onSelect:function(e,t,o){}}}(jQuery);
1254 /* qTip2 v2.2.1 | Plugins: tips viewport modal | Styles: core basic css3 | qtip2.com | Licensed MIT | Sun Aug 09 2015 06:46:07 */1377 /* qTip2 v2.2.1 | Plugins: tips viewport modal | Styles: core basic css3 | qtip2.com | Licensed MIT | Sun Aug 09 2015 06:46:07 */
1255 !function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=E,this.elements={target:a},this._id=R+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:D,attr:e,onTooltip:D,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=D}function f(a){return a===E||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?D:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?D:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==D,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,E,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(d.isPlainObject(b.title)&&(b.button=b.title.button,b.title=b.title.text),g(b.title||D)&&(b.title=D))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===C?{ready:C}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(Q,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)for(d in this.checks[c])(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return U.concat("").join(a?"-"+a+" ":" ")}function l(a,b){return b>0?setTimeout(d.proxy(a,this),b):void a.call(this)}function m(a){this.tooltip.hasClass(_)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=l.call(this,function(){this.toggle(C,a)},this.options.show.delay))}function n(a){if(!this.tooltip.hasClass(_)&&!this.destroyed){var b=d(a.relatedTarget),c=b.closest(V)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=l.call(this,function(){this.toggle(D,a)},this.options.hide.delay,this)}}function o(a){!this.tooltip.hasClass(_)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=l.call(this,function(){this.hide(a)},this.options.hide.inactive))}function p(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function q(a,c,e){d(b.body).delegate(a,(c.split?c:c.join("."+R+" "))+"."+R,function(){var a=x.api[d.attr(this,T)];a&&!a.disabled&&e.apply(a,arguments)})}function r(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):E,p="html5"===f.metadata.type&&o?o[f.metadata.name]:E,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(C,{},x.defaults,f,"object"==typeof q?h(q):E,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===D||!j)return D;k.content.text=j}if(i.container.length||(i.container=m),i.target===D&&(i.target=n),k.show.target===D&&(k.show.target=n),k.show.solo===C&&(k.show.solo=i.container.closest("body")),k.hide.target===D&&(k.hide.target=n),k.position.viewport===C&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new z(i.at,C),i.my=new z(i.my),a.data(R))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===D)return D;return a.attr(S,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(bb,l).attr("title",""),g=new e(a,k,c,!!j),a.data(R,g),g}function s(a){return a.charAt(0).toUpperCase()+a.slice(1)}function t(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+qb.join(f+" ")+f).split(" "),h=0;if(pb[b])return a.css(pb[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return pb[b]=d,e}function u(a,b){return Math.ceil(parseFloat(t(a,b)))}function v(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.init(this.qtip=a)}function w(a,b){this.options=b,this._ns="-modal",this.init(this.qtip=a)}var x,y,z,A,B,C=!0,D=!1,E=null,F="x",G="y",H="width",I="height",J="top",K="left",L="bottom",M="right",N="center",O="flipinvert",P="shift",Q={},R="qtip",S="data-hasqtip",T="data-qtip-id",U=["ui-widget","ui-tooltip"],V="."+R,W="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),X=R+"-fixed",Y=R+"-default",Z=R+"-focus",$=R+"-hover",_=R+"-disabled",ab="_replacedByqTip",bb="oldtitle",cb={ie:function(){for(var a=4,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];a+=1);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||D};y=e.prototype,y._when=function(a){return d.when.apply(d,a)},y.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),f.posClass=this._createPosClass((this.position={my:k.my,at:k.at}).my),this.tooltip=g.tooltip=b=d("<div/>",{id:this._id,"class":[R,Y,e.style.classes,f.posClass].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":D,"aria-describedby":this._id+"-content","aria-hidden":C}).toggleClass(_,this.disabled).attr(T,this.id).data(R,this).appendTo(k.container).append(g.content=d("<div />",{"class":R+"-content",id:this._id+"-content","aria-atomic":C})),this.rendered=-1,this.positioning=C,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,D))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,D)),this.rendered=C,this._setWidget(),d.each(Q,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=D,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(C,f.event,D),c.hiddenDuringWait=D}),x.api[this.id]=this,this},y.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=C;var a,b=this.target,c=b.attr(bb);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()});for(a in this.timers)clearTimeout(this.timers[a]);b.removeData(R).removeAttr(T).removeAttr(S).removeAttr("aria-describedby"),this.options.suppress&&c&&b.attr("title",c).removeAttr(bb),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=E,delete x.api[this.id]}}return this.destroyed?this.target:(a===C&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},A=y.checks={builtin:{"^id$":function(a,b,c,e){var f=c===C?x.nextid:c,g=R+"-"+f;f!==D&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(this.position[b]=a[b]=new z(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(C)||this.toggle(C))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(Y,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},y.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var db=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,eb=/^prerender|show\.ready/i;y.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=D,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&eb.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=db.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=C,d.each(a,d.proxy(j,this)),this.positioning=D,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?E:this.cache.event),this},y._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=C,a.then(function(a){return e.waiting=D,c._update(a,b)},E,function(a){return c._update(a,b)})):a===D||!a&&""!==a?D:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):D},y._waitForContent=function(a){var b=this.cache;return b.waiting=C,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=D}).promise()},y._updateContent=function(a,b){this._update(a,this.elements.content,b)},y._updateTitle=function(a,b){this._update(a,this.elements.title,b)===D&&this._removeTitle(D)},y._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":R+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":R+"-title","aria-atomic":C})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},y._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=E,a!==D&&this.reposition())},y._createPosClass=function(a){return R+"-pos-"+(a||this.options.position.my).abbrev()},y.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=C;var f,g,h,i,j=this.cache,k=this.tooltip,l=this.options.position,m=l.target,n=l.my,o=l.at,p=l.viewport,q=l.container,r=l.adjust,s=r.method.split(" "),t=k.outerWidth(D),u=k.outerHeight(D),v=0,w=0,x=k.css("position"),y={left:0,top:0},z=k[0].offsetWidth>0,A=c&&"scroll"===c.type,B=d(a),E=q[0].ownerDocument,F=this.mouse;if(d.isArray(m)&&2===m.length)o={x:K,y:J},y={left:m[0],top:m[1]};else if("mouse"===m)o={x:K,y:J},(!r.mouse||this.options.hide.distance)&&j.origin&&j.origin.pageX?c=j.origin:!c||c&&("resize"===c.type||"scroll"===c.type)?c=j.event:F&&F.pageX&&(c=F),"static"!==x&&(y=q.offset()),E.body.offsetWidth!==(a.innerWidth||E.documentElement.clientWidth)&&(g=d(b.body).offset()),y={left:c.pageX-y.left+(g&&g.left||0),top:c.pageY-y.top+(g&&g.top||0)},r.mouse&&A&&F&&(y.left-=(F.scrollX||0)-B.scrollLeft(),y.top-=(F.scrollY||0)-B.scrollTop());else{if("event"===m?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?j.target=d(c.target):c.target||(j.target=this.elements.target):"event"!==m&&(j.target=d(m.jquery?m:this.elements.target)),m=j.target,m=d(m).eq(0),0===m.length)return this;m[0]===b||m[0]===a?(v=cb.iOS?a.innerWidth:m.width(),w=cb.iOS?a.innerHeight:m.height(),m[0]===a&&(y={top:(p||m).scrollTop(),left:(p||m).scrollLeft()})):Q.imagemap&&m.is("area")?f=Q.imagemap(this,m,o,Q.viewport?s:D):Q.svg&&m&&m[0].ownerSVGElement?f=Q.svg(this,m,o,Q.viewport?s:D):(v=m.outerWidth(D),w=m.outerHeight(D),y=m.offset()),f&&(v=f.width,w=f.height,g=f.offset,y=f.position),y=this.reposition.offset(m,y,q),(cb.iOS>3.1&&cb.iOS<4.1||cb.iOS>=4.3&&cb.iOS<4.33||!cb.iOS&&"fixed"===x)&&(y.left-=B.scrollLeft(),y.top-=B.scrollTop()),(!f||f&&f.adjustable!==D)&&(y.left+=o.x===M?v:o.x===N?v/2:0,y.top+=o.y===L?w:o.y===N?w/2:0)}return y.left+=r.x+(n.x===M?-t:n.x===N?-t/2:0),y.top+=r.y+(n.y===L?-u:n.y===N?-u/2:0),Q.viewport?(h=y.adjusted=Q.viewport(this,y,l,v,w,t,u),g&&h.left&&(y.left+=g.left),g&&h.top&&(y.top+=g.top),h.my&&(this.position.my=h.my)):y.adjusted={left:0,top:0},j.posClass!==(i=this._createPosClass(this.position.my))&&k.removeClass(j.posClass).addClass(j.posClass=i),this._trigger("move",[y,p.elem||p],c)?(delete y.adjusted,e===D||!z||isNaN(y.left)||isNaN(y.top)||"mouse"===m||!d.isFunction(l.effect)?k.css(y):d.isFunction(l.effect)&&(l.effect.call(k,this,d.extend({},y)),k.queue(function(a){d(this).css({opacity:"",height:""}),cb.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=D,this):this},y.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!cb.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var fb=(z=y.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,N).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?G:F}).prototype;fb.invert=function(a,b){this[a]=this[a]===K?M:this[a]===M?K:b||this[a]},fb.string=function(a){var b=this.x,c=this.y,d=b!==c?"center"===b||"center"!==c&&(this.precedance===G||this.forceY)?[c,b]:[b,c]:[b];return a!==!1?d.join(" "):d},fb.abbrev=function(){var a=this.string(!1);return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},fb.clone=function(){return new z(this.string(),this.forceY)},y.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&e.event&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=d.event.fix(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=C),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",l=this.options[k],m=(this.options[a?"hide":"show"],this.options.position),n=this.options.content,o=this.tooltip.css("width"),p=this.tooltip.is(":visible"),q=a||1===l.target.length,r=!c||l.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!p),h=!g.is(":animated")&&p===a&&r,i=h?E:!!this._trigger(k,[90]),this.destroyed?this:(i!==D&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(this.mouse&&(e.origin=d.event.fix(this.mouse)),d.isFunction(n.text)&&this._updateContent(n.text,D),d.isFunction(n.title)&&this._updateTitle(n.title,D),!B&&"mouse"===m.target&&m.adjust.mouse&&(d(b).bind("mousemove."+R,this._storeMouse),B=C),o||g.css("width",g.outerWidth(D)),this.reposition(c,arguments[2]),o||g.css("width",""),l.solo&&("string"==typeof l.solo?d(l.solo):d(V,l.solo)).not(g).not(l.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,B&&!d(V+'[tracking="true"]:visible',l.solo).not(g).length&&(d(b).unbind("mousemove."+R),B=D),this.blur(c)),j=d.proxy(function(){a?(cb.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof l.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),l.effect===D||q===D?(g[k](),j()):d.isFunction(l.effect)?(g.stop(1,1),l.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&l.target.trigger("qtip-"+this.id+"-inactive"),this))},y.show=function(a){return this.toggle(C,a)},y.hide=function(a){return this.toggle(D,a)},y.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(V),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=x.zindex+b.length;return c.hasClass(Z)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+Z).qtip("blur",a)),c.addClass(Z)[0].style.zIndex=f),this},y.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(Z),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},y.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(_):this.disabled):"boolean"!=typeof a&&(a=C),this.rendered&&this.tooltip.toggleClass(_,a).attr("aria-disabled",a),this.disabled=!!a,this)},y.enable=function(){return this.disable(D)},y._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":R+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(_)||a.hide(b),D})},y._updateButton=function(a){if(!this.rendered)return D;var b=this.elements.button;a?this._createButton():b.remove()},y._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(_);c.removeClass(_),_=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(_,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(Y,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(R+"-icon",!a)},y._storeMouse=function(a){return(this.mouse=d.event.fix(a)).type="mousemove",this},y._bind=function(a,b,c,e,f){if(a&&c&&b.length){var g="."+this._id+(e?"-"+e:"");return d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this)),this}},y._unbind=function(a,b){return a&&d(a).unbind("."+this._id+(b?"-"+b:"")),this},y._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||E,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=D,!e.isDefaultPrevented()},y._bindEvents=function(a,b,c,e,f,g){var h=c.filter(e).add(e.filter(c)),i=[];h.length&&(d.each(b,function(b,c){var e=d.inArray(c,a);e>-1&&i.push(a.splice(e,1)[0])}),i.length&&(this._bind(h,i,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)}),c=c.not(h),e=e.not(h))),this._bind(c,a,f),this._bind(e,b,g)},y._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?D:(this.cache.event=a&&d.event.fix(a),this.cache.target=a&&d(a.target),clearTimeout(this.timers.show),void(this.timers.show=l.call(this,function(){this.render("object"==typeof a||c.show.ready)},c.prerender?0:c.show.delay)))}var c=this.options,e=c.show.target,f=c.hide.target,g=c.show.event?d.trim(""+c.show.event).split(" "):[],h=c.hide.event?d.trim(""+c.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(c.show.event)&&!/mouse(out|leave)/i.test(c.hide.event)&&h.push("mouseleave"),this._bind(e,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=C}),this._bindEvents(g,h,e,f,b,function(){return this.timers?void clearTimeout(this.timers.show):D}),(c.show.ready||c.prerender)&&b.call(this,a)},y._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),q=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(X)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(_)&&this.tooltip[0].offsetWidth>0,e=b.parents(V).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",o,"inactive"),this._bind(i.add(g),x.inactiveEvents,o)),this._bindEvents(r,s,h,i,m,n),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){return this.cache?void(this.cache.onTarget="mouseenter"===a.type):D}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(_)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:q,"resize",p),f.adjust.scroll&&this._bind(q.add(f.container),"scroll",p)},y._unassignEvents=function(){var c=this.options,e=c.show.target,f=c.hide.target,g=d.grep([this.elements.target[0],this.rendered&&this.tooltip[0],c.position.container[0],c.position.viewport[0],c.position.container.closest("html")[0],a,b],function(a){return"object"==typeof a});e&&e.toArray&&(g=g.concat(e.toArray())),f&&f.toArray&&(g=g.concat(f.toArray())),this._unbind(g)._unbind(g,"destroy")._unbind(g,"inactive")},d(function(){q(V,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(X)&&!c.hasClass(_)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.position.adjust.mouse&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass($,b)}),q("["+T+"]",W,o)}),x=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=E,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],R):E;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,R);if(!a)return C;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),D;a.set(b,e)}}),g!==E?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(C,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===D||c.length<1||x.api[c]?x.nextid++:c,b=r(d(this),c,k),b===D?C:(x.api[c]=b,d.each(Q,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,x.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,bb):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(bb,b))}return d.fn["attr"+ab].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+ab].apply(this,arguments));return a||b.filter("["+bb+"]").attr("title",function(){return d.attr(this,bb)}).removeAttr(bb),b}},function(a,b){if(!b||d.fn[a+ab])return C;var c=d.fn[a+ab]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+ab]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(S))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+ab].apply(this,arguments)}),x.version="2.2.1",x.nextid=0,x.inactiveEvents=W,x.zindex=15e3,x.defaults={prerender:D,id:D,overwrite:C,suppress:C,content:{text:C,attr:"title",title:D,button:D},position:{my:"top left",at:"bottom right",target:D,container:D,viewport:D,adjust:{x:0,y:0,mouse:C,scroll:C,resize:C,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:D})}},show:{target:D,event:"mouseenter",effect:C,delay:90,solo:D,ready:D,autofocus:D},hide:{target:D,event:"mouseleave",effect:C,delay:0,fixed:D,inactive:D,leave:"window",distance:D},style:{classes:"",widget:D,width:D,height:D,def:C},events:{render:E,move:E,show:E,hide:E,toggle:E,visible:E,hidden:E,focus:E,blur:E}};var gb,hb="margin",ib="border",jb="color",kb="background-color",lb="transparent",mb=" !important",nb=!!b.createElement("canvas").getContext,ob=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,pb={},qb=["Webkit","O","Moz","ms"];if(nb)var rb=a.devicePixelRatio||1,sb=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),tb=rb/sb;else var ub=function(a,b,c){return"<qtipvml:"+a+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(b||"")+' style="behavior: url(#default#VML); '+(c||"")+'" />'};d.extend(v.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("<div />",{"class":R+"-tip"}).prependTo(a.tooltip),nb?(b=d("<canvas />").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=ub("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===J||a.y===N&&this.element.position().top+this.size[1]/2+this.options.offset<b.outerHeight(C))},_parseCorner:function(a){var b=this.qtip.options.position.my;return a===D||b===D?a=D:a===C?a=new z(b.string()):a.string||(a=new z(a),a.fixed=C),a},_parseWidth:function(a,b,c){var d=this.qtip.elements,e=ib+s(b)+"Width";return(c?u(c,e):u(d.content,e)||u(this._useTitle(a)&&d.titlebar||d.content,e)||u(d.tooltip,e))||0},_parseRadius:function(a){var b=this.qtip.elements,c=ib+s(a.y)+s(a.x)+"Radius";return cb.ie<9?0:u(this._useTitle(a)&&b.titlebar||b.content,c)||u(b.tooltip,c)||0},_invalidColour:function(a,b,c){var d=a.css(b);return!d||c&&d===a.css(c)||ob.test(d)?D:d},_parseColours:function(a){var b=this.qtip.elements,c=this.element.css("cssText",""),e=ib+s(a[a.precedance])+s(jb),f=this._useTitle(a)&&b.titlebar||b.content,g=this._invalidColour,h=[];return h[0]=g(c,kb)||g(f,kb)||g(b.content,kb)||g(b.tooltip,kb)||c.css(kb),h[1]=g(c,e,jb)||g(f,e,jb)||g(b.content,e,jb)||g(b.tooltip,e,jb)||b.tooltip.css(e),d("*",c).add(c).css("cssText",kb+":"+lb+mb+";"+ib+":0"+mb+";"),h},_calculateSize:function(a){var b,c,d,e=a.precedance===G,f=this.options.width,g=this.options.height,h="c"===a.abbrev(),i=(e?f:g)*(h?.5:1),j=Math.pow,k=Math.round,l=Math.sqrt(j(i,2)+j(g,2)),m=[this.border/i*l,this.border/g*l];return m[2]=Math.sqrt(j(m[0],2)-j(this.border,2)),m[3]=Math.sqrt(j(m[1],2)-j(this.border,2)),b=l+m[2]+m[3]+(h?0:m[0]),c=b/l,d=[k(c*f),k(c*g)],e?d:d.reverse()},_calculateTip:function(a,b,c){c=c||1,b=b||this.size;var d=b[0]*c,e=b[1]*c,f=Math.ceil(d/2),g=Math.ceil(e/2),h={br:[0,0,d,e,d,0],bl:[0,0,d,0,0,e],tr:[0,e,d,0,d,e],tl:[0,0,0,e,d,e],tc:[0,e,f,0,d,e],bc:[0,0,d,0,f,e],rc:[0,0,d,g,0,e],lc:[d,0,d,e,0,g]};return h.lt=h.br,h.rt=h.bl,h.lb=h.tr,h.rb=h.tl,h[a.abbrev()]},_drawCoords:function(a,b){a.beginPath(),a.moveTo(b[0],b[1]),a.lineTo(b[2],b[3]),a.lineTo(b[4],b[5]),a.closePath()},create:function(){var a=this.corner=(nb||cb.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=a.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(b,c){if(!this.enabled)return this;var e,f,g,h,i,j,k,l,m=this.qtip.elements,n=this.element,o=n.children(),p=this.options,q=this.size,r=p.mimic,s=Math.round;b||(b=this.qtip.cache.corner||this.corner),r===D?r=b:(r=new z(r),r.precedance=b.precedance,"inherit"===r.x?r.x=b.x:"inherit"===r.y?r.y=b.y:r.x===r.y&&(r[b.precedance]=b[b.precedance])),f=r.precedance,b.precedance===F?this._swapDimensions():this._resetDimensions(),e=this.color=this._parseColours(b),e[1]!==lb?(l=this.border=this._parseWidth(b,b[b.precedance]),p.border&&1>l&&!ob.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==C?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===G?[s(r.x===K?l:r.x===M?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===J?k[1]-q[1]:0)]:[s(r.x===K?k[0]-q[0]:0),s(r.y===J?l:r.y===L?k[1]-q[1]-l:(k[1]-q[1])/2)],nb?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,tb),i=this._calculateTip(r,this.size,tb),o.attr(H,k[0]*tb).attr(I,k[1]*tb),o.css(H,k[0]).css(I,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*tb,j[1]*tb),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===cb.ie?2:1:0,o.css({coordsize:k[0]+l+" "+(k[1]+l),antialias:""+(r.string().indexOf(N)>-1),left:j[0]-j[2]*Number(f===F),top:j[1]-j[2]*Number(f===G),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+(k[1]+l),path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(ub("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==D&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return D;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j=(g.tooltip.hasClass("ui-widget"),{});return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===F&&e.reverse(),d.each(e,function(d,e){var h,k,l;1378 !function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=E,this.elements={target:a},this._id=R+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:D,attr:e,onTooltip:D,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=D}function f(a){return a===E||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?D:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?D:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==D,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,E,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(d.isPlainObject(b.title)&&(b.button=b.title.button,b.title=b.title.text),g(b.title||D)&&(b.title=D))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===C?{ready:C}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(Q,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)for(d in this.checks[c])(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return U.concat("").join(a?"-"+a+" ":" ")}function l(a,b){return b>0?setTimeout(d.proxy(a,this),b):void a.call(this)}function m(a){this.tooltip.hasClass(_)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=l.call(this,function(){this.toggle(C,a)},this.options.show.delay))}function n(a){if(!this.tooltip.hasClass(_)&&!this.destroyed){var b=d(a.relatedTarget),c=b.closest(V)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=l.call(this,function(){this.toggle(D,a)},this.options.hide.delay,this)}}function o(a){!this.tooltip.hasClass(_)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=l.call(this,function(){this.hide(a)},this.options.hide.inactive))}function p(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function q(a,c,e){d(b.body).delegate(a,(c.split?c:c.join("."+R+" "))+"."+R,function(){var a=x.api[d.attr(this,T)];a&&!a.disabled&&e.apply(a,arguments)})}function r(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):E,p="html5"===f.metadata.type&&o?o[f.metadata.name]:E,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(C,{},x.defaults,f,"object"==typeof q?h(q):E,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===D||!j)return D;k.content.text=j}if(i.container.length||(i.container=m),i.target===D&&(i.target=n),k.show.target===D&&(k.show.target=n),k.show.solo===C&&(k.show.solo=i.container.closest("body")),k.hide.target===D&&(k.hide.target=n),k.position.viewport===C&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new z(i.at,C),i.my=new z(i.my),a.data(R))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===D)return D;return a.attr(S,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(bb,l).attr("title",""),g=new e(a,k,c,!!j),a.data(R,g),g}function s(a){return a.charAt(0).toUpperCase()+a.slice(1)}function t(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+qb.join(f+" ")+f).split(" "),h=0;if(pb[b])return a.css(pb[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return pb[b]=d,e}function u(a,b){return Math.ceil(parseFloat(t(a,b)))}function v(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.init(this.qtip=a)}function w(a,b){this.options=b,this._ns="-modal",this.init(this.qtip=a)}var x,y,z,A,B,C=!0,D=!1,E=null,F="x",G="y",H="width",I="height",J="top",K="left",L="bottom",M="right",N="center",O="flipinvert",P="shift",Q={},R="qtip",S="data-hasqtip",T="data-qtip-id",U=["ui-widget","ui-tooltip"],V="."+R,W="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),X=R+"-fixed",Y=R+"-default",Z=R+"-focus",$=R+"-hover",_=R+"-disabled",ab="_replacedByqTip",bb="oldtitle",cb={ie:function(){for(var a=4,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];a+=1);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||D};y=e.prototype,y._when=function(a){return d.when.apply(d,a)},y.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),f.posClass=this._createPosClass((this.position={my:k.my,at:k.at}).my),this.tooltip=g.tooltip=b=d("<div/>",{id:this._id,"class":[R,Y,e.style.classes,f.posClass].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":D,"aria-describedby":this._id+"-content","aria-hidden":C}).toggleClass(_,this.disabled).attr(T,this.id).data(R,this).appendTo(k.container).append(g.content=d("<div />",{"class":R+"-content",id:this._id+"-content","aria-atomic":C})),this.rendered=-1,this.positioning=C,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,D))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,D)),this.rendered=C,this._setWidget(),d.each(Q,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=D,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(C,f.event,D),c.hiddenDuringWait=D}),x.api[this.id]=this,this},y.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=C;var a,b=this.target,c=b.attr(bb);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()});for(a in this.timers)clearTimeout(this.timers[a]);b.removeData(R).removeAttr(T).removeAttr(S).removeAttr("aria-describedby"),this.options.suppress&&c&&b.attr("title",c).removeAttr(bb),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=E,delete x.api[this.id]}}return this.destroyed?this.target:(a===C&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},A=y.checks={builtin:{"^id$":function(a,b,c,e){var f=c===C?x.nextid:c,g=R+"-"+f;f!==D&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(this.position[b]=a[b]=new z(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(C)||this.toggle(C))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(Y,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},y.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var db=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,eb=/^prerender|show\.ready/i;y.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=D,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&eb.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=db.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=C,d.each(a,d.proxy(j,this)),this.positioning=D,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?E:this.cache.event),this},y._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=C,a.then(function(a){return e.waiting=D,c._update(a,b)},E,function(a){return c._update(a,b)})):a===D||!a&&""!==a?D:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):D},y._waitForContent=function(a){var b=this.cache;return b.waiting=C,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=D}).promise()},y._updateContent=function(a,b){this._update(a,this.elements.content,b)},y._updateTitle=function(a,b){this._update(a,this.elements.title,b)===D&&this._removeTitle(D)},y._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":R+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":R+"-title","aria-atomic":C})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},y._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=E,a!==D&&this.reposition())},y._createPosClass=function(a){return R+"-pos-"+(a||this.options.position.my).abbrev()},y.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=C;var f,g,h,i,j=this.cache,k=this.tooltip,l=this.options.position,m=l.target,n=l.my,o=l.at,p=l.viewport,q=l.container,r=l.adjust,s=r.method.split(" "),t=k.outerWidth(D),u=k.outerHeight(D),v=0,w=0,x=k.css("position"),y={left:0,top:0},z=k[0].offsetWidth>0,A=c&&"scroll"===c.type,B=d(a),E=q[0].ownerDocument,F=this.mouse;if(d.isArray(m)&&2===m.length)o={x:K,y:J},y={left:m[0],top:m[1]};else if("mouse"===m)o={x:K,y:J},(!r.mouse||this.options.hide.distance)&&j.origin&&j.origin.pageX?c=j.origin:!c||c&&("resize"===c.type||"scroll"===c.type)?c=j.event:F&&F.pageX&&(c=F),"static"!==x&&(y=q.offset()),E.body.offsetWidth!==(a.innerWidth||E.documentElement.clientWidth)&&(g=d(b.body).offset()),y={left:c.pageX-y.left+(g&&g.left||0),top:c.pageY-y.top+(g&&g.top||0)},r.mouse&&A&&F&&(y.left-=(F.scrollX||0)-B.scrollLeft(),y.top-=(F.scrollY||0)-B.scrollTop());else{if("event"===m?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?j.target=d(c.target):c.target||(j.target=this.elements.target):"event"!==m&&(j.target=d(m.jquery?m:this.elements.target)),m=j.target,m=d(m).eq(0),0===m.length)return this;m[0]===b||m[0]===a?(v=cb.iOS?a.innerWidth:m.width(),w=cb.iOS?a.innerHeight:m.height(),m[0]===a&&(y={top:(p||m).scrollTop(),left:(p||m).scrollLeft()})):Q.imagemap&&m.is("area")?f=Q.imagemap(this,m,o,Q.viewport?s:D):Q.svg&&m&&m[0].ownerSVGElement?f=Q.svg(this,m,o,Q.viewport?s:D):(v=m.outerWidth(D),w=m.outerHeight(D),y=m.offset()),f&&(v=f.width,w=f.height,g=f.offset,y=f.position),y=this.reposition.offset(m,y,q),(cb.iOS>3.1&&cb.iOS<4.1||cb.iOS>=4.3&&cb.iOS<4.33||!cb.iOS&&"fixed"===x)&&(y.left-=B.scrollLeft(),y.top-=B.scrollTop()),(!f||f&&f.adjustable!==D)&&(y.left+=o.x===M?v:o.x===N?v/2:0,y.top+=o.y===L?w:o.y===N?w/2:0)}return y.left+=r.x+(n.x===M?-t:n.x===N?-t/2:0),y.top+=r.y+(n.y===L?-u:n.y===N?-u/2:0),Q.viewport?(h=y.adjusted=Q.viewport(this,y,l,v,w,t,u),g&&h.left&&(y.left+=g.left),g&&h.top&&(y.top+=g.top),h.my&&(this.position.my=h.my)):y.adjusted={left:0,top:0},j.posClass!==(i=this._createPosClass(this.position.my))&&k.removeClass(j.posClass).addClass(j.posClass=i),this._trigger("move",[y,p.elem||p],c)?(delete y.adjusted,e===D||!z||isNaN(y.left)||isNaN(y.top)||"mouse"===m||!d.isFunction(l.effect)?k.css(y):d.isFunction(l.effect)&&(l.effect.call(k,this,d.extend({},y)),k.queue(function(a){d(this).css({opacity:"",height:""}),cb.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=D,this):this},y.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!cb.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var fb=(z=y.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,N).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?G:F}).prototype;fb.invert=function(a,b){this[a]=this[a]===K?M:this[a]===M?K:b||this[a]},fb.string=function(a){var b=this.x,c=this.y,d=b!==c?"center"===b||"center"!==c&&(this.precedance===G||this.forceY)?[c,b]:[b,c]:[b];return a!==!1?d.join(" "):d},fb.abbrev=function(){var a=this.string(!1);return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},fb.clone=function(){return new z(this.string(),this.forceY)},y.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&e.event&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=d.event.fix(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=C),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",l=this.options[k],m=(this.options[a?"hide":"show"],this.options.position),n=this.options.content,o=this.tooltip.css("width"),p=this.tooltip.is(":visible"),q=a||1===l.target.length,r=!c||l.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!p),h=!g.is(":animated")&&p===a&&r,i=h?E:!!this._trigger(k,[90]),this.destroyed?this:(i!==D&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(this.mouse&&(e.origin=d.event.fix(this.mouse)),d.isFunction(n.text)&&this._updateContent(n.text,D),d.isFunction(n.title)&&this._updateTitle(n.title,D),!B&&"mouse"===m.target&&m.adjust.mouse&&(d(b).bind("mousemove."+R,this._storeMouse),B=C),o||g.css("width",g.outerWidth(D)),this.reposition(c,arguments[2]),o||g.css("width",""),l.solo&&("string"==typeof l.solo?d(l.solo):d(V,l.solo)).not(g).not(l.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,B&&!d(V+'[tracking="true"]:visible',l.solo).not(g).length&&(d(b).unbind("mousemove."+R),B=D),this.blur(c)),j=d.proxy(function(){a?(cb.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof l.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),l.effect===D||q===D?(g[k](),j()):d.isFunction(l.effect)?(g.stop(1,1),l.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&l.target.trigger("qtip-"+this.id+"-inactive"),this))},y.show=function(a){return this.toggle(C,a)},y.hide=function(a){return this.toggle(D,a)},y.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(V),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=x.zindex+b.length;return c.hasClass(Z)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+Z).qtip("blur",a)),c.addClass(Z)[0].style.zIndex=f),this},y.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(Z),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},y.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(_):this.disabled):"boolean"!=typeof a&&(a=C),this.rendered&&this.tooltip.toggleClass(_,a).attr("aria-disabled",a),this.disabled=!!a,this)},y.enable=function(){return this.disable(D)},y._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":R+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(_)||a.hide(b),D})},y._updateButton=function(a){if(!this.rendered)return D;var b=this.elements.button;a?this._createButton():b.remove()},y._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(_);c.removeClass(_),_=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(_,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(Y,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(R+"-icon",!a)},y._storeMouse=function(a){return(this.mouse=d.event.fix(a)).type="mousemove",this},y._bind=function(a,b,c,e,f){if(a&&c&&b.length){var g="."+this._id+(e?"-"+e:"");return d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this)),this}},y._unbind=function(a,b){return a&&d(a).unbind("."+this._id+(b?"-"+b:"")),this},y._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||E,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=D,!e.isDefaultPrevented()},y._bindEvents=function(a,b,c,e,f,g){var h=c.filter(e).add(e.filter(c)),i=[];h.length&&(d.each(b,function(b,c){var e=d.inArray(c,a);e>-1&&i.push(a.splice(e,1)[0])}),i.length&&(this._bind(h,i,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)}),c=c.not(h),e=e.not(h))),this._bind(c,a,f),this._bind(e,b,g)},y._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?D:(this.cache.event=a&&d.event.fix(a),this.cache.target=a&&d(a.target),clearTimeout(this.timers.show),void(this.timers.show=l.call(this,function(){this.render("object"==typeof a||c.show.ready)},c.prerender?0:c.show.delay)))}var c=this.options,e=c.show.target,f=c.hide.target,g=c.show.event?d.trim(""+c.show.event).split(" "):[],h=c.hide.event?d.trim(""+c.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(c.show.event)&&!/mouse(out|leave)/i.test(c.hide.event)&&h.push("mouseleave"),this._bind(e,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=C}),this._bindEvents(g,h,e,f,b,function(){return this.timers?void clearTimeout(this.timers.show):D}),(c.show.ready||c.prerender)&&b.call(this,a)},y._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),q=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(X)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(_)&&this.tooltip[0].offsetWidth>0,e=b.parents(V).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",o,"inactive"),this._bind(i.add(g),x.inactiveEvents,o)),this._bindEvents(r,s,h,i,m,n),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){return this.cache?void(this.cache.onTarget="mouseenter"===a.type):D}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(_)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:q,"resize",p),f.adjust.scroll&&this._bind(q.add(f.container),"scroll",p)},y._unassignEvents=function(){var c=this.options,e=c.show.target,f=c.hide.target,g=d.grep([this.elements.target[0],this.rendered&&this.tooltip[0],c.position.container[0],c.position.viewport[0],c.position.container.closest("html")[0],a,b],function(a){return"object"==typeof a});e&&e.toArray&&(g=g.concat(e.toArray())),f&&f.toArray&&(g=g.concat(f.toArray())),this._unbind(g)._unbind(g,"destroy")._unbind(g,"inactive")},d(function(){q(V,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(X)&&!c.hasClass(_)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.position.adjust.mouse&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass($,b)}),q("["+T+"]",W,o)}),x=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=E,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],R):E;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,R);if(!a)return C;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),D;a.set(b,e)}}),g!==E?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(C,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===D||c.length<1||x.api[c]?x.nextid++:c,b=r(d(this),c,k),b===D?C:(x.api[c]=b,d.each(Q,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,x.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,bb):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(bb,b))}return d.fn["attr"+ab].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+ab].apply(this,arguments));return a||b.filter("["+bb+"]").attr("title",function(){return d.attr(this,bb)}).removeAttr(bb),b}},function(a,b){if(!b||d.fn[a+ab])return C;var c=d.fn[a+ab]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+ab]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(S))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+ab].apply(this,arguments)}),x.version="2.2.1",x.nextid=0,x.inactiveEvents=W,x.zindex=15e3,x.defaults={prerender:D,id:D,overwrite:C,suppress:C,content:{text:C,attr:"title",title:D,button:D},position:{my:"top left",at:"bottom right",target:D,container:D,viewport:D,adjust:{x:0,y:0,mouse:C,scroll:C,resize:C,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:D})}},show:{target:D,event:"mouseenter",effect:C,delay:90,solo:D,ready:D,autofocus:D},hide:{target:D,event:"mouseleave",effect:C,delay:0,fixed:D,inactive:D,leave:"window",distance:D},style:{classes:"",widget:D,width:D,height:D,def:C},events:{render:E,move:E,show:E,hide:E,toggle:E,visible:E,hidden:E,focus:E,blur:E}};var gb,hb="margin",ib="border",jb="color",kb="background-color",lb="transparent",mb=" !important",nb=!!b.createElement("canvas").getContext,ob=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,pb={},qb=["Webkit","O","Moz","ms"];if(nb)var rb=a.devicePixelRatio||1,sb=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),tb=rb/sb;else var ub=function(a,b,c){return"<qtipvml:"+a+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(b||"")+' style="behavior: url(#default#VML); '+(c||"")+'" />'};d.extend(v.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("<div />",{"class":R+"-tip"}).prependTo(a.tooltip),nb?(b=d("<canvas />").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=ub("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===J||a.y===N&&this.element.position().top+this.size[1]/2+this.options.offset<b.outerHeight(C))},_parseCorner:function(a){var b=this.qtip.options.position.my;return a===D||b===D?a=D:a===C?a=new z(b.string()):a.string||(a=new z(a),a.fixed=C),a},_parseWidth:function(a,b,c){var d=this.qtip.elements,e=ib+s(b)+"Width";return(c?u(c,e):u(d.content,e)||u(this._useTitle(a)&&d.titlebar||d.content,e)||u(d.tooltip,e))||0},_parseRadius:function(a){var b=this.qtip.elements,c=ib+s(a.y)+s(a.x)+"Radius";return cb.ie<9?0:u(this._useTitle(a)&&b.titlebar||b.content,c)||u(b.tooltip,c)||0},_invalidColour:function(a,b,c){var d=a.css(b);return!d||c&&d===a.css(c)||ob.test(d)?D:d},_parseColours:function(a){var b=this.qtip.elements,c=this.element.css("cssText",""),e=ib+s(a[a.precedance])+s(jb),f=this._useTitle(a)&&b.titlebar||b.content,g=this._invalidColour,h=[];return h[0]=g(c,kb)||g(f,kb)||g(b.content,kb)||g(b.tooltip,kb)||c.css(kb),h[1]=g(c,e,jb)||g(f,e,jb)||g(b.content,e,jb)||g(b.tooltip,e,jb)||b.tooltip.css(e),d("*",c).add(c).css("cssText",kb+":"+lb+mb+";"+ib+":0"+mb+";"),h},_calculateSize:function(a){var b,c,d,e=a.precedance===G,f=this.options.width,g=this.options.height,h="c"===a.abbrev(),i=(e?f:g)*(h?.5:1),j=Math.pow,k=Math.round,l=Math.sqrt(j(i,2)+j(g,2)),m=[this.border/i*l,this.border/g*l];return m[2]=Math.sqrt(j(m[0],2)-j(this.border,2)),m[3]=Math.sqrt(j(m[1],2)-j(this.border,2)),b=l+m[2]+m[3]+(h?0:m[0]),c=b/l,d=[k(c*f),k(c*g)],e?d:d.reverse()},_calculateTip:function(a,b,c){c=c||1,b=b||this.size;var d=b[0]*c,e=b[1]*c,f=Math.ceil(d/2),g=Math.ceil(e/2),h={br:[0,0,d,e,d,0],bl:[0,0,d,0,0,e],tr:[0,e,d,0,d,e],tl:[0,0,0,e,d,e],tc:[0,e,f,0,d,e],bc:[0,0,d,0,f,e],rc:[0,0,d,g,0,e],lc:[d,0,d,e,0,g]};return h.lt=h.br,h.rt=h.bl,h.lb=h.tr,h.rb=h.tl,h[a.abbrev()]},_drawCoords:function(a,b){a.beginPath(),a.moveTo(b[0],b[1]),a.lineTo(b[2],b[3]),a.lineTo(b[4],b[5]),a.closePath()},create:function(){var a=this.corner=(nb||cb.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=a.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(b,c){if(!this.enabled)return this;var e,f,g,h,i,j,k,l,m=this.qtip.elements,n=this.element,o=n.children(),p=this.options,q=this.size,r=p.mimic,s=Math.round;b||(b=this.qtip.cache.corner||this.corner),r===D?r=b:(r=new z(r),r.precedance=b.precedance,"inherit"===r.x?r.x=b.x:"inherit"===r.y?r.y=b.y:r.x===r.y&&(r[b.precedance]=b[b.precedance])),f=r.precedance,b.precedance===F?this._swapDimensions():this._resetDimensions(),e=this.color=this._parseColours(b),e[1]!==lb?(l=this.border=this._parseWidth(b,b[b.precedance]),p.border&&1>l&&!ob.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==C?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===G?[s(r.x===K?l:r.x===M?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===J?k[1]-q[1]:0)]:[s(r.x===K?k[0]-q[0]:0),s(r.y===J?l:r.y===L?k[1]-q[1]-l:(k[1]-q[1])/2)],nb?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,tb),i=this._calculateTip(r,this.size,tb),o.attr(H,k[0]*tb).attr(I,k[1]*tb),o.css(H,k[0]).css(I,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*tb,j[1]*tb),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===cb.ie?2:1:0,o.css({coordsize:k[0]+l+" "+(k[1]+l),antialias:""+(r.string().indexOf(N)>-1),left:j[0]-j[2]*Number(f===F),top:j[1]-j[2]*Number(f===G),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+(k[1]+l),path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(ub("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==D&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return D;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j=(g.tooltip.hasClass("ui-widget"),{});return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===F&&e.reverse(),d.each(e,function(d,e){var h,k,l;
1256 e===N?(h=c===G?K:J,j[h]="50%",j[hb+"-"+h]=-Math.round(b[c===G?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===F?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===P&&j.precedance===b&&k[d]&&j[c]!==N?j.precedance=j.precedance===F?G:F:a!==P&&k[d]&&(j[b]=j[b]===N?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===N?p[hb+"-"+b]=o[a]=g[hb+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=D),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:D,top:D,x:0,y:0},p={};this.corner.fixed!==C&&(e(m,F,G,K,M),e(n,G,F,J,L),(j.string()!==i.corner.string()||i.cornerTop!==k.top||i.cornerLeft!==k.left)&&this.update(j,D)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,(o.left=m===P&&!!k.left)&&f(F,K,M),(o.top=n===P&&!!k.top)&&f(G,J,L),this.element.css(p).toggle(!(o.x&&o.y||j.x===N&&o.y||j.y===N&&o.x)),d.left-=g.left.charAt?g.user:m!==P||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==P||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),gb=Q.tip=function(a){return new v(a,a.options.style.tip)},gb.initialize="render",gb.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=C)}},A.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(C,x.defaults,{style:{tip:{corner:C,mimic:D,width:6,height:6,border:C,offset:0}}}),Q.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],s=u[a],t=v[a],w=c===P,x=s===f?j:s===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=q[f]+r[f]-(n?0:m[f]),A=z-k,B=k+j-(h===H?o:p)-z,C=x-(u.precedance===a||s===u[b]?y:0)-(t===N?i/2:0);return w?(C=(s===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-m[f]+r[f],k-C,Math.min(Math.max(-m[f]+r[f]+(h===H?o:p),k+C),d[f],"center"===s?k-x:1e9))):(e*=c===O?2:0,A>0&&(s!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(s!==g||A>0)&&(d[f]-=(s===N?-C:C)+e,l.invert(a,g)),d[f]<q&&-d[f]>B&&(d[f]=k,l=u.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s=e.target,t=c.elements.tooltip,u=e.my,v=e.at,w=e.adjust,x=w.method.split(" "),y=x[0],z=x[1]||x[0],A=e.viewport,B=e.container,C=(c.cache,{left:0,top:0});return A.jquery&&s[0]!==a&&s[0]!==b.body&&"none"!==w.method?(m=B.offset()||C,n="static"===B.css("position"),k="fixed"===t.css("position"),o=A[0]===a?A.width():A.outerWidth(D),p=A[0]===a?A.height():A.outerHeight(D),q={left:k?0:A.scrollLeft(),top:k?0:A.scrollTop()},r=A.offset()||C,("shift"!==y||"shift"!==z)&&(l=u.clone()),C={left:"none"!==y?j(F,G,y,w.x,K,M,H,f,h):0,top:"none"!==z?j(G,F,z,w.y,J,L,I,g,i):0,my:l}):C};var vb,wb,xb="qtip-modal",yb="."+xb;wb=function(){function a(a){if(d.expr[":"].focusable)return d.expr[":"].focusable;var b,c,e,f=!isNaN(d.attr(a,"tabindex")),g=a.nodeName&&a.nodeName.toLowerCase();return"area"===g?(b=a.parentNode,c=b.name,a.href&&c&&"map"===b.nodeName.toLowerCase()?(e=d("img[usemap=#"+c+"]")[0],!!e&&e.is(":visible")):!1):/input|select|textarea|button|object/.test(g)?!a.disabled:"a"===g?a.href||f:f}function c(a){k.length<1&&a.length?a.not("body").blur():k.first().focus()}function e(a){if(i.is(":visible")){var b,e=d(a.target),h=f.tooltip,j=e.closest(V);b=j.length<1?D:parseInt(j[0].style.zIndex,10)>parseInt(h[0].style.zIndex,10),b||e.closest(V)[0]===h[0]||c(e),g=a.target===k[k.length-1]}}var f,g,h,i,j=this,k={};d.extend(j,{init:function(){return i=j.elem=d("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return D}}).hide(),d(b.body).bind("focusin"+yb,e),d(b).bind("keydown"+yb,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),i.bind("click"+yb,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),j},update:function(b){f=b,k=b.options.show.modal.stealfocus!==D?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,g){var k=(d(b.body),a.tooltip),l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=i.is(":visible"),p=d(yb).filter(":visible:not(:animated)").not(k);return j.update(a),e&&l.stealfocus!==D&&c(d(":focus")),i.toggleClass("blurs",l.blur),e&&i.appendTo(b.body),i.is(":animated")&&o===e&&h!==D||!e&&p.length?j:(i.stop(C,D),d.isFunction(m)?m.call(i,e):m===D?i[n]():i.fadeTo(parseInt(g,10)||90,e?1:0,function(){e||i.hide()}),e||i.queue(function(a){i.css({left:"",top:""}),d(yb).length||i.detach(),a()}),h=e,f.destroyed&&(f=E),j)}}),j.init()},wb=new wb,d.extend(w.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=wb.elem,b.addClass(xb).css("z-index",x.modal_zindex+d(yb).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(wb.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(yb),f=x.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);wb.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+Z).qtip("blur",a.originalEvent),b.addClass(Z)[0].style.zIndex=f,wb.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),void a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(yb).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this)):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:void wb.toggle(this.qtip,!!b,c)},destroy:function(){this.qtip.tooltip.removeClass(xb),this.qtip._unbind(this.qtip.tooltip,this._ns),wb.toggle(this.qtip,D),delete this.qtip.elements.overlay}}),vb=Q.modal=function(a){return new w(a,a.options.show.modal)},vb.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=C))},x.modal_zindex=x.zindex-200,vb.initialize="render",A.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(C,x.defaults,{show:{modal:{on:D,effect:C,blur:C,stealfocus:C,escape:C}}})})}(window,document);1379 e===N?(h=c===G?K:J,j[h]="50%",j[hb+"-"+h]=-Math.round(b[c===G?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===F?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===P&&j.precedance===b&&k[d]&&j[c]!==N?j.precedance=j.precedance===F?G:F:a!==P&&k[d]&&(j[b]=j[b]===N?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===N?p[hb+"-"+b]=o[a]=g[hb+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=D),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:D,top:D,x:0,y:0},p={};this.corner.fixed!==C&&(e(m,F,G,K,M),e(n,G,F,J,L),(j.string()!==i.corner.string()||i.cornerTop!==k.top||i.cornerLeft!==k.left)&&this.update(j,D)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,(o.left=m===P&&!!k.left)&&f(F,K,M),(o.top=n===P&&!!k.top)&&f(G,J,L),this.element.css(p).toggle(!(o.x&&o.y||j.x===N&&o.y||j.y===N&&o.x)),d.left-=g.left.charAt?g.user:m!==P||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==P||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),gb=Q.tip=function(a){return new v(a,a.options.style.tip)},gb.initialize="render",gb.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=C)}},A.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(C,x.defaults,{style:{tip:{corner:C,mimic:D,width:6,height:6,border:C,offset:0}}}),Q.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],s=u[a],t=v[a],w=c===P,x=s===f?j:s===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=q[f]+r[f]-(n?0:m[f]),A=z-k,B=k+j-(h===H?o:p)-z,C=x-(u.precedance===a||s===u[b]?y:0)-(t===N?i/2:0);return w?(C=(s===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-m[f]+r[f],k-C,Math.min(Math.max(-m[f]+r[f]+(h===H?o:p),k+C),d[f],"center"===s?k-x:1e9))):(e*=c===O?2:0,A>0&&(s!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(s!==g||A>0)&&(d[f]-=(s===N?-C:C)+e,l.invert(a,g)),d[f]<q&&-d[f]>B&&(d[f]=k,l=u.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s=e.target,t=c.elements.tooltip,u=e.my,v=e.at,w=e.adjust,x=w.method.split(" "),y=x[0],z=x[1]||x[0],A=e.viewport,B=e.container,C=(c.cache,{left:0,top:0});return A.jquery&&s[0]!==a&&s[0]!==b.body&&"none"!==w.method?(m=B.offset()||C,n="static"===B.css("position"),k="fixed"===t.css("position"),o=A[0]===a?A.width():A.outerWidth(D),p=A[0]===a?A.height():A.outerHeight(D),q={left:k?0:A.scrollLeft(),top:k?0:A.scrollTop()},r=A.offset()||C,("shift"!==y||"shift"!==z)&&(l=u.clone()),C={left:"none"!==y?j(F,G,y,w.x,K,M,H,f,h):0,top:"none"!==z?j(G,F,z,w.y,J,L,I,g,i):0,my:l}):C};var vb,wb,xb="qtip-modal",yb="."+xb;wb=function(){function a(a){if(d.expr[":"].focusable)return d.expr[":"].focusable;var b,c,e,f=!isNaN(d.attr(a,"tabindex")),g=a.nodeName&&a.nodeName.toLowerCase();return"area"===g?(b=a.parentNode,c=b.name,a.href&&c&&"map"===b.nodeName.toLowerCase()?(e=d("img[usemap=#"+c+"]")[0],!!e&&e.is(":visible")):!1):/input|select|textarea|button|object/.test(g)?!a.disabled:"a"===g?a.href||f:f}function c(a){k.length<1&&a.length?a.not("body").blur():k.first().focus()}function e(a){if(i.is(":visible")){var b,e=d(a.target),h=f.tooltip,j=e.closest(V);b=j.length<1?D:parseInt(j[0].style.zIndex,10)>parseInt(h[0].style.zIndex,10),b||e.closest(V)[0]===h[0]||c(e),g=a.target===k[k.length-1]}}var f,g,h,i,j=this,k={};d.extend(j,{init:function(){return i=j.elem=d("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return D}}).hide(),d(b.body).bind("focusin"+yb,e),d(b).bind("keydown"+yb,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),i.bind("click"+yb,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),j},update:function(b){f=b,k=b.options.show.modal.stealfocus!==D?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,g){var k=(d(b.body),a.tooltip),l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=i.is(":visible"),p=d(yb).filter(":visible:not(:animated)").not(k);return j.update(a),e&&l.stealfocus!==D&&c(d(":focus")),i.toggleClass("blurs",l.blur),e&&i.appendTo(b.body),i.is(":animated")&&o===e&&h!==D||!e&&p.length?j:(i.stop(C,D),d.isFunction(m)?m.call(i,e):m===D?i[n]():i.fadeTo(parseInt(g,10)||90,e?1:0,function(){e||i.hide()}),e||i.queue(function(a){i.css({left:"",top:""}),d(yb).length||i.detach(),a()}),h=e,f.destroyed&&(f=E),j)}}),j.init()},wb=new wb,d.extend(w.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=wb.elem,b.addClass(xb).css("z-index",x.modal_zindex+d(yb).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(wb.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(yb),f=x.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);wb.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+Z).qtip("blur",a.originalEvent),b.addClass(Z)[0].style.zIndex=f,wb.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),void a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(yb).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this)):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:void wb.toggle(this.qtip,!!b,c)},destroy:function(){this.qtip.tooltip.removeClass(xb),this.qtip._unbind(this.qtip.tooltip,this._ns),wb.toggle(this.qtip,D),delete this.qtip.elements.overlay}}),vb=Q.modal=function(a){return new w(a,a.options.show.modal)},vb.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=C))},x.modal_zindex=x.zindex-200,vb.initialize="render",A.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(C,x.defaults,{show:{modal:{on:D,effect:C,blur:C,stealfocus:C,escape:C}}})})}(window,document);
1257 //# sourceMappingURL=jquery.qtip.min.js.map1380 //# sourceMappingURL=jquery.qtip.min.js.map
1258 </script>1381 </script>
1259 <link href='//fonts.googleapis.com/css?family=Oswald:300' rel='stylesheet' type='text/css'>1382 <link href='//fonts.googleapis.com/css?family=Oswald:300' rel='stylesheet' type='text/css'>
1260 <link href='//fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>1383 <link href='//fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
1261 <style>1384 <style>
1262 body {1385 body {
1263 margin: 0;1386 margin: 0;
1264 padding: 1.5em;1387 padding: 1.5em;
1265 min-width: 61em;1388 min-width: 61em;
1266 background: url("blue_space_with_planets_by_darkdissolution-updCont.jpg") black;1389 background: url("blue_space_with_planets_by_darkdissolution-updCont.jpg") black;
1267 background-attachment: fixed;1390 background-attachment: fixed;
1268 background-size: cover;1391 background-size: cover;
1269 /* fixes a font rendering issue on OS X */1392 /* fixes a font rendering issue on OS X */
1270 -webkit-font-smoothing: subpixel-antialiased;1393 -webkit-font-smoothing: subpixel-antialiased;
1271 }1394 }
1272 1395
1273 body.screenshotMode {1396 body.screenshotMode {
1274 padding: 1.5em;1397 padding: 1.5em;
1275 min-width: 61em;1398 min-width: 61em;
1276 background: #090909;1399 background: #090909;
1277 }1400 }
1278 1401
1279 body.screenshotMode .navContainer {1402 body.screenshotMode .navContainer {
1280 top: -5em;1403 top: -5em;
1281 }1404 }
1282 1405
1283 body.screenshotMode .navContainer #screenshotButton {1406 body.screenshotMode .navContainer #screenshotButton {
1284 top: 5.5em;1407 top: 5.5em;
1285 }1408 }
1286 1409
1287 .navContainer {1410 .navContainer {
1288 height: 2em;1411 height: 2em;
1289 vertical-align: center;1412 vertical-align: center;
1290 width: 59em;1413 width: 59em;
1291 position: relative;1414 position: relative;
1292 top: 0em;1415 top: 0em;
1293 text-align: center;1416 text-align: center;
1294 color: white;1417 color: white;
1295 font-family: "Agency FB", "Oswald", sans-serif;1418 font-family: "Agency FB", "Oswald", sans-serif;
1296 margin: 0 auto;1419 margin: 0 auto;
1297 border: 0.2em solid rgb(30, 166, 197);1420 border: 0.2em solid rgb(30, 166, 197);
1298 border-bottom: none;1421 border-bottom: none;
1299 box-shadow: 0em 0em 0.5em 0em rgb(30, 166, 197);1422 box-shadow: 0em 0em 0.5em 0em rgb(30, 166, 197);
1300 z-index: 99;1423 z-index: 99;
1301 background: url("nnwall.jpg") black;1424 background: url("nnwall.jpg") black;
1302 padding: 0;1425 padding: 0;
1303 line-height: 1em;1426 line-height: 1em;
1304 }1427 }
1305 1428
1306 .mapLegend {1429 .mapLegend {
1307 position: absolute;1430 position: absolute;
1308 width: 59em;1431 width: 59em;
1309 height: 2em;1432 height: 2em;
1310 z-index: 8;1433 z-index: 8;
1311 background: #000 url("nnwall.jpg") repeat scroll 0% 0%;1434 background: #000 url("nnwall.jpg") repeat scroll 0% 0%;
1312 box-shadow: 0em 0em 0.5em 0em #1EA6C5;1435 box-shadow: 0em 0em 0.5em 0em #1EA6C5;
1313 border: 0.2em solid #1EA6C5;1436 border: 0.2em solid #1EA6C5;
1314 color: #FFF;1437 color: #FFF;
1315 font-family: "Agency FB","Oswald",sans-serif;1438 font-family: "Agency FB","Oswald",sans-serif;
1316 left: 2.35em;1439 left: 2.35em;
1317 top: 3.6em;1440 top: 3.6em;
1318 }1441 }
1319 1442
1320 .mapLegend .system {1443 .mapLegend .system {
1321 top: 0.9em;1444 top: 0.9em;
1322 position: relative;1445 position: relative;
1323 left: 0.9em;1446 left: 0.9em;
1324 }1447 }
1325 1448
1326 .mapLegend .system label {1449 .mapLegend .system label {
1327 position: absolute;1450 position: absolute;
1328 left: 1.5em;1451 left: 1.5em;
1329 top: -0.25em;1452 top: -0.25em;
1330 }1453 }
1331 1454
1332 .mapLegend .systemLegendContainer {1455 .mapLegend .systemLegendContainer {
1333 float: left;1456 float: left;
1334 height: 2.2em;1457 height: 2.2em;
1335 position: relative;1458 position: relative;
1336 white-space: nowrap;1459 white-space: nowrap;
1337 width: 9.65%;1460 width: 9.65%;
1338 }1461 }
1339 1462
1340 #configButton {1463 #configButton {
1341 position: absolute;1464 position: absolute;
1342 left: 25.25em;1465 left: 25.25em;
1343 top: 0.5em;1466 top: 0.5em;
1344 }1467 }
1345 1468
1346 #screenshotButton {1469 #screenshotButton {
1347 position: absolute;1470 position: absolute;
1348 left: 23.5em;1471 left: 23.5em;
1349 top: 0.5em;1472 top: 0.5em;
1350 }1473 }
1351 1474
1352 .configMenu {1475 .configMenu {
1353 position: absolute;1476 position: absolute;
1354 width: 59em;1477 width: 59em;
1355 height: 5em;1478 height: auto;
1356 z-index: 9;1479 z-index: 9;
1357 background: #000 url("nnwall.jpg") repeat scroll 0% 0%;1480 background: #000 url("nnwall.jpg") repeat scroll 0% 0%;
1358 box-shadow: 0em 0em 0.5em 0em #1EA6C5;1481 box-shadow: 0em 0em 0.5em 0em #1EA6C5;
1359 border: 0.2em solid #1EA6C5;1482 border: 0.2em solid #1EA6C5;
1360 color: #FFF;1483 color: #FFF;
1361 font-family: "Agency FB","Oswald",sans-serif;1484 font-family: "Agency FB","Oswald",sans-serif;
1362 left: 2.35em;1485 left: 2.35em;
1363 opacity: 1;1486 opacity: 1;
1364 top: 3.6em;1487 top: 3.6em;
1365 transition: all 1s ease;1488 transition: top 1s ease, opacity 1s ease;
1366 }1489 }
1367 1490
1368 .configMenu.closed {1491 .configMenu.closed {
1369 top: -5em !important;1492 top: -5em !important;
1370 opacity: 0;1493 opacity: 0;
1371 }1494 }
1372
1373 @media (min-width: 65em) {
1374 .navContainer {
1375 position: fixed !important;
1376 left: 0 !important;
1377 right: 0 !important;
1378 border-bottom: 0.2em solid rgb(30, 166, 197) !important;
1379 }
1380
1381 .mapContainer {
1382 top: 0.7em !important;
1383 }
1384
1385 .infocardContainer {
1386 top: 0.7em !important;
1387 }
1388
1389 .infocardContainer span.infocardText {
1390 padding-left: 0;
1391 padding-right: 0;
1392 }
1393
1394 .configMenu, .mapLegend {
1395 position: fixed !important;
1396 margin: 0px auto !important;
1397 left: 0 !important;
1398 right: 0 !important;
1399 top: 2.2em !important;
1400 }
1401
1402 }
1403
1404 /*@media (max-width: 64.999999em) {
1405 .stickyContainer {
1406 position: sticky;
1407 position: -webkit-sticky;
1408 right: 0px;
1409 left: 0px;
1410 width: 100%;
1411 max-width: 98vw;
1412 margin: 0 auto;
1413 }
1414 }*/
1415 1495
1416 .mapContainer {1496 .mapContainer {
1417 position: relative;1497 position: relative;
1418 height: 60em;1498 height: 60em;
1419 width: 60em;1499 width: 60em;
1420 margin: 0 auto;1500 margin: 0 auto;
1421 border: 0.22em rgb(30, 167, 198) solid;1501 border: 0.22em rgb(30, 167, 198) solid;
1422 box-shadow: 0em 0em 0.5em 0.1em rgb(28, 107, 144);1502 box-shadow: 0em 0em 0.5em 0.1em rgb(28, 107, 144);
1423 border-radius: 0.5em;1503 border-radius: 0.5em;
1424 /*background-color: rgb(30, 167, 198);*/1504 /*background-color: rgb(30, 167, 198);*/
1425 overflow: hidden;1505 overflow: hidden;
1426 overflow: -moz-hidden-unscrollable;1506 overflow: -moz-hidden-unscrollable;
1427 overflow: -webkit-hidden-unscrollable;1507 overflow: -webkit-hidden-unscrollable;
1428 }1508 }
1429 1509
1430 .grid .darkOverlay {1510 .grid .darkOverlay {
1431 height: 100%;1511 height: 100%;
1432 width: 100%;1512 width: 100%;
1433 background-color: rgba(0,0,0,0.4);1513 background-color: rgba(0,0,0,0.4);
1434 }1514 }
1435 1515
1436 .map {1516 .map {
1437 height: 75%;1517 height: 75%;
1438 width: 75%;1518 width: 75%;
1439 position: absolute;1519 position: absolute;
1440 margin-top: 50%;1520 margin-top: 50%;
1441 margin-left: 50%;1521 margin-left: 50%;
1442 color: white;1522 color: white;
1443 font-family: "Agency FB", "Oswald", sans-serif;1523 font-family: "Agency FB", "Oswald", sans-serif;
1444 z-index: 5;1524 z-index: 5;
1445 border-radius: 0.1em;1525 border-radius: 0.1em;
1446 }1526 }
1447 1527
1448 .grid .mapScale h2 {1528 .grid .mapScale h2 {
1449 color: white;1529 color: white;
1450 font-family: "Agency FB", "Oswald", sans-serif;1530 font-family: "Agency FB", "Oswald", sans-serif;
1451 position: relative;1531 position: relative;
1452 top: -2em;1532 top: -2em;
1453 }1533 }
1454 1534
1455 .grid .mapScale {1535 .grid .mapScale {
1456 position: absolute;1536 position: absolute;
1457 right: 0.75%;1537 right: 0.75%;
1458 bottom: 0.75%;1538 bottom: 0.75%;
1459 width: 10.5%;1539 width: 10.5%;
1460 border: solid #F3F3F3 0.2em;1540 border: solid #F3F3F3 0.2em;
1461 box-sizing: border-box;1541 box-sizing: border-box;
1462 border-top: none;1542 border-top: none;
1463 height: 1%;1543 height: 1%;
1464 text-align: center;1544 text-align: center;
1465 }1545 }
1466 1546
1467 .grid .mapScale .arrowHead {1547 .grid .mapScale .arrowHead {
1468 position: absolute;1548 position: absolute;
1469 border-top: 0.2em solid white;1549 border-top: 0.2em solid white;
1470 border-left: 0.2em solid white;1550 border-left: 0.2em solid white;
1471 height: 0.3em;1551 height: 0.3em;
1472 width: 0.3em;1552 width: 0.3em;
1473 bottom: -0.3em;1553 bottom: -0.3em;
1474 display: none;1554 display: none;
1475 }1555 }
1476 1556
1477 .grid .mapScale.arrows {1557 .grid .mapScale.arrows {
1478 border-left: none !important;1558 border-left: none !important;
1479 border-right: none !important;1559 border-right: none !important;
1480 border-bottom-style: dashed !important;1560 border-bottom-style: dashed !important;
1481 bottom: 1% !important;1561 bottom: 1% !important;
1482 }1562 }
1483 1563
1484 .grid .mapScale.arrows .arrowHead {1564 .grid .mapScale.arrows .arrowHead {
1485 display: block !important;1565 display: block !important;
1486 }1566 }
1487 1567
1488 .grid .mapScale .arrowL.arrowHead {1568 .grid .mapScale .arrowL.arrowHead {
1489 transform: rotate(-45deg);1569 transform: rotate(-45deg);
1490 -webkit-transform: rotate(-45deg);1570 -webkit-transform: rotate(-45deg);
1491 left: 0;1571 left: 0;
1492 }1572 }
1493 1573
1494 .grid .mapScale .arrowR.arrowHead {1574 .grid .mapScale .arrowR.arrowHead {
1495 transform: rotate(135deg);1575 transform: rotate(135deg);
1496 -webkit-transform: rotate(135deg);1576 -webkit-transform: rotate(135deg);
1497 right: 0;1577 right: 0;
1498 }1578 }
1499 1579
1500 .infocardContainer {1580 .infocardContainer {
1501 max-width: 58.5em;1581 max-width: 58.5em;
1502 width: 92vw;1582 width: 92vw;
1503 padding-left: 0.25em;1583 padding-left: 0.25em;
1504 padding-right: 0.25em;1584 padding-right: 0.25em;
1505 position: relative;1585 position: relative;
1506 top: 0em;1586 top: 0em;
1507 text-align: center;1587 text-align: center;
1508 color: white;1588 color: white;
1509 font-family: "Agency FB", "Oswald", sans-serif;1589 font-family: "Agency FB", "Oswald", sans-serif;
1510 margin: 0 auto;1590 margin: 0 auto;
1511 border: 0.2em solid rgb(30, 166, 197);1591 border: 0.2em solid rgb(30, 166, 197);
1512 border-top: none;1592 border-top: none;
1513 box-shadow: 0em 0em 0.5em 0em rgb(30, 166, 197);1593 box-shadow: 0em 0em 0.5em 0em rgb(30, 166, 197);
1514 z-index: 0;1594 z-index: 0;
1515 background: url("nnwall.jpg") black;1595 background: url("nnwall.jpg") black;
1516 }1596 }
1517 1597
1518 .infocardContainer * {1598 .infocardContainer * {
1519 text-align: center;1599 text-align: center;
1520 margin: 0 auto;1600 margin: 0 auto;
1521 width: auto;1601 width: auto;
1522 padding: 0.25em;1602 padding: 0.25em;
1523 }1603 }
1524 1604
1525 .infocardContainer h2 {1605 .infocardContainer h2 {
1526 width: auto;1606 width: auto;
1527 }1607 }
1528 1608
1529 .systemTitle {1609 .systemTitle {
1530 position: absolute;1610 position: absolute;
1531 bottom: 0.1em;1611 bottom: 0.1em;
1532 color: white;1612 color: white;
1533 text-align: center;1613 text-align: center;
1534 width: 100%;1614 width: 100%;
1535 font-family: "Agency FB", "Oswald", sans-serif;1615 font-family: "Agency FB", "Oswald", sans-serif;
1536 font-size: 3em;1616 font-size: 3em;
1537 padding: 0;1617 padding: 0;
1538 margin: 0;1618 margin: 0;
1539 color: rgb(135, 195, 224);1619 color: rgb(135, 195, 224);
1540 }1620 }
1541 1621
1542 .system {1622 .system {
1543 height: 0.65em;1623 height: 0.65em;
1544 width: 0.65em;1624 width: 0.65em;
1545 background-color: rgb(36, 36, 36);1625 background-color: rgb(36, 36, 36);
1546 border: 0.15em solid;1626 border: 0.15em solid;
1547 border-radius: 100%;1627 border-radius: 100%;
1548 margin-top: -0.325em;1628 margin-top: -0.325em;
1549 margin-left: -0.325em;1629 margin-left: -0.325em;
1550 }1630 }
1551 1631
1552 .system label {1632 .system label {
1553 font-size: 0.8em;1633 font-size: 0.8em;
1554 }1634 }
1555 1635
1556 .system.ew {1636 .system.ew {
1557 border-color: #C35B2B;1637 border-color: #C35B2B;
1558 }1638 }
1559 1639
1560 .system.bw {1640 .system.bw {
1561 border-color: #959597;1641 border-color: #959597;
1562 }1642 }
1563 1643
1564 .system.ku {1644 .system.ku {
1565 border-color: #FED433;1645 border-color: #FED433;
1566 }1646 }
1567 1647
1568 .system.li {1648 .system.li {
1569 border-color: #2299F5;1649 border-color: #2299F5;
1570 }1650 }
1571 1651
1572 .system.br {1652 .system.br {
1573 border-color: #BD3035;1653 border-color: #BD3035;
1574 }1654 }
1575 1655