function Point(){this.dk;this.camino=false;this.nombre;this.descripcion;this.titulo=false;this.lat;this.lng;this.calle;this.nro;this.localidad;this.provincia;this.showDialogs=false;this.contentDialog;this.response}Point.prototype.setDk=function(a){this.dk=a};Point.prototype.getDk=function(){return this.dk};Point.prototype.setLat=function(a){this.lat=parseFloat(a)};Point.prototype.getLat=function(){return this.lat};Point.prototype.setLong=function(a){this.lng=parseFloat(a)};Point.prototype.getLong=function(){return this.lng};Point.prototype.getLatLong=function(){return new GLatLng(this.getLat(),this.getLong(),true)};Point.prototype.setCamino=function(a){this.camino=a};Point.prototype.getCamino=function(){return this.camino};Point.prototype.setCalle=function(a){this.calle=a};Point.prototype.getCalle=function(){return this.calle};Point.prototype.setNro=function(a){this.nro=a};Point.prototype.getNro=function(){return this.nro};Point.prototype.setLocalidad=function(a){this.localidad=a};Point.prototype.getLocalidad=function(){return this.localidad};Point.prototype.setProvincia=function(a){this.provincia=a};Point.prototype.getProvincia=function(){return this.provincia};Point.prototype.setTitle=function(a){this.titulo=a};Point.prototype.getTitle=function(){return this.titulo};Point.prototype.getAddress=function(){var a="";if(this.getCalle()){if(this.getNro()){a+=this.getCalle()+" "+this.getNro()}}if(this.getLocalidad()){a+=","+this.getLocalidad()}if(this.getProvincia()){a+=","+this.getProvincia()}return a};Point.prototype.setShowDialog=function(a){this.showDialogs=a};Point.prototype.showDialog=function(){return this.showDialogs};Point.prototype.setDialog=function(a){this.contentDialog=a};Point.prototype.setResponse=function(a){this.response=a};Point.prototype.getResponse=function(){return this.response};Point.prototype.getComoLlegar=function(c){var a=this.getAddress();var b="";b+='<div id="como_llegar" class="mapa_ubicacion">';b+="     Como llegar : ";b+="     <a onclick=\"showText('from',"+this.getDk()+",'"+a+"',"+c+');" style="cursor:pointer;">Hasta Aqu&iacute;</a>';b+="     &nbsp; - &nbsp;";b+="     <a onclick=\"showText('to',"+this.getDk()+",'"+a+"',"+c+');" style="cursor:pointer;" >Desde Aqu&iacute;</a> ';b+='     <div id="c_from_'+this.getDk()+'" style="display:none;" class="direccion" >';b+="     Direcci&oacute;n Origen";b+='     <input type="text" size="25" id="fromAddress_'+this.getDk()+'" name="from"';b+='     value=""/>';b+="     <input class=\"button_map\" type=button value='IR' onclick='setDirections("+this.getDk()+", "+c+")' />";b+="    </div>";b+='    <div id="c_to_'+this.getDk()+'" style="display:none;" class="direccion" >';b+="    Direcci&oacute;n Destino";b+='    <input type="text" size="25" id="toAddress_'+this.getDk()+'" name="to"';b+='    value="" />';b+="     <input class=\"button_map\" type=button value='IR' onclick='setDirections("+this.getDk()+", "+c+")' />";b+="   </div>";b+='   <div class="div_back" id="back_'+this.getDk()+'" style="display:none;cursor:pointer;">';b+='       <a onclick="volver('+this.getDk()+","+c+');"><< volver</a>';b+="   </div>";b+="</div>";return b};Point.prototype.getDialogResponse=function(a){return"<div class='directionGeo'>"+this.getResponse()+"</div>"};Point.prototype.getDialog=function(b){var a="";a+="<div class='contenidoGlobo'>";if(this.contentDialog){a+=this.contentDialog}if(this.getCamino()){a+=this.getComoLlegar(b)}if(this.getResponse()){a+=this.getDialogResponse()}a+="</div>";return a};var vecMap=new Array();function Map(a){this.idContent=a;this.map;this.geocoder;this.globalReference=false;this.centerMap=false;this.cache=false;this.index;this.gdir=null;this.initialtype=G_NORMAL_MAP;this.zoom=15;this.zoomControl=true;this.typeControl=true;this.scaleControl=true;this.vecPoint=new Array();this.vecGlobalReference=new Array();this.vecOverlay=new Array()}Map.prototype.addPoint=function(a){this.vecPoint[this.vecPoint.length]=a};Map.prototype.addOverlays=function(a){this.vecOverlay[this.vecOverlay.length]=a};Map.prototype.getOverlay=function(){return this.vecOverlay};Map.prototype.setCenterMap=function(a){this.centerMap=a};Map.prototype.getCenterMap=function(a){return this.centerMap};Map.prototype.setCache=function(a){this.cache=a};Map.prototype.getCache=function(){return this.cache};Map.prototype.setZoomMap=function(a){this.zoom=a};Map.prototype.getZoomMap=function(){return this.zoom};Map.prototype.showZoomControlMap=function(a){if(a){if(a=="false"){this.zoomControl=false}else{this.zoomControl=true}}else{return this.zoomControl}};Map.prototype.showTypeControlMap=function(a){if(a){if(a=="false"){this.typeControl=false}else{this.typeControl=true}}else{return this.typeControl}};Map.prototype.showScaleControlMap=function(a){if(a){if(a=="false"){this.scaleControl=false}else{this.scaleControl=true}}else{return this.scaleControl}};Map.prototype.showMap=function(){if(!this.getCache()){this.create()}};Map.prototype.setIndex=function(a){this.index=a};Map.prototype.getIndex=function(){return this.index};Map.prototype.convertType=function(a){switch(a){case"normal":return G_NORMAL_MAP;break;case"satelite":return G_SATELLITE_MAP;break;case"hibrido":return G_HYBRID_MAP;break;case"relieve":return G_PHYSICAL_MAP;break}};Map.prototype.setInitialType=function(a){this.initialtype=this.convertType(a)};Map.prototype.getInitialType=function(){return this.initialtype};Map.prototype.getGdir=function(){return this.gdir};Map.prototype.create=function(){if(GBrowserIsCompatible()){this.map=new GMap2(document.getElementById(this.idContent));this.setIndex(vecMap.length);this.map.addMapType(G_PHYSICAL_MAP);vecMap[vecMap.length]=this;this.map.setMapType(this.getInitialType());if(this.showZoomControlMap()){this.map.addControl(new GLargeMapControl())}if(this.showTypeControlMap()){this.map.addControl(new GMapTypeControl())}if(this.showScaleControlMap()){this.map.addControl(new GScaleControl())}this.gdir=new GDirections(this.map);this.geocoder=new GClientGeocoder();if(this.getCenterMap()){this.map.setCenter(this.getCenterMap(),this.getZoomMap())}if(this.getGlobal()){this.showGlobalReference()}else{var c=this.vecPoint;for(var b=0;b<c.length;b++){this.showPoint(c[b])}var d=this.getOverlay();for(var a=0;a<d.length;a++){this.map.addOverlay(d[a])}}}};Map.prototype.showPoint=function(d){if(this.geocoder){var e=this;var c=this.map;var a=d.getLatLong();var b=d;this.geocoder.getLocations(a,function(i){if(!i){alert(i+" not found")}else{try{var g=i.Placemark[0];var l=g.Point.coordinates[1];var j=g.Point.coordinates[0];var f=new GLatLng(l,j,true);if(b.getTitle()){var h=new GMarker(f,{title:b.getTitle()})}else{var h=new GMarker(f)}d.setResponse(g.address);c.addOverlay(h);c.setCenter(f,e.getZoomMap());GEvent.addListener(h,"click",function(){h.openInfoWindowHtml(d.getDialog(e.getIndex()));vecMap[e.getIndex()].map.updateInfoWindow()});if(d.showDialog()){h.openInfoWindowHtml(d.getDialog(e.getIndex()));setTimeout("refreshDialog ("+e.getIndex()+")",3000)}}catch(k){}}})}};function refreshDialog(a){vecMap[a].map.updateInfoWindow()}Map.prototype.setGlobal=function(a){this.globalReference=a};Map.prototype.getGlobal=function(){return this.globalReference};Map.prototype.addGlobalReference=function(a){this.vecGlobalReference[this.vecGlobalReference.length]=a};Map.prototype.centrarMapa=function(){if(this.geocoder){var a=this;map=this.map;address=","+this.getCenterMap();this.geocoder.getLatLng(address,function(b){if(!b){alert(address+" not found")}else{map.setCenter(b,a.getZoomMap())}})}};Map.prototype.showGlobalReference=function(){var b=this.vecGlobalReference;for(var a=0;a<b.length;a++){this.showPointGlobal(b[a])}};Map.prototype.showPointGlobal=function(d){if(this.geocoder){var b=this;var c=this.map;var a=d.getAddress();this.geocoder.getLatLng(a,function(e){if(!e){alert(a+" not found")}else{if(!b.getCenterMap()){c.setCenter(e,b.getZoomMap())}if(d.getTitle()){var f=new GMarker(e,{title:d.getTitle()})}else{var f=new GMarker(e)}c.addOverlay(f);GEvent.addListener(f,"click",function(){f.openInfoWindowHtml(d.getDialog())})}})}};function setDirections_org(c,d,b,a){vecMap[indiceMap].getGdir().load("from: "+c+" to: "+d)}function setDirections(a,b){fromAddress=document.getElementById("fromAddress_"+a).value;toAddress=document.getElementById("toAddress_"+a).value;vecMap[b].getGdir().load("from: "+fromAddress+" to: "+toAddress)}function showText(b,g,e,f){var d=document.getElementById("c_from_"+g);var a=document.getElementById("c_to_"+g);var c=document.getElementById("back_"+g);if(b=="from"){d.style.display="";document.getElementById("fromAddress_"+g).value="";a.style.display="none";document.getElementById("toAddress_"+g).value=e;c.style.display="";vecMap[f].map.updateInfoWindow("",function(){document.getElementById("toAddress_"+g).value=e})}if(b=="to"){d.style.display="none";document.getElementById("fromAddress_"+g).value=e;a.style.display="";document.getElementById("toAddress_"+g).value="";c.style.display="";vecMap[f].map.updateInfoWindow("",function(){document.getElementById("fromAddress_"+g).value=e})}}function volver(b,a){document.getElementById("c_from_"+b).style.display="none";document.getElementById("fromAddress_"+b).value="";document.getElementById("c_to_"+b).style.display="none";document.getElementById("toAddress_"+b).value="";document.getElementById("back_"+b).style.display="none";vecMap[a].map.updateInfoWindow()};