var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var a=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,e=aB.userAgent.toLowerCase(),c=aB.platform.toLowerCase(),h=c?/win/.test(c):/win/.test(e),j=c?/mac/.test(c):/mac/.test(e),g=/webkit/.test(e)?parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,d=!+"\v1",f=[0,0,0],k=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){k=aB.plugins[ab].description;if(k&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;d=false;k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1");f[0]=parseInt(k.replace(/^(.*)\..*$/,"$1"),10);f[1]=parseInt(k.replace(/^.*\.(.*)\s.*$/,"$1"),10);f[2]=/[a-zA-Z]/.test(k)?parseInt(k.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var i=new ActiveXObject(X);if(i){k=i.GetVariable("$version");if(k){d=true;k=k.split(" ")[1].split(",");f=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)]}}}catch(b){}}}return{w3:a,pv:f,wk:g,ie:d,win:h,mac:j}}(),aK=function(){if(!ah.w3){return}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP()}});if(af==top){(function(){if(ak){return}try{aL.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}aP()})()}}if(ah.wk){(function(){if(ak){return}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return}aP()})()}aC(aP)}}();function aP(){if(ak){return}try{var b=aL.getElementsByTagName("body")[0].appendChild(ar("span"));b.parentNode.removeChild(b)}catch(a){return}ak=true;var d=Z.length;for(var c=0;c<d;c++){Z[c]()}}function aj(a){if(ak){a()}else{Z[Z.length]=a}}function aC(a){if(typeof af.addEventListener!=aq){af.addEventListener("load",a,false)}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",a,false)}else{if(typeof af.attachEvent!=aq){aM(af,"onload",a)}else{if(typeof af.onload=="function"){var b=af.onload;af.onload=function(){b();a()}}else{af.onload=a}}}}}function aN(){if(aa){Y()}else{am()}}function Y(){var d=aL.getElementsByTagName("body")[0];var b=ar(aD);b.setAttribute("type",aE);var a=d.appendChild(b);if(a){var c=0;(function(){if(typeof a.GetVariable!=aq){var e=a.GetVariable("$version");if(e){e=e.split(" ")[1].split(",");ah.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)]}}else{if(c<10){c++;setTimeout(arguments.callee,10);return}}d.removeChild(b);a=null;am()})()}else{am()}}function am(){var g=aG.length;if(g>0){for(var h=0;h<g;h++){var c=aG[h].id;var l=aG[h].callbackFn;var a={success:false,id:c};if(ah.pv[0]>0){var i=aS(c);if(i){if(ao(aG[h].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(c,true);if(l){a.success=true;a.ref=av(c);l(a)}}else{if(aG[h].expressInstall&&au()){var e={};e.data=aG[h].expressInstall;e.width=i.getAttribute("width")||"0";e.height=i.getAttribute("height")||"0";if(i.getAttribute("class")){e.styleclass=i.getAttribute("class")}if(i.getAttribute("align")){e.align=i.getAttribute("align")}var f={};var d=i.getElementsByTagName("param");var k=d.length;for(var j=0;j<k;j++){if(d[j].getAttribute("name").toLowerCase()!="movie"){f[d[j].getAttribute("name")]=d[j].getAttribute("value")}}ae(e,f,c,l)}else{aF(i);if(l){l(a)}}}}}else{ay(c,true);if(l){var b=av(c);if(b&&typeof b.SetVariable!=aq){a.success=true;a.ref=b}l(a)}}}}}function av(b){var d=null;var c=aS(b);if(c&&c.nodeName=="OBJECT"){if(typeof c.SetVariable!=aq){d=c}else{var a=c.getElementsByTagName(aD)[0];if(a){d=a}}}return d}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(f,d,h,e){aU=true;ap=e||null;at={success:false,id:h};var a=aS(h);if(a){if(a.nodeName=="OBJECT"){aJ=aO(a);ad=null}else{aJ=a;ad=h}f.id=ac;if(typeof f.width==aq||(!/%$/.test(f.width)&&parseInt(f.width,10)<310)){f.width="310"}if(typeof f.height==aq||(!/%$/.test(f.height)&&parseInt(f.height,10)<137)){f.height="137"}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var b=ah.ie&&ah.win?"ActiveX":"PlugIn",c="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+b+"&MMdoctitle="+aL.title;if(typeof d.flashvars!=aq){d.flashvars+="&"+c}else{d.flashvars=c}if(ah.ie&&ah.win&&a.readyState!=4){var g=ar("div");h+="SWFObjectNew";g.setAttribute("id",h);a.parentNode.insertBefore(g,a);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}aA(f,d,h)}}function aF(a){if(ah.ie&&ah.win&&a.readyState!=4){var b=ar("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(aO(a),b);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.replaceChild(aO(a),a)}}function aO(b){var d=ar("div");if(ah.win&&ah.ie){d.innerHTML=b.innerHTML}else{var e=b.getElementsByTagName(aD)[0];if(e){var a=e.childNodes;if(a){var f=a.length;for(var c=0;c<f;c++){if(!(a[c].nodeType==1&&a[c].nodeName=="PARAM")&&!(a[c].nodeType==8)){d.appendChild(a[c].cloneNode(true))}}}}}return d}function aA(e,g,c){var d,a=aS(c);if(ah.wk&&ah.wk<312){return d}if(a){if(typeof e.id==aq){e.id=c}if(ah.ie&&ah.win){var f="";for(var i in e){if(e[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){g.movie=e[i]}else{if(i.toLowerCase()=="styleclass"){f+=' class="'+e[i]+'"'}else{if(i.toLowerCase()!="classid"){f+=" "+i+'="'+e[i]+'"'}}}}}var h="";for(var j in g){if(g[j]!=Object.prototype[j]){h+='<param name="'+j+'" value="'+g[j]+'" />'}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+f+">"+h+"</object>";ag[ag.length]=e.id;d=aS(e.id)}else{var b=ar(aD);b.setAttribute("type",aE);for(var k in e){if(e[k]!=Object.prototype[k]){if(k.toLowerCase()=="styleclass"){b.setAttribute("class",e[k])}else{if(k.toLowerCase()!="classid"){b.setAttribute(k,e[k])}}}}for(var l in g){if(g[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"){aQ(b,l,g[l])}}a.parentNode.replaceChild(b,a);d=b}}return d}function aQ(b,d,c){var a=ar("param");a.setAttribute("name",d);a.setAttribute("value",c);b.appendChild(a)}function aw(a){var b=aS(a);if(b&&b.nodeName=="OBJECT"){if(ah.ie&&ah.win){b.style.display="none";(function(){if(b.readyState==4){aT(a)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.removeChild(b)}}}function aT(a){var b=aS(a);if(b){for(var c in b){if(typeof b[c]=="function"){b[c]=null}}b.parentNode.removeChild(b)}}function aS(a){var c=null;try{c=aL.getElementById(a)}catch(b){}return c}function ar(a){return aL.createElement(a)}function aM(a,c,b){a.attachEvent(c,b);al[al.length]=[a,c,b]}function ao(a){var b=ah.pv,c=a.split(".");c[0]=parseInt(c[0],10);c[1]=parseInt(c[1],10)||0;c[2]=parseInt(c[2],10)||0;return(b[0]>c[0]||(b[0]==c[0]&&b[1]>c[1])||(b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]))?true:false}function az(b,f,a,c){if(ah.ie&&ah.mac){return}var e=aL.getElementsByTagName("head")[0];if(!e){return}var g=(a&&typeof a=="string")?a:"screen";if(c){aH=null;an=null}if(!aH||an!=g){var d=ar("style");d.setAttribute("type","text/css");d.setAttribute("media",g);aH=e.appendChild(d);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]}an=g}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,f)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+f+"}"))}}}function ay(a,c){if(!aI){return}var b=c?"visible":"hidden";if(ak&&aS(a)){aS(a).style.visibility=b}else{az("#"+a,"visibility:"+b)}}function ai(b){var a=/[\\\"<>\.;]/;var c=a.exec(b)!=null;return c&&typeof encodeURIComponent!=aq?encodeURIComponent(b):b}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var a=al.length;for(var b=0;b<a;b++){al[b][0].detachEvent(al[b][1],al[b][2])}var d=ag.length;for(var c=0;c<d;c++){aw(ag[c])}for(var e in ah){ah[e]=null}ah=null;for(var f in swfobject){swfobject[f]=null}swfobject=null})}}();return{registerObject:function(a,e,c,b){if(ah.w3&&a&&e){var d={};d.id=a;d.swfVersion=e;d.expressInstall=c;d.callbackFn=b;aG[aG.length]=d;ay(a,false)}else{if(b){b({success:false,id:a})}}},getObjectById:function(a){if(ah.w3){return av(a)}},embedSWF:function(k,e,h,f,c,a,b,i,g,j){var d={success:false,id:e};if(ah.w3&&!(ah.wk&&ah.wk<312)&&k&&e&&h&&f&&c){ay(e,false);aj(function(){h+="";f+="";var q={};if(g&&typeof g===aD){for(var o in g){q[o]=g[o]}}q.data=k;q.width=h;q.height=f;var n={};if(i&&typeof i===aD){for(var p in i){n[p]=i[p]}}if(b&&typeof b===aD){for(var l in b){if(typeof n.flashvars!=aq){n.flashvars+="&"+l+"="+b[l]}else{n.flashvars=l+"="+b[l]}}}if(ao(c)){var m=aA(q,n,e);if(q.id==e){ay(e,true)}d.success=true;d.ref=m}else{if(a&&au()){q.data=a;ae(q,n,e,j);return}else{ay(e,true)}}if(j){j(d)}})}else{if(j){j(d)}}},switchOffAutoHideShow:function(){aI=false},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}},hasFlashPlayerVersion:ao,createSWF:function(a,b,c){if(ah.w3){return aA(a,b,c)}else{return undefined}},showExpressInstall:function(b,a,d,c){if(ah.w3&&au()){ae(b,a,d,c)}},removeSWF:function(a){if(ah.w3){aw(a)}},createCSS:function(b,a,c,d){if(ah.w3){az(b,a,c,d)}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(b){var a=aL.location.search||aL.location.hash;if(a){if(/\?/.test(a)){a=a.split("?")[1]}if(b==null){return ai(a)}var c=a.split("&");for(var d=0;d<c.length;d++){if(c[d].substring(0,c[d].indexOf("="))==b){return ai(c[d].substring((c[d].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(aU){var a=aS(ac);if(a&&aJ){a.parentNode.replaceChild(aJ,a);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block"}}if(ap){ap(at)}}aU=false}}}}();window.OD=window.OD||{};OD.MapFormObserver=Class.create();OD.MapFormObserver.prototype={initialize:function(c){this.config=Object.extend({countryID:"objInsertion_Country_ID",districtID:"objInsertion_District_ID",cityID:"objInsertion_City_ID",quarterID:"objInsertion_Quarter_ID",cityName:"objTmpCity_Name",streetName:"objInsertion_Street_ID"},c);var b=this.config;if($(b.cityID)&&$(b.countryID).options[$(b.countryID).selectedIndex].value==1){Event.observe(b.cityID,"otx:fillSelectOnRequest",this.findLocation.bind(this));Event.observe(b.cityID,"change",this.findLocation.bind(this));Event.observe(b.quarterID,"change",this.findLocation.bind(this))}else{Event.observe(b.cityName,"change",this.findLocation.bind(this))}Event.observe(b.streetName,"change",this.findLocation.bind(this))},findLocation:function(){var i="",j="",f="",b="",d="",h=0,l=0,c=0,g=0,k=this.config;f=$(k.countryID).options[$(k.countryID).selectedIndex].text;c=$(k.countryID).options[$(k.countryID).selectedIndex].value;b=($(k.streetName).value==$(k.streetName).getAttribute("data-tip"))?"":$(k.streetName).value;if(c==1){l=$(k.cityID).options[$(k.cityID).selectedIndex].value;if(l==="0"){return false}i=$(k.cityID).options[$(k.cityID).selectedIndex].text;j=$(k.districtID).options[$(k.districtID).selectedIndex].text;h=$(k.districtID).options[$(k.districtID).selectedIndex].value;g=$(k.quarterID).options[$(k.quarterID).selectedIndex].value;if(g>0&&b.length==0){d=$(k.quarterID).options[$(k.quarterID).selectedIndex].text}}else{i=$(k.cityName).value}var e=new OD.GeoCodeRequest();e.setLocation(f,j,i,b,d);e.setDistrictId(h);e.setCityId(l);e.setCountryId(c);e.setQuarterId(g);e.findAddress()},updateAbroad:function(){var b=this.config,c=$(b.countryID).options[$(b.countryID).selectedIndex].value,e=$(b.countryID).options[$(b.countryID).selectedIndex].text;if(c!=1){var d=new OD.GeoCodeRequest();d.setLocation(e);d.setCountryId(c);d.findAddress(false,true);return true}else{return false}}};OD.GeoCodeRequest=Class.create();OD.GeoCodeRequest.prototype={country:null,district:null,city:null,street:null,quarter:null,districtId:null,cityId:null,countryId:null,quarterId:null,insertionId:null,isVillage:false,isCountry:false,geocoder:null,operationStatus:0,saveGeoMarker:true,address:"",lat:null,lng:null,zoomLevel:null,initialize:function(){try{this.geocoder=new google.maps.Geocoder()}catch(a){}},setLocation:function(d,b,c,e,a){this.country=d;this.district=b;this.city=c;this.street=e;if(a){this.quarter=a}},setDistrictId:function(a){this.districtId=a},setCityId:function(a){this.cityId=a},setQuarterId:function(a){this.quarterId=a},setCountryId:function(a){this.countryId=a},setInsertionId:function(a){this.insertionId=a},findAddress:function(c,b){var a=this.prepareAddress(c,b);if(this.address){this.operationStatus=(b)?11:((a)?1:3);if(!a&&this.cityId>0&&this.countryId==1){this.doCityInfoRequest()}else{this.doLocationRequest()}return true}else{return false}},doCityInfoRequest:function(){new Ajax.Request("/?mod=maps&act=getGeoMarker&districtId="+this.districtId+"&cityId="+this.cityId+"&quarterId="+this.quarterId,{method:"get",onSuccess:function(a){if(a.responseJSON.status!="noCity"){this.isVillage=a.responseJSON.isVillage;if(a.responseJSON.status=="ok"){this.lat=a.responseJSON.location.lat*1;this.lng=a.responseJSON.location.lng*1;this.zoomLevel=a.responseJSON.location.zoomLevel*1;this.exact=false;this.showOnMap();this.operationStatus=4;return}else{if(a.responseJSON.status=="unknownGeoMarker"){this.operationStatus=4;this.notFoundAction();return}}}this.doLocationRequest()}.bind(this)})},doLocationRequest:function(){try{this.geocoder.geocode({address:this.address},this.parseResponse.bind(this))}catch(a){}},prepareAddress:function(b,a){this.address="";if(a){this.address=this.country;this.isCountry=true;return false}else{if(this.city&&this.country){this.address=this.city+", "+(this.district&&this.district!=this.city?this.district+", ":"")+this.country}else{if(this.country&&this.countryId!=1){this.address=this.country}}}if(!b&&this.quarter){this.address=this.quarter+", "+this.address}if(!b&&this.street){this.address=this.street+", "+this.address;return true}else{return false}},fillLocalizationStrInfo:function(){if($("localizationStrInfo")){if($("objInsertion_Country_ID").value==1){$("localizationStrInfo").value=$("objInsertion_Country_ID").value+"|"+$("objInsertion_Province_ID").value+"|"+$("objInsertion_District_ID").value+"|"+$("objInsertion_City_ID").value+"|"+$("objInsertion_Street_ID").value}else{$("localizationStrInfo").value=$("objInsertion_Country_ID").value+"||"+$("objTmpCity_Name").value+"|"+$("objInsertion_Street_ID").value}}},parseResponse:function(c,a){var h=true,g,f,d,e,b;if(a==google.maps.GeocoderStatus.OK){this.fillLocalizationStrInfo();coordinnates=c[0].geometry.location;f=c[0].geometry.location_type;d=c[0].formatted_address;e=coordinnates.lat();b=coordinnates.lng();this.exact=false;if(f===google.maps.GeocoderLocationType.ROOFTOP){zoomLevel=16;this.exact=true}else{if(f===google.maps.GeocoderLocationType.RANGE_INTEROPLATED){zoomLevel=15}else{if(f===google.maps.GeocoderLocationType.GEOMETRIC_CENTER){zoomLevel=14}else{if(f===google.maps.GeocoderLocationType.APPROXIMATE&&this.isCountry){zoomLevel=6}else{if(f===google.maps.GeocoderLocationType.APPROXIMATE&&this.isVillage){zoomLevel=13}else{if(f===google.maps.GeocoderLocationType.APPROXIMATE){zoomLevel=12}else{h=false}}}}}}if(this.operationStatus==3&&f===google.maps.GeocoderLocationType.ROOFTOP){h=false}if(this.quarter&&this.quarter.length>0){zoomLevel=12;h=true}if(h&&((this.quarter&&this.quarter.length>0)||(this.street&&this.street.length))){if(!this.isInCity(this.city,c[0].address_components)){h=false;this.saveGeoMarker=false}}}else{h=false}if(h){this.operationStatus=(this.operationStatus==1)?2:((this.operationStatus==11)?12:4);this.lat=e;this.lng=b;this.zoomLevel=zoomLevel;this.showOnMap();this.saveResponse()}else{if(this.operationStatus==3){if(this.countryId!=1){this.operationStatus=11;this.findAddress(false,true)}else{this.operationStatus=5;this.notFoundAction();this.saveResponse()}}else{if(this.insertionId>0&&this.countryId==1){this.saveResponse()}this.findAddress(true)}}},showOnMap:function(){OD.Map.showLocation({lat:this.lat,lng:this.lng,zoom:this.zoomLevel,exact:this.exact,source:"google",unknownLocation:false})},isInCity:function(a,c){if(c){for(var b=0;b<c.length;b++){if(c[b].long_name==a){return true}}}return false},notFoundAction:function(){OD.Map.showDefault()},saveResponse:function(){if(this.saveGeoMarker&&((this.cityId>0&&(this.operationStatus==4||this.operationStatus==5))||(this.insertionId>0&&(this.operationStatus==2||(this.operationStatus==4&&this.countryId!=1)||this.operationStatus==5||this.operationStatus==1||this.operationStatus==12)))){var a="";if(this.operationStatus==2||this.operationStatus==4||this.operationStatus==12){a="lat="+this.lat+"&lng="+this.lng+"&zoomLevel="+this.zoomLevel;if(this.exact){a+="&exact=true"}}else{a="unknown=true"}if(this.insertionId>0&&(this.operationStatus==1||this.operationStatus==2||(this.operationStatus==4&&this.countryId!=1)||this.operationStatus==12)){a+="&insertionId="+this.insertionId}else{if(this.cityId>0&&this.quarterId==0){a+="&cityId="+this.cityId}else{if(this.cityId>0&&this.quarterId>0){a+="&quarterId="+this.quarterId}else{return}}}new Ajax.Request("/?mod=maps&act=geoMarkerCache",{method:"post",parameters:a})}}};window.OD=window.OD||{};OD.GoogleMap=function(a){if(!a){throw"Brak parametrów"}var c,m={},f,i,b,g,l,k,h,d;if(arguments.length>1){m=arguments[arguments.length-1];if(typeof m!=="object"){throw"Opcje nie są obiektem"}}f={lat:52.025459,lng:19.204102,zoom:6,exact:false,source:"google",unknownLocation:true};c=Object.extend({edit:false,userLocation:false,updateAbroad:false,findLocation:false,position:f,resizeable:false},m);if(m.userLocation&&navigator.geolocation){navigator.geolocation.getCurrentPosition(function(o){c.position={lat:o.coords.latitude,lng:o.coords.longitude,zoom:11,exact:false};try{updateMap()}catch(n){}})}var j=function(o){var n="/images/2012012701/pl_PL/0/bgGMap.png";if(o==="shadow"){if(c.edit){return new google.maps.MarkerImage(n,new google.maps.Size(64,20),new google.maps.Point(114,302),new google.maps.Point(10,20))}else{return new google.maps.MarkerImage(n,new google.maps.Size(51,19),new google.maps.Point(291,303),new google.maps.Point(11,19))}}else{if(c.edit&&c.position.exact){return new google.maps.MarkerImage(n,new google.maps.Size(44,59),new google.maps.Point(9,262))}else{if(c.edit){return new google.maps.MarkerImage(n,new google.maps.Size(44,59),new google.maps.Point(65,262))}else{if(c.position.exact){return new google.maps.MarkerImage(n,new google.maps.Size(35,47),new google.maps.Point(202,272))}else{return new google.maps.MarkerImage(n,new google.maps.Size(35,47),new google.maps.Point(248,272))}}}}},e=function(n){if(!b){if(!n){n=new google.maps.LatLng(c.position.lat,c.position.lng)}b=new google.maps.Map(a,{backgroundColor:"#fff",zoom:1*c.position.zoom,center:n,mapTypeId:google.maps.MapTypeId.ROADMAP,streetViewControl:false,scaleControl:true,scaleControlOptions:{position:google.maps.ControlPosition.RIGHT_BOTTOM},scrollwheel:false});if(c.edit){google.maps.event.addListener(b,"zoom_changed",function(){c.position.zoom=b.getZoom();_updateMarker();d();h()});google.maps.event.addListener(b,"dragend",function(){d();h()})}}if(c.resizeable){Event.observe(a,"map:resize",function(o){google.maps.event.trigger(b,"resize");if(o.memo.popup){b.setCenter(n);b.setOptions({scrollwheel:true})}else{b.setCenter(n);b.setOptions({scrollwheel:false})}})}};_updateMarker=function(){if(!g){return}if(c.position.source=="user"&&c.position.zoom>13){c.position.exact=true}else{if(c.position.source=="user"){c.position.exact=false}}g.setIcon(j("icon"))};initMarker=function(n){if(!g){if(!n){n=new google.maps.LatLng(c.position.lat,c.position.lng)}g=new google.maps.Marker({map:b,position:n,animation:google.maps.Animation.DROP,icon:j("icon"),shadow:j("shadow"),draggable:c.edit?true:false});if(c.edit){google.maps.event.addListener(g,"dragstart",function(){h()});google.maps.event.addListener(g,"dragend",function(){c.position.source="user";c.position.unknownLocation=false;_updateMarker();google.maps.event.trigger(b,"newLocation")});google.maps.event.addListener(b,"newLocation",function(){$("geoCodeLat").value=g.getPosition().lat();$("geoCodeLng").value=g.getPosition().lng();$("geoCodeZoom").value=(b.cityZoom)?b.getZoom()-2:b.getZoom();$("geoCodeExact").value=c.position.exact?"y":"n";$("geoCodeSource").value=c.position.source;if($("objInsertion_UnknownGeoMarker")){$("objInsertion_UnknownGeoMarker").value=c.position.unknownLocation?"y":"n"}if($("objInvestment_UnknownGeoMarker")){$("objInvestment_UnknownGeoMarker").value=c.position.unknownLocation?"y":"n"}})}}};init=function(){if(c.edit){if(c.observeFields){k=c.observeFields}var o=new OD.MapFormObserver(k);if(c.showMap){e();initMarker();if(!c.position.exact&&c.position.source=="google"){_showTip()}}else{if(c.updateAbroad){if(!o.updateAbroad()){setDefaultPosition();o.findLocation()}}}}else{if(c.findLocation){var n=new OD.GeoCodeRequest();n.setLocation(c.findLocation.country,c.findLocation.district,c.findLocation.city,c.findLocation.street);n.setInsertionId(c.findLocation.insertionId);n.setCityId(c.findLocation.cityId);n.findAddress()}else{e();initMarker()}}},setPosition=function(n){c.position=Object.extend(c.position,n);updateMap()},setDefaultPosition=function(){c.position=Object.extend(c.position,f);updateMap(true)},updateMap=function(n){var o=new google.maps.LatLng(c.position.lat,c.position.lng);if(!b){e(o)}else{b.setCenter(o);b.setZoom(c.position.zoom)}if(!g){if(!n){initMarker(o)}}else{g.setPosition(o);_updateMarker()}if(g&&c.edit&&!c.position.exact&&c.position.source=="google"){_showTip()}google.maps.event.trigger(b,"newLocation")},_showTip=function(){if(!b){return}setTimeout(function(){if(c.tip&&!b.controls[google.maps.ControlPosition.TOP_CENTER].getLength()){l=new Element("div",{id:"gMapTip"}).update(c.tip).observe("mousedown",h.bind(this));b.controls[google.maps.ControlPosition.TOP_CENTER].push(l)}},500)},h=function(){if(!b){return}if(c.tip){b.controls[google.maps.ControlPosition.TOP_CENTER].clear()}},d=function(){if(!b||!g){return}if(!b.getBounds().contains(g.getPosition())){g.setPosition(b.getCenter())}google.maps.event.trigger(b,"newLocation")};return{show:init,showLocation:setPosition,showDefault:setDefaultPosition}};var otxNewGallery=Class.create({initialize:function(a){this.settings={slider:(a&&a.slider!=undefined)?a.slider:true};if($$("#imageBox a").length){var b=$("imageBox");this.galleryImage=b.select("img")[0];this.galleryLink=b.select("a")[0];this.galleryMovie=b.select("div")[0];this.tr={txtPrevPhoto:b.getAttribute("data-prev"),txtNextPhoto:b.getAttribute("data-next"),txtCloseWindow:b.getAttribute("data-close")};this.galleryLink.observe("click",this.show.bind(this));if($("imageList")){this.imageWrap=$("imageList");this.imageList=$$("#imageList p")[0];this.imageLinks=$$("#imageList a");this.imageLinksCount=this.imageLinks.length;this.imagePerScreen=6;this.imageActive="";this.screenActive="";this.prepareThumbnails();if(this.settings.slider&&(this.imageLinksCount>this.imagePerScreen)){this.prepareNavigation()}this.updateThumbnails();this.updateNavigation()}}else{if($$("#imageBox div").length){this.galleryMovie=$$("#imageBox div")[0];this.prepareMovie(this.galleryMovie.innerHTML);this.galleryMovie.setStyle({display:"block"})}}},changeActive:function(a){this.unmarkActive();if(a.hasClassName("movie")){if(this.galleryMovie.empty()){this.prepareMovie(a.href)}this.galleryLink.hide();this.galleryMovie.setStyle({display:"block"})}else{this.galleryImage.src=a.href.replace(/mini_big/,"mini_middle");this.galleryMovie.setStyle({display:"none"});this.galleryLink.show()}this.imageActive=parseInt(a.rel);this.screenActive=Math.floor(this.imageActive/this.imagePerScreen);this.updateThumbnails();this.updateNavigation()},unmarkActive:function(){this.imageLinks[this.imageActive].removeClassName("active")},markActive:function(){this.imageLinks[this.imageActive].addClassName("active")},changeScreen:function(a){this.screenActive=a;this.moveScreen()},moveScreen:function(){this.imageList.scrollTop=this.imageLinks[this.screenActive*this.imagePerScreen].offsetTop},scrollDiv:function(a){if(a.stop){a.stop()}wheel=Event.wheel(a);if(window.opera){wheel=-1*wheel}if(wheel>0&&this.screenActive>0){this.screenActive--}if(wheel<0&&this.screenActive<this.carouselScreenCount-1){this.screenActive++}this.updateThumbnails();this.updateNavigation()},prepareThumbnails:function(){if(this.settings.slider&&(this.imageLinksCount>this.imagePerScreen)){this.imageList.className="enhanced";this.imageLinks[this.imageLinksCount-1].style.paddingBottom="100px"}$A(this.imageLinks).each(function(b,a){b.setAttribute("rel",a)});this.imageList.observe("click",function(b){var a=b.findElement("A");if(!a.hasClassName("panorama")){b.stop();if(a){if(a.hasClassName("active")){return false}this.changeActive(a);a.blur()}}}.bind(this))},prepareNavigation:function(){var a=new Element("div",{id:"navBox",className:"navBox"});this.navNext=new Element("span",{id:"navNext",className:"navNext"});this.navPrev=new Element("span",{id:"navPrev",className:"navPrev"});a.appendChild(this.navNext);a.appendChild(this.navPrev);this.carouselScreenCount=Math.ceil(this.imageLinksCount/this.imagePerScreen);this.navScreen=[];for(var c=0,b=this.carouselScreenCount-1;c<=b;b--){this.navScreen[b]=new Element("span",{id:"screen"+b});a.appendChild(this.navScreen[b])}this.imageWrap.insertBefore(a,this.imageWrap.firstChild);a.observe("click",function(f){var d=f.element();if(d.id=="navNext"&&d.hasClassName("active")&&this.imageActive<this.imageLinksCount-1){if(this.imageLinks[this.imageActive+1].hasClassName("panorama")){this.imageActive++;Event.fireEvent(d,"click")}else{this.changeActive(this.imageLinks[this.imageActive+1])}}else{if(d.id=="navPrev"&&d.hasClassName("active")&&this.imageActive>0){if(this.imageLinks[this.imageActive-1].hasClassName("panorama")){this.imageActive--;Event.fireEvent(d,"click")}else{this.changeActive(this.imageLinks[this.imageActive-1])}}else{if(d.rel!=this.screenActive&&d.hasClassName("active")){this.changeScreen(parseInt(d.id.replace(/screen/,"")));this.updateNavigation()}}}}.bind(this));this.imageList.observe("mousewheel",function(d){this.scrollDiv(d)}.bind(this));this.imageWrap.observe("DOMMouseScroll",function(d){this.scrollDiv(d)}.bind(this))},updateThumbnails:function(){if(this.imageActive==""){this.imageActive=0}if(this.screenActive==""){this.screenActive=0}this.markActive();if(this.settings.slider&&(this.imageLinksCount>this.imagePerScreen)){this.moveScreen()}},updateNavigation:function(){if(this.settings.slider&&(this.imageLinksCount>this.imagePerScreen)){if(this.imageActive!=0){this.navPrev.addClassName("active").addClassName("navPrev2")}else{this.navPrev.removeClassName("active").removeClassName("navPrev2")}if(this.imageActive<this.imageLinksCount-1){this.navNext.addClassName("active").addClassName("navNext2")}else{this.navNext.removeClassName("active").removeClassName("navNext2")}for(var a=0;a<this.carouselScreenCount;a++){if(this.screenActive==a){this.navScreen[a].removeClassName("active")}else{this.navScreen[a].addClassName("active")}}}},prepareMovie:function(b){if(b){$("imageBoxDiv").appendChild(new Element("div",{id:"movieDiv"}));var a={allowScriptAccess:"always",allowFullScreen:"true"};var c={id:"myytplayer"};swfobject.embedSWF(b+"&version=3","movieDiv","300","225","8",null,null,a,c)}},show:function(j){if(j.stop){j.stop()}var f=[];f.push('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');f.push('<html xmlns="http://www.w3.org/1999/xhtml">');f.push("<head>");f.push('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');f.push("<title>otoDom - Galeria</title>");f.push('<link rel="stylesheet" media="all" type="text/css" href="/images/2012012701/pl_PL/0/css/popup.css" />');f.push('<script type="text/javascript" src="/images/2012012701/pl_PL/0/js/packed/popup.js"><\/script>');f.push("</head>");f.push("<body>");var a;if(this.imageLinks){f.push('<div id="imageList"><div>');for(var c=0;c<this.imageLinksCount;c++){if(this.imageLinks[c].hasClassName("movie")){f.push('<a href="'+this.imageLinks[c].href+'" class="movie"><img src="images/2012012701/pl_PL/0/bgMovie.png" alt="" /></a>')}else{if(!this.imageLinks[c].hasClassName("panorama")){f.push('<a href="'+this.imageLinks[c].href+'"><img src="'+this.imageLinks[c].href.replace(/mini_big/,"mini_small")+'" alt="" /></a>')}}}}else{f.push('<div id="imageList" style="display:none"><div>');f.push('<a href="'+this.galleryLink.href+'"><img src="'+this.galleryLink.href.replace(/mini_big/,"mini_small")+'" alt="" /></a>');a=' style="visibility: hidden"'}f.push("</div></div>");f.push('<div id="navLink">');f.push('<span id="previousImage"'+a+' class="toLeft"><span>&laquo;</span> '+this.tr.txtPrevPhoto+"</span>");f.push('<span id="nextImage"'+a+' class="toRight">'+this.tr.txtNextPhoto+" <span>&raquo;</span></span>");f.push('<span id="closeLink">'+this.tr.txtCloseWindow+"  <span>x</span></span>");f.push("</div>");f.push('<div id="imageBox" onclick="window.close()"></div>');f.push('<script type="text/javascript">window.onload=function(){OD.popup.init('+(this.imageActive?this.imageActive:0)+")}<\/script>");f.push("</body>");f.push("</html>");var k=(screen.width)<820?(screen.width):820;var d=(screen.height)<730?(screen.height):730;var m=(screen.height)?(screen.height-d)/2:0;var b=(screen.width)?(screen.width-k)/2:0;var g=window.open("","","top="+m+",left="+b+",width="+k+",height="+d+",toolbar=no,directories=no,menubar=no,locations=no,status=no,scrollbars=yes,resizable=yes,fullscreen=no");g.document.open();g.document.write(f.join("\n"));g.document.close();g.focus();this.galleryLink.blur()}});document.observe("dom:loaded",function(){(function(){var g=$$("dl.stripeMe");for(var e=0,d=g.length;e<d;e++){var f=g[e].select("dd");for(var c=0,b=f.length;c<b;c++){if(c%2){f[c].addClassName("even")}else{f[c].addClassName("odd")}}}})();(function(){var b=$("facebookUrl");if(b){b.writeAttribute("href","http://www.facebook.com/sharer.php?u="+encodeURIComponent(document.URL)+"&src=sp")}})();(function(){var d=$("offerContact"),f,c,e,b=function(h){var g=h.readAttribute("data-label")};if(d&&d.getAttribute("data-id")!=null){c="/?mod=popup&act="+d.getAttribute("data-action")+"&id="+d.getAttribute("data-id");if(d.getAttribute("data-type")){c+="&type="+d.getAttribute("data-type")}if(d.getAttribute("data-project")){c+="&project="+d.getAttribute("data-project")}f=new Element("div",{id:"offerContactForm"});d.insert({bottom:f});OD.Load.js("otxPopupForms.js",function(){e=new OD.popupForm(d.getAttribute("data-popup-title"),"",true);e.sendRequestFromShow(c,f)})}if(d===null&&$$(".linkPopup")){OD.Load.js("otxPopupForms.js")}})();(function(){var c=$$("span.phoneOD");if(c){c.invoke("addClassName","js");c.each(function(d){d.insert('<a href="#">'+d.getAttribute("data-text")+"</a>")});var b=$(document.body).on("click",".phoneOD a",function(f){f.stop();var d=f.findElement(".phoneOD");c.invoke("removeClassName","js");new Ajax.Request("/?mod=show&act=showContacts",{method:"get",parameters:{type:d.getAttribute("data-type"),id:d.getAttribute("data-id")}});b.stop()})}})();var a={mode:"standard",init:function(){if($("offerPrint")&&$("printMessage")){var c=$("offerPrint");var b=$("headerOD").up().insertBefore($("printMessage"),$("headerOD"));[c,b].invoke("observe","click",function(d){d.stop();this.switchPreview()}.bind(this));c.style.display="inline"}},switchPreview:function(){var c,b;for(c=0;(b=document.getElementsByTagName("link")[c]);c++){if(b.getAttribute("rel").indexOf("stylesheet")!=-1&&b.getAttribute("media")==="screen"){b.disabled=(this.mode==="standard")?true:false;if(b.getAttribute("title")==="Print Preview"){b.disabled=(this.mode==="standard")?false:true}}}this.mode=(this.mode==="standard"?"print":"standard");if(this.mode==="print"){window.print()}}};a.init()});var resizeMap=function(){var e,b=$("menuRight").select(".mapBox")[0],f,h=$("mapWrapper"),i=$("resizeMapLink"),c=$("googleMap"),a=a;if($("jakDojade")){var g=$("jakDojade"),j=$("jakDojade").select("a")[0].clone(true);j.on("click",function(k){k.stop();Event.fireEvent(g,"click")})}i.on("click",function(k){k.stop();d()});var d=function(k){if(e===false){e=true;i.update(h.getAttribute("data-zoom-out"));if(!f){f=new OD.Popup({titleTxt:h.getAttribute("data-popup-title"),closeLink:j,closeTxt:false,autoSize:true,maxWidth:800,maxHeight:450})}h.setStyle(f.getGripSize());c.setStyle({width:f.getGripSize().width,height:parseFloat(f.getGripSize().height)-i.measure("height")+"px"});f.getGrip().insert(h);f.show();document.observe("keyup",function(l){if(l.keyCode==Event.KEY_ESC){d()}})}else{if(e){f.hide()}e=false;i.update(h.getAttribute("data-zoom-in"));b.insert(h).setStyle({display:"block"});h.setStyle({width:"300px",height:"auto"});c.setStyle({width:"300px",height:"300px"});document.stopObserving("keyup")}if(!k){c.fire("map:resize",{popup:e})}};d(true)};Event.observe(window,"load",function(){var d=$("googleMap"),c={},a;if(d){a=d.readAttribute("data-map");if(a!==null){a=a.split("|");c={position:{lat:a[0],lng:a[1],zoom:1*a[2],exact:a[3]=="y"?true:false,source:a[4]},resizeable:true}}else{a=d.readAttribute("data-geo");if(a!==null){a=a.split("|");c={findLocation:{country:a[0],district:a[1],city:a[2],street:a[3],insertionId:1*a[4],cityId:1*a[5]},resizeable:true}}else{return false}}try{OD.Map=new OD.GoogleMap(d,c);$(document.body).insert(new Element("script",{src:"http://maps.google.com/maps/api/js?v=3.4&sensor=false&callback=OD.Map.show"}));resizeMap()}catch(b){}}});var jakDojade={box:false,createLayer:function(){this.box=new OD.Popup({titleTxt:this.el.readAttribute("data-popup-title"),closeTxt:this.el.readAttribute("data-popup-close"),autoSize:true,maxWidth:950,maxHeight:550});this.frame=new Element("iframe",{src:this.el.readAttribute("data-url")}).setStyle({width:"100%",height:"100%",border:0});this.box.getGrip().insert(this.frame)},init:function(){this.el=$("jakDojade");if(this.el){this.el.on("click",function(a){a.stop();if(!this.box){this.createLayer()}this.box.show()}.bind(this))}}};var neighborLink={offerId:null,queryId:null,orderBy:null,page:1,listing:null,listingType:null,listingTypes:{newest:{refPattern:"najnowsze-oferty-nieruchomosci",neighborUrl:"/index.php?mod=promoted&act=newest"},promoted:{refPattern:"promowane-oferty-nieruchomosci",neighborUrl:"/index.php?mod=promoted&act=promoted"},corporation:{refPattern:/(deweloper|developer|biuro-nieruchomosci|real-estate-agency)\/[\w\-]+-id([0-9]+)/,neighborUrl:"/index.php?mod=search&act="},category:{refPattern:/\/(\w+(\/[\w\-]+)*(\/[0-9]+)?)\/?$/,neighborUrl:"/index.php?mod=categories&act="}},itemType:null,itemTypes:{wantedInsertion:{idPattern:"wid([0-9]+).html",defaultOrderBy:"Orderby"},insertion:{idPattern:"id([0-9]+).html",defaultOrderBy:"objSearchQuery_Orderby"},investment:{idPattern:"inv([0-9]+).html",defaultOrderBy:"Orderby"}},init:function(){for(var c in this.itemTypes){var a=new RegExp(this.itemTypes[c].idPattern);var b=a.exec(document.URL);if(b&&this.isInt(b[1])){this.offerId=b[1];this.itemType=c;break}}this.queryId=this.getSearchQueryId();this.orderBy=this.getOrderBy();this.page=this.getPage();this.listing=this.getListing();this.displayLinks()},displayLinks:function(){if(this.queryId||this.listing){$("neighborLinkList").href=this.getListLink();$("neighborLinkList").addClassName("active");if(this.offerId){var b=getCookie("neighborLink_disablePrev");var a=getCookie("neighborLink_disableNext");if(b!=1){$("neighborLinkPrev").href=this.getNeighborLink("prev");$("neighborLinkPrev").addClassName("active")}if(a!=1){$("neighborLinkNext").href=this.getNeighborLink("next");$("neighborLinkNext").addClassName("active")}}}delCookie("neighborLink_disablePrev");delCookie("neighborLink_disableNext")},displayInfo:function(){},getNeighborLink:function(a){var b="&id="+this.offerId+"&page="+this.page+"&orderby="+this.orderBy;if(this.queryId){switch(this.itemType){case"insertion":return"/index.php?mod=search&act="+a+b+"&qid="+this.queryId;case"investment":return"/index.php?mod=investments&act="+a+b+"&qid="+this.queryId}}else{if(this.listing){return this.listingTypes[this.listingType].neighborUrl+a+b+"&listing="+this.listing}}},getListLink:function(){if(this.queryId){switch(this.itemType){case"insertion":return"/index.php?mod=search&act=searchResults&qid="+this.queryId+"&currentPage="+this.page+"&objSearchQuery_Orderby="+this.orderBy;case"investment":return"/index.php?mod=investments&act=searchResults&qid="+this.queryId+"&currentPage="+this.page+"&Orderby="+this.orderBy;case"wantedInsertion":return"/index.php?mod=searchWanted&act=searchResults&qid="+this.queryId+"&currentPage="+this.page+"&Orderby="+this.orderBy}}else{if(this.listing){return this.listing}}},getSearchQueryId:function(){var a=document.referrer;var b=this.getQueryVar(a,"qid");if(!b){b=getCookie("neighborLink_qid")}delCookie("neighborLink_qid");return b},getPage:function(){var c=document.referrer;var d=this.getQueryVar(c,"currentPage");if(!d){var b=new RegExp("/([0-9]+)/?(\\?.*?)?$");var a=b.exec(c);if(a&&a[1]){d=a[1]}}if(!d){d=getCookie("neighborLink_page");delCookie("neighborLink_page")}if(!d){d=1}return d},getOrderBy:function(){var a=document.referrer;var b;if(this.itemType){b=this.getQueryVar(a,this.itemTypes[this.itemType].defaultOrderBy)}if(!b){b=getCookie("neighborLink_orderBy");delCookie("neighborLink_orderBy")}if(!b){b="activation_date DESC"}return b},getListing:function(){var d=document.referrer;var e=getCookie("neighborLink_listing");for(var c in this.listingTypes){var b=new RegExp(this.listingTypes[c].refPattern);var a=b.exec(d);if(a&&a[0]){this.listingType=c;e=a[0];break}else{a=b.exec(e);if(a&&a[0]){this.listingType=c;break}}}delCookie("neighborLink_listing");return e},getQueryVar:function(c,a){var b=new RegExp("[?&]"+a+"=([^&$]*)","i");var d=c.search(b);if(d==-1){return null}return RegExp.$1},isInt:function(a){return !isNaN(parseInt(a))}};var inactiveOffer=function(){var f=$("maskOffer"),e=$("containerOD"),k=$("otherOffers"),j,h=0,g;if(f&&e){if(k){e.insert({after:k});k.setStyle({width:"980px",margin:"0 auto"})}j=f.select("div")[0];if(j){e.insert({before:j});j.setStyle({width:"660px",left:"-160px",marginBottom:"20px"})}g=setInterval(function(){f.setStyle({height:e.getHeight()+10+"px"});if(++h>3){clearInterval(g)}},1000)}};document.observe("dom:loaded",function(){new otxNewGallery();neighborLink.init();jakDojade.init();inactiveOffer();var a=$("bankierLink");if(a){a.on("click",function(b){b.stop();form=window.open(this.href,"","width=800,height=800,status=no,scrollbars=yes");form.focus()})}});
