// Copyright (c) Position s.r.o.
// All rights reserved.

var Initilized=false;SFT_BASIC="basic";SFT_EXTENDED="extended";SFT_DEFAULT=SFT_BASIC;DSF_PRODUCTS=0;DSF_SHOPTYPES=1;DSF_DEFAULT=DSF_PRODUCTS;MAP_COUNTRY="SK";var ActiveSearchFormType=SFT_DEFAULT,ActiveDetailSearchFilter=null,UserNearestPopupIconId="NearestPt",ClockShowCount=0;if(typeof LastSearchType=="undefined")LastSearchType=null;if(typeof LastSearchValues=="undefined")LastSearchValues=null;function SetInnerHTML(a,b){if(typeof a!="object")a=document.getElementById(a);if(a)a.innerHTML=b}
function ToggleImage(a){if(typeof a!="object")a=document.getElementById(a);if(a){var b=String(a.src),c=b.lastIndexOf(".");b=b.substr(c-1,1)=="_"?b.substr(0,c-1)+b.substr(c):b.substr(0,c)+"_"+b.substr(c);a.src=b}}
function HighlightImage(a,b){if(typeof b=="undefined")b=true;if(typeof a!="object")a=document.getElementById(a);if(a){var c=String(a.src),d=c.lastIndexOf(".");if(c.substr(d-1,1)=="_"&&!b)c=c.substr(0,d-1)+c.substr(d);else if(c.substr(d-1,1)!="_"&&b)c=c.substr(0,d)+"_"+c.substr(d);a.src=c}}function PreloadImages(a){for(var b=0;b<a.length;b++)(new Image).src=a[b]+"?"+VERSION_IMG}function PreloadCursor(a){document.createElement("img").src=a+"?"+VERSION_IMG}
function GetActiveLayerIDsAsText(){if(Layers){for(var a="",b=0;b<Layers.length;b++)a+=(a==""?"":",")+Layers.MapIDs;return a}else return""}function SetElementClass(a,b){if(!(typeof a=="undefined"||a=="")){if(typeof b=="undefined")b="";if(typeof a!="object")a=document.getElementById(a);if(a)a.className=b}}
function HideFocusOutlineOnLinks(a){function b(c){var d=c.tagName;if(typeof d!="undefined")d=d.toLowerCase();if(d=="a"){if(ngIExplorer)c.hideFocus="true";c.style.outline="none"}for(d=0;d<c.childNodes.length;d++)b(c.childNodes[d])}if(typeof a=="undefined"||a==""||!a)for(a=0;a<document.links.length;a++){if(ngIExplorer)document.links[a].hideFocus="true";document.links[a].style.outline="none"}else{if(typeof a!="object")a=document.getElementById(a);a&&b(a)}}
function BoolArray2URL(a,b){if(typeof b=="undefined")b=false;if(b)for(var c=true,d=0;d<a.length;d++)if(a[d]===true){c=false;break}var e="";for(d=0;d<a.length;d++){if(e!="")e+=";";e+=a[d]===true?"1":b&&c?"1":"0"}return e}
function GetScrollbarWidth(){var a=document.createElement("div");a.style.width="50px";a.style.height="50px";a.style.visibility="hidden";a.style.overflow="scroll";a.id="scrollbar_width_test_outer";document.body.appendChild(a);a.innerHTML='<div id="scrollbar_width_test_inner" style="width: 100px; height: 100px;"></div>';var b=50-a.clientWidth;document.body.removeChild(a);return b}
function IsHScrollbarVisible(a){if(typeof a=="undefined")return false;if(typeof a!="object")a=document.getElementById(a);return a?a.clientWidth<a.scrollWidth:false}function IsVScrollbarVisible(a){if(typeof a=="undefined")return false;if(typeof a!="object")a=document.getElementById(a);return a?a.clientHeight<a.scrollHeight:false}
function RepeatLastSearch(){if(LastSearchValues)switch(LastSearchType){case "standard":switch(LastSearchValues.SFT){case SFT_BASIC:places.Search(LastSearchValues.text,MAP_COUNTRY);break;case SFT_EXTENDED:places.SearchAddress(LastSearchValues.city,LastSearchValues.street,LastSearchValues.cp,LastSearchValues.co,MAP_COUNTRY);break}break;case "nearest":if(app_type!=1)return;nearest.NearestToPos(GetActiveLayerIDsAsText(),LastSearchValues.pos,MAP_COUNTRY,LastSearchValues.refine_params);break;case "shop_detail":if(app_type==
2)return;Detail_RPC.sendRequest("src/detail_shop.php?lang="+lang+"&shop_id="+LastSearchValues.id);break;default:return}}
function RenderScales(){if(map&&map.ZoomLevels){for(var a=new Array(map.ZoomLevels.length),b=0;b<map.ZoomLevels.length;b++)a[a.length-b-1]=map.ZoomLevels[b];var c=document.getElementById("ScaleHolder");if(c){var d="";d+='<map name="ScaleClickMap" style="outline:none;" hidefocus="true">\n';for(b=0;b<a.length;b++)d+='<area shape="rect" coords="'+Math.floor(b*6).toString()+", 0, "+Math.floor(b*6+6).toString()+', 27" title="1 : '+FormatScale(a[b])+'" alt="1 : '+FormatScale(a[b])+'" href="javascript: map.SetScale('+
a[b]+');" onfocus="parent.focus();" />';d+="</map>\n";a="";a+='<img src="img/zoom_out.gif?'+VERSION_IMG+'" onclick="map.ZoomOut();" title="'+lngIconTitleZoomOut+'" alt="'+lngIconAltZoomOut+'" class="HandCursor" style="width: 21px; height: 23px;"/>';a+='<img src="img/zoom_back.gif?'+VERSION_IMG+'" usemap="#ScaleClickMap" class="HandCursor" style="width: '+map.ZoomLevels.length*6+'px; height: 23px;" />';a+='<img src="img/zoom_in.gif?'+VERSION_IMG+'" onclick="map.ZoomIn();" title="'+lngIconTitleZoomIn+
'" alt="'+lngIconAltZoomIn+'" class="HandCursor" style="width: 21px; height: 23px;" />';if(map.ZoomLevels&&map.ZoomLevel>=0)a+='<img class="HandCursor" src="img/zoom_redpoint.gif?'+VERSION_IMG+'" style="width: 6px; height: 23px; position: absolute; left: '+(21+6*(map.ZoomLevels.length-1-map.ZoomLevel))+'px;" title="1 : '+FormatScale(map.ZoomLevels[map.ZoomLevel])+'" />';c.innerHTML=d+a}UpdateTipsWidth()}}
function UpdateTipsWidth(){var a=document.getElementById("Tips"),b=document.getElementById("ScaleControl"),c=document.getElementById("MapButtons"),d=document.getElementById("MapControls");if(a&&b&&c&&d){a.style.left=b.offsetLeft+b.offsetWidth+6+"px";b=d.offsetWidth-b.offsetLeft-b.offsetWidth-c.offsetWidth-12;if(b>0)a.style.width=b+"px"}}function ClearInfoContent(){SetInfoTitle("");SetInfoBody("");SetInfoFooter("")}
function SetInfoTitle(a){if(typeof a=="undefined"||a=="")a="";SetInnerHTML("InfoTitle",a)}function SetInfoBody(a){if(typeof a=="undefined"||a=="")a="";SetInnerHTML("InfoBody",a);a!=""&&HideFocusOutlineOnLinks("InfoBody")}
function SetInfoFooter(a){if(typeof a=="undefined"||a==""){SetElementClass("InfoFooter","ZeroHeight");SetElementClass("InfoBody","InfoBody_NoFooter");SetInnerHTML("InfoFooter","")}else{SetElementClass("InfoBody","InfoBody_Footer");var b=document.getElementById("InfoFooter");if(b){SetElementClass("InfoFooter","InfoFooter_Normal");SetInnerHTML(b,a);HideFocusOutlineOnLinks("InfoBody")}}}
function AdjustControlsInFullscreen(){if(fullscreen){var a=document.getElementById("All"),b=document.getElementById("Map"),c=document.getElementById("MapContainer"),d=document.getElementById("MainMap"),e=document.getElementById("MapMarginTop");if(!(!a||!b||!c||!d||!e)){var g=window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight,f=b.offsetHeight-c.offsetHeight;e=e.offsetHeight;e=g-5-e;b.style.height=
e+"px";c.style.height=e-f+"px";d.style.height=e-f-2+"px";if(a.clientWidth>0)d.style.width=a.clientWidth-2+"px";if(map.Initialized)map.SetMapSize(d.clientWidth,d.clientHeight);else{map.MapWidth=d.clientWidth;map.MapHeight=d.clientHeight}}}}function ScrollTo(a){if(typeof a!="undefined"){if(typeof a!="object")a=document.getElementById(a);a&&a.scrollIntoView()}}function ScrollToSearch(){ScrollTo("SearchForm")}function ScrollToMap(){ScrollTo("MapMarginTop")}function ScrollToInfo(){ScrollTo("Info")}
var TipsTimerID=null;function DisplayTip(a){var b="";if(!a){for(;CurrentTipIndex<0||CurrentTipIndex>=lngTipsArray.length;)CurrentTipIndex=Math.round(lngTipsArray.length*Math.random());a=CurrentTipIndex}if(a<lngTipsArray.length&&a>=0)if(lngTipsArray[a]!="undefined"){b='<div class="blackTitle" style="margin: 0px 8px 0 5px; float: left; height: 100%;">'+lngTip+"</div>";b+='<p style="margin-top:0px;">'+lngTipsArray[a]+"</p>";SetInnerHTML("Tips",b)}}
function DisplayNextTip(){CurrentTipIndex++;if(CurrentTipIndex>=lngTipsArray.length)CurrentTipIndex=0;DisplayTip()}function TipsTimerStart(){TipsTimerID=window.setInterval("DisplayNextTip()",8E3)}function TipsTimerStop(){TipsTimerID&&window.clearTimeout(TipsTimerID)}
function setSearchFormType(a){var b=document.getElementById("SearchForm_basic"),c=document.getElementById("SearchForm_extended"),d=document.getElementById("SearchForm_Type");if(b&&c)switch(a){case SFT_BASIC:b.className="";c.className="hidden";if(d)d.innerHTML=lngSearchFormExtended;ActiveSearchFormType=a;break;case SFT_EXTENDED:b.className="hidden";c.className="";if(d)d.innerHTML=lngSearchFormBasic;ActiveSearchFormType=a;break;default:break}}
function ToggleSearchType(){setSearchFormType(ActiveSearchFormType==SFT_BASIC?SFT_EXTENDED:SFT_BASIC)}function AddOptionToSelect(a,b,c){if(typeof a!="object")a=document.getElementById(a);if(a&&b){var d=document.createElement("OPTION");d.text=String(b);d.value=c?c:"---";a.options.add(d)}}
function RegionChanged(a){if(typeof a=="undefined")a=false;var b=document.getElementById("InputRegion"),c=document.getElementById("InputDistrict");if(b&&c){for(;c.options.length>0;)c.remove(0);for(var d=null,e=0;e<Regions.length;e++)if(Regions[e].id==b.value){d=Regions[e];break}AddOptionToSelect(c,lngSearchDistrictAll,"");if(!ngOpera)c.selectedIndex=0;for(e=0;e<Districts.length;e++)if(d&&Districts[e].region_id==d.id||!d)AddOptionToSelect(c,Districts[e].popis,Districts[e].id);if(Initilized&&d&&!a){ShowOverlayMap(false);
d.id==1?map.LocateScaleXY(4E5,d.geocode):map.LocateScaleXY(8E5,d.geocode)}}}function DistrictChanged(){if(Initilized){var a=document.getElementById("InputDistrict");if(a)for(var b=0;b<Districts.length;b++)if(Districts[b].id==a.value){ShowOverlayMap(false);map.LocateScaleXY(4E5,Districts[b].geocode);break}}}function ToggleProductCheckbox(a){setActiveDetailSearchFilter(DSF_PRODUCTS);ToggleImage("Product_"+a+"_checkbox");ProductsCheckboxStates[a]=!ProductsCheckboxStates[a]}
function CheckProductCheckbox(a,b,c){if(typeof c=="undefined")c=false;if(typeof b=="undefined")b=true;c&&setActiveDetailSearchFilter(DSF_PRODUCTS);HighlightImage("Product_"+a+"_checkbox",b);ProductsCheckboxStates[a]=b}function ToggleShopTypeCheckbox(a){setActiveDetailSearchFilter(DSF_SHOPTYPES);ToggleImage("ShopType_"+a+"_checkbox");ShopTypesCheckboxStates[a]=!ShopTypesCheckboxStates[a]}
function CheckShopTypeCheckbox(a,b,c){if(typeof c=="undefined")c=false;if(typeof b=="undefined")b=true;c&&setActiveDetailSearchFilter(DSF_SHOPTYPES);HighlightImage("ShopType_"+a+"_checkbox",b);ShopTypesCheckboxStates[a]=b}function ToggleLayerCheckbox(a){ToggleImage("Layer_"+a+"_checkbox")}function CheckLayerCheckbox(a,b){if(typeof b=="undefined")b=true;HighlightImage("Layer_"+a+"_checkbox",b)}
function setActiveDetailSearchFilter(a){if(!(ActiveDetailSearchFilter&&ActiveDetailSearchFilter==a)){ActiveDetailSearchFilter=a;var b=document.getElementById("DetailSearchFilter_table");if(b){HighlightImage("SearchFilterProducts_RB",a==DSF_PRODUCTS);HighlightImage("SearchFilterShopTypes_RB",a==DSF_SHOPTYPES);for(var c=1;c<b.rows.length;c++){b.rows[c].cells[0].className=a==DSF_PRODUCTS?"":"SearchFilterInactive";if(b.rows[c].cells[1]&&b.rows[c+1].cells[1])b.rows[c].cells[1].className=a==DSF_SHOPTYPES?
"":"SearchFilterInactive"}}}}function SearchBoxEnter(a,b){if(typeof a!="object")a=document.getElementById(a);if(typeof b=="undefined")b=ActiveSearchFormType;if(a)for(var c=0;c<SearchForms.length;c++)if(SearchForms[c].Type==b)for(var d=0;d<SearchForms[c].Controls.length;d++)if(SearchForms[c].Controls[d].Ctrl_ID==a.id&&a.value==SearchForms[c].Controls[d].BlankValue){a.value="";break}}
function SearchBoxLeave(a,b){if(typeof a!="object")a=document.getElementById(a);if(typeof b=="undefined")b=ActiveSearchFormType;if(a)for(var c=0;c<SearchForms.length;c++)if(SearchForms[c].Type==b){for(b=0;b<SearchForms[c].Controls.length;b++)if(SearchForms[c].Controls[b].Ctrl_ID==a.id&&a.value==""){a.value=SearchForms[c].Controls[b].BlankValue;break}break}}function SearchKeyPress(a){if(!a)a=window.event;if((a.which?a.which:a.keyCode)==13){Search();return false}return true}
function Search(){var a=false,b={},c;for(c=0;c<SearchForms.length;c++)if(SearchForms[c].Type==ActiveSearchFormType)for(var d=0;d<SearchForms[c].Controls.length;d++){var e=document.getElementById(SearchForms[c].Controls[d].Ctrl_ID);if(e){e=e.value==SearchForms[c].Controls[d].BlankValue?"":e.value;if(e!="")a=true;b[SearchForms[c].Controls[d].ParamName]=e}}if(a){ClearSearchResults(true);SetInfoTitle(lngMessageWaitSearching);ScrollToInfo();if(app_type==1)if(a=document.getElementById("InputRegion")){a.selectedIndex=
0;RegionChanged()}LastSearchType="standard";LastSearchValues={};LastSearchValues.SFT=ActiveSearchFormType;switch(ActiveSearchFormType){case SFT_BASIC:places.Search(b.text,MAP_COUNTRY);LastSearchValues.text=b.text;break;case SFT_EXTENDED:places.SearchAddress(b.city,b.street,b.cp,b.co,MAP_COUNTRY);LastSearchValues.city=b.city;LastSearchValues.street=b.street;LastSearchValues.cp=b.cp;LastSearchValues.co=b.co;break}}else if(app_type==1){a=document.getElementById("InputRegion");b=document.getElementById("InputDistrict");
if(a&&b){d="";if(b.selectedIndex>0)for(c=0;c<Districts.length;c++)if(Districts[c].id==b.value){d=Districts[c].geocode;break}if(a.selectedIndex>0&&b.selectedIndex==0)for(c=0;c<Regions.length;c++)if(Regions[c].id==a.value){d=Regions[c].geocode;break}d!=""&&FindNearest(d)}}}
function ClearSearchValues(){var a,b;if(app_type==1){if(a=document.getElementById("InputRegion"))a.selectedIndex=0;RegionChanged()}if(typeof SearchForms!="undefined")for(b=0;b<SearchForms.length;b++)for(var c=0;c<SearchForms[b].Controls.length;c++)if(a=document.getElementById(SearchForms[b].Controls[c].Ctrl_ID))a.value=SearchForms[b].Controls[c].BlankValue;if(app_type==1){for(b=0;b<Products.length;b++)CheckProductCheckbox(b,Products[b].enabled_by_default,false);for(b=0;b<ShopTypes.length;b++)CheckShopTypeCheckbox(b,
ShopTypes[b].enabled_by_default,false)}}function ClearSearchResults(a){if(typeof a=="undefined")a=true;typeof places!="undefined"&&places.ClearDisplayedItems();app_type==1&&typeof nearest!="undefined"&&nearest.ClearDisplayedItems();if(a){ClearInfoContent();LastSearchValues=LastSearchType=null}}function StartSearch(){return true}function StopSearch(){SetInfoBody("");SetInfoFooter("");return true}
function SearchError(a){var b="";switch(a){case -3:b=lngSearchErrorInvalidID;break;case -2:b=lngSearchErrorInvalidLayer;break;case -1:default:b=lngSearchErrorNoResults;break}SetInfoTitle(lngSearchResults);SetInfoBody(b);SetInfoFooter("")}
function SearchResultCalcDescription(a){var b="";if(typeof a=="object"&&a!=null){if(typeof a.street=="string"&&a.street!="")b=a.street;if(typeof a.city=="string"&&a.city!=""){if(b!="")b+=", ";b+=a.city;if(typeof a.statusKod=="string"&&a.statusKod!=""){var c=lngCityStatus[a.statusKod];if(c!="")b+=", "+c}}if(typeof a.psc=="string"&&a.psc!=""){if(b!="")b+=", ";b+=a.psc}}if(b=="")b=a.descr;else a.descr=b;return b}
function DisplaySearchResults(a){if(a.Results.length==1)switch(app_type){case 1:FindNearest(a.Results[0].pos);return;case 2:LocatePlace(0);break;default:return}if(!(app_type!=1&&app_type!=2)){map.PanMode();if(a.Results.length>0){SetInfoTitle(lngSearchResults);for(var b=new ngStringBuilder,c=0;c<a.Results.length;c++){b.append('<div style="width: 100%; vertical-align: middle;">');b.append('<img src="img/item_arrowred.gif?'+VERSION_IMG+'" style="width: 6px; height: 5px; vertical-align: middle; margin-right: 5px;" />');
if(app_type==2)b.append('<span style="vertical-align: middle;"><a href="javascript:LocatePlace('+c+');" hidefocus="true">'+SearchResultCalcDescription(a.Results[c])+"</a>");else{b.append('<span style="vertical-align: middle;"><a href="javascript:FindNearest(\''+a.Results[c].pos+'\');" hidefocus="true">'+SearchResultCalcDescription(a.Results[c])+"</a>");b.append('&nbsp;(<a href="javascript:LocatePlace('+c+')">'+lngSearchResultsShowOnMap+"</a>)")}b.append("</span></div>")}SetInfoBody(b.toString());
b.clear();a.Params.PrevVisible?b.append('<a href="javascript:places.PrevPage();">'+lngPrevious+"</a>"):b.append('<span class="SearchResultsPagingInactive">'+lngPrevious+"</span>");b.append("<span>&nbsp;|&nbsp;</span>");a.Params.NextVisible?b.append('<a href="javascript:places.NextPage();">'+lngNext+"</a>"):b.append('<span class="SearchResultsPagingInactive">'+lngNext+"</span>");SetInfoFooter(b.toString())}}}
function DisplaySearchNearestResults(a){map.PanMode();if(a.Results.length>0){SetInfoTitle(lngSearchResultsShops);for(var b=0,c=0;c<a.Results.length;c++){eval(a.Results[c].descr);a.Results[c].description=p_descr;a.Results[c].description.shoptype=ShopTypes[a.Results[c].description.shoptype_idx];a.Results[c].description.products=[];for(var d=0,e=0;e<a.Results[c].description.product_idxs.length;e++){a.Results[c].description.products[e]=Products[a.Results[c].description.product_idxs[e]];d+=a.Results[c].description.products[e].icon_width}d+=
(a.Results[c].description.products.length-1)*3;if(d>b)b=d}if(ngIExplorer&&b%2==1)b+=1;d=new ngStringBuilder;d.append('<table id="SearchNearestResults" cellpadding="0" cellspacing="0" border="0" '+(ngIExplorer?"":'style="width: 100%;"')+">");for(c=0;c<a.Results.length;c++){d.append('  <tr style="height: 19px;" class="HandCursor'+(c%2==1?" SearchResultsEvenLine":"")+'" onclick="javascript:LocateNearestPlace('+c+');" title="'+lngSearchResultsShowOnMap+'">');d.append('    <td style="width: 80px;">');
d.append('      <img src="img/item_arrowred.gif?'+VERSION_IMG+'" style="width: 6px; height: 5px; vertical-align: middle; margin-right: 5px;" />');d.append('      <span style="height: 18px; vertical-align: middle;">&nbsp;'+a.Results[c].dist+"</span>");d.append("    </td>");d.append('    <td style="width: 27px;">');if(a.Results[c].description.shoptype.icon!="")ngIExplorer?d.append("      <div style=\"vertical-align: middle; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.Results[c].description.shoptype.icon+
"?"+VERSION_IMG+'\', sizingMethod=\'image\');" class="NearestShopTypeIcon" title="'+a.Results[c].description.shoptype.alt+'"></div>'):d.append('      <img src="'+a.Results[c].description.shoptype.icon+"?"+VERSION_IMG+'" class="NearestShopTypeIcon" style="vertical-align: middle;" alt="'+a.Results[c].description.shoptype.alt+'" title="'+a.Results[c].description.shoptype.alt+'" />');d.append("    </td>");d.append("    <td>");d.append("      <span>"+a.Results[c].description.partner+", "+a.Results[c].description.adresa_search+
"</span>");d.append("    </td>");d.append('    <td style="text-align: right; width: '+b+'px;">');var g="";for(e=0;e<a.Results[c].description.product_idxs.length;e++)g+=ngIExplorer?'<img src="/ngMapAPI/empty.gif" style="vertical-align: middle; width: '+a.Results[c].description.products[e].icon_width+"px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.Results[c].description.products[e].icon+"?"+VERSION_IMG+"', sizingMethod='image');"+(e==a.Results[c].description.product_idxs.length-
1?" margin-right: 0px;":"")+'" class="NearestProductIcon" title="'+a.Results[c].description.products[e].alt+'" alt="'+a.Results[c].description.products[e].alt+'" />':'<img src="'+a.Results[c].description.products[e].icon+'" alt="'+a.Results[c].description.products[e].alt+'"  title="'+a.Results[c].description.products[e].alt+'" class="NearestProductIcon" style="width: '+a.Results[c].description.products[e].icon_width+"px;"+(e==a.Results[c].description.product_idxs.length-1?" margin-right: 0px;":"")+
'" />';d.append("      "+g);d.append("    </td>");d.append("  </tr>")}d.append("</table>");if(ngIExplorer){var f=document.getElementById("InfoBody");f.style.visibility="hidden"}SetInfoBody(d.toString());if(ngIExplorer){c=document.getElementById("SearchNearestResults");for(e=0;e<c.rows.length;e++)c.rows[e].cells[2].style.width=f.clientWidth-(c.rows[e].cells[0].offsetWidth+c.rows[e].cells[1].offsetWidth+b)+"px";f.style.visibility="visible"}d.clear();a.PrevVisible?d.append('<a href="javascript:nearest.PrevPage();">'+
lngPrevious+"</a>"):d.append('<span class="SearchResultsPagingInactive">'+lngPrevious+"</span>");d.append("<span>&nbsp;|&nbsp;</span>");a.NextVisible?d.append('<a href="javascript:nearest.NextPage();">'+lngNext+"</a>"):d.append('<span class="SearchResultsPagingInactive">'+lngNext+"</span>");SetInfoFooter(d.toString())}}function LocatePlace(a){if(typeof a!="undefined"){ClearSearchResults(false);ShowOverlayMap(false);ScrollToMap();places.LocateItem(a)}}
function FindNearest(a){if(typeof a=="undefined"||a==""){if(typeof projection=="undefined")projection=new ngProj(map);projection.OnCalculate=function(c,d){typeof d!="undefined"&&FindNearest(d)};projection.Pixels2Proj(new ScreenPt(map.PopupX,map.PopupY))}else{ClearSearchResults(true);SetInfoTitle(lngMessageWaitSearching);ScrollToInfo();var b="";switch(ActiveDetailSearchFilter){case DSF_PRODUCTS:b="products="+BoolArray2URL(ProductsCheckboxStates,false);break;case DSF_SHOPTYPES:b="shoptypes="+BoolArray2URL(ShopTypesCheckboxStates,
false);break}LastSearchType="nearest";LastSearchValues={};LastSearchValues.pos=a;LastSearchValues.refine_params=b;nearest.NearestToPos(GetActiveLayerIDsAsText(),ng_URLEncode(a),MAP_COUNTRY,b);map&&map.HideMapMenu()}}function LocateNearestPlace_ActiveCommandCallback(a){switch(a.ACCAction){case "AOPopup":a.ShowActiveObjPopupByID(a.ACCPopupLayer,a.ACCPopupObjID);break;case "Popup":a.ShowPopupByID(a.ACCPopupObjID)}}
function LocateNearestPlace_CreatePopupIcon(a,b,c,d,e){a=map.AddPopupIcon(a,c,d,e,new ScreenPt(20,20));a.onpopup=NearestPtIconPopupMenu;a.objid=b;return a}
function LocateNearestPlace(a){if(typeof a!="undefined"){ClearSearchResults(false);ShowOverlayMap(false);ScrollToMap();if(nearest.Results[a].description){if(nearest.Results[a].description.shoptype.layerid==""){nearest.Map.PopupIconExists(UserNearestPopupIconId)&&nearest.Map.RemovePopupIconByID(UserNearestPopupIconId);var b="";switch(nearest.Results[a].description.chain){case "Slovnaft":b="img/logoSlovnaft.png";break;case "SLSP":b="img/logoSporitelna.png";break;case "Slovensk\ufffd po\ufffdta":b="img/logoPosta.png";
break;case "TESCO":b="img/logoTesco.png";break;case "V\ufffdB":b="img/logoVUB.png";break;case "Billa":b="img/logoBilla.png";break;case "\ufffdSOB":b="img/logoCSOB.png";break;case "JET":b="img/logoJet.png";break;case "NAY":b="img/logoNay.png";break;case "Geco Tabak":b="img/logoGeko.png";break;case "Press Poly\ufffdk":b="img/logoPress.png";break;case "OTP":b="img/logoOTP.png";break;default:switch(nearest.Results[a].description.typ){case "Bankomat":b="img/logoATM.png";break;default:b="img/logoOther.png";
break}}b=LocateNearestPlace_CreatePopupIcon(UserNearestPopupIconId,nearest.Results[a].id,b,nearest.Results[a].pos,nearest.Results[a].descr);map.ACCAction="Popup";map.ACCPopupObjID=b.id}else{map.ACCAction="AOPopup";map.ACCPopupLayer=nearest.Results[a].description.shoptype.layerid;map.ACCPopupObjID=nearest.Results[a].id}map.ActiveCommandCallback=LocateNearestPlace_ActiveCommandCallback;map.LocateScaleXY(nearest.Results[a].scale,nearest.Results[a].pos)}}}
function ShowOverlayMap(a){if(typeof a=="undefined"||a==null)a=true;var b=document.getElementById("Prehledka"),c=document.getElementById("MapContainer"),d=document.getElementById("MapControls");if(!(!b||!c||!d))if(!(b.className=="hidden"&&!a||b.className!="hidden"&&a)){b.className=a?"":"hidden";c.className=a?"hidden":"";d.className=a?"hidden":"";if(a){if(a=document.getElementById("InputRegion")){a.selectedIndex=0;RegionChanged()}}else RenderScales()}}
function HighlightOverlayMapRegion(a,b){if(typeof b=="undefined")b=false;var c=document.getElementById("Prehledka");if(c)if(typeof a=="undefined"||!b)c.style.backgroundPosition=OverlayMapDefaultBackgroundPos;else{b=null;for(var d=0;d<Regions.length;d++)if(Regions[d].id==a){b=Regions[d];break}c.style.backgroundPosition=b?b.background_position:OverlayMapDefaultBackgroundPos}}
function RegionSelect(a,b){ShowOverlayMap(false);var c=document.getElementById("InputRegion");if(c){c.value=a;RegionChanged(b)}}function SetMapMode(a){a.OnMouseDown="";a.OnMouseUp="";HighlightImage("btnPan",a.Mode=="P");HighlightImage("btnZoom",a.Mode.charAt(0)=="Z");if(a.Mode=="P"){a.OnMouseDown=CursorChangeDown;a.OnMouseUp=CursorChangeUp}}function CursorChangeDown(a){a&&a.SetCursor(a.CursorPanDown);return true}function CursorChangeUp(a){a&&a.SetCursor(a.CursorPan);return true}
function MapMenu(a){var b=[];if(app_type==1)b=['<a href="javascript:FindNearest('+(typeof position=="undefined"?"":"'"+position+"'")+')">'+lngFindNearestShop+"</a>"];return RenderDefaultPopUpMenu(a,lngAtThisPlace,"",b)}
function ActiveObjectMenu(a,b,c){if(app_type==2)return"";else{if(!c.description){eval(c.descr);c.description=p_descr;c.description.shoptype=ShopTypes[c.description.shoptype_idx];c.description.products=[];for(b=0;b<c.description.product_idxs.length;b++)c.description.products[b]=Products[c.description.product_idxs[b]]}b=['<a href="javascript:Detail('+c.objid+');">'+lngMoreInformation+"</a>"];return RenderDefaultPopUpMenu(a,'<div id="MapPopupProductIcons">'+RenderProductIcons(c.description.products)+
"</div>"+c.description.partner+"<br />"+c.description.adresa+"<br />"+c.description.umisteni,c.pos,"",b)}}function SearchItemMenu(a,b){var c=[];if(app_type==1)c=['<a href="javascript:FindNearest()">'+lngFindNearestShop+"</a>"];return RenderDefaultPopUpMenu(a,b.descr,b.pos,c)}
function NearestPtIconPopupMenu(a,b){eval(b.descr);b.description=p_descr;b.description.shoptype=ShopTypes[b.description.shoptype_idx];b.description.products=[];for(var c=0;c<b.description.product_idxs.length;c++)b.description.products[c]=Products[b.description.product_idxs[c]];c=['<a href="javascript:Detail('+b.objid+');">'+lngMoreInformation+"</a>"];return RenderDefaultPopUpMenu(a,'<div id="MapPopupProductIcons">'+RenderProductIcons(b.description.products)+"</div>"+String(b.description.partner).replace(/ /g,
"&nbsp;")+"<br />"+String(b.description.adresa_popup).replace(/ /g,"&nbsp;")+"<br />"+b.description.umisteni,b.pos,"",c)}function CommandFinished(a){RenderScales();a.ZoomLevel==0&&a.Mode!="L"&&a.PanMode();if(typeof a.LayersStates!="undefined")for(var b=0;b<a.LayersStates.length;b++)CheckLayerCheckbox(b,a.LayersStates[b]);if(b=document.getElementById("MapCopyrights"))b.innerHTML="Data \ufffd "+a.Copyrights;DisplayTip();return true}
function TilesLoading(){ClockShowCount++;var a=document.getElementById("Clock");if(a)a.className="";return true}function TilesLoaded(){ClockShowCount--;if(ClockShowCount==0){var a=document.getElementById("Clock");if(a)a.className="hidden"}return true}
function CreatePopup(a,b,c,d,e,g){if(a){innerHTML='<div id="MapPopupFrame" style="border-width: 1px;">'+d+"</div>";if(ngOpera){a.innerHTML="";var f=document.createElement("div");f.style.visibility="hidden";f.style.position="absolute";f.style.height="auto";f.style.width="auto";a.appendChild(f);f.innerHTML=innerHTML}else{a.style.width="auto";a.style.height="auto";a.innerHTML='<div id="MapPopupFrame" style="border-width: 1px;">'+d+"</div>"}f=document.getElementById("MapPopupFrame");var h=f.offsetHeight+
5,j=f.offsetWidth+1;c-=h;var i=false,k=false;if(c<g){i=true;c+=h}if(b+j>this.MapWidth+e){k=true;b-=j-12}else b-=11;a.innerHTML='<img src="img/window_arr_'+(i?"up":"down")+".gif?"+VERSION_IMG+'" style="position: absolute; top: '+(i?0:f.offsetHeight-1)+"px; left: "+(k?f.offsetWidth-23:0)+'px; width: 23px; height: 6px; z-index: 501;"><div id="MapPopupFrame" style="position: absolute; border-width: 1px; top: '+(i?5:0)+"px; width: "+(f.offsetWidth-2)+"px; height: "+(f.offsetHeight-2)+'px; z-index: 500;">'+
d+'</div><div id="MapPopupFrameShadowH" style="top: '+(f.offsetHeight+(i?5:0))+"px; width: "+(f.offsetWidth-1)+'px;"></div><div id="MapPopupFrameShadowV" style="left: '+f.offsetWidth+"px; height: "+(f.offsetHeight-1)+"px; top: "+(i?7:2)+'px;"></div>';a.style.width=j+"px";a.style.height=h+"px";a.style.left=b+"px";a.style.top=c+"px";a.style.visibility="visible";HideFocusOutlineOnLinks(a)}}
function Home(){if(!fullscreen&&app_type==1){ShowOverlayMap(true);map.ZoomAnimation=false;map.PanAnimation=false}fullscreen&&typeof init_popup_icon!="undefined"&&map.PopupIconExists(UserNearestPopupIconId)&&map.RemovePopupIconByID(UserNearestPopupIconId);map.Home();map.MapCommand("INIT",app_type==3?"&show_layer="+layer:"");map.ZoomMode();if(!fullscreen&&app_type==1){map.ZoomAnimation=true;map.PanAnimation=true}if(app_type==1||app_type==2){ClearSearchValues();setSearchFormType(SFT_DEFAULT);setActiveDetailSearchFilter(DSF_DEFAULT);
ClearSearchResults(true);typeof places!="undefined"&&places.Reset();app_type==1&&typeof nearest!="undefined"&&nearest.Reset()}}
function FullScreen(a){if(a)window.close();else{a="index.php?fs&lang="+lang+"&mode="+ng_URLEncode(map.Mode)+"&sess="+map.MapSession+"&mapx="+map.X+"&mapy="+map.Y;var b;if((app_type==1||app_type==2)&&ActiveSearchFormType!=SFT_DEFAULT)a+="&sft="+ActiveSearchFormType;if(app_type==1){if(ActiveDetailSearchFilter!=DSF_DEFAULT)a+="&dsf="+ActiveDetailSearchFilter;if((b=document.getElementById("InputRegion"))&&b.value!=""&&b.value!="---")a+="&rid="+b.value;if((b=document.getElementById("InputDistrict"))&&
b.value!=""&&b.value!="---")a+="&did="+b.value;a+="&prods="+BoolArray2URL(ProductsCheckboxStates,false);a+="&shops="+BoolArray2URL(ShopTypesCheckboxStates,false)}if(app_type==2)a+="&layers="+BoolArray2URL(map.LayersStates,false);if(LastSearchType&&LastSearchValues){a+="&lst="+LastSearchType;for(var c in LastSearchValues)a+="&lsv["+c+"]="+ng_URLEncode(String(LastSearchValues[c]))}if(typeof SearchForms!="undefined")for(c=0;c<SearchForms.length;c++)for(var d=0;d<SearchForms[c].Controls.length;d++)if(b=
document.getElementById(SearchForms[c].Controls[d].Ctrl_ID))if(b.value!=SearchForms[c].Controls[d].BlankValue)a+="&sv["+SearchForms[c].Controls[d].ParamName+"]="+ng_URLEncode(b.value);if(app_type==3)a+="&layer="+layer;if((a=window.open(a,"","fullscreen=yes, scrollbars=yes, resizable=no, top=0, left=0, width="+window.screen.width+", height="+window.screen.height))&&app_type==1){b=map.PopupIcons[UserNearestPopupIconId];if(typeof b!="undefined"){a.init_popup_icon={};a.init_popup_icon.objid=b.objid;a.init_popup_icon.url=
b.url;a.init_popup_icon.pos=b.pos;a.init_popup_icon.descr=b.descr}}}}function PrintMap(){if(map){var a=720,b=600;if(a>screen.width)a=screen.width;if(b>screen.height)b=screen.height;var c=(screen.width-a)/2,d=(screen.height-b)/2;if(c<0)c=0;if(d<0)d=0;var e="";e="../print.php?"+map.URLStateParams();if(window.lang)e+="&lang="+lang;(a=window.open(e,"print","width="+a+", height="+b+", scrollbars=yes, menubar=yes, resizable=yes, left="+c+", top="+d))&&a.focus()}}
function PopupCenter(){map.Center(map.PopupX,map.PopupY);map.HidePopup()}function PopupMaxDetail(a){typeof a!="undefined"?map.LocateScaleXY("max",a):map.MaxDetail(map.PopupX,map.PopupY);map.HidePopup()}function PopupScale200(){map.SetScale(2E5,map.PopupX,map.PopupY);map.HidePopup()}
function ShowDetail_RPC(a){if(typeof a!="undefined"){a.products=[];for(var b=0;b<a.products_idxs.length;b++)a.products[b]=Products[a.products_idxs[b]];a.shoptype=ShopTypes[a.shoptype_idx];var c=new ngStringBuilder;b=document.getElementById("InfoBody");c.append('<table id="DetailTable" class="Detail" cellpadding="0" cellspacing="0" style="width: '+b.offsetWidth+'px;">');c.append('<tr><td style="padding-right: 20px;">');c.append('  <table cellpadding="0" cellspacing="0">');a.products.length>0&&c.append('    <tr><td class="DetailCaption">'+
lngDetailCaptionServicesAndProducts+'</td><td style="white-space: nowrap;">'+RenderProductIcons(a.products)+"</td></tr>");if(a.ulice!=""||a.obec!="")c.append('    <tr><td class="DetailCaption">'+lngDetailCaptionAddress+"</td><td>"+a.ulice+(a.ulice!=""&&a.obec!=""?"<br />":"")+a.obec+"</td></tr>");a.umisteni!=""&&c.append('    <tr><td class="DetailCaption">'+lngDetailCaptionLocation+"</td><td>"+a.umisteni+"</td></tr>");a.email!=""&&c.append('    <tr><td class="DetailCaption">'+lngDetailCaptionEmail+
'</td><td><a target="_BLANK" href="mailto:'+a.email+'">'+a.email+"</a></td></tr>");c.append("  </table>");c.append("</td>");c.append('<td align="right">');c.append('  <table id="OpeningHours" cellpadding="0" cellspacing="0">');if(a.od_po_pa!=""||a.od_so!=""||a.od_ne!="")c.append('    <tr><td colspan="2" class="DetailTitle" style="margin-bottom: 0px;">'+lngDetailCaptionOpeningHours+"</td>");a.od_po_pa!=""&&c.append('    <tr><td class="OpeningHoursDaysCaption">'+lngMondayFriday+'</td><td class="OpeningHoursDaysValue">'+
a.od_po_pa+"</td>");a.od_so!=""&&c.append('    <tr><td class="OpeningHoursDaysCaption">'+lngSaturday+'</td><td class="OpeningHoursDaysValue">'+a.od_so+"</td>");a.od_ne!=""&&c.append('    <tr><td class="OpeningHoursDaysCaption">'+lngSunday+'</td><td class="OpeningHoursDaysValue">'+a.od_ne+"</td>");if(typeof a.poznamka=="object"){a.poznamka.length>0&&c.append('<tr style="height: 5px;">');for(b=0;b<a.poznamka.length;b++)switch(a.poznamka[b].length){case 0:case 1:c.append('    <tr><td colspan="2" style="text-align: left">'+
a.poznamka[b][0]+"</td>");break;case 2:c.append('    <tr><td class="OpeningHoursDaysCaption">'+a.poznamka[b][0]+'</td><td class="OpeningHoursDaysValue">'+a.poznamka[b][1]+"</td>");break}}else typeof a.poznamka=="string"&&a.poznamka!=""&&c.append('    <tr style="height: 5px;"></tr><tr><td colspan="2" style="text-align: left">'+a.poznamka+"</td>");c.append("  </table>");c.append("</td></tr>");c.append("</table>");if(a.jnn_vlak!=""||a.jnn_mhd!=""||a.jnn_auto!=""||a.jnn_pesky!=""){c.append('<div class="DetailTitle">'+
lngHowToFindUsTitle+"</div>");c.append('<table class="Detail" cellpadding="0" cellspacing="0">');a.jnn_vlak!=""&&c.append('<tr><td class="DetailCaption">'+lngDetailByTrain+"</td><td>"+a.jnn_vlak+"</td></tr>");a.jnn_mhd!=""&&c.append('<tr><td class="DetailCaption">'+lngDetailByPubTraf+"</td><td>"+a.jnn_mhd+"</td></tr>");a.jnn_auto!=""&&c.append('<tr><td class="DetailCaption">'+lngDetailByCar+"</td><td>"+a.jnn_auto+"</td></tr>");a.jnn_pesky!=""&&c.append('<tr><td class="DetailCaption">'+lngDetailByFoot+
"</td><td>"+a.jnn_pesky+"</td></tr>");c.append("</table>")}SetInfoTitle(a.partner);SetInfoBody(c.toString());if((b=document.getElementById("InfoBody"))&&IsVScrollbarVisible(b)){if(b=document.getElementById("OpeningHours"))b.style.paddingRight="5px";if(b=document.getElementById("DetailTable"))b.style.width=b.offsetWidth-GetScrollbarWidth()-5+"px"}}}
function Detail(a){ClearSearchResults(true);SetInfoBody(lngMessageWaitLoading);ScrollToInfo();LastSearchType="shop_detail";LastSearchValues={};LastSearchValues.id=a;Detail_RPC.sendRequest("src/detail_shop.php?lang="+lang+"&shop_id="+a)}
function RenderProductIcons(a){if(typeof a=="undefined"||a.length==0)return"";for(var b="",c=0;c<a.length;c++)b+='<img src="'+(ngIExplorer?"/ngMapAPI/empty.gif":a[c].icon+"?"+VERSION_IMG)+'" alt="'+a[c].alt+'" title="'+a[c].alt+'" class="PopupProductIcon" style="width: '+a[c].icon_width+"px;"+(c==a.length-1?"margin-right: 0px;":"")+(ngIExplorer?"filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a[c].icon+"?"+VERSION_IMG+"', sizingMethod='image');":"")+'" />';return b}
function RenderDefaultPopUpMenu(a,b,c,d,e){var g="",f='<img style="margin-right: 5px;" src="img/item_arrowred.gif?'+VERSION_IMG+'" />';if(typeof d!="undefined"&&d!="")for(var h=0;h<d.length;h++)g+=f+d[h]+"<br />";g+=f+'<a href="javascript:PopupCenter();">'+lngCenterMap+"</a><br />";g+=f+'<a href="javascript:PopupMaxDetail('+(typeof c=="undefined"||c==""?"":"'"+c+"'")+');">'+lngMaxDetail+"</a><br />";if(typeof e!="undefined"&&e!="")for(h=0;h<e.length;h++)g+=f+e[h]+"<br />";return a.CreatePopupHTML(b,
g)}function ToggleLayer(a){if(typeof a!="undefined")map.MapCommand(map.LayersStates[a]?"LD":"LE",a)}
function Init(){var a=[];switch(app_type){case 1:a=new Array("img/arr_leftup_.gif","img/arr_leftdown_.gif","img/arr_rightup_.gif","img/arr_rightdown_.gif","img/arr_up_.gif","img/arr_down_.gif","img/arr_left_.gif","img/arr_right_.gif","img/icon1_.gif","img/icon2_.gif","img/icon3_.gif","img/icon4_.gif","img/icon5_.gif","img/checkbox_.gif","img/window_arr_down.gif","img/window_arr_up.gif","img/item_arrowred.gif","img/radiobutton_.gif","img/clock.png","img/logoATM.png","img/logoBilla.png","img/logoBrandStore.png",
"img/logoCSOB.png","img/logoGeko.png","img/logoJet.png","img/logoNay.png","img/logoOther.png","img/logoPartner.png","img/logoPosta.png","img/logoPress.png","img/logoSlovnaft.png","img/logoSporitelna.png","img/logoTesco.png","img/logoVUB.png","img/logoOTP.png","img/Shop1_s.png","img/Shop2_s.png","img/Shop3_s.png","img/Shop4_s.png","img/Sortiment1_s.png","img/Sortiment2_s.png","img/Sortiment3_s.png","img/Sortiment4_s.png","img/Sortiment5_s.png","img/Sortiment6_s.png","img/Sortiment7_s.png","img/Sortiment8_s.png",
"img/Sortiment9_s.png","img/Sortiment10_s.png","img/zoom_back.gif","img/zoom_in.gif","img/zoom_out.gif","img/zoom_redpoint.gif");break;case 2:a=new Array("img/arr_leftup_.gif","img/arr_leftdown_.gif","img/arr_rightup_.gif","img/arr_rightdown_.gif","img/arr_up_.gif","img/arr_down_.gif","img/arr_left_.gif","img/arr_right_.gif","img/icon1_.gif","img/icon2_.gif","img/icon3_.gif","img/icon4_.gif","img/icon5_.gif","img/checkbox_.gif","img/window_arr_down.gif","img/window_arr_up.gif","img/item_arrowred.gif",
"img/radiobutton_.gif","img/clock.png","img/zoom_back.gif","img/zoom_in.gif","img/zoom_out.gif","img/zoom_redpoint.gif");break;case 3:break}PreloadImages(a);PreloadCursor("img/hand_big.cur");PreloadCursor("img/hand_small.cur");PreloadCursor("img/lupa.cur");if(!ngIExplorer)if(a=document.getElementById("Clock"))a.innerHTML='<img src="img/clock.png?'+VERSION_IMG+'" style="width: 32px; height: 32px;" />';map=new ngMap("MainMap","map.php?lang="+lang+"&at="+app_type);if(ngOpera){map.CursorPan="move";map.CursorPanDown=
"move";map.CursorZoomIn="crosshair"}else{map.CursorPan="url('img/Hand_big.cur?"+VERSION_IMG+"'), move";map.CursorPanDown="url('img/Hand_small.cur?"+VERSION_IMG+"'), move";map.CursorZoomIn="url('img/lupa.cur?"+VERSION_IMG+"'), crosshair"}map.CreatePopup=CreatePopup;map.OnModeChanged=SetMapMode;map.OnCommandFinished=CommandFinished;map.OnTilesLoading=TilesLoading;map.OnTilesLoaded=TilesLoaded;map.OnMapMenu=MapMenu;map.OnActiveObjectMenu=ActiveObjectMenu;if(fullscreen){window.onresize=AdjustControlsInFullscreen;
AdjustControlsInFullscreen()}if(app_type==1||app_type==2){places=new ngPlaces(map);places.PageSize=13;places.Country=MAP_COUNTRY;places.OnSearch=StartSearch;places.OnSearchCancel=StopSearch;places.OnSearchError=SearchError;places.OnSearchResults=DisplaySearchResults;places.OnItemPopupMenu=SearchItemMenu}if(app_type==1){nearest=new ngNearest(map);nearest.NearestURL="http://"+document.domain+"/src/nearest.php";nearest.PageSize=9;nearest.OnSearch=StartSearch;nearest.OnSearchResults=DisplaySearchNearestResults;
nearest.OnSearchCancel=StopSearch;nearest.OnSearchError=SearchError;nearest.OnLocateItem=LocateNearestPlace}if(app_type==1||app_type==3){Detail_RPC=new ngRPC("Detail");Detail_RPC.nocache=true}setSearchFormType(SFT_DEFAULT);app_type==1&&setActiveDetailSearchFilter(DSF_DEFAULT);if(fullscreen&&init_session!=""){var b;map.MapSession=init_session;map.X=init_map_x;map.Y=init_map_y;map.Update();map.SetMode(init_map_mode);if(app_type==1){typeof init_dsf!="undefined"&&setActiveDetailSearchFilter(init_dsf);
if(typeof init_rid!="undefined"){a=document.getElementById("InputRegion");a.value=init_rid}RegionChanged();if(typeof init_did!="undefined"){a=document.getElementById("InputDistrict");a.value=init_did}if(typeof init_products_checkbox_states!="undefined"){a=String(init_products_checkbox_states).split(";");for(b=0;b<a.length;b++)CheckProductCheckbox(b,a[b]=="1",false)}if(typeof init_shoptypes_checkbox_states!="undefined"){a=String(init_shoptypes_checkbox_states).split(";");for(b=0;b<a.length;b++)CheckShopTypeCheckbox(b,
a[b]=="1",false)}}if((app_type==1||app_type==2)&&typeof init_sft!="undefined")setSearchFormType(init_sft);if((app_type==1||app_type==2)&&typeof init_search_values!="undefined")for(b=0;b<SearchForms.length;b++)for(var c=0;c<SearchForms[b].Controls.length;c++)if(typeof init_search_values[SearchForms[b].Controls[c].ParamName]!="undefined")if(a=document.getElementById(SearchForms[b].Controls[c].Ctrl_ID))a.value=init_search_values[SearchForms[b].Controls[c].ParamName];if(app_type==1)if(typeof init_popup_icon!=
"undefined"){LocateNearestPlace_CreatePopupIcon(UserNearestPopupIconId,init_popup_icon.objid,init_popup_icon.url,init_popup_icon.pos,init_popup_icon.descr);map.Update()}if(LastSearchType&&LastSearchValues)map.ActiveCommandCallback=function(){RepeatLastSearch()};ScrollToMap()}else{Home();if(app_type==1&&typeof ShopID!="undefined"){map.ActiveCommandCallback=function(d){ShowOverlayMap(false);d.LocateScaleXY("max",ShopID.Geometry)};RegionSelect(ShopID.RegionID);Detail(ShopID.ID)}app_type==1&&HighlightOverlayMapRegion()}TipsTimerStart();
HideFocusOutlineOnLinks();Initilized=true}window.onload=Init;window.onunload=TipsTimerStop;
