// Copyright (c) Position s.r.o.
// All rights reserved.

var ngMapAPIURL="/ngMapAPI",ua=navigator.userAgent.toLowerCase(),ngOpera=ua.indexOf("opera")!=-1,ngOperaVersion=ngOpera?parseFloat(window.opera.version()):false,ngIExplorer=eval("/*@cc_on!@*/false"),ngIExplorer6=ngIExplorer&&parseInt(ua.match(/msie (\d+)/)[1])<7,ngFireFox=ua.indexOf("firefox")!=-1,ngFireFox1x=ngFireFox&&ua.indexOf("firefox/1.")!=-1,ngFireFox2x=ngFireFox&&ua.indexOf("firefox/2.")!=-1,ngChrome=ua.indexOf("chrome")!=-1,ngSafari=ua.indexOf("safari")!=-1,ngURLParams=[],ngURLParamsParsed=
false;function ScreenPt(a,b){this.x=a;this.y=b}function ngVal(a,b){return typeof a=="undefined"?b:a}function ngNullVal(a,b){return typeof a=="undefined"||a===null?b:a}
function ng_DetectAPIURL(){try{for(var a=document.getElementsByTagName("script"),b,c=0;c<a.length;c++)if(typeof a[c].src!="undefined"){b=a[c].src;var d=b.indexOf("basic.js");if(d>=0){ngMapAPIURL=b.substring(0,d-1);d=ngMapAPIURL.indexOf("://");if(d<0){var e=location.href;d=e.indexOf("://");if(ngMapAPIURL.charAt(0)=="/"){d=e.indexOf("/",d+3);if(d>0)e=e.substr(0,d)}else{var f=e.lastIndexOf("/");if(d+3<f)e=e.substr(0,f+1)}ngMapAPIURL=e+ngMapAPIURL}break}}}catch(g){}}
var ngPreloadedImages=[],ngPreloadImgCnt=0,ngPreloadImgCallback=null;function ng_PreloadImage(a){var b=ngPreloadedImages[a];if(typeof b=="undefined"){b=new Image;b.onload=ng_PreloadImgDone;b.onfailure=ng_PreloadImgDone;b.onerror=ng_PreloadImgDone;ngPreloadImgCnt++;ngPreloadedImages[a]=b;b.src=a}return b}function ng_PreloadImgDone(){ngPreloadImgCnt--;if(ngPreloadImgCnt<=0&&typeof ngPreloadImgCallback=="function"){ngPreloadImgCnt=0;var a=ngPreloadImgCallback;ngPreloadImgCallback=null;a()}}
function ng_PreloadImagesBegin(){ngPreloadImgCnt++}function ng_PreloadImagesEnd(a){ngPreloadImgCallback=ngAddEvent(ngPreloadImgCallback,a);ng_PreloadImgDone()}function ng_ReloadImage(a){ngPreloadedImages[a]=undefined;return ng_PreloadImage(a)}function PointsFromStr(a){var b=[];a=a.split(" ");for(var c=a.length/2,d=0;d<c;d++)b[d]=new ScreenPt(parseInt(a[d*2]),parseInt(a[d*2+1]));return b}function ng_AddURLParam(a,b){a+=a.indexOf("?")!=-1?"&":"?";a+=b;return a}
function ng_unescape(a){a=""+a;for(var b=a.indexOf("+");b>=0;){a=a.substring(0,b)+"%20"+a.substring(b+1,a.length);b=a.indexOf("+")}return unescape(a)}function ng_htmlEncode(a){a=new String(a);a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a=a.replace(/"/g,"&quot;")}
function ng_URLEncode(a,b,c){a=""+a;var d=a.length,e=new String,f=new Number;b=ngVal(b,false);if(typeof c=="undefined")c={33:1,36:1,95:1,39:1,40:1,41:1,42:1,44:1,45:1,46:1,48:1};for(i=0;i<d;i++){f=a.charCodeAt(i);if(f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||c[f])e+=a.charAt(i);else if(f==37)e+="%u0025";else{if(b){e+="%u";if(f<=255)e+="00"}else{e+="%";if(f>255)e+="u"}hexValStr=f.toString(16);if(hexValStr.length%2==1)hexValStr="0"+hexValStr;e+=hexValStr}}return e}
function ng_inDOM(a){if(typeof a=="object")for(;a;){if(a.tagName=="BODY")return true;a=a.parentNode}return false}function ng_containsDOM(a,b){var c=false;do{if(c=a==b)break;b=b.parentNode}while(b!=null);return c}function ng_CheckMouseEnter(a,b){if(!a)return false;if(a.contains&&b.fromElement)return!a.contains(b.fromElement);else if(b.relatedTarget)return!ng_containsDOM(a,b.relatedTarget)}
function ng_CheckMouseLeave(a,b){if(a.contains&&b.toElement)return!a.contains(b.toElement);else if(b.relatedTarget)return!ng_containsDOM(a,b.relatedTarget)}function ng_WindowWidth(){var a=0;if(typeof window.innerWidth=="number")a=window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)a=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)a=document.body.clientWidth;a||(a=100);return a}
function ng_WindowHeight(){var a=0;if(typeof window.innerHeight=="number")a=window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)a=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)a=document.body.clientHeight;a||(a=100);return a}
function ng_DocumentScrollX(){var a=0;if(typeof window.pageYOffset=="number")a=window.pageXOffset;else if(document.body&&(document.body.scrollLeft||document.body.scrollTop))a=document.body.scrollLeft;else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))a=document.documentElement.scrollLeft;return a}
function ng_DocumentScrollY(){var a=0;if(typeof window.pageYOffset=="number")a=window.pageYOffset;else if(document.body&&(document.body.scrollLeft||document.body.scrollTop))a=document.body.scrollTop;else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))a=document.documentElement.scrollTop;return a}function ng_findPosX(a){var b=0;if(a.offsetParent)for(;a.offsetParent;){b+=a.offsetLeft;a=a.offsetParent}else if(a.x)b+=a.x;return b}
function ng_findPosY(a){var b=0;if(a.offsetParent)for(;a.offsetParent;){b+=a.offsetTop;a=a.offsetParent}else if(a.y)b+=a.y;return b}
function ng_findMousePosX(a){var b=0;if(a.offsetParent)for(;a.offsetParent;){b+=a.offsetLeft;b-=a.scrollLeft;if(ngFireFox)b+=ng_GetCurrentStyle(a,"overflow")!=="auto"||ngFireFox1x||ngFireFox2x?2*ng_GetCurrentStylePx(a,"border-left-width"):ng_GetCurrentStylePx(a,"border-left-width");else ngOpera||(b+=ng_GetCurrentStylePx(a,"border-left-width"));a=a.offsetParent}else if(a.x)b+=a.x;b-=ng_DocumentScrollX();return b}
function ng_findMousePosY(a){var b=0;if(a.offsetParent)for(;a.offsetParent;){b+=a.offsetTop;b-=a.scrollTop;if(ngFireFox)b+=ng_GetCurrentStyle(a,"overflow")!=="auto"||ngFireFox1x||ngFireFox2x?2*ng_GetCurrentStylePx(a,"border-top-width"):ng_GetCurrentStylePx(a,"border-top-width");else ngOpera||(b+=ng_GetCurrentStylePx(a,"border-top-width"));a=a.offsetParent}else if(a.y)b+=a.y;b-=ng_DocumentScrollY();return b}
function ng_nullAttr(a){if(typeof a=="number")return false;if(typeof a=="string"&&a=="")return true;if(typeof a=="object"&&a==null)return true;return false}function ng_GetStylePx2(a){a=ngVal(a,"");if(a!=""){if(a.length>2&&a.substring(a.length-2)=="px")a=ng_GetStylePx(a.substring(0,a.length-2));return a}}function ng_GetStylePx(a){var b=typeof a;if(b=="number")return a;if(a==""||b=="undefined")return 0;a=parseInt(a);return isNaN(a)?0:a}
function ng_GetCurrentStyle(a,b){var c;if(document.defaultView&&document.defaultView.getComputedStyle)c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b);else if(a.currentStyle){b=b.replace(/\-(\w)/g,function(d,e){return e.toUpperCase()});c=a.currentStyle[b]}return c}function ng_GetCurrentStylePx(a,b){return ng_GetStylePx(ng_GetCurrentStyle(a,b))}function ng_StyleWidth(a){return typeof a.style.pixelWidth!="undefined"?ng_GetStylePx(a.style.pixelWidth):ng_GetStylePx(a.style.width)}
function ng_StyleHeight(a){return typeof a.style.pixelHeight!="undefined"?ng_GetStylePx(a.style.pixelHeight):ng_GetStylePx(a.style.height)}function ng_SetStyleWidth(a,b){if(typeof a.style.pixelWidth!="undefined")a.style.pixelWidth=b;else a.style.width=b+"px"}function ng_SetStyleHeight(a,b){if(typeof a.style.pixelHeight!="undefined")a.style.pixelHeight=b;else a.style.height=b+"px"}
function ng_OuterWidth(a){return ng_GetStylePx(a.offsetWidth)+ng_GetCurrentStylePx(a,"margin-left")+ng_GetCurrentStylePx(a,"margin-right")}function ng_OuterHeight(a){return ng_GetStylePx(a.offsetHeight)+ng_GetCurrentStylePx(a,"margin-top")+ng_GetCurrentStylePx(a,"margin-bottom")}
function ng_SetOuterWidth(a,b){b-=ng_GetCurrentStylePx(a,"margin-left")+ng_GetCurrentStylePx(a,"margin-right");b-=ng_GetCurrentStylePx(a,"border-left-width")+ng_GetCurrentStylePx(a,"border-right-width");b-=ng_GetCurrentStylePx(a,"padding-left")+ng_GetCurrentStylePx(a,"padding-right");ng_SetStyleWidth(a,b)}
function ng_SetOuterHeight(a,b){b-=ng_GetCurrentStylePx(a,"margin-top")+ng_GetCurrentStylePx(a,"margin-bottom");b-=ng_GetCurrentStylePx(a,"border-top-width")+ng_GetCurrentStylePx(a,"border-bottom-width");b-=ng_GetCurrentStylePx(a,"padding-top")+ng_GetCurrentStylePx(a,"padding-bottom");ng_SetStyleHeight(a,b)}
function ng_ClientWidth(a){if(!a)return 0;var b=ng_GetStylePx(a.clientWidth);if(!b){b=ng_StyleWidth(a);b+=ng_GetCurrentStylePx(a,"padding-left")+ng_GetCurrentStylePx(a,"padding-right")}return b}function ng_ClientHeight(a){if(!a)return 0;var b=ng_GetStylePx(a.clientHeight);if(!b){b=ng_StyleHeight(a);b+=ng_GetCurrentStylePx(a,"padding-top")+ng_GetCurrentStylePx(a,"padding-bottom")}return b}
function ng_SetClientWidth(a,b){b-=ng_GetCurrentStylePx(a,"padding-left")+ng_GetCurrentStylePx(a,"padding-right");ng_SetStyleWidth(a,b)}function ng_SetClientHeight(a,b){b-=ng_GetCurrentStylePx(a,"padding-top")+ng_GetCurrentStylePx(a,"padding-bottom");ng_SetStyleHeight(a,b)}function ng_setLeftTopNotIE(a,b,c){a.style.left=b+"px";a.style.top=c+"px"}function ng_setLeftTopIE(a,b,c){a.style.pixelLeft=b;a.style.pixelTop=c}var ng_setLeftTop=ngIExplorer?ng_setLeftTopIE:ng_setLeftTopNotIE;
function ng_setBoundsNotIE(a,b,c,d,e){a.style.left=b+"px";a.style.top=c+"px";a.style.width=d+"px";a.style.height=e+"px"}function ng_setBoundsIE(a,b,c,d,e){a.style.pixelLeft=b;a.style.pixelTop=c;a.style.pixelWidth=d;a.style.pixelHeight=e}var ng_setBounds=ngIExplorer?ng_setBoundsIE:ng_setBoundsNotIE;
function ng_ProcessURLParams2(a,b){if(a!=""){a=a.split(b);for(b=0;b<a.length;b++){s=a[b].split("=");if(s[0].substr(0,4)=="amp;")s[0]=s[0].substr(4);ngURLParams[ng_unescape(s[0])]=s.length>1?ng_unescape(s[1]):null}}}function ng_ProcessURLParams(a){ngURLParams=[];a=ngVal(a,window.location.href);var b=a.indexOf("?"),c=a.indexOf("#"),d="",e="";if(c>=0){e=a.substr(c+1);a=a.substr(0,c)}if(b>=0)d=a.substr(b+1);ng_ProcessURLParams2(d,"&");ng_ProcessURLParams2(e,"@");ngURLParamsParsed=true}
function ng_GET(a){ngURLParamsParsed||ng_ProcessURLParams();return ngURLParams[a]}function ng_Redirect(a,b){b=ngVal(b,true);try{var c=parent;if(b&&c!=window){for(;c;){if(c.parent==c)break;c=c.parent}c.location.href=a}else document.location.href=a;return true}catch(d){return false}}function ng_InIFRAME(){return parent!=window}function ng_CopyVar(a){var b;if(typeof a=="object"){b={};for(var c in a)b[c]=ng_CopyVar(a[c])}else b=a;return b}
function ng_EmptyVar(a){switch(typeof a){case "undefined":return true;case "string":return a=="";case "integer":return a==0;case "object":if(!a)return true;if(a.length>0)return false;for(var b in a)return false;return true;case "boolean":return!a}return false}function ngAddEvent(a,b){if(typeof b=="function"){if(typeof a=="function")return function(c,d,e,f){var g=a(c,d,e,f);c=b(c,d,e,f);return typeof g==typeof c&&g==c?g:undefined};return b}return a}
function ngObjAddEvent(a,b){var c=false;if(typeof b=="string"){c=b;b=a;a=c;c=true}if(typeof b=="function")if(typeof this[a]=="function"){var d=this.eventscnt=ngVal(this.eventscnt,0);this["ev_"+d]=c?b:this[a];this.eventscnt++;var e=this.eventscnt;this["ev_"+e]=c?this[a]:b;this.eventscnt++;this[a]=function(f,g,k,l){var h,j;if(this["ev_"+d])h=this["ev_"+d](f,g,k,l);if(this["ev_"+e])j=this["ev_"+e](f,g,k,l);return typeof h==typeof j&&h==j?h:undefined}}else this[a]=b}
function ngObjRemoveEvent(a,b){if(typeof b=="function")if(this[a]==b)this[a]=null;else{a=ngVal(this.eventscnt,0);for(var c=0;c<a;c++)if(this["ev_"+c]==b)this["ev_"+c]=null}}
function ng_sendRequest(a,b){b=ngVal(b,this.nocache);var c=this;c=document.getElementById(this.id);var d=document.getElementsByTagName("head").item(0);if(d){c&&d.removeChild(c);c=document.createElement("script");if(b){b=new Date;var e=a.indexOf("?");a+=e>=0?"&":"?";a+="UQ="+b.getTime()}c.setAttribute("src",a);c.setAttribute("id",this.id);d.appendChild(c)}}function ngRPC(a){this.id=a+"_RPC";this.nocache=false;this.sendRequest=ng_sendRequest}
function ngStringBuilder(a){this.strings=new Array("");this.append=function(b){if(b)if(typeof b=="string")this.strings.push(b);else if(b.strings)for(var c=0;c<b.strings.length;c++)this.strings.push(b.strings[c]);else for(c=0;c<b.length;c++)this.strings.push(b[c]);return this};this.clear=function(){this.strings.length=1};this.empty=function(){return this.strings.length<=1};this.toString=function(){return this.strings.join("")};this.append(a)}var url=document.location.href,idx=url.indexOf("://");
if(idx>=0){ngHTTPProtocol=url.substring(0,idx+3);if(ngHTTPProtocol=="file://")ngHTTPProtocol="http://"}else ngHTTPProtocol="http://";ng_DetectAPIURL();ngEmptyURL=ngMapAPIURL+"/empty.gif?nop";
