/*! Instromet Climatica script file Updates from Cumulus realtime.txt file Created by Mark Crossley July 2013 Copyright ©2013 Prodata Weather Systems Version Date Author Comments 0.0 21/09/13 M Crossley Initial beta release 0.1 21/09/13 M Crossley Fix for IE 10 initial screen resizing. 0.2 24/09/13 M Crossley Added check of number of fields in realtime.txt 0.3 24/09/13 M Crossley Amended realtime.txt response handling Amended CSS handling on page load to avoid flashing scroll bars 0.4 30/09/13 M Crossley Amended JQuery Ajax call to remove depreciated success call Changed to using long polling methods to fetch realtime.txt via PHP Changed baroInd to use fast transition post load 0.4b 02/10/13 M Crossley Added realtime update interval back in to add delay to long poll requests 0.5 07/10/13 M Crossley Delay display until we also get the windspeed gauge loaded 0.5a 07/10/13 M Crossley Delay load of pupup background by 1s 0.6 08/10/13 M Crossley Change CSS attributes to remove scroll bars on page load Rearrange HTML structure Add data indicator to top left 0.10 10/10/13 M Crossley New revision using batched up wind values Added option for extra wind pointer to show avg or gust values 0.11 17/10/13 M Crossley Added checks for angle changes before attempting to animate pointers 0.12 29/11/13 M Crossley Fixed rounding errors on wind speed conversions 0.13 30/12/13 M Crossley Fixed triggering of multiple data GETs when the settings were displayed 0.14 20/11/15 M Crossley Changed some 'magic' numbers in offsets to calculated values Made the small red pointers slightly longer to reach outer scale Added some fade in/out effects to the pop-ups Added a kludgy iframe to detect window scrollbar show/hide Added alternate barometer scales - mb, hPA, kPa 0.15 24/11/15 M Crossley Added additional 'undefined' check to the data response in getData.done() 0.16 26/11/15 M Crossley Fixed some meory leaks on setTimeout calls 0.17 23/04/17 M Crossley Fixed "sunny now" flag */ "option strict";var instrometConfig={hasTempSensor:!0,hasRainSensor:!0,hasSunSensor:!0,hasHumiditySensor:!0,hasWetDrySensor:!1,./realtimeDataFile:"/test/getClimaticaDataTest3.php",./realtimeUpdateInt:5,monthNames:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]},instromet;instromet=function(){var wt="0.16 - 26/11/15",t={},e,ot,lt=0,bt=Math.max(Math.min(instrometConfig../realtimeUpdateInt-20,25),.5),st,o,kt=0,r=0,s=0,d=0,y=0,g=0,nt=0,tt=0,it=0,rt=0,ut=!1,at=!0,vt,p,ft,f=90,n={tempUnit:"",rainUnit:"",baroUnit:"",windUnit:"",extrasOption:"",baroInd:"min",windPtr:""},i={tempUnit:"",rainUnit:"",baroUnit:"",windUnit:""},dt=function(){var r=!1,o=!1,e=document.createElement("iframe");e.id="hacky-scrollbar-resize-listener";e.style.cssText="height: 0; background-color: transparent; margin: 0; padding: 0; overflow: hidden; border-width: 0; position: absolute; width: 100%;";e.onload=function(){e.contentWindow.addEventListener("resize",function(){try{var n=new UIEvent("resize");window.dispatchEvent(n)}catch(t){}})};document.body.appendChild(e);n=di("instromet_options")||n;i.tempUnit=t.UoM.temp;n.tempUnit=n.tempUnit?n.tempUnit:i.tempUnit;instrometConfig.hasTempSensor?l("rad_unitsTemp",n.tempUnit):$("#setupTemp").css("opacity",.4);i.rainUnit=t.UoM.rain;n.rainUnit=n.rainUnit?n.rainUnit:i.rainUnit;instrometConfig.hasRainSensor?l("rad_unitsRain",n.rainUnit):$("#setupRain").css("opacity",.4);i.windUnit=t.UoM.wind;n.windUnit=n.windUnit?n.windUnit:i.windUnit;l("rad_unitsWind",n.windUnit);switch(n.windUnit){case"mph":f=90;$("#imgSpdDial").attr("src").indexOf("mph")===-1&&($("#imgSpdDial").attr("src","./images/mph.png"),r=!0);break;case"kts":f=78.21;$("#imgSpdDial").attr("src").indexOf("mph")===-1&&($("#imgSpdDial").attr("src","./images/mph.png"),r=!0);break;case"km/h":f=150;$("#imgSpdDial").attr("src").indexOf("kph")===-1&&($("#imgSpdDial").attr("src","./images/kph.png"),r=!0);break;case"m/s":f=41.67;$("#imgSpdDial").attr("src").indexOf("mps")===-1&&($("#imgSpdDial").attr("src","./images/mps.png"),r=!0)}i.baroUnit=t.UoM.press;n.baroUnit=n.baroUnit?n.baroUnit:i.baroUnit;l("rad_unitsBaro",n.baroUnit);switch(n.baroUnit){case"mb":$("#imgBarDial").attr("src").indexOf("mb")===-1&&($("#imgBarDial").attr("src","./images/mb.png"),o=!0);break;case"hPa":$("#imgBarDial").attr("src").indexOf("hpa")===-1&&($("#imgBarDial").attr("src","./images/hpa.png"),o=!0);break;case"kPa":$("#imgBarDial").attr("src").indexOf("kpa")===-1&&($("#imgBarDial").attr("src","./images/kpa.png"),o=!0)}n.extrasOption=n.extrasOption?n.extrasOption:"avg";l("rad_unitsExtras",n.extrasOption);n.extrasOption==="std"&&$("#imgDirAvgPtrShad, #imgDirAvgPtr, #imgSpdAvgPtrShad, #imgSpdAvgPtr").hide();n.windPtr=n.windPtr?n.windPtr:"wGust";l("rad_windExtra",n.windPtr);n.baroInd=t.pressH-t.press>t.press-t.pressL?"max":"min";$("#imgBarBoss").click(function(){ii();et()});u($("#imgStation"));u($("#imgDirAvgPtrShad"));u($("#imgDirAvgPtr"));u($("#imgDirPtrShad"));u($("#imgDirPtr"));u($("#imgSpdAvgPtrShad"));u($("#imgSpdAvgPtr"));u($("#imgSpdPtrShad"));u($("#imgSpdPtr"));u($("#imgBarPtrShad"));u($("#imgBarPtrShad"));u($("#imgBarPtr"));u($("#imgBarInd1Shad"));u($("#imgBarInd1Ptr"));u($("#imgBarBoss"));u($("#imgInfo"));r?$("#imgSpdDial").load(function(){b()}):o?$("#imgBarDial").load(function(){b()}):b();w();$("#version").text(wt);navigator.appVersion.indexOf("rv:11")&&b();setTimeout(function(){$("").attr("src","./images/popupBackground.png")},1e3);at=!1},u=function(n){var t=new Image;t.src=n.attr("src");n.data("nativeSize",{height:t.height,width:t.width})},h=function(){k(0);ot=$.ajax({url:instrometConfig../realtimeDataFile+"?timestamp="+lt,datatype:"json",cache:!1}).done(function(n){if(typeof n.data.date=="undefined"||n.data.date.substr(0,5)==="Error"){ft=setTimeout(function(){h()},1e3);k(1);return}n.data.numRec>0?(k(2),t=n.data,lt=n.timestamp,at&&dt(),et(!1)):k(1);ft=setTimeout(function(){h()},bt*1e3)}).fail(function(){ot.statusText!=="abort"&&(ft=setTimeout(function(){h()},5e3));k(1)})},et=function(u){var f,e,h,l,a,s;u=typeof u=="boolean"?u:!1;u||clearInterval(p);st=Math.round(1e3*instrometConfig../realtimeUpdateInt*.9/t.numRec);s=Math.min(Math.round(st/1e3*.8*100)/100,5);s!==o&&($("#imgDirAvgPtrShad, #imgDirAvgPtr, #imgDirPtrShad, #imgDirPtr, #imgSpdAvgPtrShad, #imgSpdAvgPtr, #imgSpdPtrShad, #imgSpdPtr").css(tr(s)),o=s);h=v(+t.press,i.baroUnit,"mb");l=v(+t.pressL,i.baroUnit,"mb");a=v(+t.pressH,i.baroUnit,"mb");e=(h-950)/100*270-135;f=((n.baroInd==="min"?l:a)-950)/100*270-135;kt++;ut?(it!==e&&($("#imgBarPtr, #imgBarPtrShad").rotate({animateTo:e,duration:o}),it=e),rt!==f&&($("#imgBarInd1Ptr, #imgBarInd1Shad").rotate({animateTo:f,duration:o}),rt=f)):(it!==e&&($("#imgBarPtr, #imgBarPtrShad").css(c(e)),it=e),rt!==f&&($("#imgBarInd1Ptr, #imgBarInd1Shad").css(c(f)),rt=f));r=u?r:0;t.numRec>1&&!u&&(p=setInterval(function(){yt(o,!1)},st));yt(o,u)},yt=function(u,e){var h,l,v,w,o,s,b,k;if(r>=t.numRec){r=t.numRec-1;clearInterval(p);return}b=n.windPtr==="wAvg"?a(+t.windA[r],i.windUnit,n.windUnit):a(+t.windG[r],i.windUnit,n.windUnit);k=a(+t.wind[r],i.windUnit,n.windUnit);h=k/f*270-135;l=b/f*270-135;v=+t.windB[r];w=+t.windAB[r];v===0&&(v=y);o=v-y;o>180?o-=360:o<-180&&(o+=360);y+=o;s=w-g;s>180?s-=360:s<-180&&(s+=360);g+=s;ut?(o!==0&&$("#imgDirPtr, #imgDirPtrShad").rotate({animateTo:y,duration:u}),h!==nt&&($("#imgSpdPtr, #imgSpdPtrShad").rotate({animateTo:h,duration:u}),nt=h),n.extrasOption==="avg"&&(s!==0&&$("#imgDirAvgPtr, #imgDirAvgPtrShad").rotate({animateTo:g,duration:u}),tt!==l&&($("#imgSpdAvgPtr, #imgSpdAvgPtrShad").rotate({animateTo:l,duration:u}),tt=l))):(o!==0&&$("#imgDirPtr, #imgDirPtrShad").css(c(y)),h!==nt&&($("#imgSpdPtr, #imgSpdPtrShad").css(c(h)),nt=h),n.extrasOption==="avg"&&(s!==0&&$("#imgDirAvgPtr, #imgDirAvgPtrShad").css(c(g)),tt!==l&&($("#imgSpdAvgPtr, #imgSpdAvgPtrShad").css(c(l)),tt=l)));e||(r++,r>=t.numRec&&(r=t.numRec-1,clearInterval(p)))},w=function(){var u,f,e,y,o=n.tempUnit,c=n.rainUnit,h=n.baroUnit,l=n.windUnit,p=o==="C"?"℃":"℉";switch(s){case 0:if(instrometConfig.hasTempSensor)u=ht(+t.temp,i.tempUnit,o),f=ht(+t.tempL,i.tempUnit,o),e=ht(+t.tempH,i.tempUnit,o),$("#lcd1").html("AIR TEMP= "+u+p),$("#lcd2").html("MIN= "+f+" MAX= "+e);else{s=1;w();return}break;case 1:u=v(+t.pressL,i.baroUnit,h);f=v(+t.pressH,i.baroUnit,h);$("#lcd1").html("BARO MIN= "+u+h);$("#lcd2").html("BARO MAX= "+f+h);break;case 2:if(instrometConfig.hasRainSensor)u=ct(t.rain,i.rainUnit,c),f=ct(t.rainM,i.rainUnit,c),e=t.date,y=ct(t.rainY,i.rainUnit,c),$("#lcd1").html("RAIN TODAY = "+" ".repeat(6-u.length)+u+c),$("#lcd2").html(instrometConfig.monthNames[+e.substr(3,2)-1]+"= "+" ".repeat(6-f.length)+f+" YR="+" ".repeat(6-y.length)+y);else{s=3;w();return}break;case 3:if(instrometConfig.hasSunSensor)u=t.sun,f=t.sunny===1?"YES":"NO",$("#lcd1").html("SUN TODAY= "+u+"HRS"),$("#lcd2").html("SUN SHINING= "+f);else{s=4;w();return}break;case 4:u=instrometConfig.hasTempSensor?gi(+t.tempT,i.tempUnit,o):"---";f=v(+t.pressT,i.baroUnit,h,2);$("#lcd1").html("TEMP TRND= "+(+u>0?"+":"")+u+"/hr");$("#lcd2").html("BARO TRND= "+(+f>0?"+":"")+f+"/hr");break;case 5:u=a(+t.wind[r],i.windUnit,l);f=a(+t.windA[r],i.windUnit,l);e=a(+t.windG[r],i.windUnit,l);$("#lcd1").html("WIND SPEED - "+u+l);$("#lcd2").html("GUST= "+Math.round(e)+" AVERAGE= "+Math.round(f));break;case 6:u=t.windAB[r];f=ir(u);u="00"+u;u=u.substr(u.length-3);u!=="000"&&(u+="°");$("#lcd1").html("WIND DIRECTION");$("#lcd2").html("PREVAILING= "+u+" ("+f+")");break;case 7:u=instrometConfig.hasHumiditySensor?t.hum:"--";f=t.time;$("#lcd1").html("HUMIDITY NOW= "+u+"%");$("#lcd2").html("TIME= "+f)}s=(s+1)%8;window.setTimeout(function(){w()},5e3)},pt=function(){clearTimeout(ft);ot.abort();clearInterval(p)},b=function(){var t=$("#imgStation").width(),i=$("#imgStation").height(),n=t/$("#imgStation").data("nativeSize").width;$("#imgStation").css({visibility:"visible",display:"inline"});$("#imgSpdDial, #imgBarDial").removeClass("absolute").css({position:"absolute",display:"block"});$("#imgDirAvgPtrShad").css({top:Math.round(i*(360-$("#imgDirAvgPtrShad").data("nativeSize").height/2)/724+n*3),left:Math.round(t*(345-$("#imgDirAvgPtrShad").data("nativeSize").width/2)/1513+n*3),width:Math.round($("#imgDirAvgPtrShad").data("nativeSize").width*n),height:Math.round($("#imgDirAvgPtrShad").data("nativeSize").height*n),display:"block"});$("#imgDirAvgPtr").css({top:Math.round(i*(360-$("#imgDirAvgPtr").data("nativeSize").height/2)/724),left:Math.round(t*(345-$("#imgDirAvgPtr").data("nativeSize").width/2)/1513),width:Math.round($("#imgDirAvgPtr").data("nativeSize").width*n),height:Math.round($("#imgDirAvgPtr").data("nativeSize").height*n),display:"block"});$("#imgDirPtrShad").css({top:Math.round(i*(360-$("#imgDirPtrShad").data("nativeSize").height/2)/724+n*4),left:Math.round(t*(345-$("#imgDirPtrShad").data("nativeSize").width/2)/1513+n*4),width:Math.round($("#imgDirPtrShad").data("nativeSize").width*n),height:Math.round($("#imgDirPtrShad").data("nativeSize").height*n),display:"block"});$("#imgDirPtr").css({top:Math.round(i*(360-$("#imgDirPtr").data("nativeSize").height/2)/724),left:Math.round(t*(345-$("#imgDirPtr").data("nativeSize").width/2)/1513),width:Math.round($("#imgDirPtr").data("nativeSize").width*n),height:Math.round($("#imgDirPtr").data("nativeSize").height*n),display:"block"});$("#imgSpdAvgPtrShad").css({top:Math.round(i*(360-$("#imgSpdAvgPtrShad").data("nativeSize").height/2)/724+n*3),left:Math.round(t*(1179-$("#imgSpdAvgPtrShad").data("nativeSize").width/2)/1513+n*3),width:Math.round($("#imgSpdAvgPtrShad").data("nativeSize").width*n),height:Math.round($("#imgSpdAvgPtrShad").data("nativeSize").height*n),display:"block"});$("#imgSpdAvgPtr").css({top:Math.round(i*(360-$("#imgSpdAvgPtr").data("nativeSize").height/2)/724),left:Math.round(t*(1179-$("#imgSpdAvgPtr").data("nativeSize").width/2)/1513),width:Math.round($("#imgSpdAvgPtr").data("nativeSize").width*n),height:Math.round($("#imgSpdAvgPtr").data("nativeSize").height*n),display:"block"});$("#imgSpdPtrShad").css({top:Math.round(i*(360-$("#imgSpdPtrShad").data("nativeSize").height/2)/724+n*3),left:Math.round(t*(1179-$("#imgSpdPtrShad").data("nativeSize").width/2)/1513+n*3),width:Math.round($("#imgSpdPtrShad").data("nativeSize").width*n),height:Math.round($("#imgSpdPtrShad").data("nativeSize").height*n),display:"block"});$("#imgSpdPtr").css({top:Math.round(i*(360-$("#imgSpdPtr").data("nativeSize").height/2)/724),left:Math.round(t*(1179-$("#imgSpdPtr").data("nativeSize").width/2)/1513),width:Math.round($("#imgSpdPtr").data("nativeSize").width*n),height:Math.round($("#imgSpdPtr").data("nativeSize").height*n),display:"block"});$("#imgBarPtrShad").css({top:Math.round(i*(317-$("#imgBarPtrShad").data("nativeSize").height/2)/724+n*3),left:Math.round(t*(761-$("#imgBarPtrShad").data("nativeSize").width/2)/1513+n*3),width:Math.round($("#imgBarPtrShad").data("nativeSize").width*n),height:Math.round($("#imgBarPtrShad").data("nativeSize").height*n),display:"block"});$("#imgBarPtr").css({top:Math.round(i*(317-$("#imgBarPtr").data("nativeSize").height/2)/724),left:Math.round(t*(761-$("#imgBarPtr").data("nativeSize").width/2)/1513),width:Math.round($("#imgBarPtr").data("nativeSize").width*n),height:Math.round($("#imgBarPtr").data("nativeSize").height*n),display:"block"});$("#imgBarInd1Shad").css({top:Math.round(i*(317-$("#imgBarInd1Shad").data("nativeSize").height/2)/724+n*4),left:Math.round(t*(761-$("#imgBarInd1Shad").data("nativeSize").width/2)/1513+n*4),width:Math.round($("#imgBarInd1Shad").data("nativeSize").width*n),height:Math.round($("#imgBarInd1Shad").data("nativeSize").height*n),display:"block"});$("#imgBarInd1Ptr").css({top:Math.round(i*(317-$("#imgBarInd1Ptr").data("nativeSize").height/2)/724),left:Math.round(t*(761-$("#imgBarInd1Ptr").data("nativeSize").width/2)/1513),width:Math.round($("#imgBarInd1Ptr").data("nativeSize").width*n),height:Math.round($("#imgBarInd1Ptr").data("nativeSize").height*n),display:"block"});$("#imgBarBoss").css({top:Math.round(i*(317-$("#imgBarBoss").data("nativeSize").height/2)/724),left:Math.round(t*(761-$("#imgBarBoss").data("nativeSize").width/2)/1513),width:Math.round($("#imgBarBoss").data("nativeSize").width*n),height:Math.round($("#imgBarBoss").data("nativeSize").height*n),display:"block"});$("#lcd1").css({top:Math.round(i*.7461),left:Math.round(t*.4164),fontSize:Math.round(19*n),display:"block"});$("#lcd2").css({top:Math.round(i*.7755),left:Math.round(t*.4164),fontSize:Math.round(19*n),display:"block"});$("#imgInfo").css({width:Math.round(24*n+4),height:Math.round(24*n+4),display:"block"});$("#loading").remove()},gt=function(){e=$('
');e.appendTo(document.body);$("#settings").click(function(){ni()});$("#imgInfo").click(function(){ti()});$(".settingsPopupContent").drags()},ni=function(){var n=$("#setupContent");pt();$("#popupContent").append(n);e.fadeIn(500);$(".settingsPopup").fadeIn(500);$("#close, .x").unbind("click");$("#close, .x").click(function(t){return t.stopImmediatePropagation(),$(".settingsPopup").fadeOut(500,function(){$("#popupContentHolder").append($(n))}),e.fadeOut(500),h(),!1})},ti=function(){var n=$("#infoContent");$("#popupContent").append(n);e.fadeIn(500);$(".settingsPopup").fadeIn(500);$(".x").unbind("click");$(".x").click(function(t){return t.stopImmediatePropagation(),$(".settingsPopup").fadeOut(500,function(){$("#popupContentHolder").append($(n))}),e.fadeOut(500),!1})},c=function(n){return{transform:"rotate("+n+"deg)","-webkit-transform":"rotate("+n+"deg)","-moz-transform":"rotate("+n+"deg)","-ms-transform":"rotate("+n+"deg)"}},ii=function(){pt();$("#imgBarInd1Ptr").hasClass("slowTransition")&&$("#imgBarInd1Ptr, #imgBarInd1Shad").removeClass("slowTransition").addClass("fastTransition");n.baroInd=n.baroInd==="min"?"max":"min";et(!0);setTimeout(function(){h()},1e3)},k=function(n){var t="#F00";clearTimeout(vt);switch(n){case 0:t="#666";break;case 1:t="#F00";break;case 2:t="#0D0"}$("#dataInd").css("background-color",t);n!==0&&(vt=setTimeout(function(){$("#dataInd").css("background-color","")},600))},ri=function(n){return(n*9/5+32).toFixed(1)},ui=function(n){return((n-32)*5/9).toFixed(1)},fi=function(n){return n*.447},ei=function(n){return n*.515},oi=function(n){return n*.2778},si=function(n){return(n*1.9426).toFixed(1)},hi=function(n){return(n*2.237).toFixed(1)},ci=function(n){return(n*3.6).toFixed(1)},li=function(n){return n.toFixed(1)},ai=function(n){return(n/25.4).toFixed(2)},vi=function(n){return(n*25.4).toFixed(1)},yi=function(n,t){return t=t||2,(n*.029528744).toFixed(t)},pi=function(n){return(n/.029528744).toFixed(1)},wi=function(n){return(n*10).toFixed(1)},bi=function(n,t){return t=t||2,(n/10).toFixed(t)},ki=function(n,t){var r,i=new Date;i.setYear(i.getFullYear()+1);r="; expires="+i.toGMTString();document.cookie=n+"="+encodeURIComponent(JSON.stringify(t))+r},di=function(n){for(var t,r,u=null,f=document.cookie.split(";"),i=f.length;i--;)if(t=f[i].split("="),t[0].trim()===n){try{r=decodeURIComponent(t[1])}catch(e){r=t[1]}u=JSON.parse(unescape(r));break}return u},l=function(n,t){$('input:radio[name="'+n+'"]').filter('[value="'+t+'"]').attr("checked",!0)},ht=function(n,t,i){return t==="C"&&i==="F"?ri(n):t==="F"&&i==="F"?ui(n):n.toFixed(1)},gi=function(n,t,i){return t==="C"&&i==="F"?(n*1.8).toFixed(1):t==="F"&&i==="F"?(n/1.8).toFixed(1):n.toFixed(1)},ct=function(n,t,i){return t==="mm"&&i==="in"?ai(n):t==="in"&&i==="mm"?vi(n):i==="in"?n.toFixed(2):n.toFixed(1)},a=function(n,t,i){var r,u,f=function(n){return(+n).toFixed(1)};switch(t){case"mph":r=fi;break;case"kts":r=ei;break;case"km/h":r=oi;break;case"m/s":default:r=f}switch(i){case"mph":u=hi;break;case"kts":u=si;break;case"km/h":u=ci;break;case"m/s":default:u=li}return u(r(n))},v=function(n,t,i,r){var u,f,e=function(n,t){return(+n).toFixed(t)};r=r||(i==="hPa"||i==="mb"?1:2);switch(t){case"hPa":case"mb":u=e;break;case"inHg":u=pi;break;case"kPa":u=wi}switch(i){case"hPa":case"mb":f=e;break;case"inHg":f=yi;break;case"kPa":f=bi}return f(u(n,r),r)},nr=function(t){switch(t.value){case"C":case"F":n.tempUnit=t.value;break;case"mm":case"in":n.rainUnit=t.value;break;case"hPa":$("#imgBarDial").attr("src","./images/hpa.png");n.baroUnit=t.value;break;case"inHg":case"mb":$("#imgBarDial").attr("src","./images/mb.png");n.baroUnit=t.value;break;case"kPa":$("#imgBarDial").attr("src","./images/kpa.png");n.baroUnit=t.value;break;case"km/h":f=150;$("#imgSpdDial").attr("src","./images/kph.png");n.windUnit=t.value;break;case"m/s":f=41.67;$("#imgSpdDial").attr("src","./images/mps.png");n.windUnit=t.value;break;case"mph":f=90;$("#imgSpdDial").attr("src","./images/mph.png");n.windUnit=t.value;break;case"kts":f=78.21;$("#imgSpdDial").attr("src","./images/mph.png");n.windUnit=t.value;break;case"avg":case"std":n.extrasOption=t.value;n.extrasOption==="std"?$("#imgDirAvgPtrShad, #imgDirAvgPtr, #imgSpdAvgPtrShad, #imgSpdAvgPtr").hide():$("#imgDirAvgPtrShad, #imgDirAvgPtr, #imgSpdAvgPtrShad, #imgSpdAvgPtr").show();break;case"wAvg":case"wGust":n.windPtr=t.value}ki("instromet_options",n);et(!0)},tr=function(n){return{transition:"transform "+n+"s ease-in-out","-webkit-transition":"-webkit-transform "+n+"s ease-in-out","-moz-transition":"-moz-transform "+n+"s ease-in-out","-ms-transition":"-ms-transform "+n+"s ease-in-out","-o-transition":"-o-transform "+n+"s ease-in-out"}},ir=function(n){return n===0?"calm":["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.floor((n+11.25)/22.5)%16]};return String.prototype.repeat=String.prototype.repeat||function(n){for(var i="",t=this.valueOf();n>0;)n&1&&(i+=t),n>>=1,t+=t;return i},$(window).load(function(){/*@cc_on@if(@_jscript_version<=9)ut=!0;@else@end@*/ut&&($("#img_spd_ptr, #img_spd_shad").rotate(-135),$("#img_spd_avg_ptr, #img_spd_avg_shad").rotate(-135),$("#img_ind_ptr, #img_ind_shad").rotate(-135));d=$("#imgStation").width();$("").attr("src",d<800?"./images/climatica_small_frame.png":"./images/climatica_frame.png").load(function(){$("#imgStation").attr("src",$(this).attr("src")).css("cursor","auto");h()});gt();$(window).resize(function(){d<800&&$("#imgStation").width()>800&&(d=$("#imgStation").width(),$("#imgStation").attr("src","./images/climatica_frame.png"));b()})}),{changeOptions:nr}}(),function(n){n.fn.drags=function(t){var i;t=n.extend({handle:""},t);i=t.handle===""?this:this.find(t.handle);return i.css("cursor",t.cursor).on("mousedown",function(i){var r=t.handle===""?n(this).addClass("draggable"):n(this).addClass("active-handle").parent().addClass("draggable");var e=r.css("z-index"),u=r.outerHeight(),f=r.outerWidth(),o=r.offset().top+u-i.pageY,s=r.offset().left+f-i.pageX;r.css("z-index",1e3).parents().on("mousemove",function(t){n(".draggable").offset({top:t.pageY+o-u,left:t.pageX+s-f}).on("mouseup",function(){n(this).removeClass("draggable").css("z-index",e)})});i.preventDefault()}).on("mouseup",function(){t.handle===""?n(this).removeClass("draggable"):n(this).removeClass("active-handle").parent().removeClass("draggable")})}}(jQuery) //# sourceMappingURL=climatica.min.js.map