telenavis.Utils=function(){var p={G:null,ct:function(){var I="";var aS=document.getElementsByTagName("script");for(var i=0;i<aS.length;i++){if(aS[i].src.indexOf('jsmapv2addon')> -1){var bb=aS[i].src.lastIndexOf("/");I=aS[i].src.substr(0,bb);if(I.substr(I.length-1,1)!="/"){I=I+"/";}break;}}return I;}};return{initialize:function(G){p.G=G;G.contextMenu=new telenavis.ContextMenu('menu',G);G.contextMenu.initialize();G.addEventListener("zoomchanged",telenavis.Utils.hideContextMenu);G.addEventListener("centerchanged",telenavis.Utils.hideContextMenu);G.addEventListener("ondragstart",telenavis.Utils.hideContextMenu);},I:p.ct(),createParamDelegate:function(bs,bq){if(arguments.length>2){var be=[];for(var n=2;n<arguments.length;++n){be.push(arguments[n]);}return function(){return bq.apply(bs,be);};}else{return function(){return bq.call(bs);};}},createLayer:function(G,az,cg){var as=G.getLayerIndex(az);if(as== -1){G.addLayer(new telenavis.Layer(az,cg));as=G.getLayerIndex(az);}var cj=G.getLayersArray()[as];return cj;},getLayer:function(G,az){var as=G.getLayerIndex(az);if(as== -1){return null;}else{var aZ=G.getLayersArray()[as];return aZ;}},ax:function(d){var a=d.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;i+=1){n=a[i].name;if(typeof d[n]==='function'){d[n]=null;}}}a=d.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1){telenavis.Utils.ax(d.childNodes[i]);}}},C:function(str){return str.replace(/^\s+|\s+$/g,"");},hideContextMenu:function(){p.G.contextMenu.hide();},bk:function(bz,cd){var ck=function(){return bz[cd].apply(bz,arguments);};return ck;},bl:function(bz,cO,bA){if(bz.attachEvent){bz.attachEvent("on"+cO,bA);}else{bz.addEventListener(cO,bA,false);}},cw:function(bz,cO,bA){if(bz.detachEvent){bz.detachEvent("on"+cO,bA);}else{bz.removeEventListener(cO,bA,false);}},$:function(id){return document.getElementById(id);},dj:function(cx){cx=cx?cx:window.event;var cZ=cx.clientX;var V=cx.clientY;if(document.body.clientLeft){cZ+=document.body.clientLeft;}if(document.body.clientTop){V+=document.body.clientTop;}V+=document.documentElement.scrollTop;cZ+=document.documentElement.scrollLeft;return new telenavis.Point(cZ,V);},dk:function(bE){var dg=0;var df=0;if(bE.offsetParent){do{df+=bE.offsetLeft;dg+=bE.offsetTop;}while(bE=bE.offsetParent);}return new telenavis.Point(df,dg);},json_parse:function(obj){var at,ch,escapee={'"':'"','\\':'\\','/':'/',b:'\b',f:'\f',n:'\n',r:'\r',t:'\t'},text,error=function(m){throw{name:'SyntaxError',message:m,at:at,text:text};},next=function(c){if(c&&c!==ch){error("Expected '"+c+"' instead of '"+ch+"'");}ch=text.charAt(at);at+=1;return ch;},number=function(){var number,string='';if(ch==='-'){string='-';next('-');}while(ch>='0'&&ch<='9'){string+=ch;next();}if(ch==='.'){string+='.';while(next()&&ch>='0'&&ch<='9'){string+=ch;}}if(ch==='e'||ch==='E'){string+=ch;next();if(ch==='-'||ch==='+'){string+=ch;next();}while(ch>='0'&&ch<='9'){string+=ch;next();}}number= +string;if(isNaN(number)){error("Bad number");}else{return number;}},string=function(){var hex,i,string='',uffff;if(ch==='"'){while(next()){if(ch==='"'){next();return string;}else if(ch==='\\'){next();if(ch==='u'){uffff=0;for(i=0;i<4;i+=1){hex=parseInt(next(),16);if(!isFinite(hex)){break;}uffff=uffff*16+hex;}string+=String.fromCharCode(uffff);}else if(typeof escapee[ch]==='string'){string+=escapee[ch];}else{break;}}else{string+=ch;}}}error("Bad string");},white=function(){while(ch&&ch<=' '){next();}},word=function(){switch(ch){case 't':next('t');next('r');next('u');next('e');return true;case 'f':next('f');next('a');next('l');next('s');next('e');return false;case 'n':next('n');next('u');next('l');next('l');return null;}error("Unexpected '"+ch+"'");},value,array=function(){var array=[];if(ch==='['){next('[');white();if(ch===']'){next(']');return array;}while(ch){array.push(value());white();if(ch===']'){next(']');return array;}next(',');white();}}error("Bad array");},object=function(){var key,object={};if(ch==='{'){next('{');white();if(ch==='}'){next('}');return object;}while(ch){key=string();white();next(':');if(Object.hasOwnProperty.call(object,key)){error('Duplicate key "'+key+'"');}object[key]=value();white();if(ch==='}'){next('}');return object;}next(',');white();}}error("Bad object");};value=function(){white();switch(ch){case '{':return object();case '[':return array();case '"':return string();case '-':return number();default:return ch>='0'&&ch<='9'?number():word();}};return function(source,reviver){var result;text=source;at=0;ch=' ';result=value();white();if(ch){error("Syntax error");}return typeof reviver==='function'?function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}return reviver.call(holder,key,value);}({'':result},''):result;};}};}();telenavis.Utils.Constants=function(){return{cv:"http://localhost/JsMapV2Addon/getTrafficRoads.ashx",cG:"http://localhost/JsMapV2Addon/gettrafficevents.ashx",ci:"#dd0101",ce:"#ffcc00",cf:"#33b100",bF:"gray",aG:"3px",aI:"6px",bZ:"img/trafficpin.png",dn:"img/collisionPin.gif",ca:new telenavis.Point(10,10),cI:"img/close.png",bU:"img/traffic.png",bV:new telenavis.Point(60,20),da:new Array({type:"ΕΚΤΑΚΤΑ ΓΕΓΟΝΟΤΑ",imageSrc:"img/trafficpin.png"},{type:"ΜΠΛΟΚΑΡΙΣΜΑ ΟΔΟΥ",imageSrc:"img/collisionPin.gif"},{type:"ΕΡΓΑ",imageSrc:"img/trafficpin.png"},{type:"ΑΓΝΩΣΤΟΣ",imageSrc:"img/trafficpin.png"}),_routeStartPin:"img/startPin.png",_routeStartPinHotspot:new telenavis.Point(15,15),_routeEndPin:"img/endPin.png",_routeEndPinHotspot:new telenavis.Point(15,15),_routeIntermediatePin:"img/intermediatePin.png",_routeIntermediatePinHotspot:new telenavis.Point(15,15),di:"img/broom.png",bM:"img/createRoute.png",cC:"img/routeStep.png",cz:new telenavis.Point(4,4),bC:"img/loading.gif",aB:150,cn:4,aC:'img/back.png'};}();telenavis.ContextMenu=function(A,G){return{items:[],map:G,show:function(e,am){if(!this.items){return false;}if(!this.items.length){return false;}this.hide();var Q=document.createElement("div");Q.id=this.getDivId();Q.style.position="absolute";Q.style.left=am.x+"px";Q.style.top=am.y+"px";Q.style.backgroundColor="#E3DEDE";Q.style.border="solid 1px gray";Q.style.width="210px";Q.style.zIndex=100;var aa=document.createElement("table");var ab=document.createElement("tbody");aa.cellSpacing=0;aa.cellPadding=0;aa.style.backgroundColor="transparent";aa.style.width="100%";for(var ZZ in this.items){if(this.items[ZZ].imgUrl!==null){if(this.items[ZZ].enabled==true){var F=document.createElement("tr");F.id=this.getDivId()+"_"+ZZ;F.onmouseover=this.cy;var bo=telenavis.Utils.dk(this.map.getDiv());var bK=new telenavis.Point(am.x-bo.x,am.y-bo.y);F.onclick=telenavis.Utils.createParamDelegate(this.items[ZZ],this.items[ZZ].onClick,bK);var bu=this.items[ZZ].imgUrl;var av=document.createElement("td");av.style.width="20px";av.style.border="none";av.align="center";av.vAlign="middle";if(bu!==""){var bx=document.createElement("img");bx.src=bu;av.appendChild(bx);}var M=document.createElement("td");M.style.cursor="default";M.style.fontFamily="Arial";M.style.fontSize="11px";M.style.color="black";M.style.border="none";M.style.whiteSpace="nowrap";M.style.padding="0px";M.appendChild(document.createTextNode(" "+this.items[ZZ].text+" "));var cu=document.createElement("td");M.style.cursor="default";M.style.fontFamily="Arial";M.style.fontSize="11px";M.style.color="black";M.style.border="none";M.style.whiteSpace="nowrap";M.style.padding="5px";F.appendChild(av);F.appendChild(M);F.appendChild(cu);ab.appendChild(F);}}}aa.appendChild(ab);Q.appendChild(aa);var cD=document.body;cD.appendChild(Q);},hide:function(){var Q=document.getElementById(this.getDivId());if(Q){telenavis.Utils.ax(Q);Q.parentNode.removeChild(Q);}},getDivId:function(){return A+"_contextMenu";},addMenuItem:function(ZZ){ZZ.map=this.map;this.items[ZZ.id]=ZZ;this.items.length+=1;},getMenuItem:function(A){return this.items[A];},removeMenuItem:function(A){if(this.items[A]){delete this.items[A];this.items.length-=1;}},cy:function(e){if(!e){e=window.event;}var bE=e.srcElement?e.srcElement:e.target;var F=bE.parentNode;if(F.id===""){F=F.parentNode;}F.style.backgroundColor="yellow";F.onmouseout=function(){F.style.backgroundColor="";};},initialize:function(){this.map=G;var cR=this.map.getLayersArray();telenavis.Utils.createLayer(this.map,'routeLayer',cR.length);this.map.contextMenu.addMenuItem(telenavis.Routing.RouteStartMenuItem);if(telenavis.Utils.Constants.showIntermediate!==null){if(telenavis.Utils.Constants.showIntermediate===true){this.map.contextMenu.addMenuItem(telenavis.Routing.RouteIntermediateMenuItem);}}this.map.contextMenu.addMenuItem(telenavis.Routing.RouteEndMenuItem);this.map.contextMenu.addMenuItem(telenavis.Routing.RouteMenuItem);this.map.contextMenu.addMenuItem(telenavis.Routing.ClearRouteMenuItem);this.map.getDiv().oncontextmenu=function(e){G.contextMenu.show(e,telenavis.Utils.dj(e));return false;};}};};telenavis.ContextMenu.MenuItem=function(){return{id:"",onclick:null,map:null,imgUrl:"",text:"",enabled:true};};telenavis.Routing=function(){return{routeStart:null,routeEnd:null,routeIntermediates:[],routingStrategy:telenavis.Router.optimizationStrategy.TIME,routingType:telenavis.Router.routeType.VEHICLE,routingAvoidedTypes:'',router:null,routerLocale:'el-GR',initialize:function(){this.router=new telenavis.Router("myRouter");this.router.addEventListener(telenavis.Router.events.ROUTE_CREATED,telenavis.Routing.RouteMenuItem.onRouteResponse);},route:function(cF,bp,bn){if(bp){this.routeStart=bp;}if(bn){this.routeEnd=bn;}if(this.routeStart&&this.routeEnd){var cJ=new telenavis.Router();var bY=(this.routingType=="traffic"?true:false);cJ.route(cF,this.routeStart,this.routeEnd,bY,this.routeOptimizationType);}},getRoute:function(bp,bn,db){if(bp){this.routeStart=bp;}if(bn){this.routeEnd=bn;}if(db){this.routeIntermediates=db;}if(this.routeStart&&this.routeEnd){var cY=[];cY.push(this.routeStart);for(var i=0;i<this.routeIntermediates.length;i++){cY.push(this.routeIntermediates[i]);}cY.push(this.routeEnd);this.router.getRoute(cY,this.routingStrategy,this.routingType,this.routerLocale,8,this.routingAvoidedTypes);}}};}();telenavis.Routing.RouteStartMenuItem=function(){var ZZ=new telenavis.ContextMenu.MenuItem();ZZ.id='RouteStart';ZZ.onRouteStartSet=null;ZZ.onClick=function(am){this.map.contextMenu.hide();if(am.srid==null){telenavis.Routing.routeStart=this.map.worldPosAt(am);}else{telenavis.Routing.routeStart=am;}var R=telenavis.Utils.getLayer(this.map,"routePins");if(R===null){R=telenavis.Utils.createLayer(this.map,"routePins",3);}R.removePin("routeStart");var B=new telenavis.Pin('routeStart');B.setWorldPos(telenavis.Routing.routeStart);B.setImageSrc(ZZ.imgUrl);B.setTip("Αρχή διαδρομής");B.setHotspot(telenavis.Utils.Constants._routeStartPinHotspot);R.addPin(B);if(this.onRouteStartSet){this.onRouteStartSet(telenavis.Routing.routeStart);}if(telenavis.Routing.routeEnd!==null){telenavis.Routing.RouteMenuItem.onClick();}};ZZ.imgUrl=telenavis.Utils.I+telenavis.Utils.Constants._routeStartPin;ZZ.text="Ορισμός ως αρχή της διαδρομής";return ZZ;}();telenavis.Routing.RouteEndMenuItem=function(){var ZZ=new telenavis.ContextMenu.MenuItem();ZZ.id='RouteEnd';ZZ.onRouteEndSet=null;ZZ.onClick=function(am){this.map.contextMenu.hide();if(am.srid==null){telenavis.Routing.routeEnd=this.map.worldPosAt(am);}else{telenavis.Routing.routeEnd=am;}var R=telenavis.Utils.getLayer(this.map,"routePins");if(R===null){R=telenavis.Utils.createLayer(this.map,"routePins",3);}R.removePin("routeEnd");var B=new telenavis.Pin('routeEnd');B.setWorldPos(telenavis.Routing.routeEnd);B.setImageSrc(ZZ.imgUrl);B.setTip("Τέλος διαδρομής");B.setHotspot(telenavis.Utils.Constants._routeEndPinHotspot);R.addPin(B);if(this.onRouteEndSet){this.onRouteEndSet(telenavis.Routing.routeEnd);}if(telenavis.Routing.routeStart!==null){telenavis.Routing.RouteMenuItem.onClick();}};ZZ.imgUrl=telenavis.Utils.I+telenavis.Utils.Constants._routeEndPin;ZZ.text="Ορισμός ως τέλος της διαδρομής";return ZZ;}();telenavis.Routing.RouteIntermediateMenuItem=function(){var ZZ=new telenavis.ContextMenu.MenuItem();ZZ.id='RouteIntermediate';ZZ.onRouteIntermediateSet=null;ZZ.onClick=function(am){this.map.contextMenu.hide();while(telenavis.Routing.routeIntermediates.length>0){telenavis.Routing.routeIntermediates.pop();}if(am.srid==null){telenavis.Routing.routeIntermediates.push(this.map.worldPosAt(am));}else{telenavis.Routing.routeIntermediates.push(am);}var R=telenavis.Utils.getLayer(this.map,"routePins");if(R===null){R=telenavis.Utils.createLayer(this.map,"routePins",3);}R.removePin("routeIntermediate");var B=new telenavis.Pin('routeIntermediate');B.setWorldPos(telenavis.Routing.routeIntermediates[0]);B.setImageSrc(ZZ.imgUrl);B.setTip("Ενδιάμεσος προορισμός");B.setHotspot(telenavis.Utils.Constants._routeIntermediatePinHotspot);R.addPin(B);if(this.onRouteIntermediateSet){this.onRouteIntermediateSet(telenavis.Routing.routeIntermediates[0]);}if(telenavis.Routing.routeStart!==null&&telenavis.Routing.routeEnd!==null){telenavis.Routing.RouteMenuItem.onClick();}};ZZ.imgUrl=telenavis.Utils.I+telenavis.Utils.Constants._routeIntermediatePin;ZZ.text="Ορισμός ως ενδιάμεσος προορισμός";return ZZ;}();telenavis.Routing.ClearRouteMenuItem=function(){var ZZ=new telenavis.ContextMenu.MenuItem();ZZ.id='ClearRoute';ZZ.onClearRoute=null;ZZ.onClick=function(){this.map.contextMenu.hide();var R=telenavis.Utils.getLayer(this.map,"routePins");if(R!=null){R.removePin("routeStart");R.removePin("routeIntermediate");R.removePin("routeEnd");var dh=R.getPinsArray();for(var i=dh.length-1;i>=0;i--){R.removePin(dh[i].getId());}}R=telenavis.Utils.getLayer(ZZ.map,"routePolyline");if(R!=null){var dc=R.getPolylinesArray();for(var i=dc.length-1;i>=0;i--){R.removePolyline(dc[i].getId());}}telenavis.Routing.routeStart=null;telenavis.Routing.routeEnd=null;while(telenavis.Routing.routeIntermediates.length>0){telenavis.Routing.routeIntermediates.pop();}if(this.onClearRoute){this.onClearRoute();}};ZZ.imgUrl=telenavis.Utils.I+telenavis.Utils.Constants.di;ZZ.text="Καθαρισμός διαδρομής";return ZZ;}();telenavis.Routing.RouteMenuItem=function(){var ZZ=new telenavis.ContextMenu.MenuItem();ZZ.id="CreateRoute";ZZ.onRoute=null;ZZ.onClick=function(){this.map.contextMenu.hide();if(telenavis.Routing.routeStart!==null&&telenavis.Routing.routeEnd!==null){telenavis.Routing.getRoute(telenavis.Routing.routeStart,telenavis.Routing.routeEnd,telenavis.Routing.routeIntermediates);}};ZZ.imgUrl=telenavis.Utils.I+telenavis.Utils.Constants.bM;ZZ.text="Δημιουργία διαδρομής";ZZ.onRouteResponse=function(K){var R=telenavis.Utils.getLayer(ZZ.map,"routePolyline");if(R===null){R=telenavis.Utils.createLayer(ZZ.map,"routePolyline",1);}R.removePolyline('routePolyline');var O=K.getPolyline('routePolyline');O.fillColor="none";O.fillOpacity=0;O.strokeWidth="5px";R.addPolyline(O);var aT=K.getRouteInstructions();var aD=telenavis.Utils.getLayer(ZZ.map,"routePins");if(aD===null){aD=telenavis.Utils.createLayer(ZZ.map,"routePins",3);}var ay=aD.getPinsArray();for(var j=ay.length-1;j>=0;j--){if(ay[j].getId().match('routeStep')!==null){aD.removePin(ay[j].getId());}}for(var i=0;i<aT.length;i++){var B=new telenavis.Pin('routeStep'+i.toString());B.setWorldPos(aT[i].point);B.setImageSrc(telenavis.Utils.I+telenavis.Utils.Constants.cC);B.setTip(aT[i].directions);B.setHotspot(telenavis.Utils.Constants.cz);if(B.setzIndex){B.setzIndex(-1);}aD.addPin(B);}if(ZZ.onRoute){var bh=K.getRouteResults();ZZ.onRoute(aT,bh.TotalDistance,bh.TotalMinutes,K.getRouteSummary());}};return ZZ;}();telenavis.Routing.initialize();telenavis.Tools={};telenavis.Tools.TrafficTool=function(G){var p={U:0,ai:null,aJ:null,ag: -1,bj:function(){p.aM();var bd=p.ai.getPolylinesArray();for(var i=bd.length-1;i>=0;i--){p.ai.removePolyline(bd[i].getId());}var ay=p.ai.getPinsArray();for(var j=ay.length-1;j>=0;j--){p.ai.removePin(ay[j].getId());}},bm:function(){p.cH();},cH:function(){var ad=telenavis.Utils.Constants.cv;ad+="?key="+telenavis.constants.key;ad+="&zoomLevel="+G.getZoom().toString();ad+="&time="+new Date().getTime();ad+="&callback=telenavis.Tools.TrafficTool.RoadsResponse";telenavis.Tools.TrafficTool.RoadsResponse="";telenavis.createXSRF(ad,p.bI);},bI:function(){if(telenavis.Tools.TrafficTool.RoadsResponse===""){alert('An error occured while accessing the server');}else{p.co(telenavis.Tools.TrafficTool.RoadsResponse);p.cK();}},co:function(K){for(var i=0;i<K.length;i++){var bi=[];for(var j=0;j<K[i].points.length;j++){bi.push(new telenavis.WorldPoint(parseFloat(K[i].points[j].x),parseFloat(K[i].points[j].y),telenavis.Projector.WGSSrid));}poly=new telenavis.Polyline("polyHalo_"+i.toString());poly.setPoints(bi);poly.strokeColor="white";poly.strokeOpacity=1;poly.fillColor="";poly.fillOpacity=0;poly.strokeWidth=telenavis.Utils.Constants.aI;p.ai.addPolyline(poly);}for(var i=0;i<K.length;i++){var bi=[];for(var j=0;j<K[i].points.length;j++){bi.push(new telenavis.WorldPoint(parseFloat(K[i].points[j].x),parseFloat(K[i].points[j].y),telenavis.Projector.WGSSrid));}var O=new telenavis.Polyline("poly_"+i.toString());O.setPoints(bi);switch(K[i].state){case 0:O.strokeColor=telenavis.Utils.Constants.cf;break;case 1:O.strokeColor=telenavis.Utils.Constants.ce;break;case 2:O.strokeColor=telenavis.Utils.Constants.ci;break;case 3:O.strokeColor=telenavis.Utils.Constants.bF;break;}O.strokeOpacity=1;O.fillColor="none";O.fillOpacity=0;O.strokeWidth=telenavis.Utils.Constants.aG;p.ai.addPolyline(O);}},cK:function(){var ad=telenavis.Utils.Constants.cG;ad+="?key="+telenavis.constants.key;ad+="&time="+new Date().getTime();ad+="&callback=telenavis.Tools.TrafficTool.EventsResponse";telenavis.Tools.TrafficTool.EventsResponse="";telenavis.createXSRF(ad,p.cb);},cb:function(){if(telenavis.Tools.TrafficTool.EventsResponse===""){alert('An error occured while accessing the server');}else{p.cs(telenavis.Tools.TrafficTool.EventsResponse);}},cs:function(K){if(K.err!==null){var ar=telenavis.Utils;for(var i=0;i<K.events.length;i++){var B=new telenavis.Pin('TrafficPin'+i.toString());var pt=new telenavis.WorldPoint(K.events[i].x,K.events[i].y,4326);B.setWorldPos(pt);for(var j=0;j<ar.Constants.da.length;j++){if(K.events[i].type==ar.Constants.da[j].type){B.setImageSrc(ar.I+ar.Constants.da[j].imageSrc);}}B.setTip(K.events[i].description.replace(/\\n/g," "));B.setHotspot(ar.Constants.ca);B.onClick=p.bB;B.event=K.events[i];p.ai.addPin(B);}}},bB:function(B){var aZ=telenavis.Utils.createLayer(G,"trafficBalloonLayer",100);p.aJ=aZ.createBalloon(B.getScreenPos(),new telenavis.Size(300,150));var cA=p.aJ.getDiv();cA.innerHTML=p.bW(B);if(G.contextMenu!=null){G.contextMenu.hide();}},aM:function(){try{p.aJ.hide();}catch(ex){}},bW:function(B){switch(B.event.consequences){case "0":B.event.consequences="Ελαφρές";break;case "1":B.event.consequences="Μέτριες";break;case "2":B.event.consequences="Βαριές";break;}var H="";H+="<table>";H+="<tr>";H+="<td><b>"+B.event.type+" - "+B.event.subtype+"</b></td>";H+="<td style='text-align:right;'><img src='"+telenavis.Utils.I+telenavis.Utils.Constants.cI+"' style='cursor:pointer;'/></td>";H+="</tr>";H+="<tr>";H+="<td colspan='2'><b>Επιπτώσεις : </b>"+B.event.consequences+"</td>";H+="</tr>";H+="<tr>";H+="<td colspan='2'><b>Δρόμος - Δήμος :</b> "+B.event.name+" - "+B.event.municipality+"</td>";H+="</tr>";H+="<tr>";H+="<td colspan='2'><b>Περιγραφή :</b>"+B.event.description.replace(/\\n/g," ")+"</td>";H+="</tr>";H+="<tr>";H+="<td><b>Έναρξη :</b></td><td>"+B.event.dtFrom+"</td>";H+="</tr>";H+="<tr>";H+="<td><b>Εκτιμ. Λήξη :</b></td><td>"+B.event.dtTo+"</td>";H+="</tr>";H+="</table>";return H;}};p.ai=telenavis.Utils.getLayer(G,'trafficLayer');if(p.ai===null){p.ai=telenavis.Utils.createLayer(G,'trafficLayer',3);}var J=[];J.state=0;J.onclick=function(){if(J.state===0){J.showTraffic();}else{J.hideTraffic();}};J.showTraffic=function(){if(J.state==1){return;}J.state=1;p.U=G.getZoom();p.bm();};J.hideTraffic=function(){if(J.state===0){return;}J.state=0;p.U=0;p.bj();};J.refreshTraffic=function(){if(J.state===0){return;}J.hideTraffic();J.showTraffic();};J.hideBalloon=function(){p.aM();};J.mapZoomChanged=function(){if(p.U===0){return;}var bX=G.getZoom();var aF=false;if(telenavis.constants.maxZoom==12){if(bX<6){p.bj();return;}switch(bX){case 6:if(p.U!=6){aF=true;}break;case 7:case 8:if(p.U!=7&&p.U!=8){aF=true;}break;case 9:case 10:if(p.U!=9&&p.U!=10){aF=true;}break;case 11:case 12:if(p.U!=11&&p.U!=12){aF=true;}break;}}else{if(p.ag<10&&bX>=10){aF=true;}else if(bX<10){p.bj();p.ag=G.getZoom();return;}switch(bX){case 10:case 11:case 12:if(p.U<10||p.U>12){aF=true;}break;case 13:case 14:if(p.U<13||p.U>14){aF=true;}break;case 15:case 16:if(p.U<15||p.U>16){aF=true;}break;case 17:case 18:if(p.U<17||p.U>18){aF=true;}break;}}if(aF){p.U=G.getZoom();p.bj();p.bm();}p.ag=G.getZoom();};G.addEventListener('zoomchanged',J.mapZoomChanged);p.ag=G.getZoom();return J;};telenavis.Utils.StatusDiv=function(G){var aW={bR:function(){var ag=G.getDiv();var g=document.createElement("div");g.id=this.getDivId();g.style.position="absolute";g.style.left=parseInt(ag.clientWidth,10)-telenavis.Utils.Constants.bc+"px";g.style.top=parseInt(ag.clientHeight,10)-telenavis.Utils.Constants.aU+"px";g.style.width=telenavis.Utils.Constants.bc+"px";g.style.height=telenavis.Utils.Constants.aU+"px";g.style.overflow="hidden";g.style.backgroundColor=telenavis.Utils.Constants.bO;g.style.border=telenavis.Utils.Constants.bN;g.style.fontFamily=telenavis.Utils.Constants.bP;g.style.fontSize=telenavis.Utils.Constants.bS;g.style.visibility="hidden";g.style.zIndex=telenavis.Utils.Constants.bQ;g.scrollStatus="";g.innerHTML="Message";ag.appendChild(g);return;},getDivId:function(){return G.getId()+".statusDiv";},show:function(){var g=document.getElementById(this.getDivId());if(g){if(g.scrollStatus=="1"&&g.style.visibility=="visible"){return;}g.scrollStatus="1";var ag=G.getDiv();var ba=parseInt(ag.clientHeight,10);var aV=parseInt(ag.clientHeight,10)-telenavis.Utils.Constants.aU;var V=ba;g.style.top=V+"px";g.style.visibility='visible';var aE=function(){V-=1;if(g.scrollStatus!="1"){return;}if(V>aV){g.style.top=V+"px";setTimeout(aE,2);}else{g.style.top=V+"px";g.scrollStatus="";}};setTimeout(aE,1000);}},hide:function(){var g=document.getElementById(aW.getDivId());if(g){if(g.scrollStatus=="-1"||g.style.visibility=="hidden"){return;}g.scrollStatus="-1";var ag=G.getDiv();var aV=ag.clientHeight;var ba=ag.clientHeight-telenavis.Utils.Constants.aU;var V=ba;g.style.top=V+"px";g.style.visibility="visible";var aE=function(){V+=1;if(g.scrollStatus!="-1"){return;}if(V<aV){g.style.top=V+"px";setTimeout(aE,2);}else{g.style.top=V+"px";g.style.visibility="hidden";g.scrollStatus="";}};setTimeout(aE,2);}},showMessage:function(aH,by){var g=document.getElementById(this.getDivId());if(g){var H="";H+="<table cellspacing=0 cellpadding=0 style=\"border:none; margin:0px\"><tr>";if(by){H+="<td style=\"border:none; vertical-align:middle;\"><img src='"+by+"' style=\"border:none; vertical-align:middle\" /></td>";}else{H+="<td style=\"border:none; vertical-align:middle;\"><img src='"+telenavis.Utils.I+telenavis.Utils.Constants.bT+"' style=\"border:none; vertical-align:middle\"/></td>";}H+="<td style=\"border:none; vertical-align:middle;\">"+aH+"</td></tr></table>";g.innerHTML=H;}this.show();}};aW.bR();return aW;};telenavis.Utils.GeocodingControl=function(A){var P={1001:"The HTML container to hold the geocoding control, could not be found.",1002:"Οδός:",1003:"<Οδός><Αριθμός>",1004:"Δήμος:",1005:"Τ.Κ.:",1006:"Νομός:",1007:"Χώρα:",1008:"Ελλάδα",1010:"Αναζήτηση",1011:"Πρέπει να δώσετε όνομα οδού",1012:"Το όνομα της οδού και ο αριθμός.",1013:"Επόμενο",1014:"Προηγούμενο",1015:"Το όνομα του δήμου",1016:"Ο ταχυδρομικός κωδικός",1017:"Το όνομα του νομού",1030:"Βρέθηκαν τα εξής",1031:"Δεν βρέθηκαν αποτελέσματα"};var p={bL:function(aX){var ar=telenavis.Utils;var aj=ar.$(aX);if(!aj){throw new Error(P.cN);}var ae=document.createElement("div");ae.id=A+".container";ae.style.position="relative";ae.style.left="0px";ae.style.top="0px";ae.style.width="100%";ae.style.height="100%";var g=document.createElement("div");g.id=A+".main";g.style.position="absolute";g.style.left="0px";g.style.top="0px";g.style.width="100%";g.style.height="100%";var aa=document.createElement("table");aa.cellSpacing=0;aa.style.width="100%";var cX="90%";var ab=document.createElement("tbody");var F=document.createElement("tr");D=p.af();D.appendChild(document.createTextNode(P[1002]));F.appendChild(D);var au=document.createElement("input");au.id=A+".road";au.value="";au.title=P[1012];au.style.fontFamily=aj.style.fontFamily;au.style.fontSize=aj.style.fontSize;au.style.color=aj.style.color;au.onkeypress=telenavis.Utils.bk(p,"aA");D=p.af();D.align="right";D.appendChild(au);F.appendChild(D);ab.appendChild(F);F=document.createElement("tr");D=p.af();D.appendChild(document.createTextNode(P[1004]));F.appendChild(D);var aP=document.createElement("input");aP.id=A+".council";aP.value="";aP.title=P[1015];aP.style.fontFamily=aj.style.fontFamily;aP.style.fontSize=aj.style.fontSize;aP.style.color=aj.style.color;aP.onkeypress=telenavis.Utils.bk(p,"aA");D=p.af();D.align="right";D.appendChild(aP);F.appendChild(D);ab.appendChild(F);if(o.showPostcode===true){F=document.createElement("tr");D=p.af();D.appendChild(document.createTextNode(P[1005]));F.appendChild(D);var aQ=document.createElement("input");aQ.id=A+".postcode";aQ.value="";aQ.title=P[1016];aQ.style.fontFamily=aj.style.fontFamily;;aQ.style.fontSize=aj.style.fontSize;aQ.style.color=aj.style.color;aQ.onkeypress=telenavis.Utils.bk(p,"aA");D=p.af();D.align="right";D.appendChild(aQ);F.appendChild(D);ab.appendChild(F);}F=document.createElement("tr");D=p.af();D.appendChild(document.createTextNode(P[1006]));F.appendChild(D);var aR=document.createElement("input");aR.id=A+".state";aR.value="";aR.title=P[1017];aR.style.fontFamily=aj.style.fontFamily;;aR.style.fontSize=aj.style.fontSize;aR.style.color=aj.style.color;aR.onkeypress=telenavis.Utils.bk(p,"aA");D=p.af();D.align="right";D.appendChild(aR);F.appendChild(D);ab.appendChild(F);if(o.showCountry){F=document.createElement("tr");D=p.af();D.appendChild(document.createTextNode(P[1007]));F.appendChild(D);var aw=document.createElement("input");aw.id=A+".country";aw.value=P[1008];aw.title=P[1008];aw.style.fontFamily=aj.style.fontFamily;;aw.style.fontSize=aj.style.fontSize;aw.style.color=aj.style.color;aw.onkeypress=telenavis.Utils.bk(p,"aA");aw.disabled=true;D=document.createElement("td");D.align="right";D.appendChild(aw);F.appendChild(D);ab.appendChild(F);}F=document.createElement("tr");var aL=document.createElement("input");aL.type="button";aL.id=A+".find";aL.value=P[1010];aL.title=P[1010];aL.style.fontFamily=aj.style.fontFamily;aL.style.fontSize=aj.style.fontSize;aL.style.color=aj.style.color;aL.onclick=p.bg;D=p.af();D.colSpan=2;D.align="center";D.appendChild(aL);F.appendChild(D);ab.appendChild(F);aa.appendChild(ab);g.appendChild(aa);ae.appendChild(g);aj.appendChild(ae);},aA:function(e){e=(e?e:window.event);if(e.keyCode==13){p.bg();}},bg:function(){var ar=telenavis.Utils;var ao=ar.$(A+".road").value;var aq=ar.$(A+".council").value;var ap=ar.$(A+".state").value;if(ao===""){alert(P[1011]);return;}var aN="";aN+=ao+",";aN+=aq+",";aN+=ap+",";var cr=new telenavis.Geocoder();cr.geocode(aN,p.cc);p.bJ();},cc:function(L){p.cE();switch(L.ResponseCode){case 0:var bw=L.Candidates[0];var ah=bw.address.split(",");if(o.onAddressSelected){o.onAddressSelected({address:bw.address,position:new telenavis.WorldPoint(bw.x,bw.y,telenavis.Projector.WGSSrid)});}var ar=telenavis.Utils;var ao=ar.$(A+".road");var aq=ar.$(A+".council");var bf=ar.$(A+".postcode");var ap=ar.$(A+".state");if(ah.length==3){ao.value=ar.C(ah[0]);aq.value=ar.C(ah[1]);ap.value=ar.C(ah[2]);}else if(ah.length==4){ao.value=ar.C(ah[0]);if(bf){bf.value=ar.C(ah[2]);}aq.value=ar.C(ah[2]);ap.value=ar.C(ah[3]);}p.aK();break;case 5:p.bG(L.ResponseDescription);break;default:p.bH(L.ResponseCode,L);break;}},bG:function(cL){var ar=telenavis.Utils;var aj=ar.$(A+".container");var T=ar.$(A+".main");T.style.visibility="hidden";var g=document.createElement("div");g.id=A+".errorDiv";g.style.width=T.clientWidth+"px";g.style.height=T.clientHeight+"px";g.style.position="absolute";g.style.left="0px";g.style.top="0px";var an=document.createElement("input");an.id=A+".backButton";an.value=P[1014];an.type="button";ar.bl(an,"click",p.aK);ar.ax(g);g.appendChild(document.createTextNode(P[1031]));g.appendChild(document.createElement("br"));g.appendChild(document.createElement("br"));g.appendChild(an);aj.appendChild(g);},bH:function(bD,L){var ar=telenavis.Utils;var aj=ar.$(A+".container");var T=ar.$(A+".main");T.style.visibility="hidden";var g=document.createElement("div");g.id=A+".candidatesDiv";g.style.width=T.clientWidth+"px";g.style.height=T.clientHeight+"px";g.style.maxHeight=T.clientHeight-10+"px";g.style.overflowY="scroll";g.style.position="absolute";g.style.left="0px";g.style.top="0px";var aH=P[1030];if(!aH){aH="unknown resp code: "+bD;}g.appendChild(document.createTextNode(aH+"  "));var aC=new Image();aC.title="Πίσω";aC.style.cursor="pointer";aC.src=ar.I+ar.Constants.aC;ar.bl(aC,"click",p.aK);g.appendChild(aC);var cS=document.createElement("ul");cS.style.paddingLeft="0px";cS.style.marginLeft="15px";cS.style.paddingTop="0px";cS.style.marginTop="0px";for(var i=0;i<L.Candidates.length;i++){var bw=L.Candidates[i];var cU=document.createElement("li");var cQ=document.createElement("a");cQ.href="#";cQ.appendChild(document.createTextNode(bw.address));cQ.candidate=bw;cQ.onclick=function(){var cV=this.candidate;var cW=this.candidate.address;var ak=cW.split(",");var ao=ar.$(A+".road");var aq=ar.$(A+".council");var ap=ar.$(A+".state");var cT=ar.$(A+".postcode");if(ak.length==3){ao.value=ar.C(ak[0]);aq.value=ar.C(ak[1]);ap.value=ar.C(ak[2]);}else if(ak.length==4){ao.value=ar.C(ak[0]);if(cT!==null){cT.value=ar.C(ak[1]);}aq.value=ar.C(ak[2]);ap.value=ar.C(ak[3]);}if(o.onAddressSelected){o.onAddressSelected({address:cW,position:new telenavis.WorldPoint(cV.x,cV.y,telenavis.Projector.WGSSrid)});}var al=ar.$(A+".candidatesDiv");ar.ax(al);al.parentNode.removeChild(al);p.aK();};cU.appendChild(cQ);cS.appendChild(cU);}g.appendChild(cS);aj.appendChild(g);return;},bt:function(){var ar=telenavis.Utils;var ac=ar.$(A+".candidatesList");var aY=ac.selectedIndex;if(aY== -1){return;}var bw=ac.options[aY].value;var ak=bw.split(",");var ao=ar.$(A+".road");var aq=ar.$(A+".council");var ap=ar.$(A+".state");var cT=ar.$(A+".postcode");if(ak.length==3){ao.value=ar.C(ak[0]);aq.value=ar.C(ak[1]);ap.value=ar.C(ak[2]);}else if(ak.length==4){ao.value=ar.C(ak[0]);if(cT!==null){cT.value=ar.C(ak[1]);}aq.value=ar.C(ak[2]);ap.value=ar.C(ak[3]);}var cp=ar.$(A+".candidatesCoordList");var cq=cp.options[aY].value;var bv=cq.split("|");if(o.onAddressSelected){o.onAddressSelected({address:bw,position:new telenavis.WorldPoint(parseFloat(bv[0]),parseFloat(bv[1]),telenavis.Projector.WGSSrid)});}var al=ar.$(A+".candidatesDiv");ar.ax(al);al.parentNode.removeChild(al);p.aK();},aK:function(){var ar=telenavis.Utils;var an=document.getElementById(A+".backButton");if(an!==null){ar.cw(an,"click",p.aK);}var al=ar.$(A+".candidatesDiv");if(al){ar.ax(al);al.parentNode.removeChild(al);}var aO=ar.$(A+".errorDiv");if(aO){ar.ax(aO);aO.parentNode.removeChild(aO);}var ae=ar.$(A+".main");ae.style.visibility="visible";},cl:function(e){if(!e){e=window.event;}if(e.keyCode==13){p.bt();}},bJ:function(){var ar=telenavis.Utils;var aj=ar.$(A+".container");var T=ar.$(A+".main");T.style.visibility="hidden";var g=document.createElement("div");g.id=A+".waitDiv";g.style.width=T.clientWidth+"px";g.style.height=T.clientHeight+"px";g.style.position="absolute";g.style.left="0px";g.style.top="0px";g.innerHTML="<table width='100%' height='100px'>"+"<tr>"+"<td align='center' valign='middle'>"+"<img src='"+ar.I+ar.Constants.bC+"'>"+"</td>"+"</tr>"+"</table>";aj.appendChild(g);g.focus();},cE:function(){var g=telenavis.Utils.$(A+".waitDiv");if(g){telenavis.Utils.ax(g);g.parentNode.removeChild(g);}},af:function(){var D=document.createElement("td");return D;}};var o={showPostcode:false,showCountry:false,renderControl:function(aX){p.bL(aX);},onAddressSelected:null};return o;};
