/*
 WEB-GIS PRO-GOROD ver. 0.2.6. Author Titov.V. All rights reserved.
*/
var swfobject=function(){function d(){if(!R){try{var b=t.getElementsByTagName("body")[0].appendChild(y("span"));b.parentNode.removeChild(b)}catch(c){return}R=true;b=V.length;for(var g=0;g<b;g++)V[g]()}}function e(b){if(R)b();else V[V.length]=b}function n(b){if(typeof I.addEventListener!=f)I.addEventListener("load",b,false);else if(typeof t.addEventListener!=f)t.addEventListener("load",b,false);else if(typeof I.attachEvent!=f)L(I,"onload",b);else if(typeof I.onload=="function"){var c=I.onload;I.onload=
function(){c();b()}}else I.onload=b}function s(){da?p():k()}function p(){var b=t.getElementsByTagName("body")[0],c=y(u);c.setAttribute("type",A);var g=b.appendChild(c);if(g){var j=0;(function(){if(typeof g.GetVariable!=f){var l=g.GetVariable("$version");if(l){l=l.split(" ")[1].split(",");m.pv=[parseInt(l[0],10),parseInt(l[1],10),parseInt(l[2],10)]}}else if(j<10){j++;setTimeout(arguments.callee,10);return}b.removeChild(c);g=null;k()})()}else k()}function k(){var b=O.length;if(b>0)for(var c=0;c<b;c++){var g=
O[c].id,j=O[c].callbackFn,l={success:false,id:g};if(m.pv[0]>0){var q=v(g);if(q)if(H(O[c].swfVersion)&&!(m.wk&&m.wk<312)){C(g,true);if(j){l.success=true;l.ref=G(g);j(l)}}else if(O[c].expressInstall&&J()){l={};l.data=O[c].expressInstall;l.width=q.getAttribute("width")||"0";l.height=q.getAttribute("height")||"0";if(q.getAttribute("class"))l.styleclass=q.getAttribute("class");if(q.getAttribute("align"))l.align=q.getAttribute("align");var r={};q=q.getElementsByTagName("param");for(var z=q.length,E=0;E<
z;E++)if(q[E].getAttribute("name").toLowerCase()!="movie")r[q[E].getAttribute("name")]=q[E].getAttribute("value");F(l,r,g,j)}else{w(q);j&&j(l)}}else{C(g,true);if(j){if((g=G(g))&&typeof g.SetVariable!=f){l.success=true;l.ref=g}j(l)}}}}function G(b){var c=null;if((b=v(b))&&b.nodeName=="OBJECT")if(typeof b.SetVariable!=f)c=b;else if(b=b.getElementsByTagName(u)[0])c=b;return c}function J(){return!W&&H("6.0.65")&&(m.win||m.mac)&&!(m.wk&&m.wk<312)}function F(b,c,g,j){W=true;ba=j||null;ea={success:false,
id:g};var l=v(g);if(l){if(l.nodeName=="OBJECT"){T=B(l);X=null}else{T=l;X=g}b.id=fa;if(typeof b.width==f||!/%$/.test(b.width)&&parseInt(b.width,10)<310)b.width="310";if(typeof b.height==f||!/%$/.test(b.height)&&parseInt(b.height,10)<137)b.height="137";t.title=t.title.slice(0,47)+" - Flash Player Installation";j=m.ie&&m.win?"ActiveX":"PlugIn";j="MMredirectURL="+I.location.toString().replace(/&/g,"%26")+"&MMplayerType="+j+"&MMdoctitle="+t.title;if(typeof c.flashvars!=f)c.flashvars+="&"+j;else c.flashvars=
j;if(m.ie&&m.win&&l.readyState!=4){j=y("div");g+="SWFObjectNew";j.setAttribute("id",g);l.parentNode.insertBefore(j,l);l.style.display="none";(function(){l.readyState==4?l.parentNode.removeChild(l):setTimeout(arguments.callee,10)})()}x(b,c,g)}}function w(b){if(m.ie&&m.win&&b.readyState!=4){var c=y("div");b.parentNode.insertBefore(c,b);c.parentNode.replaceChild(B(b),c);b.style.display="none";(function(){b.readyState==4?b.parentNode.removeChild(b):setTimeout(arguments.callee,10)})()}else b.parentNode.replaceChild(B(b),
b)}function B(b){var c=y("div");if(m.win&&m.ie)c.innerHTML=b.innerHTML;else if(b=b.getElementsByTagName(u)[0])if(b=b.childNodes)for(var g=b.length,j=0;j<g;j++)!(b[j].nodeType==1&&b[j].nodeName=="PARAM")&&b[j].nodeType!=8&&c.appendChild(b[j].cloneNode(true));return c}function x(b,c,g){var j,l=v(g);if(m.wk&&m.wk<312)return j;if(l){if(typeof b.id==f)b.id=g;if(m.ie&&m.win){var q="";for(var r in b)if(b[r]!=Object.prototype[r])if(r.toLowerCase()=="data")c.movie=b[r];else if(r.toLowerCase()=="styleclass")q+=
' class="'+b[r]+'"';else if(r.toLowerCase()!="classid")q+=" "+r+'="'+b[r]+'"';r="";for(var z in c)if(c[z]!=Object.prototype[z])r+='<param name="'+z+'" value="'+c[z]+'" />';l.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+q+">"+r+"</object>";Y[Y.length]=b.id;j=v(b.id)}else{z=y(u);z.setAttribute("type",A);for(q in b)if(b[q]!=Object.prototype[q])if(q.toLowerCase()=="styleclass")z.setAttribute("class",b[q]);else q.toLowerCase()!="classid"&&z.setAttribute(q,b[q]);for(var E in c)c[E]!=
Object.prototype[E]&&E.toLowerCase()!="movie"&&K(z,E,c[E]);l.parentNode.replaceChild(z,l);j=z}}return j}function K(b,c,g){var j=y("param");j.setAttribute("name",c);j.setAttribute("value",g);b.appendChild(j)}function o(b){var c=v(b);if(c&&c.nodeName=="OBJECT")if(m.ie&&m.win){c.style.display="none";(function(){c.readyState==4?h(b):setTimeout(arguments.callee,10)})()}else c.parentNode.removeChild(c)}function h(b){if(b=v(b)){for(var c in b)if(typeof b[c]=="function")b[c]=null;b.parentNode.removeChild(b)}}
function v(b){var c=null;try{c=t.getElementById(b)}catch(g){}return c}function y(b){return t.createElement(b)}function L(b,c,g){b.attachEvent(c,g);S[S.length]=[b,c,g]}function H(b){var c=m.pv;b=b.split(".");b[0]=parseInt(b[0],10);b[1]=parseInt(b[1],10)||0;b[2]=parseInt(b[2],10)||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false}function D(b,c,g,j){if(!(m.ie&&m.mac)){var l=t.getElementsByTagName("head")[0];if(l){g=g&&typeof g=="string"?g:"screen";if(j)ca=M=null;
if(!M||ca!=g){j=y("style");j.setAttribute("type","text/css");j.setAttribute("media",g);M=l.appendChild(j);if(m.ie&&m.win&&typeof t.styleSheets!=f&&t.styleSheets.length>0)M=t.styleSheets[t.styleSheets.length-1];ca=g}if(m.ie&&m.win)M&&typeof M.addRule==u&&M.addRule(b,c);else M&&typeof t.createTextNode!=f&&M.appendChild(t.createTextNode(b+" {"+c+"}"))}}}function C(b,c){if(ga){c=c?"visible":"hidden";if(R&&v(b))v(b).style.visibility=c;else D("#"+b,"visibility:"+c)}}function a(b){return/[\\\"<>\.;]/.exec(b)!=
null&&typeof encodeURIComponent!=f?encodeURIComponent(b):b}var f="undefined",u="object",A="application/x-shockwave-flash",fa="SWFObjectExprInst",I=window,t=document,P=navigator,da=false,V=[s],O=[],Y=[],S=[],T,X,ba,ea,R=false,W=false,M,ca,ga=true,m=function(){var b=typeof t.getElementById!=f&&typeof t.getElementsByTagName!=f&&typeof t.createElement!=f,c=P.userAgent.toLowerCase(),g=P.platform.toLowerCase(),j=g?/win/.test(g):/win/.test(c);g=g?/mac/.test(g):/mac/.test(c);c=/webkit/.test(c)?parseFloat(c.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,
"$1")):false;var l=!+"\u000b1",q=[0,0,0],r=null;if(typeof P.plugins!=f&&typeof P.plugins["Shockwave Flash"]==u){if((r=P.plugins["Shockwave Flash"].description)&&!(typeof P.mimeTypes!=f&&P.mimeTypes[A]&&!P.mimeTypes[A].enabledPlugin)){da=true;l=false;r=r.replace(/^.*\s+(\S+\s+\S+$)/,"$1");q[0]=parseInt(r.replace(/^(.*)\..*$/,"$1"),10);q[1]=parseInt(r.replace(/^.*\.(.*)\s.*$/,"$1"),10);q[2]=/[a-zA-Z]/.test(r)?parseInt(r.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof I.ActiveXObject!=f)try{var z=
new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(z)if(r=z.GetVariable("$version")){l=true;r=r.split(" ")[1].split(",");q=[parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10)]}}catch(E){}return{w3:b,pv:q,wk:c,ie:l,win:j,mac:g}}();(function(){if(m.w3){if(typeof t.readyState!=f&&t.readyState=="complete"||typeof t.readyState==f&&(t.getElementsByTagName("body")[0]||t.body))d();if(!R){typeof t.addEventListener!=f&&t.addEventListener("DOMContentLoaded",d,false);if(m.ie&&m.win){t.attachEvent("onreadystatechange",
function(){if(t.readyState=="complete"){t.detachEvent("onreadystatechange",arguments.callee);d()}});I==top&&function(){if(!R){try{t.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,0);return}d()}}()}m.wk&&function(){R||(/loaded|complete/.test(t.readyState)?d():setTimeout(arguments.callee,0))}();n(d)}}})();(function(){m.ie&&m.win&&window.attachEvent("onunload",function(){for(var b=S.length,c=0;c<b;c++)S[c][0].detachEvent(S[c][1],S[c][2]);b=Y.length;for(c=0;c<b;c++)o(Y[c]);for(var g in m)m[g]=
null;m=null;for(var j in swfobject)swfobject[j]=null;swfobject=null})})();return{registerObject:function(b,c,g,j){if(m.w3&&b&&c){var l={};l.id=b;l.swfVersion=c;l.expressInstall=g;l.callbackFn=j;O[O.length]=l;C(b,false)}else j&&j({success:false,id:b})},getObjectById:function(b){if(m.w3)return G(b)},embedSWF:function(b,c,g,j,l,q,r,z,E,U){var Z={success:false,id:c};if(m.w3&&!(m.wk&&m.wk<312)&&b&&c&&g&&j&&l){C(c,false);e(function(){g+="";j+="";var Q={};if(E&&typeof E===u)for(var N in E)Q[N]=E[N];Q.data=
b;Q.width=g;Q.height=j;N={};if(z&&typeof z===u)for(var $ in z)N[$]=z[$];if(r&&typeof r===u)for(var aa in r)if(typeof N.flashvars!=f)N.flashvars+="&"+aa+"="+r[aa];else N.flashvars=aa+"="+r[aa];if(H(l)){$=x(Q,N,c);Q.id==c&&C(c,true);Z.success=true;Z.ref=$}else if(q&&J()){Q.data=q;F(Q,N,c,U);return}else C(c,true);U&&U(Z)})}else U&&U(Z)},switchOffAutoHideShow:function(){ga=false},ua:m,getFlashPlayerVersion:function(){return{major:m.pv[0],minor:m.pv[1],release:m.pv[2]}},hasFlashPlayerVersion:H,createSWF:function(b,
c,g){if(m.w3)return x(b,c,g)},showExpressInstall:function(b,c,g,j){m.w3&&J()&&F(b,c,g,j)},removeSWF:function(b){m.w3&&o(b)},createCSS:function(b,c,g,j){m.w3&&D(b,c,g,j)},addDomLoadEvent:e,addLoadEvent:n,getQueryParamValue:function(b){var c=t.location.search||t.location.hash;if(c){if(/\?/.test(c))c=c.split("?")[1];if(b==null)return a(c);c=c.split("&");for(var g=0;g<c.length;g++)if(c[g].substring(0,c[g].indexOf("="))==b)return a(c[g].substring(c[g].indexOf("=")+1))}return""},expressInstallCallback:function(){if(W){var b=
v(fa);if(b&&T){b.parentNode.replaceChild(T,b);if(X){C(X,true);if(m.ie&&m.win)T.style.display="block"}ba&&ba(ea)}W=false}}}}(),json_parse=function(){var d,e,n={'"':'"',"\\":"\\","/":"/",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"},s,p=function(o){throw{name:"SyntaxError",message:o,at:d,text:s};},k=function(o){o&&o!==e&&p("Expected '"+o+"' instead of '"+e+"'");e=s.charAt(d);d+=1;return e},G=function(){var o;o="";if(e==="-"){o="-";k("-")}for(;e>="0"&&e<="9";){o+=e;k()}if(e===".")for(o+=".";k()&&e>="0"&&
e<="9";)o+=e;if(e==="e"||e==="E"){o+=e;k();if(e==="-"||e==="+"){o+=e;k()}for(;e>="0"&&e<="9";){o+=e;k()}}o=+o;if(isNaN(o))p("Bad number");else return o},J=function(){var o,h,v="",y;if(e==='"')for(;k();)if(e==='"'){k();return v}else if(e==="\\"){k();if(e==="u"){for(h=y=0;h<4;h+=1){o=parseInt(k(),16);if(!isFinite(o))break;y=y*16+o}v+=String.fromCharCode(y)}else if(typeof n[e]==="string")v+=n[e];else break}else v+=e;p("Bad string")},F=function(){for(;e&&e<=" ";)k()},w=function(){switch(e){case "t":k("t");
k("r");k("u");k("e");return true;case "f":k("f");k("a");k("l");k("s");k("e");return false;case "n":k("n");k("u");k("l");k("l");return null}p("Unexpected '"+e+"'")},B,x=function(){var o=[];if(e==="["){k("[");F();if(e==="]"){k("]");return o}for(;e;){o.push(B());F();if(e==="]"){k("]");return o}k(",");F()}}p("Bad array")},K=function(){var o,h={};if(e==="{"){k("{");F();if(e==="}"){k("}");return h}for(;e;){o=J();F();k(":");Object.hasOwnProperty.call(h,o)&&p('Duplicate key "'+o+'"');h[o]=B();F();if(e===
"}"){k("}");return h}k(",");F()}}p("Bad object")};B=function(){F();switch(e){case "{":return K();case "[":return x();case '"':return J();case "-":return G();default:return e>="0"&&e<="9"?G():w()}};return function(o,h){s=o;d=0;e=" ";o=B();F();e&&p("Syntax error");return typeof h==="function"?function v(y,L){var H,D,C=y[L];if(C&&typeof C==="object")for(H in C)if(Object.hasOwnProperty.call(C,H)){D=v(C,H);if(D!==undefined)C[H]=D;else delete C[H]}return h.call(y,L,C)}({"":o},""):o}}();
function Map(d){function e(){if(!d)throw"Map DOM object is not defined in constructor";if(typeof d=="string")throw"String is passed as argument to constructor";if(!swfobject)throw"SWF builder object is not defined in constructor";n()}function n(){var a=document.createElement("div");a.id="ProGorodMap";d.appendChild(a);var f={key:C,width:d.offsetWidth,height:d.offsetHeight},u={id:a.id,name:a.id};swfobject.switchOffAutoHideShow();swfobject.embedSWF("http://flash.tmcrussia.com/releases/0.2.6/Main.swf",
a.id,"100%","100%","10.0","http://flash.tmcrussia.com/swf/expressInstall.swf",f,{wmode:"opaque",align:"left",scale:"default",allowscriptaccess:"always",hasPriority:"true"},u);FlashBridge.flashObj=document.getElementById(a.id);FlashBridge.mapObj=H;s(FlashBridge.flashObj)}function s(a){if(a){addHandler(a,"mouseover",p);addHandler(a,"mouseout",k)}}function p(a){window.addEventListener&&window.addEventListener("DOMMouseScroll",G,false);window.onmousewheel=document.onmousewheel=G}function k(a){window.removeEventListener&&
window.removeEventListener("DOMMouseScroll",G,false);window.onmousewheel=document.onmousewheel=function(f){}}function G(a){var f=navigator.appVersion.toLowerCase().indexOf("mac")!=-1;f=navigator.appVersion.toLowerCase().indexOf("win")!=-1;f=window.opera==undefined?false:true;f=0;if(!a)a=window.event;if(a.wheelDelta)f=a.wheelDelta/120;else if(a.detail)f=-a.detail/3;f&&J(f);a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();a.cancelBubble=true;a.cancel=true;a.returnValue=false}
function J(a){FlashBridge.sendFlash("sendMouseWheelEvent",a)}function F(a){switch(a.type){case "point":h.points.push(a);break;case "polyline":h.polylines.push(a);break;case "polygon":h.polygons.push(a);break;case "rectangle":h.rectangles.push(a);break;case "freeHand":h.freeHands.push(a);break;case "widget":h.widgets.push(a);break}}function w(a){switch(a.type){case "point":delete h.points[a.id];break;case "polyline":delete h.polylines[a.id];break;case "polygon":delete h.polygons[a.id];break;case "rectangle":delete h.rectangles[a.id];
break;case "freeHand":delete h.freeHands[a.id];break;case "widget":delete h.widgets[a.id]}}function B(a){id=a.id;delete a.id;switch(a.type){case "point":h.points[id].params=a;break;case "polyline":h.polylines[id].params.points=a.points;break;case "polygon":h.polygons[id].params.points=a.points;break;case "rectangle":h.rectangles[id].params.points=a.points;break}}var x={lon:4187521,lat:7473956,z:10},K={slider:{}},o={},h={points:[],polylines:[],polygons:[],rectangles:[],freeHands:[],widgets:[]},v,y=
[],L=[],H=this,D=false,C="91904bf395e483bb2d4f5b6c3516007d";this.mapZoomCallBack=this.mapMoveCallBack=this.ready=this.freeHandCallBack=this.rectangleCallBack=this.polygonCallBack=this.polylineCallBack=this.pointCallBack=bboxCallback=null;this.sendException=function(a){this.error(a)};this.error=function(a){console?console.log(a):alert(a)};this.getControls=function(){return K};this.setCenter=function(a){if(a&&a.lon!=undefined&&a.lat!=undefined&&a.zoom){x.lon=a.lon;x.lat=a.lat;x.z=a.zoom}D&&FlashBridge.sendFlash("setCenter",
x)};this.setCenterByBbox=function(a){a&&a.lon1!=undefined&&a.lat1!=undefined&&a.lon2!=undefined&&a.lat2!=undefined&&D&&FlashBridge.sendFlash("setCenterByBbox",a)};this.setControl=function(a,f){a=a.toString();K[a]=f?typeof f=="string"?{arg:f.toString()}:f:{}};this.unsetControl=function(a){var f=a.toString();if(K[a]!=undefined)K[a].enable=false};this.sendCallBack=function(a){if(a.type)switch(a.type){case "point":testFunc(this.pointCallBack)&&this.pointCallBack(h.points);break;case "polyline":testFunc(this.polylineCallBack)&&
this.polylineCallBack(h.polylines);break;case "polygon":testFunc(this.polygonCallBack)&&this.polygonCallBack(h.polygons);break;case "rectangle":testFunc(this.rectangleCallBack)&&this.rectangleCallBack(h.rectangles);break;case "freeHand":testFunc(this.freeHandCallBack)&&this.freeHandCallBack(h.freeHands);break;case "ajax":var f=L[a.id];f!=undefined&&f.callBack(a.response);L[a.id]=null;break;case "mapReady":testFunc(this.ready)&&this.ready();break;case "mapMove":testFunc(this.mapMoveCallBack)&&this.mapMoveCallBack(a.coords);
break;case "mapZoom":testFunc(this.mapZoomCallBack)&&this.mapZoomCallBack(a.coords);break;case "onPointClick":(a=h.points[a.id])&&a.onClick&&testFunc(a.onClick)&&a.onClick(a);break;case "onPointOver":(a=h.points[a.id])&&a.onMouseOver&&testFunc(a.onMouseOver)&&a.onMouseOver(a);break;case "onPointOut":(a=h.points[a.id])&&a.onMouseOut&&testFunc(a.onMouseOut)&&a.onMouseOut(a);break;case "getRoute":testFunc(this.route.callBack.get)&&this.route.callBack.get(a.route);break;case "onClickRoute":testFunc(this.route.callBack.onClick)&&
this.route.callBack.onClick(a);break;case "onMouseOverRoute":testFunc(this.route.callBack.onMouseOver)&&this.route.callBack.onMouseOver(a);break;case "onMouseOutRoute":testFunc(this.route.callBack.onMouseOut)&&this.route.callBack.onMouseOut(a);break;case "onDragRoute":testFunc(this.route.callBack.onDrag)&&this.route.callBack.onDrag(a);break;case "widgetCreate":if(testFunc(this.widget.callBack.create)){delete a.type;y[a.id]=a;this.widget.callBack.create(a)}break;case "widgetDelete":testFunc(this.widget.callBack["delete"])&&
this.widget.callBack["delete"](a);break;case "marker":testFunc(this.marker.callBack)&&this.marker.callBack(a)}};this.createGeometry=function(a,f){var u=null;switch(a.type){case "point":u=new Point(a,f);break;case "polyline":u=new Polyline(a,f);break;case "polygon":u=new Polygon(a,f);break;case "rectangle":u=new Rectangle(a,f);break;case "freeHand":h.freeHands.push(a);break;case "widget":h.widgets.push(a);break}if(!f&&D&&(a.type=="freeHand"||a.type=="widget"))FlashBridge.sendFlash("createGeometry",
a);if(a.type=="freeHand"||a.type=="widget")this.sendCallBack(a);if(u)return u};this.deleteGeometry=function(a){var f,u,A;if(typeof a=="string"&&a=="all"){for(el in h)for(A=0;A<h[el].length;A++){f={type:el.substring(0,el.length-1),id:A};w(f);D&&FlashBridge.sendFlash("deleteGeometry",f)}return true}else if(typeof a=="object"&&a.type!=undefined)if(a.id!=undefined){w(a);D&&FlashBridge.sendFlash("deleteGeometry",a)}else{u=this.getGeometry(a);for(A=0;A<u.length;){f={type:a.type,id:A};w(f);D&&FlashBridge.sendFlash("deleteGeometry",
f);A++}}};this.getGeometry=function(a){var f=null;if(a=="all")return h;switch(a.type){case "point":f=h.points;break;case "polyline":f=h.polylines;break;case "polygon":f=h.polygons;break;case "rectangle":f=h.rectangles;break;case "freeHand":f=h.freeHands;break}if(f&&a.id!=undefined)f=f[a.id];return f};this.updateGeometry=function(a){B(a);this.sendCallBack(a)};this.hideGeometry=function(a){FlashBridge.sendFlash("hideShowGeometry",{action:"hide",params:a})};this.showGeometry=function(a){FlashBridge.sendFlash("hideShowGeometry",
{action:"show",params:a})};this.addPointToGeometry=function(a){var f;if(a.type=="polyline")f=h.polylines[a.id];else if(a.type=="polygon")f=h.polygons[a.id];if(f!=undefined){f.points.push({lon:a.lon,lat:a.lat});FlashBridge.sendFlash("addPointToGeometry",a);this.sendCallBack(a)}};this.updatePoint=function(a){var f;if(a.type=="polyline")f=h.polylines[a.id].params.points[a.pointId];else if(a.type=="poligon")f=h.poligons[a.id].params.points[a.pointId];else if(a.type=="point")f=h.points[a.id].params;if(f){if(a.lon&&
a.lat){f.lon=a.lon;f.lat=a.lat}FlashBridge.sendFlash("updatePoint",a);this.sendCallBack(a)}};this.setStyle=function(a){a&&a.type&&FlashBridge.sendFlash("setStyle",a)};this.parseLog=function(a){if(a.type&&(a.url||a.str))FlashBridge.sendFlash("logParse",a)};this.geometry=function(){return h};this.geometry.get=this.getGeometry;this.geometry.create=this.createGeometry;this.geometry["delete"]=this.deleteGeometry;this.geometry.update=this.updateGeometry;this.geometry.hide=this.hideGeometry;this.geometry.show=
this.showGeometry;this.geometry.addPoint=this.addPointToGeometry;this.geometry.updatePoint=this.updatePoint;this.geometry.setStyle=this.setStyle;this.geometry.parseLog=this.parseLog;this.geometry.callBack=this.sendCallBack;this.geometry.sendCallBack=this.sendCallBack;this.search=function(a,f){var u;if(typeof a=="object"&&a.type){u=function(A){testFunc(f)&&A!=null&&f(json_parse(A))};a.callBack=u;this.ajax(a)}};this.ajax=function(a){var f=L.length;a.id=f;D&&FlashBridge.sendFlash("sendRequest",a);L[f]=
a};this.getPreSet=function(){var a=null;if(D==false){a={coords:x,controls:this.getControls(),geometry:this.getGeometry("all"),requests:L};a.geometry.route=[v];a.geometry.widgets=y;D=true}return a};this.getBboxCoords=function(){return FlashBridge.sendFlash("getBboxCoords")};this.lonLatToXY=function(a){var f,u,A={};if(a.lon&&typeof a.lon=="number"&&a.lat&&typeof a.lat=="number"&&a.zoom&&typeof a.zoom=="number"){f=this.getBboxCoords();u=FlashBridge.sendFlash("getResolution",a.zoom);A.x=Math.round(1/
u*(a.lon-f.bbox.lon1));A.y=Math.round(1/u*(f.bbox.lat2-a.lat));return A}return null};this.screenShot={};this.screenShot.getScreen=function(a){return FlashBridge.sendFlash("getScreenShot",{type:"buffer",quality:a||20})};this.screenShot.printMap=function(){FlashBridge.sendFlash("getScreenShot",true)};this.screenShot.getSVGFreeHand=function(){return FlashBridge.sendFlash("getSVGFromFreeHand",true)};this.route=function(){return v};this.route.callBack={};this.route.callBack.get=null;this.route.callBack.onMouseOver=
null;this.route.callBack.onMouseOut=null;this.route.callBack.onClick=null;this.route.callBack.onDrag=null;this.route.get=function(a){if(typeof a=="object"&&typeof a.points=="object"&&a.points.length>1){a.type="route";if(D)FlashBridge.sendFlash("createGeometry",a);else v=a}};this.route["delete"]=function(){v=null;FlashBridge.sendFlash("deleteGeometry",{type:"route"})};this.route.deletePoint=function(a){a!=undefined&&a>=0&&FlashBridge.sendFlash("deletePoint",{type:"route",id:a})};this.widget=function(){return y};
this.widget.create=function(a){if(typeof a=="object"&&a.url&&a.lon&&a.lat){a.type="widget";D?FlashBridge.sendFlash("createGeometry",a):h.widgets.push(a)}};this.widget.set=function(a){if(typeof a=="object"&&a.id!=undefined&&a.func&&typeof a.func=="string")return FlashBridge.sendFlash("sendWidgetMessage",a)};this.widget["delete"]=function(a){y[a]&&delete h.widgets[a];FlashBridge.sendFlash("deleteGeometry",{type:"widget",id:a})};this.widget.callBack={};this.widget.callBack.create=null;this.widget.callBack["delete"]=
null;this.marker={};this.marker.callBack=null;e()}function FlashBridge(){}FlashBridge.mapObj=null;FlashBridge.flashObj=null;FlashBridge.receiveFlash=function(d,e){var n;if(this.mapObj!=null&&d!=""){n=this.mapObj;if(testFunc(n[d.toString()]))if(d.toString()=="createGeometry")n.createGeometry(e,true);else return e!=undefined?n[d.toString()](e):n[d.toString()]();else if(testFunc(d))return window[d](e||null)}};
FlashBridge.sendFlash=function(d,e){var n;if(this.mapObj!=null&&this.flashObj!=null&&d!=""){n=this.flashObj;if(testFunc(n[d.toString()]))return e!=undefined?n[d.toString()](e):n[d.toString()]()}};
function GeometryProto(d){if(d&&d!="")var e=d;else throw"type is no defined";var n;this.toString=function(){return e};this.type=this.toString();this.id=function(){return n};this.init=function(s,p){if(s&&FlashBridge.mapObj){this.params=s;this.params.type=this.type;s=FlashBridge.mapObj;var k=s.getGeometry({type:e});k.push(this);n=k.length-1;p||FlashBridge.sendFlash("createGeometry",this.params);s.sendCallBack(this)}};this.show=function(){FlashBridge.sendFlash("hideShowGeometry",{action:"show",params:{type:this.type,
id:this.id()}})};this.hide=function(){FlashBridge.sendFlash("hideShowGeometry",{action:"hide",params:{type:this.type,id:this.id()}})};this.set=function(s){if(FlashBridge.mapObj){var p=FlashBridge.mapObj;s&&p.updatePoint({type:this.type,id:this.id(),pointId:s})}};this["delete"]=function(){FlashBridge.mapObj&&FlashBridge.mapObj.deleteGeometry({type:this.type,id:this.id()})}}
function Point(d,e){if(d&&d.lon!=undefined&&d.lat!=undefined)this.init(d,e);else throw"not all params";this.set=function(){FlashBridge.mapObj&&FlashBridge.mapObj.updatePoint({type:this.type,id:this.id()})}}Point.prototype=new GeometryProto("point");function Polyline(d,e){if(d&&d.points&&typeof d.length)this.init(d,e);else throw"not all params";}Polyline.prototype=new GeometryProto("polyline");function Polygon(d,e){if(d&&d.points&&typeof d.length)this.init(d,e);else throw"not all params";}
Polygon.prototype=new GeometryProto("polygon");function Rectangle(d,e){if(d&&d.points&&typeof d.length)this.init(d,e);else throw"not all params";}Rectangle.prototype=new GeometryProto("rectangle");function addHandler(d,e,n){if(typeof d.addEventListener!="undefined")d.addEventListener(e,n,false);else if(typeof d.attachEvent!="undefined")d.attachEvent("on"+e,n);else throw"Incompatible browser";}
function removeHandler(d,e,n){if(typeof d.removeEventListener!="undefined")d.removeEventListener(e,n,false);else if(typeof d.detachEvent!="undefined")d.detachEvent("on"+e,n);else throw"Incompatible browser";}var PI=3.14159265358979;function deg_rad(d){return d*(PI/180)}function deg_decimal(d){return d/PI*180}function merc_x(d){return 6378137*deg_rad(d)}function from_merc_x(d){return deg_decimal(d/6378137)}
function merc_y(d){if(d>89.5)d=89.5;if(d<-89.5)d=-89.5;var e=Math.sqrt(0.006694380004260925);d=deg_rad(d);var n=Math.sin(d);n=e*n;n=Math.pow((1-n)/(1+n),0.5*e);e=Math.tan(0.5*(PI*0.5-d))/n;return 0-6378137*Math.log(e)}
function from_merc_y(d){var e=Math.sqrt(0.006694380004260925);d=Math.exp(-d/6378137);var n,s,p;n=0.5*e;s=1.5707963267948966-2*Math.atan(d);var k=15;for(p=0.1;Math.abs(p)>1.0E-7&&--k>0;){p=e*Math.sin(s);p=1.5707963267948966-2*Math.atan(d*Math.pow((1-p)/(1+p),n))-s;s+=p}return deg_decimal(s)}function lonLatToXY(d){if(FlashBridge.mapObj&&FlashBridge.mapObj.lonLatToXY)return FlashBridge.mapObj.lonLatToXY(d);return null}
function TimeToDegreesLon(d){var e=new Number(d.substr(0,3));d=new Number(d.substr(3));return e+d/60}function TimeToDegreesLat(d){var e=new Number(d.substr(0,2));d=new Number(d.substr(2));return e+d/60}
function distVincenty(d,e,n,s){var p={},k={};p.lon=deg_rad(d);p.lat=deg_rad(e);k.lon=deg_rad(n);k.lat=deg_rad(s);d=1/298.257223563;e=k.lon-p.lon;p=Math.atan((1-d)*Math.tan(p.lat));s=Math.atan((1-d)*Math.tan(k.lat));k=Math.sin(p);p=Math.cos(p);n=Math.sin(s);s=Math.cos(s);for(var G=e,J=2*Math.PI,F=20;Math.abs(G-J)>1.0E-12&&--F>0;){var w=Math.sin(G),B=Math.cos(G),x=Math.sqrt(s*w*s*w+(p*n-k*s*B)*(p*n-k*s*B));if(x==0)return 0;B=k*n+p*s*B;var K=Math.atan2(x,B),o=p*s*w/x,h=1-o*o;w=B-2*k*n/h;if(isNaN(w))w=
0;var v=d/16*h*(4+d*(4-3*h));J=G;G=e+(1-v)*d*o*(K+v*x*(w+v*B*(-1+2*w*w)))}if(F==0)return NaN;h=h*2.723316066819453E11/4.0408299984087055E13;d=h/1024*(256+h*(-128+h*(74-47*h)));x=6356752.3142*(1+h/16384*(4096+h*(-768+h*(320-175*h))))*(K-d*x*(w+d/4*(B*(-1+2*w*w)-d/6*w*(-3+4*x*x)*(-3+4*w*w))));return x=x.toFixed(3)}Array.prototype.find=function(d){var e=false;for(i=0;i<this.length;i++)if(typeof d=="function"){if(d.test(this[i])){e||(e=[]);e.push(i)}}else if(this[i]===d){e||(e=[]);e.push(i)}return e};
function testFunc(a){if(a&&(typeof a=="function"||typeof window[a]=="function"))return true;return false};

