var telenavisOverlayLayer=function(P,B){if(typeof(telenavis)=="undefined"){throw new Error('The overlay layer requires telenavis JsMap2 script.');}this.m=null;this.P=P;this.B=B;this.ae=false;this.aF=0;this.aU=0;this.J='http://live5.telenavis.com/telenavisOverlayLayer/';this.selectedCategory=0;this.languages={GREEK:0,ENGLISH:1};this.categories={TRAFFIC:1,TRANSPORT:2,CULTURE:4};this.clientId=54723618;this.traffic = new TrafficOverlay(this);;this.transport = new TransportOverlay(this);;this.culture = new CultureOverlay(this);};telenavisOverlayLayer.prototype.aK=function(D){var f=this.c.J+"gettile.ashx?x="+D.x+"&y="+D.y+"&z="+D.z;f+="&l="+this.c.aU;f+="&cid="+this.c.clientId;var I='';var bb=[];if(this.c.traffic){if((this.c.selectedCategory&this.c.categories.TRAFFIC)==this.c.categories.TRAFFIC){var aS=this.c.traffic.aM();if(aS!=null){I+=aS;}bb.push(this.c.categories.TRAFFIC+"-"+this.c.traffic.getZIndex());}}if(this.c.transport){if((this.c.selectedCategory&this.c.categories.TRANSPORT)==this.c.categories.TRANSPORT){var ar=this.c.transport.aM();if(ar!=null){I+=ar;}bb.push(this.c.categories.TRANSPORT+"-"+this.c.transport.getZIndex());}}if(this.c.culture){if((this.c.selectedCategory&this.c.categories.CULTURE)==this.c.categories.CULTURE){var bD=this.c.culture.aM();if(bD!=null){I+=bD;}bb.push(this.c.categories.CULTURE+"-"+this.c.culture.getZIndex());}}if(I===''){return null;}else{return f+I+"&zi="+bb.join('|');}};telenavisOverlayLayer.prototype.aJ=function(D,Q){var f=this.c.J+"gettilefeatures.ashx?x="+D.x+"&y="+D.y+"&z="+D.z;f+="&c="+this.c.selectedCategory;f+="&l="+this.c.aU;f+="&cid="+this.c.clientId;f+="&cb=tlft";f+="&tm="+new Date().getTime();if(this.c.traffic){if((this.c.selectedCategory&this.c.categories.TRAFFIC)==this.c.categories.TRAFFIC){f+=this.c.traffic.aL();}}if(this.c.transport){if((this.c.selectedCategory&this.c.categories.TRANSPORT)==this.c.categories.TRANSPORT){f+=this.c.transport.aL();}}if(this.c.culture){if((this.c.selectedCategory&this.c.categories.CULTURE)==this.c.categories.CULTURE){f+=this.c.culture.aL();}}var aC=function(){var ao=tlft;if(ao==null){Q([]);}else{Q(ao);}};this.c.ag(f,aC);};telenavisOverlayLayer.prototype.onFeatureClicked=function(ao,aP){var m=(this.c!=null?this.c:this.m.c);var B=m.B;var R=B.getLayer("balloonLayer");if(R==null){R=new telenavis.Layer("balloonLayer",10);B.addLayer(R);}var ad=function(){var af=null;var bf=function(aY){return(typeof HTMLElement==="object"?aY instanceof HTMLElement:(typeof aY==="object"&&aY.nodeType===1&&typeof aY.nodeName==="string"));};var aX=null;if(ao[0].lr==m.categories.TRAFFIC){af=R.createBalloon(B.screenPosAt(aP),m.traffic.balloonSize);aX=m.traffic.getBalloonContents(trflr);}else if(ao[0].lr==m.categories.TRANSPORT){af=R.createBalloon(B.screenPosAt(aP),m.transport.balloonSize);aX=m.transport.getBalloonContents(trflr);}else if(ao[0].lr==m.categories.CULTURE){af=R.createBalloon(B.screenPosAt(aP),m.culture.balloonSize);aX=m.culture.getBalloonContents(trflr);}if(bf(aX)===true){var bd=af.getDiv();bd.appendChild(aX);var be=bg.bh(bd.innerHTML);af.setSize(be);}else{af.setContents(aX);}};if(ao.length==1){var f=m.J+'balloon.ashx';f+="?c="+ao[0].lr;f+='&f='+ao[0].id;f+='&cb=trflr';f+="&l="+m.aU;f+="&cid="+m.clientId;f+="&t="+new Date().getTime();if(ao[0].lr==m.categories.TRAFFIC){f+=m.traffic.aQ();}else if(ao[0].lr==m.categories.TRANSPORT){f+=m.transport.aQ();}else if(ao[0].lr==m.categories.CULTURE){f+=m.culture.aQ();}m.ag(f,ad);}else{var bO=[],bt=[],bz=[];for(var i=0;i0){bM=m.traffic.getBalloonContentsMultiple(bO);bd.appendChild(bM);}if(bt.length>0){bQ=m.transport.getBalloonContentsMultiple(bt);bd.appendChild(bQ);}if(bz.length>0){bm=m.culture.getBalloonContentsMultiple(bz);bd.appendChild(bm);}var af=R.createBalloon(B.screenPosAt(aP),m.culture.balloonSize);var bs=af.getDiv();if(bs){bs.appendChild(bN);var be=bh(bN.innerHTML);af.setSize(be);}}};telenavisOverlayLayer.prototype.ag=function(f,ad){var aa=function(){ad();r.parentNode.removeChild(r);};var r=document.createElement("script");r.type="text/javascript";if(r.addEventListener){r.onload=aa;}else if(r.readyState){r.onreadystatechange=function(){if(r.readyState=="loaded"){aa();}};}r.onerror=aa;r.src=f;document.body.appendChild(r);return r;};var bL=function(aY,bk){if(aY.style.styleFloat!=null){aY.style.styleFloat=bk;}else{aY.style.cssFloat=bk;}};var bh=function(bR){if(bR===null||bR===""){return new telenavis.Size(0,0);}var bd=document.createElement("div");bd.id='divMeasure';bd.innerHTML=""+bR+"";bd.style.visibility="hidden";bd.style.position="absolute";bd.style.left="0px";bd.style.top="0px";bd.style.overflow="hidden";document.body.appendChild(bd);var bj=document.getElementById("divMeasure").offsetWidth;var bE=document.getElementById("divMeasure").offsetHeight;bd.parentNode.removeChild(bd);return new telenavis.Size(bj,bE);};telenavisOverlayLayer.prototype.initialize=function(){this.m=new telenavis.OverlayLayer(this.P,this.aK,this.aJ);this.m.featureClicked=this.onFeatureClicked;this.m.c=this;};telenavisOverlayLayer.prototype.getId=function(){return this.P;};telenavisOverlayLayer.prototype.show=function(){if(!this.ae){this.B.addLayer(this.m);this.ae=true;}else{if(this.traffic.ba){}else{this.m.show();}}};telenavisOverlayLayer.prototype.hide=function(){if(this.ae){this.m.hide();}};telenavisOverlayLayer.prototype.A=function(aH){return typeof(aH)!="undefined";};var TrafficOverlay=function(c){this.c=c;this.at=946684800000;this.v=null;this.aW=0;this.ba=false;this.events={DATA_AVAILABLE:'available',DATA_UNAVAILABLE:'unavailable',ERROR_OCCURED:'error'};this.closeImageSrc='img/traffic/close.png';this.balloonSize=new telenavis.Size(300,170);this.minVisibleZoom=9;this.maxVisibleZoom=18;};TrafficOverlay.prototype.ab=function(j,aB){j=j.toString();if(!this.c.A(this.l)){return;}var k=this,ap=false,g,aj=k.l[j];if(k.c.A(aj)){var ah=[];for(g=0;g";d+="";if(this.closeImageSrc){d+="\""+uvu.ac+"\"";}d+="";d+="";d+="";d+=""+uvu.as+""+o.Consequences+"";d+="";d+="";d+=""+uvu.ak+" "+o.Name+" - "+o.Municipality+"";d+="";d+="";d+=""+uvu.av+""+o.Description.replace(/\\n/g," ")+"";d+="";d+="";d+=""+uvu.am+""+this.aq(aO)+"";d+="";d+="";d+=""+uvu.au+""+this.aq(az)+"";d+="";d+="";return d;};TrafficOverlay.prototype.getBalloonContentsMultiple=function(ao){var bM=document.createElement('div');bH=document.createElement('strong');bH.appendChild(document.createTextNode(uvu.bi+' ('+ao.length+')'));bM.appendChild(bH);bM.appendChild(document.createElement('br'));var bG=document.createElement('ul');for(var i=0;i("+ai.Category+") "+ai.Name+"";d+="";if(this.closeImageSrc){d+="\""+aV.ac+"\"";}d+="";d+="";d+="";d+="";d+="";d+="";d+=""+ai.Description+"";d+="";d+="";return d;};TransportOverlay.prototype.getBalloonContentsMultiple=function(ao){ao.sort(this.categorySorter);var bQ=document.createElement('div');bH=document.createElement('strong');bH.appendChild(document.createTextNode(aV.bi+' ('+ao.length+')'));bQ.appendChild(bH);bQ.appendChild(document.createElement('br'));var bG=document.createElement('ul');for(var i=0;ibK.Category){return 1;}else if(bu.CategorybK.Category){return 1;}else if(bu.Category"+ai.Category+" ";d+="";if(this.closeImageSrc){d+="\""+bq.ac+"\"";}d+="";d+="";d+="";d+="";d+="";d+="";d+=""+ai.Title+"";d+="";d+="";d+=""+bq.bV+"";d+="";d+="";return d;};CultureOverlay.prototype.getBalloonContentsMultiple=function(ao){ao.sort(this._categorySorter);var bm=document.createElement('div');bH=document.createElement('strong');bH.appendChild(document.createTextNode(bq.bi+' ('+ao.length+')'));bm.appendChild(bH);bm.appendChild(document.createElement('br'));var bG=document.createElement('ul');for(var i=0;i