HydsViewer.COMPONENTS={CLOCK:0,DETAIL_WINDOW:1,GENERAL_WINDOW:2,PALETTE:3,VALUE:4,CLOCK_DATE:5,ANIMATION_CONTROL:6,BOXES:7,SCALE:8};HydsViewer.LAYERS_TYPE={BASE:0,WMS:1,RASTER:2,LIGHTNING_ALARM:3,LIGHTNING:4,STATIONS:5,VECTOR:6,GML:7,RAD_TRAM:8,QUALITY:9,GRATICULE:10,LIGHTNING_ALARM_MEDUSA:11,CB_TRAM:12,METAR_TAF:13,HYDROALERT_ALARM:14};function HydsViewer(d,a,b,c){if(!HydsViewer.Instances){HydsViewer.Instances=new Array()}this.id=HydsViewer.Instances.length;HydsViewer.Instances[this.id]=this;this.locale;this.olMap;this.olResolutions;this.div_name;this.layers=null;this.components=null;this.has_layers=true;this.original_extent=null;this.extent=null;this.coords=null;this.x=0;this.y=0;this.offset=0;this.measured_frames;this.forecasted_frames;this.total_frames;this.start_epoch;this.now_epoch;this.current_frame;this.current_frame_epoch;this.frame_duration;this.is_animation_running;this.setCenter=setCenter;this.setZoom=setZoom;this.getZoom=getZoom;this.zoomUp=zoomUp;this.zoomDown=zoomDown;this.setLocale=setLocale;this.addLayer=addLayer;this.setLayerOpacity=setLayerOpacity;this.getLayerOpacity=getLayerOpacity;this.setLayerVisibility=setLayerVisibility;this.getLayerVisibility=getLayerVisibility;this.setLayerPosition=setLayerPosition;this.getLayerType=getLayerType;this.removeLayer=removeLayer;this.addLightning=addLightning;this.addStation=addStation;this.addMetar=addMetar;this.addPoint=addPoint;this.modifyPoint=modifyPoint;this.addQualityPoint=addQualityPoint;this.addRegion=addRegion;this.addLine=addLine;this.adaptZone=adaptZone;this.fitToLayer=fitToLayer;this.recalcCenter=recalcCenter;this.addComponent=addComponent;this.removeComponent=removeComponent;this.addLayersToComponent=addLayersToComponent;this.setPaletteProduct=setPaletteProduct;this.setValues=setValues;this.addBox=addBox;this.removeBox=removeBox;this.init=initHV;this.initialize=initializeHV;this.loadBaseLayer=loadBase;this.updateFrame=updateFrame;this.setPause=setPause;this.setPlay=setPlay;this.recalcLayersAndComponents=recalcLayersAndComponents;this.repaintLayers=repaintLayers;this.recalcPositions=recalcPositions;this.setAnimationParams=setAnimationParamsAn;this.setNowEpoch=setNowEpochAn;this.setFrame=setFrameAn;this.start=startAn;this.stop=stopAn;this.pause=pauseAn;this.getTotalFrames=getTotalFramesAn;this.getStartEpoch=getStartEpochAn;this.getNowEpoch=getNowEpochAn;this.getCurrentEpoch=getCurrentEpochAn;this.getMeasuredFrames=getMeasuredFramesAn;this.getFrameDuration=getFrameDurationAn;this.timeOut=timeOutAn;this.updateSizeDestroy=null;setImagesArray();this.init(d,a,b);if(c!=undefined){this.initialize(c)}}function setCenter(b,a){this.x=b;this.y=a;this.recalcCenter()}function setZoom(a){this.olMap.setCenter(this.olMap.getCenter(),a);this.recalcCenter();this.repaintLayers()}function getZoom(){return this.olMap.getZoom()}function zoomUp(){var a=this.olMap.getZoom();this.olMap.setCenter(this.olMap.getCenter(),a-1);this.recalcCenter();this.repaintLayers()}function zoomDown(){var a=this.olMap.getZoom();this.olMap.setCenter(this.olMap.getCenter(),a+1);this.recalcCenter();this.repaintLayers()}function initHV(e,a,b){this.locale=a;this.div_name=e;this.layers=new Array();this.components=new Array();this.olResolutions=new Array();for(var d=0;d<=MAX_ZOOM_LEVEL;d++){this.olResolutions[d]=5/32768*Math.pow(2,d)}this.minResolution=this.olResolutions[0];this.maxResolution=this.olResolutions[this.olResolutions.length-1];var c={controls:[],projection:new OpenLayers.Projection("EPSG:"+b),tileSize:new OpenLayers.Size(256,256),resolutions:this.olResolutions};this.olMap=new OpenLayers.Map(this.div_name,c);this.olMap.fractionalZoom=true;if(OpenLayers.String.contains(navigator.appName,"Microsoft")){this.events.register("resize",this,this.repaintLayers)}else{this.updateSizeDestroy=OpenLayers.Function.bind(this.repaintLayers,this);OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)}this.loadBaseLayer();this.setAnimationParams(0,0,1);this.setNowEpoch(0);window.setInterval("HydsViewer.Instances["+this.id+"].timeOut()",ANIMATION_DURATION)}function initializeHV(c){if(c.options.centerX!=undefined&&c.options.centerY!=undefined){this.setCenter(c.options.centerX,c.options.centerY)}if(c.zoomLevel!=undefined){this.setZoom(c.zoomLevel)}if(c.baseLayerUrl!=undefined&&c.baseLayerName!=undefined){this.addLayer(c.baseLayerName,HydsViewer.LAYERS_TYPE.BASE,c.baseLayerUrl)}if(c.options.backward!=undefined&&c.options.forward!=undefined&&c.options.duration!=undefined&&c.options.lastObservation!=undefined){this.setAnimationParams(c.options.backward,c.options.forward,c.options.duration);this.setNowEpoch(c.options.lastObservation)}if(c.showClock!=undefined&&c.showClock){this.addComponent(HydsViewer.COMPONENTS.CLOCK)}if(c.showGeneralWindow!=undefined&&c.showGeneralWindowUrl!=undefined&&c.showGeneralWindowName!=undefined&&c.showGeneralWindow){this.addComponent(HydsViewer.COMPONENTS.GENERAL_WINDOW,c.showGeneralWindowUrl,c.showGeneralWindowName)}if(c.showDetailWindow!=undefined&&c.showDetailWindowUrl!=undefined&&c.showDetailWindowName!=undefined&&c.showDetailWindow){this.addComponent(HydsViewer.COMPONENTS.DETAIL_WINDOW,c.showDetailWindowUrl,c.showDetailWindowName)}if(c.showValues!=undefined&&c.showValues){this.addComponent(HydsViewer.COMPONENTS.VALUE,SIGN_VALUES);this.setValues([c.values,c.slaveValues])}if(c.showPalette!=undefined&&c.options.paletteUrl!=undefined&&c.showPalette){this.addComponent(HydsViewer.COMPONENTS.PALETTE);this.setPaletteProduct(c.options.paletteUrl)}if(c.base_layers!=undefined){for(var e=0;e<c.base_layers.length;e++){var g=c.base_layers[e];if(g.overProducts!=undefined&&!g.overProducts){if(g.url!=undefined&&g.name!=undefined){this.addLayer(g.name,HydsViewer.LAYERS_TYPE.BASE,g.url);if(g.opacity!=undefined){this.setLayerOpacity(g.name,g.opacity)}}}}}if(c.options.product_layers!=undefined){for(var e=0;e<c.options.product_layers.length;e++){var h=c.options.product_layers[e];if(h!=undefined){switch(h.type){case"satellite":case"accumulation_window":case"radcast":case"reflectivity":case"hydroalert":this.addLayer(h.layerName,h.layerType,h.layerUrl,h.layerCoords);this.setLayerOpacity(h.layerName,h.opacity);break}}}}if(c.base_layers!=undefined){for(var e=0;e<c.base_layers.length;e++){var g=c.base_layers[e];if(g.overProducts!=undefined&&g.overProducts){if(g.url!=undefined&&g.name!=undefined){this.addLayer(g.name,HydsViewer.LAYERS_TYPE.BASE,g.url);if(g.opacity!=undefined){this.setLayerOpacity(g.name,g.opacity)}}}}}if(c.showGraticule){this.addLayer("graticule",HydsViewer.LAYERS_TYPE.GRATICULE)}if(c.options.product_layers!=undefined){for(var e=0;e<c.options.product_layers.length;e++){var h=c.options.product_layers[e];switch(h.type){case"lightning":this.addLayer(h.layerName,h.layerType);for(var d=0;d<h.lightnings.length;d++){var b=h.lightnings[d];this.addLightning(h.layerName,b.x,b.y,b.time)}break;case"lightning_alarm":case"rad-tram_alarm":case"cb-tram_alarm":this.addLayer(h.layerName,h.layerType,h.alarms);break;case"hydroalert_alarm":this.addLayer(h.layerName,h.layerType,h.angles);break;case"rad-tram":case"cb-tram":this.addLayer(h.layerName,h.layerType,h.trams);break;case"points":this.addLayer(h.layerName,h.layerType);for(var d=0;d<h.coords.length;d++){var a=h.coords[d].lon;var k=h.coords[d].lat;var m=(c.options.centerX==a)&&(c.options.centerY==k);this.addPoint(h.layerName,a,k,h.idPoint[d],h.colors[d],m)}break;case"metar":this.addLayer(h.layerName,h.layerType);for(var d=0;d<h.metars.length;d++){this.addMetar(h.layerName,h.metars[d])}break}}}if(c.showBoxes!=undefined&&c.showBoxes){this.addComponent(HydsViewer.COMPONENTS.BOXES);if(c.options.boxes!=undefined){for(var e=0;e<c.options.boxes.length;e++){var f=c.options.boxes[e];this.addBox(f.boxName,f.boxText,f.boxColor,f.boxFrames)}}}}function loadBase(){var b=new OpenLayers.Bounds();b.extend(new OpenLayers.LonLat(-180,90));b.extend(new OpenLayers.LonLat(180,-90));b.toBBOX();var a=new OpenLayers.Layer.Image("baseLayer",BASELAYER_IMAGE,b,new OpenLayers.Size(4096,4096),{minResolution:this.olResolutions[0],maxResolution:this.olResolutions[this.olResolutions.length-1],isBaseLayer:true,buffer:1,gutter:0});this.olMap.addLayer(a)}function recalcLayersAndComponents(){if(this.layers!=null){for(var a=0;a<this.layers.length;a++){this.layers[a].reloadLayers(this)}recalcPositions()}if(this.components!=null){for(var a=0;a<this.components.length;a++){this.components[a].reloadComponent(this)}}}function repaintLayers(){if(this.layers!=null){for(var a=0;a<this.layers.length;a++){this.layers[a].repaintLayer()}}if(this.components!=null){for(var a=0;a<this.components.length;a++){this.components[a].repaintLayers()}}this.setFrame(this.getCurrentEpoch())}function setImagesArray(){if(typeof(productInformationCache)!="undefined"){imagesUrl="/images/lib/HydsViewer/components/controlAnimation/"}else{imagesUrl="images/components/controlAnimation/"}}function getFileName(f){var c=new Date();c.setTime(f*1000);var e=c.getUTCFullYear();var g=toStringNumber(c.getUTCMonth()+1,2);var b=toStringNumber(c.getUTCDate(),2);var a=toStringNumber(c.getUTCHours(),2);var d=toStringNumber(c.getUTCMinutes(),2);return e+""+g+""+b+""+a+""+d}function getDate(d){var b=new Date();b.setTime(d*1000);var c=b.getFullYear();var e=toStringNumber(b.getMonth()+1,2);var a=toStringNumber(b.getDate(),2);return a+"/"+e+"/"+c}function getTime(d){var b=new Date();b.setTime(d*1000);var a=toStringNumber(b.getHours(),2);var c=toStringNumber(b.getMinutes(),2);var e=a+":"+c;return e}function toStringNumber(d,c){var a=parseInt(d);var b=""+d;while(a<Math.pow(10,c-1)){b="0"+b;a=a*10;if(a==0){a=10}}return b}function degree2Rad(a){return Math.PI*a/180}var MAX_ZOOM_LEVEL=9;var BASELAYER_IMAGE="/images/baseLayer.jpg";var LIGHTNING_WIDTH=10;var LIGHTNING_HEIGHT=10;var LIGHTNING_IMAGE="/images/lightning.png";var ANIMATION_DURATION=1000;var PRODUCTS_PATH="http://localhost/products/";var LAYERS_INIT_POSITION=10000;var COMPONENTS_INIT_POSITION=20000;var WINDOW_SIZE=150;var styleDefault=new OpenLayers.StyleMap({"default":new OpenLayers.Style({fillColor:"#ffffff",strokeColor:"blue",strokeWidth:"${p_stroke}",graphicZIndex:1,fillOpacity:1,pointRadius:"${p_radius}",cursor:"pointer"}),temporary:new OpenLayers.Style({fillColor:"yellow",strokeColor:"#AEAF0A",strokeWidth:2,graphicZIndex:2,label:"${name}",fontColor:"#111111",fontSize:"15px",fontFamily:"Arial,Helvetica",fontWeight:"bold",labelYOffset:10}),select:new OpenLayers.Style({fillColor:"yellow",strokeColor:"#AEAF0A",strokeWidth:2,graphicZIndex:2})});var styleStation=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleStation.fillColor="white";styleStation.fillOpacity=1;styleStation.strokeColor="black";styleStation.strokeOpacity=1;styleStation.strokeWidth=1;styleStation.pointRadius=5;var stylePointIn=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);stylePointIn.fillColor="white";stylePointIn.fillOpacity=1;stylePointIn.strokeColor="white";stylePointIn.strokeOpacity=0;stylePointIn.strokeWidth=1;stylePointIn.pointRadius=6;var stylePointOut=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);stylePointOut.fillColor="white";stylePointOut.fillOpacity=0.5;stylePointOut.strokeColor="white";stylePointOut.strokeOpacity=1;stylePointOut.strokeWidth=4;stylePointOut.pointRadius=12;var styleRegion=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleRegion.fillColor="white";styleRegion.fillOpacity=0.5;styleRegion.strokeColor="white";styleRegion.strokeOpacity=1;styleRegion.strokeWidth=2;var styleRadTram=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleRadTram.fillColor="black";styleRadTram.fillOpacity=0.5;styleRadTram.strokeColor="black";styleRadTram.strokeOpacity=1;styleRadTram.strokeWidth=2;var styleRadTramForecast=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleRadTramForecast.fillColor="101010";styleRadTramForecast.fillOpacity=0.5;styleRadTramForecast.strokeColor="#101010";styleRadTramForecast.strokeOpacity=1;styleRadTramForecast.strokeWidth=2;var styleCbTramYellow=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleCbTramYellow.fillColor="yellow";styleCbTramYellow.fillOpacity=0.5;styleCbTramYellow.strokeColor="yellow";styleCbTramYellow.strokeOpacity=1;styleCbTramYellow.strokeWidth=2;var styleCbTramOrange=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleCbTramOrange.fillColor="orange";styleCbTramOrange.fillOpacity=0.5;styleCbTramOrange.strokeColor="orange";styleCbTramOrange.strokeOpacity=1;styleCbTramOrange.strokeWidth=2;var styleCbTramRed=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleCbTramRed.fillColor="red";styleCbTramRed.fillOpacity=0.5;styleCbTramRed.strokeColor="red";styleCbTramRed.strokeOpacity=1;styleCbTramRed.strokeWidth=2;var styleHydroalertCircle1=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleHydroalertCircle1.fillColor="white";styleHydroalertCircle1.fillOpacity=0;styleHydroalertCircle1.strokeColor="#289cb0";styleHydroalertCircle1.strokeOpacity=1;styleHydroalertCircle1.strokeWidth=1;styleHydroalertCircle1.pointRadius=5;var styleHydroalertCircle2=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleHydroalertCircle2.fillColor="white";styleHydroalertCircle2.fillOpacity=0;styleHydroalertCircle2.strokeColor="#1778ad";styleHydroalertCircle2.strokeOpacity=1;styleHydroalertCircle2.strokeWidth=2;styleHydroalertCircle2.pointRadius=5;var styleHydroalertCircle3=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleHydroalertCircle3.fillColor="white";styleHydroalertCircle3.fillOpacity=0;styleHydroalertCircle3.strokeColor="#004081";styleHydroalertCircle3.strokeOpacity=1;styleHydroalertCircle3.strokeWidth=3;styleHydroalertCircle3.pointRadius=5;var styleHydroalertSemiCircle=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);styleHydroalertSemiCircle.fillColor="white";styleHydroalertSemiCircle.fillOpacity=0.5;styleHydroalertSemiCircle.strokeColor="white";styleHydroalertSemiCircle.strokeOpacity=0;styleHydroalertSemiCircle.strokeWidth=0;styleHydroalertSemiCircle.pointRadius=5;var LIGHTNING_ALARM_NO_ALERT_IN_COLOR="#2f4f4f";var LIGHTNING_ALARM_NO_ALERT_OUT_COLOR="#736F6E";var LIGHTNING_ALARM_ALERT_IN_FORECAST_COLOR="red";var LIGHTNING_ALARM_ALERT_OUT_FORECAST_COLOR="yellow";var LIGHTNING_ALARM_NO_ALERT_STROKE_OPACITY=1;var LIGHTNING_ALARM_NO_ALERT_FILL_OPACITY=0;var LIGHTNING_ALARM_ALERT_STROKE_OPACITY=1;var LIGHTNING_ALARM_ALERT_FILL_OPACITY=0.4;var LIGHTNING_FRAME_DURATION=30*60;var TRAM_FRAME_DURATION=60*60;var HYDROALERT_OBJECTS=new Array();HYDROALERT_OBJECTS[0]="POLYGON(())";HYDROALERT_OBJECTS[1]="POLYGON((-0.1232050 0.0855600, -0.1252066 0.0826034, -0.1271372 0.0795999, -0.1289957 0.0765513, -0.1307812 0.0734593, -0.1324926 0.0703257, -0.1341289 0.0671523, -0.1356893 0.0639408, -0.1371727 0.0606931, -0.1385784 0.0574110, -0.1399056 0.0540964, -0.1411536 0.0507511, -0.1423215 0.0473771, -0.1434088 0.0439762, -0.1444149 0.0405504, -0.1453391 0.0371017, -0.1461810 0.0336319, -0.1469401 0.0301430, -0.1476159 0.0266371, -0.1482081 0.0231161, -0.1487163 0.0195820, -0.1491403 0.0160368, -0.1494797 0.0124825, -0.1497345 0.0089211, -0.1499044 0.0053547, -0.1499894 0.0017853, -0.1499894 -0.0017852, -0.1499044 -0.0053546, -0.1497345 -0.0089210, -0.1494797 -0.0124824, -0.1491403 -0.0160367, -0.1487163 -0.0195819, -0.1482081 -0.0231160, -0.1476160 -0.0266370, -0.1469402 -0.0301429, -0.1461811 -0.0336318, -0.1453392 -0.0371016, -0.1444149 -0.0405503, -0.1434089 -0.0439761, -0.1423215 -0.0473770, -0.1411536 -0.0507510, -0.1399057 -0.0540963, -0.1385785 -0.0574109, -0.1371727 -0.0606930, -0.1356893 -0.0639407, -0.1341290 -0.0671522, -0.1324927 -0.0703256, -0.1307813 -0.0734592, -0.1289958 -0.0765512, -0.1271372 -0.0795998, -0.1252066 -0.0826033, -0.1232051 -0.0855599, -0.1174658 -0.0821376, -0.1119608 -0.0787152, -0.1066900 -0.0752928, -0.1016535 -0.0718704, -0.0968513 -0.0684480, -0.0922832 -0.0650256, -0.0879495 -0.0616032, -0.0838500 -0.0581808, -0.0799848 -0.0547584, -0.0763538 -0.0513360, -0.0729571 -0.0479136, -0.0697947 -0.0444912, -0.0668665 -0.0410688, -0.0641725 -0.0376464, -0.0617128 -0.0342240, -0.0594874 -0.0308016, -0.0574962 -0.0273792, -0.0557393 -0.0239568, -0.0542166 -0.0205344, -0.0529282 -0.0171120, -0.0518741 -0.0136896, -0.0510542 -0.0102672, -0.0504685 -0.0068448, -0.0501171 -0.0034224, -0.0500000 0.0000000, -0.0501171 0.0034224, -0.0504685 0.0068448, -0.0510542 0.0102672, -0.0518741 0.0136896, -0.0529282 0.0171120, -0.0542166 0.0205344, -0.0557393 0.0239568, -0.0574962 0.0273792, -0.0594874 0.0308016, -0.0617128 0.0342240, -0.0641725 0.0376464, -0.0668665 0.0410688, -0.0697947 0.0444912, -0.0729571 0.0479136, -0.0763538 0.0513360, -0.0799848 0.0547584, -0.0838500 0.0581808, -0.0879495 0.0616032, -0.0922832 0.0650256, -0.0968513 0.0684480, -0.1016535 0.0718704, -0.1066900 0.0752928, -0.1119608 0.0787152, -0.1174658 0.0821376, -0.1232051 0.0855600))";HYDROALERT_OBJECTS[2]="POLYGON((-0.0816625 0.1258223, -0.0865091 0.1225405, -0.0912240 0.1190722, -0.0958000 0.1154225, -0.1002301 0.1115971, -0.1045076 0.1076018, -0.1086260 0.1034427, -0.1125790 0.0991260, -0.1163606 0.0946584, -0.1199650 0.0900467, -0.1233867 0.0852979, -0.1266205 0.0804191, -0.1296616 0.0754180, -0.1325052 0.0703019, -0.1351471 0.0650789, -0.1375832 0.0597568, -0.1398098 0.0543437, -0.1418235 0.0488478, -0.1436212 0.0432775, -0.1452003 0.0376414, -0.1465583 0.0319479, -0.1476931 0.0262058, -0.1486031 0.0204238, -0.1492867 0.0146107, -0.1497431 0.0087753, -0.1499715 0.0029266, -0.1499715 -0.0029266, -0.1497431 -0.0087753, -0.1492867 -0.0146107, -0.1486031 -0.0204238, -0.1476931 -0.0262058, -0.1465583 -0.0319479, -0.1452003 -0.0376414, -0.1436212 -0.0432775, -0.1418235 -0.0488478, -0.1398098 -0.0543436, -0.1375832 -0.0597568, -0.1351471 -0.0650789, -0.1325052 -0.0703019, -0.1296616 -0.0754179, -0.1266206 -0.0804191, -0.1233867 -0.0852978, -0.1199650 -0.0900467, -0.1163606 -0.0946584, -0.1125790 -0.0991260, -0.1086261 -0.1034426, -0.1045077 -0.1076018, -0.1002302 -0.1115971, -0.0958000 -0.1154225, -0.0912240 -0.1190721, -0.0865092 -0.1225405, -0.0816625 -0.1258222, -0.0791801 -0.1207893, -0.0767991 -0.1157565, -0.0745194 -0.1107236, -0.0723410 -0.1056907, -0.0702640 -0.1006578, -0.0682882 -0.0956249, -0.0664138 -0.0905920, -0.0646407 -0.0855591, -0.0629689 -0.0805262, -0.0613985 -0.0754933, -0.0599294 -0.0704604, -0.0585615 -0.0654276, -0.0572950 -0.0603947, -0.0561299 -0.0553618, -0.0550660 -0.0503289, -0.0541035 -0.0452960, -0.0532422 -0.0402631, -0.0524823 -0.0352302, -0.0518238 -0.0301973, -0.0512665 -0.0251644, -0.0508106 -0.0201316, -0.0504559 -0.0150987, -0.0502026 -0.0100658, -0.0500507 -0.0050329, -0.0500000 0.0000000, -0.0500507 0.0050329, -0.0502026 0.0100658, -0.0504559 0.0150987, -0.0508106 0.0201316, -0.0512665 0.0251644, -0.0518238 0.0301973, -0.0524823 0.0352302, -0.0532422 0.0402631, -0.0541035 0.0452960, -0.0550660 0.0503289, -0.0561299 0.0553618, -0.0572950 0.0603947, -0.0585615 0.0654276, -0.0599293 0.0704604, -0.0613985 0.0754933, -0.0629689 0.0805262, -0.0646407 0.0855591, -0.0664138 0.0905920, -0.0682882 0.0956249, -0.0702640 0.1006578, -0.0723410 0.1056907, -0.0745194 0.1107236, -0.0767991 0.1157565, -0.0791801 0.1207893, -0.0816625 0.1258222))";HYDROALERT_OBJECTS[3]="POLYGON((-0.0283010 0.1473060, -0.0362331 0.1455581, -0.0440591 0.1433834, -0.0517558 0.1407883, -0.0593007 0.1377804, -0.0666718 0.1343684, -0.0738474 0.1305625, -0.0808065 0.1263737, -0.0875286 0.1218144, -0.0939940 0.1168979, -0.1001839 0.1116387, -0.1060800 0.1060520, -0.1116651 0.1001545, -0.1169227 0.0939632, -0.1218375 0.0874965, -0.1263950 0.0807731, -0.1305820 0.0738130, -0.1343860 0.0666364, -0.1377960 0.0592644, -0.1408019 0.0517187, -0.1433950 0.0440212, -0.1455677 0.0361948, -0.1473134 0.0282621, -0.1486273 0.0202466, -0.1495053 0.0121718, -0.1499450 0.0040612, -0.1499450 -0.0040612, -0.1495053 -0.0121717, -0.1486273 -0.0202466, -0.1473135 -0.0282621, -0.1455677 -0.0361947, -0.1433950 -0.0440212, -0.1408019 -0.0517186, -0.1377960 -0.0592644, -0.1343860 -0.0666364, -0.1305820 -0.0738130, -0.1263950 -0.0807731, -0.1218375 -0.0874964, -0.1169227 -0.0939632, -0.1116651 -0.1001544, -0.1060800 -0.1060520, -0.1001839 -0.1116386, -0.0939941 -0.1168979, -0.0875286 -0.1218144, -0.0808065 -0.1263737, -0.0738474 -0.1305625, -0.0666719 -0.1343684, -0.0593008 -0.1377803, -0.0517558 -0.1407883, -0.0440591 -0.1433834, -0.0362332 -0.1455581, -0.0283010 -0.1473060, -0.0300022 -0.1414137, -0.0316339 -0.1355215, -0.0331963 -0.1296292, -0.0346892 -0.1237370, -0.0361126 -0.1178448, -0.0374666 -0.1119525, -0.0387512 -0.1060603, -0.0399664 -0.1001680, -0.0411121 -0.0942758, -0.0421884 -0.0883836, -0.0431952 -0.0824913, -0.0441326 -0.0765991, -0.0450005 -0.0707069, -0.0457991 -0.0648146, -0.0465282 -0.0589224, -0.0471878 -0.0530301, -0.0477780 -0.0471379, -0.0482988 -0.0412457, -0.0487501 -0.0353534, -0.0491320 -0.0294612, -0.0494445 -0.0235690, -0.0496875 -0.0176767, -0.0498611 -0.0117845, -0.0499653 -0.0058922, -0.0500000 0.0000000, -0.0499653 0.0058922, -0.0498611 0.0117845, -0.0496875 0.0176767, -0.0494445 0.0235690, -0.0491320 0.0294612, -0.0487501 0.0353534, -0.0482988 0.0412457, -0.0477780 0.0471379, -0.0471878 0.0530301, -0.0465281 0.0589224, -0.0457991 0.0648146, -0.0450005 0.0707069, -0.0441326 0.0765991, -0.0431952 0.0824913, -0.0421883 0.0883836, -0.0411121 0.0942758, -0.0399664 0.1001680, -0.0387512 0.1060603, -0.0374666 0.1119525, -0.0361126 0.1178448, -0.0346892 0.1237370, -0.0331963 0.1296292, -0.0316339 0.1355215, -0.0300022 0.1414137, -0.0283010 0.1473060))";HYDROALERT_OBJECTS[4]="POLYGON((0.0166667 0.1490712, 0.0068039 0.1498456, -0.0030885 0.1499682, -0.0129674 0.1494384, -0.0227900 0.1482586, -0.0325133 0.1464339, -0.0420953 0.1439722, -0.0514942 0.1408842, -0.0606690 0.1371834, -0.0695800 0.1328858, -0.0781882 0.1280102, -0.0864564 0.1225777, -0.0943485 0.1166120, -0.1018301 0.1101391, -0.1088688 0.1031871, -0.1154340 0.0957862, -0.1214970 0.0879687, -0.1270315 0.0797685, -0.1320134 0.0712213, -0.1364210 0.0623643, -0.1402353 0.0532360, -0.1434395 0.0438761, -0.1460198 0.0343254, -0.1479649 0.0246253, -0.1492663 0.0148182, -0.1499184 0.0049465, -0.1499184 -0.0049466, -0.1492663 -0.0148182, -0.1479649 -0.0246253, -0.1460198 -0.0343254, -0.1434395 -0.0438761, -0.1402353 -0.0532359, -0.1364211 -0.0623642, -0.1320134 -0.0712212, -0.1270315 -0.0797685, -0.1214970 -0.0879687, -0.1154340 -0.0957862, -0.1088688 -0.1031871, -0.1018301 -0.1101391, -0.0943485 -0.1166120, -0.0864564 -0.1225777, -0.0781882 -0.1280102, -0.0695800 -0.1328858, -0.0606690 -0.1371834, -0.0514942 -0.1408842, -0.0420953 -0.1439722, -0.0325134 -0.1464339, -0.0227900 -0.1482586, -0.0129674 -0.1494385, -0.0030885 -0.1499682, 0.0068039 -0.1498456, 0.0166667 -0.1490712, 0.0114400 -0.1431084, 0.0064267 -0.1371455, 0.0016267 -0.1311827, -0.0029600 -0.1252198, -0.0073333 -0.1192570, -0.0114933 -0.1132941, -0.0154400 -0.1073313, -0.0191733 -0.1013684, -0.0226933 -0.0954056, -0.0260000 -0.0894427, -0.0290933 -0.0834799, -0.0319733 -0.0775170, -0.0346400 -0.0715542, -0.0370933 -0.0655913, -0.0393333 -0.0596285, -0.0413600 -0.0536656, -0.0431733 -0.0477028, -0.0447733 -0.0417399, -0.0461600 -0.0357771, -0.0473333 -0.0298142, -0.0482933 -0.0238514, -0.0490400 -0.0178885, -0.0495733 -0.0119257, -0.0498933 -0.0059628, -0.0500000 0.0000000, -0.0498933 0.0059629, -0.0495733 0.0119257, -0.0490400 0.0178885, -0.0482933 0.0238514, -0.0473333 0.0298142, -0.0461600 0.0357771, -0.0447733 0.0417399, -0.0431733 0.0477028, -0.0413600 0.0536656, -0.0393333 0.0596285, -0.0370933 0.0655913, -0.0346400 0.0715542, -0.0319733 0.0775170, -0.0290933 0.0834799, -0.0260000 0.0894427, -0.0226933 0.0954056, -0.0191733 0.1013684, -0.0154400 0.1073313, -0.0114933 0.1132941, -0.0073333 0.1192570, -0.0029600 0.1252198, 0.0016267 0.1311827, 0.0064267 0.1371455, 0.0114400 0.1431084, 0.0166667 0.1490712))";HYDROALERT_OBJECTS[5]="POLYGON((0.0500000 0.1414214, 0.0392734 0.1447674, 0.0283264 0.1473011, 0.0172204 0.1490082, 0.0060178 0.1498792, -0.0052185 0.1499092, -0.0164256 0.1490980, -0.0275405 0.1474501, -0.0385008 0.1449748, -0.0492451 0.1416860, -0.0597131 0.1376021, -0.0698460 0.1327461, -0.0795870 0.1271452, -0.0888814 0.1208309, -0.0976770 0.1138385, -0.1059245 0.1062073, -0.1135777 0.0979802, -0.1205935 0.0892032, -0.1269326 0.0799257, -0.1325594 0.0701997, -0.1374424 0.0600798, -0.1415542 0.0496227, -0.1448716 0.0388872, -0.1473761 0.0279335, -0.1490536 0.0168231, -0.1498948 0.0056182, -0.1498948 -0.0056182, -0.1490536 -0.0168231, -0.1473761 -0.0279336, -0.1448716 -0.0388873, -0.1415542 -0.0496228, -0.1374424 -0.0600798, -0.1325594 -0.0701998, -0.1269325 -0.0799258, -0.1205935 -0.0892032, -0.1135776 -0.0979802, -0.1059245 -0.1062074, -0.0976770 -0.1138385, -0.0888814 -0.1208309, -0.0795869 -0.1271453, -0.0698460 -0.1327461, -0.0597130 -0.1376022, -0.0492451 -0.1416860, -0.0385008 -0.1449748, -0.0275404 -0.1474501, -0.0164255 -0.1490980, -0.0052185 -0.1499092, 0.0060178 -0.1498792, 0.0172205 -0.1490082, 0.0283264 -0.1473011, 0.0392734 -0.1447674, 0.0500000 -0.1414213, 0.0421600 -0.1357645, 0.0346400 -0.1301077, 0.0274400 -0.1244508, 0.0205600 -0.1187939, 0.0140000 -0.1131371, 0.0077600 -0.1074802, 0.0018400 -0.1018234, -0.0037600 -0.0961665, -0.0090400 -0.0905097, -0.0140000 -0.0848528, -0.0186400 -0.0791960, -0.0229600 -0.0735391, -0.0269600 -0.0678823, -0.0306400 -0.0622254, -0.0340000 -0.0565685, -0.0370400 -0.0509117, -0.0397600 -0.0452548, -0.0421600 -0.0395980, -0.0442400 -0.0339411, -0.0460000 -0.0282843, -0.0474400 -0.0226274, -0.0485600 -0.0169706, -0.0493600 -0.0113137, -0.0498400 -0.0056569, -0.0500000 0.0000000, -0.0498400 0.0056569, -0.0493600 0.0113137, -0.0485600 0.0169706, -0.0474400 0.0226274, -0.0460000 0.0282843, -0.0442400 0.0339411, -0.0421600 0.0395980, -0.0397600 0.0452548, -0.0370400 0.0509117, -0.0340000 0.0565685, -0.0306400 0.0622254, -0.0269600 0.0678823, -0.0229600 0.0735391, -0.0186400 0.0791960, -0.0140000 0.0848528, -0.0090400 0.0905097, -0.0037600 0.0961665, 0.0018400 0.1018234, 0.0077600 0.1074802, 0.0140000 0.1131371, 0.0205600 0.1187939, 0.0274400 0.1244508, 0.0346400 0.1301077, 0.0421600 0.1357645, 0.0500000 0.1414214))";HYDROALERT_OBJECTS[6]="POLYGON((0.0794727 0.1272167, 0.0685859 0.1334015, 0.0572212 0.1386569, 0.0454579 0.1429461, 0.0333777 0.1462393, 0.0210650 0.1485135, 0.0086056 0.1497530, -0.0039139 0.1499489, -0.0164060 0.1491001, -0.0287839 0.1472124, -0.0409612 0.1442989, -0.0528530 0.1403801, -0.0643767 0.1354830, -0.0754517 0.1296420, -0.0860010 0.1228976, -0.0959511 0.1152969, -0.1052326 0.1068929, -0.1137809 0.0977441, -0.1215364 0.0879142, -0.1284451 0.0774717, -0.1344588 0.0664894, -0.1395356 0.0550439, -0.1436401 0.0432148, -0.1467438 0.0310846, -0.1488250 0.0187379, -0.1498693 0.0062605, -0.1498693 -0.0062605, -0.1488250 -0.0187378, -0.1467438 -0.0310846, -0.1436401 -0.0432148, -0.1395356 -0.0550439, -0.1344588 -0.0664895, -0.1284450 -0.0774717, -0.1215364 -0.0879142, -0.1137809 -0.0977441, -0.1052327 -0.1068929, -0.0959511 -0.1152970, -0.0860010 -0.1228976, -0.0754517 -0.1296420, -0.0643766 -0.1354830, -0.0528531 -0.1403800, -0.0409612 -0.1442989, -0.0287839 -0.1472124, -0.0164060 -0.1491001, -0.0039139 -0.1499489, 0.0086056 -0.1497529, 0.0210650 -0.1485135, 0.0333777 -0.1462393, 0.0454578 -0.1429461, 0.0572212 -0.1386569, 0.0685859 -0.1334016, 0.0794727 -0.1272167, 0.0693220 -0.1221280, 0.0595857 -0.1170394, 0.0502637 -0.1119507, 0.0413559 -0.1068620, 0.0328625 -0.1017734, 0.0247834 -0.0966847, 0.0171186 -0.0915960, 0.0098682 -0.0865074, 0.0030320 -0.0814187, -0.0033898 -0.0763300, -0.0093974 -0.0712413, -0.0149906 -0.0661527, -0.0201695 -0.0610640, -0.0249341 -0.0559753, -0.0292844 -0.0508867, -0.0332203 -0.0457980, -0.0367420 -0.0407093, -0.0398493 -0.0356207, -0.0425424 -0.0305320, -0.0448211 -0.0254433, -0.0466855 -0.0203547, -0.0481356 -0.0152660, -0.0491714 -0.0101773, -0.0497928 -0.0050887, -0.0500000 0.0000000, -0.0497928 0.0050887, -0.0491714 0.0101773, -0.0481356 0.0152660, -0.0466855 0.0203547, -0.0448211 0.0254433, -0.0425424 0.0305320, -0.0398493 0.0356207, -0.0367420 0.0407093, -0.0332203 0.0457980, -0.0292844 0.0508867, -0.0249341 0.0559753, -0.0201695 0.0610640, -0.0149906 0.0661527, -0.0093974 0.0712413, -0.0033898 0.0763300, 0.0030320 0.0814187, 0.0098682 0.0865074, 0.0171187 0.0915960, 0.0247834 0.0966847, 0.0328625 0.1017734, 0.0413559 0.1068620, 0.0502637 0.1119507, 0.0595857 0.1170394, 0.0693220 0.1221280, 0.0794727 0.1272167))";HYDROALERT_OBJECTS[7]="POLYGON((0.1064268 0.1057040, 0.0962043 0.1150858, 0.0851586 0.1234828, 0.0733843 0.1308233, 0.0609821 0.1370445, 0.0480581 0.1420930, 0.0347229 0.1459257, 0.0210906 0.1485099, 0.0072779 0.1498234, -0.0065971 0.1498549, -0.0204157 0.1486042, -0.0340596 0.1460820, -0.0474121 0.1423099, -0.0603589 0.1373201, -0.0727892 0.1311554, -0.0845968 0.1238684, -0.0956805 0.1155216, -0.1059455 0.1061864, -0.1153040 0.0959426, -0.1236759 0.0848779, -0.1309897 0.0730870, -0.1371826 0.0606707, -0.1422018 0.0477352, -0.1460042 0.0343913, -0.1485574 0.0207533, -0.1498395 0.0069375, -0.1498395 -0.0069376, -0.1485574 -0.0207532, -0.1460042 -0.0343914, -0.1422018 -0.0477353, -0.1371826 -0.0606706, -0.1309897 -0.0730870, -0.1236760 -0.0848779, -0.1153040 -0.0959426, -0.1059455 -0.1061864, -0.0956805 -0.1155216, -0.0845968 -0.1238685, -0.0727892 -0.1311554, -0.0603589 -0.1373201, -0.0474121 -0.1423099, -0.0340596 -0.1460820, -0.0204157 -0.1486042, -0.0065972 -0.1498549, 0.0072779 -0.1498234, 0.0210907 -0.1485099, 0.0347229 -0.1459257, 0.0480581 -0.1420930, 0.0609821 -0.1370444, 0.0733843 -0.1308233, 0.0851586 -0.1234828, 0.0962043 -0.1150858, 0.1064268 -0.1057040, 0.0941629 -0.1014759, 0.0823996 -0.0972477, 0.0711369 -0.0930195, 0.0603747 -0.0887914, 0.0501131 -0.0845632, 0.0403521 -0.0803351, 0.0310917 -0.0761069, 0.0223318 -0.0718787, 0.0140724 -0.0676506, 0.0063136 -0.0634224, -0.0009446 -0.0591943, -0.0077022 -0.0549661, -0.0139593 -0.0507379, -0.0197158 -0.0465098, -0.0249717 -0.0422816, -0.0297271 -0.0380535, -0.0339819 -0.0338253, -0.0377361 -0.0295971, -0.0409898 -0.0253690, -0.0437429 -0.0211408, -0.0459955 -0.0169126, -0.0477475 -0.0126845, -0.0489989 -0.0084563, -0.0497497 -0.0042282, -0.0500000 0.0000000, -0.0497497 0.0042282, -0.0489989 0.0084563, -0.0477475 0.0126845, -0.0459955 0.0169126, -0.0437429 0.0211408, -0.0409898 0.0253690, -0.0377361 0.0295971, -0.0339819 0.0338253, -0.0297271 0.0380535, -0.0249717 0.0422816, -0.0197158 0.0465098, -0.0139593 0.0507379, -0.0077022 0.0549661, -0.0009446 0.0591943, 0.0063136 0.0634224, 0.0140724 0.0676506, 0.0223318 0.0718787, 0.0310917 0.0761069, 0.0403521 0.0803351, 0.0501131 0.0845632, 0.0603747 0.0887914, 0.0711369 0.0930195, 0.0823997 0.0972477, 0.0941629 0.1014759, 0.1064268 0.1057040))";HYDROALERT_OBJECTS[8]="POLYGON((0.1245683 0.0835627, 0.1156010 0.0955846, 0.1054779 0.1066509, 0.0943003 0.1166510, 0.0821800 0.1254849, 0.0692381 0.1330642, 0.0556040 0.1393133, 0.0414140 0.1441696, 0.0268100 0.1475846, 0.0119379 0.1495242, -0.0030535 0.1499689, -0.0180143 0.1489144, -0.0327951 0.1463711, -0.0472480 0.1423644, -0.0612286 0.1369345, -0.0745970 0.1301356, -0.0872197 0.1220358, -0.0989704 0.1127159, -0.1097316 0.1022691, -0.1193959 0.0907999, -0.1278665 0.0784230, -0.1350588 0.0652620, -0.1409008 0.0514486, -0.1453342 0.0371209, -0.1483147 0.0224220, -0.1498124 0.0074990, -0.1498124 -0.0074990, -0.1483147 -0.0224220, -0.1453342 -0.0371209, -0.1409008 -0.0514486, -0.1350587 -0.0652620, -0.1278665 -0.0784230, -0.1193959 -0.0907999, -0.1097316 -0.1022691, -0.0989704 -0.1127159, -0.0872197 -0.1220358, -0.0745970 -0.1301357, -0.0612285 -0.1369345, -0.0472480 -0.1423644, -0.0327951 -0.1463711, -0.0180143 -0.1489144, -0.0030534 -0.1499689, 0.0119379 -0.1495242, 0.0268100 -0.1475846, 0.0414140 -0.1441696, 0.0556040 -0.1393133, 0.0692381 -0.1330642, 0.0821800 -0.1254849, 0.0943003 -0.1166510, 0.1054779 -0.1066509, 0.1156010 -0.0955846, 0.1245684 -0.0835627, 0.1108822 -0.0802202, 0.0977546 -0.0768777, 0.0851857 -0.0735352, 0.0731754 -0.0701927, 0.0617237 -0.0668502, 0.0508306 -0.0635077, 0.0404962 -0.0601652, 0.0307204 -0.0568227, 0.0215032 -0.0534802, 0.0128446 -0.0501377, 0.0047446 -0.0467951, -0.0027967 -0.0434526, -0.0097795 -0.0401101, -0.0162036 -0.0367676, -0.0220691 -0.0334251, -0.0273759 -0.0300826, -0.0321242 -0.0267401, -0.0363138 -0.0233976, -0.0399449 -0.0200551, -0.0430173 -0.0167125, -0.0455311 -0.0133700, -0.0474862 -0.0100275, -0.0488828 -0.0066850, -0.0497207 -0.0033425, -0.0500000 0.0000000, -0.0497207 0.0033425, -0.0488828 0.0066850, -0.0474862 0.0100275, -0.0455311 0.0133700, -0.0430173 0.0167126, -0.0399449 0.0200551, -0.0363138 0.0233976, -0.0321242 0.0267401, -0.0273759 0.0300826, -0.0220691 0.0334251, -0.0162036 0.0367676, -0.0097795 0.0401101, -0.0027967 0.0434526, 0.0047446 0.0467951, 0.0128446 0.0501377, 0.0215032 0.0534802, 0.0307204 0.0568227, 0.0404962 0.0601652, 0.0508307 0.0635077, 0.0617237 0.0668502, 0.0731754 0.0701927, 0.0851857 0.0735352, 0.0977546 0.0768777, 0.1108822 0.0802202, 0.1245683 0.0835627))";function setAnimationParamsAn(b,a,c){this.frame_duration=c;this.measured_frames=b/this.frame_duration;this.forecasted_frames=a/this.frame_duration;this.total_frames=this.measured_frames+this.forecasted_frames;this.current_frame=0;if(typeof this.now_epoch!="undefined"){this.setNowEpoch(this.now_epoch)}this.recalcLayersAndComponents()}function setNowEpochAn(a){this.now_epoch=a;this.start_epoch=this.now_epoch-(this.measured_frames*this.frame_duration)+this.frame_duration;this.current_frame_epoch=this.start_epoch+(this.current_frame*this.frame_duration);this.setFrame(this.current_frame_epoch);this.recalcLayersAndComponents()}function startAn(){this.is_animation_running=true;this.setPlay()}function pauseAn(){this.is_animation_running=false;this.setPause()}function stopAn(){this.pause();this.setFrame(this.start_epoch)}function timeOutAn(){if(!this.is_animation_running){return}var a=this.current_frame_epoch+this.frame_duration;if(this.current_frame+1==this.total_frames){a=this.start_epoch}this.setFrame(a);hydsViewer_triggerEventSetEpoch("animation_control",a)}function getTotalFramesAn(){return this.total_frames}function getStartEpochAn(){return this.start_epoch}function getFrameDurationAn(){return this.frame_duration}function getMeasuredFramesAn(){return this.measured_frames}function getCurrentEpochAn(){return this.current_frame_epoch}function getNowEpochAn(){return this.now_epoch}function setFrameAn(a){n_frame=(a-this.start_epoch)/this.frame_duration;if(n_frame==this.total_frames&&this.is_animation_running){n_frame=0;a=this.start_epoch}if(n_frame>this.total_frames||n_frame<0){console.log("[ERROR] Wrong frame time to show");return}this.current_frame=n_frame;this.current_frame_epoch=a;this.updateFrame(this.current_frame)}function hydsViewer_triggerEventSetEpoch(a,b){$(document).trigger("EVENT_SET_EPOCH",[a,b])}function hydsViewer_triggerEventSetCurrentStation(a,b){$(document).trigger("EVENT_SET_CURRENT_STATION",[a,b])}function addComponent(e,b,d){if(this.components!=null){for(var c=0;c<this.components.length;c++){if(this.components[c].getType()==e){return}}}var a;switch(e){case HydsViewer.COMPONENTS.CLOCK:a=new Clock(this.olMap,this.locale,this);this.components.push(a);break;case HydsViewer.COMPONENTS.CLOCK_DATE:a=new ClockDate(this.olMap,this.locale,this);this.components.push(a);break;case HydsViewer.COMPONENTS.GENERAL_WINDOW:a=new GeneralWindow(this.olMap,this.olResolutions[0],this.olResolutions[this.olResolutions.length-1],this.locale,b,d,this);this.components.push(a);a.setZoom(1);break;case HydsViewer.COMPONENTS.DETAIL_WINDOW:a=new DetailWindow(this.olMap,this.olResolutions[0],this.olResolutions[this.olResolutions.length-1],this.locale,b,d,this);this.components.push(a);a.setZoom(this.olResolutions.length-1);break;case HydsViewer.COMPONENTS.PALETTE:a=new Palette(this.olMap,this.locale,this);this.components.push(a);break;case HydsViewer.COMPONENTS.SCALE:a=new Scale(this.olMap,this.locale,this);this.components.push(a);break;case HydsViewer.COMPONENTS.VALUE:a=new Value(this.olMap,this.locale,b,this);this.components.push(a);break;case HydsViewer.COMPONENTS.ANIMATION_CONTROL:a=new AnimationControl(this.olMap,this.locale,this);this.components.push(a);break;case HydsViewer.COMPONENTS.BOXES:a=new Boxes(this.olMap,this.locale,this);this.components.push(a);break;default:console.log("[ERROR] Unkown component: "+e)}this.addLayersToComponent(e)}function removeComponent(b){for(var a=0;a<this.components.length;a++){if(this.components[a].getType()==b){this.components[a].remove();this.components.splice(a,1)}}this.recalcPositions()}function addLayersToComponent(d){if(this.components!=null){for(var c=0;c<this.components.length;c++){if(this.components[c].getType()==d&&this.layers!=null){for(var b=0;b<this.layers.length;b++){if(this.layers[b].getType()==HydsViewer.LAYERS_TYPE.RASTER){var e=this.layers[b].getCoords();var a=this.layers[b].getUrl();this.components[c].addLayer(this.layers[b].getName(),this.layers[b].getType(),a,e);this.components[c].setLayerOpacity(this.layers[b].getName(),this.layers[b].getOpacity())}else{if(this.layers[b].getType()==HydsViewer.LAYERS_TYPE.WMS){var e=this.layers[b].getCoords();var a=this.layers[b].getUrl();this.components[c].addLayer(this.layers[b].getName(),this.layers[b].getType(),a,e);this.components[c].setLayerOpacity(this.layers[b].getName(),this.layers[b].getOpacity())}}}}}}}function setPaletteProduct(a){if(this.components!=null){for(var b=0;b<this.components.length;b++){if(this.components[b].getType()==HydsViewer.COMPONENTS.PALETTE){this.components[b].setProduct(a)}}}}function setValues(a){if(this.components!=null){for(var b=0;b<this.components.length;b++){if(this.components[b].getType()==HydsViewer.COMPONENTS.VALUE){this.components[b].setValues(a)}}}}function addBox(b,e,d,a){if(this.components!=null){for(var c=0;c<this.components.length;c++){if(this.components[c].getType()==HydsViewer.COMPONENTS.BOXES){this.components[c].addBox(b,e,d,a)}}}}function removeBox(a){if(this.components!=null){for(var b=0;b<this.components.length;b++){if(this.components[b].getType()==HydsViewer.COMPONENTS.BOXES){this.components[b].removeBox(a)}}}}function setLocale(a){this.locale=a;if(this.components!=null){for(var b=0;b<this.components.length;b++){this.components[b].setLocale(a)}}}function setPlay(){if(this.components!=null){for(var a=0;a<this.components.length;a++){this.components[a].start()}}}function setPause(){if(this.components!=null){for(var a=0;a<this.components.length;a++){this.components[a].pause()}}}function addLayer(f,e,a,g){if(!this.has_layers){return}var d;var b=null;if(this instanceof HydsViewer){b=this}else{b=this.viewer}switch(e){case HydsViewer.LAYERS_TYPE.BASE:d=new BaseLayer(f,this.olMap,this.minResolution,this.maxResolution,a,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.WMS:d=new WmsProductLayer(f,this.olMap,this.minResolution,this.maxResolution,a,g,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);if(this instanceof HydsViewer){this.fitToLayer(g)}break;case HydsViewer.LAYERS_TYPE.RASTER:d=new RasterProductLayer(f,this.olMap,this.minResolution,this.maxResolution,a,g,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);if(this instanceof HydsViewer){this.fitToLayer(g)}break;case HydsViewer.LAYERS_TYPE.LIGHTNING_ALARM:d=new LightningAlarmLayer(f,this.olMap,this.minResolution,this.maxResolution,a,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.LIGHTNING_ALARM_MEDUSA:d=new LightningAlarmLayerMedusa(f,this.olMap,this.minResolution,this.maxResolution,a,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.HYDROALERT_ALARM:d=new HydroalertAlarmLayer(f,this.olMap,this.minResolution,this.maxResolution,a,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.LIGHTNING:d=new LightningLayer(f,this.olMap,this.minResolution,this.maxResolution,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.STATIONS:d=new StationsLayer(f,this.olMap,this.minResolution,this.maxResolution,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.METAR_TAF:d=new StationsLayerMetarTaf(f,this.olMap,this.minResolution,this.maxResolution,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.VECTOR:d=new VectorLayer(f,this.olMap,this.minResolution,this.maxResolution,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.GML:d=new GmlLayer(f,this.olMap,this.minResolution,this.maxResolution,a,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.RAD_TRAM:d=new RadTramLayer(f,this.olMap,this.minResolution,this.maxResolution,b,a);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.CB_TRAM:d=new CbTramLayer(f,this.olMap,this.minResolution,this.maxResolution,b,a);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.QUALITY:d=new QualityLayer(f,this.olMap,this.minResolution,this.maxResolution,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;case HydsViewer.LAYERS_TYPE.GRATICULE:d=new GraticuleLayer(f,this.olMap,this.minResolution,this.maxResolution,b);this.layers.push(d);d.setPositionLayer(LAYERS_INIT_POSITION+this.layers.length-1);break;default:console.log("[ERROR] Unkown layer type: "+e)}if(this instanceof HydsViewer){for(var c=0;c<this.components.length;c++){if(e==HydsViewer.LAYERS_TYPE.RASTER||e==HydsViewer.LAYERS_TYPE.WMS){this.components[c].addLayer(f,e,a,g)}}}}function removeLayer(b){if(!this.has_layers){return}for(var a=0;a<this.layers.length;a++){if((this.layers[a].getName()==b)&&(this instanceof HydsViewer||(this.layers[a].getType()!=HydsViewer.LAYERS_TYPE.BASE))){this.layers[a].remove();this.layers.splice(a,1)}}if(this instanceof HydsViewer){for(var a=0;a<this.components.length;a++){this.components[a].removeLayer(b)}}this.recalcPositions()}function setLayerOpacity(c,a){if(!this.has_layers){return}for(var b=0;b<this.layers.length;b++){if(this.layers[b].getName()==c){this.layers[b].setOpacity(a)}}if(this instanceof HydsViewer){for(var b=0;b<this.components.length;b++){this.components[b].setLayerOpacity(c,a)}}}function getLayerOpacity(b){if(!this.has_layers){return 0}for(var a=0;a<this.layers.length;a++){if(this.layers[a].getName()==b){return this.layers[a].getOpacity()}}return 0}function setLayerVisibility(c,a){if(!this.has_layers){return}for(var b=0;b<this.layers.length;b++){if(this.layers[b].getName()==c){this.layers[b].setVisibility(a)}}if(this instanceof HydsViewer){for(var b=0;b<this.components.length;b++){this.components[b].setLayerVisibility(c,a)}}}function getLayerVisibility(b){if(!this.has_layers){return false}for(var a=0;a<this.layers.length;a++){if(this.layers[a].getName()==b){return this.layers[a].getVisibility()}}return false}function setLayerPosition(f,g){if(!this.has_layers){return}var b=g-1;if((b<0||b>=this.layers.length)&&this instanceof HydsViewer){console.log("[ERROR] The position of the layer must be a value between 1 and "+(this.layers.length));return}var e=false;var d=0;for(var c=0;(c<this.layers.length&&!e);c++){if(this.layers[c].getName()==f&&(this instanceof HydsViewer||(this.layers[c].getType()!=HydsViewer.LAYERS_TYPE.BASE))){var a=this.layers[c];this.layers.splice(c,1);this.layers.splice(b,0,a);e=true}else{if(this.layers[c].getType()==HydsViewer.LAYERS_TYPE.BASE){d++}}}if(this instanceof HydsViewer){for(var c=0;c<this.components.length;c++){this.components[c].setLayerPosition(f,(g-d))}}this.recalcPositions()}function getLayerType(b){if(!this.has_layers){return -1}for(var a=0;a<this.layers.length;a++){if(this.layers[a].getName()==b){return this.layers[a].getType()}}return -1}function addLightning(d,a,e,c){if(this.layers!=null){for(var b=0;b<this.layers.length;b++){if(this.layers[b].getName()==d&&this.layers[b].getType()==HydsViewer.LAYERS_TYPE.LIGHTNING){this.layers[b].addLightningLayer(a,e,c);this.recalcPositions()}}}}function addStation(d,a,e,b){if(this.layers!=null){for(var c=0;c<this.layers.length;c++){if(this.layers[c].getName()==d&&this.layers[c].getType()==HydsViewer.LAYERS_TYPE.STATIONS){this.layers[c].addStationLayer(a,e,b);this.recalcPositions()}}}}function addMetar(c,b){if(this.layers!=null){for(var a=0;a<this.layers.length;a++){if(this.layers[a].getName()==c&&this.layers[a].getType()==HydsViewer.LAYERS_TYPE.METAR_TAF){this.layers[a].addStationLayer(b);this.recalcPositions()}}}}function addPoint(e,a,g,d,f,b){if(this.layers!=null){for(var c=0;c<this.layers.length;c++){if(this.layers[c].getName()==e&&this.layers[c].getType()==HydsViewer.LAYERS_TYPE.VECTOR){this.layers[c].addPointLayer(a,g,d,f,b);this.recalcPositions()}}}}function modifyPoint(e,a,g,d,f,b){if(this.layers!=null){for(var c=0;c<this.layers.length;c++){if(this.layers[c].getName()==e&&this.layers[c].getType()==HydsViewer.LAYERS_TYPE.VECTOR){this.layers[c].modifyPointLayer(a,g,d,f,b);this.recalcPositions()}}}}function addQualityPoint(d,f,e,c,a){if(this.layers!=null){for(var b=0;b<this.layers.length;b++){if(this.layers[b].getName()==d&&this.layers[b].getType()==HydsViewer.LAYERS_TYPE.QUALITY){this.layers[b].addQualityPoint(f,e,c,a);this.recalcPositions()}}}}function addRegion(d,c,a,e){if(this.layers!=null){for(var b=0;b<this.layers.length;b++){if(this.layers[b].getName()==d&&this.layers[b].getType()==HydsViewer.LAYERS_TYPE.VECTOR){this.layers[b].addRegionLayer(c,a,e);this.recalcPositions()}}}}function addLine(c,b,e,d){if(this.layers!=null){for(var a=0;a<this.layers.length;a++){if(this.layers[a].getName()==c&&this.layers[a].getType()==HydsViewer.LAYERS_TYPE.VECTOR){this.layers[a].addLineLayer(b,e,d);this.recalcPositions()}}}}function adaptZone(){if(this.layers!=null){for(var a=0;a<this.layers.length;a++){if(this.layers[a].getType()==HydsViewer.LAYERS_TYPE.VECTOR){this.layers[a].adaptZoneLayer();this.recalcPositions();return}}}}function fitToLayer(a){this.coords=a;this.recalcCenter()}function recalcCenter(){var a=0;var j=0;if(this instanceof HydsViewer){var k=$("#"+this.div_name).width()*this.olMap.getResolution();var f=$("#"+this.div_name).height()*this.olMap.getResolution();a=this.x;j=this.y;if(this.coords!=null){var b=this.coords[1]+k/2;var g=this.coords[3]-k/2;var c=this.coords[2]+f/2;var e=this.coords[0]-f/2;if(a>g&&a<b){diffRight=g-a;diffLeft=a-b;if(diffLeft>diffRight){a=g}else{a=b}}else{if(a>g){a=g}else{if(a<b){a=b}}}if(j>e&&j<c){diffTop=e-j;diffBottom=j-c;if(diffBottom>diffTop){j=diffTop}else{j=diffBottom}}else{if(j>e){j=e}else{if(j<c){j=c}}}}}else{a=this.map.getCenter().lon;j=this.map.getCenter().lat}this.olMap.setCenter(new OpenLayers.LonLat(a,j));if(this.components!=null){for(var d=0;d<this.components.length;d++){if(this.components[d].getType()==HydsViewer.COMPONENTS.DETAIL_WINDOW||this.components[d].getType()==HydsViewer.COMPONENTS.GENERAL_WINDOW||this.components[d].getType()==HydsViewer.COMPONENTS.GENERAL_WINDOW){this.components[d].setCenter()}}}}function updateFrame(b){if(!this.has_layers){return}if(this.layers!=null){for(var a=0;a<this.layers.length;a++){this.layers[a].setFrameLayer(b)}}if(this.components!=null){for(var a=0;a<this.components.length;a++){this.components[a].setFrameComponent(b)}}}function recalcPositions(){if(!this.has_layers){return}var b=0;if(typeof this.layers!="undefined"){for(var a=0;a<this.layers.length;a++){if(this instanceof HydsViewer||(this.layers[a].getType()!=HydsViewer.LAYERS_TYPE.BASE)){this.layers[a].setPositionLayer(LAYERS_INIT_POSITION+b);b++}}}if(this instanceof HydsViewer){for(var a=0;a<this.components.length;a++){this.components[a].recalcPositions()}}}function getOpacityLayer(){return this.opacity}function setOpacityLayer(a){this.opacity=a;for(var b=0;b<this.olLayers.length;b++){this.olLayers[b].setOpacity(this.opacity)}}function getVisibilityLayer(){return this.visibility}function setVisibilityLayer(a){this.visibility=a;for(var b=0;b<this.olLayers.length;b++){this.olLayers[b].setVisibility(this.visibility)}if(this.visibility){this.setFrameLayer(this.viewer.current_frame)}}function setPositionLayer(b){this.position=b;for(var a=0;a<this.olLayers.length;a++){this.olLayers[a].setZIndex(b)}}function setFrameLayer(b){if(!this.visibility){return}if(!this.is_animated){for(var a=0;a<this.olLayers.length;a++){this.olLayers[a].setVisibility(true)}return}if(b<0||b>=this.olLayers.length){console.log("invalid frame for layer "+this.layer_name)}else{for(var a=0;a<this.olLayers.length;a++){if(a==b){this.olLayers[a].setVisibility(true)}else{this.olLayers[a].setVisibility(false)}}}}function getNameLayer(){return this.layer_name}function getTypeLayer(){return this.type}function repaintLayer(){}function removeL(){this.olMap.removeLayers(this.olLayers)}function BaseLayer(d,e,b,a,c,f){this.is_animated=false;this.layer_name=d;this.olLayers=null;this.position;this.viewer=f;this.olMap=e;this.type=HydsViewer.LAYERS_TYPE.BASE;this.opacity=1;this.visibility=true;this.wms_url=c;this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayer;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadBL;this.reloadLayers=reloadBL;this.repaintLayer=repaintLayer;this.load()}function loadBL(){this.opacity=1;if(this.olLayers!=null){this.opacity=this.olLayers[0].getOpacity();this.remove()}this.olLayers=new Array();var a=new OpenLayers.Layer.WMS(this.layer_name,this.wms_url,{layers:this.layer_name},{minResolution:this.minResolution,maxResolution:this.maxResolution,map_transparent:"ON",isBaseLayer:false,buffer:0});a.setOpacity(this.opacity);this.olLayers.push(a);this.olMap.addLayers(this.olLayers)}function reloadBL(a){this.viewer=a}function RasterProductLayer(d,f,b,a,c,e,g){this.is_animated=true;this.layer_name=d;this.olLayers=null;this.position=-1;this.viewer=g;this.olMap=f;this.type=HydsViewer.LAYERS_TYPE.RASTER;this.opacity=1;this.visibility=true;this.wms_url=c;if((g.olMap.getCenter().lon<-12)||(d.indexOf("uk")!=-1&&g.olMap.getCenter().lon<2)){g.offset=-1}this.olBounds=new OpenLayers.Bounds();this.olBounds.extend(new OpenLayers.LonLat(e[1],e[0]));this.olBounds.extend(new OpenLayers.LonLat(e[3],e[2]));this.olBounds.toBBOX();this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayer;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadRL;this.reloadLayers=reloadRL;this.repaintLayer=repaintLayer;this.getCoords=getCoordsRL;this.getUrl=getUrlRL;this.load()}function loadRL(){this.opacity=1;if(this.olLayers!=null){this.opacity=this.olLayers[0].getOpacity();this.remove()}this.olLayers=new Array();for(var c=0;c<this.viewer.getTotalFrames();c++){var d=this.viewer.getStartEpoch()+(c*this.viewer.getFrameDuration());var a=getFileName(d);if(c<this.viewer.getMeasuredFrames()){a=this.wms_url+this.layer_name+"/png/"+a+".png"}else{a=this.wms_url+this.layer_name+"/prediction/"+getFileName(this.viewer.getNowEpoch())+"/"+a+".png"}var b=new OpenLayers.Layer.Image(this.layer_name,a,this.olBounds,new OpenLayers.Size(100,100),{minResolution:this.minResolution,maxResolution:this.maxResolution,map_transparent:"ON",isBaseLayer:false,buffer:0});b.setVisibility(false);b.setOpacity(this.opacity);this.olLayers.push(b)}this.olMap.addLayers(this.olLayers);for(var c=0;c<this.olLayers.length;c++){this.olLayers[c].setVisibility(true);this.olLayers[c].setVisibility(false)}}function reloadRL(a){this.viewer=a;this.load()}function getCoordsRL(){var a=this.olBounds.getCenterLonLat();var f=a.lat+(this.olBounds.getHeight()/2);var c=a.lon+(this.olBounds.getWidth()/2);var e=a.lon-(this.olBounds.getWidth()/2);var b=a.lat-(this.olBounds.getHeight()/2);var d=[f,e,b,c];return d}function getUrlRL(){return this.wms_url}function WmsProductLayer(d,f,b,a,c,e,g){this.is_animated=true;this.layer_name=d;this.olLayers=null;this.position;this.olMap=f;this.viewer=g;this.type=HydsViewer.LAYERS_TYPE.WMS;this.opacity=1;this.visibility=true;this.wms_url=c;if((g.olMap.getCenter().lon<-12)||(d.indexOf("uk")!=-1&&g.olMap.getCenter().lon<2)){g.offset=-1}this.olBounds=new OpenLayers.Bounds();this.olBounds.extend(new OpenLayers.LonLat(e[1],e[0]));this.olBounds.extend(new OpenLayers.LonLat(e[3],e[2]));this.olBounds.toBBOX();this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayer;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadWL;this.reloadLayers=reloadWL;this.repaintLayer=repaintLayer;this.getCoords=getCoordsWL;this.getUrl=getUrlWL;this.load()}function loadWL(){this.opacity=1;if(this.olLayers!=null){this.opacity=this.olLayers[0].getOpacity();this.remove()}this.olLayers=new Array();for(var c=0;c<this.viewer.getTotalFrames();c++){var d=this.viewer.getStartEpoch()+(c*this.viewer.getFrameDuration());var a=getFileName(d);var b=new OpenLayers.Layer.WMS(this.layer_name,this.wms_url,{layers:this.layer_name+"/"+a},{minResolution:this.minResolution,maxResolution:this.maxResolution,map_transparent:"ON",isBaseLayer:false,buffer:0});b.setVisibility(false);b.setOpacity(this.opacity);this.olLayers.push(b)}this.olMap.addLayers(this.olLayers);for(var c=0;c<this.olLayers.length;c++){this.olLayers[c].setVisibility(true);this.olLayers[c].setVisibility(false)}}function reloadWL(a){this.viewer=a;this.load()}function getCoordsWL(){var a=this.olBounds.getCenterLonLat();var f=a.lat+(this.olBounds.getHeight()/2);var c=a.lon+(this.olBounds.getWidth()/2);var e=a.lon-(this.olBounds.getWidth()/2);var b=a.lat-(this.olBounds.getHeight()/2);var d=[f,e,b,c];return d}function getUrlWL(){return this.wms_url}function LightningAlarmLayer(c,e,b,a,d,f){this.is_animated=true;this.layer_name=c;this.olLayers=null;this.position;this.viewer=f;this.olMap=e;this.type=HydsViewer.LAYERS_TYPE.HYDROALERT_ALARM;this.opacity=1;this.visibility=true;this.styleAlarms=null;this.featureAlarms=null;this.lon=0;this.lat=0;this.radius_alarm_in=0;this.radius_alarm_out=0;this.values=null;this.feature_no_alarm_in=null;this.feature_no_alarm_out=null;this.feature_alarm_in=null;this.feature_alarm_out=null;this.feature_alarm_forecast_in=null;this.feature_alarm_forecast_out=null;this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerLAL;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadLAL;this.reloadLayers=reloadLAL;this.repaintLayer=repaintLayerLAL;this.load(d)}function loadLAL(b){if(this.olLayers!=null){this.remove()}this.lon=b.x;this.lat=b.y;this.radius_alarm_in=b.radius_in;this.radius_alarm_out=b.radius_out;this.values=b.values;var g=new OpenLayers.Geometry.Point(this.lon,this.lat);this.olLayers=new Array();this.styleAlarms=new Array();this.featureAlarms=new Array();var d=new OpenLayers.Layer.Vector("lightning_alarms",{rendererOptions:{zIndexing:true}});var a=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);a.fillColor=LIGHTNING_ALARM_NO_ALERT_OUT_COLOR;a.fillOpacity=LIGHTNING_ALARM_NO_ALERT_FILL_OPACITY;a.strokeColor=LIGHTNING_ALARM_NO_ALERT_OUT_COLOR;a.strokeOpacity=LIGHTNING_ALARM_NO_ALERT_STROKE_OPACITY;a.strokeWidth=2;var c=OpenLayers.Geometry.Polygon.createRegularPolygon(g,this.radius_alarm_out,200,0);var e=new OpenLayers.Feature.Vector(c,null,a);e.id="out";d.addFeatures([e]);var i=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);i.fillColor=LIGHTNING_ALARM_NO_ALERT_IN_COLOR;i.fillOpacity=LIGHTNING_ALARM_NO_ALERT_FILL_OPACITY;i.strokeColor=LIGHTNING_ALARM_NO_ALERT_IN_COLOR;i.strokeOpacity=LIGHTNING_ALARM_NO_ALERT_STROKE_OPACITY;i.strokeWidth=2;var f=OpenLayers.Geometry.Polygon.createRegularPolygon(g.clone(),this.radius_alarm_in,200,0);var h=new OpenLayers.Feature.Vector(f,null,i);h.id="in";d.addFeatures([h]);this.olLayers.push(d);this.olMap.addLayers(this.olLayers)}function reloadLAL(a){this.viewer=a}function repaintLayerLAL(){}function setFrameLayerLAL(g){if(!this.visibility){return}var e=this.values[g];var f=this.viewer.getStartEpoch()+(g*this.viewer.getFrameDuration());var a=Math.round(new Date().getTime()/1000);for(var c=0;c<this.olLayers.length;c++){var d=this.olLayers[c].getFeatureById("out");switch(e.out_value){case 0:d.style.fillColor=LIGHTNING_ALARM_NO_ALERT_OUT_COLOR;d.style.fillOpacity=LIGHTNING_ALARM_NO_ALERT_FILL_OPACITY;d.style.strokeColor=LIGHTNING_ALARM_NO_ALERT_OUT_COLOR;d.style.strokeOpacity=LIGHTNING_ALARM_NO_ALERT_STROKE_OPACITY;break;case 1:if(f<a){d.style.fillColor=LIGHTNING_ALARM_NO_ALERT_OUT_COLOR;d.style.fillOpacity=LIGHTNING_ALARM_ALERT_FILL_OPACITY;d.style.strokeColor=LIGHTNING_ALARM_NO_ALERT_OUT_COLOR;d.style.strokeOpacity=LIGHTNING_ALARM_ALERT_STROKE_OPACITY}else{d.style.fillColor=LIGHTNING_ALARM_ALERT_OUT_FORECAST_COLOR;d.style.fillOpacity=LIGHTNING_ALARM_ALERT_FILL_OPACITY;d.style.strokeColor=LIGHTNING_ALARM_ALERT_OUT_FORECAST_COLOR;d.style.strokeOpacity=LIGHTNING_ALARM_ALERT_STROKE_OPACITY}break}var b=this.olLayers[c].getFeatureById("in");switch(e.in_value){case 0:b.style.fillColor=LIGHTNING_ALARM_NO_ALERT_IN_COLOR;b.style.fillOpacity=LIGHTNING_ALARM_NO_ALERT_FILL_OPACITY;b.style.strokeColor=LIGHTNING_ALARM_NO_ALERT_IN_COLOR;b.style.strokeOpacity=LIGHTNING_ALARM_NO_ALERT_STROKE_OPACITY;break;case 1:if(f<a){b.style.fillColor=LIGHTNING_ALARM_NO_ALERT_IN_COLOR;b.style.fillOpacity=LIGHTNING_ALARM_ALERT_FILL_OPACITY;b.style.strokeColor=LIGHTNING_ALARM_NO_ALERT_IN_COLOR;b.style.strokeOpacity=LIGHTNING_ALARM_ALERT_STROKE_OPACITY}else{b.style.fillColor=LIGHTNING_ALARM_ALERT_IN_FORECAST_COLOR;b.style.fillOpacity=LIGHTNING_ALARM_ALERT_FILL_OPACITY;b.style.strokeColor=LIGHTNING_ALARM_ALERT_IN_FORECAST_COLOR;b.style.strokeOpacity=LIGHTNING_ALARM_ALERT_STROKE_OPACITY}break}this.olLayers[c].redraw()}}function LightningAlarmLayerMedusa(c,e,b,a,d,f){this.is_animated=true;this.layer_name=c;this.olLayers=null;this.position;this.viewer=f;this.olMap=e;this.type=HydsViewer.LAYERS_TYPE.LIGHTNING_ALARM_MEDUSA;this.opacity=1;this.visibility=true;this.styleAlarms=null;this.featureAlarms=null;this.lon=0;this.lat=0;this.radius_alarm_in=0;this.radius_alarm_out=0;this.values=null;this.feature_no_alarm_in=null;this.feature_no_alarm_out=null;this.feature_alarm_in=null;this.feature_alarm_out=null;this.feature_alarm_forecast_in=null;this.feature_alarm_forecast_out=null;this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerLAM;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadLAM;this.reloadLayers=reloadLAM;this.repaintLayer=repaintLayerLAM;this.load(d)}function loadLAM(b){if(this.olLayers!=null){this.remove()}this.lon=b.x;this.lat=b.y;this.radius_alarm_in=b.radius_in;this.radius_alarm_out=b.radius_out;this.values=b.values;var g=new OpenLayers.Geometry.Point(this.lon,this.lat);this.olLayers=new Array();this.styleAlarms=new Array();this.featureAlarms=new Array();var d=new OpenLayers.Layer.Vector("lightning_alarms",{rendererOptions:{zIndexing:true}});var a=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);a.fillColor=LIGHTNING_ALARM_ALERT_OUT_FORECAST_COLOR;a.fillOpacity=LIGHTNING_ALARM_NO_ALERT_FILL_OPACITY;a.strokeColor=LIGHTNING_ALARM_ALERT_OUT_FORECAST_COLOR;a.strokeOpacity=LIGHTNING_ALARM_NO_ALERT_STROKE_OPACITY;a.strokeWidth=2;var c=OpenLayers.Geometry.Polygon.createRegularPolygon(g,this.radius_alarm_out,200,0);var e=new OpenLayers.Feature.Vector(c,null,a);e.id="out";d.addFeatures([e]);var i=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);i.fillColor=LIGHTNING_ALARM_ALERT_IN_FORECAST_COLOR;i.fillOpacity=LIGHTNING_ALARM_NO_ALERT_FILL_OPACITY;i.strokeColor=LIGHTNING_ALARM_ALERT_IN_FORECAST_COLOR;i.strokeOpacity=LIGHTNING_ALARM_NO_ALERT_STROKE_OPACITY;i.strokeWidth=2;var f=OpenLayers.Geometry.Polygon.createRegularPolygon(g.clone(),this.radius_alarm_in,200,0);var h=new OpenLayers.Feature.Vector(f,null,i);h.id="in";d.addFeatures([h]);this.olLayers.push(d);this.olMap.addLayers(this.olLayers)}function reloadLAM(a){this.viewer=a}function repaintLayerLAM(){}function setFrameLayerLAM(g){if(!this.visibility){return}var e=this.values[g];var f=this.viewer.getStartEpoch()+(g*this.viewer.getFrameDuration());var a=Math.round(new Date().getTime()/1000);for(var c=0;c<this.olLayers.length;c++){var d=this.olLayers[c].getFeatureById("out");switch(e.out_value){case 0:d.style.fillColor=LIGHTNING_ALARM_ALERT_OUT_FORECAST_COLOR;d.style.fillOpacity=LIGHTNING_ALARM_NO_ALERT_FILL_OPACITY;d.style.strokeColor=LIGHTNING_ALARM_ALERT_OUT_FORECAST_COLOR;d.style.strokeOpacity=LIGHTNING_ALARM_NO_ALERT_STROKE_OPACITY;break;case 1:d.style.fillColor=LIGHTNING_ALARM_ALERT_OUT_FORECAST_COLOR;d.style.fillOpacity=LIGHTNING_ALARM_ALERT_FILL_OPACITY;d.style.strokeColor=LIGHTNING_ALARM_ALERT_OUT_FORECAST_COLOR;d.style.strokeOpacity=LIGHTNING_ALARM_ALERT_STROKE_OPACITY;break}var b=this.olLayers[c].getFeatureById("in");switch(e.in_value){case 0:b.style.fillColor=LIGHTNING_ALARM_ALERT_IN_FORECAST_COLOR;b.style.fillOpacity=LIGHTNING_ALARM_NO_ALERT_FILL_OPACITY;b.style.strokeColor=LIGHTNING_ALARM_ALERT_IN_FORECAST_COLOR;b.style.strokeOpacity=LIGHTNING_ALARM_NO_ALERT_STROKE_OPACITY;break;case 1:b.style.fillColor=LIGHTNING_ALARM_ALERT_IN_FORECAST_COLOR;b.style.fillOpacity=LIGHTNING_ALARM_ALERT_FILL_OPACITY;b.style.strokeColor=LIGHTNING_ALARM_ALERT_IN_FORECAST_COLOR;b.style.strokeOpacity=LIGHTNING_ALARM_ALERT_STROKE_OPACITY;break}this.olLayers[c].redraw()}}function HydroalertAlarmLayer(c,e,b,a,d,f){this.is_animated=true;this.layer_name=c;this.olLayers=null;this.position;this.viewer=f;this.olMap=e;this.type=HydsViewer.LAYERS_TYPE.HYDROALERT_ALARM;this.opacity=1;this.visibility=true;this.styleAlarms=null;this.featureAlarms=null;this.lon=0;this.lat=0;this.radius_alarm_1=0;this.radius_alarm_2=0;this.radius_alarm_3=0;this.values=null;this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerHAL;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadHAL;this.reloadLayers=reloadHAL;this.repaintLayer=repaintLayerHAL;this.load(d)}function loadHAL(d){if(this.olLayers!=null){this.remove()}this.lon=parseFloat(d.x);this.lat=parseFloat(d.y);this.radius_alarm_1=parseFloat(d.radius_1);this.radius_alarm_2=parseFloat(d.radius_2);this.radius_alarm_3=parseFloat(d.radius_3);this.values=d.values;var i=new OpenLayers.Geometry.Point(this.lon,this.lat);this.olLayers=new Array();this.styleAlarms=new Array();this.featureAlarms=new Array();var f=new OpenLayers.Layer.Vector("hydroalert_alarms",{rendererOptions:{zIndexing:true}});var c=OpenLayers.Geometry.Polygon.createRegularPolygon(i,this.radius_alarm_1,200,0);var h=new OpenLayers.Feature.Vector(c,null,styleHydroalertCircle1);h.id="HA1";f.addFeatures([h]);var b=OpenLayers.Geometry.Polygon.createRegularPolygon(i,this.radius_alarm_2,200,0);var g=new OpenLayers.Feature.Vector(b,null,styleHydroalertCircle2);g.id="HA2";f.addFeatures([g]);var a=OpenLayers.Geometry.Polygon.createRegularPolygon(i,this.radius_alarm_3,200,0);var e=new OpenLayers.Feature.Vector(a,null,styleHydroalertCircle3);e.id="HA3";f.addFeatures([e]);this.olLayers.push(f);this.olMap.addLayers(this.olLayers)}function reloadHAL(a){this.viewer=a}function repaintLayerHAL(){}function setFrameLayerHAL(b){if(!this.visibility){return}var j=this.values[b];var h=this.viewer.getStartEpoch()+(b*this.viewer.getFrameDuration());var f=Math.round(new Date().getTime()/1000);for(var e=0;e<this.olLayers.length;e++){var o=this.olLayers[e].getFeatureById("HA_semi");if(o!=null){this.olLayers[e].removeFeatures([o])}var d=j.angle;var l=j.value;var k=HYDROALERT_OBJECTS[l];var c=OpenLayers.Geometry.fromWKT(k);var g=new OpenLayers.Feature.Vector(c,null,styleHydroalertSemiCircle);g.id="HA_semi";g.geometry.rotate(d,new OpenLayers.Geometry.Point(0,0));g.geometry.move(this.lon,this.lat);this.olLayers[e].addFeatures([g]);var a=this.olLayers[e].getFeatureById("HA1");this.olLayers[e].drawFeature(a);var n=this.olLayers[e].getFeatureById("HA2");this.olLayers[e].drawFeature(n);var m=this.olLayers[e].getFeatureById("HA3");this.olLayers[e].drawFeature(m)}}function LightningLayer(c,d,b,a,e){this.is_animated=false;this.layer_name=c;this.olLayers=null;this.position;this.viewer=e;this.olMap=d;this.type=HydsViewer.LAYERS_TYPE.LIGHTNING;this.opacity=1;this.visibility=true;this.lightnings=null;this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerLL;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadLL;this.reloadLayers=reloadLL;this.addLightningLayer=addLightningLL;this.repaintLayer=repaintLayer;this.load()}function loadLL(){if(this.olLayers!=null){this.remove()}this.olLayers=new Array();this.lightnings=new Array();var a=new OpenLayers.Layer.Markers("lightnings");this.olLayers.push(a);this.olMap.addLayers(this.olLayers)}function addLightningLL(a,h,f){var e={x:a,y:h,epoch:f};this.lightnings.push(e);var c=new OpenLayers.Size(LIGHTNING_WIDTH,LIGHTNING_HEIGHT);var g=new OpenLayers.Pixel(-(c.w/2),-c.h);var d=new OpenLayers.Icon(LIGHTNING_IMAGE,c,g);var b=new OpenLayers.Marker(new OpenLayers.LonLat(a,h),d);b.id=this.lightnings.length-1;b.setOpacity(0);this.olLayers[0].addMarker(b)}function reloadLL(a){this.viewer=a;this.load()}function setFrameLayerLL(a){if(!this.visibility){return}var h=this.viewer.getStartEpoch()+(a*this.viewer.getFrameDuration());for(var d=0;d<this.olLayers.length;d++){for(var c=0;c<this.olLayers[d].markers.length;c++){var e=this.olLayers[d].markers[c];var k=e.id;var l=this.lightnings[k];var f=l.epoch-(l.epoch%this.viewer.getFrameDuration())+this.viewer.getFrameDuration();var b=LIGHTNING_FRAME_DURATION+this.viewer.getFrameDuration();var g=(b-(h-f))/b;if(g>1||g<0){g=0}e.setOpacity(g)}this.olLayers[d].redraw()}}function VectorLayer(c,d,b,a,e){this.is_animated=true;this.layer_name=c;this.olLayers=null;this.position;this.viewer=e;this.olMap=d;this.type=HydsViewer.LAYERS_TYPE.VECTOR;this.opacity=1;this.visibility=true;this.elements=null;this.features=null;this.selectControl=null;this.panControl=null;this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerVL;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.addPointLayer=addPointVL;this.modifyPointLayer=modifyPointVL;this.addRegionLayer=addRegionVL;this.addLineLayer=addLineVL;this.adaptZoneLayer=adaptZoneVL;this.load=loadVL;this.reloadLayers=reloadVL;this.repaintLayer=repaintLayer;this.load()}function loadVL(){if(this.olLayers!=null){this.remove()}this.olLayers=new Array();this.elements=new Array();this.features=new Array();var a=new OpenLayers.Layer.Vector("vector",{rendererOptions:{zIndexing:true}});this.olLayers.push(a);this.olMap.addLayers(this.olLayers);this.selectControl=new OpenLayers.Control.SelectFeature(this.olLayers[0],{});this.olMap.addControl(this.selectControl);this.selectControl.activate()}function selectObject(a){}function unSelectObject(a){}function addPointVL(f,e,a,d,i){var b={x:f,y:e,id:a,type:"point",values:d,isMain:i};this.elements.push(b);var g=new OpenLayers.Geometry.Point(f,e);if(i){var c=new OpenLayers.Feature.Vector(g,null,stylePointOut);c.id=a+"_out";c.attributes.element=b;c.attributes.viewer=this.viewer;this.olLayers[0].addFeatures([c])}var h=new OpenLayers.Feature.Vector(g.clone(),null,stylePointIn);h.id=a+"_in";h.attributes.element=b;h.attributes.viewer=this.viewer;this.olLayers[0].addFeatures([h])}function addRegionVL(d,b,e){var c={id:b,type:"region",values:e,points:d};this.elements.push(c);var a=new OpenLayers.Format.WKT();var f=a.read(d);f.attributes.element=c;f.attributes.viewer=this.viewer;f.id=b;f.style=styleRegion;this.olLayers[0].addFeatures([f])}function addLineVL(h,a,e){var b={id:a,type:"line",values:e,points:h};this.elements.push(b);var j=new Array();for(var c=0;c<h.length;c++){var f=new OpenLayers.Geometry.Point(h[c][0],h[c][1]);j.push(f)}var d=new OpenLayers.Geometry.LineString(j);var g=new OpenLayers.Feature.Vector(d,null,styleRegion);g.attributes.element=b;g.attributes.viewer=this.viewer;g.id=a;this.olLayers[0].addFeatures([g])}function modifyPointVL(a,g,e,f,b){var d={x:""+a,y:""+g,id:e,type:"point",values:f,isMain:b};for(var c=0;c<this.elements.length;c++){if(this.elements[c].id==e){this.elements[c].values=f}}}function adaptZoneVL(){var a=this.olLayers[0].getDataExtent();var b=parseInt(this.olLayers[0].getZoomForExtent(a,true));this.olMap.setCenter(a.getCenterLonLat(),b);this.panControl=new OpenLayers.Control.NavToolbar();this.olMap.addControl(this.panControl);this.viewer.original_extent=a;this.viewer.extent=a;this.olMap.setOptions({restrictedExtent:a})}function reloadVL(a){return}function setFrameLayerVL(g){if(!this.visibility){return}for(var e=0;e<this.olLayers.length;e++){this.olLayers[e].setVisibility(true);for(var a=0;a<this.elements.length;a++){var d=this.elements[a];switch(d.type){case"point":if(d.isMain){var f=this.olLayers[e].getFeatureById(d.id+"_out");f.style.strokeColor=d.values[g];this.olLayers[e].drawFeature(f)}var c=this.olLayers[e].getFeatureById(d.id+"_in");c.style.strokeColor=d.values[g];c.style.fillColor=d.values[g];this.olLayers[e].drawFeature(c);break;case"region":case"line":var b=this.olLayers[e].getFeatureById(d.id);b.style.strokeColor=d.values[g];b.style.fillColor=d.values[g];this.olLayers[e].drawFeature(b);break;default:console.log("[ERROR] Unknown vector type"+d.type)}}}}function StationsLayer(c,d,b,a,e){this.is_animated=true;this.layer_name=c;this.olLayers=null;this.position;this.viewer=e;this.olMap=d;this.type=HydsViewer.LAYERS_TYPE.STATIONS;this.opacity=1;this.visibility=true;this.stations=null;this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerSL;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadSL;this.reloadLayers=reloadSL;this.addStationLayer=addStationSL;this.repaintLayer=repaintLayer;this.load()}function loadSL(){if(this.olLayers!=null){this.remove()}this.olLayers=new Array();this.stations=new Array();var a=new OpenLayers.Layer.Vector("stations",{rendererOptions:{zIndexing:true}});this.olLayers.push(a);this.olMap.addLayers(this.olLayers)}function addStationSL(b,f,c){var d={x:b,y:f,values:c};this.stations.push(d);var a=new OpenLayers.Geometry.Point(d.x,d.y);var e=new OpenLayers.Feature.Vector(a,null,styleStation);e.id=""+this.stations.length-1;this.olLayers[0].addFeatures([e])}function reloadSL(a){this.viewer=a;this.load()}function setFrameLayerSL(e){for(var c=0;c<this.olLayers.length;c++){for(var b=0;b<this.olLayers[c].features.length;b++){var a=this.olLayers[c].features[b].id;var d=this.stations[a];this.olLayers[c].features[b].style.fillColor=d.values[e];this.olLayers[c].drawFeature(this.olLayers[c].features[b])}}}function StationsLayerMetarTaf(c,d,b,a,e){this.is_animated=true;this.layer_name=c;this.olLayers=null;this.position;this.viewer=e;this.olMap=d;this.type=HydsViewer.LAYERS_TYPE.METAR_TAF;this.opacity=1;this.visibility=true;this.stations=null;this.selectControl=null;this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerMT;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadMT;this.reloadLayers=reloadMT;this.addStationLayer=addStationMT;this.repaintLayer=repaintLayer;this.load()}function loadMT(){if(this.olLayers!=null){this.remove()}this.olLayers=new Array();this.stations=new Array();var a=new OpenLayers.Layer.Vector("stations",{rendererOptions:{zIndexing:true}});this.olLayers.push(a);this.selectControl=new OpenLayers.Control.SelectFeature(a,{onSelect:selectObjectMT,onUnselect:unSelectObjectMT});this.olMap.addControl(this.selectControl);this.selectControl.activate();this.olMap.addLayers(this.olLayers)}function selectObjectMT(d){var f=d.attributes.viewer;var b=d.attributes.element;var a=d.attributes.layer;var c=new Object();c.lon=b.lon;c.lat=b.lat;c.name=b.name;c.code=b.code;c.data=new Object();c.data.date=b.data[f.current_frame].date;c.data.metar=b.data[f.current_frame].metar;c.data.taf=b.data[f.current_frame].taf;hydsViewer_triggerEventSetCurrentStation("viewer",c);d.style.fillColor="blue";a.drawFeature(d)}function unSelectObjectMT(b){var a=b.attributes.layer;b.style.fillColor="white";a.drawFeature(b)}function addStationMT(b){this.stations.push(b);var a=new OpenLayers.Geometry.Point(b.lon,b.lat);var c=new OpenLayers.Feature.Vector(a,null,styleStation);c.id=""+b.id;c.attributes.element=b;c.attributes.viewer=this.viewer;c.attributes.layer=this.olLayers[0];this.olLayers[0].addFeatures([c]);this.olLayers[0].drawFeature(c)}function reloadMT(a){this.viewer=a;this.load()}function setFrameLayerMT(a){}function GmlLayer(d,e,b,a,c,f){this.is_animated=false;this.layer_name=d;this.olLayers=null;this.position;this.gml_url=c;this.viewer=f;this.olMap=e;this.type=HydsViewer.LAYERS_TYPE.GML;this.opacity=1;this.visibility=true;this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerGL;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadGL;this.reloadLayers=reloadGL;this.repaintLayer=repaintLayer;this.load()}function loadGL(){if(this.olLayers!=null){this.remove()}this.olLayers=new Array();var a=new OpenLayers.Layer.GML(this.layer_name,this.gml_url);this.olLayers.push(a);this.olMap.addLayers(this.olLayers)}function reloadGL(a){this.viewer=a}function setFrameLayerGL(a){}function RadTramLayer(d,e,c,b,f,a){this.is_animated=true;this.layer_name=d;this.olLayers=null;this.position;this.viewer=f;this.olMap=e;this.type=HydsViewer.LAYERS_TYPE.RAD_TRAM;this.opacity=1;this.visibility=true;this.polygons=null;this.minResolution=c;this.maxResolution=b;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerRT;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadRT;this.reloadLayers=reloadRT;this.repaintLayer=repaintLayer;this.load(a)}function loadRT(b){this.opacity=1;if(this.olLayers!=null){this.opacity=this.olLayers[0].getOpacity();this.remove()}this.olLayers=new Array();this.polygons=new Array();var e=new OpenLayers.Layer.Vector("vector",{rendererOptions:{zIndexing:true}});this.olLayers.push(e);this.olMap.addLayers(this.olLayers);for(var d=0;d<b.length;d++){var g=b[d].date==b[d].forecast_date;var c={date:b[d].date,forecast_date:b[d].forecast_date,polygon:b[d].polygon,stage:b[d].stage,isMeasured:g};this.polygons.push(c);var a=new OpenLayers.Format.WKT();var f=a.read(b[d].polygon);f.attributes.element=c;f.attributes.viewer=this.viewer;f.id=b[d].polygon;if(g){f.style=styleRadTram}else{f.style=styleRadTramForecast}this.olLayers[0].addFeatures([f])}}function reloadRT(a){this.viewer=a;this.load()}function setFrameLayerRT(a){if(!this.visibility){return}var f=this.viewer.getStartEpoch()+(a*this.viewer.getFrameDuration());for(var d=0;d<this.olLayers.length;d++){this.olLayers[d].setVisibility(true);for(var c=0;c<this.polygons.length;c++){var g=this.polygons[c];var l=this.olLayers[d].getFeatureById(g.polygon);var e=0;var b=TRAM_FRAME_DURATION+this.viewer.getFrameDuration();var k=g.forecast_date;var h=f-g.date;if(g.isMeasured){if(h<this.viewer.getFrameDuration()&&h>=0){e=(b-(f-k))/b}else{e=0}}else{if(h<this.viewer.getFrameDuration()&&h>=0){e=(b-(k-f))/b}else{e=0}}if(e>1||e<0){e=0}l.style.fillOpacity=0;l.style.strokeOpacity=e;this.olLayers[d].drawFeature(l)}}}function CbTramLayer(d,e,c,b,f,a){this.is_animated=true;this.layer_name=d;this.olLayers=null;this.position;this.viewer=f;this.olMap=e;this.type=HydsViewer.LAYERS_TYPE.CB_TRAM;this.opacity=1;this.visibility=true;this.polygons=null;this.minResolution=c;this.maxResolution=b;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerCT;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadCT;this.reloadLayers=reloadCT;this.repaintLayer=repaintLayer;this.load(a)}function loadCT(b){this.opacity=1;if(this.olLayers!=null){this.opacity=this.olLayers[0].getOpacity();this.remove()}this.olLayers=new Array();this.polygons=new Array();var e=new OpenLayers.Layer.Vector("vector",{rendererOptions:{zIndexing:true}});this.olLayers.push(e);this.olMap.addLayers(this.olLayers);for(var d=0;d<b.length;d++){var g=b[d].date==b[d].forecast_date;var c={date:b[d].date,forecast_date:b[d].forecast_date,polygon:b[d].polygon,stage:b[d].stage,isMeasured:g};this.polygons.push(c);var a=new OpenLayers.Format.WKT();var f=a.read(b[d].polygon);f.attributes.element=c;f.attributes.viewer=this.viewer;f.id=b[d].polygon;switch(b[d].stage){case"1":f.style=styleCbTramYellow;break;case"2":f.style=styleCbTramOrange;break;case"3":f.style=styleCbTramRed;break;default:if(g){f.style=styleRadTram}else{f.style=styleRadTramForecast}}this.olLayers[0].addFeatures([f])}}function reloadCT(a){this.viewer=a;this.load()}function setFrameLayerCT(a){if(!this.visibility){return}var f=this.viewer.getStartEpoch()+(a*this.viewer.getFrameDuration());for(var d=0;d<this.olLayers.length;d++){this.olLayers[d].setVisibility(true);for(var c=0;c<this.polygons.length;c++){var g=this.polygons[c];var l=this.olLayers[d].getFeatureById(g.polygon);var e=0;var b=TRAM_FRAME_DURATION+this.viewer.getFrameDuration();var k=g.forecast_date;var h=f-g.date;if(g.isMeasured){if(h<this.viewer.getFrameDuration()&&h>=0){e=(b-(f-k))/b}else{e=0}}else{if(h<this.viewer.getFrameDuration()&&h>=0){e=(b-(k-f))/b}else{e=0}}if(e>1||e<0){e=0}l.style.fillOpacity=0;l.style.strokeOpacity=e;this.olLayers[d].drawFeature(l)}}}function QualityLayer(c,d,b,a,e){this.is_animated=true;this.layer_name=c;this.olLayers=null;this.position;this.qualPoints=new Array();this.viewer=e;this.olMap=d;this.type=HydsViewer.LAYERS_TYPE.QUALITY;this.opacity=1;this.visibility=true;this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayerQL;this.getOpacity=getOpacityLayerQL;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayerQUAL;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadQUAL;this.reloadLayers=reloadQUAL;this.addQualityPoint=addQualityPointQUAL;this.repaintLayer=repaintLayer;this.load()}function loadQUAL(){if(this.olLayers!=null){this.remove()}this.olLayers=new Array();var a=new OpenLayers.Layer("quality",{rendererOptions:{zIndexing:true}});this.olLayers.push(a);this.olMap.addLayers(this.olLayers)}function addQualityPointQUAL(d,c,e,b){var a=new OpenLayers.Control.QualityPoint(d,c,e,b);this.olMap.addControl(a);this.qualPoints.push(a)}function reloadQUAL(a){this.viewer=a;this.load()}function setFrameLayerQUAL(f){var c=this.viewer.getStartEpoch();var e=this.viewer.getFrameDuration();var b=c+((f+1)*e);var d=(b-c)/e;for(var a=0;a<this.qualPoints.length;a++){this.qualPoints[a].fillElement(d)}}function setOpacityLayerQL(b){for(var a=0;a<this.qualPoints.length;a++){this.qualPoints[a].setOpacity(b)}}function getOpacityLayerQL(){if(this.qualPoints.length==0){console.log("NO QUALITY POINTS IN QUALITY LAYER");return -1}return this.qualPoints[0].getOpacity()}function GraticuleLayer(c,d,b,a,e){this.is_animated=false;this.layer_name=c;this.olLayers=null;this.position;this.viewer=e;this.olMap=d;this.type=HydsViewer.LAYERS_TYPE.GRATICULE;this.opacity=1;this.visibility=true;this.intervals=[45,30,20,10,5,2,1,0.5,0.2,0.1,0.05,0.01,0.005,0.002,0.001];this.numPoints=50;this.targetSize=400;this.labelFormat="dm";this.labelled=true;this.lineSymbolizer={strokeColor:"#808080",strokeWidth:1,strokeOpacity:1};this.labelSymbolizer={stroke:false,fill:false,fontColor:"#5c3312",fontSize:"14px",fontFamily:"Lato",fontWeight:"bold",label:"${label}",labelAlign:"${labelAlign}",labelXOffset:"${xOffset}",labelYOffset:"${yOffset}"};this.minResolution=b;this.maxResolution=a;this.setOpacity=setOpacityLayer;this.getOpacity=getOpacityLayer;this.setVisibility=setVisibilityLayer;this.getVisibility=getVisibilityLayer;this.setPositionLayer=setPositionLayer;this.setFrameLayer=setFrameLayer;this.getName=getNameLayer;this.getType=getTypeLayer;this.remove=removeL;this.load=loadGR;this.reloadLayers=reloadGR;this.repaintLayer=drawLinesGR;this.drawLines=drawLinesGR;this.load()}function loadGR(){this.olLayers=new Array();var a=new OpenLayers.Style({},{rules:[new OpenLayers.Rule({symbolizer:{Point:this.labelSymbolizer,Line:this.lineSymbolizer}})]});var b=new OpenLayers.Layer.Vector(this.layerName,{styleMap:new OpenLayers.StyleMap({"default":a})});this.olLayers.push(b);this.olMap.addLayers(this.olLayers);this.drawLines()}function drawLinesGR(){var l=this.olMap.getExtent();if(!l){return}this.olLayers[0].destroyFeatures();var m=new OpenLayers.Projection("EPSG:4326");var H=this.olMap.getProjectionObject();var g=this.olMap.getResolution();if(H.proj&&H.proj.projName=="longlat"){this.numPoints=1}var K=this.olMap.getCenter();var D=new OpenLayers.Pixel(K.lon,K.lat);OpenLayers.Projection.transform(D,H,m);var y=this.targetSize*g;y*=y;var q;for(var C=0;C<this.intervals.length;++C){q=this.intervals[C];var I=q/2;var d=D.offset(new OpenLayers.Pixel(-I,-I));var b=D.offset(new OpenLayers.Pixel(I,I));OpenLayers.Projection.transform(d,m,H);OpenLayers.Projection.transform(b,m,H);var e=(d.x-b.x)*(d.x-b.x)+(d.y-b.y)*(d.y-b.y);if(e<=y){break}}D.x=Math.floor(D.x/q)*q;D.y=Math.floor(D.y/q)*q;var B=0;var r=[D.clone()];var p=D.clone();var z;do{p=p.offset(new OpenLayers.Pixel(0,q));z=OpenLayers.Projection.transform(p.clone(),m,H);r.unshift(p)}while(l.containsPixel(z)&&++B<1000);p=D.clone();do{p=p.offset(new OpenLayers.Pixel(0,-q));z=OpenLayers.Projection.transform(p.clone(),m,H);r.push(p)}while(l.containsPixel(z)&&++B<1000);B=0;var w=[D.clone()];p=D.clone();do{p=p.offset(new OpenLayers.Pixel(-q,0));z=OpenLayers.Projection.transform(p.clone(),m,H);w.unshift(p)}while(l.containsPixel(z)&&++B<1000);p=D.clone();do{p=p.offset(new OpenLayers.Pixel(q,0));z=OpenLayers.Projection.transform(p.clone(),m,H);w.push(p)}while(l.containsPixel(z)&&++B<1000);var a=[];for(var C=0;C<w.length;++C){var f=w[C].x;var v=[];var J=null;var E=Math.min(r[0].y,90);var o=Math.max(r[r.length-1].y,-90);var c=(E-o)/this.numPoints;var k=o;for(var A=0;A<=this.numPoints;++A){var F=new OpenLayers.Geometry.Point(f,k);F.transform(m,H);v.push(F);k+=c;if(F.y>=l.bottom&&!J){J=F}}if(this.labelled){var t=new OpenLayers.Geometry.Point(J.x,l.top);var G={value:f,label:this.labelled?OpenLayers.Util.getFormattedLonLat(f,"lon",this.labelFormat):"",labelAlign:"ct",xOffset:0,yOffset:-2};var h=new OpenLayers.Feature.Vector(t,G);this.olLayers[0].addFeatures([h])}var u=new OpenLayers.Geometry.LineString(v);a.push(new OpenLayers.Feature.Vector(u))}for(var A=0;A<r.length;++A){k=r[A].y;if(k<-90||k>90){continue}var v=[];var x=w[0].x;var s=w[w.length-1].x;var n=(s-x)/this.numPoints;var f=x;var J=null;for(var C=0;C<=this.numPoints;++C){var F=new OpenLayers.Geometry.Point(f,k);F.transform(m,H);v.push(F);f+=n;if(F.x<l.right){J=F}}if(this.labelled){var t=new OpenLayers.Geometry.Point(l.left,J.y);var G={value:k,label:this.labelled?OpenLayers.Util.getFormattedLonLat(k,"lat",this.labelFormat):"",labelAlign:"lb",xOffset:2,yOffset:2};var h=new OpenLayers.Feature.Vector(t,G);this.olLayers[0].addFeatures(h)}var u=new OpenLayers.Geometry.LineString(v);a.push(new OpenLayers.Feature.Vector(u))}this.olLayers[0].addFeatures(a)}function reloadGR(a){this.viewer=a}function setLayerPositionComponent(e,f){var b=f-1;if(b<0||b>=this.viewer_layers.length){console.log("[ERROR] The position of the layer must be a value between 1 and "+(this.viewer_layers.length));return}var d=false;for(var c=0;(c<this.viewer_layers.length&&!d);c++){if(this.viewer_layers[c].getName()==e){var a=this.viewer_layers[c];this.viewer_layers.splice(c,1);this.viewer_layers.splice(b,0,a);d=true}}this.recalcPositions()}function getType(){return this.type}function removeC(){this.map.removeControl(this.olMap)}function setPositionComponent(a){this.olMap.setZIndex(a)}function repaintLayersComponents(){if(!this.has_layers){return}if(this.layers!=null){for(var a=0;a<this.layers.length;a++){this.layers[a].repaintLayer()}}}function Clock(b,a,c){this.is_animated=true;this.has_layers=false;this.viewer=c;this.map=b;this.olMap=null;this.type=HydsViewer.COMPONENTS.CLOCK;this.locale=a;this.setFrameComponent=setFrameClock;this.load=loadCL;this.setLocale=setLocaleCL;this.addLayer=addLayer;this.setLayerOpacity=setLayerOpacity;this.setLayerVisibility=setLayerVisibility;this.setLayerPosition=setLayerPosition;this.removeLayer=removeLayer;this.remove=removeC;this.getType=getType;this.pause=pauseC;this.start=startC;this.repaintLayers=repaintLayersComponents;this.recalcPositions=recalcPositions;this.setLayerPosition=setLayerPosition;this.reloadComponent=reloadCL;this.load()}function loadCL(){MEASURED="measured";FORECASTED="forecast";this.olMap=new OpenLayers.Control.Clock();this.setLocale(this.locale);this.map.addControl(this.olMap);var a=new Date();a.setTime(0);this.olMap.addClass(FORECASTED)}function setFrameClock(e){if(!this.is_animated){return}var a=this.viewer.getStartEpoch();var d=this.viewer.getFrameDuration();var b=a+(e*d);var c="";b+=this.viewer.offset*3600;if(e<this.viewer.getMeasuredFrames()){this.olMap.removeClass(FORECASTED);this.olMap.addClass(MEASURED);c=this.locales.getLocale(MEASURED)}else{this.olMap.removeClass(MEASURED);this.olMap.addClass(FORECASTED);c=this.locales.getLocale(FORECASTED)}this.olMap.updateTime(getTime(b)+" "+c);this.olMap.updateDate(getDate(b))}function startC(){}function pauseC(){}function reloadCL(a){this.viewer=a}function setLocaleCL(a){this.locale=a;this.locales=new Locales(this.locale)}function AnimationControl(b,a,c){this.is_animated=true;this.has_layers=false;this.viewer=c;this.map=b;this.olMap=null;this.type=HydsViewer.COMPONENTS.ANIMATION_CONTROL;this.locale=a;this.setFrameComponent=setFrameAC;this.start=startAC;this.stop=stopAC;this.pause=pauseAC;this.load=loadAC;this.setLocale=setLocaleAC;this.addLayer=addLayer;this.setLayerOpacity=setLayerOpacity;this.setLayerVisibility=setLayerVisibility;this.setLayerPosition=setLayerPosition;this.removeLayer=removeLayer;this.remove=removeC;this.getType=getType;this.repaintLayers=repaintLayersComponents;this.recalcPositions=recalcPositions;this.setLayerPosition=setLayerPosition;this.reloadComponent=reloadAC;this.load()}function loadAC(){this.olMap=new OpenLayers.Control.AnimationControl();this.setLocale(this.locale);this.map.addControl(this.olMap);rightMarginSlider=0.77;load_slider();var c=this.locales.getLocale("animation");var b=this.locales.getLocale("captures");var a=this.locales.getLocale("prevision");$("#anim_message").html("<em> "+c+" "+this.viewer.getTotalFrames()+" "+b+" </em>");$("#animation-control-glow").html(a);$("#playAC").css("background-image","url("+imagesUrl+"play_norm.gif)");$("#pauseAC").css("background-image","url("+imagesUrl+"pause_clicked.gif)")}function load_slider(){var b=this.viewer.getStartEpoch();var c=this.viewer.getFrameDuration();var a=this.viewer.getTotalFrames();$("#slider_anim").slider("destroy");$("#slider_anim").slider({animate:false,min:0,max:a,step:1,slide:function(d,f){pauseAn();var e=Math.min(f.value,a-1);setFrame(b+(c*e))}})}function startAC(){$("#playAC").css("background-image","url("+imagesUrl+"play_clicked.gif)");$("#pauseAC").css("background-image","url("+imagesUrl+"pause_norm.gif)")}function pauseAC(){$("#playAC").css("background-image","url("+imagesUrl+"play_norm.gif)");$("#pauseAC").css("background-image","url("+imagesUrl+"pause_clicked.gif)")}function stopAC(){$("#playAC").css("background-image","url("+imagesUrl+"play_norm.gif)");$("#pauseAC").css("background-image","url("+imagesUrl+"pause_clicked.gif)")}function setFrameAC(b){if(!this.is_animated){return}var e,f,k,h,i,g;var d=this.viewer.getStartEpoch();var a=this.viewer.getFrameDuration();var j=d+(b*a);g=new Date(j*1000);e=g.getHours().toString();e=addLeadingZero(e);f=g.getMinutes().toString();f=addLeadingZero(f);k=g.getDate().toString();k=addLeadingZero(k);h=(g.getMonth()+1).toString();h=addLeadingZero(h);i=g.getFullYear().toString();$("#image_hour").html(e+":"+f);$("#image_date").html(k+"/"+h+"/"+i);$("#animation-control-glow").css("visibility",(b>this.viewer.getMeasuredFrames()?"visible":"hidden"));var c=(j-d)/a;$("#slider_anim").slider("option","value",c)}function addLeadingZero(a){return(a<10?"0"+a:a)}function reloadAC(a){this.viewer=a;load_slider()}function setLocaleAC(a){this.locale=a;this.locales=new Locales(this.locale)}function ClockDate(b,a,c){this.is_animated=true;this.has_layers=false;this.viewer=c;this.map=b;this.olMap=null;this.type=HydsViewer.COMPONENTS.CLOCK_DATE;this.locale=a;this.setFrameComponent=setFrameClockDate;this.load=loadCD;this.setLocale=setLocaleCD;this.addLayer=addLayer;this.setLayerOpacity=setLayerOpacity;this.setLayerVisibility=setLayerVisibility;this.setLayerPosition=setLayerPosition;this.removeLayer=removeLayer;this.remove=removeC;this.getType=getType;this.start=startCD;this.stop=stopCD;this.pause=pauseCD;this.repaintLayers=repaintLayersComponents;this.recalcPositions=recalcPositions;this.setLayerPosition=setLayerPosition;this.reloadComponent=reloadCD;this.load()}function loadCD(){MEASURED="measured";FORECASTED="forecast";this.olMap=new OpenLayers.Control.ClockDate();this.setLocale(this.locale);this.map.addControl(this.olMap);var a=new Date();a.setTime(0);this.olMap.addClass(FORECASTED)}function startCD(){}function pauseCD(){}function stopCD(){}function setFrameClockDate(d){if(!this.is_animated){return}var a=this.viewer.getStartEpoch();var c=this.viewer.getFrameDuration();var b=a+(d*c)-86400;if(d>=this.viewer.getMeasuredFrames()){this.olMap.removeClass(MEASURED);this.olMap.addClass(FORECASTED)}else{this.olMap.removeClass(FORECASTED);this.olMap.addClass(MEASURED)}this.olMap.updateDate(getDate(b))}function reloadCD(a){this.viewer=a}function setLocaleCD(a){this.locale=a;this.locales=new Locales(this.locale)}function DetailWindow(f,c,b,a,d,e,g){this.is_animated=true;this.has_layers=true;this.viewer=g;this.map=f;this.olMap=null;this.type=HydsViewer.COMPONENTS.DETAIL_WINDOW;this.layers=null;this.minResolution=c;this.maxResolution=b;this.locale=a;this.url=d;this.layer_name=e;this.setFrameComponent=setFrameDetailWindow;this.setCenter=setCenterDW;this.setZoom=setZoomDW;this.load=loadDW;this.setLocale=setLocaleDW;this.addLayer=addLayer;this.setLayerOpacity=setLayerOpacity;this.setLayerVisibility=setLayerVisibility;this.setLayerPosition=setLayerPosition;this.removeLayer=removeLayer;this.remove=removeC;this.pause=pauseDW;this.start=startDW;this.getType=getType;this.repaintLayers=repaintLayersComponents;this.recalcPositions=recalcPositions;this.setLayerPosition=setLayerPosition;this.reloadComponent=reloadDW;this.loadDWLayers=loadDWLayers;this.load()}function loadDW(){this.layers=new Array();var a={projection:"EPSG:4326",size:new OpenLayers.Size(WINDOW_SIZE,WINDOW_SIZE)};this.olMap=new OpenLayers.Control.OrtoMap(a);this.map.addControl(this.olMap);this.loadDWLayers()}function startDW(){}function pauseDW(){}function loadDWLayers(){if(this.minResolution>this.maxResolution){var a=this.minResolution;this.minResolution=this.maxResolution;this.maxResolution=a}var b=new OpenLayers.Layer.WMS("base",this.url,{layers:this.layer_name},{minResolution:this.minResolution,maxResolution:this.maxResolution,map_transparent:"ON",isBaseLayer:false,buffer:0});this.olMap.addLayers([b])}function setCenterDW(){this.olMap.setCenter(this.map.getCenter());this.olMap.update()}function setZoomDW(a){this.olMap.setCenter(this.map.getCenter(),a);this.olMap.update()}function setFrameDetailWindow(b){if(!this.is_animated){return}if(this.layers!=null){for(var a=0;a<this.layers.length;a++){this.layers[a].setFrameLayer(b)}}}function reloadDW(b){this.viewer=b;if(this.layers!=null){for(var a=0;a<this.layers.length;a++){this.layers[a].reloadLayers(this.viewer)}}}function setLocaleDW(a){this.locale=a}function GeneralWindow(f,c,b,a,d,e,g){this.is_animated=true;this.has_layers=true;this.viewer=g;this.map=f;this.olMap=null;this.type=HydsViewer.COMPONENTS.GENERAL_WINDOW;this.layers=null;this.minResolution=c;this.maxResolution=b;this.locale=a;this.url=d;this.layer_name=e;this.setFrameComponent=setFrameGeneralWindow;this.setCenter=setCenterGW;this.setZoom=setZoomGW;this.load=loadGW;this.setLocale=setLocaleGW;this.addLayer=addLayer;this.setLayerOpacity=setLayerOpacity;this.setLayerVisibility=setLayerVisibility;this.setLayerPosition=setLayerPosition;this.removeLayer=removeLayer;this.remove=removeC;this.pause=pauseGW;this.start=startGW;this.getType=getType;this.repaintLayers=repaintLayersComponents;this.recalcPositions=recalcPositions;this.setLayerPosition=setLayerPosition;this.reloadComponent=reloadGW;this.loadGWLayers=loadGWLayers;this.load()}function loadGW(){this.layers=new Array();var a={projection:"EPSG:4326",size:new OpenLayers.Size(WINDOW_SIZE,WINDOW_SIZE)};this.olMap=new OpenLayers.Control.OverMap(a);this.map.addControl(this.olMap);this.loadGWLayers()}function startGW(){}function pauseGW(){}function loadGWLayers(){if(this.minResolution>this.maxResolution){var a=this.minResolution;this.minResolution=this.maxResolution;this.maxResolution=a}var b=new OpenLayers.Layer.WMS("base",this.url,{layers:this.layer_name},{minResolution:this.minResolution,maxResolution:this.maxResolution,map_transparent:"ON",isBaseLayer:false,buffer:0});this.olMap.addLayers([b])}function setCenterGW(){this.olMap.setCenter(this.map.getCenter());this.olMap.update()}function setZoomGW(a){this.olMap.setCenter(this.map.getCenter(),a);this.olMap.update()}function setFrameGeneralWindow(b){if(!this.is_animated){return}if(this.layers!=null){for(var a=0;a<this.layers.length;a++){this.layers[a].setFrameLayer(b)}}}function reloadGW(b){this.viewer=b;if(this.layers!=null){for(var a=0;a<this.layers.length;a++){this.layers[a].reloadLayers(this.viewer)}}}function setLocaleGW(a){this.locale=a}function Palette(b,a,c){this.is_animated=false;this.has_layers=false;this.viewer=c;this.map=b;this.olMap=null;this.type=HydsViewer.COMPONENTS.PALETTE;this.locale=a;this.setFrameComponent=setFramePalette;this.setProduct=setProductPalette;this.load=loadPL;this.addLayer=addLayer;this.setLayerOpacity=setLayerOpacity;this.setLayerVisibility=setLayerVisibility;this.setLayerPosition=setLayerPosition;this.removeLayer=removeLayer;this.remove=removeC;this.start=startPL;this.stop=stopPL;this.pause=pausePL;this.getType=getType;this.repaintLayers=repaintLayersComponents;this.recalcPositions=recalcPositions;this.setLayerPosition=setLayerPosition;this.reloadComponent=reloadPL;this.load()}function loadPL(){this.olMap=new OpenLayers.Control.Palette();this.map.addControl(this.olMap)}function loadVC(){this.olMap=new OpenLayers.Control.Value();this.values=new Array();this.map.addControl(this.olMap)}function startPL(){}function pausePL(){}function stopPL(){}function setFramePalette(a){if(!this.is_animated){return}}function reloadPL(a){this.viewer=a}function setProductPalette(a){this.olMap.updatePalette(a)}function Scale(b,a,c){this.is_animated=false;this.has_layers=false;this.viewer=c;this.map=b;this.olMap=null;this.type=HydsViewer.COMPONENTS.SCALE;this.locale=a;this.setFrameComponent=setFrameScale;this.load=loadSCL;this.addLayer=addLayer;this.setLayerOpacity=setLayerOpacity;this.setLayerVisibility=setLayerVisibility;this.setLayerPosition=setLayerPosition;this.removeLayer=removeLayer;this.remove=removeC;this.start=startSCL;this.stop=stopSCL;this.pause=pauseSCL;this.getType=getType;this.repaintLayers=repaintLayersComponents;this.recalcPositions=recalcPositions;this.setLayerPosition=setLayerPosition;this.reloadComponent=reloadSCL;this.load()}function loadSCL(){this.olMap=new OpenLayers.Control.ScaleLine();this.map.addControl(this.olMap)}function loadVC(){this.olMap=new OpenLayers.Control.Value();this.values=new Array();this.map.addControl(this.olMap)}function startSCL(){}function pauseSCL(){}function stopSCL(){}function setFrameScale(a){if(!this.is_animated){return}}function reloadSCL(a){this.viewer=a}function Boxes(b,a,c){this.is_animated=true;this.has_layers=false;this.viewer=c;this.map=b;this.olMap=null;this.type=HydsViewer.COMPONENTS.BOXES;this.locale=a;this.boxes=null;this.setFrameComponent=setFrameBC;this.load=loadBC;this.addLayer=addLayer;this.setLayerOpacity=setLayerOpacity;this.setLayerVisibility=setLayerVisibility;this.setLayerPosition=setLayerPosition;this.removeLayer=removeLayer;this.remove=removeC;this.start=startBC;this.stop=stopBC;this.pause=pauseBC;this.getType=getType;this.repaintLayers=repaintLayersComponents;this.recalcPositions=recalcPositions;this.setLayerPosition=setLayerPosition;this.addBox=addBoxBC;this.removeBox=removeBoxBC;this.reloadComponent=reloadBC;this.load()}function loadBC(){this.olMap=new OpenLayers.Control.Boxes();this.boxes=new Array();this.map.addControl(this.olMap)}function addBoxBC(b,e,d,a){var c={name:b,text:e,class_name:d,values:a};this.boxes.push(c);this.olMap.addBox(b,e,d)}function removeBoxBC(a){this.olMap.removeBox(a)}function startBC(){}function pauseBC(){}function stopBC(){}function setFrameBC(c){if(!this.is_animated){return}for(var a=0;a<this.boxes.length;a++){var b=this.boxes[a];if(b.values!=null){this.olMap.css("opacity",b.values[c],b.name)}}}function reloadBC(a){this.viewer=a}function Value(c,a,b,d){this.is_animated=true;this.has_layers=false;this.viewer=d;this.map=c;this.olMap=null;this.type=HydsViewer.COMPONENTS.VALUE;this.locale=a;this.values=null;this.directions=null;this.url=b;this.setFrameComponent=setFrameValue;this.setValues=setValuesVC;this.load=loadVC;this.setLocale=setLocaleVC;this.addLayer=addLayer;this.setLayerOpacity=setLayerOpacity;this.setLayerVisibility=setLayerVisibility;this.setLayerPosition=setLayerPosition;this.removeLayer=removeLayer;this.remove=removeC;this.start=startVC;this.stop=stopVC;this.pause=pauseVC;this.getType=getType;this.repaintLayers=repaintLayersComponents;this.recalcPositions=recalcPositions;this.setLayerPosition=setLayerPosition;this.reloadComponent=reloadVC;this.load()}function loadVC(){this.olMap=new OpenLayers.Control.Value();this.values=new Array();this.map.addControl(this.olMap)}function startVC(){}function pauseVC(){}function stopVC(){}function setFrameValue(a){if(!this.is_animated){return}if(a<0||a>=this.values.length||(this.directions!=null&&a>=this.directions.length)){console.log("[ERROR] no value for the given frame!");return}this.olMap.updateValue(this.values[a]);if(this.directions==null){this.olMap.isWind(false)}else{this.olMap.isWind(true);this.olMap.updateDirection(this.url+this.locale+"/"+this.directions[a]+".png")}}function reloadVC(a){this.viewer=a}function setValuesVC(a){this.values=a[0];this.directions=a[1]}function setLocaleVC(a){this.locale=a};
