home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Theme / 8GadgetPack / 8GadgetPackSetup.msi / Gadgets.7z / Gadgets / MyWeather.gadget / js / js.js < prev    next >
Text File  |  2011-07-30  |  28KB  |  471 lines

  1. System.Gadget.settingsUI = "settings.html";
  2. System.Gadget.onSettingsClosed = settingsClosed;
  3. System.Gadget.onDock = docked;
  4. System.Gadget.onUndock = undocked;
  5.  
  6.  
  7. var txtcolor = System.Gadget.Settings.read("txtcolor");
  8. if(txtcolor==''){txtcolor="1";System.Gadget.Settings.write("txtcolor", txtcolor);}
  9. var userAgenty = System.Gadget.Settings.read("userAgenty");
  10. if(userAgenty==''){userAgenty=false;System.Gadget.Settings.write("userAgenty", userAgenty);}
  11. var win        = System.Gadget.Settings.read("win");
  12. if(win=='')
  13. {
  14.    var userAgent = navigator.userAgent.toLowerCase();
  15.    var userAgenty=System.Gadget.Settings.read("userAgenty");
  16.    if(userAgenty==''){userAgenty=false;System.Gadget.Settings.write("userAgenty", userAgenty);}   
  17.    if(userAgent.indexOf("windows nt 6.0")>-1){var win="vista";}else{var win="win7";}
  18.    System.Gadget.Settings.write("win", win);    
  19. }
  20.  
  21. var wireless = System.Network.Wireless;
  22. var status;
  23. wireless.connectionChanged = go;
  24. var statuscheck=0;
  25. var count = 0;
  26. var styley=System.Gadget.Settings.read("styley");
  27. if(styley==''){styley="1";System.Gadget.Settings.write("styley", styley);}
  28. var confirmy=System.Gadget.Settings.read("confirmy");
  29. if(confirmy==''){confirmy=false;System.Gadget.Settings.write("confirmy", confirmy);}
  30. function update(){load('0');}
  31. function start(){if(System.Gadget.docked) {docked();}else{undocked();}load('0');}
  32.  
  33. function load(run){
  34. count = count+1;
  35.  
  36. if(count == 50){location.href = "index.html";}
  37. if(run==0){go();/*confirm('lade daten');*/}
  38.  
  39. var show  = "";show  = System.Gadget.Settings.read("show");show  = show.toString();if(show.length == 4){show = "0"+show;}if(show == ''){show="wc:USNY0996";}var CF_var = "";CF_var = System.Gadget.Settings.read("CF");if(CF_var == ''){CF_var="C";}
  40. /**/
  41. var rssDoc2 = new ActiveXObject("MSXML2.DOMDocument.3.0");
  42. rssDoc2.onreadystatechange = popData2;
  43. rssDoc2.load("http://weather.service.msn.com/data.aspx?src=vista&wealocations="+show+"&weadegreetype="+CF_var+"&culture="+lang.culture);
  44. function popData2()
  45. {
  46. if(rssDoc2.readyState!=4)return;
  47. var c2 = 0;
  48. var rssItems2 = rssDoc2.selectNodes("/weatherdata/weather");
  49.  
  50. for(var i=0;i<rssItems2.length;i++)
  51. {
  52. var stadt = rssItems2[i].selectSingleNode("./@weatherlocationname").text;
  53. var arrLine = stadt.split(",");
  54. System.Gadget.Settings.write("current_stadt", arrLine[0]);
  55.  
  56. var alert = rssItems2[i].selectSingleNode("./@alert").text;
  57.  
  58. System.Gadget.Settings.write("current_temperature", rssItems2[i].selectSingleNode("./current/@temperature").text+"░"+CF_var);
  59. System.Gadget.Settings.write("current_skycode", rssItems2[i].selectSingleNode("./current/@skycode").text);
  60. System.Gadget.Settings.write("current_skytext", rssItems2[i].selectSingleNode("./current/@skytext").text);
  61. System.Gadget.Settings.write("current_date", rssItems2[i].selectSingleNode("./current/@date").text);
  62. System.Gadget.Settings.write("current_day", rssItems2[i].selectSingleNode("./current/@day").text);
  63. System.Gadget.Settings.write("current_shortday", rssItems2[i].selectSingleNode("./current/@shortday").text);
  64. System.Gadget.Settings.write("current_observationtime", rssItems2[i].selectSingleNode("./current/@observationtime").text);
  65. System.Gadget.Settings.write("current_observationpoint", rssItems2[i].selectSingleNode("./current/@observationpoint").text);
  66. System.Gadget.Settings.write("current_feelslike", rssItems2[i].selectSingleNode("./current/@feelslike").text);
  67. System.Gadget.Settings.write("current_humidity", rssItems2[i].selectSingleNode("./current/@humidity").text);
  68. System.Gadget.Settings.write("current_windspeed", rssItems2[i].selectSingleNode("./current/@windspeed").text);
  69. System.Gadget.Settings.write("current_winddisplay", rssItems2[i].selectSingleNode("./current/@winddisplay").text);
  70.  
  71. //2010-07-02
  72. var observationtime = rssItems2[i].selectSingleNode("./current/@observationtime").text;
  73. var arrLine1 = observationtime.split(":");
  74. var currentdate = rssItems2[i].selectSingleNode("./current/@date").text;
  75. var arrLine2 = currentdate.split("-");
  76.  
  77. //svar dateform1 = arrLine2[2]+" "+monthname[arrLine2[1]]+" "+arrLine2[0];  /* 01 Jul 2010*/
  78. dateform["de-DE"] = arrLine2[2]+"."+arrLine2[1]+"."+arrLine2[0];             /* 01.07.2010*/
  79. dateform[""] = rssItems2[i].selectSingleNode("./current/@date").text;   /*2010-07-02*/
  80.  
  81.  
  82. System.Gadget.Settings.write("current_observationtime", dateform[lang.culture]+" - "+arrLine1[0]+":"+arrLine1[1]);
  83.  
  84. System.Gadget.Settings.write("forecast0_low", rssItems2[i].selectSingleNode("./forecast[0]/@low").text);
  85. System.Gadget.Settings.write("forecast0_high", rssItems2[i].selectSingleNode("./forecast[0]/@high").text);
  86. System.Gadget.Settings.write("forecast0_skycodeday", rssItems2[i].selectSingleNode("./forecast[0]/@skycodeday").text);
  87. System.Gadget.Settings.write("forecast0_skytextday", rssItems2[i].selectSingleNode("./forecast[0]/@skytextday").text);
  88. System.Gadget.Settings.write("forecast0_date", rssItems2[i].selectSingleNode("./forecast[0]/@date").text);
  89. System.Gadget.Settings.write("forecast0_day", rssItems2[i].selectSingleNode("./forecast[0]/@day").text);
  90. System.Gadget.Settings.write("forecast0_shortday", rssItems2[i].selectSingleNode("./forecast[0]/@shortday").text);
  91. System.Gadget.Settings.write("forecast0_precip", rssItems2[i].selectSingleNode("./forecast[0]/@precip").text);
  92. var today_vorschau = System.Gadget.Settings.read("forecast0_low")+"░ / "+System.Gadget.Settings.read("forecast0_high")+"░";
  93. System.Gadget.Settings.write("today_vorschau", today_vorschau);
  94.  
  95. System.Gadget.Settings.write("forecast1_low", rssItems2[i].selectSingleNode("./forecast[1]/@low").text);
  96. System.Gadget.Settings.write("forecast1_high", rssItems2[i].selectSingleNode("./forecast[1]/@high").text);
  97. System.Gadget.Settings.write("forecast1_skycodeday", rssItems2[i].selectSingleNode("./forecast[1]/@skycodeday").text);
  98. System.Gadget.Settings.write("forecast1_skytextday", rssItems2[i].selectSingleNode("./forecast[1]/@skytextday").text);
  99. System.Gadget.Settings.write("forecast1_date", rssItems2[i].selectSingleNode("./forecast[1]/@date").text);
  100. System.Gadget.Settings.write("forecast1_day", rssItems2[i].selectSingleNode("./forecast[1]/@day").text);
  101. System.Gadget.Settings.write("forecast1_shortday", rssItems2[i].selectSingleNode("./forecast[1]/@shortday").text);
  102. System.Gadget.Settings.write("forecast1_precip", rssItems2[i].selectSingleNode("./forecast[1]/@precip").text);
  103.  
  104. System.Gadget.Settings.write("forecast2_low", rssItems2[i].selectSingleNode("./forecast[2]/@low").text);
  105. System.Gadget.Settings.write("forecast2_high", rssItems2[i].selectSingleNode("./forecast[2]/@high").text);
  106. System.Gadget.Settings.write("forecast2_skycodeday", rssItems2[i].selectSingleNode("./forecast[2]/@skycodeday").text);
  107. System.Gadget.Settings.write("forecast2_skytextday", rssItems2[i].selectSingleNode("./forecast[2]/@skytextday").text);
  108. System.Gadget.Settings.write("forecast2_date", rssItems2[i].selectSingleNode("./forecast[2]/@date").text);
  109. System.Gadget.Settings.write("forecast2_day", rssItems2[i].selectSingleNode("./forecast[2]/@day").text);
  110. System.Gadget.Settings.write("forecast2_shortday", rssItems2[i].selectSingleNode("./forecast[2]/@shortday").text);
  111. System.Gadget.Settings.write("forecast2_precip", rssItems2[i].selectSingleNode("./forecast[2]/@precip").text);
  112.  
  113. System.Gadget.Settings.write("forecast3_low", rssItems2[i].selectSingleNode("./forecast[3]/@low").text);
  114. System.Gadget.Settings.write("forecast3_high", rssItems2[i].selectSingleNode("./forecast[3]/@high").text);
  115. System.Gadget.Settings.write("forecast3_skycodeday", rssItems2[i].selectSingleNode("./forecast[3]/@skycodeday").text);
  116. System.Gadget.Settings.write("forecast3_skytextday", rssItems2[i].selectSingleNode("./forecast[3]/@skytextday").text);
  117. System.Gadget.Settings.write("forecast3_date", rssItems2[i].selectSingleNode("./forecast[3]/@date").text);
  118. System.Gadget.Settings.write("forecast3_day", rssItems2[i].selectSingleNode("./forecast[3]/@day").text);
  119. System.Gadget.Settings.write("forecast3_shortday", rssItems2[i].selectSingleNode("./forecast[3]/@shortday").text);
  120. System.Gadget.Settings.write("forecast3_precip", rssItems2[i].selectSingleNode("./forecast[3]/@precip").text);
  121.  
  122. System.Gadget.Settings.write("forecast4_low", rssItems2[i].selectSingleNode("./forecast[4]/@low").text);
  123. System.Gadget.Settings.write("forecast4_high", rssItems2[i].selectSingleNode("./forecast[4]/@high").text);
  124. System.Gadget.Settings.write("forecast4_skycodeday", rssItems2[i].selectSingleNode("./forecast[4]/@skycodeday").text);
  125. System.Gadget.Settings.write("forecast4_skytextday", rssItems2[i].selectSingleNode("./forecast[4]/@skytextday").text);
  126. System.Gadget.Settings.write("forecast4_date", rssItems2[i].selectSingleNode("./forecast[4]/@date").text);
  127. System.Gadget.Settings.write("forecast4_day", rssItems2[i].selectSingleNode("./forecast[4]/@day").text);
  128. System.Gadget.Settings.write("forecast4_shortday", rssItems2[i].selectSingleNode("./forecast[4]/@shortday").text);
  129. System.Gadget.Settings.write("forecast4_precip", rssItems2[i].selectSingleNode("./forecast[4]/@precip").text);
  130. }
  131. if(System.Gadget.docked) {docked();}else{undocked();}
  132. if(alert != '' && confirmy==true){if(typeof alert!='undefined'){confirm(alert+" "+lang.wetter_for+" "+System.Gadget.Settings.read("current_stadt")+"!\n"+lang.wetterwarnung);}}
  133.  
  134. }
  135. /**/
  136.  
  137. /*if(run==0){confirm('daten gefunden');}*/
  138. }
  139.  
  140.  
  141.  
  142. function docked() {
  143. if(userAgenty==true)
  144. {
  145. var style=System.Gadget.Settings.read("style");if(style==''){style="c";System.Gadget.Settings.write("style", style);}
  146.     document.body.style.height = "280px";
  147. var oBackground = document.getElementById("bg");
  148.     oBackground.src = "url(img/bg-undocked4_"+style+".png)";
  149. big();
  150. }
  151. else
  152. {
  153. var style=System.Gadget.Settings.read("style");if(style==''){style="c";System.Gadget.Settings.write("style", style);}
  154.     document.body.style.height = "67px";
  155. var oBackground = document.getElementById("bg");
  156.  
  157.     oBackground.src = "url(img/bg-docked4_"+style+".png)";
  158. small();
  159. }
  160. }
  161.  
  162.  
  163. function undocked() {
  164. var style=System.Gadget.Settings.read("style");
  165.     document.body.style.height = "280px";
  166. var oBackground = document.getElementById("bg");
  167.     oBackground.src = "url(img/bg-undocked4_"+style+".png)";
  168. big();
  169. }
  170.  
  171. function showFlyout () {
  172. System.Gadget.Flyout.file = "flyout.html";
  173. hideFlyout();
  174. System.Gadget.Flyout.show = true;
  175. System.Gadget.Flyout.onShow = function() {
  176. System.Gadget.Flyout.document.getElementById("iframe").src = flyoutHTML;
  177. }
  178. }
  179.  
  180. function hideFlyout () {
  181. if (System.Gadget.Flyout.show) {
  182. System.Gadget.Flyout.show = false;
  183. }
  184. }
  185. function go() {
  186.    var sett1  = setTimeout("load('0');",1000 * 60 * 30);
  187.    var sett2  = setTimeout("load('1');",1000 * 5);
  188.    var sett3  = setTimeout("load('1');",1000 * 10);
  189.    var sett4  = setTimeout("load('1');",1000 * 15);
  190.    var sett5  = setTimeout("load('1');",1000 * 30);
  191.    var sett6  = setTimeout("load('1');",1000 * 60);
  192.    var sett7  = setTimeout("load('1');",1000 * 60 * 5);
  193.    var sett8  = setTimeout("load('1');",1000 * 60 * 10);
  194.    var sett9  = setTimeout("load('1');",1000 * 60 * 20);
  195. }
  196. function small(){
  197. document.getElementById("bg").removeObjects();
  198.  
  199.  
  200. if(System.Gadget.Settings.read("current_skycode") != ''){bg.addImageObject("img/w"+styley+"/"+System.Gadget.Settings.read("current_skycode")+".png", 5, 8);}
  201.  
  202. if(System.Gadget.Settings.read("txtcolor") == '1')
  203. {
  204.  
  205. /*black*/
  206. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_temperature"), "Calibri", 21, "black", 122,6);txtAlign.align = 2;
  207. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("today_vorschau"), "Calibri", 12, "black", 121,30);txtAlign.align = 2;
  208. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_stadt"), "Calibri", 12, "black", 120,44);txtAlign.align = 2;
  209. /*black*/
  210. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_temperature"), "Calibri", 21, "white", 121,5);txtAlign.align = 2;
  211. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("today_vorschau"), "Calibri", 12, "white", 120,29);txtAlign.align = 2;
  212. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_stadt"), "Calibri", 12, "white", 119,43);txtAlign.align = 2;
  213.  
  214. }else{
  215.  
  216. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_temperature"), "Calibri", 21, "white", 122,6);txtAlign.align = 2;
  217. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("today_vorschau"), "Calibri", 12, "white", 121,30);txtAlign.align = 2;
  218. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_stadt"), "Calibri", 12, "white", 120,44);txtAlign.align = 2;
  219. /*black*/
  220. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_temperature"), "Calibri", 21, "black", 121,5);txtAlign.align = 2;
  221. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("today_vorschau"), "Calibri", 12, "black", 120,29);txtAlign.align = 2;
  222. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_stadt"), "Calibri", 12, "black", 119,43);txtAlign.align = 2;
  223. /*black*/
  224.  
  225. }
  226.  
  227.  
  228.  
  229.  
  230. }
  231. function big() {
  232. document.getElementById("bg").removeObjects();
  233. var CF_var = "";CF_var = System.Gadget.Settings.read("CF");if(CF_var == ''){CF_var="C";}
  234.  
  235. if(System.Gadget.Settings.read("current_skycode") != ''){bg.addImageObject("img/w"+styley+"/"+System.Gadget.Settings.read("current_skycode")+".png", 5, 8);}
  236.  
  237.  
  238.  
  239. if(System.Gadget.Settings.read("txtcolor") == '1')
  240. {
  241.  
  242. /*black*/
  243. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_temperature"), "Calibri", 21, "black", 122,6);txtAlign.align = 2;
  244. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("today_vorschau"), "Calibri", 12, "black", 121,30);txtAlign.align = 2;
  245. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_stadt"), "Calibri", 12, "black", 120,44);txtAlign.align = 2;
  246. /*black*/
  247. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_temperature"), "Calibri", 21, "white", 121,5);txtAlign.align = 2;
  248. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("today_vorschau"), "Calibri", 12, "white", 120,29);txtAlign.align = 2;
  249. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_stadt"), "Calibri", 12, "white", 119,43);txtAlign.align = 2;
  250.  
  251. }else{
  252.  
  253. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_temperature"), "Calibri", 21, "white", 122,6);txtAlign.align = 2;
  254. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("today_vorschau"), "Calibri", 12, "white", 121,30);txtAlign.align = 2;
  255. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_stadt"), "Calibri", 12, "white", 120,44);txtAlign.align = 2;
  256. /*black*/
  257. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_temperature"), "Calibri", 21, "black", 121,5);txtAlign.align = 2;
  258. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("today_vorschau"), "Calibri", 12, "black", 120,29);txtAlign.align = 2;
  259. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_stadt"), "Calibri", 12, "black", 119,43);txtAlign.align = 2;
  260. /*black*/
  261.  
  262. }
  263.  
  264. /*
  265. System.Gadget.Settings.write("current_temperature", rssItems2[i].selectSingleNode("./current/@temperature").text+"░"+CF_var);
  266. System.Gadget.Settings.write("current_skycode", rssItems2[i].selectSingleNode("./current/@skycode").text);
  267. System.Gadget.Settings.write("current_skytext", rssItems2[i].selectSingleNode("./current/@skytext").text);
  268. System.Gadget.Settings.write("current_date", rssItems2[i].selectSingleNode("./current/@date").text);
  269. System.Gadget.Settings.write("current_day", rssItems2[i].selectSingleNode("./current/@day").text);
  270. System.Gadget.Settings.write("current_shortday", rssItems2[i].selectSingleNode("./current/@shortday").text);
  271. System.Gadget.Settings.write("current_observationtime", rssItems2[i].selectSingleNode("./current/@observationtime").text);
  272. System.Gadget.Settings.write("current_observationpoint", rssItems2[i].selectSingleNode("./current/@observationpoint").text);
  273. System.Gadget.Settings.write("current_feelslike", rssItems2[i].selectSingleNode("./current/@feelslike").text);
  274. System.Gadget.Settings.write("current_humidity", rssItems2[i].selectSingleNode("./current/@humidity").text);
  275. System.Gadget.Settings.write("current_windspeed", rssItems2[i].selectSingleNode("./current/@windspeed").text);
  276. System.Gadget.Settings.write("current_winddisplay", rssItems2[i].selectSingleNode("./current/@winddisplay").text);
  277. */
  278. var observationpoint = System.Gadget.Settings.read("current_observationpoint");
  279. if(observationpoint.indexOf(",") > -1){var o = observationpoint.split(",");observationpoint=o[1];}
  280. if(observationpoint.indexOf("-") > -1){var o = observationpoint.split("-");observationpoint=o[1];}
  281. if(observationpoint.indexOf("/") > -1){var o = observationpoint.split("/");observationpoint=o[1];}
  282. if(observationpoint.length > 15){var o = observationpoint.split(" ");observationpoint=o[1];}
  283. if(observationpoint.length == 0){observationpoint=System.Gadget.Settings.read("current_stadt");}
  284.  
  285. var winddisplay = "";
  286. if(CF_var == 'C'){winddisplay = lang.winddisplay_k;}else{winddisplay = lang.winddisplay_m;}
  287.  
  288.  
  289. if(System.Gadget.Settings.read("txtcolor") == '1')
  290. {
  291.  
  292. /*black*/
  293. document.getElementById("bg").addTextObject(lang.skytext, "Calibri", 12, "black", 10,71);
  294. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_skytext"), "Calibri", 12, "black", 120,71);
  295. txtAlign.align = 2;
  296. document.getElementById("bg").addTextObject(lang.feelslike, "Calibri", 12, "black", 10,83);
  297. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_feelslike")+"░"+CF_var, "Calibri", 12, "black", 121,83);
  298. txtAlign.align = 2;
  299. document.getElementById("bg").addTextObject(lang.humidity, "Calibri", 12, "black", 10,95);
  300. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_humidity")+"%", "Calibri", 12, "black", 122,95);txtAlign.align = 2;
  301. document.getElementById("bg").addTextObject(lang.windspeed, "Calibri", 12, "black", 10,107);
  302. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_windspeed")+" "+winddisplay, "Calibri", 12, "black", 121,107);
  303. txtAlign.align = 2;
  304. document.getElementById("bg").addTextObject(lang.observationpoint, "Calibri", 12, "black", 10,119);
  305. var txtAlign = bg.addTextObject(observationpoint, "Calibri", 12, "black", 120,119);
  306. txtAlign.align = 2;
  307. /*black*/
  308.  
  309.  
  310. document.getElementById("bg").addTextObject(lang.skytext, "Calibri", 12, "white", 9,70);
  311. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_skytext"), "Calibri", 12, "white", 119,70);
  312. txtAlign.align = 2;
  313.  
  314. document.getElementById("bg").addTextObject(lang.feelslike, "Calibri", 12, "white", 9,82);
  315. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_feelslike")+"░"+CF_var, "Calibri", 12, "white", 120,82);
  316. txtAlign.align = 2;
  317. document.getElementById("bg").addTextObject(lang.humidity, "Calibri", 12, "white", 9,94);
  318. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_humidity")+"%", "Calibri", 12, "white", 121,94);txtAlign.align = 2;
  319. document.getElementById("bg").addTextObject(lang.windspeed, "Calibri", 12, "white", 9,106);
  320. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_windspeed")+" "+winddisplay, "Calibri", 12, "white", 120,106);
  321. txtAlign.align = 2;
  322. document.getElementById("bg").addTextObject(lang.observationpoint, "Calibri", 12, "white", 9,118);
  323. var txtAlign = bg.addTextObject(observationpoint, "Calibri", 12, "white", 119,118);
  324. txtAlign.align = 2;
  325.  
  326. }else{
  327.  
  328. document.getElementById("bg").addTextObject(lang.skytext, "Calibri", 12, "white", 10,71);
  329. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_skytext"), "Calibri", 12, "white", 120,71);
  330. txtAlign.align = 2;
  331.  
  332. document.getElementById("bg").addTextObject(lang.feelslike, "Calibri", 12, "white", 10,83);
  333. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_feelslike")+"░"+CF_var, "Calibri", 12, "white", 121,83);
  334. txtAlign.align = 2;
  335. document.getElementById("bg").addTextObject(lang.humidity, "Calibri", 12, "white", 10,95);
  336. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_humidity")+"%", "Calibri", 12, "white", 122,95);txtAlign.align = 2;
  337. document.getElementById("bg").addTextObject(lang.windspeed, "Calibri", 12, "white", 10,107);
  338. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_windspeed")+" "+winddisplay, "Calibri", 12, "white", 121,107);
  339. txtAlign.align = 2;
  340. document.getElementById("bg").addTextObject(lang.observationpoint, "Calibri", 12, "white", 10,118);
  341. var txtAlign = bg.addTextObject(observationpoint, "Calibri", 12, "white", 120,119);
  342. txtAlign.align = 2;
  343. /*black*/
  344. document.getElementById("bg").addTextObject(lang.skytext, "Calibri", 12, "black", 9,70);
  345. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_skytext"), "Calibri", 12, "black", 119,70);
  346. txtAlign.align = 2;
  347. document.getElementById("bg").addTextObject(lang.feelslike, "Calibri", 12, "black", 9,82);
  348. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_feelslike")+"░"+CF_var, "Calibri", 12, "black", 120,82);
  349. txtAlign.align = 2;
  350. document.getElementById("bg").addTextObject(lang.humidity, "Calibri", 12, "black", 9,94);
  351. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_humidity")+"%", "Calibri", 12, "black", 121,94);txtAlign.align = 2;
  352. document.getElementById("bg").addTextObject(lang.windspeed, "Calibri", 12, "black", 9,106);
  353. var txtAlign = bg.addTextObject(System.Gadget.Settings.read("current_windspeed")+" "+winddisplay, "Calibri", 12, "black", 120,106);
  354. txtAlign.align = 2;
  355. document.getElementById("bg").addTextObject(lang.observationpoint, "Calibri", 12, "black", 9,119);
  356. var txtAlign = bg.addTextObject(observationpoint, "Calibri", 12, "black", 119,118);
  357. txtAlign.align = 2;
  358. /*black*/
  359.  
  360. /*
  361. document.getElementById("bg").addTextObject(lang.observationpoint, "Calibri", 12, "white", 9,126);
  362. var txtAlign = bg.addTextObject(observationpoint, "Calibri", 12, "white", 119,126);txtAlign.align = 2;
  363. */
  364.  
  365.  
  366. if(System.Gadget.Settings.read("txtcolor") == '1')
  367. {
  368.  
  369. /*black*/
  370. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast1_day"), "Calibri", 12, "black", 50,146);
  371. var tz1 = System.Gadget.Settings.read("forecast1_low")+"░ / "+System.Gadget.Settings.read("forecast1_high")+"░";
  372. document.getElementById("bg").addTextObject(tz1, "Calibri", 12, "black", 51,158);
  373.  
  374. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast2_day"), "Calibri", 12, "black", 50,177);
  375. var tz2 = System.Gadget.Settings.read("forecast2_low")+"░ / "+System.Gadget.Settings.read("forecast2_high")+"░";
  376. document.getElementById("bg").addTextObject(tz2, "Calibri", 12, "black", 51,189);
  377.  
  378. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast3_day"), "Calibri", 12, "black", 50,208);
  379. var tz3 = System.Gadget.Settings.read("forecast3_low")+"░ / "+System.Gadget.Settings.read("forecast3_high")+"░";
  380. document.getElementById("bg").addTextObject(tz3, "Calibri", 12, "black", 51,220);
  381.  
  382. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast4_day"), "Calibri", 12, "black", 50,239);
  383. var tz4 = System.Gadget.Settings.read("forecast4_low")+"░ / "+System.Gadget.Settings.read("forecast4_high")+"░";
  384. document.getElementById("bg").addTextObject(tz4, "Calibri", 12, "black", 51,251);
  385. /*black*/
  386.  
  387. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast1_day"), "Calibri", 12, "white", 49,145);
  388. var tz1 = System.Gadget.Settings.read("forecast1_low")+"░ / "+System.Gadget.Settings.read("forecast1_high")+"░";
  389. document.getElementById("bg").addTextObject(tz1, "Calibri", 12, "white", 50,157);
  390. bg.addImageObject("img/m"+styley+"/"+System.Gadget.Settings.read("forecast1_skycodeday")+".png", 15, 146);
  391.  
  392.  
  393. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast2_day"), "Calibri", 12, "white", 49,176);
  394. var tz2 = System.Gadget.Settings.read("forecast2_low")+"░ / "+System.Gadget.Settings.read("forecast2_high")+"░";
  395. document.getElementById("bg").addTextObject(tz2, "Calibri", 12, "white", 50,188);
  396. bg.addImageObject("img/m"+styley+"/"+System.Gadget.Settings.read("forecast2_skycodeday")+".png", 15, 177);
  397.  
  398.  
  399. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast3_day"), "Calibri", 12, "white", 49,207);
  400. var tz3 = System.Gadget.Settings.read("forecast3_low")+"░ / "+System.Gadget.Settings.read("forecast3_high")+"░";
  401. document.getElementById("bg").addTextObject(tz3, "Calibri", 12, "white", 50,219);
  402. bg.addImageObject("img/m"+styley+"/"+System.Gadget.Settings.read("forecast3_skycodeday")+".png", 15, 208);
  403.  
  404.  
  405. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast4_day"), "Calibri", 12, "white", 49,238);
  406. var tz4 = System.Gadget.Settings.read("forecast4_low")+"░ / "+System.Gadget.Settings.read("forecast4_high")+"░";
  407. document.getElementById("bg").addTextObject(tz4, "Calibri", 12, "white", 50,250);
  408. bg.addImageObject("img/m"+styley+"/"+System.Gadget.Settings.read("forecast4_skycodeday")+".png", 15, 239);
  409.  
  410. }else{
  411.  
  412. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast1_day"), "Calibri", 12, "white", 50,146);
  413. var tz1 = System.Gadget.Settings.read("forecast1_low")+"░ / "+System.Gadget.Settings.read("forecast1_high")+"░";
  414. document.getElementById("bg").addTextObject(tz1, "Calibri", 12, "white", 51,158);
  415.  
  416. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast2_day"), "Calibri", 12, "white", 50,177);
  417. var tz2 = System.Gadget.Settings.read("forecast2_low")+"░ / "+System.Gadget.Settings.read("forecast2_high")+"░";
  418. document.getElementById("bg").addTextObject(tz2, "Calibri", 12, "white", 51,189);
  419.  
  420. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast3_day"), "Calibri", 12, "white", 50,208);
  421. var tz3 = System.Gadget.Settings.read("forecast3_low")+"░ / "+System.Gadget.Settings.read("forecast3_high")+"░";
  422. document.getElementById("bg").addTextObject(tz3, "Calibri", 12, "white", 51,220);
  423.  
  424. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast4_day"), "Calibri", 12, "white", 50,239);
  425. var tz4 = System.Gadget.Settings.read("forecast4_low")+"░ / "+System.Gadget.Settings.read("forecast4_high")+"░";
  426. document.getElementById("bg").addTextObject(tz4, "Calibri", 12, "white", 51,251);
  427.  
  428.  
  429.  
  430. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast1_day"), "Calibri", 12, "black", 49,145);
  431. var tz1 = System.Gadget.Settings.read("forecast1_low")+"░ / "+System.Gadget.Settings.read("forecast1_high")+"░";
  432. document.getElementById("bg").addTextObject(tz1, "Calibri", 12, "black", 50,157);
  433. bg.addImageObject("img/m"+styley+"/"+System.Gadget.Settings.read("forecast1_skycodeday")+".png", 15, 146);
  434.  
  435.  
  436. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast2_day"), "Calibri", 12, "black", 49,176);
  437. var tz2 = System.Gadget.Settings.read("forecast2_low")+"░ / "+System.Gadget.Settings.read("forecast2_high")+"░";
  438. document.getElementById("bg").addTextObject(tz2, "Calibri", 12, "black", 50,188);
  439. bg.addImageObject("img/m"+styley+"/"+System.Gadget.Settings.read("forecast2_skycodeday")+".png", 15, 177);
  440.  
  441.  
  442. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast3_day"), "Calibri", 12, "black", 49,207);
  443. var tz3 = System.Gadget.Settings.read("forecast3_low")+"░ / "+System.Gadget.Settings.read("forecast3_high")+"░";
  444. document.getElementById("bg").addTextObject(tz3, "Calibri", 12, "black", 50,219);
  445. bg.addImageObject("img/m"+styley+"/"+System.Gadget.Settings.read("forecast3_skycodeday")+".png", 15, 208);
  446.  
  447.  
  448. document.getElementById("bg").addTextObject(System.Gadget.Settings.read("forecast4_day"), "Calibri", 12, "black", 49,238);
  449. var tz4 = System.Gadget.Settings.read("forecast4_low")+"░ / "+System.Gadget.Settings.read("forecast4_high")+"░";
  450. document.getElementById("bg").addTextObject(tz4, "Calibri", 12, "black", 50,250);
  451. bg.addImageObject("img/m"+styley+"/"+System.Gadget.Settings.read("forecast4_skycodeday")+".png", 15, 239);
  452.  
  453. }
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463. }
  464. function settingsClosed(p_event) {
  465.     //OK clicked?
  466.     if (p_event.closeAction == p_event.Action.commit) {
  467.         //yes, read settings here
  468.         load();
  469.     }
  470. }