function px(A){return A+"px"}function em(A){return A+"em"}function getPosition(E){var A=0;var F=0;var B=E.offsetWidth;var D=E.offsetHeight;while(E!=null){F+=E.offsetTop;A+=E.offsetLeft;E=E.offsetParent}var C={top:F,left:A,width:B,height:D};return(C)}function getPageSize(){return new GSize(window.innerWidth||(document.documentElement&&document.documentElement.clientWidth)||document.body.clientWidth,window.innerHeight||(document.documentElement&&document.documentElement.clientHeight)||document.body.clientHeight)}function getWindowHeight(){return(getPageSize().height)}function getWindowWidth(){return(getPageSize().width)}function removeChildren(C){var B;var A=Array();while((B=C.lastChild)!=null){A.push(C.removeChild(B))}return(A)}function formatFloat(C,B){var A=(""+C).split(".");return(A.length==1?C.toString():A[0]+"."+A[1].substr(0,B))}function htmlEscape(A){A=A.replace(/&/g,"&amp;");A=A.replace(/>/g,"&gt;");A=A.replace(/</g,"&lt;");return A}function $(B,A){if(!A){A=document}return A.getElementById(B)}function getDocumentFromFrame(B){var A;if(B.contentDocument){A=B.contentDocument}else{if(B.contentWindow){A=B.contentWindow.document}else{A=window.frames[B].document}}return(A)}var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};Object.extend=function(A,B){for(property in B){A[property]=B[property]}return A};var Config=Class.create();Config.prototype.initialize=function(F,E){this.defaults={};this.current={};for(var A in E){this.current[A]=this.defaults[A]=E[A]}if(F&&F.length!=0){var C=F.split("&");for(var B=0;B<C.length;B++){var D=unescape(C[B]).split("=");if(D[0]&&D[1]){this.current[D[0]]=this.sanitize(D[1])}}}};Config.prototype.sanitize=function(A){return(htmlEscape(A))};Config.prototype.getDefaults=function(){return(this.defaults)};Config.prototype.getCurrent=function(){return(this.current)};Config.prototype.getValue=function(A){return(this.current[A])};Config.prototype.setValue=function(A,B){this.current[A]=B};Config.prototype.toStr=function(){var B="";for(var A in this.current){B+=A+"="+this.current[A]+"\n"}return(B)};Config.prototype.setValues=function(A){for(var B in A){this.setValue(B,A[B])}};Config.prototype.getChanged=function(){var B=Array();for(var A in this.current){B.push(A+"="+this.current[A])}return(B)};var gMap;var gConfig;var gMaptypes;var mozaic_server="http://static.targuldecase.ro/";var cat_uri=new Array(2);cat_uri[0]=["nul.xml","devanzare.xml","deinchiriat.xml","diverse.xml"];cat_uri[1]=["nul2.xml","devanzare2.xml","deinchiriat2.xml","diverse2.xml"];var cat_color=["black","red","orange","blue"];var cat_div=["nul","div_cat_1","div_cat_2","div_cat_3","div_cat_4"];var cat_cssclass_normal=["nul","cat_devanzare","cat_deinchiriat","cat_diverse","cat_harta"];var cat_cssclass_activ=["nul","cat_devanzare_activ","cat_deinchiriat_activ","cat_diverse_activ","cat_harta_activ"];var anunturi_uri="/anunturi/individual/";var anunturi_liste_uri="/anunturi/";var client_anunt_lista="";var client_harta="harta-iasi.html";var client_anunt_id="direct.html";var base_URL="http://www.targuldecase.ro/";var post_anunt_URL="http://www.targuldecase.ro/nou";var maps={};maps["terestris"]={location:mozaic_server+"mozaic/u85b",name:"Terestris",maxzoomlevel:16,copyright:'Harta: &copy; 2007 <a href="http://www.terestris.ro/" target="_blank">Terestris</a>',caption:"Harta Iaşi, zona metropolitană",extension:".png"};maps["transport"]={location:mozaic_server+"mozaic/t77",name:"Transport",maxzoomlevel:16,copyright:'Harta: &copy; 2007 <a href="http://www.terestris.ro/" target="_blank">Terestris</a>',caption:"Harta Iaşi, transport",extension:".png"};function loadAppBase(){urlUpdater=new urlUpdaterClass();setDefaults();resizeMap();gMap=new GMap2($("map"));gMaptypes={};var A;for(A in maps){gMaptypes[A]=makeMyMap(maps[A])}gMap.removeMapType(G_NORMAL_MAP);gMap.removeMapType(G_HYBRID_MAP);for(A in gMaptypes){gMap.addMapType(gMaptypes[A])}gMap.removeMapType(G_SATELLITE_MAP);gMap.addMapType(G_SATELLITE_MAP);gMap.addControl(new GSmallMapControl());gMap.addControl(new GMapTypeControl());gMap.enableScrollWheelZoom();gMap.enableContinuousZoom();gMap.disableDoubleClickZoom();new GKeyboardHandler(gMap);makeIcons();gMap.addControl(new GScaleControl());resizeMap();gMap.termsDiv_=gMap.getContainer().childNodes[2];gMap.copyrightSpan_=document.createElement("span");gMap.termsDiv_.insertBefore(gMap.copyrightSpan_,gMap.termsDiv_.firstChild);var B;if(gConfig.getValue("map").toLowerCase()=="terestris"){B=maps[gConfig.getValue("map").toLowerCase()].map}else{if(gConfig.getValue("map").toLowerCase()=="transport"){B=maps[gConfig.getValue("map").toLowerCase()].map}else{if(gConfig.getValue("map").toLowerCase()=="satellite"){B=G_SATELLITE_MAP}else{B=maps["terestris"].map}}}gMap.setCenter(new GLatLng(gConfig.getValue("lat"),gConfig.getValue("lon")),parseInt(gConfig.getValue("zoom"),10),B);urlUpdater.enable();updatePageUrl();if((gConfig.getValue("map").toLowerCase()=="terestris")||(gConfig.getValue("map").toLowerCase()=="transport")){updateCopyright();$("mapcaption").innerHTML=maps[gConfig.getValue("map").toLowerCase()].caption}else{$("mapcaption").innerHTML="Iaşi, imagini din satelit"}GEvent.addListener(gMap,"moveend",updatePageUrl);GEvent.addListener(gMap,"maptypechanged",function(){if((gMap.getCurrentMapType().getName().toLowerCase()=="terestris")||(gMap.getCurrentMapType().getName().toLowerCase()=="transport")){$("mapcaption").innerHTML=gMap.getCurrentMapType().getCaption();updateCopyright();updatePageUrl()}else{gMap.copyrightSpan_.innerHTML="";$("mapcaption").innerHTML="Iaşi, imagini din satelit";updatePageUrl()}});resizeMap()}function updateCopyright(){gMap.copyrightSpan_.innerHTML=gMap.getCurrentMapType().copyright+", interfaţa Google "}function makeIcons(){var A=["red","blue","green","yellow","orange","purple","brown","white","black","gray"];for(var B=0;B<A.length;B++){var D=A[B];var C=new GIcon();C.image="./markers/mm_20_"+D+".png";C.shadow="./markers/mm_20_shadow.png";C.iconSize=new GSize(12,20);C.shadowSize=new GSize(22,20);C.iconAnchor=new GPoint(6,20);C.infoWindowAnchor=new GPoint(5,1);marker_icons[D]=C}}function makeMyMap(A){var B=A.name.charAt(0).toUpperCase()+A.name.substr(1);var C=new GMapType([new MyTileLayer(A.location,A.maxzoomlevel,A.copyright,A.extension)],G_SATELLITE_MAP.getProjection(),B,{shortName:B,errorMessage:"Arie neacoperită sau indisponibilă temporar. <a href='javascript:centru()'>Repoziţionaţi harta în Centru</a> sau reîncărcaţi pagina."});C.getCaption=function(){return A.caption};C.copyright=A.copyright;A.map=C;return(C)}function MyTileLayer(C,D,B,E){var A=new GTileLayer(new GCopyrightCollection(),12,D);A.baseUrl_=C+"/";if(E!=null){A.baseExt_=E}else{A.baseExt_=".png";A[0].isPng=function(){return"True"}}A.getTileUrl=MyTileLayer.prototype.getTileUrl;return(A)}MyTileLayer.prototype.getTileUrl=function(C,B){var A=this.baseUrl_+B+"/"+C.x+"-"+C.y+this.baseExt_;return(A)};function resizeMap(){var B=5;var G=$("map");var A=getWindowHeight()-getPosition(G).top;var C=getWindowWidth()-getPosition(G).left;var E=A-B;var F=C-B;G.style.height=px(E);G.style.width=px(F);var D=$(sidebar_name);D.style.height=px(E);if(gMap){gMap.checkResize()}}function centru(){var A=gConfig.getDefaults();gMap.setCenter(new GLatLng(A["lat"],A["lon"]),parseInt(A["zoom"],10))}function infoFereastra(E,D,C){var A=new GLatLng(E,D);var B='<p style="width: 200px;font-family: Times, serif; font-weight:normal;font-size:100%; line-height:125%;">'+C+"</p>";gMap.panTo(A);window.setTimeout(function(){gMap.openInfoWindowHtml(A,B)},500)}