// Copyright (c) Position s.r.o.
// All rights reserved.

var ngPreloadedImages=[],ngMapAPIURL="/ngMapAPI",ua=navigator.userAgent.toLowerCase(),ngOpera=ua.indexOf("opera")!=-1,ngOperaVersion=ngOpera?parseFloat(window.opera.version()):false,ngIExplorer=!ngOpera&&ua.indexOf("msie")!=-1,ngFireFox=ua.indexOf("firefox")!=-1,ngFireFox1x=ngFireFox&&ua.indexOf("firefox/1.")!=-1,ngSafari=ua.indexOf("safari")!=-1,ngURLParams=[],ngURLParamsParsed=false;function ScreenPt(a,b){this.x=a;this.y=b}
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){}}
function ng_PreloadImage(a){var b=ngPreloadedImages[a];if(!b){b=new Image;b.src=a;ngPreloadedImages[a]=b}return b}function ng_ReloadImage(a){var b=new Image;b.src=a;return ngPreloadedImages[a]=b}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){var c=a.length,d=new String,e=new Number;if(typeof b=="undefined")b=false;for(i=0;i<c;i++){e=a.charCodeAt(i);if(e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e==33||e==36||e==95)d+=a.charAt(i);else if(e==37)d+="%u0025";else{if(b){d+="%u";if(e<=255)d+="00"}else{d+="%";if(e>255)d+="u"}hexValStr=e.toString(16);if(hexValStr.length%2==1)hexValStr="0"+hexValStr;d+=hexValStr}}return d}
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.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;if(!a||a<100)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;if(!a||a<100)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_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){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(){ngURLParams=[];var a=window.location.href,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 ngAddEvent(a,b){if(typeof b=="function")return typeof a=="function"?function(c){a(c);b(c)}:b;else if(typeof a=="function")return a}
function ng_sendRequest(a){var b=this;b=document.getElementById(this.id);var c=document.getElementsByTagName("head").item(0);if(c){b&&c.removeChild(b);b=document.createElement("script");if(this.nocache){var d=new Date,e=a.indexOf("?");a+=e>=0?"&":"?";a+="UQ="+d.getTime()}b.setAttribute("src",a);b.setAttribute("id",this.id);c.appendChild(b)}}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])};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";
