function share42(a,b,c,d,e){var f=jQuery;b||(b=location.href),c||(c=document.title),b=encodeURIComponent(b),c=encodeURIComponent(c),d||(d=150),e||(e=20);var g=["",'"http://www.facebook.com/sharer.php?u='+b+"&t="+c+'" title="Поделиться в Facebook"',"",'"http://twitter.com/share?text='+c+"&url="+b+'" title="Добавить в Twitter"','"#" onclick="window.open(\'http://vkontakte.ru/share.php?url='+b+"', '_blank', 'scrollbars=0, resizable=1, menubar=0, left=200, top=200, width=554, height=421, toolbar=0, status=0');return false\" title=\"Поделиться В Контакте\"",'"http://my.ya.ru/posts_add_link.xml?URL='+b+"&title="+c+'" title="Поделиться в Я.ру"'],h='<div id="share42">';for(var i=0;i<g.length;i++)g[i]&&(h+='<a rel="nofollow" style="display:block;width:16px;height:16px;margin:0 0 6px;background:url('+a+"icons.png) -"+16*i+'px 0" href='+g[i]+' target="_blank"></a>');h+="</div>",document.write(h),f(window).load(function(){function b(){var b=Math.max(document.body.scrollTop,document.documentElement.scrollTop);b+e<d?a.style.top=d-b+"px":a.style.top=e+"px"}var a=document.getElementById("share42");b(),f(window).scroll(b)})}function undelayMapLoading(){window.mapLoadingDelayed=!1,mapLoadingDelayedCallback()}function delayMapLoading(){window.mapLoadingDelayed=!0}function hab_edit_get_content(){return $(habr_selectedtarget).value}function hab_edit_preview(){darkPannel.ajax(DataCenter+"editors/preview.php")}function hab_edit_videoform(){darkPannel.ajax(DataCenter+"editors/video.php")}function hab_edit_insert_text_loc(){darkPannel.ajax(DataCenter+"editors/locality.php")}function hab_edit_showpicuploadform(){darkPannel.ajax(DataCenter+"editors/upload.php")}function hab_edit_open_help(){darkPannel.ajax(DataCenter+"editors/help.php")}function hab_edit_resize_stop(){document.addEventListener?document.removeEventListener("mousemove",hab_edit_resize_mousemove,!1):document.detachEvent("onmousemove",hab_edit_resize_mousemove)}function hab_edit_resize_start(a){a||(a=this.event),textarea_height||(textarea_height=100),a.pageY?mouseY=a.pageY-textarea_height:mouseY=a.clientY-textarea_height,document.addEventListener?document.addEventListener("mousemove",hab_edit_resize_mousemove,!1):document.attachEvent("onmousemove",hab_edit_resize_mousemove)}function hab_edit_resize_mousemove(a){a||(a=this.event);if(a.pageY)var b=a.pageY-mouseY;else var b=a.clientY-mouseY;b>=50&&($(habr_selectedtarget).style.height=b+"px",textarea_height=b)}function hab_edit_insert_text_link(){var a=$(habr_selectedtarget),b=hab_edit_getCursor(a);if(b.start!=b.end){var c=window.prompt("Введите URL ссылки",""),d=new RegExp("([A-Za-z][A-Za-z0-9+.-]{1,120}:[A-Za-z0-9/](([A-Za-z0-9$_.+!*,;/?:@&~=-])|%[A-Fa-f0-9]{2}){1,333}(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*,;/?:@&~=%-]{0,1000}))?)");c&&c.match(d)?hab_edit_insert_tag("<a href='"+c+"' target=_blank>","</a>"):alert("Это не URL")}else alert("Сначала выделите текст, который вы желаете сделать ссылкой")}function hab_edit_insert_text_s(){hab_edit_insert_tag("<s>","</s>")}function hab_edit_insert_text_u(){hab_edit_insert_tag("<u>","</u>")}function hab_edit_insert_text_user(){var a=$(habr_selectedtarget),b=hab_edit_getCursor(a),c=window.prompt("Кто?","");c&&(b.start!=b.end?hab_edit_insert_tag('<hh user="'+c+'">',"</hh>"):hab_edit_insert_tag("",'<hh user="'+c+'" />'))}function hab_edit_insert_text_i(){hab_edit_insert_tag("<em>","</em>")}function hab_edit_insert_text_img_close(){$("addimgdiv").style.display="none"}function hab_edit_insert_text_img(){$("addimgdiv").style.display="block"}function hab_edit_insert_text_b(){hab_edit_insert_tag("<strong>","</strong>")}function hab_edit_insert_text_blockquote(){hab_edit_insert_tag("<blockquote>","</blockquote>")}function hab_edit_insert_text_mdash(){hab_edit_insert_tag("","&mdash;")}function hab_edit_insert_text_quote(){var a=$(habr_selectedtarget),b=hab_edit_getCursor(a);b.start!=b.end?hab_edit_insert_tag("<quote>","</quote>"):(hab_edit_insert_tag("",quote?"&laquo;":"&raquo;"),quote=!quote)}function hab_edit_insert_tag(a,b){hab_edit_text_save_undo();var c=$(habr_selectedtarget);c.focus();var d=c.scrollTop,e=hab_edit_getCursor(c);if(e.start==e.end){var f=e.start+a.length;c.value=c.value.substring(0,e.start)+a+b+c.value.substr(e.start),hab_edit_setCursor(c,f,f)}else{var g=c.value.substring(0,e.start),h=c.value.substring(e.start,e.end),i=c.value.substring(e.end);c.value=g+a+h+b+i;var f=String(g+a+h+b).length;hab_edit_setCursor(c,f,f)}d&&(c.scrollTop=d)}function hab_edit_setCursor(a,b,c){if(a.createTextRange){var d=a.createTextRange();d.move("character",b),d.select()}else a.selectionStart&&a.setSelectionRange(b,c)}function hab_edit_getCursor(a){var b={start:0,end:0};if(a.setSelectionRange)b.start=a.selectionStart,b.end=a.selectionEnd;else{if(!document.selection)return 0;if(document.selection&&document.selection.createRange){var c=document.selection.createRange(),d=c.duplicate();d.moveToElementText(a),d.setEndPoint("EndToEnd",c),b.start=d.text.length-c.text.length,b.end=b.start+c.text.length}}return b}function hab_edit_text_clear_undo(){undo=""}function hab_edit_text_save_undo(){undo=$(habr_selectedtarget).value}function hab_edit_text_undo(){undo&&($(habr_selectedtarget).value=undo)}function habr_selecttarget(a){habr_selectedtarget=a}function sapi_GenerateBestPlacesControl(){function b(){function n(c){b=0,o[c>0?"show":"hide"](),p[c<g?"show":"hide"](),a("i.active",q).removeClass("active"),a("i.bp"+c,q).addClass("active");var d=c*e,f=m<c;m=c;var h=a(".tab",q),i=a("<div class='tab' id='bestTab-"+c+"' style='left:"+(f?"":"-")+"280px'></div>");i.appendTo(r),r.stop().css({left:0}).animate({left:280*(f?-1:1)},500,function(){h.remove(),i.css("left",0),r.css("left",0)});for(var k=0;k<e;k++)(function(a,b){var c=j(a+d);c&&c.appendTo(b)})(k,i)}function l(){var b=a(".tab a",c),d=Math.floor(Math.random()*(b.length-1)),e=a(b.get(d)),f=a("<div class='bestPlaces-hint'>"+a("span",e).html()+"</div>"),g=e.offset();f.css({position:"absolute",right:document.body.clientWidth-(5+g.left),top:-5+g.top}),e.addClass("btab-light"),f.appendTo(a("body")),f.hide().show("slow"),setTimeout(function(){f.hide("slow"),setTimeout(function(){e.removeClass("btab-light"),f.remove()},600)},6e3)}function k(){var c=h.length;if(c){var d=Math.floor(c/e);g=d;var f=Math.floor(d*Math.random()),j=a(".bestPageNav",q);for(var k=0;k<d+1;++k)a("<i class='bp"+k+"'/>").appendTo(j);i=!0;if(aCurrentUser.nav_in)for(var k=0;k<c;++k)if(h[k][1]==aCurrentUser.nav_in){f=Math.floor(k/e),i=!1;break}n(f),i&&setTimeout(function(){setInterval(function(){b++,b%3==0?(n(Math.floor(d*Math.random())),setTimeout(l,1e3)):l()},15e3),l()},1e3)}}function j(b){var c=h[b];if(!c)return!1;typeof c.img!="string"&&(c.img=c.img[0]),typeof c.big!="string"&&(c.big=c.big[0]);var d=c[2],e=a("<a id='ba-"+b+"' href='"+DRR+c[3]+"'><span>"+d+"</span></a>"),f=new Image;f.onload=function(){e.css({backgroundImage:"url("+c.img+")"})},f.src=c.img;var g={rid:"best"+b};aCurrentUser.nav_in==c[1]&&e.css({border:"1px solid #F00"}),SAPI.Class("map.ext.floatHint",[e,function(a){return"<table><tr valign=middle><td width='72px'><img src='"+c.big+"' ></td><td>"+d+"<br/><i>лучшие обьекты на карте eSosedi</i></td></tr></table>"}]);return e}var a=jQuery,b=0,c=a("<div class='bestMapPlaces'>лучшие места мира</div>"),d=200,e=10,f=0,g=0,h=0,i=!0;a.ajax({url:DataCenter+"loader/bestPlaces.php",dataType:"json",success:function(a){h=a,setTimeout(function(){k()},1)}});var m=-1;c.html("<label>Интересные места мира:</label>");var o=a("<span class='btab-left'>&lt;</span>").appendTo(c).click(function(){n(m-1)}).hide(),p=a("<span class='btab-right'>&gt;</span>").appendTo(c).click(function(){n(m+1)}).hide(),q=a("<div class='nodeSlider' ><div class='tabsIn'></div><div class='bestPageNav'></div></div>");q.appendTo(c);var r=a(".tabsIn",q);return c}var a=0;a||(a=b());return a}function mapia_images_update(a){$("images_div").innerHTML="обновление...",AjaxUpdater("#images_div",DataCenter+"loader/nav_image_update.php?idkey="+a)}function dark_off(){darkPannel.close()}function plant_spores(a){if(plant_last_spores!=a)plant_last_spores=a;else return;jQuery(function(){setTimeout(function(){jQuery.ajax({url:DataCenter+"loader/spore_section.php?plants="+a,success:function(a){end_plant_spore(a),jQuery(window).scroll()}})},500)})}function end_plant_spore(a){var b=new String(a),c=b.split("--}}\n"),d,e=jQuery;while(d=c.shift()){var f=d.split("{{");try{f[0]&&f[1]&&e("."+f[0])&&e("."+f[0]).html(f[1])}catch(g){g=0}}var h=e(".backair-top");if(!!h.length&&!h.hasClass("patched")){h.addClass("patched");var i=-1,j=0,k="";h.removeClass("rela_bottom");var l=function(){var a=h,b=a.height(),c=a.css("height","auto").height(),d=a.offset()||{},f=parseInt(d.top),g=e("#container"),l=e("#right_block .h750"),m=g.height()+g.offset().top,n=l.offset().top,o=e(".rightAdvertTop").height(),p=e(window).scrollTop(),q=e(window).height(),r=[n+o,m-c],s=[Math.max(p,n),p+q],t=q-c;t<0?t=-t:t=0;var u="";s[0]>=r[1]||s[1]>=m?(u="relf_bottom",t=0):s[0]<=r[0]&&s[1]<=r[0]+c?(u="rela_top",t=o+n-e(".expand_H").offset().top):(u="rela_bottom",t*=-1),u!=k&&(t=t+"px",a.css({position:u=="rela_bottom"?"fixed":"absolute",bottom:u=="rela_top"?"auto":t,top:u=="rela_top"?t:"auto"}),k&&a.removeClass("__"+k),k=u,a.addClass("__"+k)),f==i,j!=c&&(j=c,a.animate({height:c+"px"})),i=f,j=c};e(".air_selector a",h).click(function(){var a=e(".air_body .d2>div",h);a.removeClass("selected"),e(".air_selector a",h).removeClass("_selected"),e(".air_body .d2>div:eq("+e(this).prevAll().length+")",h).addClass("selected"),e(this).addClass("_selected"),l()});var m=0;jQuery(window).scroll(function(){l()}),setTimeout(l,1)}}function tab_pselect(a){a=typeof a=="undefined"?(SAPI.blackbox.store.get("ncTABsel")||1)-1:a;var b=jQuery,c=b("#nav_tabctrl");b(".tabSelector",c).removeClass("selected"),b(".tabSelector:eq("+a+")",c).addClass("selected"),b(".tab_in",c).removeClass("selected"),b(".tab_in:eq("+a+")",c).addClass("selected"),tab_pselect_active!=a&&(tab_pselect_active===null&&b(".tabSelector",c).each(function(a,c){b(this).click(function(){tab_pselect(a)})}),SAPI.blackbox.store.set("ncTABsel",a+1),tab_pselect_active=a)}function top_onmap_click(){if(!$("map_overlayed_blocker"))return!0;gmap_maximize();return!1}function register_fast(){darkPannel.ajax(DataCenter+"register/index.html?FAST");return!1}function dark_help(){darkPannel.ajax(DataCenter+"loader/sosedi_help.php")}function enter_form_hide(){darkPannel.close();return!1}function enter_form_show(){darkPannel.login();return!1}function popimage(a,b,c){c&&(b="http://crawler.kashey.ru/piC/"+b),parse_ViewImage(a,b,"",b)}function apifault(a){window.console&&console.log(a)}function OneAddNewBlog(a,b){typeof mycaller!="undefined"&&typeof mycaller.OneAddNewBlog!="undefined"&&this!=mycaller?mycaller.OneAddNewBlog(a,b):$p("BlogPost")?($p("BlogPost").options[$p("BlogPost").options.length]=new Option(b,a),$p("BlogPost").selectedIndex=$p("BlogPost").options.length-1):alert("выбраный блог возможно не появился в списке. Если так - обновите форму добавления")}function blog_add_open(){if(dark_panel_on==0){var a=0;dark_panel_on||(a=1),dark_on(),a&&($p("darkdotinner").innerHTML="<img src=imgs/icon/load.gif><BR>Идет загрузка..."),AjaxUpdater("#darkdotinner",DataCenter+"editors/spot_blog.php")}else window.open(DataCenter+"editors/spot_blog.php?alone","Add_Blog_Open","width=450,height=370,toolbar=0,location=0")||alert("Окошко не открывается :(")}function bad_twitt(a){mapia_context_close();if(!!aCurrentUser.id){var b={bad:a};jQuery.get(DataCenter+"editors/twitter.php",b)}}function edit_twitt(a){mapia_context_close();if(!aCurrentUser.id)register_fast();else{var b=0;dark_panel_on||(b=1),dark_on(),b&&($p("darkdotinner").innerHTML="<img src=imgs/icon/load.gif><BR>Идет загрузка...");var c={edit:a};AjaxUpdater("#darkdotinner",DataCenter+"editors/twitter.php")}}function popup_newspore(a){dark_panel_on||(showW=1),dark_on(),showW&&($p("darkdotinner").innerHTML="<img src=imgs/icon/load.gif><BR>в данный момент я гружу новость :)<BR>"),AjaxUpdater("#darkdotinner","loader/newspore.php?content_id="+a)}function storm_done(){$p("storm_tag").innerHTML="Зарубленно",$p("storm_tag").className="nav_a_S",dark_off()}function about_stories(){darkPannel.ajax(DataCenter+"editors/about_stories.php")}function about_uncomplited(){darkPannel.ajax(DataCenter+"editors/uncomplited.php")}function my_favorites(a){a=a||0;var b=jQuery("#my_places_ref")[0],c=jQuery("#my_favorites")[0];if(c.style.display==""&&!a)c.hide(),$("google_box_tr_inner").show();else{var d=jQuery(b).offset();c.style.top=d.top+"px",c.style.left=parseInt(d.left)-60+"px",c.style.width=parseInt(document.body.clientWidth-d.left)+50+"px",a||(c.innerHTML="<center>Загрузка избранный мест</center>"),AjaxUpdater("#my_favorites",DataCenter+"loader/my_favorites.php",{rq:a},"post"),c.style.display="",jQuery("#google_box_tr_inner").hide()}}function get_me_in_blog(a){darkPannel.ajax(DataCenter+"editors/getinblog.php?blogid="+a)}function open_self_blog_selector(){darkPannel.ajax(DataCenter+"editors/self_blogs.php")}function news_rewritescanspore(){var a=jQuery;jQuery(".newspore").each(function(b,c){var d=a(this),e=d.attr("title");d.attr("title","Прочитать новость целиком"),d.click(function(){darkPannel.ajax(DataCenter+"loader/newspore.php?content_id="+d.attr("new-id"))}),d.css({textDecoration:"underline",cursor:"pointer"});var f=a(".newsporesrc",d);f&&(f.attr("title","Источник"),f.click(function(){window.open(f.attr("new-src"));return!1}),f.css({textDecoration:"underline"}))})}function nav_add_image(a){darkPannel.ajax(DataCenter+"editors/mapia_image_upload.php?mid="+a)}function make_pages_text_load(a,b){typeof RemoveEditRectangle!="undefined"&&RemoveEditRectangle(),AjaxUpdater("#content_target",DataCenter+"loader/mapia_text_show.php?mid="+a+"&seq="+b+"&mode=1")}function make_mapia_text_load(a,b){RemoveEditRectangle(),AjaxUpdater("#content_target",DataCenter+"loader/mapia_text_show.php?mid="+a+"&seq="+b)}function make_pages_text_editor(a,b){var c=parseInt($p("content_holder").clientHeight);c<200&&(c=200),c+=20,$p("content_holder").innerHTML="<div id=content_target style='padding-bottom:30px;min-height:"+c+"px'>...Идет загрузка редактора...</div>",AjaxUpdater("#content_target",DataCenter+"editors/pages_text_editor.php?mid="+a+"&seq="+b)}function make_mapia_text_editor(a,b){var c=parseInt($p("content_holder").clientHeight);c<200&&(c=200),c+=20,$p("content_holder").innerHTML="<div id=content_target style='padding-bottom:30px;min-height:"+c+"px'>...Идет загрузка редактора...</div>",AjaxUpdater("#content_target",DataCenter+"editors/mapia_text_editor.php?mid="+a+"&seq="+b)}function requery_objects(){SAPI.val("-map.effect.dropMarker",1),SAPI.map.zone.event.trigger("ztile.dropData"),SAPI.map.zone.callZTile(),setTimeout(function(){SAPI.val("-map.effect.dropMarker",0),SAPI.map.zone.callZTile()},100)}function pn_images_poson(a,b,c,d){ShowMapObject("p"+a,[d/1e6,c/1e6])}function loc_a_loc(a){clearTimeout(loc_a_loc_timer);if(a){if(!GetMap())return;var b=a.name.split(","),c=parseInt(b[0])/1e6,d=parseInt(b[1])/1e6,e=parseInt(b[2]);e||(e=GetMap().getZoom()),loc_a_loc_timer=setTimeout(function(){PosMap(c,d,e)},500)}}function ShowMapObject(a,b){clearTimeout(showMapObjectTm),showMapObjectTm=setTimeout(function(){_ShowMapObject(a,b)},500)}function _ShowMapObject(a,b){var c="object."+a+".spawn",d=this,e=SAPI.map.zone,f=setTimeout(function(){b&&e.setPosition(SAPI.map.LatLng(b[0],b[1]))},100),g=e.event.listen(c,function(a,b){e.setPosition(b.getCenter()),clearTimeout(f),SAPI.delay(function(){b.onBalloonCreate(),SAPI.delay(function(){b.innerOpenBallon()},200)},500)})}function GetMap(){return SAPI.map.zone&&SAPI.map.zone.isMapReady?SAPI.map.zone:null}function update_center_center(){}function PosMap(a,b,c){a&&a.sapiLatLng?SAPI.map.zone.setPosition(a,b):SAPI.map.zone.setPosition(SAPI.map.LatLng(a,b),c)}function Nav_FixActivation(a){SAPI.val("nav.autoActivationId",a),SAPI.event.trigger("nav.autoActivation")}function geo_ShowAddr(a,b,c,d){SAPI.map.zone.geocode(a,{success:function(a){a=a[0],GetMap().setPosition(a.point,b||15),setTimeout(function(){GetMap().addOverlay(new SAPI.Class("map.effect.guidePoint",[{className:"guideStar",effect:"bounce",point:a.point,name:a.addr}]))},2e3),d&&d(a)}})}function OnLoadAdd(str){var thisstr=str;typeof str=="string"&&(str=function(){eval(thisstr)}),loaderevents.push(str)}function toggleClass(a,b,c){var d=$(a);!d||jQuery(d)[c?"addClass":"removeClass"](b)}function microtime(){var a=1,b=(new Date).getTime()/1e3,c=parseInt(b);return a?b:Math.round((b-c)*1e3)/1e3+" "+c}function timeGetTime(){var a=new Date;return a.getTime()}function window_innerHeight(){if(typeof window.innerWidth=="number")return window.innerHeight;if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))return document.documentElement.clientHeight;return 1}function fixPNG(a){var b=/MSIE (5\.5|6).+Win/.test(navigator.userAgent);if(!a.ieFixPngPassed){if(b){var c;a.tagName=="IMG"?/\.png$/.test(a.src)&&(a.width&&a.width!=28?(a.width=a.width,a.height=a.height):a.onload=function(){fixPNG(this)},c=a.src,a.src="/blank.gif"):(c=a.currentStyle.backgroundImage.match(/url\("(.+)"\)/i),c&&(c=c[1],a.runtimeStyle.backgroundImage="none")),c&&(a.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c+"',sizingMethod='scale')")}a.ieFixPngPassed=1}}function AjaxUpdater(a,b,c,d,e){jQuery.ajax({url:b,type:(d||"get").toUpperCase(),data:c||{},success:function(b){jQuery(a).html(b),e&&e()}})}function $(a){return document.getElementById(a)}(function(a,b){function cg(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cd(a){if(!bZ[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";bZ[a]=c}return bZ[a]}function cc(a,b){var c={};d.each(cb.concat.apply([],cb.slice(0,b)),function(){c[this]=a});return c}function bY(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bX(){try{return new a.XMLHttpRequest}catch(b){}}function bW(){d(a).unload(function(){for(var a in bU)bU[a](0,1)})}function bQ(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(f[h.toLowerCase()]=a.converters[h]);l=k,k=e[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=f[m]||f["* "+k];if(!n){p=b;for(o in f){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=f[j[1]+" "+k];if(p){o=f[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&d.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bP(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bO(a,b,c,e){if(d.isArray(b)&&b.length)d.each(b,function(b,f){c||bq.test(a)?e(a,f):bO(a+"["+(typeof f=="object"||d.isArray(f)?b:"")+"]",f,c,e)});else if(!c&&b!=null&&typeof b=="object")if(d.isArray(b)||d.isEmptyObject(b))e(a,"");else for(var f in b)bO(a+"["+f+"]",b[f],c,e);else e(a,b)}function bN(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bH,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bN(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bN(a,c,d,e,"*",g));return l}function bM(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bB),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bo(a,b,c){var e=b==="width"?bi:bj,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function ba(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function _(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function $(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function Z(a,b){if(b.nodeType===1&&!!d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function Y(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function O(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(J.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function N(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function F(a,b){return(a&&a!=="*"?a+".":"")+b.replace(r,"`").replace(s,"&")}function E(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,q=[],r=[],s=d._data(this,"events");if(!(a.liveFired===this||!s||!s.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(p,"")===a.type?r.push(g.selector):t.splice(i--,1);f=d(a.target).closest(r,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&q.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=q.length;j<k;j++){f=q[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function C(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function w(){return!0}function v(){return!1}function g(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function f(a,c,f){if(f===b&&a.nodeType===1){f=a.getAttribute("data-"+c);if(typeof f=="string"){try{f=f==="true"?!0:f==="false"?!1:f==="null"?null:d.isNaN(f)?e.test(f)?d.parseJSON(f):f:parseFloat(f)}catch(g){}d.data(a,c,f)}else f=b}return f}var c=a.document,d=function(){function I(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(I,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x=!1,y,z="then done fail isResolved isRejected promise".split(" "),A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,H={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a=="string"){g=h.exec(a);if(g&&(g[1]||!e)){if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a)}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.1",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?D.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;y.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=!0;if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&I()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):H[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||C.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]);return a},trim:F?function(a){return a==null?"":F.call(a)}:function(a){return a==null?"":a.toString().replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?D.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c=="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){c=1;try{while(a[0])a.shift().apply(d,f)}catch(g){throw g}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(d.isFunction(this.promise)?this.promise():this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),e;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(e)return e;e=a={}}var c=z.length;while(c--)a[z[c]]=b[z[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){var b=arguments.length,c=b<=1&&a&&d.isFunction(a.promise)?a:d.Deferred(),e=c.promise();if(b>1){var f=E.call(arguments,0),g=b,h=function(a){return function(b){f[a]=arguments.length>1?E.call(arguments,0):b,--g||c.resolveWith(e,f)}};while(b--)a=f[b],a&&d.isFunction(a.promise)?a.promise().then(h(b),c.reject):--g;g||c.resolveWith(e,f)}else c!==a&&c.resolve(a);return e},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),y=d._Deferred(),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){H["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),G&&(d.inArray=function(a,b){return G.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?A=function(){c.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:c.attachEvent&&(A=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",A),d.ready())});return d}();(function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(!(!e||!e.length||!f)){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e),b=e=f=null}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(!!b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]=="function"),b=null;return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}})();var e=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!g(a)},data:function(a,c,e,f){if(!!d.acceptData(a)){var g=d.expando,h=typeof c=="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c=="object"||typeof c=="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(!!d.acceptData(b)){var f=d.expando,h=b.nodeType,i=h?d.cache:b,j=h?b[d.expando]:d.expando;if(!i[j])return;if(c){var k=e?i[j][f]:i[j];if(k){delete k[c];if(!g(k))return}}if(e){delete i[j][f];if(!g(i[j]))return}var l=i[j][f];d.support.deleteExpando||i!=a?delete i[j]:i[j]=null,l?(i[j]={},h||(i[j].toJSON=d.noop),i[j][f]=l):h&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a=="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var g=this[0].attributes,h;for(var i=0,j=g.length;i<j;i++)h=g[i].name,h.indexOf("data-")===0&&(h=h.substr(5),f(this[0],h,e[h]))}}return e}if(typeof a=="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=f(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(!!a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var h=/[\n\t\r]/g,i=/\s+/,j=/\r/g,k=/^(?:href|src|style)$/,l=/^(?:button|input)$/i,m=/^(?:button|input|object|select|textarea)$/i,n=/^a(?:rea)?$/i,o=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"){var b=(a||"").split(i);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(!f.className)f.className=a;else{var g=" "+f.className+" ",h=f.className;for(var j=0,k=b.length;j<k;j++)g.indexOf(" "+b[j]+" ")<0&&(h+=" "+b[j]);f.className=d.trim(h)}}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"||a===b){var c=(a||"").split(i);for(var e=0,f=this.length;e<f;e++){var g=this[e];if(g.nodeType===1&&g.className)if(a){var j=(" "+g.className+" ").replace(h," ");for(var k=0,l=c.length;k<l;k++)j=j.replace(" "+c[k]+" "," ");g.className=d.trim(j)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b=="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,h=d(this),j=b,k=a.split(i);while(f=k[g++])j=e?j:!h.hasClass(f),h[j?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(h," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var k=i?f:0,l=i?f+1:h.length;k<l;k++){var m=h[k];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(i)return a;g.push(a)}}if(i&&!g.length&&h.length)return d(h[f]).val();return g}if(o.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(j,"")}return b}var n=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){n&&(e=a.call(this,b,c.val())),e==null?e="":typeof e=="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&o.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=k.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&l.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var o=a.getAttributeNode("tabIndex");return o&&o.specified?o.value:m.test(a.nodeName)||n.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&a.hasAttribute&&!a.hasAttribute(c))return b;var p=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return p===null?b:p}h&&(a[c]=e);return a[c]}});var p=/\.(.*)$/,q=/^(?:textarea|input|select)$/i,r=/\./g,s=/ /g,t=/[^\w\s.|`]/g,u=function(a){return a.replace(t,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&c!==a&&!c.frameElement&&(c=a)}catch(h){}if(f===!1)f=v;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(){return typeof d!="undefined"&&!d.event.triggered?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=v);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),u).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete t[h]}if(d.isEmptyObject(t)){var w=s.handle;w&&(w.elem=null),delete s.events,delete s.handle,d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a=="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(p,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=!0,l[m]())}catch(q){}k&&(l["on"+m]=k),d.event.triggered=!1}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,F(a.origType,a.selector),d.extend({},a,{handler:E,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,F(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?w:v):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=w;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=w;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=w,this.stopPropagation()},isDefaultPrevented:v,isPropagationStopped:v,isImmediatePropagationStopped:v};var x=function(a){var b=a.relatedTarget;try{if(b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(e){}},y=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?y:x,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?y:x)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&d(b).closest("form").length&&C("submit",this,arguments)}),d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&d(b).closest("form").length&&a.keyCode===13&&C("submit",this,arguments)});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var z,A=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},B=function B(a){var c=a.target,e,f;if(!!q.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=A(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:B,beforedeactivate:B,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&B.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&B.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",A(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in z)d.event.add(this,c+".specialChange",z[c]);return q.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return q.test(this.nodeName)}},z=d.event.special.change.filters,z.focus=z.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){a=d.event.fix(a),a.type=b;return d.event.handle.call(this,a)}d.event.special[b]={setup:function(){this.addEventListener(a,c,!0)},teardown:function(){this.removeEventListener(a,c,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a=="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var D={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,e,a[o],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=p.exec(h),k="",j&&(k=j[0],h=h.replace(p,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(D[h]+k),h=h+k):h=(D[h]||h)+k;if(c==="live")for(var q=0,r=n.length;q<r;q++)d.event.add(n[q],"live."+F(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+F(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(!u)e.push.apply(e,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.getAttribute("type")},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,d=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(e){d=!0}b&&(k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(d||!l.match.PSEUDO.test(c)&&!/!=/.test(c))return b.call(a,c)}catch(e){}return k(c,null,null,[a]).length>0})}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};d.find=k,d.expr=k.selectors,d.expr[":"]=d.expr.filters,d.unique=k.uniqueSort,d.text=k.getText,d.isXMLDoc=k.isXML,d.contains=k.contains}();var G=/Until$/,H=/^(?:parents|prevUntil|prevAll)/,I=/,/,J=/^.[^:#\[\.,]*$/,K=Array.prototype.slice,L=d.expr.match.POS,M={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(O(this,a,!1),"not",a)},filter:function(a){return this.pushStack(O(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=L.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(N(c[0])||N(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=K.call(arguments);G.test(a)||(e=c),e&&typeof e=="string"&&(f=d.filter(e,f)),f=this.length>1&&!M[a]?d.unique(f):f,(this.length>1||I.test(e))&&H.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var P=/ jQuery\d+="(?:\d+|null)"/g,Q=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,S=/<([\w:]+)/,T=/<tbody/i,U=/<|&#?\w+;/,V=/<(?:script|object|embed|option|style)/i,W=/checked\s*(?:[^=]|=\s*.checked.)/i,X={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};X.optgroup=X.option,X.tbody=X.tfoot=X.colgroup=X.caption=X.thead,X.th=X.td,d.support.htmlSerialize||(X._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(P,""):null;if(typeof a=="string"&&!V.test(a)&&(d.support.leadingWhitespace||!Q.test(a))&&!X[(S.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(R,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}else d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j=="string"&&W.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?Y(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,ba)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!V.test(a[0])&&(d.support.checkClone||!W.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&h!==1&&(f=h)),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){$(a,e),f=_(a),g=_(e);for(h=0;f[h];++h)$(f[h],g[h])}if(b){Z(a,e);if(c){f=_(a),g=_(e);for(h=0;f[h];++h)Z(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i=="number"&&(i+="");if(!i)continue;if(typeof i=="string"&&!U.test(i))i=b.createTextNode(i);else if(typeof i=="string"){i=i.replace(R,"<$1></$2>");var j=(S.exec(i)||["",""])[1].toLowerCase(),k=X[j]||X._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=T.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&Q.test(i)&&m.insertBefore(b.createTextNode(Q.exec(i)[0]),m.firstChild),i=m.childNodes}i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)f&&d.nodeName(g[h],"script")&&(!g[h].type||g[h].type.toLowerCase()==="text/javascript")?f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]):(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h]));return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bb=/alpha\([^)]*\)/i,bc=/opacity=([^)]*)/,bd=/-([a-z])/ig,be=/([A-Z])/g,bf=/^-?\d+(?:px)?$/i,bg=/^-?\d/,bh={position:"absolute",visibility:"hidden",display:"block"},bi=["Left","Right"],bj=["Top","Bottom"],bk,bl,bm,bn=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bk(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e=="number"&&isNaN(e)||e==null)return;typeof e=="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bk)return bk(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bd,bn)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bo(a,b,e):d.swap(a,bh,function(){f=bo(a,b,e)});if(f<=0){f=bk(a,b,b),f==="0px"&&bm&&(f=bm(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f=="string"?f:f+"px"}},set:function(a,b){if(!bf.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return bc.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bb.test(f)?f.replace(bb,e):c.filter+" "+e}}),c.defaultView&&c.defaultView.getComputedStyle&&(bl=function(a,c,e){var f,g,h;e=e.replace(be,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bm=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bf.test(d)&&bg.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bk=bl||bm,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var bp=/%20/g,bq=/\[\]$/,br=/\r?\n/g,bs=/#.*$/,bt=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bu=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bv=/(?:^file|^widget|\-extension):$/,bw=/^(?:GET|HEAD)$/,bx=/^\/\//,by=/\?/,bz=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bA=/^(?:select|textarea)/i,bB=/\s+/,bC=/([?&])_=[^&]*/,bD=/(^|\-)([a-z])/g,bE=function(a,b,c){return b+c.toUpperCase()},bF=/^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,bG=d.fn.load,bH={},bI={},bJ,bK;try{bJ=c.location.href}catch(bL){bJ=c.createElement("a"),bJ.href="",bJ=bJ.href}bK=bF.exec(bJ.toLowerCase()),d.fn.extend({load:function(a,c,e){if(typeof a!="string"&&bG)return bG.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c=="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("<div>").append(c.replace(bz,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bA.test(this.nodeName)||bu.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(br,"\r\n")}}):{name:b.name,value:c.replace(br,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bJ,isLocal:bv.test(bK[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bM(bH),ajaxTransport:bM(bI),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bP(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bQ(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bD,bE)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bt.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bs,"").replace(bx,bK[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bB),e.crossDomain||(q=bF.exec(e.url.toLowerCase()),e.crossDomain=!(!q||q[1]==bK[1]&&q[2]==bK[2]&&(q[3]||(q[1]==="http:"?80:443))==(bK[3]||(bK[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!="string"&&(e.data=d.param(e.data,e.traditional)),bN(bH,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!bw.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(by.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bC,"$1_="+w);e.url=x+(x===e.url?(by.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in{success:1,error:1,complete:1})u[t](e[t]);o=bN(bI,e,c,u);if(!o)v(-1,"No Transport");else{u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bO(g,a[g],c,f);return e.join("&").replace(bp,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bR=d.now(),bS=/(\=)\?(&|$)|()\?\?()/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bR++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bS.test(b.url)||f&&bS.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bS,l),b.url===j&&(f&&(k=k.replace(bS,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bT=d.now(),bU,bV;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bX()||bY()}:bX,bV=d.ajaxSettings.xhr(),d.support.ajax=!!bV,d.support.cors=bV&&"withCredentials"in bV,bV=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),(!a.crossDomain||!!a.hasContent)&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bU[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}!j&&a.isLocal&&!a.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},!a.async||g.readyState===4?c():(bU||(bU={},bW()),h=bT++,g.onreadystatechange=bU[h]=c)},abort:function(){c&&c(0,1)}}}});var bZ={},b$=/^(?:toggle|show|hide)$/,b_=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ca,cb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(cc("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",cd(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cc("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a=="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(cc("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(!d.support.inlineBlockNeedsLayout)this.style.display="inline-block";else{var j=cd(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(b$.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=b_.exec(e),j=f.cur();if(i){var k=parseFloat(i[2]),l=i[3]||(d.cssNumber[c]?"":"px");l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:cc("show",1),slideUp:cc("hide",1),slideToggle:cc("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a=="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration=="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!ca&&(ca=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(ca),ca=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var ce=/^t(?:able|d|h)$/i,cf=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=cg(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!ce.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),a=b=e=f=g=h=null,d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=e==="absolute"&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=cf.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cf.test(a.nodeName)&&d.css(a,"position")==="static")a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=cg(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=cg(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=d})(window),function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){c=b.parentNode,e=c.name;if(!b.href||!e||c.nodeName.toLowerCase()!=="map")return!1;b=a("img[usemap=#"+e+"]")[0];return!!b&&d(b)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{},a.ui.version||(a.extend(a.ui,{version:"1.8.16",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;b=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){c=a(this[0]);for(var d;c.length&&c[0]!==document;){d=c.css("position");if(d==="absolute"||d==="relative"||d==="fixed"){d=parseInt(c.css("zIndex"),10);if(!isNaN(d)&&d!==0)return d}c=c.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function e(b,c,d,e){a.each(f,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),e&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var f=d==="Width"?["Left","Right"]:["Top","Bottom"],g=d.toLowerCase(),h={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return h["inner"+d].call(this);return this.each(function(){a(this).css(g,e(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return h["outer"+d].call(this,b);return this.each(function(){a(this).css(g,e(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){b=a.ui[b].prototype;for(var e in d)b.plugins[e]=b.plugins[e]||[],b.plugins[e].push([c,d[e]])},call:function(a,b,c){if((b=a.plugins[b])&&a.element[0].parentNode)for(var d=0;d<b.length;d++)a.options[b[d][0]]&&b[d][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;c=c&&c==="left"?"scrollLeft":"scrollTop";var d=!1;if(b[c]>0)return!0;b[c]=1,d=b[c]>0,b[c]=0;return d},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))}(jQuery),function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)},c=new c,c.options=a.extend(!0,{},c.options),a[e][b].prototype=a.extend(!0,c,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e;if(f&&e.charAt(0)==="_")return h;f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b){h=f;return!1}}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))});return h}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}this._setOptions(e);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",b);return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e=this.options[b];c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),d=d||{};if(c.originalEvent){b=a.event.props.length;for(var f;b;)f=a.event.props[--b],c[f]=c.originalEvent[f]}this.element.trigger(c,d);return!(a.isFunction(e)&&e.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}}(jQuery),function(a){var b=!1;a(document).mouseup(function(){b=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation();return!1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(c){if(!b){this._mouseStarted&&this._mouseUp(c),this._mouseDownEvent=c;var e=this,f=c.which==1,g=typeof this.options.cancel=="string"&&c.target.nodeName?a(c.target).closest(this.options.cancel).length:!1;if(!f||g||!this._mouseCapture(c))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=this._mouseStart(c)!==!1;if(!this._mouseStarted){c.preventDefault();return!0}}!0===a.data(c.target,this.widgetName+".preventClickEvent")&&a.removeData(c.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return e._mouseMove(a)},this._mouseUpDelegate=function(a){return e._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),c.preventDefault();return b=!0}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&((this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1)?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(this._trigger("drag",b,c)===!1){this._mouseUp({});return!1}this.position=c.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var e=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){e._trigger("stop",b)!==!1&&e._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options;b=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element,b.parents("body").length||b.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),b[0]!=this.element[0]&&!/(fixed|absolute)/.test(b.css("position"))&&b.css("position","absolute");return b},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){b=a(b.containment);var c=b[0];if(c){b.offset();var e=a(c).css("overflow")!="hidden";this.containment=[(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0),(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0),(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=b}}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position),b=b=="absolute"?1:-1;var e=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(e[0].tagName);return{top:c.top+this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:e.scrollTop())*b),left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:e.scrollLeft())*b)}},_generatePosition:function(b){var c=this.options,e=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(e[0].tagName),g=b.pageX,h=b.pageY;if(this.originalPosition){var i;this.containment&&(this.relative_container?(i=this.relative_container.offset(),i=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):i=this.containment,b.pageX-this.offset.click.left<i[0]&&(g=i[0]+this.offset.click.left),b.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),b.pageX-this.offset.click.left>i[2]&&(g=i[2]+this.offset.click.left),b.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),c.grid&&(h=c.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY,h=i?h-this.offset.click.top<i[1]||h-this.offset.click.top>i[3]?h-this.offset.click.top<i[1]?h+c.grid[1]:h-c.grid[1]:h:h,g=c.grid[0]?this.originalPageX+Math.round((g-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX,g=i?g-this.offset.click.left<i[0]||g-this.offset.click.left>i[2]?g-this.offset.click.left<i[0]?g+c.grid[0]:g-c.grid[0]:g:g)}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:e.scrollTop()),left:g-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:e.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,e){e=e||this._uiHash(),a.ui.plugin.call(this,b,[c,e]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute"));return a.Widget.prototype._trigger.call(this,b,c,e)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.16"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var e=a(this).data("draggable"),f=e.options,g=a.extend({},c,{item:e.element});e.sortables=[],a(f.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(e.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,g))})},stop:function(b,c){var e=a(this).data("draggable"),f=a.extend({},c,{item:e.element});a.each(e.sortables,function(){this.instance.isOver?(this.instance.isOver=0,e.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,e.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,f))})},drag:function(b,c){var e=a(this).data("draggable"),f=this;a.each(e.sortables,function(){this.instance.positionAbs=e.positionAbs,this.instance.helperProportions=e.helperProportions,this.instance.offset.click=e.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=e.offset.click.top,this.instance.offset.click.left=e.offset.click.left,this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top,e._trigger("toSortable",b),e.dropped=this.instance.element,e.currentItem=e.element,this.instance.fromOutside=e),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),e._trigger("fromSortable",b),e.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(){var b=a("body"),c=a(this).data("draggable").options;b.css("cursor")&&(c._cursor=b.css("cursor")),b.css("cursor",c.cursor)},stop:function(){var b=a(this).data("draggable").options;b._cursor&&a("body").css("cursor",b._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){b=a(c.helper),c=a(this).data("draggable").options,b.css("opacity")&&(c._opacity=b.css("opacity")),b.css("opacity",c.opacity)},stop:function(b,c){b=a(this).data("draggable").options,b._opacity&&a(c.helper).css("opacity",b._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(){var b=a(this).data("draggable");b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"&&(b.overflowOffset=b.scrollParent.offset())},drag:function(b){var c=a(this).data("draggable"),e=c.options,f=!1;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")c.overflowOffset.top+c.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?c.scrollParent[0].scrollTop=f=c.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-c.overflowOffset.top<e.scrollSensitivity&&(c.scrollParent[0].scrollTop=f=c.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")c.overflowOffset.left+c.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?c.scrollParent[0].scrollLeft=f=c.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-c.overflowOffset.left<e.scrollSensitivity&&(c.scrollParent[0].scrollLeft=f=c.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(c,b)}}),a.ui.plugin.add("draggable","snap",{start:function(){var b=a(this).data("draggable"),c=b.options;b.snapElements=[],a(c.snap.constructor!=String?c.snap.items||":data(draggable)":c.snap).each(function(){var c=a(this),e=c.offset();this!=b.element[0]&&b.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:e.top,left:e.left})})},drag:function(b,c){for(var e=a(this).data("draggable"),f=e.options,g=f.snapTolerance,h=c.offset.left,i=h+e.helperProportions.width,j=c.offset.top,k=j+e.helperProportions.height,l=e.snapElements.length-1;l>=0;l--){var m=e.snapElements[l].left,n=m+e.snapElements[l].width,o=e.snapElements[l].top,p=o+e.snapElements[l].height;if(m-g<h&&h<n+g&&o-g<j&&j<p+g||m-g<h&&h<n+g&&o-g<k&&k<p+g||m-g<i&&i<n+g&&o-g<j&&j<p+g||m-g<i&&i<n+g&&o-g<k&&k<p+g){if(f.snapMode!="inner"){var q=Math.abs(o-k)<=g,r=Math.abs(p-j)<=g,s=Math.abs(m-i)<=g,t=Math.abs(n-h)<=g;q&&(c.position.top=e._convertPositionTo("relative",{top:o-e.helperProportions.height,left:0}).top-e.margins.top),r&&(c.position.top=e._convertPositionTo("relative",{top:p,left:0}).top-e.margins.top),s&&(c.position.left=e._convertPositionTo("relative",{top:0,left:m-e.helperProportions.width}).left-e.margins.left),t&&(c.position.left=e._convertPositionTo("relative",{top:0,left:n}).left-e.margins.left)}var u=q||r||s||t;f.snapMode!="outer"&&(q=Math.abs(o-j)<=g,r=Math.abs(p-k)<=g,s=Math.abs(m-h)<=g,t=Math.abs(n-i)<=g,q&&(c.position.top=e._convertPositionTo("relative",{top:o,left:0}).top-e.margins.top),r&&(c.position.top=e._convertPositionTo("relative",{top:p-e.helperProportions.height,left:0}).top-e.margins.top),s&&(c.position.left=e._convertPositionTo("relative",{top:0,left:m}).left-e.margins.left),t&&(c.position.left=e._convertPositionTo("relative",{top:0,left:n-e.helperProportions.width}).left-e.margins.left)),!e.snapElements[l].snapping&&(q||r||s||t||u)&&e.options.snap.snap&&e.options.snap.snap.call(e.element,b,a.extend(e._uiHash(),{snapItem:e.snapElements[l].item})),e.snapElements[l].snapping=q||r||s||t||u}else e.snapElements[l].snapping&&e.options.snap.release&&e.options.snap.release.call(e.element,b,a.extend(e._uiHash(),{snapItem:e.snapElements[l].item})),e.snapElements[l].snapping=!1}}}),a.ui.plugin.add("draggable","stack",{start:function(){var b=a(this).data("draggable").options;b=a.makeArray(a(b.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(b.length){var c=parseInt(b[0].style.zIndex)||0;a(b).each(function(a){this.style.zIndex=c+a}),this[0].style.zIndex=c+b.length}}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){b=a(c.helper),c=a(this).data("draggable").options,b.css("zIndex")&&(c._zIndex=b.css("zIndex")),b.css("zIndex",c.zIndex)},stop:function(b,c){b=a(this).data("draggable").options,b._zIndex&&a(c.helper).css("zIndex",b._zIndex)}})}(jQuery),jQuery.noConflict(),function(){SAPI=window.SAPI||{},SAPI.tearUp=function(){(function(a){function g(){a.rootNode()||a.val("_rootNode",document.body),SAPI.event.persistent("dom.ready"),SAPI.event.persistent("doviceReady")}var b="document.body",c=0,d,e=jQuery,f=[];a.$=e,a.map={},a.css={},a.math={},a.event={},a.css={},a.math={},a._undefined=d,a.nop=function(a){},a.$(g),document.addEventListener&&document.addEventListener("deviceready",g,!1),a.rootNode=function(a){return SAPI.val("_rootNode")||document.body};var h=Math.random()*1e3+10;a.someid=function(a){return a+"-smid-"+h++},a.observeHotlink=function(b){e.each(b,function(b,c){var d=b.split(":"),e="";d[1]&&(e=d[0],d[0]=d[1]);var f=a.event,g=d[0].split("|");e=="map"?a.event.listen("map.worker.zoneready",function(){f=a.map.event,f.listen("map.worker.start",function(){var a=g[0].split(">");a[1]==="defered"?SAPI.delay(function(){f.trigger(a[0],c)},1):f.trigger(a[0],c)})}):f.trigger(g[0],c)})},a.escape=function(a){return a},a.ensure=function(a){for(var b=0,c=a.length;b<c;++b)try{document.createElement(a[b])}catch(d){}},a.supplant=function(a,b){return a.replace(/{([^{}]*)}/g,function(a,c){var d=b[c];return typeof d=="string"||typeof d=="number"?d:a})}})(SAPI),function(api){function readyZeroTimeout(){setZeroTimeout_postMessage=function(){var a=0,b=0;SAPI.event.dom.addEvent("message",function(c){var d=SAPI.jsonp.from(c.data);d&&d.ztpm&&d.as==SAPI.serviceCount&&setZeroTimeout_vector[d.fn]?(setZeroTimeout_vector[d.fn](),delete setZeroTimeout_vector[d.fn],b--,intcnt||(b=0,a=0,setZeroTimeout_vector=[])):SAPI.console.error("zeroPostmessage break",d)},!1);return function(c,d){a++,b++,setZeroTimeout_vector[a]=function(){c.call(d)},window.postMessage(SAPI.jsonp.to({ztpm:1,fn:a,as:SAPI.serviceCount}),"*");return{zero:1,ztid:a}}}()}function Klass(a){a instanceof Function&&(a={initialize:a});var b=[],c=function(){if(arguments.length==1&&arguments[0]==__DO_NOT_START__)return this;if(c._prototyping)return this;var a=this;this.__resetValues||console.trace("window object!"),this.__resetValues(),this.privat={},this.__generation__=KlassGenerationCounter++;var b=this.initialize?this.initialize.apply(this,arguments):this;api.each(this.__touchChain(),function(b,c){c.apply(a)});return this};a.superclass={extend:{}},a.__yapThisIsSAPIClass__=42;if(a.Extends){if(typeof a.Extends=="object"){a.extendedFrom=a.Extends;var d=a.Extends;a.Extends=[];for(var e in d){var f=api.use(d[e]);if(f)a.Extends.push(f);else throw new Error("SAPI.Klass:"+d[e]+" is undefined SAPI class")}}typeof a.Extends=="string"&&(a.extendedFrom=[a.Extends],a.Extends=[api.use(a.Extends)]);for(var g in a.Extends){var h=a.Extends[g];if(!h){window.console&&window.console.trace();throw"SAPI.Klass:"+a.extendedFrom[g]+" is undefined"}var i=api.duplicate(h.prototype);a.superclass.extend[h.__classname__]=i,i.__resetValues(),a.superclass=api.interference(a.superclass,i)}}a.$_eachWalker=collectAllInthin,a.$_eachWalker(b,"$autorun",a,function(a){return a.superclass});var j={};api.each(a.superclass,function(b,d){b in a||(this instanceof Function?c.prototype[b]=d:(j[b]=d,c[b]=d))}),c.prototype.superclass=a.superclass,delete a.superclass,a.share={},a.__classname__&&(a.inshare||(a.inshare=[]),a.inshare[a.__classname__]=a.share),a.__klass__={extendedFrom:a.extendedFrom,parentClass:a.Extends},delete a.extendedFrom,delete a.Extends,api.each(a,function(a,b){this instanceof Function?c.prototype[a]=b:(j[a]=b,c[a]=b)});var k=function(){var a=this;c.superclass&&c.superclass.__resetValues&&c.superclass.__resetValues.apply(this),api.each(j,function(b,c){a[b]=c})};c.prototype.__resetValues=function(){k.apply(this)},c.prototype.__touchChain=function(){return b},c.__default__={},k.apply(c.__default__),c.constructor=Klass,c.prototype.constructor=c;return c}function extend(a,b){var c=function(){};extend_initObject[b]||(new b,extend_initObject[b]=1),c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a,a.superclass=b.prototype}(function(a){a.string=function(a){return{test:function(b,c){return(typeOf(b)=="regexp"?b:new RegExp(""+b,c)).test(a)},contains:function(b,c){return c?(c+a+c).indexOf(c+b+c)>-1:a.indexOf(b)>-1},trim:function(){return a.replace(/^\s+|\s+$/g,"")},clean:function(){return a.replace(/\s+/g," ").trim()},camelCase:function(){return a.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase()})},hyphenate:function(){return a.replace(/[A-Z]/g,function(a){return"-"+a.charAt(0).toLowerCase()})},capitalize:function(){return a.replace(/\b[a-z]/g,function(a){return a.toUpperCase()})},escapeRegExp:function(){return a.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(b){return parseInt(a,b||10)},toFloat:function(){return parseFloat(a)},hexToRgb:function(b){var c=a.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return c?c.slice(1).hexToRgb(b):null},rgbToHex:function(b){var c=a.match(/\d{1,3}/g);return c?c.rgbToHex(b):null},substitute:function(b,c){return a.replace(c||/\\?\{([^{}]+)\}/g,function(a,c){if(a.charAt(0)=="\\")return a.slice(1);return b[c]!=null?b[c]:""})},replace:function(b,c){return a.split(b).join(c)},countValue:function(a,b){if(a>10&&a<20)return b[2];switch((""+a%10).charAt(0)){case"1":return b[0];case"2":return b[1];case"3":return b[1];case"4":return b[1];default:return b[2]}}}}})(SAPI);var __DO_NOT_START__="345ertg034958dfgl3k5uo3i042u58dfg345320458u324509ug0394u5134095u345";window._sapi_||(window._sapi_={}),window._sapi_.Namespaces||(window._sapi_.Namespaces=[]);var namespace={},namespaceind=window._sapi_.Namespaces.length;window._sapi_.Namespaces[namespaceind]=namespace,api.serviceCount=namespaceind;var windowspacename="window._sapi_.Namespaces["+namespaceind+"]",windowSAPI=window._sapi_,extend_initObject=[],_classCache={};api.extend=extend;var nativeForEach=Array.prototype.forEach,nativeMap=Array.prototype.map,nativeReduce=Array.prototype.reduce,nativeReduceRight=Array.prototype.reduceRight,nativeFilter=Array.prototype.filter,nativeEvery=Array.prototype.every,nativeSome=Array.prototype.some,nativeIndexOf=Array.prototype.indexOf,nativeLastIndexOf=Array.prototype.lastIndexOf,nativeIsArray=Array.prototype.isArray,nativeKeys=Object.prototype.keys,slice=Array.prototype.slice,unshift=Array.prototype.unshift,toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,propertyIsEnumerable=Object.prototype.propertyIsEnumerable,breaker=typeof StopIteration!="undefined"?StopIteration:"__break__";api.breakLoop=function(){throw breaker},api.isNumber=function(a){return a===+a||toString.call(a)==="[object Number]"},api.each=function(a,b,c){try{if(nativeForEach&&a.forEach===nativeForEach&&a.length)a.forEach(function(d,e){b.call(c||d,e,d,a)});else if(a.length&&api.isNumber(a.length))for(var d=0,e=a.length;d<e;d++)a[d]&&b.call(c||a[d],d,a[d],a);else for(var f in a)hasOwnProperty.call(a,f)&&b.call(c||a[f],f,a[f],a)}catch(g){if(g!=breaker)throw g}return a},api.filter=function(a,b,c){if(nativeFilter&&a.filter===nativeFilter)return a.filter(b,c);var d=[];each(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)});return d},api.filterReject=function(a,b,c){var d=[];each(a,function(a,e,f){b.call(c,a,e,f)||(d[d.length]=a)});return d},api.testAll=function(a,b,c){b=b||{};if(nativeEvery&&a.every===nativeEvery)return a.every(b,c);var d=!0;each(a,function(a,e,f){(d=d&&b.call(c,a,e,f))||api.breakLoop()});return d},api.testAny=function(a,b,c){b=b||{};if(nativeSome&&a.some===nativeSome)return a.some(b,c);var d=!1;api.each(a,function(a,e,f){(d=b.call(c,a,e,f))&&api.breakLoop()});return d},api.extractVariables=function(a){a=api.merge({},a),api.each(a,function(b,c){var d=typeof c;c instanceof Function?delete a[b]:d=="object"&&("__yapThisIsSAPIClass__"in c&&c.__yapThisIsSAPIClass__==42?delete a[b]:c.tagName&&"innerHTML"in c?delete a[b]:(c.__extractVariables__=(c.__extractVariables__||0)+1,c.__extractVariables__==1&&(a[b]=api.extractVariables(c)),c.__extractVariables__--,c.__extractVariables__||delete c.__extractVariables__))});return a},api.duplicate=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},api.merge=function(a,b,c,d,e,f,g){var h=a,i=0,j=arguments;api.each(j,function(a,b){if(a>0){var c=b;for(var d in c)h[d]=c[d]}});return h},api.count=function(a){var b=0;api.each(a,function(){b++});return b},api.join=function(a,b,c,d){var e=arguments,f=[],g=function(a,b){var c=[],d=e[b],f=e[b+1];api.each(a,function(a,d){d&&a?typeof d=="array"||typeof d=="object"?c.push(g(d),b+1):c.push(a+f+d):d?c.push(d):c.push(a)});return c.join(d)};return g(a,1)},api.interference=function(a,b){"$interference"in a||(a.$interference={}),a.$irunnext=function(a,b,c){var d=0;for(var e in a)d&&a[e].apply(this,c),a[e]==b&&(d=1)},api.each(b,function(c,d){if(c in a)if(d instanceof Function){var e=a[c],f="after";b.$interference&&b.$interference[c]&&(f=b.$interference[c]);var g=[];f=="before"?(g.push(d),g.push(e)):f=="replace"?g.push(d):f=="ignore"?g.push(e):(g.push(e),g.push(d)),a[c]=function(){var a=this.$interference;this.$interference={},this.$interference.stop=0,this.$interference.stack=g;var b;for(var c=0,d=g.length;d;--d,++c){this.$interference.self=g[c],this.$interference.lastResult=b,b=g[c].apply(this,arguments)||b;if(this.$interference.stop)break}this.$interference=a;return b}}else a[c]=d;else a[c]=d});return a};var collectAllInthin=function(a,b,c,d){b in c&&a.push(c[b]);var e=d(c);e&&"$_eachWalker"in e&&e.$_eachWalker(a,b,e,d)},KlassGenerationCounter=Math.ceil(Math.random()*1e4);api.globalUseName=function(a){return windowspacename+"."+a+".__entity"},api.use=function(a){var b,c=this.provide(a,!1);if(c)return c.__entity;return b},api.create=function(a){},api.listNext=function(a,b,c){arguments.length<3&&(c=!0);var d=0,e=0,f=0,g=api.list(a);api.each(g,function(c,g){var h=api.use(a+"."+g);h.__listable__&&(this!=b?(d||(d=g),f&&(e||(e=g))):f=1)});return b&&!c?e:e||d},api.list=function(a){var b=api.provide(a,!1);if(b===!1)return[];var c=[];api.each(b,function(a,b){a!="__entity"&&c.push(""+a)});return c},api.provide=function(a,b){arguments.length<2&&(b={});var c=a.split("."),d=namespace;for(var e in c){var f=c[e];if(!d[f]){if(b===!1)return!1;d[f]={}}d=d[f]}b!==!1&&(d.__entity=b);return d},api.impliment=function(a,b){var c=api.provide(a,b);return c},api.implimentClass=function(a,b){b=b||{},b.__classname__=a,_classCache[a]&&delete _classCache[a];var c=new Klass(b);api.impliment(a,c);return api.use(a)},api.Class=function(a,b){var c=0,d,e=c=_classCache[a]||api.use(a);if(!e){window.console&&(console.error("class mis",a),console.trace());throw a+" is undefined class"}b?b instanceof Function?e=b(e):b instanceof Object&&(d=new e(__DO_NOT_START__),e=e.apply(d,b)):(d=new e(__DO_NOT_START__),e=e.apply(d)),e.__namecache__&&(_classCache[a]=c);return e},api.Singletone=function(a,b){return api.memoize(function(c){return api.Class(a,b)})},api.val=function(a,b){var c="valuestore."+a;if(arguments.length>1)this.impliment(c,{value:b});else{var d=this.use(c);d&&"value"in d&&(b=d.value)}return b},api.jsonp={};var jsonp=api.jsonp;windowSAPI.jsonp_callbackCNT=window.jsonp_callbackCNT||0,window.jsopc={},jsonp.quoteString=function(a){var b=/["\\\x00-\x1f\x7f-\x9f]/g,c={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};if(a.match(b))return'"'+a.replace(b,function(a){var b=c[a];if(typeof b=="string")return b;b=a.charCodeAt();return"\\u00"+Math.floor(b/16).toString(16)+(b%16).toString(16)})+'"';return'"'+a+'"'},jsonp.to=function(a){if(typeof JSON=="object"&&JSON.stringify)return JSON.stringify(a);var b=typeof a;if(a===null)return"null";if(b=="undefined")return undefined;if(b=="number"||b=="boolean")return a+"";if(b=="string")return jsonp.quoteString(a);if(b=="object"){if(typeof a.toJSON=="function")return $.toJSON(a.toJSON());if(a.constructor===Date){var c=a.getUTCMonth()+1;c<10&&(c="0"+c);var d=a.getUTCDate();d<10&&(d="0"+d);var e=a.getUTCFullYear(),f=a.getUTCHours();f<10&&(f="0"+f);var g=a.getUTCMinutes();g<10&&(g="0"+g);var h=a.getUTCSeconds();h<10&&(h="0"+h);var i=a.getUTCMilliseconds();i<100&&(i="0"+i),i<10&&(i="0"+i);return'"'+e+"-"+c+"-"+d+"T"+f+":"+g+":"+h+"."+i+'Z"'}if(a.constructor===Array){var j=[];for(var k=0;k<a.length;k++)j.push($.toJSON(a[k])||"null");return"["+j.join(",")+"]"}var l=[];for(var m in a){var n,b=typeof m;if(b=="number")n='"'+m+'"';else if(b=="string")n=jsonp.quoteString(m);else continue;if(typeof a[m]=="function")continue;var o=$.toJSON(a[m]);l.push(n+":"+o)}return"{"+l.join(", ")+"}"}},jsonp.from=function(a){return window.JSON&&window.JSON.parse?window.JSON.parse(a):(new Function("return "+a))()},jsonp.createCallback=function(a,b,c){var d="jsonp.callback."+a,e={func:b,params:c},f="clb_"+a+"_"+ ++windowSAPI.jsonp_callbackCNT;SAPI.Export(f,function(){e.arguments=arguments,b.apply(e,arguments),delete window.jsopc[f]},window.jsopc);return"jsopc."+f},api.console=function(a){window.console&&window.console.log.apply(window.console,arguments)},api.isdef=function(a){return typeof a!="undefined"},api.microtime=function(){var a=(new Date).getTime()/1e3;return a},api.funcBind=function(a,b){return function(){b.apply(a,arguments)}},api.equals=function(a,b){if(a===b)return!0;if(!a&&b||a&&!b)return!1;if(a.length!=b.length)return!1;for(var c in a)if(a[c]!=b[c])return!1;return!0},api.memoize=function(a,b,c){function d(e,f){var g={};return function(){e==0&&f==0&&(e=arguments.length);if(e<=0){arguments[e]in g||(g[arguments[e]]=a.apply(b,arguments));return g[arguments[e]]}arguments[e]in g||(c&&(g={}),g[arguments[e]]=d(e-1,f+1));return g[arguments[e]].apply(this,arguments)}}return d(a.length-1,0)};var setZeroTimeout_vector=[],setZeroTimeout_postMessage=0,setZeroTimeout=function(a,b){return setTimeout(function(){a.call(b)},1)},__clearTimeout=window.clearTimeout;api.clearTimeout=function(a){!a||(a&&a.zero?delete setZeroTimeout_vector[a.ztid]:__clearTimeout(a))};var __setTimeout=window.setTimeout;api.setTimeout=function(a,b){return api.delay(a,{timeout:b})},api.delay=function(a,b){typeof b=="number"&&(b={timeout:b}),b=b||{};var c=1;b.now&&(c=0),b.timeout&&(c=b.timeout);var d=window;b.obj&&(d=b.obj),b.context&&(d=b.context);return c<1&&!b.defered?setZeroTimeout(a,d):__setTimeout(function(){a.apply(d)},Math.max(c,1))},window.postMessage&&SAPI.delay(function(){SAPI.event.listen("core.events.ready",function(){readyZeroTimeout();var a=1;setZeroTimeout_postMessage(function(){a==1?api.console.log("postMessaged timeouts deactivated"):(api.console.log("postMessaged timeouts activated"),setZeroTimeout=function(a,b){return setZeroTimeout_postMessage(a,b)})}),a=2})},1),api.bind=function(a,b){return function(){return a.apply(b,arguments)}},api.rand=function(a,b){return Math.round(Math.random()*(b-a))+a},api.addCss=function(a,b){var c=document.createElement("link");c.setAttribute("rel","stylesheet"),c.setAttribute("type","text/css"),c.setAttribute("href",a),typeof c!="undefined"&&(b&&b.target=="parent"&&SAPI.rootNode().appendChild(filered),(!b||b.target=="both")&&document.getElementsByTagName("head")[0].appendChild(c))},api.addScript=function(src,params){params=params||{};try{var fileref=document.createElement("script");fileref.type="text/javascript",src&&(fileref.src=src);if(params.text){var callback=params.callback;callback||(callback=function(){}),params.callback=function(){eval(params.text),callback()}}params.callback&&(fileref.onreadystatechange===null?fileref.onreadystatechange=function(){var a=this.readyState;if(a==="loaded"||a==="complete")fileref.onreadystatechange=null,params.callback(fileref)}:fileref.onload=fileref.onerror=fileref.onloadend=fileref.onended=function(){params.callback(fileref)}),document.getElementsByTagName("body")[0].appendChild(fileref)}catch(e){}},api.extractScripts=function(a){var b="<script[^>]*>([\\S\\s]*?)</script>",c=new RegExp(b,"img"),d=new RegExp(b,"im"),e=a.match(c)||[],f=[],g;for(g in e){var h=""+e[g],i=h.match(d);i&&i[1]&&f.push(i[1])}return f},api.Export=function(a,b,c){c||(c=api),c[a]=b},api.ajax=function(a){api.$.ajax(a)},api.loadTo=function(a,b){api.ajax(api.$.extend({},{success:function(c){b.async?api.ticktack(function(){a.html(c)}):a.html(c)}},b))},api.__roundBox=function(a,b){b=b||"roundrect";var c=b+"-rrin",d=b+"-td";return"<table class='"+b+"'>"+"<tr class='"+c+"'><td class='"+c+" "+d+"1'></td><td class='"+c+" "+d+"2'></td></tr>"+"<tr class='"+c+"'><td class='"+c+" "+d+"3'>"+a+"</td><td class='"+c+" "+d+"4'></td></tr>"+"</table>"},api.console={log:function(a,b){window.console&&(window.console.log instanceof Function?window.console.log.apply(window.console,arguments):window.console.log(a,b))},error:function(a){window.console&&(window.console.log instanceof Function?window.console.log.apply(window.console,arguments):window.console.log(a))}},function(a){function g(a){var b={},g={},h=d++;this.callin={node:a,events:b,persist:g,idkey:h},f.push(this.callin),a.eventset=this.callin;var i=function(b){g[b]&&a.trigger.apply(this,g[b])};a.listen=function(a,c,d){b[a]||(b[a]=[]);var f=this;d&&(c=SAPI.funcBind(d,c));var g={id:e++,name:a,callback:c,remove:function(){f.remove(this)}};b[a].push(g),i(a);return g},a.leave=function(a,c){SAPI.each(b[a],function(a,b){this.callback==c&&_this.remove(this)})},a.remove=function(a){SAPI.each(b[a.name],function(c,d){d.id==a.id&&delete b[a.name][c]})},a.persistent=function(a){g[a]=arguments,i(a);return{remove:function(){delete g[a]}}},a.hold=function(a){delete g[a]},a.trigger=function(a){var c=b[a];if(c){var d=arguments,e=[],f=0;SAPI.each(c,function(a,b){f||(this.stop=function(){f=1},e.push(this.callback.apply(this,d)))});return e}return[]},a.result=function(b){var d=arguments,e=a.trigger.apply(this,d);if(e&&e.length)return e[0];return c},a.forEach=function(b){var c=arguments,d=a.trigger.apply(this,c),e=[],f={Do:function(a){SAPI.each(e,a)}};d&&d.length&&(e=d);return f}}var b=jQuery,c,d=1,e=1,f=[];new g(a),a.createSpace=function(a){new g(a)},a.ize=function(a,c,d){var e=this;d&&d.context&&(e=d.context);var f=function(c,f){b(a).bind(c,function(a){a.unBbl=function(){a.stopPropagation()},d&&d.stopBubbling=="all"&&a.unBbl(),f.call(e,a)})};for(var g in c){var h=c[g];switch(g.toLowerCase()){case"unwheelable":SAPI.event.dom.overHookWheel(a);break;case"unselectable":h?(a.onselectstart=function(){return!1},a.unselectable="on"):(a.onselectstart=function(){return!0},a.unselectable="off");break;default:f(g,c[g])}}},a.clear=function(a,b){if(b=="select"){var c={click:function(a){return!1},mousedown:function(a){a.stopImmediatePropagation();return!1},mouseup:function(a){a.stopImmediatePropagation();return!1},unselectable:!1};SAPI.event.ize(a,c,{stopBubbling:"all"})}},a.dom={stopBubble:function(a){a=a||window.event,a.cancelBubble=!0,a.cancel=!0,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault();return!0},addEvent:function(a,b){return this.addEventTo(document,a,b)},addEventTo:function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)},removeEventFrom:function(a,b,c){a.addEventListener?a.removeEventListener(b,c,!1):a.attachEvent&&a.detachEvent("on"+b,c)},ctrl:function(a,b,c,d){return b&&b!="disable"?this.addEventTo(a,c,d):this.removeEventFrom(a,c,d)},dragging:{hold:function(){var a=this,b={drag:document.ondragstart,select:document.onselectstart,unhold:function(){a.unhold(this)}};document.ondragstart=function(){return!1},document.onselectstart=function(){return!1};return b},unhold:function(a){document.ondragstart=a.drag,document.onselectstart=a.select}},overHookWheel:function(b){var c=b,d="mousewheel",e=this,f=function(b){return a.dom.stopBubble(b)};c.addEventListener?(c.addEventListener("DOMMouseScroll",f,!1),c.addEventListener(d,f,!1)):c.attachEvent&&c.attachEvent("on"+d,f)}},a.doChangeLocation=function(a){var c=b("<form method='post' action='#'><input type=submit></form>");c.attr("action",a),c.appendTo(SAPI.css.sandBox()),c.submit()},SAPI.event.trigger("core.events.ready")}(SAPI.event),api.user=function(a){a&&this.val("__user",a);return this.val("__user")};var mLatLng=function(a,b,c){c=c||1,c==1?(this.x=+a,this.y=+b):(this.x=+a/c,this.y=+b/c)};mLatLng.prototype.lat=function(){return this.x},mLatLng.prototype.lng=function(){return this.y},mLatLng.prototype.getLat=function(){return this.lat()},mLatLng.prototype.getLng=function(){return this.lng()},mLatLng.prototype.equal=function(a){var b=1e-7;return Math.abs(this.lat()-a.lat())<b&&Math.abs(this.lng()-a.lng())<b},mLatLng.prototype.dup=function(){return new mLatLng(this.x,this.y)},mLatLng.prototype.clone=function(){var a=new mLatLng(this.x,this.y);for(var b in this)a[b]=this[b];return a},mLatLng.prototype.distTo=function(a){return api.math.distTo(this.x,this.y,a.x,a.y)},mLatLng.prototype.angleTo=function(a){return api.math.angleTo(this.x,this.y,a.x,a.y)},mLatLng.prototype.sapiLatLng=function(){return 1},mLatLng.prototype.toJSON=function(){return{x:this.x,y:this.y}};var mLatLngBounds=function(a,b){this.lt=a,this.br=b};mLatLngBounds.prototype.center=function(){return this.getCenter()},mLatLngBounds.prototype.getCenter=function(){return new mLatLng(this.lt.x+(this.br.x-this.lt.x)/2,this.lt.y+(this.br.y-this.lt.y)/2)},mLatLngBounds.prototype.getSouthWest=function(){return this.br},mLatLngBounds.prototype.getNorthEast=function(){return this.lt},mLatLngBounds.prototype.getLT=function(){return new mLatLng(this.lt.x,this.lt.y)},mLatLngBounds.prototype.getLB=function(){return new mLatLng(this.lt.x,this.br.y)},mLatLngBounds.prototype.getRT=function(){return new mLatLng(this.br.x,this.lt.y)},mLatLngBounds.prototype.getRB=function(){return new mLatLng(this.br.x,this.br.y)},mLatLngBounds.prototype.dup=function(){return new mLatLngBounds(this.lt,this.br)},api.map.LatLng=function(a,b){return new mLatLng(a,b)},api.map.toLatLng=function(a){if("x"in a)return SAPI.map.LatLng(a.x,a.y);if("lat"in a)return SAPI.map.LatLng(a.lat,a.lng);if(a[0])return SAPI.map.LatLng(a[0],a[1]);throw"not a latLng compatible object",a},api.map.LatLngBounds=mLatLngBounds,api.mapon=function(a,b){api.map.mapSelector=a,api.event.listen("dom.ready",function(){api.map.start(b)})},api.position=function(a,b){api.map.position.apply(this.map,arguments)},api.hightlightObject=function(a){};var _ChainSeq={initialize:function(a){this.init(a)},init:function(a){var b={repeat:1,ticked:1,seq:[]};this.params=SAPI.merge({},b,a),this.seq=this.params.seq.slice(0)},run:function(){this.next();return this},breakit:function(){this.init({});return this},getNext:function(){var a=this.seq.shift();a||(this.params.repeat--,this.params.repeat&&(this.seq=this.params.seq.slice(0),a=this.seq.shift()));return a},call:function(a){var b=this;this.params.ticked?SAPI.delay(function(){a.apply(b)},{now:1}):a.apply(b)},repeat:function(){this.call(this.nowSeq)},repeatNow:function(){this.nowSeq()},next:function(){var a=this.getNext();this.nowSeq=a,a&&this.call(a);return this}},ChainSeq=Klass(_ChainSeq);api.chain=function(a){var b=new ChainSeq(a);return b},function(){api.event.listen("dom.ready",function(){function f(){document.write=function(a){e(a)},document.writeln=function(a){e(a+"\n")}}function e(a){b+=a,clearTimeout(c),c=setTimeout(function(){h()},1)}function d(b,c){a?h():f(),a={target:b,callback:c}}var a="",b="",c=0;api.write={write:e,target:d};var g=0,h=function(){target=a,clearTimeout(c);if(b){g++;var d=target,e="<span id='dws"+g+"'>"+b+"</span>";b="";var f=$(e);$(target.target).append(f),target.callback&&target.callback($(target.target)),h(target)}};f()})}(),function(){SAPI.animation={},SAPI.impliment("animation.functors",{Pow:function(a,b){return Math.pow(a,b&&b[0]||6)},Expo:function(a){return Math.pow(2,8*(a-1))},Circ:function(a){return 1-Math.sin(Math.acos(a))},Sine:function(a){return 1-Math.sin((1-a)*Math.PI/2)},Back:function(a,b){b=b&&b[0]||1.618;return Math.pow(a,2)*((b+1)*a-b)},Bounce:function(a){var b;for(var c=0,d=1;1;c+=d,d/=2)if(a>=(7-4*c)/11){b=d*d-Math.pow((11-6*c-11*a)/4,2);break}return b},bouncer:function(a,b){return 0},sinbounce:function(a,b){var c=b/Math.PI,d=Math.sin(a*c)},Elastic:function(a,b){return Math.pow(2,10*--a)*Math.cos(20*a*Math.PI*(b&&b[0]||1)/3)}});var a=SAPI.use("animation.functors");SAPI.animation.easing=a;var b={params:{endtime:1,zeroTM:1,FPS:24},timeouts:0,initialize:function(a){this.params.FPS=24,this.setParams(a),this.fStep=SAPI.bind(this.step,this),this.stop()},setParams:function(a){this.params=SAPI.merge({},this.params,a),this.FPSstep=1/this.params.FPS;return this},start:function(){this.intime=0,this.insteptime=0,this.stoped=0,this.started=1,this.tickpassed=0,this.ticktryed=0,this.startime=SAPI.microtime(),this.params.duration&&(this.params.endtime=this.startime+this.params.duration/1e3),this.insteptime=this.startime+(this.params.seed||(Math.random()-.5)/3),this.__run();return this},stop:function(){this.params.endtime>1&&this.instep(this.params.endtime),clearTimeout(this.timeouts),this.stoped=1,this.started=0},__run:function(){if(this.started){this.intime=SAPI.microtime(),this.insteptime||(this.insteptime=this.intime);var a=this.params.endtime-this.intime;a<0&&this.params.endtime>1?this.stop():this.timeouts=SAPI.delay(this.fStep,{timeout:this.params.FPS>10?this.params.zeroTM:Math.max(13,this.FPSstep*10)})}else this.stop();return this},frame:function(a,b,c){this.params.fn&&this.params.fn(a,b,c);if(0)SAPI.console.error(e);return this},instep:function(a){this.tickpassed++;var b={start:this.startime,intime:this.intime,outtime:a,timepass:a-this.startime,ticktime:a-this.insteptime,position:(a-this.startime)/(this.params.endtime-this.startime),target:this.params.target,params:this.params};this.insteptime=a,this.frame(b.timepass,b),this.intime=a},step:function(){var a=SAPI.microtime(),b=a-this.insteptime;this.ticktryed++,b>=this.FPSstep&&this.instep(a),this.__run();return this},css:function(a,b,c){var d=new SAPI.Class("sapi.animation.css",[a,b,c]);d.driver=this,this.stackStep(function(a,b){d.step(a,b)});return d}},c=SAPI.implimentClass("sapi.animation.valuefloat",{startvalues:{},endvalues:{},values:{},_delta:0,initialize:function(a,b){this.endvalues=SAPI.duplicate(a),this.prepare(),this.values=SAPI.duplicate(startvalues)},prepare:function(){this.startvalues=SAPI.duplicate(this.endvalues)},apply:function(){},functor:function(a,b,c,d){return(d-c)*(b/this.duration)},step:function(a){for(var b in this.values)this.values[b]=this.startvalues[b]+this.functor(b,a,this.startvalues[b],this.endvalues[b])}}),d=SAPI.implimentClass("sapi.animation.chainDecorator",{chain:[],step:function(){},push:function(a){this.chain.push(a)}});SAPI.animation.css=function(a,b){},SAPI.animation.functor=function(a,b){a.fn=b;var c=SAPI.Class("sapi.animation.core",[a]);c.start();return c};var f=SAPI.implimentClass("sapi.animation.core",b);SAPI.animation.chain=function(a){var b=SAPI.Class("sapi.animation.chainDecorator");for(var c in arguments)arguments[c]instanceof Function?b.push({step:arguments[c]}):b.push(SAPI.Class("sapi.animation.valuefloat",[arguments[c]]));a.fn=function(){b.step.apply(b,arguments)};return SAPI.Class("sapi.animation.core",[a])},SAPI.animation.core=function(a){return SAPI.Class("sapi.animation.core",[a])},SAPI.implimentClass("sapi.animation.plug",{animationInstance:0,$autorun:function(){},animate:function(){this.animationInstance=SAPI.animation.chain(arguments),this.animationInstance.start()}})}(),function(a){function c(){try{return"localStorage"in window&&window.localStorage!==null}catch(a){return!1}}var b={store:{}};b.store.supported=c();var d=b.store.supported?window.localStorage:{};b.store.get=function(b){try{return d[b]&&a.jsonp.from(d[b])}catch(c){window.console&&console.error(c);return!1}},b.store.set=function(b,c){try{d[b]=a.jsonp.to(c);return c}catch(e){window.console&&console.error(e);return!1}},a.blackbox=b}(SAPI),function(a){a.cookie={write:function(a,b,c){this.options=c||{},this.options.encode&&(b=encodeURIComponent(b)),this.options.domain&&(b+="; domain="+this.options.domain),this.options.path&&(b+="; path="+this.options.path);if(this.options.duration){var d=new Date;d.setTime(d.getTime()+this.options.duration),b+="; expires="+d.toGMTString()}this.options.secure&&(b+="; secure"),document.cookie=a+"="+b;return this},read:function(a){var b=document.cookie.match("(?:^|;)\\s*"+SAPI.string(a).escapeRegExp()+"=([^;]*)");return b?decodeURIComponent(b[1]):null}}}(SAPI),function(a){var b=a.$;a.extfn={positionRelative:function(a,b){var c=0,d=0,e=a.closest(b);if(e.length&&e.css("position")!=="static"){var f=a,g=f.offset().left-parseInt(f.css("marginLeft"),10),h=f.offset().top-parseInt(f.css("marginTop"),10),i=e.offset().left+parseInt(e.css("borderLeftWidth"),10),j=e.offset().top+parseInt(e.css("borderTopWidth"),10);c=g-i,d=h-j}return{left:c,top:d}},lazyResize:function(a,c,d,e){e=e||0,c.css({height:"auto",display:"block"});var f=c.height(),g=Math.max(a.height(),5);e<Math.abs(f-g)&&(!d||f<d)?b(a).stop().animate({height:f+e},200):a.css("height",Math.min(g,d))},toOptionList:function(a,c){var d=[];b.each(a,function(a,b){var e=a===c;d.push('<option value="'+a+'" '+e+">"+b+"</option>")});return d.join("\n")},trim:function(a){a=a||"";var b=" s ",c=new RegExp("^["+b+"]+|["+b+"]+$","g");return a.replace(c,"")},natSort:function(a,b){var c,d,e,f,g=/(\d+)|(\D+)/g,h=/\d+/;return a.sort(function(a,i){var j=b(a),k=b(i);c=String(j).toLowerCase().match(g)||"",d=String(k).toLowerCase().match(g)||"";while(c.length&&d.length){e=c.shift(),f=d.shift();if(h.test(e)||h.test(f)){if(!h.test(e))return 1;if(!h.test(f))return-1;if(e!=f)return e-f}else if(e!=f)return e>f?1:-1}return c.length-d.length})},setval:function(a,c){var d=b(a).val(),e=a;b(a).val(c),(d||c)&&d!=c&&(clearTimeout(this.__amovaltm),this.__amovaltm=setTimeout(function(){b(e).trigger("change")},1));return b(this)},valueChange:function(a,c,d){d=d||100;var e=0,f=function(){var a=this;clearTimeout(e),e=setTimeout(function(){c.call(a)},d)},g=0,h=a;a=b(a);var i=a,j=a.val(),k=function(){j!=i.val()&&(clearTimeout(h.chtm),h.chtm=setTimeout(function(){a.change()},100),j=i.val())};a.change(f),a.focus(function(){j=b(i).val(),g=setInterval(function(){k()},300)}),a.blur(function(){clearInterval(g)})}}}(SAPI),function(){jQuery.fn.fixFloat=function(a){a=SAPI.merge({top:0},a);var b=$(this);if("stop"in a)b.trigger("fixfloat_stop");else{if(b.attr("fixfloated"))return;$(function(){b.attr("fixfloated","true");var c=$(".__fixfloatmarker__",b);c.length==0&&(c=$("<div class='__fixfloatmarker__'></div>").insertBefore(b));var d=b.css("position"),e=b.css("top"),f="normal",g=function(){if(f!="fixed"){var c=b.height();a.inFloat&&a.inFloat(b);var d=function(){f="fixed",b.css("position","fixed"),b.css("top",a.top)},e=SAPI.css.windowScroll(),g=b.height(),h=Math.max(g,c),i=b.offset();e.y>i.top+h?(f="fixed",b.css("position","absolute"),b.css({left:i.left,top:-h}),b.stop().animate({top:e.y},function(){d()})):d()}},h=function(){f!="normal"&&(f="normal",b.css("position","static"),b.css("top",e),a.inStatic&&a.inStatic(b))},i=0,j=function(){var d=SAPI.css.windowScroll(),e={w:b.width(),h:b.height()},f=c.offset(),i=a.heightMinimal||e.h/2,j=f.top+a.top,k=d.y>j;if(a.middleBlocker){var l=a.middleBlocker.height(),m=c.offset();d.y+a.top+i<=m.top+l+2&&(k=0)}k?g():h()},k=function(){j()};$(window).bind("scroll",k,!1),b.bind("fixfloat_stop",function(){h(),$(window).unbind("scroll",k,!1),b.attr("fixfloated",!1)}),j()})}}}(),function(){var a=SAPI.implimentClass("tools.hmi.mouseDragger",{docdrag:0,active:0,initialize:function(a){this.MapMoveDecorator=SAPI.bind(function(a){this.mousemove(a)},this),this.MapUpDecorator=SAPI.bind(function(a){this.stop(a)},this),this.params=this.prepare(a)},bindTo:function(a){var b=SAPI.bind(function(a){this.start(),SAPI.event.dom.stopBubble(a);return!1},this);SAPI.event.dom.ctrl(a[0],"enable","mousedown",b),SAPI.event.dom.ctrl(a[0],"enable","touchstart",b)},prepare:function(a){return a},process:function(a){return a},functor:function(a,b){this.params.functor(a,b?this.process(b):0)},mousePosition:function(a){a.touches&&a.touches.length==1&&(a=a.touches[0]);return a.pageX?{x:a.pageX,y:a.pageY}:SAPI.css.windowScroll(a.clientX,a.clientY)},setStartMouse:function(a){a&&!this.mouseP&&(this.mouseP=this.mousePosition(a))},start:function(a){a=a||window.event,a||(this.mouseC=0),this.active=1,this.setStartMouse(a),SAPI.event.dom.ctrl(document,"enable","mousemove",this.MapMoveDecorator),SAPI.event.dom.ctrl(document,"enable","touchmove",this.MapMoveDecorator),SAPI.event.dom.ctrl(document,"enable","mouseup",this.MapUpDecorator),SAPI.event.dom.ctrl(document,"enable","touchend",this.MapUpDecorator),this.docdrag=SAPI.event.dom.dragging.hold(),this.functor("start",0),a&&SAPI.event.dom.stopBubble(a);return!1},stop:function(a){this.active=0,SAPI.event.dom.ctrl(document,"disable","mousemove",this.MapMoveDecorator),SAPI.event.dom.ctrl(document,"disable","touchmove",this.MapMoveDecorator),SAPI.event.dom.ctrl(document,"disable","mouseup",this.MapUpDecorator),SAPI.event.dom.ctrl(document,"disable","touchend",this.MapUpDecorator),this.docdrag&&(this.docdrag.unhold(),this.docdrag=0),this.functor("end",0),this.mouseP=0,this.mouseC=0},mousemove:function(a){a=a||window.event,this.setStartMouse(a),this.mouseEndP=this.mousePosition(a);var b={start:this.mouseP,end:this.mouseEndP,delta:{x:this.mouseEndP.x-this.mouseP.x,y:this.mouseEndP.y-this.mouseP.y}};this.functor("move",b),SAPI.event.dom.stopBubble(a);return!1}})}(),function(){var a=jQuery,b={dragger:"tools.hmi.mouseDragger"},c=SAPI.implimentClass("tools.hmi.editBounds",{params:{},initialize:function(a){this.params={},this._lastSetup={},this.link(a),this.init()},link:function(a){this.params=SAPI.merge({},b,this.params,a)},show:function(b){var c=this;this.params.timeout_ShowHide(SAPI.delay(function(){c.params.timeout_ShowHide(0),c.topBox.css("display")=="none"&&c.topBox.stop().show().css("opacity",.1).animate({opacity:1},200,function(){a(this).css({opacity:""})})},{timeout:b||100,context:c}))},hide:function(){var b=this;this.params.timeout_ShowHide(SAPI.delay(function(){b.params.timeout_ShowHide(0),b.topBox.stop().animate({opacity:0},200,function(){a(this).hide()})},{timeout:150,context:b}))},aDrag:function(b,c,d){var e={l:{left:0},r:{right:0},t:{top:0},b:{bottom:0},m:{left:"50%"}},f=a("<i></i>").addClass(b).addClass(b+c).addClass("_a"+c);f.css(SAPI.merge({},e[d.charAt(0)],e[d.charAt(1)]));return{el:f,action:c,actfor:b}},setSize:function(a,b){this.topBox.css({width:a,height:b});var c=this.dragBox.css("marginLeft")+this.dragBox.css("marginRight"),d=this.dragBox.css("marginTop")+this.dragBox.css("marginBottom");this.dragBox.css({width:a-c,height:b-d})},inject:function(b){this.topBox.appendTo(b);if(0)a(this.topBox).mouseenter(function(){_this.show()}).mouseleave(function(){_this.hide()})},init:function(){var b=this,c={lt:this.aDrag("lt","s","lt"),rt:this.aDrag("rt","s","rt"),lb:this.aDrag("lb","s","lb"),rb:this.aDrag("rb","s","rb"),rot:this.aDrag("rot","r","mt")};this.dragBox=a("<div class='extdragAll'></div>"),this.topBox=a("<div class='extdragEdit' style='display:none'></div>"),c.drag={el:this.dragBox,action:"drag",type:"da"};var d=this.topBox;SAPI.each(c,function(a,c){c.el.css({opacity:.6}).appendTo(d);var e=SAPI.Class(this.params.dragger,[{functor:function(a,d){a=="start"?b.start(c,d):a=="end"?b.end(c,d):a=="move"&&b.move(c,d)}}]);e.bindTo(c.el)},this)},start:function(a,b){this.lock()},end:function(a,b){this.unlock()},move:function(a,b){if(a.action=="drag")this.sizeChange("move",{left:this._locked.left+b.delta.x,top:this._locked.top+b.delta.y});else if(a.action=="s"){var c={lt:{left:1,top:1,width:-1,height:-1},lb:{left:1,top:0,width:-1,height:1},rt:{left:0,top:1,width:1,height:-1},rb:{left:0,top:0,width:1,height:1}},d=c[a.actfor];this.sizeChange("scale",{left:this._locked.left+b.delta.x*d.left,top:this._locked.top+b.delta.y*d.top,width:this._locked.width+b.delta.x*d.width,height:this._locked.height+b.delta.y*d.height})}else a.action!="rot"},lock:function(){this._locked={left:parseInt(this.topBox.css("left")),top:parseInt(this.topBox.css("top")),width:parseInt(this.topBox.css("width")),height:parseInt(this.topBox.css("height"))}},unlock:function(){this.params.unlock&&this.params.unlock(this._lastSetup)},sizeChange:function(a,b){this._lastSetup=b,this.topBox.css(b),this.params.callback&&this.params.callback(a,this._lastSetup)}});if(0)a(function(){var a=SAPI.Class("tools.hmi.editBounds",[{}]);a.inject(document.body),a.sizeChange("set",{top:100,left:100,width:200,height:150})})}(),function(){var a=SAPI.implimentClass("tools.geoLocation",{initialize:function(){this.event={},SAPI.event.createSpace(this.event)},test:function(){return"geolocation"in navigator},getPosition:function(a){function e(a){clearTimeout(b),b=setTimeout(function(){SAPI.event.trigger("geolocation.error",a),c.trigger("geolocation.error",a)},300)}function d(a){clearTimeout(b),b=setTimeout(function(){SAPI.event.trigger("geolocation.update",a),c.trigger("geolocation.update",a)},300)}if(!this.test())e({code:-505,message:"out of service"});else{var b=0,c=this.event;SAPI.event.trigger("geolocation.start"),this.event.trigger("geolocation.start"),navigator.geolocation.getCurrentPosition(d,e,{enableHighAccuracy:a})}}})}(),function(){var a=SAPI.implimentClass("mixin.interface.raphael",{$autorun:function(){var a=this;this.Raphael={instance:0,get:function(b,c){if(this.instance)return this.instance;var d=b||a.getDiv();if(!d)return!1;c=c||a.getPixelDim(),this.instance=Raphael(d,c.left,c.top);return this.instance},remove:function(){this.instance&&this.instance.remove(),this.instance=0}}},hide:function(){this.Raphael.remove()}})}(),function(){var a="hotlink",b=SAPI.implimentClass("utils.link.hot",{initialize:function(){},get:function(b,c){var d=SAPI.val("conf.basedir")+a+"/load/"+b;$.get(d,{},c)},create:function(b,c){var d=SAPI.val("conf.basedir")+a+"/save/";$.post(d,{data:b},c)}})}()}(SAPI),function(a){}(SAPI),function(a){function h(a){return a/Math.PI*180}function g(a){return a/180*Math.PI}function f(a,b){return new e(a,b)}function e(a,b){this.x=a,this.y=b}function d(a){a=parseInt(a),isFinite(a)||(a=0);return a}var b=1e6,c=1/b;a.ZM_FACTOR=b,e.prototype={ZM_FACTORIZE:function(){return new f(this.x*=c,this.y*=c)},length:function(){return Math.sqrt(this.length2())},length2:function(){return this.x*this.x+this.y*this.y},normalize:function(a){a||(a=Math.sqrt(this.x*this.x+this.y*this.y)),a=1/a;return f(this.x*a,this.y*a)},dot:function(a){return this.x*a.x+this.y*a.y},add:function(a){return f(this.x+a.x,this.y+a.y)},sub:function(a){return f(this.x-a.x,this.y-a.y)},mul:function(a){return f(this.x*a,this.y*a)}},a.vector=f,a.deg2rad=g,a.rad2deg=h,a.distTo=function(a,b,c,d){a=g(a),b=g(b),c=g(c),d=g(d);return Math.round(6378137*Math.acos(Math.cos(a)*Math.cos(c)*Math.cos(b-d)+Math.sin(a)*Math.sin(c)))},a.humanDist=function(a){a=d(a);var b=a+" м";a>20&&(b=Math.round(a/10)*10+" м"),a>400&&(b=Math.round(a/100)/10+" км");return b},a.angleTo=function(a,b,c,d){var e=f(a,b),g=f(c,d),i=e.sub(g).normalize(),j=h(Math.acos(i.x));i.y<0&&(j=360-j);return j},a.line={length:function(a){var b=0,c=a.length-1;for(var d=1;c;--c,++d)b+=a[d].sub(a[d-1]).length(),a[d]._lineLength=b;return b},pointAtDistance:function(a,b){var c=0,d,e,f,g=b.length-1,h=0;for(var i=1;g;--g,++i){d=c,e=b[i]._lineLength-c,c=b[i]._lineLength;if(c>a){f=b[i].sub(b[i-1]),e-=c-a;return{point:b[i-1].add(f.normalize().mul(e)),offset:e,index:i-1}}}return!1},fromArray:function(a){var b=[];b.length=a.length;for(var c=0,d=a.length;d;++c,--d)b[c]=f(a[c][0],a[c][1]);return b}}}(SAPI.math),function(a){a.haveTransforms=0,a.IErotate=function(a,b){var c=b*Math.PI/180,d=Math.cos(c),e=Math.sin(c),f={};f["-ms-filter"]='progid:DXImageTransform.Microsoft.Matrix(sizingMethod="auto expand", M11 = '+d+", M12 = "+ -e+", M21 = "+e+", M22 = "+d+")",f.filter=f["-ms-filter"];return SAPI.join(f,"; ",":")},a.browserPrefix=function(a){var b=[""];jQuery.browser.mozilla&&b.push("-moz-"),jQuery.browser.opera&&b.push("-o-"),jQuery.browser.webkit&&b.push("-webkit-");var c=[];for(var d in b)c.push(b[d]+a);return c.join(";")},a.transform=function(a){var b=[];a.rotate&&b.push("rotate("+Math.round(a.rotate*10)/10+"deg)"),b=b.join(" ");return this.browserPrefix("transform:"+b)},a.rotate=function(b,c){return a.haveTransforms?a.transform({rotate:b}):a.IErotate(c,b,!0)};var b=[];a.rotateElement=function(c,d,e){var f=c.attr("sapirotid"),g={};f?g=b[f]:(b.push(g),c.attr("sapirotid",b.length-1)),e&&!g.fixed&&(g.fixed=1,a.fixAbsolutize(c)),g.sizeopt||(g.sizeopt={w:c.width(),h:c.height()}),c[0].style.cssText=a.rotate(d);var h=c.width(),i=c.height();c.css({"margin-left":-(h-g.sizeopt.w)/2,"margin-top":-(i-g.sizeopt.h)/2})},a.windowHeight=function(){if(typeof window.innerWidth=="number")return window.innerHeight;if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))return document.documentElement.clientHeight;return 1},a.windowScroll=function(a,b){a=+(a||0),b=+(b||0),document.attachEvent!=null?(a=a+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft),b=b+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)):!document.attachEvent&&document.addEventListener&&(a=a+window.scrollX,b=b+window.scrollY);return{x:a,y:b}},a.isVisible=function(a){if(!SAPI.$(a).is(":visible"))return 0;var b=a.offsetParent;b||(b=a.parentNode);if(b)while(b&&b.tagName!="BODY"){if(!SAPI.$(b).is(":visible"))return 0;a=b,b=b.offsetParent,b||(b=a.parentNode);if(a==b)return 0}return 1},a.fixAbsolutize=function(a){var b=$("<div><div></div></div>");b.css({width:a.outerWidth(),height:a.outerHeight(),position:"relative"}),$(">div",b).css({position:"absolute",left:0,top:0}),a.wrap(b)},a.currentStyle=function(a){var b=a.ownerDocument,c=b.defaultView,d=c?c.getComputedStyle(a,null):a.currentStyle,e=function(a){if(a in d)return d[a];return d.getPropertyValue(a)};return{cache:{},get:function(a){a in this.cache||(this.cache[a]=e(a));return this.cache[a]}}};var c=0;a.sandBox=function(){if(c)return c;c=$("<div class='sapi-sandbox' style='left:-1000px;top:-100px;width:10px;height:10px;overflow:hidden'></div>"),c.appendTo(document.body);return c},a.raphael={sprite:function(a,b){var c=new Image,d=0;c.onload=function(){d.attr({width:this.width,height:this.height})};var e=b.get("backgroundImage"),f=new RegExp("url\\((.*?)\\)"),g=f.exec(e),h=g[1];if(h.charAt(0)=='"'||h.charAt(0)=="'")h=h.substr(1,h.length-2);var i=b.get("backgroundPosition")?b.get("backgroundPosition").split(" "):[b.get("backgroundPositionX"),b.get("backgroundPositionY")];SAPI.each(i,function(a,b){i[a]=parseInt(b)});var j={bp:i,x:-parseInt(i[0])+ -parseInt(b.get("marginLeft")),y:-parseInt(i[1])+ -parseInt(b.get("marginRight")),paddedLeft:parseInt(i[0])+parseInt(b.get("marginLeft")),paddedTopt:parseInt(i[1])+parseInt(b.get("marginRight")),marginLeft:+parseInt(b.get("marginLeft")),marginTop:+parseInt(b.get("marginRight")),width:parseInt(b.get("width")),height:parseInt(b.get("height"))},k=Math.max(j.width,j.height);d=a.image(h,i[0],i[1]).attr({"clip-rect":"0 0 "+k*2+" "+k}),c.src=h;return{off:j,image:d,attr:function(){return this.image.activeAttrs},rotationLasts:function(){return this.attr().cx+(this.attr().x||0)+" "+(this.attr().cy+(this.attr().y||0))},defaultOffset:function(a,b){this.image.attr({cx:-this.off.marginLeft+a,cy:-this.off.marginTop+b})}}}},SAPI.$(function(){var b=document.body;a.haveTransforms=typeof b.style.WebkitTransform!="undefined"||typeof b.style.MozTransform!="undefined"||typeof b.style.OTransform!="undefined"||typeof b.style.transform!="undefined",SAPI.event.trigger("ext.css3is",a.haveTransforms)})}(SAPI.css);if(0)$(function(){var a=$("<div style='background-color:#EEE;border:1px solid black;width:40;height:40;position:absolute;top:10px;left:10px;padding:10px'></div>").appendTo(document.body),b=$("<div class='mcatli'><i class='spr-photo'></i></div>");b.appendTo(SAPI.css.sandBox());var c=SAPI.css.currentStyle($("i",b)[0]),d=Raphael(a[0],60,40),e=SAPI.css.raphael.sprite(d,c);b.remove(),e.defaultOffset(0,34);var f=e.image;f.attr({x:20});var g=0,h=0;g=function(){f.animate({rotation:"-45 "+e.rotationLasts()},500,function(){h()})},h=function(){f.animate({rotation:"+45 "+e.rotationLasts()},500,function(){g()})},g()});(function(){var a=0;SAPI.mapsNode=function(b,c){var d=b;d.mapSelector="map_overlayed",d.zone=0,d.event={},c.event.createSpace(d.event);var e=function(){return d.zone.blockerDiv},f=function(){return d.zone.mapDiv};d.getBlocker=e,d.getMapDom=f,d.getDomHeight=function(){var a=e().height(),b=f().height();return Math.max(a,b)},d.getStaticImage=function(a,b,c){return d.zone.getStaticImage(a,b,c)},d.position=function(a,b){if(arguments.length>0)return d.zone.setPosition(a,b);return d.zone.getPosition()},d.toBounds=function(a,b,e,f,g){g||(b/=c.math.ZM_FACTOR,a/=c.math.ZM_FACTOR,f/=c.math.ZM_FACTOR,e/=c.math.ZM_FACTOR);var h=d.LatLng(b+(f-b)/2,a+(e-a)/2);h.func=function(){this.toBounds(new d.LatLngBounds(d.LatLng(b,a),d.LatLng(f,e)))};return h},c.event.listen("map.worker.zoneready",function(b,e){a=e,d.zone=new a,d.zone.event=d.event,c.console.log("dont worry, be-sapi")}),d.useTheme=function(a){var b=c.Class("map.theme."+a,[d])},d.start=function(a){var b=this,e=d,f={divId:"sapimap_"+c.serviceCount,className:"",absolute:1},g=c.merge({blocker:d.mapSelector},a);d.zone.spawnOn(c.merge({},f,g)),d.zone.tearUp(),a.prepare&&a.prepare(d),d.zone.onReady(function(e){a.onattach&&(a.onattach(d,c.$(b.mapSelector)),delete a.onattach),c.event.persistent("map.worker.ready",{sapi:c,map:d,worker:e}),d.event.persistent("map.worker.ready",{sapi:c,map:d,worker:e})}),d.zone.onStateInit(function(a){c.event.persistent("map.worker.start",{sapi:c,map:d,worker:a}),d.event.persistent("map.worker.start",{sapi:c,map:d,worker:a})}),d.zone.onStateLeave(function(a){c.event.trigger("map.worker.leave",{sapi:c,map:d,worker:a}),d.event.trigger("map.worker.leave",{sapi:c,map:d,worker:a})}),d.zone.activate()}},SAPI.mapsNode(SAPI.map,SAPI)})(),function(a){function w(a){jQuery(".top_search_preresult").html("...сейчас найдем..."),jaxSRCH_varian=1,e=0,d=0,g=0,f=0,v++;var b=v;geocoder?geocoder.getLocations(""+a,function(a){v==b&&u(a)}):g=1;var c="&llnull";j=0;if(geo_map){var h=geo_map.getMapCenter(),i=Math.round(h.y*SAPI.math.ZM_FACTOR),k=Math.round(h.x*SAPI.math.ZM_FACTOR);c="&lat="+i+"&lng="+k,j={lat:i,lng:k}}var l=DataCenter+"loader/ajafind.php";l="http://www.esosedi.ru/loader/callsearch.php";var m=SAPI.jsonp.callback(function(a){t(a)},"call.search",1);SAPI.addScript(l+"?w="+a+"&callback="+m+c)}function u(a){if(!a||a.Status.code!=200)e=1,o();else{if(!g||g==1)g=[];g.push(a),e=1,o()}}function t(a){jQuery(".top_search_preresult").html(""),lines?f=lines:f="",i=0,d=1,o()}function s(a){jQuery("a.next",a).click(function(){l(jindex(this));return!1}),jQuery("a:first",a).click(function(){jax_position(jindex(this));return!1}),jQuery("li",a).mouseenter(function(){var a=this;jQuery("div",this).css({backgroundImage:jax_getStaticMap(a)}),jQuery("div",this).show()}),jQuery("li",a).mouseleave(function(){jQuery("div",this).hide()})}function r(a){var b=jQuery(".minimap",a.dom);b.hide(),a.staticZoom.stop()}function q(a){var b=jQuery(".minimap",a.dom);a.staticZoom=SAPI.map.staticZoomDim(b,a.ll,{zoom:[8,12,14,16]}),b.show()}function p(a){var b=[];for(var c in a)b.push(a[c]);b.sort(function(a,b){return a.distkey<b.distkey});var d=[],e=[];jQuery.each(b,function(a,b){var c=this;if(!!this.text){var d=jQuery(this.text);if(!d)return;c.obj.dom=d,d.click(function(){l(c.obj)}),d.mouseover(function(){q(c.obj)}),d.mouseout(function(){r(c.obj)}),e.push(d)}}),d=d.join("\n");var f=jQuery("#jax_help"),g=jQuery('<ul class="search_tooltop"></ul>');for(var c in e)e[c].appendTo&&e[c].appendTo(g);f.html(""),g.appendTo(f);var h=SAPI.map.getDomHeight();h<200&&(h=200),f.css({height:h+"px"}),f.show(),s(f)}function o(){jQuery("#search_w").css({backgroundColor:"#FFF"}),resultOK=0,resultL={geo:[],nav:[]};var a=0,b=m(resultL.geo,g),d=n(resultL.nav,f);jQuery("#locstr_load").hide();var e=b+d;e?jQuery(".top_search_preresult").html(e+" результатов"):jQuery(".top_search_preresult").html("На радаре пусто");var h=0,i=SAPI.map.position(),j=function(a,b){var d,e=0;for(d in a)if(d>=0){var f=a[d],g=f.name+" : "+f.addr,j=g;if(g.length>60){var k=g.length-60;g=f.name+" : "+"...",g+=f.addr.substring(k)}var l=">";f.image&&(l="class='imaged'> <img src='"+DRR+f.image+"' width=16 height=16>"),c[h]=f;var m="",n=0;if(i){var n=i.distTo(f.ll);n=SAPI.math.humanDist(n),m="<i>"+n+"</i>";if(SAPI.css.haveTransforms){var o=i.angleTo(f.ll,{w:20,h:20});m+='<div class="dm" style="'+SAPI.css.rotate(o)+'"></div>'}}var p="<li "+l+'<div class="minimap"></div><a href="#" name="si'+h+'">'+g+'</a><a class="next"></a>'+m+"</li>";h++,b.push({text:p,obj:f,distkey:n}),e++}},l=0,o=[];l+=j(resultL.geo,o),l+=j(resultL.nav,o),k=o,p(o)}function n(a,b){var c=0;if(b){var d=b;for(var e in d)d[e]&&(d[e].ll=SAPI.LatLng(d[e].lat,d[e].lng,SAPI.math.ZM_FACTOR),a.push(d[e]),c++)}return c}function m(a,b){var c=0;if(b&&b!=1){var d,e;for(e in g)if(e>=0)for(d in g[e].Placemark)if(d>=0){var f=g[e].Placemark[d],h=SAPI.LatLng(f.Point.coordinates[1],f.Point.coordinates[0]),i=f.address;a.push({id:d,name:i,type:"geocode",ll:h,addr:"",image:"imgs/icon/blank.gif",url:""}),resultOK=1,c++}}return c}function l(b){a.map.position(b.ll,16)}a.search={};var b=[],c=[],d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,v=0,x=0,y=function(a,b,c,d){clearTimeout(x),c||w(b),c&&(x=setTimeout(function(){w(b)},500))},z=function(){var a=jQuery("#jax_help");a.get(0).style.display!="hidden"&&o()};a.event.listen("map.move",z),a.event.listen("call.search",y)}(SAPI),function(){var a=SAPI.val("conf.basedir"),b=window;if(!a||a=="/")a="http://"+b.location.host+"/";SAPI.val("conf.basedir",a);var c=(b.location.href.search("#")+1||b.location.host.length+9)-1;SAPI.val("conf.pageloc",b.location.href.substr(0,c))}()},SAPI.tearUp()}(),function(){SAPI=window.SAPI||{},SAPI.connectMAPS=function(){(function(a,b){function p(a,b){this.params=a,this.generation=b-1,this.ajax=0,this.start()}function m(a){}b.DomeMaps={version:"1.1"},function(){var b=SAPI.implimentClass("map.position.theme.static",{initialize:function(a){this.up=a},as:function(a){this.up=a},enter:function(){a(this.up.mapDiv).appendTo(this.up.map.getSourceDiv()),this.up.mapDiv.style.position="relative",this.up.mapDiv.style.width="100%",this.up.mapDiv.style.height="100%"},leave:function(){},reposition:function(){this.up.map.mapDivWorkable=1;return!0}}),c=SAPI.implimentClass("map.position.theme.absolute",{Extends:"map.position.theme.static",enter:function(){a(this.up.mapDiv).appendTo(document.body),this.up.mapDiv.style.position="absolute",this.mapDiv=this.up.mapDiv},leave:function(){},getRealOffsetY:function(b){return a(b).offset().top},getRealOffsetX:function(b){return a(b).offset().left},reposition:function(){var b=this.up.map.getSourceDiv(),c=a(b).offset(),d=this.getRealOffsetY(b);this.mapDiv=this.up.mapDiv,this.DivOffset=this.DivOffset||0;if(b.style.display=="none"||b.offsetWidth<10||b.offsetHeight<10||!SAPI.css.isVisible(b))this.mapDiv.style.display!="none"&&(window.console&&console.log("will hide(",this._mapDivId,"):",",D:",b.style.display,",oW:",b.offsetWidth,",oH:",b.offsetHeight,",ROX:",this.getRealOffsetX(b),"||",d,"(",this.paranoicReposition,")<",document.body.clientHeight,":",1),this.mapDiv.style.display="none",this.divDim={w:1,h:1},this._lastDivDim={w:1,h:1},this.up.map.mapDivWorkable=0,this.up.map.tryCloseBalloon(0,!0));else{this.mapDiv.style.display=="none"&&(this.mapDiv.style.display=""),this.up.map.mapDivWorkable||this.up.map.tryRestoreBalloon(0,!0);var e=a(b).offset();this.up.map.mapDivWorkable=1,this.mapDiv.style.top=e.top+this.DivOffset+"px",this.mapDiv.style.left=this.getRealOffsetX(b)+this.DivOffset+"px",this.mapDiv.style.width=this.up.divParams.width(parseInt(b.clientWidth)-this.DivOffset)+"px",this.mapDiv.style.height=this.up.divParams.height(parseInt(b.clientHeight)-this.DivOffset)+"px"}}}),d=SAPI.implimentClass("map.position.fixed",{Extends:"map.position.theme.absolute",enter:function(){d.prototype.superclass.enter.apply(this),this.up.mapDiv.style.position="fixed"},leave:function(){d.prototype.superclass.leave.apply(this)},reposition:function(){d.prototype.superclass.reposition.apply(this),this.up.mapDiv.style.top="0px",this.up.mapDiv.style.left="0px";return!0}}),e=SAPI.implimentClass("map.position.theme.fullscreen",{Extends:"map.position.fixed",enter:function(){e.prototype.superclass.enter.apply(this)},leave:function(){e.prototype.superclass.leave.apply(this)},reposition:function(){e.prototype.superclass.reposition.apply(this);return!0}}),f=SAPI.implimentClass("map.position.policy",{currentState:0,divParams:0,lastDivDim:{},initialize:function(a,b){var c=this;this.divParams={},this.map=a,this.setParams(b);var d=SAPI.bind(function(){this.onReposition()},this);SAPI.event.dom.addEvent("resize",d,!1),SAPI.event.dom.addEventTo(window,"scroll",d,!1),this.checkInterval=setInterval(d,1500),this.map.event.listen("position.policy.set",function(a,b,d){d=d||{},b=="keep"&&(b=this.currentState.name),d.stateName=b,c.setParams(d),c.policyRun()})},setParams:function(a){a=a||{};var b=function(a){return a};"width"in a&&!a.width&&(a.width=b),"height"in a&&!a.height&&(a.height=b),"keep"in this.divParams||(this.divParams={}),this.divParams=SAPI.merge({stateName:"static",width:b,height:b},this.divParams,a)},policyRun:function(){if(this.currentState)if(this.currentState.name!=this.divParams.stateName)this.currentState.theme.leave();else return;this.currentState={name:this.divParams.stateName,theme:SAPI.Class("map.position.theme."+this.divParams.stateName,[this])},this.currentState.theme.enter()},deject:function(){this.mapDiv&&(this.mapDiv.parentNode.removeChild(this.mapDiv),this.mapDiv=0)},inject:function(){this.mapDiv||(this.mapDivId=this.divParams.divId,this.mapWorkerId=this.divParams.divId+"_mapWorker",this.mapDiv=document.createElement("div"),this.mapDiv.className="sapiMapBlocker "+this.divParams.className,this.mapDiv.setAttribute("id",this.mapDivId),this.mapDiv.innerHTML="<div id='"+this.mapWorkerId+"' class='sapiMapWorker' style='width:100%;height:100%;'></div>",this.$mapDiv=a(this.mapDiv)),this.onReposition(),this.policyRun()},relativePane:function(){return this.$mapDiv},tryReposition:function(a){var b=this;clearTimeout(this.tryRepositionTimeout),this.tryRepositionTimeout=setTimeout(function(){try{b.onReposition(a)}catch(c){}},1)},attach:function(){var a=this;this.try_onRepositionDiv()},onReposition:function(b){if(!this.mapDiv||!this.currentState||!this.currentState.theme)return!1;b=b||0;var c=this,d=this.map.getSourceDiv();if(!d||!d.style){this.tryReposition();return!1}var e=this.$mapDiv.offset();if(!isFinite(parseInt(e.left)))return!1;this.currentState.theme.reposition();var e=a(this.mapDiv).offset();this.divDim={w:parseInt(this.mapDiv.clientWidth),h:parseInt(this.mapDiv.clientHeight),x:e.left,y:e.top},this.divDim.validSize=this.divDim.w&&this.divDim.h;var f=this.lastDivDim.w!=this.divDim.w||this.lastDivDim.h!=this.divDim.h||this.lastDivDim.x!=this.divDim.x||this.lastDivDim.y!=this.divDim.y;this.lastDivDim=this.divDim,f&&this.map.onSizeChange(this.divDim);return{dimDim:this.divDim,sizeChange:f}}})}();var c=[],d="map",f="hybrid",g="satelite",h=SAPI.map.LatLng,k=SAPI.map.LatLngBounds,l=function(){this.__reset(),this._position=this.LatLng(55.743545,37.597962),this.workerName=0};l.prototype.spawnOn=function(a){this._tearFunction=0,this.divParams=a,this.$PP=new SAPI.Class(SAPI.val("map.position.policy.default")||"map.position.policy",[this]),this.initialize()},l.prototype.__reset=function(){this.worker=0,this.activated=0,this.isMapReady=0,this.mapDivWorkable=0,this.ZTile=0,this.currentBalloon=0,this._windowInitialLocation=[],this._readyEvents=[],this._initstateEvents=[],this._leavestateEvents=[],this.DivOffset=0,this.layers=[],this.layerDef=[],this._selectedLayers=[],this._eventViewActivation=[],this.divDim={w:0,h:0,x:0,y:0},this._lastDivDim={w:0,h:0,x:0,y:0},this.isActive=0,this.checkInterval=0,this.tryRepositionTimeout=0,this.fullScreenMode=0,this._stages=[],this._stageTimeout=0,this.activeViewLayers=[],this.callZTile_tm=0,this.events_moveend=[],this.events_onmove=[],this.events_dragend=[],this.paranoicReposition=0,this.have_error=0,this.loadingGuardCntErrors=0,this.messageLog=[],this.__initialTime=this.microtime()},l.prototype.echoState=function(b){a(".if_map_jammed",a(this.divParams.blocker)).html(b)},l.prototype.initialize=function(){this.useAbsoluteMapDiv=this.divParams.absolute,this.traceSelfToLocation=1,this.__reset(),SAPI.event.trigger("map.initialize",this),this.__initialState=this._enterState("init-idle"),this.__initialTime=this.microtime()},l.prototype.activate=function(a){this.activated=1,this.selectMapWorker(this.workerName)},l.prototype._inject=function(){this.blockerDiv=SAPI.$(this.divParams.blocker).get(0),this.blockerDivId=this.blockerDiv.id,this.$PP.setParams(this.divParams),this.$PP.inject(),this.mapDiv=this.$PP.mapDiv,this.mapWorkerDiv=document.getElementById(this.$PP.mapWorkerId)},l.prototype._deject=function(){this.$PP.deject()},l.prototype.toggleFullScreen=function(){this.fullScreenMode=this.fullScreenMode?0:1,this.fullScreenMode?this.enterFullscreenMode():this.leaveFullscreenMode(),this.onRepositionDiv()},l.prototype.enterFullscreenMode=function(){this.$PP.fullscreen(!0)},l.prototype.leaveFullscreenMode=function(){this.$PP.fullscreen(!1)},l.prototype.relativePane=function(){return this.$PP.relativePane()},l.prototype.mapPane=function(){return this.worker.getMapPane()},l.prototype.containerOffset=function(){var b=a(this.mapDiv).offset();return{x:b.left,y:b.top}},l.prototype.containerDimensions=function(){return{w:parseInt(this.mapDiv.clientWidth),h:parseInt(this.mapDiv.clientHeight)}},l.prototype.try_onRepositionDiv=function(a){this.$PP.tryReposition(a)},l.prototype.getSourceDiv=function(){return this.blockerDiv},l.prototype.setParanoicReposition=function(a){this.paranoicReposition=a},l.prototype.onRepositionDiv=function(a){var b=this.$PP.onReposition()},l.prototype.onSizeChange=function(a){this.lastDivDim=this.divDim,this.divDim=a;var b=this;if(!!a){var c=0;+a.validSize!=+this.lastDivDim.validSize&&(clearTimeout(this._mapShowingStateTimeout),a.validSize?(this._mapShowingStateTimeout=setTimeout(function(){b.console("map showing",a,b.lastDivDim),b.event.trigger("map.showing",a,b.lastDivDim)},1),c=1):this._mapShowingStateTimeout=setTimeout(function(){b.console("map hiding",a,b.lastDivDim),b.event.trigger("map.hiding",a,b.lastDivDim)},1));if(!this.isMapReady)return;this.event.trigger("map.resize",a),this.console("set dim("+this._mapDivId+") as "+this.divDim.w+"x"+this.divDim.h+" at "+this.divDim.x+":"+this.divDim.y+" of "+this.window_innerHeight()+"/"+document.body.clientHeight),this._lastDivDim={w:this.divDim.w,h:this.divDim.h,x:this.divDim.x,y:this.divDim.y};if(this.worker&&this.isActive){var d=this.worker.getPosition(),e=function(){b.callWorker()&&(b.worker.checkResize(),c||b.setPosition(d,b.getZoom()),b.callZTile())};d&&(clearTimeout(this.onrepositionevent_tm),this.onrepositionevent_tm=SAPI.delay(function(){e()},{tm:1}))}this._onOuterBalloonMove(),SAPI.delay(function(){this._onOuterBalloonMove()},{timeout:100,context:this})}},l.prototype.checkMap=function(){this.onRepositionDiv()},l.prototype.getMinViewDimensions=function(){var a=this.divDim.w,b=this.divDim.h;return a>b?b:a},l.prototype.getViewDimensions=function(){return this.divDim},l.prototype.tearUp=function(a){var b=this;this._tearFunction=a,this.event.listen("map.get.hotlink",function(){return b._getLocationHash.call(b,"","TPLZVWB")}),this.event.listen("map.set.hotlink",function(a,c){return b.applyHotlink.call(b,c)}),this.event.listen("sync",function(a,c){return b.$PP.onReposition()}),this._inject()},l.prototype.tearDown=function(){this.killWorker(),this._deject()},l.prototype.respawn=function(){this.tearDown(),this.initialize(),this._tearFunction?this._tearFunction():this.tearUp()},l.prototype.activateZTile=function(){this.ZTile||(this.ZTile=new q(this),this.ZTile.init(this))},l.prototype._leaveState=function(a){if(!!a){var b=this;a.leave=b.microtime(),b.console("["+a.name+"] took "+(a.leave-a.enter));return a}},l.prototype.__stateLoadingDone=function(){this._stages=[]},l.prototype.__stateException=function(a,b){var c=this._stages.slice(0),d=0;while(d=c.shift())d.leave==0&&d.catcheble&&d.catcheble(a,b)},l.prototype.__callState=function(a){a.func(),this._leaveState(a);if(0)a.error=e,_this.console("state-error ["+a.name+"] "+e.fileName+":"+e.lineNumber+"\n"+e+"\n"+e.stack),_this._leaveState(a),_this.__stateException(a,e)},l.prototype._enterState=function(a,b,c,d){var e={name:a,func:b,enter:this.microtime(),leave:0,catcheble:d},f=this;this.console("entering ["+a+"]"+this._stages.length),this._stages.push(e),b&&(SAPI.clearTimeout(this._stageTimeout),c?f.__callState(e):this._stageTimeout=SAPI.delay(function(){f.__callState(e)},{now:1,context:this}));return e},l.prototype.onElementClick=function(a,b){b&&this.changeLocation(b,"TPZVW")},l.prototype.onParametersChange=function(){this.changeLocation("","TPLZVW")},l.prototype.nextWorker=function(){this.onLoadingGuard(0,"next-break")},l.prototype.onLoadingGuard=function(a,b){var c=0,d=this;this.have_error=1,clearTimeout(this.loadingGuardTm);var e="|error|";if(!!b||!this.isMapReady){b||(e="{timeout}"),d.event.trigger("map.loading.state","scriptfail"),this.loadingGuardCntErrors++,this.console("guard count "+this.loadingGuardCntErrors);if(this.loadingGuardCntErrors>4){this.loadingGuardCntErrors==5&&(this.console("stop try start map "+this.loadingGuardCntErrors),d.event.trigger("map.loading.state","superfatal"));return}var f=this.workerName;this.workerName=SAPI.listNext("map.worker",this.workerName),this.console("guard switch "+e+" to other API ("+f+"-->"+this.workerName+"), error cnt:"+this.loadingGuardCntErrors),this.isMapReady=0,this.__stateLoadingDone(),this.reportError("* "+this.messageLog.join("\n* ")),this.messageLog=[],this.console("change by "+e+" Guarding ("+f+"-->"+this.workerName+")"),this._enterState("reactivate",function(){d.activate()})}},l.prototype.startWorker=function(){var a=this;this.isMapReady=0,this._inject(),this.worker.isClosed=0,this.loadingGuard=this._enterState("loading guard",0,0,function(b,c){a.onLoadingGuard(b,c)}),clearTimeout(this.loadingGuardTm),this.loadingGuardTm=setTimeout(function(){a.onLoadingGuard(0,0)},2e4),a.event.trigger("map.loading.state","start"),this._enterState("init worker "+this.workerName,function(){a.event.trigger("map.loading.state","prestart"),a.worker.init(a.mapWorkerDiv,a),a.event.trigger("map.loading.state","poststart"),a.event.trigger("map.worker.change",a,a.workerName,a.worker.name)})},l.prototype.killWorker=function(){this.isMapReady=0;var a=0;this.event.hold("map.ready"),this.event.trigger("map.down");if(this.worker){var b=this;this._enterState("worker tear down",function(){b.tryCloseBalloon(0,!0),b.ZTile&&b.ZTile.resetObjects();var c=b._leavestateEvents.slice(0);while(a=c.shift())try{a(b)}catch(d){this.console(d)}b.worker.isClosed=1,b.worker.tearDown(),delete b.worker,SAPI.$(b.mapWorkerId).innerHTML=""},1),this.worker=0,this.selectedWorker="",this.isActive=0}clearTimeout(this.callZTile_tm)},l.prototype.selectMapWorker=function(a){a||(a=SAPI.listNext("map.worker",this.workerName));var b=this.workerName==a;this.workerName=a;if(this.activated&&(!this.worker||this.selectedWorker!=a)){this.killWorker();try{this.worker=SAPI.Class("map.worker."+a,[this.mapWorkerDiv,this]),this.startWorker(),this.selectedWorker=a}catch(c){this.worker=0,this.console(c),this.loadingGuard=this._enterState("start "+a+" failed",0,0,function(a,b){_this.onLoadingGuard(a,"break")})}}},l.prototype.onMapReady=function(){var a=this;SAPI.clearTimeout(this.tm_onMapReady),this._enterState("mapReady",function(){a._onMapReady()})},l.prototype._onMapReady=function(){this.isActive=1;var a=this,b=0;this.event.hold("map.ready"),this.mapping=this.worker.mapping,this.activateZTile(),this.ZTile&&this.ZTile.resetObjects(),this.bindEvents(),this.have_error=0,this.onRepositionDiv(),this.setPosition(this._position,this._zoom),this._enterState("onready",function(){while(b=a._readyEvents.shift())b(a)},1);if(!this.have_error){var c=this._initstateEvents.slice(0);this._enterState("stateInit",function(){while(b=c.shift())b(a)},1);if(this.have_error)return;var d=this.layerDef.slice(0);while(b=d.shift())try{b.setMap(this)}catch(e){this.console(e)}if(this.have_error)return;this.positionChanged(),this.callZTile(),this.testMap()||this.console("map lag"),this.__initialState&&(this._leaveState(this.__initialState),this.__initialState=0);if(this.have_error)return;this.isMapReady=1,this.loadingGuardCntErrors=0,this.setMapType(this.mapType),this.setPosition(this.getPosition(),this.getZoom()),this.ZTile.newGeneration(),clearTimeout(this.loadingGuardTm),this._leaveState(this.loadingGuard),this.__stateLoadingDone(),this.event.persistent("map.ready",this),this.event.trigger("map.loading.state","done"),this.tryRestoreBalloon(0,!0)}},l.prototype.callZTile=function(a){clearTimeout(this.callZTile_tm);var b=this;this.callZTile_tm=setTimeout(function(){b.do_callZTile()},a||50)},l.prototype.fixOutzoom=function(){if(this.ZTile&&this.mapDivWorkable&&this.isMapReady){var a=this.getZoom(!0);if(a<2)return!1;var b=this.lastZoom&&this.lastZoom>a+1;if(b){var c=this;SAPI.clearTimeout(this.fixOutzoom_tm),this.fixOutzoom_tm=SAPI.delay(function(){c.ZTile.hideAll(function(){c.callZTile()})},{defered:1});return!1}}return!0},l.prototype.do_callZTile=function(){this.positionChanged()&&this.ZTile&&this.mapDivWorkable&&this.isMapReady&&(this.lastZoom=this.getZoom(),this.ZTile.ZoomOffset=1,this.getMinViewDimensions()>100?this.ZTile.moveend():this.ZTile.hideAll())},l.prototype.bindEvents=function(){var a=this;this.worker.bind2MoveEnd(function(){try{a.fixOutzoom(),SAPI.delay(function(){a.callZTile(),a._onOuterBalloonMove(),a.event.trigger("map.move.ing",a,a.getPosition()),a.event.trigger("map.move.end",a,a.getPosition()),a.dispatchEvents(a.events_moveend)},{now:1}),a._onOuterBalloonMove()}catch(b){a.console(b)}},function(){try{SAPI.delay(function(){a.event.trigger("map.move.ing",a,a.getPosition()),a.dispatchEvents(a.events_onmove)},0),a.callZTile(300),a._onOuterBalloonMove()}catch(b){a.console(b)}},function(){a.disableBalloonOpenAtMouseUp=1;try{a.event.trigger("map.move.drag",a,a.getPosition()),setTimeout(function(){a.dispatchEvents(a.events_dragend),a.disableBalloonOpenAtMouseUp=0},1),a._onOuterBalloonMove()}catch(b){a.console(b)}}),this.worker.bindClick(function(){a.closeBalloon()})},l.prototype.bindClick=function(a){this.worker.bindClick(a)},l.prototype.bind2MoveEnd=function(a,b,c){a&&this.events_moveend.push(a),b&&this.events_onmove.push(b),c&&this.events_dragend.push(c)},l.prototype.dispatchEvents=function(a){var b=a.slice(0),c=0;while(c=b.shift())try{c(this)}catch(d){this.console(d)}},l.prototype.callWorker=function(){return this.worker&&this.isMapReady?!0:!1},l.prototype.geocode=function(a,b,c){c=c||0;return this.worker?this.worker.geocode(a,b,c):!1},l.prototype.onReady=function(a){this._readyEvents.push(a),this.isActive&&a(this)},l.prototype.onStateInit=function(a){this._initstateEvents.push(a),this.isActive&&a(this)},l.prototype.onStateLeave=function(a){this._leavestateEvents.push(a)},l.prototype.setMapType=function(a){var b=this.mapType;this.mapType=a,this.callWorker()&&(this.worker.setMapType(a),this.mapType=this.worker.getMapType()),b!=this.mapType&&this.event.trigger("map.worker.typechange",this,this.mapType),this.onParametersChange()},l.prototype.getMapType=function(){return this.mapType},l.prototype.getWorkerName=function(){return this.worker?this.selectedWorker:""},l.prototype.testMap=function(){if(this.worker&&this.worker.api&&this.worker.getZoom()>0&&this.worker.getPosition())return!0;this.setPosition(this.getPosition(),this.getZoom());return!1},l.prototype.setJump=function(){this.worker.setJump=1},l.prototype.setPosition=function(a,b){a||(a=this.getPosition());var c;a instanceof Function?c=a():c=a.clone(),b=parseInt(b),b=Math.max(1,b||this.getZoom()),this._position=c,this._zoom=b,this.callWorker()&&(this.worker.setPosition(c,b),c.func&&c.func.apply(this))},l.prototype.toBounds=function(a){return this.worker.zoomToBounds(a)},l.prototype.setZoom=function(a){this.setPosition(this.getPosition(),a)},l.prototype.getPosition=function(){return this._position.clone()},l.prototype.getZoom=function(a){if(!a)return this._zoom||0;if(!this.callWorker())return this._zoom||0;this._zoom=this.worker.getZoom();return this._zoom},l.prototype.zoomToPointSet=function(a,b){b=b||16,b=Math.min(17,Math.max(3,b)),this.worker.zoomToPointSet(a,b)},l.prototype.getBounds=function(){var a=this.worker.getBounds();if(!a)return!1;a.equalsTo=function(a){var b=5e-4;return Math.abs(this.x1-a.x1)<=b&&Math.abs(this.x2-a.x2)<=b&&Math.abs(this.y1-a.y1)<=b&&Math.abs(this.y2-a.y2)<=b};return a},l.prototype.getMapBounds=function(){var a=this.getBounds();return new SAPI.map.LatLngBounds(this.LatLng(a.y1,a.x2),this.LatLng(a.y2,a.x1))},l.prototype.setPixelBounds=function(){var a=this.getBounds(),b=this.mapper("fromLatLngToDivPixel",this.LatLng(a.y1,a.x1)),c=this.mapper("fromLatLngToDivPixel",this.LatLng(a.y2,a.x2)),d={left:Math.min(b.left,c.left),top:Math.min(b.top,c.top)},e={left:Math.max(b.left,c.left),top:Math.max(b.top,c.top)};this.__pixelBounds={left:d.left,top:e.top,right:e.left,bottom:d.top,width:e.left-d.left,height:d.top-e.top,0:d,1:e}},l.prototype.getPixelBounds=function(){return this.__pixelBounds},l.prototype.getPixelDimension=function(){var a=this.getPixelBounds();return{left:0,top:0,right:a.right-a.left,bottom:a.bottom-a.top}},l.prototype.positionChanged=function(){if(this.isMapReady&&this.worker&&this.worker.api){var a=this.worker.getPosition(),b=this.worker.getZoom();if(!a||!b)return!1;this._position=a.dup(),this._zoom=b,this.setPixelBounds(),this.onParametersChange()}return 1},l.prototype.LatLng=function(a,b){return new h(a,b)},l.prototype.LLBounds=function(a,b){return new k(a,b)},l.prototype.CollectionBounds=function(a){var b=this.LatLng(a[0].x,a[0].y),c=this.LatLng(a[0].x,a[0].y);a=a.slice(0);while(elem=a.shift())b.x>elem.x&&(b.x=elem.x),b.y>elem.y&&(b.y=elem.y),c.x<elem.x&&(b.x=elem.x),c.y<elem.y&&(b.y=elem.y);return this.LLBounds(b,c)},l.prototype.clearLayersSet=function(){var a;for(a in this.layers)this.layers[a]&&this.disableLayer(a);this.ZTile.clearLayersSet(),this._selectedLayers=[];var b=this;this.ZTile.hideAll(function(){b.callZTile()})},l.prototype.getSelectedLayers=function(){var a=[],b=0,c=0;for(b in this._selectedLayers)this._selectedLayers[b]&&(a.push(this._selectedLayers[b]),c++);if(!c)return!1;return a},l.prototype.allowLayer=function(a,b){this.layers[a]||(this.layers[a]=this.attachLayer(a,b));if(!this.layers[a])return!1;return!0},l.prototype.enableLayer=function(a,b){this.allowLayer(a,b);if(this.layers[a].enable(a))return!0;return!1},l.prototype.disableLayer=function(a){this.layers[a]&&(this.layers[a].disable(a),this._selectedLayers[a]=null,this.getSelectedLayers()||(this._selectedLayers=[]),this.callZTile())},l.prototype.isLayerActive=function(a){return this._selectedLayers[a]==a},l.prototype.Layer=function(a,b){b=b.id_layer||b,a=="toggle"&&(this.isLayerActive(b)?this.disableLayer(b):this.enableLayer(b))},l.prototype.describeLayer=function(b){var c=0;b.idname&&a.each(this.layers,function(a,d){this.idname==b.idname&&(c=this)});if(c)return c;var d=this,e=SAPI.$.extend({},{id_layer:this.layers.length+1,isHidden:!1},b);this.layers[e.id_layer]=e;var f=e.reader();f?(e.reader=SAPI.Class(f.name,f.codes),e.reader.map=e.map=this,e.reader.lup=e):e.reader=0,e.id_name=b.idname||f.name+"-"+e.id_layer;var g="layers."+e.id_name;e.getId=function(){return this.id_layer},e.enable=function(a){a=a||this.id_layer,d.allowLayer(a),this.enabled=1,d.ZTile.enableLayer(a),d.event.trigger(g+".change",a,this),d._selectedLayers[a]=e,d.callZTile();return!0},e.disable=function(a){a=a||this.id_layer,this.enabled=0,d.ZTile.disableLayer(a),delete d._selectedLayers[a],d.callZTile(),d.event.trigger(g+".change",a,this)},e.toggle=function(a){this.enabled?this.disable(a):this.enable(a)},this.event.listen(g+".enable",function(){e.enable()}),this.event.listen(g+".disable",function(){e.disable()});return e},l.prototype.getLayerDef=function(a){return this.layers[a]},l.prototype.filter=function(){var a=this,b=1;return{add:function(c){c.idkey||(c.idkey=b++,c.functor={add:function(){a.ZTile.addFilter(c)},remove:function(){a.ZTile.removeFilter(c)}})},remove:function(a){a.remove()}}},l.prototype.canHandleReposition=function(){return this.ZTile&&this.mapDivWorkable&&this.isMapReady},l.prototype.mapper=function(a,b){if(!this.canHandleReposition()||!this.worker||!this.worker.mapping)return!1;var c=Array.prototype.slice.call(arguments,1);return this.worker.mapping[a].apply(this.worker.mapping,c)},l.prototype.openMapTransaction=function(){this.callWorker()&&this.worker.openTransaction()},l.prototype.closeMapTransaction=function(){this.callWorker()&&this.worker.closeTransaction()},l.prototype.addOverlay=function(a){if(!("_Z_insertid"in a))return this.ZTile.injectObject(a,-1,1);a.map=this;if(!a.worker_storeId){var b=this.activeViewLayers.push(a);a.worker_storeId=b}a.mapAttach(this);var c=this.worker.addOverlay(a);a.reStacked()&&a.reStack(),this.run_eventViewActivation(a);return c},l.prototype.addControl=function(b){if(typeof b=="object"&&b instanceof Array){var c=[],d;while(d=b.shift())c.push(this.addControl(d));return c}b.mapAttach(this);if(b.attachPoint()=="map-relative"){var e=b.getDiv();a(this.relativePane())[0].appendChild(e),b.$render(!0);return b}return this.worker.addControl(b)},l.prototype.removeOverlay=function(a){a.worker_storeId>0&&(this.activeViewLayers[a.worker_storeId-1]=null),this.ZTile.dejectObject(a,-1,1),a.worker_storeId=-1,a.mapDettach&&a.mapDettach(this);return this.worker.removeOverlay(a)},l.prototype.closeBalloon=function(a){a=a||this.currentBalloon;if(a){if(!a.beforeClose())return!1;a.onClose(),a.dejectSelf(this),a==this.currentBalloon&&(this.currentBalloon=0,this.changeLocation())}return!0},l.prototype.openBalloon=function(a,b,c){if(this.currentBalloon&&this.currentBalloon.currentBalloonCaller==c.idKey()){this.tryRestoreBalloon(c);return!1}!this.closeBalloon()||(clearTimeout(this.ballonTimeout),SAPI.delay(function(){this.closeBalloon(),this.currentBalloon=this.createBalloon(a,b,c)},{timeout:10,context:this}))},l.prototype.createBalloon=function(a,b,c){var d=SAPI.Class("map.balloon."+b.ballonWorker());d.currentBalloonCaller=c.idKey(),d.assign(this,b,a,c),d.injectSelf(this),this.changeLocation();return d},l.prototype.tryRestoreBalloon=function(a,b){b=b||0,this.currentBalloon&&(b||this.currentBalloon.opener&&this.currentBalloon.opener.maybeSame(a))&&this.currentBalloon.injectSelf(this)},l.prototype.tryCloseBalloon=function(a,b){b=b||0,this.currentBalloon&&(b||this.currentBalloon.opener&&this.currentBalloon.opener.maybeSame(a))&&this.currentBalloon.dejectSelf(this)},l.prototype.tryResetBalloon=function(a){this.currentBalloon&&(force||this.currentBalloon.opener&&this.currentBalloon.opener.maybeSame(a))&&this.closeBalloon()},l.prototype._onOuterBalloonMove=function(a){a=a||this.currentBalloon,a&&this.isMapReady&&a.positionChanged()},l.prototype.zoomControl=function(a,b){this.worker&&(a?this.worker.enableZoomControl(b):this.worker.disableZoomControl())},l.prototype.getObject=function(a){return this.ZTile.getObject(a)},l.prototype.createMarker=function(a){return this.worker.createMarker(a)},l.prototype.run_eventViewActivation=function(a){var b=0;for(b in this._eventViewActivation)if(this._eventViewActivation[b]){var c=this._eventViewActivation[b](a);c=="close"&&(this._eventViewActivation[b]=null)}},l.prototype.domMouseControl=function(a,b){this.worker&&this.isActive&&this.isMapReady&&this.getWorkerName()=="yandex"&&this.worker.domMouseControl(a,b)},l.prototype.eventViewActivation=function(a){var b=0,c="";for(b in this.activeViewLayers)if(this.activeViewLayers[b]&&this.activeViewLayers[b].object.shown){c=a(this.activeViewLayers[b]);if(c=="close")return}for(b in this._eventViewActivation)if(this._eventViewActivation[b]==a)return;this._eventViewActivation.push(a)},l.prototype.noticeBox=function(a,b){this.event.trigger("notice.box",a,b)},l.prototype.getHotLink=function(){var a={};this.event.forEach("map.get.hotlink",this).Do(function(b,c){a=SAPI.merge(a,c)});return a},l.prototype.applyHotlink=function(b){"latlng"in b&&this.setPosition(h(b.latlng.lat,b.latlng.lng)),"wr"in b&&this.selectMapWorker(b.wr),"t"in b&&this.setMapType(b.t),"z"in b&&this.setZoom(b.z),this.event.listen("map.ready",function(){var c=this;"l"in b&&a.each(b.l,function(a,b){c.event.trigger("layers."+b+".enable")});if("bal"in b){var d="object."+b.bal+".spawn";this.event.listen(d,function(a,b){SAPI.delay(function(){b.innerOpenBallon()},500)})}},this)},l.prototype.changeLocation=function(a,b){clearTimeout(this._changeLocationTm1);var c=this;this._changeLocationTm1=SAPI.delay(function(){c.event.trigger("map.hashchange")},100)},l.prototype.doChangeLocation=function(){var a=_this.getHotLink();_this.event.trigger("map.set.hotlink",a)},l.prototype._getLocationHash=function(b,c){var d=function(a,b){var c="";if(!b)for(g in a)a[g]&&(c&&(c+="&"),c+=g+"="+a[g]);if(b)for(g in a)a[g]&&(c&&(c+=b),c+=a[g]);return c},e=this;if(!this.activated||!this.isMapReady||!this.traceSelfToLocation)return!1;var f={},g;if(c.search(/P/)!=-1){var h=this.getPosition();h&&(f.latlng={lat:Math.round(h.lat()*1e5)/1e5,lng:Math.round(h.lng()*1e5)/1e5})}if(c.search(/W/)!=-1){var i=this.getWorkerName();i&&(f.wr=i)}if(c.search(/T/)!=-1){var i=this.getMapType();i&&(f.t=i)}if(c.search(/Z/)!=-1){var i=this.getZoom();i&&(f.z=i)}if(c.search(/L/)!=-1&&this.getSelectedLayers()){var j=this.getSelectedLayers(),i=[];a.each(j,function(a,b){i.push(b.id_name)}),i&&(f.l=i)}c.search(/B/)!=-1&&this.currentBalloon&&(f.bal=this.currentBalloon.currentBalloonCaller);return f},l.prototype.reportError=function(a){},l.prototype.microtime=function(){return SAPI.microtime()},l.prototype.console=function(a){if(a){var b=Math.round((this.microtime()-this.__initialTime)*100)/100+": "+a;window.console&&console&&console.log(b),this.messageLog.push(b)}},l.prototype.setWindowRef=function(a){this._windowInitialLocation=a},l.prototype.getRealOffsetX=function(a){var b=0,c=a.offsetParent;if(c)while(c&&c.tagName!="BODY")b+=c.offsetLeft,c=c.offsetParent;return b+a.offsetLeft},l.prototype.getRealOffsetY=function(a){var b=0,c=a.offsetParent;if(c)while(c&&c.tagName!="BODY")b+=c.offsetTop,c=c.offsetParent;return b+a.offsetTop},l.prototype.is_visible=function(a){return SAPI.css.isVisible(a)},l.prototype.window_innerHeight=function(){return SAPI.css.windowHeight()},SAPI.nop("map"),function(){var a=SAPI.implimentClass("map.worker.baseMapper",{__listable__:!1,parent:{},pixelBoxes:{},lastZoom:-1,initialize:function(a){this.parent=a},fromLatLng:function(a){},toLatLng:function(a){},fromZoom:function(a){return a},toZoom:function(a){return a},fromLatLngToContainerPixel:function(a){},fromContainerPixelToLatLng:function(a){},fromLatLngToDivPixel:function(a){},fromDivPixelToLatLng:function(a){},latboxtopixel:function(a,b){var c=SAPI.map.LatLng(a.lat()-b.left,a.lng()-b.top),d=SAPI.map.LatLng(a.lat()+b.left,a.lng()+b.top),e=this.fromDivPixelToLatLng(c),f=this.fromDivPixelToLatLng(d);return{left:Math.abs(f.left-e.left),top:Math.abs(f.top-e.top)}},pixelboxtolat:function(a,b){var c=this.parent.getZoom();c!=this.lastZoom&&(this.pixelBoxes={},this.lastZoom=c);var d=Math.round(b.left)+":"+Math.round(b.top);if(this.pixelBoxes[d])return this.pixelBoxes[d];var e=this.fromLatLngToDivPixel(a),f={left:e.left-b.left,top:e.left-b.top},g={left:e.left+b.left,top:e.left+b.top},h=this.fromDivPixelToLatLng(f),i=this.fromDivPixelToLatLng(g),j={left:Math.abs(i.lng()-h.lng()),top:Math.abs(i.lat()-h.lat())};this.pixelBoxes[d]=j;return j}}),b=SAPI.implimentClass("map.worker.base",{__listable__:!1,mapping:"map.worker.baseMapper",name:"is!base!",div:0,driver:0,initMapping:function(){this.mapping=new SAPI.Class(this.mapping,[this])},initialize:function(a,b){this.divHolder=a,this.driver=b,this.event=b.event,this.initMapping()},init:function(a,b){this.divHolder=a,this.driver=b},tearDown:function(){},__init_loadingCycle:function(){},start:function(){},zoomControl:function(){},scrollWheelZoom:function(){},position:function(a,b){return arguments.length>0?this.setPosition(a,b):this.getPosition()},bounds:function(a){return arguments.length>1?this.setBounds(a):this.getBounds()},zoom:function(a){return arguments.length>1?this.setZoom(a):this.getZoom()},createPolygon:function(a){},createMarker:function(a){},addOverlay:function(a){},addControl:function(a){},getOverlayView:function(){},OverlayView:function(a,b){a.layerObject&&a.layerObject.__gen!=this.__generation__&&(a.layerObject.hide(),a.layerObject=0),a.layerObject||(a.layerObject=this.getOverlayView(a,b),a.layerObject.__gen=this.__generation__,a.visibleRenderGen=a.layerObject.__generation__)},removeOverlay:function(a){},unbindOverlays:function(){},openTransaction:function(){},closeTransaction:function(){},mapType:function(){},zoomToPointSet:function(){},zoomToBounds:function(a,b){return this.zoomToPointSet([a.getLT(),a.getRB()])},geocode:function(){},checkResize:function(){},debugError:function(){},onFail:function(){},fromLatLng:function(a){return this.mapping.fromLatLng(a)},toLatLng:function(a){return this.mapping.toLatLng(a)}})}(),function(){function b(a,b,c){this.inmap=a,this.object=b,this.layer=c,this.shown=0}function a(a){this.setMap(a)}SAPI.implimentClass("map.worker.Google.mapping",{Extends:"map.worker.baseMapper",fromLatLng:function(a){return new google.maps.LatLng(a.getLat(),a.getLng())},toLatLng:function(a){return SAPI.map.LatLng(a.lat(),a.lng())},toPoint:function(a){return{left:a.x,top:a.y}},fromPoint:function(a){return{x:a.left,y:a.top}},modPointByOffset:function(a,b){var c=this.parent.api.getBounds(),d=this.parent.getProjection(),e=d.fromLatLngToDivPixel(c.getSouthWest()),f=d.fromLatLngToDivPixel(c.getNorthEast());return{left:a.left-e.x*b,top:a.top-f.y*b}},fromLatLngToContainerPixel:function(a){var b=this.fromLatLngToDivPixel(a);return this.modPointByOffset(b,1)},fromContainerPixelToLatLng:function(a){var b=this.modPointByOffset(a,-1);return this.fromDivPixelToLatLng(b)},fromLatLngToDivPixel:function(a){var b=this.parent.getProjection();if(!b)return{left:0,top:0};return this.toPoint(b.fromLatLngToDivPixel(this.fromLatLng(a)))},fromDivPixelToLatLng:function(a){var b=this.parent.getProjection();if(!b)return{x:0,y:0};return this.toLatLng(b.fromDivPixelToLatLng(this.fromPoint(a)))}});var c=function(a){this.polygon=0,this.map=a,this.events={}},e=SAPI.implimentClass("map.worker.Google",{__listable__:!0,name:"google",shownName:"Google",descriptions:"РєР°СЂС‚С‹ РѕС‚ Google",mapping:"map.worker.Google.mapping",Extends:"map.worker.base",initialize:function(a,b){e.prototype.superclass.initialize.call(this,a,b),this.api=0,this.helperOverlay=0},init:function(){e.prototype.superclass.init.apply(this,arguments);var a=this;this.loadingState=this.driver._enterState("google script-load"),this.__loadingTm=0;var b=0,c=SAPI.jsonp.createCallback("gmaps_load",function(){b.next()});SAPI.chain({seq:[function(d){b=this,!window.google||!window.google.maps||!window.google.maps.Map?(a.event.trigger("map.loading.state","scriptload"),SAPI.addScript("http://maps.google.com/maps/api/js?sensor=true&callback="+c,{once:!0,callback:function(){window.google||a.driver.onLoadingGuard(0,"script-load failed")}})):this.next()},function(){this.destroyed||(a.driver._leaveState(a.loadingState),a.driver._enterState("google start",function(){a.event.trigger("map.loading.state","spawn"),a.start()},0))},function(){a.driver.console("gmap load - done")}]}).run()},soIfail:function(a){this.tryScanErrors(),this.driver._enterState("google fail "+a,function(){letswitchtoohterapi()})},start:function(){var b={zoom:this.driver.getZoom(),center:this.fromLatLng(this.driver.getPosition()),mapTypeId:this.decodeMapType(this.driver.getMapType()),disableDefaultUI:!0,scrollwheel:!1},c=this;this.api=new google.maps.Map(this.divHolder,b),this.helperOverlay=0;var d=this;this.startIniter=0,this.initViewOverlay(),this.loadingState=this.driver._enterState("google centering");var e=this.driver.getPosition();e&&e.func&&e.func.apply(this.driver),this.loadingState=this.driver._enterState("google pane tear "),this.helperOverlay=new a(this.api),this.helperOverlay.setMap(this.api),this.helperOverlay.draw()},doStartInit:function(){this.driver._leaveState(this.loadingState),this.startIniter&&google.maps.event.removeListener(this.startIniter);var a=this.driver.getPosition();a&&a.func&&a.func.apply(this.driver),this.driver.onMapReady()},tearDown:function(){clearTimeout(this.__loadingTm),this.unbindOverlays(),this.api&&(google.maps.event.clearInstanceListeners(this.api),delete this.api,this.api=0),this.destroyed=1},enableZoomControl:function(a){var b={navigationControl:!0,navigationControlOptions:{style:a.type=="small"?google.maps.NavigationControlStyle.SMALL:google.maps.NavigationControlStyle.DEFAULT}};if(a.origin){switch(a.origin){case"TOPLEFT":a.origin=google.maps.ControlPosition.TOP_LEFT;break;case"TOPRIGHT":a.origin=google.maps.ControlPosition.TOP_RIGHT;break;case"BOTTOMLEFT":a.origin=google.maps.ControlPosition.BOTTOM_LEFT;break;case"BOTTOMRIGHT":a.origin=google.maps.ControlPosition.BOTTOM_RIGHT}b.navigationControlOptions.position=a.origin}this.api.setOptions(b)},disableZoomControl:function(){var a={navigationControl:!1};this.api.setOptions(a)},getZoom:function(){if(!this.api)return!1;return this.api.getZoom()},setZoom:function(a){if(!this.api)return!1;a&&this.api.setZoom(a);return!0},setPosition:function(a,b){if(!!this.api){this.setZoom(b);var c=this.mapping.fromLatLng(a),d=this.mapping.fromLatLngToDivPixel(a),e=this.mapping.fromLatLngToDivPixel(this.getPosition());this.setJump||Math.abs(d.left-e.left)>1024||Math.abs(d.top-e.top)>1024?this.api.setCenter(c):this.api.panTo(c),this.setJump=0}},getPosition:function(){if(!this.api)return!1;return this.mapping.toLatLng(this.api.getCenter())},getBounds:function(){if(!this.api)return!1;var a=this.api.getBounds();if(!a)return!1;var b=a.getSouthWest(),c=a.getNorthEast();return{x1:b.lng(),y1:b.lat(),x2:c.lng(),y2:c.lat()}},decodeMapType:function(a){var b=google.maps.MapTypeId.ROADMAP;a==d&&(b=google.maps.MapTypeId.ROADMAP),a==f&&(b=google.maps.MapTypeId.HYBRID),a==g&&(b=google.maps.MapTypeId.SATELLITE);return b},setMapType:function(a){var b=this.decodeMapType(a);this.api.setMapTypeId(b)},getMapType:function(){var a=this.api.getMapTypeId();if(a==google.maps.MapTypeId.ROADMAP)return d;if(a==google.maps.MapTypeId.HYBRID)return f;if(a==google.maps.MapTypeId.SATELLITE)return g;return d},zoomToPointSet:function(a,b){var c=[],d=a.slice(0),e=0;while(e=d.shift())e&&c.push(this.fromLatLng(e));var f=c.slice(0);e=f.shift();var g=new google.maps.LatLngBounds(e,e);while(e=c.shift())e&&g.extend(e);this.api.fitBounds(g),b&&this.api.getZoom()>b&&this.api.setZoom(b),SAPI.delay(function(){this.driver.positionChanged()},{obj:this})},geocode:function(a,b,c){if(!this.api)b.fail&&b.fail(a,c);else{var d=this,e=new google.maps.Geocoder;c=c||0;var f={};a.x?f={location:this.fromLatLng(a)}:f={address:a},e.geocode(f,function(e,f){if(f==google.maps.GeocoderStatus.OK){if(b.geocode){var g=e[0],h={},i={},j;for(j in g.address_components){var k=g.address_components[j];i[k.types[0]]=k.long_name}h.addr=g.formatted_address,h.country=i.country,h.region=i.administrative_area_level_1,h.city=i.locality,h.adm1=i.administrative_area_level_2,h.adm2=i.administrative_area_level_3,h.street=i.route,h.bld=i.street_address,b.geocode(h);return}if(b.success){var l=[];for(var j in e)l.push({point:d.toLatLng(e[j].geometry.location),accuracy:e[j].geometry.location_type==google.maps.GeocoderLocationType.ROOFTOP,addr:e[j].formatted_address,searching:a,key:c});b.success(l)}}else b.fail&&b.fail(a,c)})}},bind2MoveEnd:function(a,b,c){google.maps.event.addListener(this.api,"idle",a),google.maps.event.addListener(this.api,"dragend",a),google.maps.event.addListener(this.api,"dragend",c),google.maps.event.addListener(this.api,"drag",b)},bindClick:function(a,b){var c=this;b&&b.efor=="google"&&google.maps.event.removeListener(b.event);return{efor:"google",event:google.maps.event.addListener(this.api,"click",function(b){a(c.toLatLng(b.latLng))})}},getPane:function(a){if(!this.helperOverlay||typeof this.helperOverlay.getPanes!="function")return!1;var b=this.helperOverlay.getPanes();return b},getProjection:function(){if(this.helperOverlay)return this.helperOverlay.getProjection();return!1},checkResize:function(){this.api&&google.maps.event.trigger(this.api,"resize")},disableScrollWheelZoom:function(){this.api.setOptions({scrollwheel:!1})},enableScrollWheelZoom:function(){this.api.setOptions({scrollwheel:!0})},openTransaction:function(){this.getPane()&&(this.objectcontainer=this.getPane().floatPane),this.objectcontainer&&(this.objectcontainer.style.display="none",this.objectcontainer.style.visibility="hidden")},closeTransaction:function(){this.objectcontainer&&(this.objectcontainer.style.display="",this.objectcontainer.style.visibility="")},createPolygon:function(a){var b=new c(this);a.attach(b)},createMarker:function(a){function c(a){this.driverMarker=a,this.setPosition=function(c){a.setPosition(b.fromLatLng(c))},this.getPosition=function(){return b.toLatLng(a.getPosition())},this.tearDown=function(){a.setMap(null)}}var b=this,d=a.icon;d.origin=d.origin||{x:0,y:0};var e={map:this.api,position:this.fromLatLng(a.position),title:a.title,icon:new google.maps.MarkerImage(d.url,new google.maps.Size(d.size.w,d.size.h),new google.maps.Point(d.origin.x,d.origin.y),new google.maps.Point(d.anchor.x,d.anchor.y)),draggable:a.draggable?!0:!1},f=new google.maps.Marker(e);a.events&&a.events.dragEnd&&google.maps.event.addListener(f,"dragend",a.events.dragEnd);return new c(f)},getOverlayView:function(a,c){return new b(this,a,c)},getMapPane:function(){return this.getPane().floatPane},addOverlay:function(a){if(a.isPolygon)return this.createPolygon(a);this.OverlayView(a,this.getPane().floatPane),a.layerObject&&a.layerObject.show();return a},addControl:function(a){this.OverlayView(a,this.api.getDiv()),a.layerObject&&a.layerObject.show();return a},removeOverlay:function(a){a.layerObject&&a.layerObject.hide&&a.layerObject.hide()},initViewOverlay:function(){var c=this;b.prototype=new google.maps.OverlayView,b.prototype.onAdd=function(a,b){this.object.init(this.inmap),this.object.getDiv().parentNode!=this.layer&&this.layer.appendChild(this.object.getDiv()),this.object.initView(),this.draw();return this.object.getDiv()},b.prototype.draw=function(a,b){this.shown||this.object.$render(!0),this.object.setPosition()},b.prototype.onRemove=function(a,b){if(this.shown){this.shown=0;return this.object.remove()}return!1},b.prototype.show=function(){this.object.getDiv()||this.onAdd(this.inmap,0),this.shown||(this.setMap(this.inmap.api),this.draw()),this.object.setPosition(),this.shown=1},b.prototype.hide=function(){this.onRemove(),this.setMap(null)},a.prototype=new google.maps.OverlayView,a.prototype.draw=function(){this.ready||(google.maps.event.trigger(this,"ready"),this.ready=!0,this.tearMapOn(0))},a.prototype.tearMapOn=function(a){if(this.getPanes())c.driver._enterState("google-doStartInit - "+a,function(){c.doStartInit()});else{var b=this;SAPI.delay(function(){b.tearMapOn(++a)},{now:1})}}}});c.prototype.attach=function(){},c.prototype.draw=function(a){this.dettach();var b=[];for(i in a.coords)b=this.map.fromLatLng(a.coords[i]);var c={fillColor:a.fill,strokeColor:a.border,strokeWidth:1,map:this.map,paths:b};a.style=="border"?this.polygon=this.map.api.Polygon(c):this.polygon=this.map.api.Polyline(c),this.polygon.setMap(this.map.api),this.events.click=google.maps.event.addListener(this.polygon,"click",function(b,c,d){a.onClick()}),this.events.mouseover=google.maps.event.addListener(this.polygon,"mouseover",function(b,c,d){a.onMouseOver()}),this.events.mouseout=google.maps.event.addListener(this.polygon,"mouseout",function(b,c,d){a.onMouseOut()})},c.prototype.dettach=function(){this.polygon&&(this.map.api.removeOverlay(this.polygon),this.polygon=0);var a;for(a in this.events)this.events[a].cleanup();this.events=[]}}(),function(){SAPI.implimentClass("map.worker.Yandex.mapping",{Extends:"map.worker.baseMapper",fromLatLng:function(a){return new YMaps.GeoPoint(a.lng(),a.lat())},toLatLng:function(a){return SAPI.map.LatLng(a.getLat(),a.getLng())},GP2YA:function(a){return new YMaps.Point(a.left,a.top)},toPoint:function(a){return{left:a.x,top:a.y}},fromPoint:function(a){return{x:a.left,y:a.top}},fromLatLngToContainerPixel:function(a){var b=this.fromLatLng(a);return this.toPoint(this.parent.api.converter.coordinatesToLocalPixels(b))},fromContainerPixelToLatLng:function(a){return this.toLatLng(this.parent.api.converter.localPixelsToCoordinates(this.GP2YA(a)))},fromLatLngToDivPixel:function(a){var b=this.fromLatLng(a);return this.toPoint(this.parent.api.converter.coordinatesToMapPixels(b))},fromDivPixelToLatLng:function(a){return this.toLatLng(this.parent.api.converter.mapPixelsToCoordinates(this.GP2YA(a)))}});var a=0,b=0,c=SAPI.implimentClass("map.worker.Yandex",{__listable__:!0,name:"yandex",shownName:"Яндекс",descriptions:"Карты от maps.yandex.ru",mapping:"map.worker.Yandex.mapping",Extends:"map.worker.base",initialize:function(a,b){c.prototype.superclass.initialize.call(this,a,b),this.api=0,this.helperOverlay=0},init:function(){c.prototype.superclass.init.apply(this,arguments);var a=this;this.loadingState=this.driver._enterState("yandex script-load"),this.__loadingTm=0;var b=0,d=SAPI.jsonp.createCallback("ymaps_load",function(){b.next()}),e=SAPI.jsonp.createCallback("ymaps_fail",function(c){SAPI.console.error(c),b.breakit(),a.driver.nextWorker()});b=SAPI.chain({ticked:1,seq:[function(c){b=this,!window.YMaps||!window.YMaps.Map?(a.event.trigger("map.loading.state","scriptload1"),SAPI.addScript("http://api-maps.yandex.ru/1.1/index.xml?loadByRequire=1&key="+SAPI.val("map.keys.yandex")+"&onerror="+e,{once:!0,callback:function(){b.next()}})):b.next()},function(){if(!a.destroyed){if(!window.YMaps){a.driver.onLoadingGuard(0,"script-load failed");return}a.driver.console("scriptloaded"),window.YMaps.Map?b.next():(a.event.trigger("map.loading.state","scriptload2"),YMaps.load(function(){a.driver.console("scriptloaded-inner"),b.next()}))}},function(){a.destroyed||(a.event.trigger("map.loading.state","spawn"),a.driver.console("startingmaps"),a.driver._leaveState(a.loadingState),a.driver._enterState("yandex start",function(){a.start()},0))},function(){a.driver.console("yandex load - done")}]}).run()},soIfail:function(a){this.tryScanErrors(),this.driver._enterState("yandex fail "+a,function(){letswitchtoohterapi()})},start:function(){this.driver._leaveState(this.loadState),this.api=new YMaps.Map(this.divHolder,{propagateEvents:!0});var a=this.driver.getPosition();a&&a.func&&a.func.apply(this.driver);var b=new SAPI.Class("map.effect.guidePoint",[{className:"guideStar",effect:"bounce",point:a,name:""}]);this.driver.addOverlay(b),SAPI.delay(function(){this.driver.removeOverlay(b)},{timeout:13,context:this}),this.driver.onMapReady()},tearDown:function(){clearTimeout(this.__loadingTm),this.api&&(this.api.removeAllOverlays(),this.api.destructor()),this.destroyed=1,this.api=0},enableZoomControl:function(a){if(!this.ctrl_zoomControl){if(a.origin)switch(a.origin){case"TOPLEFT":a.origin=YMaps.ControlPosition.TOP_LEFT;break;case"TOPRIGHT":a.origin=YMaps.ControlPosition.TOP_RIGHT;break;case"BOTTOMLEFT":a.origin=YMaps.ControlPosition.BOTTOM_LEFT;break;case"BOTTOMRIGHT":a.origin=YMaps.ControlPosition.BOTTOM_RIGHT}var b=new YMaps.ControlPosition(a.origin||YMaps.ControlPosition.TOP_LEFT,new YMaps.Point(a.left||10,a.top||10));a.type=="small"?this.ctrl_zoomControl=new YMaps.SmallZoom({noTips:!0}):this.ctrl_zoomControl=new YMaps.Zoom({noTips:!0}),this.api.addControl(this.ctrl_zoomControl,b)}},disableZoomControl:function(){this.ctrl_zoomControl||(this.api.removeControl(this.ctrl_zoomControl),this.ctrl_zoomControl=0,delete this.ctrl_zoomControl)},setPosition:function(a,b){if(!!this.api)if(b==this.api.getZoom()){var c=this.api.converter.coordinatesToLocalPixels(this.fromLatLng(a)),d=this.api.converter.coordinatesToLocalPixels(this.api.getCenter()),e=new YMaps.Point(c.x-d.x,c.y-d.y);this.setJump||Math.abs(e.x)>512||Math.abs(e.y)>512?this.api.setCenter(this.fromLatLng(a),b):this.api.moveBy(e,!0),this.setJump=0}else this.api.setCenter(this.fromLatLng(a),b)},getPosition:function(){return this.toLatLng(this.api.getCenter())},getZoom:function(){return this.api.getZoom()},getBounds:function(){if(!this.api)return!1;var a=this.api.getBounds();if(!a)return!1;var b=a.getLeftBottom(),c=a.getRightTop();return{x1:b.getLng(),y1:b.getLat(),x2:c.getLng(),y2:c.getLat()}},setMapType:function(a){var b=YMaps.MapType.MAP;a==d&&(b=YMaps.MapType.MAP),a==f&&(b=YMaps.MapType.HYBRID),a==g&&(b=YMaps.MapType.SATELLITE),this.api.setType(b)},getMapType:function(){var a=this.api.getType();if(a==YMaps.MapType.MAP)return d;if(a==YMaps.MapType.HYBRID)return f;if(a==YMaps.MapType.SATELLITE)return g;return d},zoomToPointSet:function(a,b){b=b||18;var c=[],d=a.slice(0),e;while(e=d.shift())e&&c.push(this.fromLatLng(e));var f=new YMaps.GeoCollectionBounds(c);this.api.setCenter(f.getCenter(),Math.min(b,f.getMapZoom(this.api))),this.driver.positionChanged()},geocode:function(a,b,c){if(!this.api)b.fail&&b.fail(a,c);else{a.x&&(a=this.fromLatLng(a));var d=0,e={boundedBy:this.api.getBounds()};if(a.indexOf("Москва, ")>=0){var f=new YMaps.GeoBounds(new YMaps.GeoPoint(37.13268871914181,55.55945544545429),new YMaps.GeoPoint(38.085747336675574,55.946698202860325));e=SAPI.merge(e,{boundedBy:f,strictBounds:!0})}d=new YMaps.Geocoder(a,e);var g=this;c=c||0,YMaps.Events.observe(d,d.Events.Load,function(){var d=this.length();if(this.length()){var e=this.get(0).precision;if(b.geocode){var f=this.get(0),h={},i=function(a){var b;for(b in a)b&&a[b]&&a[b][b+"Name"]&&(a[b].n=a[b][b+"Name"],h[b]=a[b]),typeof a[b]=="object"&&i(a[b])},j=f.AddressDetails;i(j);var k={};k.addr=f.text,k.country=h.Country.n,k.region=h.AdministrativeArea?h.AdministrativeArea.n:h.Locality.n,k.adm1=h.SubAdministrativeArea?h.SubAdministrativeArea.n:"",k.city=h.Locality.n,k.street=h.Thoroughfare?h.Thoroughfare.n:"",k.bld=h.Thoroughfare&&h.Thoroughfare.Premise?h.Thoroughfare.Premise.PremiseNumber:"",b.geocode(k);return}if(e=="exact"||e=="number"||e=="near"||e=="street"||e=="other"){var l=[];for(var m=0;m<d;++m){var n=this.get(m).getGeoPoint();l.push({point:g.toLatLng(n),accuracy:e=="number"||e=="exact"||e=="near",addr:this.get(m).text,searching:a,key:c})}b.success&&b.success(l)}else b.fail&&b.fail(a,c)}else b.fail&&b.fail(a,c)})}},bind2MoveEnd:function(a,b,c){var d=this;YMaps.Events.observe(this.api,this.api.Events.Update,a),YMaps.Events.observe(this.api,this.api.Events.MoveEnd,a),YMaps.Events.observe(this.api,this.api.Events.Move,b),YMaps.Events.observe(this.api,this.api.Events.DragEnd,c)},bindClick:function(a,b){var c=this;b&&b.efor=="yandex"&&b.event.cleanup();return{efor:"yandex",event:YMaps.Events.observe(this.api,this.api.Events.Click,function(b,d,e){a(c.toLatLng(d.getCoordPoint()))})}},getPane:function(a){return this.api.getContainer()},checkResize:function(){this.api&&this.api.redraw(!0)},disableScrollWheelZoom:function(){this.api.disableScrollZoom()},enableScrollWheelZoom:function(){this.api.enableScrollZoom()},openTransaction:function(){this.objectcontainer&&(this.objectcontainer.style.display="none",this.objectcontainer.style.visibility="hidden",this.detachCountainer=0,this.detachCountainer&&this.detachCountainer.removeChild(this.objectcontainer)),this.trans_open=this.driver.microtime()},closeTransaction:function(){this.objectcontainer&&(this.detachCountainer&&this.detachCountainer.appendChild(this.objectcontainer),this.objectcontainer.style.display="",this.objectcontainer.style.visibility=""),this.trans_close=this.driver.microtime()},createMarker:function(a){function c(a){this.driverMarker=a,this.setPosition=function(c){a.setGeoPoint(b.fromLatLng(c))},this.getPosition=function(){return b.toLatLng(a.getGeoPoint())},this.tearDown=function(){b.api.removeOverlay(a)}}var b=this,d=a.icon,e=new YMaps.Style;e.iconStyle=new YMaps.IconStyle,e.iconStyle.href=d.url,e.iconStyle.size=new YMaps.Point(d.size.w,d.size.h),e.iconStyle.offset=new YMaps.Point(-d.anchor.x,-d.anchor.y);var f={style:e,title:a.title,draggable:a.draggable?!0:!1},g=new YMaps.Placemark(this.fromLatLng(a.position),f);this.api.addOverlay(g),a.events&&a.events.dragEnd&&YMaps.Events.observe(g,g.Events.DragEnd,a.events.dragEnd);return new c(g)},createPolygon:function(b){var c=new a(this);b.attach(c)},getOverlayView:function(a,c){return new b(this,a,c)},getMapPane:function(){return this.lastContainer},addOverlay:function(a){if(a.isPolygon)return this.createPolygon(a);this.OverlayView(a,0),this.api.addOverlay(a.layerObject);return a},addControl:function(a){this.OverlayView(a,this.api.getContainer()),a.layerObject.container=this.api.getContainer(),this.api.addControl(a.layerObject)},removeOverlay:function(a){this.api.removeOverlay(a.layerObject)}});b=function(a,b){this.inmap=a,this.object=b,this.shown=0,this.container=0},b.prototype.onAddToMap=function(a,b){this.object.init(a),b&&(this.inmap.lastContainer=b),this.container?b=this.container:this.inmap.objectcontainer=b,this.object.initView();if(!this.shown){var c=this.object.getDiv();b.appendChild(c)}this.onMapUpdate(a),this.shown=1;return this.object.getDiv()},b.prototype.onMapUpdate=function(a,b){this.shown||this.object.$render(!0),this.object.setPosition()},b.prototype.hide=function(){this.shown=0;return this.object.remove()},b.prototype.onRemoveFromMap=function(a,b){return this.hide()},a=function(a){this.polygon=0,this.map=a,this.events={}},a.prototype.attach=function(){},a.prototype.draw=function(a){this.dettach();var b=[];for(i in a.coords)b=this.map.fromLatLng(a.coords[i]);var c={style:{polygonStyle:{outline:!0,strokeWidth:1,strokeColor:a.border,fillColor:a.fill}}};a.style=="border"?this.polygon=YMaps.Polygon(b,c):this.polygon=YMaps.Polyline(b,c),this.map.api.addOverlay(this.polygon),this.events.click=YMaps.Events.observe(this.polygon,this.polygon.Events.Click,function(b,c,d){a.onClick()}),this.events.mouseover=YMaps.Events.observe(this.polygon,this.polygon.Events.MouseEnter,function(b,c,d){a.onMouseOver()}),this.events.mouseout=YMaps.Events.observe(this.polygon,this.polygon.Events.MouseLeave,function(b,c,d){a.onMouseOut()})},a.prototype.dettach=function(){this.polygon&&(this.map.api.removeOverlay(this.polygon),this.polygon=0);var a;for(a in this.events)this.events[a].cleanup();this.events=[]}}();var n=1e6;m.prototype.init=function(a){this.map=a,this.nav_objects=[],this.objects_lookup={},this.nav_block_index={},this.nav_layers=[],this.objects_to_hide=[],this.objects_to_show=[],this.readerRequest=[],this.new_objects=[],this.render_objects=[],this.active_render=[],this.thisBounds={},this.layerEvents={},this.NowRequestingCnt=0,this.realrender={},this.LIMIT_OBJECTS=200,this.ZTILE_RENDER_LIMIT=55,this.RENDER_TIME_STEP=0,this.layerSet=[],this.hiddenPresetLayers={},this.layerEvents=[],this.widthDivCounter=11,this.objectUsageCounter=1,this.ts_queryRender=0,this.ts_queryRender2=0,this.requestTimeShift=300,this.allowBlockRequests=1,this.allowSortRender=1,this._collapceCounter=0,this.ZoomOffset=0,this._tiledebug=0,this.zBurstLimit=4,this.renderHide_tm=0,this.hideAll_Tm=0,this.inqueryRenderCnt=0,this.generationCounter=0,this._newObjectsCnt=0,this.renderPipeline={},this.visiblePipeline={},this.objectHashCounter=0,this.y_consar=[-85051128,-83979259,-82676284,-81093213,-79171334,-76840816,-74019543,-70612614,-66513260,-61606396,-55776579,-48922499,-40979898,-31952162,-21943045,-11178401,0,11178401,21943045,31952162,40979898,48922499,55776579,61606396,66513260,70612614,74019543,76840816,79171334,81093213,82676284,83979259,85051128],this.absoluteObjectCounter=0,this.config_TimeredLoad=1,this.injectDirrectObject=1,this.dirrectObjects={},this.filterCascade={},this.cluster=SAPI.Class("map.cluster.manager");var b=this;this.map.event.listen("cluster.type.add",function(a,c){b.cluster.assignType(c)}),this.map.event.listen("ztile.newGeneration",function(a,c){b.resetObjects(),b.redraw()}),this.map.event.listen("ztile.dropData",function(a,c){b._dropingObjects=1,b.newGeneration(),b.in_queryRender(!0),b._dropingObjects=0;while(b.tickRender());b.nav_block_index={};var d=[],e=[];SAPI.each(b.dirrectObjects,function(a,c){d[a]=c,e[c]=b.nav_objects[c]}),b.nav_objects=e,b.objects_lookup=d,b.in_queryRender(!0)}),this.map.event.listen("ztile.updateSector",function(a,c,d){b.nav_block_index={}}),this.map.event.listen("ztile.getVisibleObjects",function(a){return b.getVisibleObjects()}),this.counterIncremental=1},m.prototype.getVisibleObjects=function(){var a=this.nav_objects,b=[];SAPI.each(this.visiblePipeline,function(c,d){b.push(a[c])});return b},m.prototype.newGeneration=function(){this.generationCounter++},m.prototype.currentGeneration=function(){return this.generationCounter},m.prototype.redraw=function(){clearTimeout(this.newGeneration_tm),this.newGeneration_tm=SAPI.delay(function(){this.newGeneration(),this.checkObjects(),this.queryRender()},{now:1,context:this})},m.prototype.clearLayersSet=function(){this.layerSet=[],this.checkObjects(),this.queryRender()},m.prototype.enableLayer=function(a,b){b=typeof b=="undefined"?1:b;var c=b?a:0;if(this.layerSet[a]!=c){this.layerSet[a]=c;var d=[];for(var e in this.layerSet)this.layerSet[e]==e&&(d[e]=e);this.layerSet=d,this.hiddenPresetLayers[a]=this.map.getLayerDef(a).isHidden,this.redraw()}},m.prototype.disableLayer=function(a,b){this.enableLayer(a,0)},m.prototype.checkObjects=function(){this.applyFilter()};var o=0;m.prototype.dejectObject=function(a){var b=a.idKey(),c=this.objects_lookup[b];this.nav_objects[c]&&this.nav_objects[c]._isDirrect&&(delete this.objects_lookup[b],delete this.nav_objects[c],delete this.dirrectObjects[b])},m.prototype.injectObject=function(a,b,c){var d=this;this.absoluteObjectCounter++;var e=a.idKey(),f={ID_MAP_OBJECT:e};f.counterIncremental=this.counterIncremental++,f.layers={},f.stacked=[],f.stackedBefore=0,f.stackCNT=0,f.reStack=0,f.generation=this.currentGeneration(),f.updateGeneration=function(){d.redraw()},f.relativeCounter||(f.relativeCounter=0),f.storedCapacity||(f.storedCapacity=parseFloat(f.CNT||1)),f.shown=0,f.map_object=0,f.randWeight=this.absoluteObjectCounter,f.stackgroup=0,f.zbase=this,a._Z_insertid=this.absoluteObjectCounter,this.nav_objects.push(f);var g=this.nav_objects.length-1;this.objects_lookup[e]=g,this.new_objects[g]=g,f.ID_Z_INDEX=g,this._newObjectsCnt++,a.setObject(this.map,f),a.syncZ(),b==35&&!(o++>100),a.layers().add(b),f._enabled=1,this.checkObject(f),this.injectDirrectObject&&(this.dirrectObjects[e]=g,f._isDirrect=1,this.redraw()),this.queryFilter(),this.queryRender();return f},m.prototype.queryFilter=function(a){clearTimeout(this.tm_queryFilter),this.tm_queryFilter=SAPI.delay(function(){this.applyFilter(a)},{now:1,context:this})},m.prototype.applyFilter=function(a){var b,c=this.getFilterCascade();if(!c)return!1;var d=0;a=a||this.nav_objects,SAPI.each(a,function(a,b){d+=c(b)}),d&&(this.newGeneration(),this.queryRender())},m.prototype.addFilter=function(a){this.filterCascade[a.idkey]=a,this.queryFilter();return a},m.prototype.removeFilter=function(a){delete this.filterCascade[a.idkey],this.queryFilter();return a},m.prototype.getFilterCascade=function(){var a=this;return function(b){var c,d=0,e=0;for(c in a.filterCascade){var f=a.filterCascade[c],g=f.filter(b.parentContainer);if(g){e++;if("result"in g&&b._enabled!=g.result){g.result=b.maxLayer.filter(g.result,b);if(b._enabled!=g.result){b._enabled=g.result;g.change=1}}d+=+(g.change||0)}}e||b._enabled||(d++,b._enabled=1);return d}},m.prototype.checkObject=function(a){var b=0;for(j in this.layerSet)if(a.layers[j]){b=1;break}var c=b||a.forceShow;a.layerEnabled!=c&&(a.generation=this.currentGeneration()),a.layerEnabled=c},m.prototype.getObjects=function(){return this.nav_objects.split(0)},m.prototype.getObject=function(a){return this.nav_objects[a]},m.prototype.dirrectAccess=function(){return this.nav_objects},m.prototype.decodeNavBlock=function(a,b,c){return a},m.prototype.preprocessData=function(a,b){return a.mapreq?a:{mapreq:{0:a}}},m.prototype.loadDataLine=function(a,b){var c=this;c.injectDirrectObject=0,c.__in_loadDataLine(a,b),c.injectDirrectObject=1},m.prototype.onLoadingLayer=function(a,b){var c=a.layer,d=a.z,e=b.z||a.addr;b.whatever&&(e="",b.final=1);if(!this.nav_block_index[e]){var f=r.tileArea(e);this.nav_block_index[e]={},this.nav_block_index[e].zoom=e.length,this.nav_block_index[e].area=f}this.nav_block_index[e][c]||(this.nav_block_index[e][c]={id:c},this.nav_block_index[e][c].objects=[]);var g=this.nav_block_index[e][c];g.isFinal=0;return g},m.prototype.__in_loadDataLine=function(a,b){var c,d=this.getBounds();this.newGeneration();var e=0,f=this.onLoadingLayer(b,a.layer);SAPI.each(a.objects,function(a,b){var c=b.ID_MAP_OBJECT,d;c in this.objects_lookup?d=this.nav_objects[this.objects_lookup[c]]:d=this.injectObject(b,f.id),f.objects[d.ID_Z_INDEX]=d.ID_Z_INDEX},this);return e},m.prototype.objectInLayer=function(a,b){for(var c in a.layers)if(c==b)return!0;return!1},m.prototype.queryRender=function(a){clearTimeout(this.ts_queryRender2),clearTimeout(this.ts_queryRender);var b=Math.round(Math.random()*1e4);window.chargelog&&(console.trace(),console.log("charge",b)),this.ts_queryRender=SAPI.delay(function(){this.in_queryRender()},{timeout:Math.max(100,a),context:this})},m.prototype.hideAll=function(a){var b=this.nav_objects,c=[],d=this;SAPI.each(this.nav_objects,function(a,c){b[a]&&b[a].shown&&d.hideObject(a)}),this.newGeneration()},m.prototype.DimensionError=function(){SAPI.console.error("map","dimension error"),this.hideAll();return!1},m.prototype.in_queryRender=function(a){clearTimeout(this.refreshTimer),clearTimeout(this.ts_queryRender),clearTimeout(this.ts_queryRender2);var b=SAPI.microtime(),c=this.getBounds(),d=this.nav_objects,e=this.nav_block_index,f=this,g=this,h=0,i=0,j=0,k=0,l=g.getStackableDelta();if(!l)return this.DimensionError();var m=0,n=this.currentGeneration();this.lastRenderZoom=c.zoom;var o=this.cluster.setup(c.x1,c.y1,c.x2,c.y2,c.zoom,n),p=this.cluster.getBounds(),q=function(a){f.cluster.push(a)},r={},s=function(a,b){if(!r[a]){r[a]=1;var c=d[a];i++;if(window.ZFULL_PASS||b||c.passToBounds(p))q(c),h++;c.shown&&m++}},t=0,u=2;c.zoom<9&&(t=3),c.zoom<6&&(t=2);var v=function(){if(!g._dropingObjects){SAPI.each(g.dirrectObjects,function(a,b){s(b,!1)});var a,b=g.layerSet.slice(0),f=[];for(var h in b)g.hiddenPresetLayers[h]||f.push(h);var i=f.length;SAPI.each(e,function(a,b){var e=b.area,g=b.zoom;if(c.zoom>=16||g<=c.zoom+t&&Math.abs(g-c.zoom)<u){var h=e.x1<p.x2&&e.x2>p.x1&&e.y1<p.y2&&e.y2>p.y1;if(h||window.ZFULL_PASSBLOCK){j++;var k=e.x1>=p.x1&&e.x2<=p.x2&&e.y1>=p.y1&&e.y2<=p.y2;for(var l=0;l<i;l++){var m=f[l];if(b[m]){var n=b[m].objects;SAPI.each(n,function(a,b){d[b]&&d[b]._enabled&&s(b,k)})}}}}})}};if(o.update.length||a)this.cluster.start(o),v(),this.cluster.end();this.cluster.setVisibleSet();var w=this.cluster.getRender(g.LIMIT_OBJECTS),x=this.cluster.getUpdateset(g.LIMIT_OBJECTS),y=this.cluster.renderCount(),z=[],A=0,B=function(){SAPI.each(g.visiblePipeline,function(a){a&&g.visiblePipeline[a]&&(!w[a]||typeof w[a]=="undefined")&&(g.hideObject(a),A++)})};B();var C=0,D=0,E=function(){SAPI.each(x,function(a,b){g.showObject(b),k++})};E();if(0)SAPI.each(w,function(a){a&&g.torender[a]&&(!visiblePipeline[a]||typeof visiblePipeline[a]=="undefined")&&console.log("unshowed",a)});this.render_objects=w;var F=SAPI.microtime(),G=g.realrender.length,H=this.cluster.renderShown>200;H!=window.__sapi_z_overloaded&&(window.__sapi_z_overloaded=H),SAPI.console.log("map:render","currently("+n+"/"+this.counterIncremental+") visible:push"+h+"("+i+" in "+j+")/rcnt"+this.cluster.renderCount()+"/shown-"+this.cluster.renderShown+"/upd-"+this.cluster.renderUpdate+"("+k+"), deleted:"+A+" | in "+(F-b)),this.ts_queryRender=0,this.queryRefresh(1),k||this.cluster.finishTurn();return!0},m.prototype.queryRefresh=function(){clearTimeout(this.refreshTimer),this.refreshTimer=SAPI.delay(function(){this.tickRender()},{tm:this.RENDER_TIME_STEP,context:this})},m.prototype.tickRender=function(){clearTimeout(this.refreshTimer),this.refreshTimer=0;var a=0,b=0,c=this.renderPipeline,d=this.ZTILE_RENDER_LIMIT,e=this,f=0,g;for(g in c)if(c[g]){f=1;break}var h=function(){for(var e in c){c[e]&&(b++,c[e](),a++,c[e]=null);if(a>d)break}return a>d?!1:!0},i=!0;f&&(this.map.openMapTransaction(),i=h(),this.map.closeMapTransaction()),a?(this.chargeAfterRender=1,this.queryRefresh()):(this.renderPipeline={},this.chargeAfterRender&&this.queryRender(500),this.chargeAfterRender=0);return a},m.prototype.pushRender=function(a,b){this.renderPipeline[a.ID_Z_INDEX]=b},m.prototype.hideObject=function(a){var b=this.nav_objects[a];if(!!b&&b){var c=this;this.pushRender(b,function(){delete c.visiblePipeline[a],b.shown=0,c.layerCall(b.layers,b,"hide")})}},m.prototype.resetObjects=function(){this.chargeAfterRender=0;while(this.tickRender())this.chargeAfterRender=0;this.map.openMapTransaction();for(var a in this.nav_objects)if(a&&this.nav_objects[a]){var b=this.nav_objects[a];b.shown=!1;var c=this;delete c.visiblePipeline[a],c.layerCall(b.layers,b,"reset")}this.map.closeMapTransaction(),this.restackObjects(),this.newGeneration()},m.prototype.showObject=function(a){var b=this.nav_objects[a];if(!!b){var c=this;c.visiblePipeline[a]=1,this.pushRender(b,function(){b.shown=1,c.layerCall(b.layers,b,"show")})}},m.prototype.restackObjects=function(){for(var a in this.nav_objects)if(a&&this.nav_objects[a]){var b=this.nav_objects[a];b.stackCNT=0,b.stackedBefore=0,b.stacked=[],this.nav_objects[a]=b}},m.prototype.layerCall=function(a,b,c){c="ztile_"+c,b.parentContainer[c]&&b.parentContainer[c](this,a,this.map);return b},m.prototype.setObject=function(a){this.nav_objects[a.idkey]=a},m.prototype.getMinViewDimensions=function(){return this.map.getMinViewDimensions()},m.prototype.getStackableDelta=function(){var a=this.thisBounds,b=1,c=this.getMinViewDimensions();if(c<100)return!1;var d=Math.abs(a.x2-a.x1),e=Math.abs(a.y2-a.y1);d>e?b=e:b=d;return b/c},m.prototype.moveend=function(){var a=this.map.getZoom(),b=this.map.getBounds();if(!b)return!1;this.thisBounds={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,zoom:a};var c=(b.x2-b.x1)*.2,d=(b.y2-b.y1)*.2;if(isNaN(c)||isNaN(d))return!1;this.performRequire(r.listTiles(b.x1-c,b.y1-d,b.x2+c,b.y2+d,a-1));return!0},m.prototype.onRequestingChange=function(a){},m.prototype.getBounds=function(){return this.thisBounds},p.prototype.start=function(){var b=this;this.timeout=setTimeout(function(){b.ajax=a.ajax(b.params),b.timeout=0},Math.ceil(this.generation/2)*300)},p.prototype.abort=function(){this.timeout&&clearTimeout(this.timeout),this.ajax&&(this.ajax.abort(),delete this.ajax,this.ajax=0)};var q=function(a){};q.prototype=new m,q.prototype.AjaxRequest=function(a,b,c){var d={cache:!1,url:a,global:!1,error:b.onFail,success:b.onComplete,dataType:"json",contentType:"application/json"},e=new p(d,c);return{transport:{abort:function(){e.abort()}}}};var r={zoomTile:function(a){var b=-18e7,c=18e7,d=-9e7,e=9e7,f=a.length;for(i=0;i<f;i++)xdel=Math.round((b+c)/2),ydel=Math.round((d+e)/2),a[i]=="0"&&(p1=0,p2=0),a[i]=="1"&&(p1=0,p2=1),a[i]=="2"&&(p1=1,p2=1),a[i]=="3"&&(p1=1,p2=0),p1==0?b=xdel+1:c=xdel,p2==0?d=ydel+1:e=ydel;var g=[];g[0]=SAPI.map.LatLng(d/n,b/n),g[1]=SAPI.map.LatLng(e/n,c/n);return g},checkPoint:function(a,b,c,d,e){var f=0,g=0,h=-18e7,i=18e7,j=-9e7,k=9e7,l=0,m=32,n=0,o=0,p=0,q=0,r=0,s=e-1;while(s>=0)f=Math.round((h+i)/2),g=Math.round((j+k)/2),r=Math.pow(2,s),p=c&r,q=d&r,p>0?h=f+1:i=f,q>0?(j=g+1,l=n):(k=g,m=n),s--,o++;return a>=h&&a<=i&&b>=j&&b<=k?1:0},getZTile:function(a,b,c){var d=0,e=0,f=0,g=0,h=-18e7,i=18e7,j=-9e7,k=9e7,l=0,m=32,n=0,o=0,p=c-1;while(p>=0)d=Math.round((h+i)/2),e=Math.round((j+k)/2),a<=d?(i=d,f=f*2):(h=d+1,f=f*2+1),b<=e?(k=e,m=n,g=g*2):(j=e+1,l=n,g=g*2+1),p--,o++;return{x:f,y:g}},retcode:function(a,b,c){var d=0,e=0,f=0,g=0,h=0,i="0",j=c-1,k=0;while(j>=0)f=Math.pow(2,j),g=a&f,h=b&f,g>0?d=2:d=0,h>0?e=1:e=0,d&&e&&(k="3"),d&&!e&&(k="1"),!d&&!e&&(k="0"),!d&&e&&(k="2"),i=i+k,j--;return i},listTiles:function(a,b,c,d,e){var f=[];a=Math.ceil(a*n),b=Math.ceil(b*n),c=Math.ceil(c*n),d=Math.ceil(d*n),e=e-1,a<-18e7&&(a=-18e7),c<-18e7&&(c=-18e7),a>18e7&&(a=18e7),c>18e7&&(c=18e7),b<-85051128&&(b=-85051128),d<-85051128&&(d=-85051128),b>85051128&&(b=85051128),d>85051128&&(d=85051128);var g=this.getZTile(a,b,e),h=g.x,i=g.y,j=Math.pow(2,e)-1,k=0,l=0,m=h,o=i;while(k!=1)k=this.checkPoint(c,b,m,o,e),l++,m=m+1,m>j&&(m=0);m==j&&(l=1),k=0;var p=0;m=h,o=i;while(k!=1)k=this.checkPoint(a,d,m,o,e),p++,o=o+1,o>j&&(o=0);o==j&&(p=1);var q="",r="",s=i,t=p;while(l>0){while(p>0){q=""+this.retcode(h,i,e),q=q.substring(0,16);var u=0,r="";while(u<q.length)r=r+"/"+q.substring(u,u+3),u=u+3;r=r.substr(1,r.length-1),r=r;var v=r;f.push({addr:q,z:v,x:h,y:i,zoom:e}),p--,i++,i>j&&(i=0)}i=s,p=t,l--,h++,h>j&&(h=0)}return f},tileArea:function(a){var b=-18e7,c=18e7,d=-9e7,e=9e7,f,g,h=a.length;for(var i=1;i<h;i++){var j=Math.round((b+c)/2),k=Math.round((d+e)/2),l=a.charAt(i);l=="0"&&(f=0,g=1),l=="1"&&(f=1,g=1),l=="2"&&(f=0,g=0),l=="3"&&(f=1,g=0),f?b=j+1:c=j,g?e=k:d=k+1}var m=[];return{y1:d/n,x1:b/n,y2:e/n,x2:c/n}}},s=SAPI.implimentClass("map.math.ZMath",r);m.prototype.AjaxRequest=function(a,b){},m.prototype.assignDataCenter=function(){return"/maptiles/"},m.prototype.getTilesVisibleSet=function(){var a=this.getBounds(),b=r.getTiles(a.x1,a.y1,a.x2,a.y2,zoom),c=array(),d=this.layerSet.slice(0),e;while(e=b.shift()){e.layers=d.slice(0);var f=e.addr;if(this.nav_block_index[f])for(i in d)this.nav_block_index[f][i]&&(e.layers[i]=0,c.push(this.nav_block_index[f][i]));var g=String(f),h=0,j=0,k=g.length;for(var l=1;l<k;l++){var m=g.slice(0,l),n=0;if(this.nav_block_index[m]){n=1;for(li in d)e.layers[li]&&this.nav_block_index[m][li]&&this.nav_block_index[m][li]["final"]&&(e.layers[li]=0)}}}},m.prototype.TileRelationsBroker=function(a){var b={},c,d=this.layerSet.slice(0);while(c=a.shift()){c.layers=d.slice(0);var e=0,f=c.addr;if(this.nav_block_index[f])for(e in d)this.nav_block_index[f][e]&&(c.layers[e]=0);var g=String(f),h=0,i=0,j=g.length;for(var k=0;k<j;k++){var l=g.slice(0,k),m=0;if(this.nav_block_index[l]){m=1;for(li in d)c.layers[li]&&this.nav_block_index[l][li]&&this.nav_block_index[l][li].isFinal&&(c.layers[li]=0)}}var n=[];c.inLayers=0;for(e in c.layers)c.layers[e]==e&&c.inLayers++;c.inLayers&&(b[f]=c)}return b},m.prototype.sliceByLayer=function(a){var b=[],c=0,d=0,e=0,f=1;for(e in a)if(a[e]){var g=a[e];if(g.inLayers>f)for(c=0;c<g.inLayers;c+=f){var h={addr:g.addr,z:g.z,x:g.x,y:g.y,zoom:g.zoom};h.DS=g.DS;var i=[],j=0,k=0,l=0;for(l in g.layers)if(g.layers[l]==l){j++;if(j>c){i[l]=l,k++;if(k>=f)break}}j&&(h.inLayers=j,h.layers=i,b.push(h))}else g.inLayers&&b.push(g)}return b},m.prototype.performRequire=function(a){var b=this,c=0,d=0,e=function(a){var b=[];for(var c in a)a[c]==c&&b.push(c);return b},f=this.sliceByLayer(this.TileRelationsBroker(a)),g=[],h=0;for(c in f)if(f[c]){var i=f[c];i.layerSet=e(i.layers);for(var j in i.layerSet)i.layer=i.layerSet[j],i.layerDef=this.map.getLayerDef(i.layer),i.layerDef.reader&&(i.target=i.layerDef.reader.assignTarget(i),h++,g[i.target]=i)}h&&(g=this.clearNavRequestTimeouts(g));for(c in g){var i=g[c];i.aborted=0,i.run=function(a){b.loadDataLine(a,this),this.finish()},i.abort=function(a){this.finish()},i.finish=function(){this.aborted=1,delete b.readerRequest[this.target],b.stopRequesting({0:this})},i.layerDef.reader.load(i)&&(this.readerRequest[i.target]=i,this.startRequesting({0:i}))}this.queryRender()},m.prototype.clearNavRequestTimeouts=function(a){var b=0,c;for(c in this.readerRequest){var d=this.readerRequest[c];b++,a[d.target]?delete a[d.target]:d.abort()}b==0&&(this.readerRequest=[]);return a},m.prototype.startRequesting=function(a){for(var b in a){var c=a[b];c.requesting=1,this.NowRequesting(1)}},m.prototype.stopRequesting=function(a){for(var b in a){var c=a[b];c.requesting&&(this.NowRequesting(-1),c.requesting=0)}},m.prototype.NowRequesting=function(a){this.NowRequestingCnt+=a,this.onRequestingChange(this.NowRequestingCnt)},function(){var a=1024,b=-1;SAPI.val("map.cluster.sizeShiftFactor",.2);var c=SAPI.implimentClass("map.cluster.manager",{clusterSet:{},initialize:function(){},decodeClusterType:function(a){if(!a||a=="point")a="map.cluster.zpoint";a=="size"&&(a="map.cluster.zsize"),a=="pass"&&(a="map.cluster.pass");return a},assignType:function(a){var b=a.group+"-"+a.name;if(!this.clusterSet[b]){var c=this.decodeClusterType(a.clu);this.clusterSet[b]={name:b,clu:SAPI.Class("map.cluster.index",[{clusterType:c}])}}a.defaults&&(this.defaultCluster=b)},setup:function(a,b,c,d,e,f){var g=0,h={isauto:1,update:{}};SAPI.each(this.clusterSet,function(h,i){var j=i.clu.setup(a,b,c,d,e,f);i.workingSet=j,g+=j.updateLength}),h.update.length=g;return h},getBounds:function(){this.bounds=0;for(var a in this.clusterSet){var b=this.clusterSet[a].clu.getBounds();if(!this.bounds||this.bounds.len<b.len)this.bounds=b}return this.bounds},push:function(a){var b=this.clusterSet[this.decodeClusterType(a.clusterName)];b||(b=this.clusterSet[this.defaultCluster]),b&&b.active&&b.clu.push(a)},start:function(a){for(var b in this.clusterSet){var c=a.isauto?this.clusterSet[b].workingSet:a;c.update.length?(this.clusterSet[b].active=1,this.clusterSet[b].clu.start(c)):this.clusterSet[b].active=0}},end:function(){for(var a in this.clusterSet)this.clusterSet[a].clu.end()},setVisibleSet:function(){for(var a in this.clusterSet)this.clusterSet[a].clu.setVisibleSet()},getRender:function(a){var b={},c=0;SAPI.each(this.clusterSet,function(d,e){var f=e.clu.getRender(a);c+=e.clu.renderShown,SAPI.merge(b,f)},this),this.renderShown=c;return b},getUpdateset:function(a){var b={},c=0;SAPI.each(this.clusterSet,function(d,e){var f=e.clu.getUpdateset(a);c+=e.clu.renderUpdate,SAPI.merge(b,f)},this),this.renderUpdate=c;return b},finishTurn:function(a){SAPI.each(this.clusterSet,function(a,b){b.clu.finishTurn()},this)},renderCount:function(){var a=0;SAPI.each(this.clusterSet,function(b,c){a+=c.clu.renderCount});return a}}),d=SAPI.implimentClass("map.cluster.index",{initialize:function(a){this.clusterName=a.clusterType,this.bounds={x1:0,y1:0,x2:0,y2:0},this.zoom=0,this.cells=0,this.cellx=0,this.celly=0,this.reset()},setup:function(a,c,d,e,f,g){f+=b,f!=this.zoom&&this.reset(),this.upgen=g,this.zoom=f,this.setBounds={x1:a,x2:d,y1:c,y2:e,zoom:f};var h=this.setupBounds(a,c,d,e);return{update:h.update,updateLength:h.length,logen:this.logen}},reset:function(){this.index={},this.lastActiveSet={},this.upgen=0,this.logen=0},setupBounds:function(a,b,c,d){this.cells=Math.pow(2,this.zoom),this.cellPixelSize=Math.round(Math.pow(256,this.zoom)/this.cells),this.cellx=360/this.cells*n,this.celly=180/this.cells*n,this.cellset={x1:Math.floor(a*n/this.cellx),y1:Math.floor(b*n/this.celly),x2:Math.ceil(c*n/this.cellx),y2:Math.ceil(d*n/this.celly)};var e=this.cellx*this.cellset.x1/n,f=this.celly*this.cellset.y1/n,g=this.cellx*this.cellset.x2/n,h=this.celly*this.cellset.y2/n;this.bounds={x1:e,y1:f,x2:g,y2:h,len:g-e+(h-f)};return this.rebuildIndex()},getCluster:function(a,b,c){var d=Math.floor(a*n/this.cellx),e=Math.floor(b*n/this.celly);if(!this.index[d+e*this.cells])return!1;var f=d+e*this.cells;if(c&&this.lastActiveSet[f]!=1)return!1;return this.index[f]},newCluster:function(){return SAPI.Class(this.clusterName,arguments)},rebuildIndex:function(){var a=0,b=0,c=[],d=0,e=0,f=0;SAPI.each(this.index,function(a,b){b&&(this.cellset.x1-1<=b.idoff.x&&b.idoff.x<=this.cellset.x2+1&&this.cellset.y1-1<=b.idoff.y&&b.idoff.y<=this.cellset.y2+1||(delete this.index[a],e++))},this);var g={};for(a=this.cellset.x1-1;a<=this.cellset.x2;a++)for(b=this.cellset.y1-1;b<=this.cellset.y2;b++){var h=a+b*this.cells;this.index[h]?this.index[h].generation<this.upgen||!(h in this.lastActiveSet)?(c.push(this.index[a+b*this.cells]),g[h]=1,f++):g[h]=2:(this.index[h]=this.newCluster(this.getCellSize(a,b),this.zoom),this.index[h].indexId=h,this.index[h].idoff={x:a,y:b},c.push(this.index[h]),f++,g[h]=1)}this.lastActiveSet=g,!f&&!e;return{update:c,length:f}},getVisibleSet:function(){var a=0,b=0,c=[];for(a=this.cellset.x1;a<this.cellset.x2;a++)for(b=this.cellset.y1;b<this.cellset.y2;b++)this.index[a+b*this.cells]&&c.push(this.index[a+b*this.cells]);return c},setVisibleSet:function(){this.renderSet=this.getVisibleSet()},getCellSize:function(a,b){return{x1:this.cellx*a,y1:this.celly*b,x2:this.cellx*(a+1),y2:this.celly*(b+1),_x:a,_y:b,_ind:a+b*this.cells}},getBounds:function(){return this.bounds},start:function(a){this.activeSet=a.update,this._nowgen=0,this.changeCnt=0;for(b in this.index)this.index[b].inactive=1;for(var b in this.activeSet){var c=this.activeSet[b];c&&(c.inactive=0,c.prepare())}},end:function(a){a=this.upgen,this.logen=Math.max(this.logen,this._nowgen),a||(a=this.logen);for(var b in this.activeSet){var c=this.activeSet[b];c&&(c.generation=a,c.logen=this.logen,c.end())}},distto:function(a){var b=a.LATITUDE-this.centerPoint.x,c=(a.LONGITUDE-this.centerPoint.y)/8;return b*b+c*c},getRender:function(a){var b=[],c={},d,e,f=this.setBounds;this.centerPoint={x:f.x1+(f.x2-f.x1)/2,y:f.y1+(f.y2-f.y1)/2},this.renderCount=0,this.renderShown=0;var g=0,h=[];for(d in this.renderSet){var i=this.renderSet[d],j=i.getWorkingset(),k=i.index,l=i.inVisibleSet(f),m=[];for(e in j){var n=k[e];if(n.clusterId!=i.cellId)continue;l||n.passToBounds(f)?(n.shown&&this.renderShown++,m.push(e),c[e]=e,g++,n.invisible=0):n.invisible=1}h.push({oset:m,oindex:k,osetstart:0,osetlen:m.length})}if(g>a){SAPI.console.log("достигнут лимит обьектов "+g+" из "+a),c={},g=0,this.renderShown=0;var o=h.length;for(;;){var p=0;for(var d=0;d<o;++d){var q=h[d];if(q.osetstart<q.osetlen){var n=q.oset[q.osetstart++];if(n){var r=q.oindex[n];r.shown&&this.renderShown++,c[n]=n,g++,p++}}}if(!p||g>a)break}}this.renderCount=g,this.renderCluster=c;return c},getUpdateset:function(a){var b=[],c,d,e=0,f=this.setBounds;this.renderUpdate=0;var g={},h=0,i=[],j={};for(c in this.renderSet){var k=this.renderSet[c];k.updateVisible();var l=k.updateoutset,m=k.index,n=k.inVisibleSet(f),o=[];for(d in l){var p=m[d];if(p.clusterId!=k.cellId)continue;if(n||p.passToBounds(f))p.shown||h++,g[d]=d,o.push(d),this.renderCluster[d]&&(j[d]=d,this.renderUpdate++)}}return j},finishTurn:function(){var a;for(a in this.index)a&&this.index[a]&&this.index[a].seal()},push:function(a){this._nowgen=Math.max(a.generation,this._nowgen);var b=this.getCluster(a.LONGITUDE,a.LATITUDE,!1);b&&(a.clusterIndexes=[],b.push(a)&&(this.changeCnt++,a.clusterId=b.cellId))}}),e=SAPI.implimentClass("map.cluster.zbase",{__namecache__:!0}),f=SAPI.implimentClass("map.cluster.zpoint",{Extends:"map.cluster.zbase",initialize:function(a,b){this.cell=a,this.cellId=a._ind,this.cellsize=a,this.latbox={x1:a.x1/n,y1:a.y1/n,x2:a.x2/n,y2:a.y2/n,zoom:b},this.gen=0,this.generation=0,this.workingset=[],this.clear()},inVisibleSet:function(a){return this.latbox.x1>=a.x1&&this.latbox.x2<=a.x2&&this.latbox.y1>=a.y1&&this.latbox.y2<=a.y2},hit:function(a,b){return this.latbox.x1<a&&this.latbox.y1<b&&this.latbox.x2>a&&this.latbox.y2>b},prepare:function(){this.changeCnt=0,this.updateset=[],this.workingset=[],this.index=[]},push:function(a){if(this.inactive)return!1;this.index[a.ID_Z_INDEX]=a,a.clusterIndexes.push(this.cellId),this.changeCnt++;return true},getStackableDelta:function(){return(this.latbox.x2-this.latbox.x1)/a},getWorkingset:function(){return this.workingset},haveRestack:function(){var a;for(a in this.index)if(this.index[a].reStack)return 1;return!1},glueData:function(){var a=this.index,b=this.index,c=[],d=[],e={};this.updateset=[];var f=this.getStackableDelta(),g=this.latbox,h=.5;this.latbox.zoom>=15&&(h=.3),this.latbox.zoom>=17&&(h=.2);var i=SAPI.val("map.cluster.sizeShiftFactor");h*=i*2,h*=f;var j=g.y2-g.y1,k=g.x2-g.x1,l=16,m=g.y1,n=g.x1,o=this,p=function(){var b;SAPI.each(a,function(a,b){c.push({id:b.ID_Z_INDEX,randWeight:b.randWeight*(b.shown*2+1)})})},q=function(){c.sort(function(a,b){return a.weight-b.weight})},r=function(){var f=[],g=0,h;while(h=c.shift()){var o=h.id,p=a[o],q,r,s,t=0,u=p.getDim();q=Math.floor(l*(p.LATITUDE-m-u.top)/j),r=Math.floor(l*(p.LONGITUDE-n-u.left)/k),s=Math.ceil(l*(p.LATITUDE-m+u.top)/j),t=Math.ceil(l*(p.LONGITUDE-n+u.left)/k);var v=[];v[o]=1;var w=1;for(var x=q;x<s;x++){if(!w)break;for(var y=r;y<t;y++){if(!w)break;if(f[x]&&f[x][y]){if(!w)break;for(var z in f[x][y]){var A=f[x][y][z];if(v[A])continue;v[A]=1,g++;var B=b[A];!p.stackedIn;if(B){var C=B.getDim(),D=Math.abs(B.LATITUDE-p.LATITUDE),E=Math.abs(B.LONGITUDE-p.LONGITUDE),F=(u.top+u.top)*i,G=(u.left+u.left)*i;D!=0||E!=0;if(D<F&&E<G){B.stacked.push(o),p.stackCNT=0,p.stackedBefore=p.stackCNT,p.stacked=[],w=0;break}}}}}}if(!w){p.stackedIn=1;continue}p.stackedIn=0,p.stackedBefore=p.stackCNT,p.stacked=[],d.push(o),e[o]=o;for(var x=q;x<=s;x++)for(var y=r;y<=t;y++)f[x]||(f[x]=[]),f[x][y]||(f[x][y]=[]),f[x][y].push(o)}};p(),q(),r(),this.workingset=e,this.postprocess()},postprocess:function(){this.updateset=[];var a,b=0,c=0;SAPI.each(this.workingset,function(a){var d=this.index[a];if(d&&d.LATITUDE){var e=d.storedCapacity,f=0,g,h=this.index,i=0,j=1;for(g in d.stacked){var k=h[d.stacked[g]];k&&(e+=k.storedCapacity,i+=k.reStack,k.reStack=0,j++)}d.relativeCounter=j==e,d.stackCNT=Math.round(e);if(d.stackedBefore!=d.stackCNT||d.reStack||i)(d.stackedBefore!=d.stackCNT||i)&&d.reStack++,b++,f=1;d.shown||(c++,f=1),f&&this.updateset.push(d.ID_Z_INDEX)}},this)},updateVisible:function(){var a={},b;SAPI.each(this.workingset,function(b){var c=this.index[b];if(!c.shown||c.reStack)a[b]=b},this),SAPI.each(this.updateset,function(b,c){var d=this.index[c];if(!d.shown||d.reStack)a[c]=c},this),this.updateoutset=a;return a},end:function(){this.glueData()},clear:function(){this.generation=0,this.index=[],this.workingset=[],this.updateset=[],this.updateoutset=[]},seal:function(a){}}),g=SAPI.implimentClass("map.cluster.pass",{Extends:"map.cluster.zpoint",glueData:function(){},postprocess:function(){},end:function(){this.workingset={};for(var a in this.index)this.workingset[a]=a}})}(),function(){var a=SAPI.implimentClass("map.reader.base",{tileable:function(){return!1},zoomeable:function(){return!1},maxZoom:function(){return 22},minZoom:function(){return 1},zoomShift:function(){return 0},sequence:function(a){},assignTarget:function(a){return!1},load:function(a){}})}(),function(){var a=SAPI.implimentClass("map.filter.base",{params:{},attr:function(a){this.params=SAPI.merge({},a)},priority:function(){return 1},filter:function(){},apply:function(){this.functor.add()},remove:function(){this.functor.remove()},defaultAction:function(){return["show","remove","nope","hint","fade"]},action:function(){return this.defaultAction()},filterFunctor:function(){return SAPI.bind(this.filter,this)}})}(),function(){var a=SAPI.implimentClass("map.layer.base",{setMap:function(a){this._map=a,this.onAttach()},onAttach:function(){},Assign:function(a){this.layerId=a.layerId,this.driver=a.driver,this.setZInstance(a.ztile);return this},enable:function(a){this.enabled=1;return!0},disable:function(a){this.enabled=0;return!0},showObject:function(a,b,c){a.shown=1},hideObject:function(a,b,c){a.shown=0},resetObject:function(a,b,c){a.shown=0},preprocessObject:function(a,b,c){return a}}),b=SAPI.implimentClass("map.layer.zbased",{Extends:"map.layer.base",enable:function(a){b.superclass.enable(a),this.ZTile.enableLayer(a);return!0},disable:function(a){b.superclass.disable(a),this.ZTile.disableLayer(a);return!0},setZInstance:function(a){this.ZTile=a,this.zTouchable()&&this.ZTile.assignLayer(this.layerId,this,{show:function(a,b,c,d){a.showObject(b,c,d);return b},hide:function(a,b,c,d){a.hideObject(b,c,d);return b},reset:function(a,b,c,d){a.resetObject(b,c,d);return b},preprocess:function(a,b,c,d){a.preprocessObject(b,c,d);return b}})}})}(),function(){var b=SAPI.implimentClass("map.layer.overlayedInterface",{showObject:function(a,b,c){a.mapObject||this.initOverlay(a,c);if(a.mapObject){a.mapObject.show(),a.shown=1;return!0}return!1},hideObject:function(a,b,c){a.mapObject&&a.mapObject.hide(),a.shown=0},resetObject:function(a,b,c){a.mapObject&&(a.mapObject.tearDown(),delete a.mapObject,a.mapObject=0),a.shown=0},initOverlay:function(a,b){var c=a.getEntityView();c&&(c.setObject(a,b),a.mapObject=c);return c}}),c=SAPI.implimentClass("map.overlay.base",{__namecache__:!0,object:0,map:0,isAttached:!1,initialize:function(){},setObject:function(a,b){this.map=a,this.zRecord=b,b.parentContainer=this},mapAttach:function(a){this.map=a,this.isAttached=1},onmapDettach:function(){this.isAttached=0},getDiv:function(){return!1},getTemplate:function(){return!1},init:function(a){return!1},show:function(){this.map&&(this.map.addOverlay(this),this.map.tryRestoreBalloon(this));return!1},hide:function(){this.map&&(this.map.removeOverlay(this),this.map.tryCloseBalloon(this));return!1},remove:function(){this.hide(),this._DivVisible=0,this.map.tryCloseBalloon(this),this.layerObject.remove()},visible:function(){return this._DivVisible&&this.map&&this.getDiv()},$render:function(){this._DivVisible=1,this.render.apply(this,arguments),this.patch(!0)},render:function(){return!1},redraw:function(){this.setCenter(),this.render()},setCenter:function(){return!1},getCenter:function(){return!1},getBBOX:function(){return!1}}),d=SAPI.implimentClass("map.overlay.point",{Extends:"map.overlay.base",innerHTML:"",$gen_html:0,template:"",isSimpleBox:!0,isPointObject:!0,initialize:function(){},getCursor:function(){return"pointer"},isTransparent:function(){return!1},positionAbsoluted:function(){return!0},prestyle:function(){var a=this.getZIndex();return(this.positionAbsoluted()?"position:absolute;":"")+(a?"z-index:"+a+";":"")+"cursor:"+this.getCursor()+";"},initView:function(){this.render(),this.setPosition()},mapAttach:function(a){d.prototype.superclass.mapAttach.apply(this,arguments),this.getDiv()||this.createDiv()},setupActions:function(){},patch:function(a){var b;if(b=this.getDiv())if(!b.patched||a)this.setupActions(),b.patched=1},getEventSet:function(){var a=this,b={click:function(b){return a.__doonclick(b)},mousedown:function(b){a.__docdrag=SAPI.event.dom.dragging.hold(),b.preventDefault();return!1},mouseup:function(b){a.__docdrag&&(a.__docdrag.unhold(),a.__docdrag=0),b.preventDefault();return!1},unselectable:"on"};return b},createRootNode:function(){return document.createElement("div")},createDiv:function(){this._div&&this.remove();var b=this;this._div=this.createRootNode(),this._div.upobj=this;if(!this.isTransparent()){this.getCursor()&&(this._div.style.cursor=this.getCursor());var c=function(a){SAPI.event.dom.stopBubble(a)},d=this.getEventSet();d&&(SAPI.event.ize(this._div,this.eventSet,{context:this,stopBubbling:"all"}),d.click&&SAPI.event.dom.ctrl(this._div,"enable","touchstart",function(c){a(b._div).click()}))}this._div.style.cssText=this.prestyle(),this._div.className=this.getDivClassName();return this._div},__clearLR:function(){return{left:0,top:0}},__ll:function(a,b){return SAPI.map.LatLng(a,b)},getCenter:function(){return this.latLng},asMapCenter:function(){this.map.setPosition(this.getCenter())},setCenter:function(a){"sapiLatLng"in a||(a=SAPI.map.toLatLng(a)),this.LONGITUDE=a.lng(),this.LATITUDE=a.lat(),this.latLng=a,this.map&&this.visible()&&this.setPosition()},getFinalLatLng:function(){return this.latLng},reStacked:function(){return this.zRecord&&(this.zRecord.reStack||this.zRecord.stackCNT)},reStack:function(){this.zRecord&&this.zRecord.reStack--<0&&(this.zRecord.reStack=0),this.restacked=1,this.render(),this.restacked=0},center:function(){if(arguments.length==0)return this.getCenter();this.setCenter.apply(this,arguments);return this},passToBounds:function(a){var b=this.getBBox(),c=b.left,d=b.top;return this.LATITUDE+c>a.y1&&this.LATITUDE-c<a.y2&&this.LONGITUDE+d>a.x1&&this.LONGITUDE-d<a.x2?!0:!1},getMapPosition:function(){return this.map.mapper("fromLatLngToDivPixel",this.getFinalLatLng())},getAttachPoint:function(){return{left:0,top:0}},getMargins:function(){return{left:0,top:0}},getDiv:function(){return this._div},getShadow:function(){return!1},getZIndex:function(){return 1},getZIndexHover:function(){return this.getZIndex()},html:function(a){a||(a=this.innerHTML),this._div&&this._setInnerHTML!=a&&(this._setInnerHTML=[a].join(""),this._div.innerHTML=this._setInnerHTML,this._div.patched=0,this.$gen_html++),this.setPosition()},getDivClassName:function(){return""},removeNode:function(a){a=a||0,this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div)},remove:function(a){this.removeNode(a),this.object&&(this.object.shown=0),d.prototype.superclass.init.apply(this,arguments)},temporalyHide:function(){this._div&&(this._div.style.display="none")},fixOutzoom:function(){if(!this.map.fixOutzoom()){this.temporalyHide();return!1}return!0},cssText:function(a){this._div.style.cssText=a},setPixelPosition:function(b,c){a(this.getDiv()).mouseout(),this.cssText(this.prestyle()+";left:"+b+"px;top:"+c+"px")},setPosition:function(){if(!this.map)return!1;if(!this.fixOutzoom())return!1;var a=this.getMapPosition();if(!a){this.temporalyHide();return!1}var b=this.getAttachPoint();if(this._div&&a){var c=Math.round(a.left-b.left),d=Math.round(a.top-b.top);this.lastPixelPosition={left:c,top:d},this.setPixelPosition(c,d)}return!0},event_onclick:function(a){},__doonclick:function(a){this.getDiv().onmouseout&&this._div.onmouseout(a);return this.event_onclick(a)},floatName:function(){return"unnamed object"}}),e=SAPI.implimentClass("map.overlay.pixelDim",{__dimsize:0,__dimgen:0,$interference:{initialize:"before"},initialize:function(){this.__dimgen=0},setObject:function(){var a=this;this.__dimgen=0},getBBox:function(){return this.map.mapper("pixelboxtolat",this.getCenter(),this.getPixelDim())},setPixelDim:function(a){SAPI.equals(this.__dimsize,a)||(this.__dimsize={left:a.top,top:a.left},this.__dimgen++)},getPixelDim:function(){return this.__dimsize||{left:10,top:10}}}),f=SAPI.implimentClass("map.overlay.rect",{Extends:"map.overlay.point",setPixelPosition:function(b,c){a(this.getDiv()).mouseout();var d=c[0]-b[0],e=c[1]-b[1];this.cssText(this.prestyle()+";left:"+b[0]+"px;top:"+b[1]+"px"+";width:"+d+"px;height:"+e+"px")},setBounds:function(a,b){this.bounds=[a.dup(),b.dup()],this.setCenter(SAPI.map.LatLng(a.x+(b.x-a.x)*.5,a.y+(b.y-a.y)*.5))},getBounds:function(){return new SAPI.map.LatLngBounds(this.bounds[0],this.bounds[1])},getMapBoundsPosition:function(){this._mapBoundsPosition={position:[this.map.mapper("fromLatLngToDivPixel",this.bounds[0]),this.map.mapper("fromLatLngToDivPixel",this.bounds[1])],zoom:this.map.getZoom()};return this._mapBoundsPosition.position},getBBox:function(){return{left:Math.abs(this.bounds[1].x-this.bounds[0].x),top:Math.abs(this.bounds[1].y-this.bounds[0].y)}},setPosition:function(){if(!this.map)return!1;if(!this.fixOutzoom())return!1;var a=this.getMapBoundsPosition();if(!a||!a[0]||!a[1]){this.temporalyHide();return!1}this._div&&a&&this.setPixelPosition([Math.round(a[0].left),Math.round(a[0].top)],[Math.round(a[1].left),Math.round(a[1].top)]);return!0}}),g=SAPI.implimentClass("map.overlay.standartTooltip",{floatName:function(){return this.object.name},updateFloatName:function(){this.floatToolTip&&this.floatToolTip.update(this.floatName())},createDiv:function(){var a=this;this.floatToolTip=SAPI.Class("map.ext.floatHint",[this.getDiv(),function(b){return a.floatName()},this.__tooltipMode||"",{onEnter:function(){a.getDiv().style.zIndex=a.getZIndexHover()},onLeave:function(){a.getDiv().style.zIndex=a.getZIndex()}}])},showToolTip:function(){var b=a(this.getDiv()).offset(),c=SAPI.css.windowScroll(0,0),d={clientX:b.left-c.x,clientY:b.top-c.y};this.floatToolTip.showTip(d)},hideToolTip:function(){this.floatToolTip.hideTip()},reStack:function(){this.updateFloatName()}})}(),function(){var a=SAPI.implimentClass("map.overlay.zinterface",{syncZ:function(){if(this.zRecord){var a=this;this.zRecord.latLng=this.latLng,this.zRecord.LONGITUDE=this.LONGITUDE,this.zRecord.LATITUDE=this.LATITUDE,this.zRecord.getDim=function(){return a.getBBox()},this.zRecord.passToBounds=function(b){return a.passToBounds(b)}}},setObject:function(a,b){var c=this;a.event.persistent("object."+this.idKey()+".spawn",this),a.event.listen("object."+this.idKey()+".invoke",function(a,b){b.apply(c)}),this.onObjectSet&&this.onObjectSet()},eachInThis:function(a){if(!!this.zRecord){var b=this.zRecord.zbase.dirrectAccess();SAPI.each(this.zRecord.stacked,function(c,d){b[d]&&a.apply(b[d].parentContainer)})}},eachWithThis:function(a){a.apply(this),this.eachInThis(a)},ztile_show:function(a,b,c){this.map=c,this.show()},ztile_hide:function(){this.hide()},setCenter:function(){this.syncZ()},updateGeneration:function(){this.zRecord.updateGeneration()},getFinalLatLng:function(){var a=0,b=0,c=0;this.eachWithThis(function(d){var e=this.center();a+=e.x,b+=e.y,c++});var d=SAPI.map.LatLng(a/c,b/c);if(!this._zInterfaceLastPosition||!this._zInterfaceLastPosition.equal(d))this._zInterfaceLastPosition=d;return this._zInterfaceLastPosition},layers:function(){var a=this,b=SAPI.bind(function(){var a=0,b=0;for(var c in this.zRecord.layers){var d=this.map.getLayerDef(c);d&&(!a||d.priority>=b)&&(a=d,b=d.priority)}this.overrideClusterName?this.zRecord.clusterName=this.overrideClusterName:(this.zRecord.clusterName="",a&&(this.zRecord.maxLayer=a,this.zRecord.cluster=a.cluster(),this.zRecord.cluster&&(this.zRecord.clusterName=this.zRecord.cluster.mode)),this.zRecord.clusterName||(this.zRecord.clusterName="pass"))},this);return{add:function(c){a.zRecord.layers[c]=c,b(),a.updateGeneration()},remove:function(c){delete a.zRecord.layers[c],b(),a.updateGeneration()},update:b}},idKey:function(){return this.zRecord.ID_MAP_OBJECT},maybeSame:function(a){return this.idKey()==a.idKey()}})}(),function(){var b=SAPI.implimentClass("map.balloon.scheme.base",{inject:function(a,b){}}),c=SAPI.implimentClass("map.balloon.generator.dirrect",{initialize:function(a){this.parent=a},html:function(){return this.parent.balloonHTML()},patch:function(a){return this.parent.balloonPatch(a)}}),d=SAPI.implimentClass("map.balloon.frontier.base",{ballonWorker:function(){return"default"},sheme:function(){},generator:function(a){return SAPI.Class("map.balloon.generator.dirrect",[a])},html:function(a){},patch:function(a){}}),d=SAPI.implimentClass("map.balloon.frontier.simple",{Extends:["map.balloon.frontier.base"],sheme:function(){return this._sheme=SAPI.Class("map.balloon.scheme.yandex")},html:function(a){return a.balloonText()},innerGenerator:function(a,b){return SAPI.Class(a.ballonGenerator(),[a,b||this.sheme])},generator:function(a,b){b=b||this._sheme;return this.innerGenerator(a,b)},patch:function(a){}}),e=SAPI.implimentClass("map.ballon.frontier.generator.byObject",{initialize:function(a,b){this.parent=a,this.object=a.object,this.sheme=b,this.generator=a.createBallonContent()},html:function(){return this.generator.html?this.generator.html(this):""},patch:function(a){return this.generator.patch?this.generator.patch(this,a):""}}),f=SAPI.implimentClass("map.overlay.balloned",{ballon_Reference:0,$interference:{ballonFrontier:"ignore"},ballonFrontier:function(){return!1},onBallonClose:function(){this.ballon_Reference=0;return!0},onBallonAttach:function(a){this.ballon_Reference=a},onBalloonCreate:function(){return!0},ballonGenerator:function(a){var b=this.ballonFrontier();if(!b)return!1;var c=b.generator(this,a);return c},innerOpenBallon:function(){var a=this,b=this.ballonFrontier();b&&this.map.openBalloon(function(){return a.__getBallonPosition()},b,this)},__getBallonPosition:function(){var a=this.getCenter();return this.map.mapper("fromLatLngToContainerPixel",a)},__getBallonAttachNode:function(){return this.getDiv()},__BallonAttach:function(){var a=0;SAPI.event.ize(this.__getBallonAttachNode(),{click:function(){!this.map.disableBalloonOpenAtMouseUp&&!this._disableBalloonOpenAtMouseUp&&this.openBallon(),this._disableBalloonOpenAtMouseUp=0,this.map.disableBalloonOpenAtMouseUp=0;return!1}},{context:this})},openBallon:function(){this.onBalloonCreate()&&this.innerOpenBallon()},createDiv:function(a){this.__BallonAttach()}}),g=SAPI.implimentClass("map.balloon.base",{Extends:"map.overlay.point",assign:function(a,b,c,d){this.map=a,this.frontier=b,this.opener=d,this.fLatLng=c},onInject:function(){var a=this;this.sheme=this.frontier.sheme(),this.holder=this.sheme.inject(this.getDiv(),this.frontier.generator(this.opener,this.sheme)),this.sheme.onUpdate=function(){a.onReposition()},this.sheme.close=function(){a.close()},this.opener.onBallonAttach(this)},getCursor:function(){return""},onClose:function(){this.opener.onBallonClose()},beforeClose:function(){return this.sheme.beforeClose?this.sheme.beforeClose():!0},close:function(){this.map.closeBalloon(this)},setContent:function(a){this.content=a,this.setText(a.html)},injectSelf:function(a){},isTransparent:function(){return!0},event_onclick:function(){return!0},getZIndex:function(){return 80},positionChanged:function(){}}),i=SAPI.implimentClass("map.balloon.extFloater",{Extends:"map.balloon.base",isShowed:0,innerDimension:{w:0,h:0,reset:function(){this.w=this.h=0}},initialize:function(){this.isShowed=0,i.prototype.superclass.initialize.apply(this,arguments),this.innerDimension.reset()},injectSelf:function(a){if(this.isShowed!=1){if(this.isShowed==-1){this.isShowed=1,a.relativePane()[0].appendChild(this.getDiv());return}this.firsttouch=1,clearTimeout(this.shifttm),this.map=a,this.init(),a.relativePane()[0].appendChild(this.getDiv()),this.onInject(),this.positionChanged(),this.isShowed=1}},getZIndex:function(){return 1002},dejectSelf:function(a){this.isShowed=-1,clearTimeout(this.shifttm),this.remove(!0)},positionChanged:function(){this.setPosition()},innerDim:function(){var a=this.holder.getDim(),b=this.innerDimension.w?0:this.getDiv().clientWidth,c=this.innerDimension.h?0:this.getDiv().clientHeight;b?this.innerDimension.w=b:b=this.innerDimension.w,c?this.innerDimension.h=c:c=this.innerDimension.h;return{w:b,h:c*2}},init:function(a){if(!this._div){var b=0;b=this.createDiv(),b.id="mapExtFloater",b.className="sapiedBalloon balloonExtented",this.innerDimension.reset()}},onReposition:function(){this.innerDimension.reset(),this.setPosition("active")},setPosition:function(b){if(!!this._div){var c=this,d=this.fLatLng(),e=this.map.containerOffset(),f=a(this.getDiv().parentNode).offset();f||(f={left:999999,top:9999999});var g=this.map.containerDimensions(),i=this.holder.getDim(),j=this.holder.innerAttach(),k=Math.round(e.x+d.left-j.left),l=Math.round(e.y+d.top-j.top);if(this.firsttouch||b=="active"){this.firsttouch=0;if(!this.holder.IS_NOT_CONTROLLED){var m=SAPI.css.windowScroll(0,0),n=0,o=0;m.y>l-i.h-10&&(o=m.y-(l-i.h-10)),m.y>e.y+g.h&&(o=0);if(n||o){var p=SAPI.merge({},d),q=this.map.mapper("fromLatLngToContainerPixel",this.map.getPosition()),r=this.map.getBounds(),s=this.map.mapper("fromLatLngToContainerPixel",new h(r.y1,r.x2)),t=s.top-p.top-20,u=Math.min(t,o);q.left-=n,q.top-=u;var v=c.map.mapper("fromContainerPixelToLatLng",q);clearTimeout(this.shifttm),this.shifttm=setTimeout(function(){c.map.setPosition(v),a(c._div).animate({left:"+="+n,top:"+="+u},200)},300)}}}k-=f.left,l-=f.top;var w=k+"px",x=l+"px",y=0,z=0;if(isNaN(k)||isNaN(l))y=1,z=1;if(d.left<0||d.top<0||d.left>g.w||d.top>g.h)(this.firsttouch||b=="active")&&this.holder.IS_NOT_CONTROLLED&&this.holder.sourceObject&&setTimeout(function(){c.map.setPosition(c.holder.sourceObject.getCenter())},100),y=1;y||(this._div.style.cssText=this.prestyle()+"left:"+w+";top:"+x),d.left<0||d.top<0||d.left>g.w||d.top>g.h||z?this.faded||(this.faded=1,SAPI.delay(function(){a(this._div).stop(),a(this._div).hide()},{context:this})):this.faded&&(SAPI.delay(function(){a(this._div).stop(),a(this._div).show(),a(this._div).css({opacity:1}),c.holder.update()}),this.faded=0);return}}});SAPI.implimentClass("map.balloon.default",{Extends:"map.balloon.extFloater"})}(),function(){var a=SAPI.implimentClass("map.control.base",{Extends:"map.overlay.rect",cssPosition:"",p_attachPoint:"",initialize:function(a){a.position&&(this.cssPosition=a.position),a.attach&&(this.p_attachPoint=a.attach),this._controlParams=SAPI.duplicate(a)},attachPoint:function(a){arguments.length>0&&(this.p_attachPoint=a);return this.p_attachPoint},setPosition:function(){this.cssText(this.prestyle()+";"+this.cssPosition);return!0}})}(),function(){var b=SAPI.implimentClass("map.control.gridHolder",{Extends:"map.control.base",grid:{left:[],middle:[],right:[]},initialize:function(a){a=a||{},b.prototype.superclass.initialize.apply(this,[{position:a.position||"top:0px;left:0px"}])},attach:function(a,b){this.grid[a].push(b)},dettach:function(b,c){SAPI.each(this.grid[b],function(d,e){e==c&&(a(c.getDiv()).remove(),delete this.grid[b][d])})},mapAttach:function(a){b.prototype.superclass.mapAttach.apply(this,arguments),this.alleach(function(b,c,d){d.positionAbsoluted=function(){return!1},d.mapAttach(a),d.render()})},alleach:function(a){var b=this;SAPI.each(this.grid,function(c){var d=b.grid[c];SAPI.each(d,function(b){var e=d[b];e&&a(c,b,e)})})},getZIndex:function(){return!1},patch:function(){var b=this.getDiv();b.index=1,this.alleach(function(a,b,c){c.remove()}),a(".mgridbase>ul",b.parentNode).html(""),this.alleach(function(c,d,e){var f=a("ul.ul-"+c,b),g=a("<li class='ulgridin' for='"+d+"-"+c+"'></li>");a(e.getDiv()).appendTo(g),g.appendTo(f),e.patch(!0)})},getDivClassName:function(){return"mgridbase"},render:function(){this.html("<ul class='ul-left'></ul><ul class='ul-middle'></ul><ul class='ul-right'></ul>"),this.patch()}})}(),function(){var b=SAPI.implimentClass("map.balloon.scheme.yandex",{Extends:["map.balloon.scheme.base"],params:{},_div:0,_setHeight:0,initialize:function(a){this.params=a},getDiv:function(){return this._div},patch:function(){var b=this;a(".sapi-ymbw-close",this.getDiv()).unbind("click").bind("click",function(){b.close();return!1}),this.dimensionSandbox()},getInnerContext:function(){return a(".sapi-ymbw-content",this.getDiv())},dimensionSandbox:function(b){var c=this.getInnerContext();this._source.beforeDimensions&&this._source.beforeDimensions(c);var d=a("._levelone",c).outerWidth(),e=a("._levelone",c).outerHeight();this._source.afterDimensions&&this._source.afterDimensions(c);var f=b?"animate":"css";a(".sapi-ymbw-l,.sapi-ymbw-r",this.getDiv()).stop()[f]({height:e+"px"}),a(this.getDiv()).stop()[f]({left:-Math.round(d/2)+"px"}),a(".sapi-ymbw-inner",this.getDiv()).stop()[f]({width:d+"px",opacity:1}),c.css({overflow:"visible"}),c.stop()[f]({width:d,height:e}),SAPI.delay(function(){this.onUpdate()},{now:1,context:this}),this._setDim={w:d,h:e}},getDim:function(){return{w:this._setDim.w,h:this._setDim.h+20}},onUpdate:function(){},update:function(b){var c=this,d=0;this.dimensionSandbox(!b&&!!1),a("img",this.getInnerContext()).unbind("load").load(function(){clearTimeout(d),d=setTimeout(function(){c.update()},100);return!1})},detouch:function(){},html:function(a){return SAPI.supplant('<div class="sapi-ymbw sapi-ymbw_full sapi-ymbw_full_close-on sapi-ymbw_full-grey-b" style=""><div class="sapi-ymbw-inner " style=""><i class="sapi-ymbw-t"></i><div class="sapi-ymbw-close-content "><div class="sapi-ymbw-content" style=""><div class="_levelone"> {html} </div></div></div><i class="sapi-ymbw-b"></i></div><i class="sapi-ymbw-l" style=""></i><i class="sapi-ymbw-r" style=""></i><i class="sapi-ymbw-tl"></i><i class="sapi-ymbw-tr"></i><i class="sapi-ymbw-bl"></i><i class="sapi-ymbw-br"></i><i class="sapi-ymbw-tail"></i><i class="sapi-ymbw-shadow"></i><i class="sapi-ymbw-close" title="Закрыть"></i></div>',{html:a})},innerAttach:function(){return{left:0,top:0}},beforeClose:function(){return this._source&&this._source.beforeClose?this._source.beforeClose():!0},inject:function(b,c){var d=this;this._source=c,c.sheme=this,a(b).html(this.html(c.html())),this._div=a(".sapi-ymbw_full",b),this.patch(this.getDiv()),c.close=function(){d.close()},c.patch(this.getInnerContext());return this}})}(),function(){var b=Math.PI,c=Math.cos(b/4),d=Math.sin(b/4);SAPI.implimentClass("map.effect.null",{});var e=SAPI.implimentClass("map.effect.dropMarker",{__wasShownBefore:0,$interference:{show:"after",hide:"before",setPixelPosition:"before"},getTopStarter:function(){var a=this.map.getPixelBounds();return a.bottom-a.height-10-this.getPixelDim().top-SAPI.rand(10,100)/100},shadowMargin:function(){var a=this.lastPixelPosition,b=this.getTopStarter(),c=(parseInt(a.top)-b)/2,e=Math.round(c*d);return{"margin-top":-e+"px","margin-left":e+"px"}},setPixelPosition:function(){var a=0,b=this;b.eachWithThis(function(){a+=this.__wasShownBefore}),a||(this.$interference.stop=1)},show:function(){var b=this,c=0;b.eachWithThis(function(){c+=this.__wasShownBefore});var d=function(){b.eachWithThis(function(){this.__wasShownBefore=1})};if(!c){var e=this.getDiv(),f=a(e),g=this.lastPixelPosition,h=this.getTopStarter(),i=parseInt(g.top)-h,j=this.map.getPixelBounds();if(i>this.map.getPixelBounds().height*.9||i<0)f.css(g),d();else{f.css({left:g.left,top:h+"px",opacity:0});var k=this.shadowMargin(),l=0;l&&a(l).css(k),SAPI.delay(function(){l&&a(l).animate({"margin-left":"0px","margin-top":"0px"});var b=parseInt(g.top),c=1e3*Math.abs(h-b)/700;f.stop().clearQueue(),f.animate({top:g.top,opacity:1},c,function(){f.animate({top:b-8},100,function(){f.animate({top:b},100,function(){d()})})})},{timeout:100+SAPI.rand(10,1e3),context:this})}}},dropLayer:function(){_this.__wasShownBefore=0},hide:function(){if(!SAPI.val("-map.effect.dropMarker")&&!this.zRecord.invisible&&!this.zRecord.stackedIn){var b=this,c=b.$interference.stack,d=b.$interference.self,e=arguments,f=this.getTopStarter(),g=a(this.getDiv()),h=this.map.getPixelBounds(),i=this.getMapPosition();i.top>h.top&&i.top<h.bottom&&i.left>h.left&&i.left<h.right&&(SAPI.delay(function(){g.animate({top:f},function(){b.eachWithThis(function(){this.__wasShownBefore=0}),b.$irunnext(c,d,e)})},{timeout:10+SAPI.rand(10,500),context:this}),this.$interference.stop=1)}}})}(),function(){var b={ru:{"а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"i2","к":"k","л":"l","м":"m","о":"o","п":"p","р":"r","с":"c","т":"t","ч":"ch","ш":"sh","щ":"sh1","э":"ee","у":"u","х":"h","ф":"f","я":"ya","ц":"ce","ю":"iu","ы":"bl","ъ":"tv","ь":"my",end:""},en:{},postrefs:{}},c=".,-/(=+*:!?!)";for(var d=0;d<c.length;d++)b.postrefs[c.charAt(d)]="z"+d;for(var d in b.ru)b.ru[d]+="_ru";for(var d="a".charCodeAt(0);d<"z".charCodeAt(0);d++){var e=String.fromCharCode(d);b.en[e]=e+"_en"}for(var d="0".charCodeAt(0);d<"9".charCodeAt(0);d++){var e=String.fromCharCode(d);b.en[e]=e}var f=SAPI.implimentClass("map.effect.cloudmade.word",{Extends:["map.overlay.point","map.overlay.pixelDim","map.overlay.standartTooltip","sapi.animation.plug"],initialize:function(a,b,c){this.word=b,this.params=c,this.create(a)},wordFabric:function(a,c){return b[a][c]},wordImage:function(a,b){var c=this.wordFabric(a,b);!!c;return SAPI.val("map.effect.cloudmade.root")+a+"/"+c+".png"},create:function(a){var b=this.word.toLowerCase();b>="a"&&b<="z"?this.classSet="en":b>="а"&&b<="я"?this.classSet="ru":b>="0"&&b<="9"?this.classSet="en":this.classSet="postrefs",this.wordParams=this.wordImage(this.classSet,b),this.ra=this.generateWord(a)},getDivClassName:function(){return"cloudworks_"+this.classSet},floatName:function(){return"Да, вот такая чтука тут болтается :P"},generateWord:function(a){return a.image(this.wordParams,0,0,144,163)}}),g=SAPI.implimentClass("map.effect.cloudmade",{words:[],defParams:{},initialize:function(a,b){this.string=a,this.params=b},wordParams:function(a,b){return{}},start:function(a,b){this.words=[],this.RA=new Raphael(this.params.raBind,a,b);for(var c=0,d=this.string.length;c<d;c++){var e=this.string.charAt(c),f=SAPI.Class("map.effect.cloudmade.word",[this.RA,e,this.wordParams(c,e)]);this.words.push(f),f.index=c,f.ra.attr({x:a+130*c,rotation:SAPI.rand(-30,30),scale:.5})}},animate:function(a){this.eachFor(function(a,b){SAPI.delay(function(){a.ra.attr({x:800,y:300,scale:.2}),a.ra.animate({x:0+a.index*100,y:100+SAPI.rand(-50,50),rotation:-10+SAPI.rand(-10,10),scale:.7,opacity:.8},1e4-100*d,"",function(){})},300*b),SAPI.delay(function(){a.ra.stop().animate({y:SAPI.rand(-100,0),x:-100+a.index*90+SAPI.rand(-50,50),scale:1,opacity:.1},3e3)},1e4+200*b/2)})},forEach:function(a){SAPI.each(this.words,function(b,c){a(c,b)})}}),h="";SAPI.map.event.listen("map.tests.cloudmade",function(b,c){a(function(){c=c||"Я";var b=a("<div style='position:absolute;top:100px;left:20px;height:300px;z-index:10'></div>");b.appendTo(a("body"));var d=SAPI.Class("map.effect.cloudmade",[c,{raBind:b[0]}]);d.start(1024,580);var e=0,f=c.length*1500,g=-1;d.forEach(function(a,b){a.ra.attr({x:800,y:300,opacity:0,scale:.2}),a.tmo=b*3}),SAPI.animation.functor({FPS:10},function(a,b){d.forEach(function(a,c){g==-1&&(g=b.timepass);var d=b.timepass-a.tmo;d>4&&(e=Math.cos(d-4)),d>16&&(a.tmo=b.timepass);var e=1;d<0&&(e=-1),d>10&&(e=Math.cos(d-10));var f=.5;f=Math.sin(d/12*Math.PI/2);var h={scale:f+Math.sin(d/2)/6,x:800-d*25,y:300-d*20+Math.sin(d)*20,opacity:e-Math.cos(d/3)/6};a.ra.attr(h)})}),SAPI.delay(function(){b.hide()},45e3);if(0)d.eachFor(function(c,d){c.createDiv(),c.generateWord();var e=a(c.getDiv()).appendTo(b);a("div",c.getDiv()).css({position:"absolute",left:"0",top:"0"}),a(c.getDiv()).css({position:"absolute",left:d*170+"px",top:"0",width:"170",height:"170"}),a.each(a(".w",e),function(b,c){var d=a(this),e=[Math.random(),Math.random(),Math.random(),Math.random()],f=[Math.random(),Math.random(),Math.random()];SAPI.animation.functor({FPS:13,seed:Math.random(1)},function(a,b){SAPI.css.rotateElement(d,f[0]*20*Math.sin(b.timepass*f[2])),d.css({left:10*e[0]*Math.sin(b.timepass*e[1]),top:10*e[2]*Math.sin(b.timepass*e[3])})})})})})})}(),function(){var b=SAPI.implimentClass("map.effect.guidePoint",{Extends:["map.overlay.point","map.overlay.pixelDim","map.overlay.standartTooltip","map.overlay.zinterface"],__tooltipMode:"new",_Z_insertid:!1,initialize:function(a){b.prototype.superclass.initialize.apply(this),this.setCenter(a.point),this.share.key=(this.share.key||0)+1,this.ID_MAP_OBJECT="guide"+this.share.key,this.params=a},idKey:function(){return this.ID_MAP_OBJECT},getDivClassName:function(){return"guidePoint "+(this.params.className||"")},floatName:function(){return this.params.name},setupActions:function(){var b=0;SAPI.delay(function(){try{var b=a("p:first",this.getDiv()).html(""),c=Raphael(b[0],64,64);for(var d=0;d<5;d++)SAPI.delay(function(){var a=c.circle(32,32,4).attr({"stroke-width":1,stroke:"#fe9400"});a.animate({r:32,"stroke-opacity":0},3e3),SAPI.delay(function(){var a=c.circle(32,32,4).attr({"stroke-width":1,stroke:"#ae4400"});a.animate({r:32,"stroke-opacity":0},3e3)},100)},1e3*d)}catch(e){}},{timeout:500,context:this})},render:function(){var a=this;this.floatName()&&SAPI.delay(function(){this.showToolTip(),SAPI.delay(function(){this.hideToolTip()},{timeout:2e3,context:this})},{timeout:1e3,context:this}),SAPI.delay(function(){this.map.removeOverlay(this)},{timeout:8e3,context:this}),this.html("<p></p>")}})}(),function(){SAPI.implimentClass("map.ext.hmi.mouseMapDragger",{Extends:"tools.hmi.mouseDragger",process:function(a){var b=this.params.map,c=b.containerOffset(),d=b.containerDimensions();a.borderMove={x:0,y:0};var e=a.end.x,f=a.end.y+25,g=0;(g=c.x-a.end.x)>0&&(e=c.x,a.borderMove.x=g>50?-2:-1),(g=c.y-a.end.y)>0&&(f=c.y,a.borderMove.y=g>50?-2:-1);var h={x:c.x+d.w,y:c.y+d.h};(g=a.end.x-h.x)>0&&(e=h.x,a.borderMove.x=g>50?2:1),(g=a.end.y-h.y)>0&&(f=h.y,a.borderMove.y=g>50?2:1),a.borderMove.active=a.borderMove.x||a.borderMove.y,a.wx=e,a.wy=f;return a}});var b=SAPI.implimentClass("map.effect.dragable",{draggingEnabled:!1,draggingState:0,draggOptions:{},enableDrap:function(a){this.draggingEnabled=a,this.checkDraggState()},createDiv:function(){this.checkDraggState(),this.draggitize()},shakerAnimator:0,shake:function(b){this.shakerAnimator||(this.shakerAnimator={fn:0});var c=this,d=a(this.getDiv());if(b){if(this.shakerAnimator.fn)return;this.shakerAnimator.pos=d.position(),this.shakerAnimator.fn=SAPI.animation.functor({FPS:12},function(a,b){var e=-Math.abs(Math.round(Math.sin(b.timepass*5)*3));d.css({top:e+c.shakerAnimator.pos.top})})}else this.shakerAnimator.fn&&(d.css(this.shakerAnimator.pos),this.shakerAnimator.fn.stop(),this.shakerAnimator=0)},draggitize:function(){var a={mousedown:function(){this.draggingEnabled&&(this.shake(0),this.dragger.start())},mouseover:function(){this.draggingEnabled&&!this.dragger.active&&this.shake(1)},mouseout:function(){this.shake(0)},mouseup:function(){this.dragger.stop()}};this.draggOptions=SAPI.merge({startShift:2},this.draggOptions),SAPI.event.ize(this.getDiv(),a,{context:this,stopBubbling:"all"})},checkDraggState:function(){var a=this,b={x:0,y:0},c=0;this.dragger||(this.dragger=SAPI.Class("map.ext.hmi.mouseMapDragger",[{map:this.map,functor:function(d,e){d=="start"?(c||(c=SAPI.Class("map.ext.borderMoveAnimator").get(a.map,b),c.start()),a.draggingState="start",a.onDragStart()):d=="end"?(a.draggingState=="move"&&(a._disableBalloonOpenAtMouseUp=1,a.onDragEnd()),b.x=0,b.y=0,c&&c.stop(),a.draggingState=0):e&&a.draggingState&&e&&(a.draggingState=="move"||Math.abs(e.delta.x)+Math.abs(e.delta.y)>a.draggOptions.startShift)&&(b.x=e.borderMove.x,b.y=e.borderMove.y,a.draggingState="move",a.onDrag(e))}}]))},onDragStart:function(){},onDragEnd:function(){},onDrag:function(a){var b=this.map.containerOffset(),c=this.map.mapper("fromContainerPixelToLatLng",{left:a.end.x-b.x,top:a.end.y-b.y+10});this.setCenter(c),this.setPosition()}})}(),function(){var b=0,c=SAPI.implimentClass("map.ext.floatHint",{initialize:function(a,d,e,f){e?e=="twin"?e=this:(this.tearUp(),e=this):(b||(b=1,b=new c(0,0,1),b.tearUp()),e=b),this.floatToolDiv_element=0;if(a){a._floatNameFunction=d,a._callbacks=f||{};var g={mousemove:function(b){e.onmouse(b,a);return!1},mouseover:function(b){e.onmouse(b,a);return!1},mouseout:function(b){e.outmouse(b,a)}};SAPI.event.ize(a,g),this.hideTip=function(b){e.outmouse(b,a)},this.showTip=function(b){e.onmouse(b,a)}}},tearUp:function(){var b=SAPI.rootNode(),c=document.createElement("div");c.style.position="absolute",c.setAttribute("id","sapi_map_float_tooltip"),c.className="nav_pointer",c.innerHTML="",c.style.display="none",b.appendChild(c),this._tool_div=c,this.$_tool_div=a(c),this.$_tool_div.css({opacity:0}),this.lastText="",this.fade=1},outmouse:function(a,b){b._callbacks&&b._callbacks.onLeave&&b._callbacks.onLeave(),this._tool_div&&(SAPI.clearTimeout(this.delayHide),this.delayHide=SAPI.delay(function(){var a=this.$_tool_div;a.stop().animate({opacity:0,marginLeft:"+=5",marginTop:"-=20"},300,function(){a.css({marginLeft:"-5",marginTop:"20"}),a.hide()}),this.fade=1},{timeout:this.animated?400:50,context:this}))},update:function(a){a!=this.lastText&&this._tool_div&&(this._tool_div.innerHTML=a),this.lastText=a},onmouse:function(b,c){if(!!this._tool_div){SAPI.clearTimeout(this.delayHide),this.update(c._floatNameFunction(c)),c._callbacks&&c._callbacks.onEnter&&c._callbacks.onEnter();var d=25,e=5,f=b.clientX+d,g=b.clientY+e;if(this.fade){this.fade=0;var h=this;this.animated=1,this.$_tool_div.stop().css({display:"inline"}).animate({opacity:1,marginLeft:0,marginTop:0},300,function(){h.animated=0})}var i=SAPI.css.windowScroll(0,0),j=SAPI.css.windowScroll(f,g);f=j.x,g=j.y,f<0&&(f=b.clientX+d),g<0&&(g=b.clientY+e);var k={},l={w:a(window).width(),h:a(window).height()},m={w:a(this._tool_div).outerWidth(),h:a(this._tool_div).outerHeight()},n={w:a(this._tool_div).innerWidth(),h:a(this._tool_div).innerHeight()};f+m.w>l.w-i.x-11?(k.left=f-(m.w+30)+"px",k.right="auto"):(k.left=+Math.round(f)+"px",k.right="auto"),g+m.h-i.y>l.h?k.top=+(l.h-(m.h-i.y))+"px":k.top=+Math.round(g)+"px";var o=parseInt(k.top);o>1&&!isNaN(o)&&k.left!="0px"||(k.top="-999px"),this.$_tool_div.css(k)}}})}(),function(){SAPI.implimentClass("map.ext.borderMoveAnimator",{get:function(a,b){return SAPI.animation.functor({FPS:10},function(c,d){if(b.x||b.y){var e=a.mapper("fromLatLngToContainerPixel",a.getPosition());e.left+=b.x*Math.max(50,d.ticktime*50),e.top+=b.y*Math.max(50,d.ticktime*50),a.setPosition(a.mapper("fromContainerPixelToLatLng",e))}})}})}(),SAPI.event.persistent("map.worker.zoneready",l);var t={api:l};SAPI.val("api.map.worker",t)})(jQuery,SAPI.map)}}(),function(a,b,c){function f(a){d=a}function e(a){for(var b=0,c=a.length;b<c;++b)(function(a,b,c){b[a]()})(b,a,g)}var d=null;f([function(){var a={activeFilters:[],only:function(a){this.block="all",this.pass=a,this.filter.apply()},add:function(a){this.filter.apply()},remove:function(a){this.filter.apply()},create:function(a){this.filter=SAPI.Class("map.filter.eSosedi",[this])}};SAPI.val("eSosedi.filtrator",a),SAPI.implimentClass("map.filter.eSosedi",{Extends:"map.filter.base",initialize:function(a){this.parent=a},filter:function(a){var b=a.object,c=!0,d=this.params;this.parent.block=="all"&&(c=!1),this.parent.pass&&!this.parent.pass.Pages;return{result:c}}}),a.create(),SAPI.map.zone.event.listen("map.ready",function(){SAPI.map.zone.filter().add(a.filter)})},function(){(function(){var a=SAPI.implimentClass("map.balloon.scheme.eSosedi",{Extends:["map.balloon.scheme.base"],params:{},_div:0,_setHeight:0,IS_NOT_CONTROLLED:!0,initialize:function(a){this.params=a},getDiv:function(){return this._div},patch:function(){var a=this;c(".balloonClose",this.getDiv()).unbind("click").bind("click",function(){a.close();return!1}),this.dimensionSandbox()},getInnerContext:function(){return c(".balloonBody",this.getDiv())},dimensionSandbox:function(a){var b=this.getInnerContext();this._source.beforeDimensions&&this._source.beforeDimensions(b);var d=b;d.stop();var e=d.width(),f=d.height();d.css({width:"auto",height:"auto",overflow:"visible"});var g=c("._levelone",b).outerWidth(),h=c("._levelone",b).outerHeight();this._source.afterDimensions&&this._source.afterDimensions(b),d.css({width:e,height:f,overflow:"hidden"});var i=a?"animate":"css";c(this.getDiv()).stop()[i]({left:-Math.round(g/2)+"px"},50),b[i]({width:g,height:h,opacity:1},50),SAPI.delay(function(){this.onUpdate()},{now:1,context:this}),this._setDim={w:g,h:h}},getDim:function(){return{w:this._setDim.w,h:this._setDim.h+20}},onUpdate:function(){},scheduleUpdate:function(a,b){clearTimeout(this._updatetm);var c=this;this._updatetm=setTimeout(function(){c._update(b)},Math.max(10,a))},_update:function(a){clearTimeout(this._updatetm);var b=this,d=0;this.dimensionSandbox(!a&&!0),c("img",this.getInnerContext()).unbind("load").load(function(){b.scheduleUpdate(10);return!1})},update:function(a){a?this._update():this.scheduleUpdate(10)},detouch:function(){},html:function(a){return SAPI.supplant('<div class="deltaBalloon sapiedBalloon" style=""><div class="balloonBody" style=""><div class="balloonDimensor" style=""><div class="_levelone"> {html} </div></div></div><div><i class="balloonTailPRE"></i><i class="balloonTail"></i><i class="balloonClose" title="Закрыть"></i></div></div>',{html:a})},innerAttach:function(){return{left:0,top:0}},beforeClose:function(){return this._source&&this._source.beforeClose?this._source.beforeClose():!0},inject:function(a,b){var d=this;this._source=b,this.sourceObject=b.parent,b.sheme=this,c(a).html(this.html(b.html())),this._div=c(".deltaBalloon",a),this.patch(this.getDiv()),b.close=function(){d.close()},b.patch(this.getInnerContext());return this}})})()},function(){SAPI.implimentClass("eSosedi.balloon.frontier",{Extends:["map.balloon.frontier.base"],sheme:function(){return this._sheme=SAPI.Class("map.balloon.scheme.eSosedi")},html:function(a){return a.balloonText()},innerGenerator:function(a,b){return SAPI.Class(a.getBalloonGenerator(),[a,this.sheme])},generator:function(a,b,c){b=b||this._sheme;return a.zRecord.stackCNT>1&&b!="single"?SAPI.Class("eSosedi.ballon.generator.stacked",[a,this.sheme]):this.innerGenerator(a,c)},patch:function(a){}});var a=SAPI.implimentClass("eSosedi.ballon.generator.stacked",{initialize:function(a,b){this.parent=a,this.object=a.object,this.sheme=b},html:function(){var a="",b=0,c=[];a+='<div class="ballonContentStacked">',this.parent.eachWithThis(function(){c[b]=this,b++}),this.innerIds=c,a+="</div>",a+='<div class="stackedIndex"><ul>';for(var d=0;d<b;++d)a+='<li balloonid="'+d+'" class="bli'+d+'">'+d+"</li>";a+="</ul></div>";return a},patch:function(a){var b=this,d=c(".bc"+this.parent.idKey(),a),e=c(".stackedIndex li",a);e.each(function(){var a=c(this),d=a.attr("balloonid"),e="#"+d+" "+b.innerIds[d].floatName();SAPI.Class("map.ext.floatHint",[this,function(a){return e}])}),e.click(function(){var a=c(this),d=a.attr("balloonid"),f=b.innerIds[d],g=f.ballonGenerator("single"),h=c(".ballonContentStacked");g.sheme=this.sheme,h.html(g.html()),e.removeClass("active"),c(".bli"+d).addClass("active"),g.patch(h,b.sheme),b.sheme.scheduleUpdate(100)}),c(".bchead2",a).hide(),c(".bli0").click(),this.sheme.update(!0),this.sheme.update()}})},function(){var b=SAPI.implimentClass("eSosedi.ballon.generator.base",{initialize:function(a,b){this.parent=a,this.object=a.object,this.sheme=b},bottomLine:function(a){var b=[];b.push("<div class='pre_ender'><div class='ender'>"),b.push("<span class='ender-line' style='padding: 0 10px'>"),this.generateBottomLine(b),b.push("</span>"),b.push("</div></div>");return b.join("\n")},generateBottomLine:function(a){a.push("<a href='"+this.getTargetLink()+"' class='gotoObject'>перейти к описанию</a>")},getTargetLink:function(){return this.parent.getTargetLink()},html:function(){var a="";a+="<div class='balCon'>",a+="<div class='bh1'>",a+="<h1>"+this.object.Name+"</h1>",a+="</div>",a+="<div class='balloonContext'>";var b=this.generateMenu();a+="<ul class='menu'>";for(var c in b)a+="<li><span>"+c+"</span></li>";a+="</ul>",a+='<div class="content" style="padding: 0 10px">';for(var c in b)a+='<div class="dtab">'+b[c].call(this)+"</div>";a+="</div>",a+=this.bottomLine(),a+="</div>",a+="</div>";return a},generateMenu:function(){return{}},beforeClose:function(){return!0},patch:function(d,e){var f=this;this.sheme=e||this.sheme,b.prototype.superclass.patch&&b.prototype.superclass.patch.apply(this,arguments);var g=0;c.each(c(".content>div",d),function(){c(this).html().length<3?c(".menu>li:eq("+c(this).prevAll().length+")",d).hide():(c('<br class="clear" />').appendTo(this),g++)}),g<2&&c(".menu",d).hide(),c(".bh1 h1",d).click(function(){a.location.href=f.getTargetLink()}).css({cursor:"pointer"}),c(".menu>li",d).click(function(){c(".content>div",d).removeClass("selected"),c(".menu>li",d).removeClass("selected");var a=c(this).prevAll().length,b=c(".content>div:eq("+a+")",d);b.addClass("selected"),f["onTab"+a+"Activate"]&&f["onTab"+a+"Activate"](b),c(this).addClass("selected"),f.sheme.update()}),c(".balloonContext",d).css({display:"block"}),c(".menu>li:eq(0)",d).click(),c(d).delegate("img","load",function(){f.sheme.update()}),f.sheme.update();return this},beforeDimensions:function(a){c(".ender",a).css({position:"relative",width:"auto"})},afterDimensions:function(a){c(".ender",a).css({width:c(".ender",a).width()-2})}})},function(){var a=SAPI.implimentClass("eSosedi.balloon.Image",{Extends:["eSosedi.ballon.generator.base"],generateBottomLine:function(a){a.push("изображение с <a href='http://www.panoramio.com/photo/"+this.parent.panoramioId+"'>Panoramio</a><br>Расширенная информация доступна на странице описания")},generateMenu:function(){var a="http://mw2.google.com/mw-panoramio/photos/medium/"+this.parent.panoramioId+".jpg",b="ballon-image-"+this.parent.panoramioId,d=new Image;return{image:function(){d.onload=function(){var e=Math.min(300,d.height),f=d.width*(e/d.height);c("#"+b).css({width:f,height:e}).attr("src",a),c("#"+b+"_l").hide()},d.src=a;return"<center><a href='"+this.getTargetLink()+"' title='Перейти на страницу описания'><img  border=0 id='"+b+"' src=''></a><p id='"+b+"_l'>загрузка</p></center>"}}}})},function(){(function(){var a=SAPI.implimentClass("eSosedi.map.entity.imagePanoramio",{Extends:["map.overlay.point","map.overlay.pixelDim","map.overlay.standartTooltip","map.overlay.zinterface","map.overlay.balloned"],initialize:function(b){a.prototype.superclass.initialize.apply(this),this.setCenter(b.centerPoint),this.object=b,this.panoramioId=b.id.substr(1),this.mapImg="http://mw2.google.com/mw-panoramio/photos/mini_square/"+this.panoramioId+".jpg",this.setPixelDim({left:40,top:40})},idKey:function(){return this.ID_MAP_OBJECT},getDivClassName:function(){return"map_img_rect"},floatName:function(){return this.object.Name},getLayerClass:function(){return this.object.visibleClassType},getZIndex:function(){return 400},getZIndexHover:function(){return 1e3},createRootNode:function(){return b.createElement("img")},patch:function(){var a=new Image,b=this;this.getDiv().style.display="none",a.onload=function(){b.getDiv().src=b.mapImg,b.getDiv().style.display="",3},a.src=this.mapImg},render:function(){this.setPixelDim({left:40,top:40})},getTargetLink:function(){return DRR+"images/panoramio/"+this.panoramioId+"/index.html"},ballonFrontier:function(){var a=this;return SAPI.Class("eSosedi.balloon.frontier")},getBalloonGenerator:function(){return"eSosedi.balloon.Image"}})})()},function(){var a=SAPI.implimentClass("eSosedi.balloon.POI",{Extends:["eSosedi.ballon.generator.base"],_onGenerateAbout:function(a,b){function d(a,b){var c=[];for(var d in a)a.hasOwnProperty(d)&&c.push(a[d]);return c.join(b)}var e="";a.cat&&(e="<br>категории: "+a.cat.join(", ")),c("."+b).html(a.text+e);var f=c("."+b).parents(".balloonContext").find(".ender-line"),g=c("<br/><div class='ballonActions'><span>"+d(a.actions,"</span><br/><span>")+"</span></div>");g.appendTo(f),a.needInfo&&c(".gotoObject",f).html("дополнить описание!").attr("href",this.getTargetLink()+"?edit")},generateMenu:function(){var a=this,b="ballon-popup-"+this.parent.idKey();return{"описание":function(){c.ajax({url:DataCenter+"loader/map_interactive.php?asjson&id="+a.parent.idKey(),dataType:"json",success:function(c){a._onGenerateAbout(c,b),a.sheme.update&&a.sheme.update()},error:function(){c("."+b).html("Произошла ошибка загрузки данных")}});return"<div class='"+b+"'>загрузка</div>"}}}})},function(){var b=SAPI.implimentClass("eSosedi.balloon.Nav",{Extends:["eSosedi.balloon.POI"],_onGenerateAbout:function(d,e){var f=this;b.prototype.superclass._onGenerateAbout.call(this,d,e),c("."+e).click(function(){a.location.href=f.getTargetLink()});var g=c("."+e).parents(".balloonContext").find(".ender-line");c("<a href='#' style='position:absolute;right:3px;top:3px'> Приблизить</a>").click(function(){f.parent.map.toBounds(f.parent.getBounds());return!1}).appendTo(g)}})},function(){(function(){var b=SAPI.implimentClass("eSosedi.map.entity.navRectangle",{Extends:["map.overlay.rect","map.overlay.pixelDim","map.overlay.standartTooltip","map.overlay.zinterface","map.overlay.balloned"],initialize:function(a){b.prototype.superclass.initialize.call(this),this.setBounds(SAPI.map.LatLng(a.bounds[0][0],a.bounds[0][1]),SAPI.map.LatLng(a.bounds[1][0],a.bounds[1][1])),this.object=a,this.id_navObject=a.id.substr(1)},idKey:function(){return this.ID_MAP_OBJECT},getDivClassName:function(){return"map_div_rect iePNG"+(aCurrentUser.nav_in==this.id_navObject?" map_div_rect_hover":"")},floatName:function(){return this.object.Name},getLayerClass:function(){return this.object.visibleClassType},getZIndex:function(){return this.object.zIndex},patch:function(){},passToBounds:function(a){var c=0;this._mapBoundsPosition&&this._mapBoundsPosition.zoom==this.map.getZoom()?c=this._mapBoundsPosition.position:c=this.getMapBoundsPosition();var d=Math.abs(c[0].left-c[1].left),e=Math.abs(c[0].top-c[1].top),f=d<9||e<9;return d>700||e>700||f?!1:b.prototype.superclass.passToBounds.call(this,a)},setPixelPosition:function(d,e){b.prototype.superclass.setPixelPosition.call(this,d,e);var f=e[0]-d[0],g=e[1]-d[1],h=4*(this.floatName().length+.1),i=f/h;this.infoLine=this.infoLine||c(".navInfoLine",c(this.getDiv()))[0];var j=f<20||g<20;this.getDiv().style.display=!a.__sapi_z_overloaded||!j?"":"none",this.infoLine.style.display=i<1||g<50?"none":"",this.infoLine.style.fontSize=i<1.5?10:12},render:function(){this.html("<div class='map_td_rect'><a href='"+this.getTargetLink()+"' class='navInfoLine nav_td_link' style='display:none'>"+this.floatName()+"&nbsp;</a>"+"</div>")},getTargetLink:function(){return DRR+"onmap/clicked/"+this.idKey().substr(1)+"/index.html"},ballonFrontier:function(){var a=this;return SAPI.Class("eSosedi.balloon.frontier")},getBalloonGenerator:function(){return"eSosedi.balloon.Nav"}})})()},function(){(function(){var a={};a[11]=1,a[12]=1,a[13]=1,a[30]=1,a[31]=1,a[32]=1,a[34]=1,a[35]=1,a[40]=1,a[41]=1,a[50]=1,a[52]=1,a[55]=1,a[60]=1,a[62]=1,a[64]=1,a[65]=1,a[70]=1,a[71]=1,a[72]=1,a[73]=1,a[80]=1,a[81]=1,a[82]=1,a[53]=1,a[61]=1,a[67]=1,a[33]=1,a[51]=1,SAPI.val("eSosedi.Pages.IconMapia",a);var b={};b[1]="mounting",b[2]="drugstore",b[3]="wow",b[4]="cafe",b[5]="cloth",b[6]="supermarket",b[7]="bar",b[8]="spare-parts",b[9]="universities",b[10]="hospitals",b[11]="sport",b[12]="interesting-place",b[13]="theaters",b[14]="motels",b[15]=b[3],b[16]=b[3],b[17]=b[3],b[18]="restaurants",b[19]="fastfood",b[20]="bar",b[21]=b[4],b[22]="gaz-station",b[23]=b[1],b[24]=b[1],b[25]=b[1],b[26]=b[7],b[27]=b[7],b[28]="cinema",b[29]=b[7],b[30]=b[7],b[31]=b[7],b[32]=b[5],b[33]=b[5],b[34]=b[5],b[35]=b[5],b[36]=b[5],b[37]=b[5],b[38]=b[5],b[39]=b[5],b[40]=b[5],b[41]=b[8],b[42]=b[8],b[43]=b[5],b[44]="school",b[45]=b[9],b[46]=b[11],b[47]=b[11],b[48]="swimming-pools",b[49]=b[11],b[50]=b[8],b[51]=b[5],b[52]=b[5],b[53]=b[1],b[54]=b[5],b[55]="Fitness",b[56]="hairdressing",b[57]=b[8],b[58]=b[10],b[59]="consultations",b[60]=b[5],b[61]="libraries",b[65]=b[5],b[66]=b[11],b[68]="supermarket",b[69]=b[1],b[70]=b[9],b[71]=b[9],b[72]=b[8],b[73]=b[8],b[74]=b[1],b[75]=b[8],b[77]=b[1],b[78]=b[5],b[79]=b[10],b[80]=b[1],b[81]=b[10],b[82]=b[8],b[83]="military",b[84]=b[1],b[85]=b[1],b[86]="police",b[87]="Courts",b[89]="registry-office",b[90]=b[1],b[91]="cafe",b[92]=b[5],b[93]=b[1],b[94]=b[10],b[95]=b[5],b[96]=b[10],b[100]="post-office",b[101]=b[8],b[103]="building-goods",b[104]=b[9],b[105]=b[5],b[106]=b[8],b[113]=b[9],SAPI.val("eSosedi.Pages.Icons",b),SAPI.implimentClass("eSosedi.Pages.IconsSetup",{})})()},function(){(function(){var a=SAPI.val("eSosedi.Pages.Icons"),b=SAPI.implimentClass("eSosedi.map.entity.Pages",{Extends:["map.overlay.point","map.overlay.pixelDim","map.overlay.standartTooltip","map.overlay.zinterface","map.overlay.balloned"],initialize:function(a){b.prototype.superclass.initialize.apply(this),this.setCenter(a.centerPoint),this.object=a,this.parsedName=a.Name.split("(").join("<i>(")+"</i>",this.setPixelDim({left:23,top:27})},idKey:function(){return this.ID_MAP_OBJECT},getDivClassName:function(){var b=a[this.object.iconState];return"map_poi_marker w_init w-"+(b||"wow")+"_png"},floatName:function(){return this.parsedName},getLayerClass:function(){return this.object.visibleClassType},getZIndex:function(){return 1450},setPixelPosition:function(){var a=this.map.getZoom()<14;c(this.getDiv())[a?"addClass":"removeClass"]("map_poi_marker_mini"),c(this.getDiv())[a?"removeClass":"addClass"]("w_init"),b.prototype.superclass.setPixelPosition.apply(this,arguments)},render:function(){this.html("&nbsp;"),this.setPixelDim({left:23,top:27})},getTargetLink:function(){return DRR+"pages/clicked/"+this.idKey().substr(1)+"/index.html"},ballonFrontier:function(){var a=this;return SAPI.Class("eSosedi.balloon.frontier")},getBalloonGenerator:function(){return"eSosedi.balloon.POI"}})})()},function(){var a=SAPI.implimentClass("eSosedi.balloon.Twitter",{Extends:["eSosedi.ballon.generator.base"],_onGenerateAbout:function(a,b){function d(a,b){var c=[];for(var d in a)a.hasOwnProperty(d)&&c.push(a[d]);return c.join(b)}var e="";a.cat&&(e="<br>категории: "+a.cat.join(", ")),c("."+b).html(a.text+e);var f=c("."+b).parents(".balloonContext").find(".ender-line"),g=c("<div class='ballonActions'><span>"+d(a.actions,"</span>&nbsp;<span>")+"</span></div>");g.appendTo(f)},generateMenu:function(){var a=this,b="ballon-popup-"+this.parent.idKey();return{"описание":function(){c.ajax({url:DataCenter+"loader/map_interactive.php?asjson&id="+a.parent.idKey(),dataType:"json",success:function(c){a._onGenerateAbout(c,b),a.sheme.update&&a.sheme.update()},error:function(){c("."+b).html("Произошла ошибка загрузки данных")}});return"<div class='"+b+"'>загрузка</div>"}}}})},function(){SAPI.implimentClass("eSosedi.Twitter.IconsSetup",{}),SAPI.val("eSosedi.Twitter.Icons",[{img:"user_1",type:0,cssclass:"w-note_png",title:"общая информация"},{img:"ico_help",type:1,cssclass:"w-information_png",title:"Что за хрень?"},{img:"auto_1",type:2,cssclass:"w-ahtung_png",title:"ВАЖНО!"},{img:"auto_2",type:3,cssclass:"w-repair_png",title:"Роем"},{img:"auto_4",type:4,cssclass:"w-full_ahtung_png",title:"Внимание"},{img:"ico_comment",type:5,cssclass:"w-interesting_place_png",title:"Путевая заметка"},{img:"ico_piece",type:6,cssclass:"w-link_png",title:"Информация по ссылке"},{img:"heartbeat",type:7,cssclass:"w-my_love_png",title:"Моя любовь"}])},function(){(function(){function a(a){for(var c in b)if(c&&b[c]&&b[c].img&&b[c].type==a)return c;return 0}var b=SAPI.val("eSosedi.Twitter.Icons"),d=SAPI.implimentClass("eSosedi.map.entity.Twitter",{Extends:["map.overlay.point","map.overlay.pixelDim","map.overlay.standartTooltip","map.overlay.zinterface","map.overlay.balloned"],initialize:function(c){d.prototype.superclass.initialize.apply(this),this.setCenter(c.centerPoint),this.object=c,this.object.Text=c[12],this.cssClass=b[a(c.iconState)].cssclass},idKey:function(){return this.ID_MAP_OBJECT},getDivClassName:function(){var a=b[this.object.iconState].cssclass;return"map_twitter_marker w_init "+a},floatName:function(){return this.object.Name},getTargetLink:function(){return DRR+"twitter/clicked/"+this.idKey().substr(1)+"/index.html"},getZIndex:function(){return 1451},setPixelPosition:function(){var a=this.map.getZoom()<15;c(this.getDiv())[a?"addClass":"removeClass"]("map_twitter_marker_mini"),c(this.getDiv())[a?"removeClass":"addClass"]("w_init"),d.prototype.superclass.setPixelPosition.apply(this,arguments)},getLayerClass:function(){return this.object.visibleClassType},render:function(){this.html("&nbsp;")},ballonFrontier:function(){var a=this;return SAPI.Class("eSosedi.balloon.frontier")},getBalloonGenerator:function(){return"eSosedi.balloon.Twitter"}})})()},function(){(function(){function b(a){if(!a)return[];var b=SAPI.val("eSosedi.map.layer"),c=a.split("\n"),d,e=[];for(var f=0,g=c.length;f<g;f++){if(c[f]=="")continue;if(f!=0&&f>1){d=c[f].split("|");var h=d[0],i=0,j=parseInt(d[1]),k=parseInt(d[2]),l=parseInt(d[3]),m=parseInt(d[4]),n=d[5],o=d[6],p=d[7],q=d[9],r=d[11]||"",s=j/1e6,t=l/1e6,u=k/1e6,v=m/1e6,w=[[u,s],[-v+u,t+s]],x=[u,s],y={};y.id=h,y.setPoint=[j,l,k,m],y.zIndex=Math.max(0,Math.min(1e4,Math.ceil(3e5/(Math.abs(parseInt(d[3]))+Math.abs(parseInt(d[4])))))),y.bounds=w,y.city_link=d[8],y.Name=o,y.Type=parseInt(n),y.po=q,y.images=r,y.dimSize=parseInt(m+l)+Math.random()*1e3,y.centerPoint=x,y.iconState=p;var z=0;switch(y.Type){case 1:break;case 3:z=SAPI.Class("eSosedi.map.entity.imagePanoramio",[y]),z.onObjectSet=function(){this.layers().add(b.images.getId())};break;case 4:z=SAPI.Class("eSosedi.map.entity.Twitter",[y]),z.onObjectSet=function(){this.layers().add(b.twitter.getId())};break;case 6:z=SAPI.Class("eSosedi.map.entity.Pages",[y]),z.onObjectSet=function(){this.layers().add(b.poi.getId())};break;case 7:z=SAPI.Class("eSosedi.map.entity.Stackable",[y]),z.onObjectSet=function(){this.layers().add(b.images.getId())};break;default:z=SAPI.Class("eSosedi.map.entity.navRectangle",[y]),z.onObjectSet=function(){this.layers().add(b.nav.getId())}}z&&(z.ID_MAP_OBJECT=y.id,e.push(z))}}return e}var d=SAPI.implimentClass("map.reader.eSosedi.zxy",{Extends:"map.reader.base",initialize:function(a){this.set=a},assignTarget:function(a){return SAPI.val("conf.DataCenter.ztile")+a.z+".xy"},readerCallback:function(c,d){var e={layer:{},objects:b(c)};e.objects.length<50&&(e.layer.final=1),e.objects.length||a.console&&console.log("has no objects"),a.console&&console.log(e.objects.length," objects loaded from",d),e.objects.length&&(d.run(e),this.map.event.trigger("reader."+this.lup.id_name+".done"))},errorCallback:function(a){a.run(result)},load:function(b){this.map.event.trigger("reader."+this.lup.id_name+".reading");var d=this;c.ajax({url:b.target,success:function(a){setTimeout(function(){d.readerCallback(a,b)},1)},error:function(c,e){setTimeout(function(){a.console&&console.log("error loading data",c,e),d.errorCallback(b)},1)}});return!0}})})()},function(){(function(){var a=SAPI.implimentClass("map.reader.eSosedi.twitter.zxy",{Extends:"map.reader.eSosedi.zxy",initialize:function(a){this.set=a},assignTarget:function(a){return SAPI.val("conf.DataCenter.ztile")+"tw/"+a.z+".xy"}})})()},function(){SAPI.implimentClass("eSosedi.map.Startup",{}),SAPI.map.zone.event.listen("map.ready",function(){var a=SAPI.map.zone.describeLayer({name:"eSosediXY",idname:"xy_all",priority:1,reader:function(){return{name:"map.reader.eSosedi.zxy",codes:[{markerFactory:function(){return"eSosedi.map.entity.auto"}}]}},cluster:function(){return{mode:"map-general",layer:1}},filter:function(a,b){return a}}),b=SAPI.map.zone.describeLayer({name:"navRect",idname:"nav_rect",priority:99,reader:function(){return!1},cluster:function(){return{mode:"map-general",layer:1}},filter:function(){return!0}}),c=SAPI.map.zone.describeLayer({name:"poiLayer",idname:"poi_layer",priority:10,reader:function(){return!1},cluster:function(){return{mode:"POI-general",layer:1}},filter:function(){return!0}}),d=SAPI.map.zone.describeLayer({name:"imagesLayer",idname:"img_layer",priority:5,reader:function(){return!1},cluster:function(){return{mode:"images-general",layer:1}},filter:function(){return!0}}),e=SAPI.map.zone.describeLayer({name:"twitterLayer",idname:"twitter_layer",priority:9,reader:function(){return!1},cluster:function(){return{mode:"POI-general",layer:1}},filter:function(){return!0}}),f=SAPI.map.zone.describeLayer({name:"mymap",idname:"spawn_mymap",priority:100,reader:function(){return!1},cluster:function(){return{mode:"general-dragUnfiltred",layer:1}},filter:function(){return!0}});SAPI.map.zone.event.trigger("cluster.type.add",{group:"map",name:"general",clu:"pass",limit:500}),SAPI.map.zone.event.trigger("cluster.type.add",{group:"POI",name:"general",clu:"point",limit:100}),SAPI.map.zone.event.trigger("cluster.type.add",{group:"images",name:"general",clu:"point",limit:50}),SAPI.map.zone.event.trigger("cluster.type.add",{group:"general",name:"dragUnfiltred",clu:"pass",defaults:!0}),SAPI.console.log("enabling data layer"),a.enable(),b.enable(),c.enable(),d.enable(),e.enable(),f.enable(),SAPI.val("eSosedi.map.layer",{nav:b,poi:c,images:d,twitter:e})})},function(){(function(){var a=SAPI.implimentClass("eSosedi.map.editor.Rectangle",{Extends:["map.overlay.rect","map.overlay.pixelDim","map.overlay.standartTooltip","map.overlay.zinterface"],initialize:function(b){a.prototype.superclass.initialize.apply(this),this.setBounds(b.bounds.getLT(),b.bounds.getRB()),this.object=b,this.i_editBounds=SAPI.Class("tools.hmi.editBounds");var c,d=this,e={};this.i_editBounds.link({callback:function(a,b){e=SAPI.merge({},e,b);if(!d._positioning){var c={left:e.left+d.leftTop[0],top:e.top+d.leftTop[1]},f=d.map.mapper("fromDivPixelToLatLng",c),g=d.map.mapper("fromDivPixelToLatLng",{left:c.left+e.width,top:c.top+e.height});d.setBounds(f,g),d.editMoved=!0,d.setPosition()}},timeout_ShowHide:function(a){clearTimeout(c),c=a}})},idKey:function(){return"_editorRect"},getDivClassName:function(){return"mapia_edit_rectangle iePNG"},floatName:function(){return"Изменяя это выделение<br/>Вы определяете вид обьекта"},getLayerClass:function(){return"editor"},getZIndex:function(){return 1e5},setPixelPosition:function(b,c){a.prototype.superclass.setPixelPosition.call(this,[0,0],[0,0]);var d=c[0]-b[0],e=c[1]-b[1];this._positioning=1,this.leftTop=[0,0],this.i_editBounds.sizeChange("set",{left:b[0],top:b[1],width:d,height:e}),this._positioning=0},patch:function(){var a=this;this.i_editBounds.inject(this.getDiv()),c("<a href='javascript:finish_edit_rectangle()'>добавить место</a>").appendTo(c(".extdragEdit",this.getDiv())).css({top:-27,right:-20,position:"absolute",display:"block",color:"#000",backgroundColor:"#EEE",border:"1px solid #000",padding:2}),this.i_editBounds.show(150)},render:function(){this.html("")}})})()},function(){(function(){function f(c,d){b.attachEvent!=null?(c=c+(b.documentElement.scrollLeft?b.documentElement.scrollLeft:b.body.scrollLeft),d=d+(b.documentElement.scrollTop?b.documentElement.scrollTop:b.body.scrollTop)):!b.attachEvent&&b.addEventListener&&(c=c+a.scrollX,d=d+a.scrollY);return{x:c,y:d}}function e(b){var c=y=0,d=b||a.event;return f(d.clientX,d.clientY)}function d(b,d,f,g){SAPI.Class("map.ext.floatHint",[b,function(){return"Сообщения на карте: <b>"+d.title+"</b><br />Перетащите метку на карту"}]),jQuery(b).draggable({revert:!0,helper:"clone",start:function(){g.addClass("active")},stop:function(h,i){g.removeClass("active"),h=h||a.event;var j=e(h),k=c("#map_overlayed").offset(),l={left:j.x-k.left,top:j.y-k.top},m=c("#map_overlayed").width(),n=c("#map_overlayed").height();if(l.left>0&&l.top>0&&l.left<m&&l.top<n){var o=GetMap().mapper("fromContainerPixelToLatLng",l),p=GetMap().getZoom(),q=Math.round(o.lat()*1e6),r=Math.round(o.lng()*1e6),s=b.selrid,t={lat:q,lng:r,zoom:p,"class":d.type,selai:f};darkPannel.request(function(a){AjaxUpdater(a,DataCenter+"editors/twitter.php",t,"post")})}}});return!0}SAPI.implimentClass("map.control.eSosedi.addButton",{Extends:"map.control.base",rendered:0,$autorun:function(){},getDivClassName:function(){return"sapi-add-pannel"},templated:function(){return"<div class='sapi-map-button sapi-addnav-button'>Добавить место</div><div class='sapi-map-button sapi-addtwitt-button'><div class='twitico_' ></div><label>Сообщения на карте</label></div>"},setupActions:function(){if(!this.rendered){var a=this,b=c(this.getDiv()),e=c(".sapi-addnav-button",b);e.click(function(){SpawnEditRectangle();return!1}),SAPI.Class("map.ext.floatHint",[e,function(a){return"Нажмите чтобы добавить <b>новое место</b> на карту"}]);var f=c(".twitico_",b),g=SAPI.val("eSosedi.Twitter.Icons");for(var h=0,i=g.length;h<i;++h){var j="<div class='w_init "+g[h].cssclass+"' id='twitter_c"+h+"' style='cursor: -moz-grab !important;cursor: -webkit-grab !important;cursor: e-resize;'></div>";d(c(j).appendTo(f),g[h],h,b)}}},render:function(){this.rendered||(this.html(this.templated()),this.patch(),this.rendered=1)}})})()},function(){(function(){function b(a,b,d,e){var f=c("<li class='maptype' maptype='"+a+"'>"+b+"</li>");f.click(function(){e.setMapType(a)}),SAPI.Class("map.ext.floatHint",[f,function(){return d}]);return f}function a(a,b,d,e){var f=c("<li class='mapworker' worker='"+a+"'>"+b+"</li>");f.click(function(){e.selectMapWorker(a)}),SAPI.Class("map.ext.floatHint",[f,function(){return d+"<br/>Разные карты = разное качество"}]);return f}SAPI.implimentClass("map.control.eSosedi.typeControl",{Extends:"map.control.base",rendered:0,$autorun:function(){},getDivClassName:function(){return"esosedi-typeControl"},templated:function(){return"<ul class=''></ul>"},setupActions:function(){if(!this.rendered){var d={map:["Cхема","схематическая карта"],hybrid:["Cпутник","вид со спутника"]},e=this,f=this.getDiv(),g=c("ul",f),h=this.map.getMapType();for(var i in d)b(i,d[i][0],d[i][1],this.map).appendTo(g);c("<li class='spacer'></li>").appendTo(g);var j="";do{j=SAPI.listNext("map.worker",j,!1);if(!j)break;var k=SAPI.use("map.worker."+j);if(!k)break;var l=k.__classname__.replace(/map.worker./,"");a(l,k.__default__.shownName,k.__default__.descriptions,this.map).appendTo(g)}while(j);this.map.event.listen("map.worker.typechange",function(a,b,d){c(".maptype",f).removeClass("selected"),c("[maptype="+d+"]",f).addClass("selected")}),this.map.event.listen("map.worker.change",function(a,b,d){c(".mapworker",f).removeClass("selected"),c("[worker="+d+"]",f).addClass("selected")}),this.map.event.trigger("map.worker.typechange",this.map,this.map.getMapType()),this.map.event.trigger("map.worker.change",this.map,this.map.workerName,this.map.worker.name)}},render:function(){this.rendered||(this.html(this.templated()),this.patch(),this.rendered=1)}})})()},function(){(function(){function c(){var a=0,c=0,e=0;try{var f=GetMap().getMapCenter();a=Math.round(f.y*1e6),c=Math.round(f.x*1e6),e=GetMap().getZoom()}catch(g){}var h={"class":aCurrentUser.headerInClass,code:aCurrentUser.headerInObject,lat:a,lng:c,zoom:e,title:b.title};darkPannel.request(function(a){AjaxUpdater(d(a),DataCenter+"editors/storm_tag.php",h,"post",function(){function b(){var a=d("input.ch",c).attr("checked"),b=d("input.ds",c),e=a?dataHost+SERVER_REQUEST_URI:"http://www.esosedi.ru/frame?linked";e+="#"+mapLocationHash,b.val(e),setTimeout(function(){b.focus(),b.select()},1)}var c=d(a);d(".internalfav",c).length||d(".fav-sub",c).show(),d(".save_this_page_toggle",c).click(function(){d(".internalfav",c).hide(),d(".fav-sub",c).show()}),d(".ds,.ch,#favmap_checkbox",c).click(b),b();var e=dataHost+SERVER_REQUEST_URI+"#"+mapLocationHash;d(".iframecontent").html("/*размеры по умолчанию Вы можете изменить под свои требования*/\n<iframe style='width:100%;height:300px' src='http://www.esosedi.ru/frame/#"+mapLocationHash+"'></iframe>\n"+"<a href='"+e+"'>и другие обьекты на еСоседи.ру</a>").click(function(){var a=d(this);setTimeout(function(){a.focus(),a.select()},1)})})})}var d=jQuery;SAPI.implimentClass("map.control.eSosedi.favButton",{Extends:"map.control.base",rendered:0,$autorun:function(){},getDivClassName:function(){return"sapi-add-pannel"},templated:function(){return aCurrentUser.Id?"<div class='sapi-map-button sapi-fav-button' style='height:13px'><label class='lcap'>Запомнить место</label></div>":"<div class='sapi-map-button sapi-favmap-button'  style='height:13px'><label class='lcap'>Ссылка на карту</label></div>"},setupActions:function(){if(!this.rendered){var a=this,b=d(this.getDiv());if(0)SAPI.Class("map.ext.floatHint",[obj,function(){}]);d(".sapi-fav-button",b).click(function(){c()}),d(".sapi-favmap-button",b).click(function(){c()}),SAPI.Class("map.ext.floatHint",[d(".sapi-favmap-button label.lcap",b),function(){return"PS: при этом адрес страницы всегда указывает на ту область карты<br>которую вы видете в данный момент"}])}},render:function(){this.rendered||(this.html(this.templated()),this.patch(),this.rendered=1)}}),a.ssp=c})()},function(){(function(){SAPI.implimentClass("map.control.eSosedi.geoLocation",{Extends:"map.control.base",rendered:0,$autorun:function(){},getDivClassName:function(){return""},templated:function(){return"<div class='sapi-map-button sapi-geolocation-button'>где я?</div>"},setupActions:function(){if(!this.rendered){var a=this,b=this.getDiv();(function(){var d=SAPI.Class("tools.geoLocation");d.test()||c(".sapi-geoip-button").hide();var e=c("div",b),f=0;d.event.listen("geolocation.start",function(){f&&f.stop(),f=SAPI.animation.functor({FPS:12},function(a,b){var c=-Math.abs(Math.round(Math.sin(b.timepass*5)*3));e.css({top:c})})}),d.event.listen("geolocation.error",function(a,b){f&&f.stop(),alert("установить Ваше месторасположение не удалось")}),d.event.listen("geolocation.update",function(b,c){f&&f.stop();var d=SAPI.map.LatLng(c.coords.latitude,c.coords.longitude);a.map.setPosition(d,Math.max(14,a.map.getZoom()));var e=new SAPI.Class("map.effect.guidePoint",[{className:"guideStar",effect:"bounce",point:d,name:"Большой брат думает что Вы тут"}]);a.map.addOverlay(e)},this),e.click(function(){d.getPosition(!0);return!1})})(),SAPI.Class("map.ext.floatHint",[b,function(a){return"Определить ваше месторасположение"}])}},render:function(){this.rendered||(this.html(this.templated()),this.patch(),this.rendered=1)}})})()},function(){(function(){SAPI.implimentClass("map.control.eSosedi.returnTo",{Extends:"map.control.base",rendered:0,$autorun:function(){},getDivClassName:function(){return""},templated:function(){return"<div class='sapi-map-button sapi-map-button-mini sapi-returnto-button'>сброс</div>"},setupActions:function(){if(!this.rendered){var a=this,b=this.getDiv();c(".sapi-map-button",b).click(function(){SAPI.map.position(SAPI.val("eSosedi.originLocation"));return!1}),SAPI.Class("map.ext.floatHint",[b,function(a){return"Возвращает Вас к изначальному месту на карте"}])}},render:function(){this.rendered||(this.html(this.templated()),this.patch(),this.rendered=1)}})})()},function(){(function(){SAPI.implimentClass("map.control.eSosedi.zoomControl",{Extends:"map.control.base",rendered:0,$autorun:function(){},getDivClassName:function(){return""},templated:function(){return"<div class='sapi-map-button sapi-zoomControl-button'><i>-</i><u>+</u></div>"},setupActions:function(){if(!this.rendered){var a=this,b=this.getDiv();c("i",b).click(function(){SAPI.map.zone.setZoom(SAPI.map.zone.getZoom()-1);return!1}),c("u",b).click(function(){SAPI.map.zone.setZoom(SAPI.map.zone.getZoom()+1);return!1}),SAPI.Class("map.ext.floatHint",[c("i",b),function(){return"Уменьшить карту"}]),SAPI.Class("map.ext.floatHint",[c("u",b),function(){return"Увеличить карту"}])}},render:function(){this.rendered||(this.html(this.templated()),this.patch(),this.rendered=1)}})})()},function(){(function(){var a=SAPI.implimentClass("map.theme.eSosedi",{initialize:function(a){a.event.listen("map.worker.start",function(a,b){b.worker.worker.enableScrollWheelZoom();var c=SAPI.Class("map.control.eSosedi.typeControl",[{position:"top:2px;right:0px"}]);b.worker.addControl(c);var d=SAPI.Class("map.control.eSosedi.zoomControl",[{position:"top:-1px;left:-1px"}]);b.worker.addControl(d);var e=SAPI.Class("map.control.eSosedi.geoLocation",[{position:"left:25px;top:1px;width:43px"}]);b.worker.addControl(e);var e=SAPI.Class("map.control.eSosedi.returnTo",[{position:"left:25px;top:25px;width:43px"}]);b.worker.addControl(e);var f=SAPI.Class("map.control.eSosedi.addButton",[{position:"left:75px;top:1px;"}]);b.worker.addControl(f);var g=SAPI.Class("map.control.eSosedi.favButton",[{position:"left:185px;top:1px;height:25px"}]);b.worker.addControl(g);if(0)toolbox&&b.worker.addControl(toolbox),twitter&&b.worker.addControl(twitter)})}})})()}]);var g="./cache/sapied/be-sapi.js",h="besapi";SAPI.event.listen("run-"+h,function(){e(d)})}(window,document,jQuery);var loaderevents=[],showMapObjectTm=0,loc_a_loc_timer=0,$p=function(a){return $(a)};(function(){function i(d,e,g,i){a||f(),c("parse_imagepreviewpop").hide();var j="";g?j=e+"/fit/"+g:j=e,i&&(j=i),b("parse_imagepreviewalt").innerHTML=d.alt||d.innerHTML;var k=new Image;k.onload=function(){var a=b("parse_imagepreviewimage"),c=1024/this.width,e=800/this.height,f;c>e?f=c:f=e,f>1&&(f=1),a.in_width=this.width*f,a.in_height=this.height*f,a.onload=function(){h(j,d)},a.src=j},k.src=j}function h(a,f){var g=b("parse_imagepreviewimage"),h=b("parse_imagepreviewpop");g.onload=null;var i=parseInt((parseInt(document.body.clientWidth)-parseInt(g.in_width))/2),j=parseInt((parseInt(e())-parseInt(g.in_height))/2),k={top:d()+j,left:i,opacity:1},l={width:parseInt(g.in_width),height:parseInt(g.in_height)};b("parse_legeng").style.width=g.in_width+"px";var m=jQuery(f).offset();h.style.left=m.left+"px",h.style.top=m.top+"px",g.width=f.width,g.height=f.height,g.style.width=parseInt(f.width)+"px",g.style.height=parseInt(f.height)+"px",c("parse_legeng").hide();var n=jQuery(h);n.show(),n.animate(k,500),jQuery(g).animate(l,500),setTimeout(function(){c("parse_legeng").fadeIn("slow")},500)}function g(){c("parse_imagepreviewpop").fadeOut()}function f(){a||(a=document.createElement("div"),a.id="parse_imagepreviewpop",a.innerHTML="<div id=parse_legeng><a class=buttonclose>закрыть</a><span id=parse_imagepreviewalt></span></div><img id=parse_imagepreviewimage />",document.body.appendChild(a),jQuery(".buttonclose, img",a).click(g))}function e(){if(typeof window.innerWidth=="number")return window.innerHeight;if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))return document.documentElement.clientHeight}function d(){return document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop}var a=0,b=function(a){return jQuery("#"+a)[0]},c=function(a){return jQuery("#"+a)};window.parse_ViewImage=i})(),function(){function k(){if(!!b){if(!b.editMoved){alert("я бы позиционировал поточнее");return}var a=j().split(","),c="x1="+a[0]+"&"+"y1="+a[1]+"&"+"x2="+a[2]+"&"+"y2="+a[3];darkPannel.ajax(DataCenter+"add/nav_add.php?"+c)}}function j(){if(!b)return 0;if(!b.editMoved)return 0;var a=b.getBounds(),c=a.getLT(),d=a.getRB(),e=Math.round(c.lng()*1e6)+","+Math.round(c.lat()*1e6)+","+Math.round(d.lng()*1e6)+","+Math.round(d.lat()*1e6);return e}function i(){b&&GetMap().removeOverlay(b),b=0,jQuery("#map_underline_text").hide(),jQuery("#float_map_controler").show(),jQuery("#float_map_controler_inner").show(),e=0,b=0}function h(){c||(c=1),i();var a=GetMap().getPixelBounds(),b={left:a[0].left,top:a[0].top},d={left:a[1].left,top:a[1].top},g={},h={};g.left=b.left+(d.left-b.left)/2-62,g.top=b.top+(d.top-b.top)/2-62,h.left=g.left+112,h.top=g.top+112;var j=new SAPI.map.LatLngBounds(GetMap().mapper("fromDivPixelToLatLng",g),GetMap().mapper("fromDivPixelToLatLng",h));f(j),jQuery.post(DataCenter+"loader/action/logObjectAdd.php"),jQuery("#map_underline_text").html("<nobr>Если Вы определись с местом - <a href='javascript:wish_to_add_place()' title='Добавить новое место на карту' class='nav_a_S map_add_button'>Добавить обьект на карту</a>, либо <a href='javascript:RemoveEditRectangle()' class='nav_a_S map_cancel_button'>отменить</a> действие</nobr>"),jQuery("#map_underline_text").slideDown(),jQuery("#float_map_controler").hide(),jQuery("#float_map_controler_inner").hide(),e=1,window.finish_edit_rectangle=k}function g(a){jQuery.getScript(DataCenter+"loader/start_edit_object.php?idkey="+a)}function f(a){i();var c=SAPI.Class("eSosedi.map.editor.Rectangle",[{bounds:a}]);b=c,GetMap().addOverlay(c)}var a=jQuery,b=0,c=0,d=0,e=0;window.DoEditThisObject=g,window.SpawnEditRectangle=h,window.MakeEditRectangle=f,window.RemoveEditRectangle=i,window.wish_to_add_place=function(){e?k():h()},window.mapia_editor_on_submit=function(){var b=j();b&&a("#coordinatemap").val(b);return!0},window.pages_editor_on_submit=function(){return!0}}(),document.createElement("user"),document.createElement("userpic"),document.createElement("loc"),document.createElement("vote"),document.createElement("iphash"),function(a,b){function v(a,c,d){var e=b("div.comment_party #comment"+a);if(e.length){k(e);var f=e.parents("li.comment_dblocki:first").children("div"),g=f.hasClass("cm-odd"),h=0,i=function(){f.removeClass("cm-"+(g?"odd":"even")),f.addClass("cm-"+(g?"even":"odd")),h++>6||(setTimeout(i,500),g=!g)};i()}else{if(d){alert("Место комментария установить не удается");return}var j=parseInt(a);if(!j||isNaN(j))return;b.ajax({url:DataCenter+"loader/comments/finder.php?id="+j,dataType:"json",success:function(d){c||(c=b(".commentTop[comment-location="+d.record.TypeClass+"_"+d.record.MapiaID+"]")),w.openPage(c,d.page,0,function(){v(a,c,!0)})}})}}function u(a,c,d,e){a=b(a);var f=a.hasClass("commentTop")?a:a.parents(".commentTop"),g=s(f);if(!g)alert("Невозможно переключить страницу");else{var h=f||b(".commentTop");h.css("opacity",.4),b.ajax({url:DataCenter+"loader/comments/fetch.php?page="+c+"&cid="+g,dataType:"json",complete:function(){h.css("opacity","")},success:function(a){try{b(".holded",f).html(a.html),w.onAcceptData(),w.scanDocumentForPage();if(d){var c=b("div.comment_party .comment_dblocki.depth0:"+(d>0?"first":"last"),f);c.length&&k(c)}e&&e()}catch(g){window.console&&console.log(g)}},error:function(){alert("Что-то не так и страница не перетыкивается")}})}}function t(d){var e=c("SAnyName").value;if(!aCurrentUser.Id){if(!e||e.length<3){alert("Назовитесь оригинальнее");return}if(o&&!c("SCheck").value){alert("Повторите капчу");return}}var f=c("MyCommentBy_"+d);if(!!f&&!!f.value){var g=b(f).parents(".commentTop"),h=s(f),i="comments_key_"+h;SAPI.blackbox.store.set("cmt_namesel",e),j=m=e,b.ajax({url:DataCenter+"loader/comments/updater.php?obj="+h+"&cid="+d,type:"post",dataType:"json",data:{keyname:i,key:a(i).innerHTML,message:f.value,tdId:d,Naming:e,secure:a("SCheck").value},success:function(a){setTimeout(function(){a.error?p(d,a.error,a.captched):(a.html&&(b(".holded",g).html(a.html),w.onAcceptData(),w.scanDocumentForPage(),v(a.newComment.record.Id,g)),setTimeout(function(){q(d)},1))},1)},error:function(){c("comments_captcha").innerHTML="случилось что-то плохое и ничего не работает",setTimeout(function(){p(d)},1e3)}}),c("comments_captcha").innerHTML="<ximg src=imgs/icon/load.gif><BR>...еще секунду и Вас услышат..."}}function s(a){var c=b(a).parents(".commentTop");return b(c).attr("comment-location")||b(a).attr("comment-location")}function r(a,d){o=0,e==a&&(e=-1),q(e),e=a;var f="<div style='width:100%;padding-right:5px'>",g="MyCommentBy_"+a,h=aCurrentUser.Id?"":"<br/><br />Анонимность имеет свои пределы";f+="<table width=100% cellpadding=0 cellspacing=0 class='hab_edit_panel_top'><tr valign=top ><td class='comment_text_input' style='position:relative'><div class='commentFader' style='position:absolute;z-index:0;padding:10px;width:600px;'><center class='incomment_abyse'>Следует помнить о недопустимости поведения бросающего тень на <br/>Вас и Ваши высказывания.<br/>Администрация просит не выходить за разумные пределы.<br/><strong>Вы несете ответственность</strong> за оставленные отзывы(ст. 129, 130 УК РФ)"+h+"</center></div>"+"<textarea style='z-index:10;position:relative' onfocus='habr_selecttarget(\""+g+"\")' Id="+g+" rows=7 "+"></textarea>"+"</td>"+"<td align=center style='width:80px;padding-top:20px' class='buttons'>"+'<a href="#" onclick="hab_edit_insert_text_b();          return false;" class="buttn spr-bold_ru"  title="жирный"></a>'+'<a href="#" onclick="hab_edit_insert_text_i();          return false;" class="buttn spr-italic_ru"  title="курсив"></a><BR>'+'<a href="#" onclick="hab_edit_insert_text_u();          return false;" class="buttn spr-underline_ru" title="подчеркнутый"></a>'+'<a href="#" onclick="hab_edit_insert_text_s();          return false;" class="buttn spr-strikethrough"  title="зачеркнуть"></a><BR>'+'<a href="#" onclick="hab_edit_insert_text_link();       return false;" class="buttn spr-link "  title="вставить ссылку"></a>'+'<a href="#" onclick="hab_edit_insert_text_blockquote(); return false;" class="buttn spr-indent"  title="отступ"></a><BR>'+'<a href="#" onclick="hab_edit_showpicuploadform();      return false;" class="buttn spr-image"  title="вставить изображение"></a>'+'<a href="#" onclick="hab_edit_text_undo();              return false;" class="buttn spr-undo"  title="отменить" id="undoimg"></a>'+"</td>"+"</tr>"+"",f+='<tr><td align=center id="comments_captcha" >',f+="</td></tr><tr><td id='comments_target_area'></td></tr></table>",f+="</div>",n||(n=Math.round(Math.random()*(i.length-1)),j=i[n],m=j,n=1,SAPI.blackbox.store.set("cmt_namesel",j)),c("CommTd_"+a).innerHTML=f;var k=0;b("textarea",c("CommTd_"+a)).keypress(function(a){if(a.ctrlKey&&(a.keyCode==13||a.keyCode==10)){t(e);return!1}k||b(".commentFader").fadeOut("slow"),k=1}),p(a,0),a>0&&b(c("CommTd_"+a)).hide().stop().slideDown(),d||b("textarea",c("CommTd_"+a)).focus()}function q(a){if(a>=0){var d=b(c("CommTd_"+a)),e=d.height();d.html(l(a));var f=d.height();d.css({height:e}).stop().animate({height:f},"normal",function(){d.css({height:"auto"})})}}function p(a,b,d){var e=aCurrentUser.fromnaa?"добавить комментарий из "+aCurrentUser.fromnaa:"добавить анонимно",f="<center><a Id='MyCommentBy_"+a+"_submit' href='#' class='MyCommentBy_submit'>"+e+"</a></center>",g=f;aCurrentUser.Id?g+='<input style="font-size:12px" type=hidden Id=SAnyName Name=SAnyName Value="">':g+='Вас, наверное, зовут <input style="font-size:12px" type="text" Id="SAnyName" Name="SAnyName=" Value="'+j+'"> из <u>'+aCurrentUser.fromnaa+"</u>"+"<p style='font-size:90%'>Комментарий будет добавлен анонимно, но также можно<a href='"+window.location.href+"#login_a' class='a_B' onclick='return enter_form_show()'>авторизоваться</a>, либо <a  onclick='return register_fast()' href='"+DRR+"register/index.html' class='a_B'>оформить прописку</a></p>",o=0,b&&(g+="<div class=error_pannel><div><strong>"+b+"</strong>",d&&(o=1,g+="<br />производится проверка на вшивость<br />",j=m,g+='<BR><table><tr valign=middle><td>Повторите надпись:</td><td><img src="SECUREKEY.php?rndfor&preBG=E88933&rand='+(a+Math.random())+'"></td><td> ==> </td>'+'<td><input maxlength=4 style="width:70px;font-size:18px" Name=SCheck Id=SCheck type=text></td>',g+="</tr></table>"),g+="</div></div>"),o||(g+="<input type=hidden Name=SCheck Id=SCheck type=text>",o=0),c("comments_captcha").innerHTML=g}function l(a){return a==0?"(<a href='#' class='comment_button'>написать новый комментарий</a>)":"(<a href='#' class='comment_button'>ответить</a>)"}function k(a){setTimeout(function(){var c=a.offset().top-100,d=b(window).scrollTop(),e=Math.abs(c-d)<400;b("html,body").animate({scrollTop:c},e?300:1)},1)}function h(){return g}var c=function(b){return a(b)},d=0,e=0,f=0,g=window.location.href.split("#");g?g=g[0]:g=window.location.href;var i=["Прохожий","Домовой","Участковый","Сосед","Домовенок","Сантехник","Монтажник","Знакомый","Зевака","Строитель","Читатель","Писатель","ЖЖшник","Робот","Бабушки","Студент","Аспирант","Картограф","Блогер","Военный","Косолапый","Вампир","Игрок","Анонимный","Без ника","Не придумал ник","Дефолт","Шахтер","Привидение","Дайте OpenID","Прикрутите логинзу!","Дядя степа","Тут бы вася","Дачник","Дерево","Цветочек","Как называться","Словать закончился","Я придумаю себе ник","Кто тут","Все спят","Проффесор","Ученый","Ламер","Байкер","НЛО","Депутат","Иностранец","Алкоголик","Красный","Зеленый","Картограф"],j="",m=(SAPI.blackbox.store.get("cmt_namesel")||"")+"";m=="null"&&(m="");var n=(m&&m.length)>2?1:0,o=0;j=m;var w={spawn:function(a,b){r(a,b||a==0)},rollTo:function(a,b){v(a,b)},openPage:function(a,b,c,d){u(a,b,c,d)},onAcceptData:function(){var a=b;a(".commentTop").each(function(){var c=a(this),d=c.attr("comment-origin"),e=a(".userLocations",c),f=a(".userNames",c);b("div.comment_party .comment_addpost",c).html("(<a href='#' class='comment_button'>ответить</a>)"),setTimeout(function(){function k(){var a=0,b;while(b=g.shift()){b[1].call(b[0]);if(a++>20)break}g.length&&setTimeout(k,1)}function j(){var b=a(this),c=b.attr("class"),d=c?a("."+c,e):0;d&&d.length&&b.html(d.html())}function i(){var b=a(this),c=b.attr("class"),d=c?a("."+c,f):0;d&&d.length?b.html("<a href='"+d.text()+"' class='chat_user'>"+b.html()+"</a>"):b.html("<u class='chat_user'>"+b.html()+"</u>")}function h(){var b=a(this),c=d,e=b.siblings("i.vote"),f=parseInt(e.html());if(isNaN(f)||e.find("vote").length)return!1;c||(c=b.siblings("a.location_link").attr("href")),c&&b.attr("href",c+"#"+b.attr("id")).html("#"),e.html('<label>твое мнение</label><b class="d">-</b><vote>'+f+'</vote><b class="u">+</b>').find("vote").css("color",voteManager.getVoteColor(f)),e[0].onselectstart=function(){return!1},e[0].unselectable="on";var g=a("userpic",b.siblings(".comments_user"));g.addClass(g.attr("uclass"))}var g=[];b("div.comment_party .header a.clink",c).each(function(){g.push([this,h])}),b("div.comment_party .header user",c).each(function(){g.push([this,i])}),b("div.comment_party .header loc",c).each(function(){g.push([this,j])}),k()},1)})},vote:function(a,c){var d=b(a).parents(".comment_dblocki:first").find(".header:first").attr("comment-for")||0,e=b(a).parents(".vote:first");d&&b.ajax({url:DataCenter+"loader/comments/vote.php?id="+d+"&deltaVote="+c,dataType:"json",success:function(a){if(a&&a.ok){var b=e.find("vote");if(a.vote.delta==0){var c=b.html();c!=";)"&&(b.html(";)"),setTimeout(function(){b.html(a.vote.result)},1e3))}else b.html(a.vote.result).css("color",voteManager.getVoteColor(a.vote.result))}}})},scanDocumentForPage:function(){var a=b;a(".commentTop .comments-start").each(function(){var b=a(this),c=b.parents(".commentTop").find(".comment-page-true-nav"),e=parseInt(b.attr("comments-page"));a("li.selected",c).removeClass("selected"),a("a.p"+e,c).parent().addClass("selected"),w.currentPage=parseInt(e);var f=1+parseInt(((a("a:last",c).attr("class")||"").match(/p(\w+)/)||["",""])[1]);if(f>10){var g=b.parents(".commentTop").find(".comments-page-visible-nav");g.hasClass("paginator")?(d.inputData.pageCurrent=e+1,d.drawPages(),d.scrollToPageCurrent()):(g.addClass("paginator"),c.css("display","none"),d=new Paginator3k(g,f,10,e+1,function(b){a("a.p"+(b-1),c).click();return!1}));var h=new Paginator3k(b.parents(".commentTop").find(".comments-nav-underlayer"),f,20,e+1,function(b){a("a.p"+(b-1),c).click();return!1})}}),a(".commentTop .comment-page-true-nav a").each(function(){var b=a(this);b.attr("href",h()+"#comment"+b.attr("start-comment"))})}};b(function(){var a=b;setTimeout(function(){b(".commentTop").delegate(".MyCommentBy_submit","click",function(){t(e);return false}).delegate("div.comment_party .comment_button,#CommTd_0 .comment_button","click",function(){var a=b(this).parents(".comment_dblocki:first").find(".header:first").attr("comment-for")||0;r(a);return false}).delegate("blockquote.comment_party .comment_dblocki","click",function(){var a=b(this).find(".header:first").attr("comment-for");w.rollTo(a,this);return false}).delegate(".comment-page-true-nav li a","click",function(){var b=a(this);if(b.parent().hasClass("selected")){}else{$page=b.attr("class").match(/p(\w+)/)[1];u(this,$page,$page-w.currentPage)}return false}).delegate(".commentNav .after","click",function(){u(this,w.currentPage+1,1);return false}).delegate(".commentNav .before","click",function(){u(this,w.currentPage-1,-1);return false}).delegate(".header .vote b.d","click",function(){w.vote(this,-1)}).delegate(".header .vote b.u","click",function(){w.vote(this,+1)});w.onAcceptData();w.scanDocumentForPage()},100)}),window.Comments=w;var x=window.location.href.split("#");if(x&&x[1]){var y="&"+x[1]+"&";var z=y.match(/&comment([^&]+)&/);if(z&&z[1]){b(function(){w.rollTo(z[1])})}}window.showCommentsTime=function(){var a=b;a.each(a(".comment_dblocki span.timep"),function(b,c){var d=a(this),e=d.attr("ts"),f=new Date(e*1e3);e>0&&f&&d.html(f+"")})}}($,jQuery),window.voteManager={getVoteColor:function(a){if(a==0)return"#AAA";if(a<0){if(a<10)return"#F00";if(a<5)return"#F44";if(a<2)return"#622";return"#644"}if(a>0){if(a>10)return"#0F0";if(a>5)return"#4F4";if(a>2)return"#262";return"#464"}},action:function(a,b){var c=a.attr("attr-type")+"-"+a.attr("attr-key");jQuery.ajax({url:DataCenter+"loader/action/vote.php?id="+c+"&deltaVote="+b,dataType:"json",success:function(b){if(b&&b.ok){var c=a.find("vote");if(b.vote.delta==0){var d=c.html();d!=";)"&&(c.html(";)"),setTimeout(function(){c.html(b.vote.result)},1e3))}else c.html(b.vote.result).css("color",voteManager.getVoteColor(b.vote.result))}}})}},jQuery(function(){var a=jQuery;a(".vote_tab").each(function(b,c){var d=a("li.tagged",c),e=a("li.voter",c),f=a("li.action,li.textAction",c),g=parseInt(a("vote",e).html()),h={type:e.attr("attr-type"),idkey:e.attr("attr-key")};e.html("<label class='voterLabel'>ваше мнение:</label><b class=\"d\">-</b><vote>"+g+'</vote><b class="u">+</b>').find("vote").css("color",voteManager.getVoteColor(g)),e[0].onselectstart=function(){return!1},e[0].unselectable="on",a("b.d",e).bind("click",function(){voteManager.action(e,-1)}),a("b.u",e).bind("click",function(){voteManager.action(e,1)}),a("label",f).html("модерация:"),a(".destroy,.deletePlace",f).click(function(){if(confirm("Уничтожить обьект, хотя можно было отредактировать?")){var a=prompt("Укажите причину удаления");a?(jQuery.ajax({url:DataCenter+"loader/action/moderateRQ.php?id="+h.idkey+"&type="+h.type+"&reson="+encodeURIComponent(a)}),alert("Мы проверим")):alert("ну нет так нет")}return!1}),a(".grant",f).click(function(){a("b.u",e).click();return!1}),a(".obstruct",f).click(function(){make_mapia_text_editor(h.idkey,h.type);return!1})})}),function(){function l(a){if(a.pageX||a.pageY)var b=a.pageX,c=a.pageY;else if(a.clientX||a.clientY)var b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,c=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;return{x:b,y:c}}function k(a){var b=a.offsetLeft;while(a.offsetParent!=null){a=a.offsetParent,b+=a.offsetLeft;if(a.tagName=="BODY")break}return b}function j(a){var b=a.offsetTop;while(a.offsetParent!=null){a=a.offsetParent,b+=a.offsetTop;if(a.tagName=="BODY")break}return b}function i(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,c)}function h(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}function g(a,b){return a&&a.className.length&&a.className.match(new RegExp("(^|\\s+)("+b+")($|\\s+)"))}function f(a,b,c){var d=b;c&&c.length&&(c=c.replace(/\s+(\S)/g,"|$1"),d.length&&(d+="|"),d+=c),a.className=a.className.replace(new RegExp("(^|\\s+)("+d+")($|\\s+)","g"),"$1"),a.className+=(a.className.length?" ":"")+b}function e(a,b){f(a,"",b)}function d(a,b){f(a,b,"")}function c(a,b,c){var d=a.getElementsByTagName(b);if(!c)return d;var e=[];for(var f=0;f<d.length;f++)g(d[f],c)&&(e[e.length]=d[f]);return e}var a=jQuery,b=function(b,c,d,e,f){if(!a(b).length)return!1;this.inputData={paginatorHolderId:b,pagesTotal:c,pagesSpan:d<c?d:c,pageCurrent:e,baseUrl:f?f:"/pages/"},this.html={holder:null,table:null,trPages:null,trScrollBar:null,tdsPages:null,scrollBar:null,scrollThumb:null,pageCurrentMark:null},this.prepareHtml(),this.initScrollThumb(),this.initPageCurrentMark(),this.initEvents(),this.scrollToPageCurrent()};b.prototype.prepareHtml=function(){this.html.holder=a(this.inputData.paginatorHolderId).get(0),a(this.html.holder).html(this.makePagesTableHtml()),this.html.table=this.html.holder.getElementsByTagName("table")[0];var b=this.html.table.getElementsByTagName("tr")[0];this.html.tdsPages=b.getElementsByTagName("td"),this.html.scrollBar=c(this.html.table,"div","scroll_bar")[0],this.html.scrollThumb=c(this.html.table,"div","scroll_thumb")[0],this.html.pageCurrentMark=c(this.html.table,"div","current_page_mark")[0],this.inputData.pagesSpan==this.inputData.pagesTotal&&d(this.html.holder,"fullsize")},b.prototype.makePagesTableHtml=function(){var a=100/this.inputData.pagesSpan+"%",b="<table ><tr>";for(var c=1;c<=this.inputData.pagesSpan;c++)b+='<td width="'+a+'"></td>';b+='</tr><tr><td colspan="'+this.inputData.pagesSpan+'">'+'<div class="scroll_bar">'+'<div class="scroll_trough"></div>'+'<div class="scroll_thumb">'+'<div class="scroll_knob"></div>'+"</div>"+'<div class="current_page_mark"></div>'+"</div>"+"</td>"+"</tr>"+"</table>";return b},b.prototype.initScrollThumb=function(){this.html.scrollThumb.widthMin="8",this.html.scrollThumb.widthPercent=this.inputData.pagesSpan/this.inputData.pagesTotal*100,this.html.scrollThumb.xPosPageCurrent=(this.inputData.pageCurrent-Math.round(this.inputData.pagesSpan/2))/this.inputData.pagesTotal*this.html.table.offsetWidth,this.html.scrollThumb.xPos=this.html.scrollThumb.xPosPageCurrent,this.html.scrollThumb.xPosMin=0,this.html.scrollThumb.xPosMax,this.html.scrollThumb.widthActual,this.setScrollThumbWidth()},b.prototype.setScrollThumbWidth=function(){this.html.scrollThumb.style.width=this.html.scrollThumb.widthPercent+"%",this.html.scrollThumb.widthActual=this.html.scrollThumb.offsetWidth,this.html.scrollThumb.widthActual<this.html.scrollThumb.widthMin&&(this.html.scrollThumb.style.width=this.html.scrollThumb.widthMin+"px"),this.html.scrollThumb.xPosMax=this.html.table.offsetWidth-this.html.scrollThumb.widthActual},b.prototype.moveScrollThumb=function(){this.html.scrollThumb.style.left=this.html.scrollThumb.xPos+"px"},b.prototype.initPageCurrentMark=function(){this.html.pageCurrentMark.widthMin="3",this.html.pageCurrentMark.widthPercent=100/this.inputData.pagesTotal,this.html.pageCurrentMark.widthActual,this.setPageCurrentPointWidth(),this.movePageCurrentPoint()},b.prototype.setPageCurrentPointWidth=function(){this.html.pageCurrentMark.style.width=this.html.pageCurrentMark.widthPercent+"%",this.html.pageCurrentMark.widthActual=this.html.pageCurrentMark.offsetWidth,this.html.pageCurrentMark.widthActual<this.html.pageCurrentMark.widthMin&&(this.html.pageCurrentMark.style.width=this.html.pageCurrentMark.widthMin+"px")},b.prototype.movePageCurrentPoint=function(){this.html.pageCurrentMark.widthActual<this.html.pageCurrentMark.offsetWidth?this.html.pageCurrentMark.style.left=(this.inputData.pageCurrent-1)/this.inputData.pagesTotal*this.html.table.offsetWidth-this.html.pageCurrentMark.offsetWidth/2+"px":this.html.pageCurrentMark.style.left=(this.inputData.pageCurrent-1)/this.inputData.pagesTotal*this.html.table.offsetWidth+"px"},b.prototype.initEvents=function(){var a=this;this.html.scrollThumb.onmousedown=function(b){if(!b)var b=window.event;b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation();var c=l(b).x-this.xPos;document.onmousemove=function(b){if(!b)var b=window.event;a.html.scrollThumb.xPos=l(b).x-c,a.moveScrollThumb(),a.drawPages()},document.onmouseup=function(){document.onmousemove=null,a.enableSelection()},a.disableSelection()},this.html.scrollBar.onmousedown=function(b){if(!b)var b=window.event;g(a.paginatorBox,"fullsize")||(a.html.scrollThumb.xPos=l(b).x-k(a.html.scrollBar)-a.html.scrollThumb.offsetWidth/2,a.moveScrollThumb(),a.drawPages())},h(window,"resize",function(){b.resizePaginator(a)})},b.prototype.drawPages=function(){var b=this.html.scrollThumb.xPos/this.html.table.offsetWidth,c=Math.round(b*this.inputData.pagesTotal),d="";c<1?(c=1,this.html.scrollThumb.xPos=0,this.moveScrollThumb()):c>=this.inputData.pagesTotal-this.inputData.pagesSpan&&(c=this.inputData.pagesTotal-this.inputData.pagesSpan+1,this.html.scrollThumb.xPos=this.html.table.offsetWidth-this.html.scrollThumb.offsetWidth,this.moveScrollThumb());for(var e=0;e<this.html.tdsPages.length;e++){var f=c+e;f==this.inputData.pageCurrent?d="<span><strong>"+f+"</strong>"+"</span>":d="<span><a href='#' title='"+f+"'>"+f+"</a>"+"</span>",this.html.tdsPages[e].innerHTML=d;var g=this;a("span a",this.html.tdsPages[e]).click(function(){g.inputData.pageCurrent=a(this).attr("title"),g.drawPages();return g.inputData.baseUrl(a(this).attr("title"))})}},b.prototype.scrollToPageCurrent=function(){this.html.scrollThumb.xPosPageCurrent=(this.inputData.pageCurrent-Math.round(this.inputData.pagesSpan/2))/this.inputData.pagesTotal*this.html.table.offsetWidth,this.html.scrollThumb.xPos=this.html.scrollThumb.xPosPageCurrent,this.moveScrollThumb(),this.drawPages()},b.prototype.disableSelection=function(){document.onselectstart=function(){return!1},this.html.scrollThumb.focus()},b.prototype.enableSelection=function(){document.onselectstart=function(){return!0}},b.resizePaginator=function(a){a.setPageCurrentPointWidth(),a.movePageCurrentPoint(),a.setScrollThumbWidth(),a.scrollToPageCurrent()},window.Paginator3k=b}(),function(){window.SAPI_BROWSER_CANVAS=0;var a=document.createElement("canvas");"getContext"in a&&a.getContext("2d")&&(window.SAPI_BROWSER_CANVAS=1)}();var tab_pselect_active=null,plant_last_spores=null,plant_last_spores_tm=0;(function(){function i(){function d(){b[c.width()>1100?"show":"hide"](),a[c.width()>1190?"show":"hide"]()}jQuery("#menu_top_holder .esd-map").click(function(){if($("map_overlayed_blocker")){gmap_maximize();return!1}});var a=jQuery("#menu_top_holder .esd-realty"),b=jQuery("#menu_top_holder .esd-postindex"),c=jQuery(window);a.html("<a href='http://realty.esosedi.ru/' class='inner iePNG'>Недвижимость</a><span class=inner_border></span>"),b.html("<a href='http://postindex.esosedi.ru/' class='inner iePNG'>Адреса</a><span class=inner_border></span>"),jQuery(window).resize(d),d()}function h(){function j(){var a;while(a=d.shift()){var b=a.getAttribute("to-src");b&&e.push([a,b,jQuery(a).offset()])}}function i(){var c=a(window).scrollTop(),d=a(window).height(),g=0;f++;for(var i=0,j=e.length;j;--j,++i){var k=e[i];k&&(f>10&&(k[2]=jQuery(k).offset()),k[2].top>c-20&&k[2].top<c+d+20&&(b&&k[0].style.display!="none"&&(k[0].onload=function(){jQuery(this).fadeIn()}),k[0].setAttribute("src",k[1]),e[i]=null,g++))}f>10&&(f=0),g>0&&h()}function h(){clearTimeout(g),g=setTimeout(i,50)}var a=jQuery,b=SAPI_BROWSER_CANVAS,c=jQuery("img"),d=[],e=[],f=0;c.each(function(a,b){d.push(b)});var g=0;j(),i(),jQuery(window).scroll(h)}function g(){var a=jQuery("#mediaForumTeaser"),b=DRR+"AddMedia/content/mediaForum/3.php";a.html("<iframe frameborder=0 scrolling='no' width='200px' height='250px' src='"+b+"'></iframe>")}function f(){jQuery("#revolvermaps").length&&jQuery.getScript("http://jd.revolvermaps.com/p.js",function(){var a=[],b=document.write;document.write=function(b){a.push(b)},rm2d_ki101("1","222","111","3aye1dkdblc","ffc000",10),jQuery("#revolvermaps").html(a.join("\n")),document.write=b})}function e(){jQuery(".yashare-auto-init").length&&jQuery.getScript("//yandex.st/share/share.js")}function d(){jQuery("#vkGroup").length&&jQuery.getScript("http://userapi.com/js/api/openapi.js?47",function(){VK.Widgets.Group("vkGroup",{mode:0,width:"262",height:"290"},4169058)})}function c(){jQuery("#vk_like_nav").length&&jQuery.getScript("http://userapi.com/js/api/openapi.js?23",function(){window.VK&&VK.init({apiId:1952310,onlyWidgets:!0}),window.VK&&VK.Widgets.Like("vk_like_nav",{type:"mini",verb:1})})}function b(){setTimeout(function(){var a=jQuery("#jumperId").attr("addr");a&&jQuery.getScript(a)},1e3)}function a(){var a="<div id='map_underline_text' style='width:100%;display:none;font-size:11px;color:#FFFFFF;background-color:#666666;position:absolute;z-index:10;'></div><div id='float_map_controler'><a href='#' id='float_map_controler_inner' class='iePng'>изменить размер карты</a></div>";jQuery(".mapResizeTool").html(a)}jQuery(function(){jQuery("#login_boxed").html('Привет, быть может <a href="#" onclick="return enter_form_show()">Мы уже знакомы</a><br />От рекламы спасет <a href="#" onclick="return register_fast()">Регистрация</a>'),a(),i(),setTimeout(function(){d();plant_spores("0,1,2");setInterval(function(){plant_spores("0,1,2")},3e4)},1)}),jQuery(window).load(function(){setTimeout(function(){c(),e(),b(),jQuery(".rightUnderMapper").length&&sapi_GenerateBestPlacesControl().appendTo(jQuery(".rightUnderMapper").html(""))},1e3),setTimeout(function(){},3),setTimeout(h,4)})})();var darkPannel=new function(){function g(){c.css({height:document.body.clientHeight+"px",width:document.body.clientWidth+"px"});var a=window_innerHeight();d.css({height:a}),e.css({width:document.body.clientWidth}),c.show()}function f(){c.hide(),e.html("")}var a=jQuery,b=0,c=0,d=0,e=0;a(function(){jQuery("#dark_dot_location").html("<div id='darkdotup' style='display:none'><table id=darkdot  ><tr valign=top height=1><td align=right><a href='#' class='close_darktop'>закрыть</a></td></tr><tr valign=middle><td align=center id=darkdotinner >&nbsp;</td></tr></table></div>"),jQuery("#darkdotup").addClass("iePNG"),e=a("#darkdotinner"),c=a("#darkdotup"),d=a("#darkdot"),a(".close_darktop").click(function(){f();return!1})}),this.login=function(){var b=a("<div></div>");b.html("<div class='hab_ed_upload_form' style=''><h2>Представьтесь</h2><form method=post action='"+DataCenter+"login.php' id=loginform>"+"<table cellpadding=0 cellspacing=0><tr><td><input type=hidden name=GOBACK Value='"+SERVER_REQUEST_URI+"'>"+"<input type=HIDDEN Name='DoLogin' Value='1'></td></tr>"+"<tr valign=bottom><td>e-mail</td><td><input type=text Name=logformLogin class=inps></td></tr>"+"<tr valign=bottom><td>Пароль</td><td><input type=password Name=logformPass class=inps>"+"<BR/></td></tr><tr style='display:none'><td><input type=submit></td></tr>"+"<tr><td><br/><br/></td></tr>"+"<tr valign=bottom style='padding-top:3px'>"+"<td><span class='nav_a_B enter_form_button'>Войти</span></td>"+"<td><a  href='#' onclick='return window.location.href=\"login.php?ForgotPass\"' class=nav_a>Забыли пароль?</a></td>"+"</tr></table></form><div class='openIded'></div><a href='#' onclick='return register_fast()'>Зарегистрироваться на соседях</a></div>"),this.node(b),window.allow_uLogin&&a(".openIded").html('<div id="uLogin"><iframe src="'+DataCenter+'cross_login.php?frame" style="width:180px;height:20px" frameborder="no" scrolling="no"></iframe></div>'),a(".enter_form_button",b).click(function(){a("[name=logformLogin]",b).val()?a("[name=logformPass]",b).val()?a("#loginform").submit():alert("Пароль! Какой пароль?"):alert("Как же вас зовут?");return!1})},this.close=f,this.node=function(b){g(),e.html(""),a(b).appendTo(e)},this.ajax=function(a){g(),e.html("<img src=imgs/icon/load.gif>"),AjaxUpdater("#darkdotinner",a)},this.request=function(a){g(),e.html("<img src=imgs/icon/load.gif>"),a("#darkdotinner")}},imagingSizes={};jQuery(function(){var a=jQuery,b=a(".imagesVertical");imagingSizes.mini=b.attr("img-from"),imagingSizes.med=b.attr("img-to"),a("img",b).each(function(){this.title=this.alt});if(0)a("img",b).mouseover(function(){this.className="selected";return;var a=this.src,b=this}).mouseout(function(){this.className="";return;var a=this.src})});var script_comm="// редактор просто взят с харба, потому что хабра - зе бест :)",mouseY,textarea_height,undo="",quote=!1,habr_selectedtarget="htmlarea";document.addEventListener?document.addEventListener("mouseup",hab_edit_resize_stop,!1):document.attachEvent("onmouseup",hab_edit_resize_stop),jQuery(function(){var a=jQuery,b=a("#float_map_controler_inner"),c,d,e,f=a("#map_overlayed_blocker");if(b.length!=0){var g=!1,h=!1,i=!1;b.click(function(){var a=window_innerHeight()-(i?150:20)-f.offset().top,c=f.height();if(h){h=!1;return!1}g||(g=!(c<a-10)),g?(b.removeClass("mapControllerMaximized"),g=!1,f.animate({height:e},200)):(g=!0,b.addClass("mapControllerMaximized"),f.animate({height:a},200)),k=!1;return!1});var j=0,k=!1,l=function(){g||(i=!0,b.click(),i=!1,k=!0)};f.mouseenter(function(){clearTimeout(j),j=setTimeout(l,3e3)}),f.mouseleave(function(){clearTimeout(j),k&&g&&b.click(),k=!1}),e=d=f.height();var m=SAPI.Class("tools.hmi.mouseDragger",[{functor:function(a,b){a=="start"?(c=0,g||(e=d=f.height())):a=="end"?h&&SAPI.cookie.write("mH"+initial_mapblocker_H,e):a=="move"&&b&&(h=!0,g||(e=Math.max(130,Math.min(window_innerHeight(),d+b.delta.y)),f.css({height:e})))}}]),n=a(".mapResizeTool,#float_map_controler_inner");m.bindTo(n),SAPI.Class("map.ext.floatHint",[b,function(a){if(g)return"Карта увеличенна до <b>максимума</b><br>Клик уменьшит ее";return"Управляет размером карты.<br/>Клик увеличит карту максимально"}])}}),function(){function map_flash_prepare(){function a(a){var b=["-moz-","-webkit-","-o-",""],c={};for(var d=0,e=b.length;d<e;++d){var f=b[d]+"transform";c[f]=a}jQuery("#map_overlayed").css(c)}jQuery("#map_overlayed").removeClass("map-transition_animated_fast"),jQuery("#map_overlayed").css("opacity",.1),a("scale(1,1.1)"),setTimeout(function(){jQuery("#map_overlayed").addClass("map-transition_animated_fast"),a("scale(1.0,1.0)"),jQuery("#map_overlayed").css("opacity",1)},100)}var $=jQuery,SAPIon=function(){window.mapLoadingDelayed?window.mapLoadingDelayedCallback=SAPIon:(setTimeout(function(){!$("#map_overlayed_blocker").length||SAPI.mapon("#map_overlayed_blocker",{divId:"map_overlayed",className:"wholemap msapied",absolute:SAPI.val("map.absolutePosition"),stateName:SAPI.val("map.positionPolicy")||"static",onattach:function(mapapi,blockermapdiv){$(">table",blockermapdiv).remove(),mapapi.useTheme("eSosedi"),SAPI.event.trigger("map.zone.done"),$("#map_placemark").addClass("controlled"),setTimeout(function(){for(var i in loaderevents)loaderevents[i]&&(typeof loaderevents[i]=="string"?eval(loaderevents[i]):loaderevents[i]())},1)}})},1),SAPIon=0)};$(function(){function n(){try{b(),j()}catch(a){window.console&&console.error(a)}}function m(){SAPI.map.zone.event.listen("map.worker.typechange",function(a,b,c){SAPI.blackbox.store.set("mapType",c),f=c,l()}),SAPI.map.zone.event.listen("map.worker.change",function(a,b,c){SAPI.blackbox.store.set("mapWorker",c),g=c,l()}),SAPI.map.zone.event.listen("map.move.end",function(a,b,c){l()})}function l(){var a=SAPI.map.position(),b=Math.round(a.x*1e6),h=Math.round(a.y*1e6),j=SAPI.map.zone.getZoom();if(j>3){var k="lat="+b+"&lng="+h+"&z="+j+"&mt="+i(f,c)+"&v="+i(g,d);window.mapLocationHash=k,clearTimeout(l);var l=setTimeout(function(){window.location.replace(e+"#"+k)},1e3)}}function j(){var a=window.location.href,b=a.search(/#/),f;if(b>0)f=a.substr(b+1),e=window.location.href.substr(0,b);else{e=a;return}var g=f.split("&"),i=g.length;if(i!=0){var j={};for(var k=0;k<i;k++){var l=g[k].split("=");l[0]&&(j[l[0]]=parseFloat(l[1]))}if(j.lat&&j.lng){SAPI.console.log("установка позиции карты на основе хеша адреса",j);var m=SAPI.map.LatLng(j.lat/1e6,j.lng/1e6);SAPI.position(m,j.z),OnLoadAdd(function(){SAPI.map.zone.addOverlay(new SAPI.Class("map.effect.guidePoint",[{className:"guideStar",effect:"bounce",point:m,name:""}]))})}"mt"in j&&SAPI.val("map.initialType",h(j.mt,c,"map")),"v"in j&&SAPI.val("map.initialWorker",h(j.v,d,"Yandex"))}}function i(a,b){for(var c in b)if(b[c]==a)return c;return!1}function h(a,b,c){return b[a]||c}function b(){var a=SAPI.blackbox.store.get("mapType");a&&SAPI.val("map.initialType",a);var b=SAPI.blackbox.store.get("mapWorker");b&&SAPI.val("map.initialWorker",b)}var a=$("#if_map_jammed");SAPI.map.event.listen("map.loading.state",function(b,c){c!="done"&&(c=="superfatal"?c="Карта не будет показана так как<br/><strong>Нет доступа</strong> до источников карт<br />":c=="start"?c="поиск сводобного спутника</br>шаг 1 из 7":c=="prestart"?c="подключение к спутнику</br>шаг 2 из 7":c=="poststart"?c="ожидание</br>шаг 3 из 7":c=="scriptload"?c="выведение спутника на позицию</br>шаг 4 из 7":c=="scriptload1"?c="передача кодов управления</br>шаг 5 из 7":c=="scriptload2"?c="фокусировка оптики</br>шаг 6 из 7":c=="spawn"?(c="настройка видеоканала</br>шаг 7 из 7",j()):c=="scriptfail"&&(c="Ошибка, перезапуск"),a.html(c))}),SAPIon&&SAPIon();var c=["map","hybrid"],d=["Google","Yandex"],e="",f="",g="",k=0;SAPI.val("eSosedi.originLocation",SAPI.map.position()),n(),m(),SAPI.map.zone.setMapType(SAPI.val("map.initialType")),SAPI.map.zone.selectMapWorker(SAPI.val("map.initialWorker")),SAPI.map.zone.setMapType(SAPI.val("map.initialType"))})}(),function(){function v(){clearTimeout(t),t=setTimeout(function(){var a=$("search_w");!a||a.value||(a="Поиск по карте")},100)}function u(){clearTimeout(t),t=setTimeout(function(){var a=$("search_w");!a||a.value=="Поиск по карте"&&(a.value="")},100)}function s(a,b,c){r&&clearTimeout(r),a.length>=2&&(r=setTimeout(function(){q(a)},500))}function q(a){a=jQuery("#search_w").val(),clearTimeout(p);if(o==a)p=setTimeout(function(){o=""},100);else{o=a;if(a.indexOf(",")>0){var b=a.split(",");if(""+b[0]==+b[0]&&""+b[1]==+b[1]){PosMap(SAPI.map.LatLng(+b[0],+b[1]),16);return}}n++;var c=n;SAPI.map.zone.geocode(a,{success:function(a){n==c&&m(a)},fail:function(){n==c&&m(null)}}),e&&e.abort();var d=GetMap()?GetMap().getPosition():{x:0,y:0},f=1e6;e=jQuery.getScript(DataCenter+"loader/ajafind.php?w="+a+"&Var="+1+"&gg="+c+"&lat="+Math.round(d.x*f)+"&lng="+Math.round(d.y*f))}}function m(a){!a||!a.length?j():(c=a,j())}function l(b,c,d,e,f){var g=jQuery,h=c[b];if(h.length>0){var j="";b=="geocode"?j="Адреса на карте":b=="nav"?j="Поиск по обьектам":b=="pages"?j="В справочнике":b=="comments"&&(j="В комментариях вокруг");var k=g("<li><label>"+j+"</label><ul class='jax_search_block jsr_"+b+"'></ul></li>"),l=g("ul",k),m=-1,n=GetMap()?GetMap().getPosition():0;for(var o in h)o>=0&&(n&&h[o].position?h[o].metres=n.distTo(h[o].position):h[o].metres=0);h.sort(function(a,b){return a.metres-b.metres});for(var o in h)o>=0&&function(b,c){var d=g("<li>"),e="";if(b.metres){var h=b.metres;h>10&&(h>1e4?e=Math.ceil(h/1e3)+"км":h>1e3?e=Math.ceil(h/100)/10+"км":e=h+"м"),e=" <i>"+e+"</i>"}d.addClass("lind-"+c).html(a(b.text,f)+e).click(function(){if(b.onclick){b.onclick();return!1}if(SAPI.val("map.search.overview")&&b.position){i({point:b.position,addr:b.text});return!1}}).appendTo(l)}(h[o],o+b);k.appendTo(e)}}function j(){var a=jQuery,b=a("#search_w"),e={},f=0;b.css("background-color","#FFF"),c&&(e.geocode=[],a.each(c,function(a,b){e.geocode.push({text:"<span>"+b.addr+"</span>",onclick:function(){i(b)},position:b.point}),f++}));if(d){var j="?searching="+encodeURIComponent(jQuery("#search_w").val());for(var k in d)if(d.hasOwnProperty(k)){var m=d[k];for(var n in m)if(n>=0&&m[n]){e[k]||(e[k]=[]);var o="";if(k=="nav")o="<a href='"+DRR+"onmap/clicked/"+m[n].id+"/"+j+"' title='"+m[n].addr+"'>"+m[n].name+"</a>";else if(k=="pages")o="<a href='"+(DRR+"pages/clicked/"+m[n].id).replace("www.esosedi.ru/pages/","pages.esosedi.ru/")+"/"+j+"'>"+m[n].name+"</a>";else if(k=="comments")o="<a href='"+m[n].url+"' title='"+m[n].fullName+"'>"+m[n].name+"</a>";else continue;e[k].push({position:SAPI.map.LatLng(m[n].lat/1e6,m[n].lng/1e6),text:o,idnav:m[n].id,objectId:m[n].objectId}),f++}}}var p=a("#jax_help").css("height","auto");a("#locstr_load").hide();if(!f)e[404]=[{text:"На карте не нашлось ничего похожего"}],g();else{var q=function(){var b=a("<ul class='jax_search_results'></ul>");a("<a href='#' class='jax_close'>Закрыть</a>").click(function(){h(),q=null;return!1}).appendTo(p.html(""));for(var c in e)e.hasOwnProperty(c)&&l(c,e,p,b,d.query);b.appendTo(a("<div class='inner'></div>").appendTo(p)),p.css({top:GetMap()?88:0}),g()};q()}}function i(a){GetMap().setPosition(a.point,Math.max(13,GetMap().getZoom())),setTimeout(function(){GetMap().addOverlay(new SAPI.Class("map.effect.guidePoint",[{className:"guideStar",effect:"bounce",point:a.point,name:a.addr}]))},1e3)}function h(){jQuery("#jax_help").stop().animate({right:-423},function(){jQuery("#jax_help_wrapper").hide()})}function g(){var a=Math.max(250,jQuery("#map_overlayed_mapWorker").height()-7),b=jQuery("#jax_help").offset(),c=jQuery("#map_overlayed_mapWorker").offset();b.top>c.top&&(a-=b.top-c.top+7),jQuery("#jax_help").height(a),jQuery("#jax_help_wrapper").css("height",jQuery("#jax_help").height()+10),jQuery("#jax_help_wrapper").show(),jQuery("#jax_help").stop().animate({right:0})}function f(a){clearTimeout(b),d=a,b=setTimeout(j,100)}function a(a,b){if(!b)return a;b=""+b+"";var c=a.replace(/<([^>]*)>/g,""),d=c,e=b.toLowerCase().split(" "),f=c.toLowerCase();for(var g=0,h=e.length;g<h;++g){var i=e[g],j,k=-1;for(j=0;j<3;++j){if((k=f.indexOf(i))>=0)break;i=i.substr(0,i.length-1)}if(k>=0){var l=c.substr(k,i.length);c=c.split(l).join("<b>"+l+"</b>"),f=c.toLowerCase()}}return a.split(d).join(c)}var b=0,c=0,d=0,e=0;window.jax_on_cmp=f;var k=-1,n=0,o="",p=0,r=0;window.jax_helpme=s;var t=0;jQuery(function(){!$("search_w")||($("search_w").onfocus=function(){u()},$("search_w").onblur=function(){v()},jQuery("#search_w").keypress(function(a){a.keyCode==13&&s(this.value)}),SAPI.extfn.valueChange(jQuery("#search_w"),function(){s(this.value)}))})}(),jQuery(function(){function cC(a,b,c,d,e,f){function o(a,b){var c,d,e,f,j,k;for(e=a,k=0;k<8;k++){f=m(e)-a;if(B(f)<b)return e;j=(3*i*e+2*h)*e+g;if(B(j)<1e-6)break;e=e-f/j}c=0,d=1,e=a;if(e<c)return c;if(e>d)return d;while(c<d){f=m(e);if(B(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(a,b);return((l*c+k)*c+j)*c}function m(a){return((i*a+h)*a+g)*a}var g=3*b,h=3*(d-b)-g,i=1-g-h,j=3*c,k=3*(e-c)-j,l=1-j-k;return n(a,1/(200*f))}function cB(b){return function(c,d,e,f){var g={back:b};a.is(e,"function")?f=e:g.rot=e,c&&c.constructor==bN&&(c=c.attrs.path),c&&(g.along=c);return this.animate(g,d,f)}}function cp(){return this.x+q+this.y}function bm(a,b,c){function d(){var g=Array[e].slice.call(arguments,0),h=g[v]("►"),i=d.cache=d.cache||{},j=d.count=d.count||[];if(i[f](h))return c?c(i[h]):i[h];j[w]>=1e3&&delete i[j.shift()],j[L](h),i[h]=a[m](b,g);return c?c(i[h]):i[h]}return d}function bh(){var a=[],b=0;for(;b<32;b++)a[b]=(~~(y.random()*16))[H](16);a[12]=4,a[16]=(a[16]&3|8)[H](16);return"r-"+a[v]("")}function a(){if(a.is(arguments[0],G)){var b=arguments[0],d=bV[m](a,b.splice(0,3+a.is(b[0],E))),e=d.set();for(var g=0,h=b[w];g<h;g++){var i=b[g]||{};c[f](i.type)&&e[L](d[i.type]().attr(i))}return e}return bV[m](a,arguments)}a.version="1.5.2";var b=/[, ]+/,c={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},d=/\{(\d+)\}/g,e="prototype",f="hasOwnProperty",g=document,h=window,i={was:Object[e][f].call(h,"Raphael"),is:h.Raphael},j=function(){this.customAttributes={}},k,l="appendChild",m="apply",n="concat",o="createTouch"in g,p="",q=" ",r=String,s="split",t="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend orientationchange touchcancel gesturestart gesturechange gestureend"[s](q),u={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},v="join",w="length",x=r[e].toLowerCase,y=Math,z=y.max,A=y.min,B=y.abs,C=y.pow,D=y.PI,E="number",F="string",G="array",H="toString",I="fill",J=Object[e][H],K={},L="push",M=/^url\(['"]?([^\)]+?)['"]?\)$/i,N=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,O={NaN:1,Infinity:1,"-Infinity":1},P=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,Q=y.round,R="setAttribute",S=parseFloat,T=parseInt,U=" progid:DXImageTransform.Microsoft",V=r[e].toUpperCase,W={blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},X={along:"along",blur:E,"clip-rect":"csv",cx:E,cy:E,fill:"colour","fill-opacity":E,"font-size":E,height:E,opacity:E,path:"path",r:E,rotation:"csv",rx:E,ry:E,scale:"csv",stroke:"colour","stroke-opacity":E,"stroke-width":E,translation:"csv",width:E,x:E,y:E},Y="replace",Z=/^(from|to|\d+%?)$/,$=/\s*,\s*/,_={hs:1,rg:1},ba=/,?([achlmqrstvxz]),?/gi,bb=/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,bc=/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,bd=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/,be=function(a,b){return a.key-b.key};a.type=h.SVGAngle||g.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML";if(a.type=="VML"){var bf=g.createElement("div"),bg;bf.innerHTML='<v:shape adj="1"/>',bg=bf.firstChild,bg.style.behavior="url(#default#VML)";if(!bg||typeof bg.adj!="object")return a.type=null;bf=null}a.svg=!(a.vml=a.type=="VML"),j[e]=a[e],k=j[e],a._id=0,a._oid=0,a.fn={},a.is=function(a,b){b=x.call(b);if(b=="finite")return!O[f](+a);return b=="null"&&a===null||b==typeof a||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||J.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return((h<0)*180+y.atan(-i/-h)*180/D+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*D/180},a.deg=function(a){return a*180/D%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,G)){var e=b.length;while(e--)if(B(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(f<d)return c-f;if(f>b-d)return c-f+b}return c},a.setWindow=function(a){h=a,g=h.document};var bi=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write("<body>"),e.close(),d=e.body}catch(f){d=createPopup().document.body}var h=d.createTextRange();bi=bm(function(a){try{d.style.color=r(a)[Y](c,p);var b=h.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b[H](16)).slice(-6)}catch(e){return"none"}})}else{var i=g.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",g.body[l](i),bi=bm(function(a){i.style.color=a;return g.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bi(b)},bj=function(){return"hsb("+[this.h,this.s,this.b]+")"},bk=function(){return"hsl("+[this.h,this.s,this.l]+")"},bl=function(){return this.hex};a.hsb2rgb=function(b,c,d,e){a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b&&(d=b.b,c=b.s,b=b.h,e=b.o);return a.hsl2rgb(b,c,d/2,e)},a.hsl2rgb=function(b,c,d,e){a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b&&(d=b.l,c=b.s,b=b.h);if(b>1||c>1||d>1)b/=360,c/=100,d/=100;var f={},g=["r","g","b"],h,i,j,k,l,m;if(!c)f={r:d,g:d,b:d};else{d<.5?h=d*(1+c):h=d+c-d*c,i=2*d-h;for(var n=0;n<3;n++)j=b+1/3*-(n-1),j<0&&j++,j>1&&j--,j*6<1?f[g[n]]=i+(h-i)*6*j:j*2<1?f[g[n]]=h:j*3<2?f[g[n]]=i+(h-i)*(2/3-j)*6:f[g[n]]=i}f.r*=255,f.g*=255,f.b*=255,f.hex="#"+(16777216|f.b|f.g<<8|f.r<<16).toString(16).slice(1),a.is(e,"finite")&&(f.opacity=e),f.toString=bl;return f},a.rgb2hsb=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,F)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;var f=z(b,c,d),g=A(b,c,d),h,i,j=f;if(g==f)return{h:0,s:0,b:f,toString:bj};var k=f-g;i=k/f,b==f?h=(c-d)/k:c==f?h=2+(d-b)/k:h=4+(b-c)/k,h/=6,h<0&&h++,h>1&&h--;return{h:h,s:i,b:j,toString:bj}},a.rgb2hsl=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,F)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;var f=z(b,c,d),g=A(b,c,d),h,i,j=(f+g)/2,k;if(g==f)k={h:0,s:0,l:j};else{var l=f-g;i=j<.5?l/(f+g):l/(2-f-g),b==f?h=(c-d)/l:c==f?h=2+(d-b)/l:h=4+(b-c)/l,h/=6,h<0&&h++,h>1&&h--,k={h:h,s:i,l:j}}k.toString=bk;return k},a._path2string=function(){return this.join(",")[Y](ba,"$1")},a.getRGB=bm(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none"};!_[f](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bi(b));var c,d,e,g,h,i,j,k=b.match(N);if(k){k[2]&&(g=T(k[2].substring(5),16),e=T(k[2].substring(3,5),16),d=T(k[2].substring(1,3),16)),k[3]&&(g=T((i=k[3].charAt(3))+i,16),e=T((i=k[3].charAt(2))+i,16),d=T((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4][s]($),d=S(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=S(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),g=S(j[2]),j[2].slice(-1)=="%"&&(g*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=S(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5][s]($),d=S(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=S(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),g=S(j[2]),j[2].slice(-1)=="%"&&(g*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=S(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,g,h)}if(k[6]){j=k[6][s]($),d=S(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=S(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),g=S(j[2]),j[2].slice(-1)=="%"&&(g*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=S(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,g,h)}k={r:d,g:e,b:g},k.hex="#"+(16777216|g|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1}},a),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=bm(function(b){if(!b)return null;var c={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d=[];a.is(b,G)&&a.is(b[0],G)&&(d=bo(b)),d[w]||r(b)[Y](bb,function(a,b,e){var f=[],g=x.call(b);e[Y](bc,function(a,b){b&&f[L](+b)}),g=="m"&&f[w]>2&&(d[L]([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");while(f[w]>=c[g]){d[L]([b][n](f.splice(0,c[g])));if(!c[g])break}}),d[H]=a._path2string;return d}),a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=C(j,3)*a+C(j,2)*3*i*c+j*3*i*i*e+C(i,3)*g,l=C(j,3)*b+C(j,2)*3*i*d+j*3*i*i*f+C(i,3)*h,m=a+2*i*(c-a)+i*i*(e-2*c+a),n=b+2*i*(d-b)+i*i*(f-2*d+b),o=c+2*i*(e-c)+i*i*(g-2*e+c),p=d+2*i*(f-d)+i*i*(h-2*f+d),q=(1-i)*a+i*c,r=(1-i)*b+i*d,s=(1-i)*e+i*g,t=(1-i)*f+i*h,u=90-y.atan((m-o)/(n-p))*180/D;(m>o||n<p)&&(u+=180);return{x:k,y:l,m:{x:m,y:n},n:{x:o,y:p},start:{x:q,y:r},end:{x:s,y:t},alpha:u}};var bn=bm(function(a){if(!a)return{x:0,y:0,width:0,height:0};a=bw(a);var b=0,c=0,d=[],e=[],f;for(var g=0,h=a[w];g<h;g++){f=a[g];if(f[0]=="M")b=f[1],c=f[2],d[L](b),e[L](c);else{var i=bv(b,c,f[1],f[2],f[3],f[4],f[5],f[6]);d=d[n](i.min.x,i.max.x),e=e[n](i.min.y,i.max.y),b=f[5],c=f[6]}}var j=A[m](0,d),k=A[m](0,e);return{x:j,y:k,width:z[m](0,d)-j,height:z[m](0,e)-k}}),bo=function(b){var c=[];if(!a.is(b,G)||!a.is(b&&b[0],G))b=a.parsePathString(b);for(var d=0,e=b[w];d<e;d++){c[d]=[];for(var f=0,g=b[d][w];f<g;f++)c[d][f]=b[d][f]}c[H]=a._path2string;return c},bp=bm(function(b){if(!a.is(b,G)||!a.is(b&&b[0],G))b=a.parsePathString(b);var c=[],d=0,e=0,f=0,g=0,h=0;b[0][0]=="M"&&(d=b[0][1],e=b[0][2],f=d,g=e,h++,c[L](["M",d,e]));for(var i=h,j=b[w];i<j;i++){var k=c[i]=[],l=b[i];if(l[0]!=x.call(l[0])){k[0]=x.call(l[0]);switch(k[0]){case"a":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]-d).toFixed(3),k[7]=+(l[7]-e).toFixed(3);break;case"v":k[1]=+(l[1]-e).toFixed(3);break;case"m":f=l[1],g=l[2];default:for(var m=1,n=l[w];m<n;m++)k[m]=+(l[m]-(m%2?d:e)).toFixed(3)}}else{k=c[i]=[],l[0]=="m"&&(f=l[1]+d,g=l[2]+e);for(var o=0,p=l[w];o<p;o++)c[i][o]=l[o]}var q=c[i][w];switch(c[i][0]){case"z":d=f,e=g;break;case"h":d+=+c[i][q-1];break;case"v":e+=+c[i][q-1];break;default:d+=+c[i][q-2],e+=+c[i][q-1]}}c[H]=a._path2string;return c},0,bo),bq=bm(function(b){if(!a.is(b,G)||!a.is(b&&b[0],G))b=a.parsePathString(b);var c=[],d=0,e=0,f=0,g=0,h=0;b[0][0]=="M"&&(d=+b[0][1],e=+b[0][2],f=d,g=e,h++,c[0]=["M",d,e]);for(var i=h,j=b[w];i<j;i++){var k=c[i]=[],l=b[i];if(l[0]!=V.call(l[0])){k[0]=V.call(l[0]);switch(k[0]){case"A":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+d),k[7]=+(l[7]+e);break;case"V":k[1]=+l[1]+e;break;case"H":k[1]=+l[1]+d;break;case"M":f=+l[1]+d,g=+l[2]+e;default:for(var m=1,n=l[w];m<n;m++)k[m]=+l[m]+(m%2?d:e)}}else for(var o=0,p=l[w];o<p;o++)c[i][o]=l[o];switch(k[0]){case"Z":d=f,e=g;break;case"H":d=k[1];break;case"V":e=k[1];break;case"M":f=c[i][c[i][w]-2],g=c[i][c[i][w]-1];default:d=c[i][c[i][w]-2],e=c[i][c[i][w]-1]}}c[H]=a._path2string;return c},null,bo),br=function(a,b,c,d){return[a,b,c,d,c,d]},bs=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},bt=function(a,b,c,d,e,f,g,h,i,j){var k=D*120/180,l=D/180*(+e||0),m=[],o,p=bm(function(a,b,c){var d=a*y.cos(c)-b*y.sin(c),e=a*y.sin(c)+b*y.cos(c);return{x:d,y:e}});if(!j){o=p(a,b,-l),a=o.x,b=o.y,o=p(h,i,-l),h=o.x,i=o.y;var q=y.cos(D/180*e),r=y.sin(D/180*e),t=(a-h)/2,u=(b-i)/2,x=t*t/(c*c)+u*u/(d*d);x>1&&(x=y.sqrt(x),c=x*c,d=x*d);var z=c*c,A=d*d,C=(f==g?-1:1)*y.sqrt(B((z*A-z*u*u-A*t*t)/(z*u*u+A*t*t))),E=C*c*u/d+(a+h)/2,F=C*-d*t/c+(b+i)/2,G=y.asin(((b-F)/d).toFixed(9)),H=y.asin(((i-F)/d).toFixed(9));G=a<E?D-G:G,H=h<E?D-H:H,G<0&&(G=D*2+G),H<0&&(H=D*2+H),g&&G>H&&(G=G-D*2),!g&&H>G&&(H=H-D*2)}else G=j[0],H=j[1],E=j[2],F=j[3];var I=H-G;if(B(I)>k){var J=H,K=h,L=i;H=G+k*(g&&H>G?1:-1),h=E+c*y.cos(H),i=F+d*y.sin(H),m=bt(h,i,c,d,e,0,g,K,L,[H,J,E,F])}I=H-G;var M=y.cos(G),N=y.sin(G),O=y.cos(H),P=y.sin(H),Q=y.tan(I/4),R=4/3*c*Q,S=4/3*d*Q,T=[a,b],U=[a+R*N,b-S*M],V=[h+R*P,i-S*O],W=[h,i];U[0]=2*T[0]-U[0],U[1]=2*T[1]-U[1];if(j)return[U,V,W][n](m);m=[U,V,W][n](m)[v]()[s](",");var X=[];for(var Y=0,Z=m[w];Y<Z;Y++)X[Y]=Y%2?p(m[Y-1],m[Y],l).y:p(m[Y],m[Y+1],l).x;return X},bu=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:C(j,3)*a+C(j,2)*3*i*c+j*3*i*i*e+C(i,3)*g,y:C(j,3)*b+C(j,2)*3*i*d+j*3*i*i*f+C(i,3)*h}},bv=bm(function(a,b,c,d,e,f,g,h){var i=e-2*c+a-(g-2*e+c),j=2*(c-a)-2*(e-c),k=a-c,l=(-j+y.sqrt(j*j-4*i*k))/2/i,n=(-j-y.sqrt(j*j-4*i*k))/2/i,o=[b,h],p=[a,g],q;B(l)>"1e12"&&(l=.5),B(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bu(a,b,c,d,e,f,g,h,l),p[L](q.x),o[L](q.y)),n>0&&n<1&&(q=bu(a,b,c,d,e,f,g,h,n),p[L](q.x),o[L](q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+y.sqrt(j*j-4*i*k))/2/i,n=(-j-y.sqrt(j*j-4*i*k))/2/i,B(l)>"1e12"&&(l=.5),B(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bu(a,b,c,d,e,f,g,h,l),p[L](q.x),o[L](q.y)),n>0&&n<1&&(q=bu(a,b,c,d,e,f,g,h,n),p[L](q.x),o[L](q.y));return{min:{x:A[m](0,p),y:A[m](0,o)},max:{x:z[m](0,p),y:z[m](0,o)}}}),bw=bm(function(a,b){var c=bq(a),d=b&&bq(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bt[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bs(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][n](bs(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](br(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](br(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](br(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](br(b.x,b.y,b.X,b.Y))}return a},h=function(a,b){if(a[b][w]>7){a[b].shift();var e=a[b];while(e[w])a.splice(b++,0,["C"][n](e.splice(0,6)));a.splice(b,1),k=z(c[w],d&&d[w]||0)}},i=function(a,b,e,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),e.bx=0,e.by=0,e.x=a[g][1],e.y=a[g][2],k=z(c[w],d&&d[w]||0))};for(var j=0,k=z(c[w],d&&d[w]||0);j<k;j++){c[j]=g(c[j],e),h(c,j),d&&(d[j]=g(d[j],f)),d&&h(d,j),i(c,d,e,f,j),i(d,c,f,e,j);var l=c[j],o=d&&d[j],p=l[w],q=d&&o[w];e.x=l[p-2],e.y=l[p-1],e.bx=S(l[p-4])||e.x,e.by=S(l[p-3])||e.y,f.bx=d&&(S(o[q-4])||f.x),f.by=d&&(S(o[q-3])||f.y),f.x=d&&o[q-2],f.y=d&&o[q-1]}return d?[c,d]:c},null,bo),bx=bm(function(b){var c=[];for(var d=0,e=b[w];d<e;d++){var f={},g=b[d].match(/^([^:]*):?([\d\.]*)/);f.color=a.getRGB(g[1]);if(f.color.error)return null;f.color=f.color.hex,g[2]&&(f.offset=g[2]+"%"),c[L](f)}for(d=1,e=c[w]-1;d<e;d++)if(!c[d].offset){var h=S(c[d-1].offset||0),i=0;for(var j=d+1;j<e;j++)if(c[j].offset){i=c[j].offset;break}i||(i=100,j=e),i=S(i);var k=(i-h)/(j-d+1);for(;d<j;d++)h+=k,c[d].offset=h+"%"}return c}),by=function(b,c,d,e){var f;if(!a.is(b,F)&&!a.is(b,"object"))return{container:1,x:b,y:c,width:d,height:e};f=a.is(b,F)?g.getElementById(b):b;if(f.tagName)return c==null?{container:f,width:f.style.pixelWidth||f.offsetWidth,height:f.style.pixelHeight||f.offsetHeight}:{container:f,width:c,height:d}},bz=function(a,b){var c=this;for(var d in b)if(b[f](d)&&!(d in a))switch(typeof b[d]){case"function":(function(b){a[d]=a===c?b:function(){return b[m](c,arguments)}})(b[d]);break;case"object":a[d]=a[d]||{},bz.call(this,a[d],b[d]);break;default:a[d]=b[d]}},bA=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)},bB=function(a,b){b.top!==a&&(bA(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a)},bC=function(a,b){b.bottom!==a&&(bA(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a)},bD=function(a,b,c){bA(a,c),b==c.top&&(c.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},bE=function(a,b,c){bA(a,c),b==c.bottom&&(c.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},bF=function(a){return function(){throw new Error("Raphaël: you are calling to method “"+a+"” of removed object")}};a.pathToRelative=bp;if(a.svg){k.svgns="http://www.w3.org/2000/svg",k.xlink="http://www.w3.org/1999/xlink",Q=function(a){return+a+(~~a===a)*.5};var bG=function(a,b){if(!b){a=g.createElementNS(k.svgns,a),a.style.webkitTapHighlightColor="rgba(0,0,0,0)";return a}for(var c in b)b[f](c)&&a[R](c,r(b[c]))};a[H]=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var bH=function(a,b){var c=bG("path");b.canvas&&b.canvas[l](c);var d=new bN(c,b);d.type="path",bK(d,{fill:"none",stroke:"#000",path:a});return d},bI=function(a,b,c){var d="linear",e=.5,f=.5,h=a.style;b=r(b)[Y](bd,function(a,b,c){d="radial";if(b&&c){e=S(b),f=S(c);var g=(f>.5)*2-1;C(e-.5,2)+C(f-.5,2)>.25&&(f=y.sqrt(.25-C(e-.5,2))*g+.5)&&f!=.5&&(f=f.toFixed(5)-1e-5*g)}return p}),b=b[s](/\s*\-\s*/);if(d=="linear"){var i=b.shift();i=-S(i);if(isNaN(i))return null;var j=[0,0,y.cos(i*D/180),y.sin(i*D/180)],k=1/(z(B(j[2]),B(j[3]))||1);j[2]*=k,j[3]*=k,j[2]<0&&(j[0]=-j[2],j[2]=0),j[3]<0&&(j[1]=-j[3],j[3]=0)}var m=bx(b);if(!m)return null;var n=a.getAttribute(I);n=n.match(/^url\(#(.*)\)$/),n&&c.defs.removeChild(g.getElementById(n[1]));var o=bG(d+"Gradient");o.id=bh(),bG(o,d=="radial"?{fx:e,fy:f}:{x1:j[0],y1:j[1],x2:j[2],y2:j[3]}),c.defs[l](o);for(var q=0,t=m[w];q<t;q++){var u=bG("stop");bG(u,{offset:m[q].offset?m[q].offset:q?"100%":"0%","stop-color":m[q].color||"#fff"}),o[l](u)}bG(a,{fill:"url(#"+o.id+")",opacity:1,"fill-opacity":1}),h.fill=p,h.opacity=1,h.fillOpacity=1;return 1},bJ=function(b){var c=b.getBBox();bG(b.pattern,{patternTransform:a.format("translate({0},{1})",c.x,c.y)})},bK=function(c,d){var e={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},h=c.node,i=c.activeAttrs||{},j=c.attrs,k=c.rotate(),m=function(a,b){b=e[x.call(b)];if(b){var c=a.attrs["stroke-width"]||"1",f={round:c,square:c,butt:0}[a.attrs["stroke-linecap"]||d["stroke-linecap"]]||0,g=[],i=b[w];while(i--)g[i]=b[i]*c+(i%2?1:-1)*f;bG(h,{"stroke-dasharray":g[v](",")})}},n={r:.1,x:.3,y:.25,rotation:1};for(var o in n)o in d&&o in i&&(Math.abs(d[o]-i[o])<n[o]?(delete d[o],a.counter_skipAttr=(+a.counter_skipAttr||0)+1):a.counter_passAttr=(+a.counter_passAttr||0)+1);for(var o in d)i[o]=d[o];c.activeAttrs=i,d[f]("rotation")&&(k=d.rotation);var t=r(k)[s](b);t.length-1?(t[1]=+t[1],t[2]=+t[2]):t=null,S(k)&&c.rotate(0,!0);for(var u in d)if(d[f](u)){if(!W[f](u))continue;var y=d[u];j[u]=y;switch(u){case"blur":c.blur(y);break;case"rotation":c.rotate(y,!0);break;case"href":case"title":case"target":var z=h.parentNode;if(x.call(z.tagName)!="a"){var A=bG("a");z.insertBefore(A,h),A[l](h),z=A}u=="target"&&y=="blank"?z.setAttributeNS(c.paper.xlink,"show","new"):z.setAttributeNS(c.paper.xlink,u,y);break;case"cursor":h.style.cursor=y;break;case"clip-rect":var B=r(y)[s](b);if(B[w]==4){c.clip&&c.clip.parentNode.parentNode.removeChild(c.clip.parentNode);var C=bG("clipPath"),D=bG("rect");C.id=bh(),bG(D,{x:B[0],y:B[1],width:B[2],height:B[3]}),C[l](D),c.paper.defs[l](C),bG(h,{"clip-path":"url(#"+C.id+")"}),c.clip=D}if(!y){var E=g.getElementById(h.getAttribute("clip-path")[Y](/(^url\(#|\)$)/g,p));E&&E.parentNode.removeChild(E),bG(h,{"clip-path":p}),delete c.clip}break;case"path":c.type=="path"&&bG(h,{d:y?j.path=bq(y):"M0,0"});break;case"width":h[R](u,y);if(j.fx)u="x",y=j.x;else break;case"x":j.fx&&(y=-j.x-(j.width||0));case"rx":if(u=="rx"&&c.type=="rect")break;case"cx":t&&(u=="x"||u=="cx")&&(t[1]+=y-j[u]),h[R](u,y),c.pattern&&bJ(c);break;case"height":h[R](u,y);if(j.fy)u="y",y=j.y;else break;case"y":j.fy&&(y=-j.y-(j.height||0));case"ry":if(u=="ry"&&c.type=="rect")break;case"cy":t&&(u=="y"||u=="cy")&&(t[2]+=y-j[u]),h[R](u,y),c.pattern&&bJ(c);break;case"r":c.type=="rect"?bG(h,{rx:y,ry:y}):h[R](u,y);break;case"src":c.type=="image"&&h.setAttributeNS(c.paper.xlink,"href",y);break;case"stroke-width":h.style.strokeWidth=y,h[R](u,y),j["stroke-dasharray"]&&m(c,j["stroke-dasharray"]);break;case"stroke-dasharray":m(c,y);break;case"translation":var F=r(y)[s](b);F[0]=+F[0]||0,F[1]=+F[1]||0,t&&(t[1]+=F[0],t[2]+=F[1]),cA.call(c,F[0],F[1]);break;case"scale":F=r(y)[s](b),c.scale(+F[0]||1,+F[1]||+F[0]||1,isNaN(S(F[2]))?null:+F[2],isNaN(S(F[3]))?null:+F[3]);break;case I:var G=r(y).match(M);if(G){C=bG("pattern");var H=bG("image");C.id=bh(),bG(C,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),bG(H,{x:0,y:0}),H.setAttributeNS(c.paper.xlink,"href",G[1]),C[l](H);var J=g.createElement("img");J.style.cssText="position:absolute;left:-9999em;top-9999em",J.onload=function(){bG(C,{width:this.offsetWidth,height:this.offsetHeight}),bG(H,{width:this.offsetWidth,height:this.offsetHeight}),g.body.removeChild(this),c.paper.safari()},g.body[l](J),J.src=G[1],c.paper.defs[l](C),h.style.fill="url(#"+C.id+")",bG(h,{fill:"url(#"+C.id+")"}),c.pattern=C,c.pattern&&bJ(c);break}var K=a.getRGB(y);if(!K.error)delete d.gradient,delete j.gradient,!a.is(j.opacity,"undefined")&&a.is(d.opacity,"undefined")&&bG(h,{opacity:j.opacity}),!a.is(j["fill-opacity"],"undefined")&&a.is(d["fill-opacity"],"undefined")&&bG(h,{"fill-opacity":j["fill-opacity"]});else if(({circle:1,ellipse:1}[f](c.type)||r(y).charAt()!="r")&&bI(h,y,c.paper)){j.gradient=y,j.fill="none";break}K[f]("opacity")&&bG(h,{"fill-opacity":K.opacity>1?K.opacity/100:K.opacity});case"stroke":K=a.getRGB(y),h[R](u,K.hex),u=="stroke"&&K[f]("opacity")&&bG(h,{"stroke-opacity":K.opacity>1?K.opacity/100:K.opacity});break;case"gradient":(({circle:1,ellipse:1})[f](c.type)||r(y).charAt()!="r")&&bI(h,y,c.paper);break;case"opacity":j.gradient&&!j[f]("stroke-opacity")&&bG(h,{"stroke-opacity":y>1?y/100:y});case"fill-opacity":if(j.gradient){var L=g.getElementById(h.getAttribute(I)[Y](/^url\(#|\)$/g,p));if(L){var N=L.getElementsByTagName("stop");N[N[w]-1][R]("stop-opacity",y)}break};default:u=="font-size"&&(y=T(y,10)+"px");var O=u[Y](/(\-.)/g,function(a){return V.call(a.substring(1))});h.style[O]=y,h[R](u,y)}}bM(c,d),t?c.rotate(t.join(q)):S(k)&&c.rotate(k,!0)},bL=1.2,bM=function(b,c){if(b.type=="text"&&!!(c[f]("text")||c[f]("font")||c[f]("font-size")||c[f]("x")||c[f]("y"))){var d=b.attrs,e=b.node,h=e.firstChild?T(g.defaultView.getComputedStyle(e.firstChild,p).getPropertyValue("font-size"),10):10;if(c[f]("text")){d.text=c.text;while(e.firstChild)e.removeChild(e.firstChild);var i=r(c.text)[s]("\n");for(var j=0,k=i[w];j<k;j++)if(i[j]){var m=bG("tspan");j&&bG(m,{dy:h*bL,x:d.x}),m[l](g.createTextNode(i[j])),e[l](m)}}else{i=e.getElementsByTagName("tspan");for(j=0,k=i[w];j<k;j++)j&&bG(i[j],{dy:h*bL,x:d.x})}bG(e,{y:d.y});var n=b.getBBox(),o=d.y-(n.y+n.height/2);o&&a.is(o,"finite")&&bG(e,{y:d.y+o})}},bN=function(b,c){var d=0,e=0;this[0]=b,this.id=a._oid++,this.node=b,b.raphael=this,this.paper=c,this.attrs=this.attrs||{},this.transformations=[],this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1},!c.bottom&&(c.bottom=this),this.prev=c.top,c.top&&(c.top.next=this),c.top=this,this.next=null},bO=bN[e];bN[e].rotate=function(c,d,e){if(this.removed)return this;if(c==null){if(this._.rt.cx)return[this._.rt.deg,this._.rt.cx,this._.rt.cy][v](q);return this._.rt.deg}var f=this.getBBox();c=r(c)[s](b),c[w]-1&&(d=S(c[1]),e=S(c[2])),c=S(c[0]),d!=null&&d!==!1?this._.rt.deg=c:this._.rt.deg+=c,e==null&&(d=null),this._.rt.cx=d,this._.rt.cy=e,d=d==null?f.x+f.width/2:d,e=e==null?f.y+f.height/2:e,this._.rt.deg?(this.transformations[0]=a.format("rotate({0} {1} {2})",this._.rt.deg,d,e),this.clip&&bG(this.clip,{transform:a.format("rotate({0} {1} {2})",-this._.rt.deg,d,e)})):(this.transformations[0]=p,this.clip&&bG(this.clip,{transform:p})),bG(this.node,{transform:this.transformations[v](q)});return this},bN[e].hide=function(){!this.removed&&(this.node.style.display="none");return this},bN[e].show=function(){!this.removed&&(this.node.style.display="");return this},bN[e].remove=function(){if(!this.removed){bA(this,this.paper),this.node.parentNode.removeChild(this.node);for(var a in this)delete this[a];this.removed=!0}},bN[e].getBBox=function(){if(this.removed)return this;if(this.type=="path")return bn(this.attrs.path);if(this.node.style.display=="none"){this.show();var a=!0}var b={};try{b=this.node.getBBox()}catch(c){}finally{b=b||{}}if(this.type=="text"){b={x:b.x,y:Infinity,width:0,height:0};for(var d=0,e=this.node.getNumberOfChars();d<e;d++){var f=this.node.getExtentOfChar(d);f.y<b.y&&(b.y=f.y),f.y+f.height-b.y>b.height&&(b.height=f.y+f.height-b.y),f.x+f.width-b.x>b.width&&(b.width=f.x+f.width-b.x)}}a&&this.hide();return b},bN[e].attr=function(b,c){if(this.removed)return this;if(b==null){var d={};for(var e in this.attrs)this.attrs[f](e)&&(d[e]=this.attrs[e]);this._.rt.deg&&(d.rotation=this.rotate()),(this._.sx!=1||this._.sy!=1)&&(d.scale=this.scale()),d.gradient&&d.fill=="none"&&(d.fill=d.gradient)&&delete d.gradient;return d}if(c==null&&a.is(b,F)){if(b=="translation")return cA.call(this);if(b=="rotation")return this.rotate();if(b=="scale")return this.scale();if(b==I&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[b]}if(c==null&&a.is(b,G)){var g={};for(var h=0,i=b.length;h<i;h++)g[b[h]]=this.attr(b[h]);return g}if(c!=null){var j={};j[b]=c}else b!=null&&a.is(b,"object")&&(j=b);for(var k in this.paper.customAttributes)if(this.paper.customAttributes[f](k)&&j[f](k)&&a.is(this.paper.customAttributes[k],"function")){var l=this.paper.customAttributes[k].apply(this,[][n](j[k]));this.attrs[k]=j[k];for(var m in l)l[f](m)&&(j[m]=l[m])}bK(this,j);return this},bN[e].toFront=function(){if(this.removed)return this;this.node.parentNode[l](this.node);var a=this.paper;a.top!=this&&bB(this,a);return this},bN[e].toBack=function(){if(this.removed)return this;if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),bC(this,this.paper);var a=this.paper}return this},bN[e].insertAfter=function(a){if(this.removed)return this;var b=a.node||a[a.length-1].node;b.nextSibling?b.parentNode.insertBefore(this.node,b.nextSibling):b.parentNode[l](this.node),bD(this,a,this.paper);return this},bN[e].insertBefore=function(a){if(this.removed)return this;var b=a.node||a[0].node;b.parentNode.insertBefore(this.node,b),bE(this,a,this.paper);return this},bN[e].blur=function(a){var b=this;if(+a!==0){var c=bG("filter"),d=bG("feGaussianBlur");b.attrs.blur=a,c.id=bh(),bG(d,{stdDeviation:+a||1.5}),c.appendChild(d),b.paper.defs.appendChild(c),b._blur=c,bG(b.node,{filter:"url(#"+c.id+")"})}else b._blur&&(b._blur.parentNode.removeChild(b._blur),delete b._blur,delete b.attrs.blur),b.node.removeAttribute("filter")};var bP=function(a,b,c,d){var e=bG("circle");a.canvas&&a.canvas[l](e);var f=new bN(e,a);f.attrs={cx:b,cy:c,r:d,fill:"none",stroke:"#000"},f.type="circle",bG(e,f.attrs);return f},bQ=function(a,b,c,d,e,f){var g=bG("rect");a.canvas&&a.canvas[l](g);var h=new bN(g,a);h.attrs={x:b,y:c,width:d,height:e,r:f||0,rx:f||0,ry:f||0,fill:"none",stroke:"#000"},h.type="rect",bG(g,h.attrs);return h},bR=function(a,b,c,d,e){var f=bG("ellipse");a.canvas&&a.canvas[l](f);var g=new bN(f,a);g.attrs={cx:b,cy:c,rx:d,ry:e,fill:"none",stroke:"#000"},g.type="ellipse",bG(f,g.attrs);return g},bS=function(a,b,c,d,e,f){var g=bG("image");bG(g,{x:c,y:d,width:e,height:f,preserveAspectRatio:"none"}),g.setAttributeNS(a.xlink,"href",b),a.canvas&&a.canvas[l](g);var h=new bN(g,a);h.attrs={x:c,y:d,width:e,height:f,src:b},h.type="image";return h},bT=function(a,b,c,d){var e=bG("text");bG(e,{x:b,y:c,"text-anchor":"middle"}),a.canvas&&a.canvas[l](e);var f=new bN(e,a);f.attrs={x:b,y:c,"text-anchor":"middle",text:d,font:W.font,stroke:"none",fill:"#000"},f.type="text",bK(f,f.attrs);return f},bU=function(a,b){this.width=a||this.width,this.height=b||this.height,this.canvas[R]("width",this.width),this.canvas[R]("height",this.height);return this},bV=function(){var b=by[m](0,arguments),c=b&&b.container,d=b.x,e=b.y,f=b.width,h=b.height;if(!c)throw new Error("SVG container not found.");var i=bG("svg");d=d||0,e=e||0,f=f||512,h=h||342,bG(i,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:f,height:h}),c==1?(i.style.cssText="position:absolute;left:"+d+"px;top:"+e+"px",g.body[l](i)):c.firstChild?c.insertBefore(i,c.firstChild):c[l](i),c=new j,c.width=f,c.height=h,c.canvas=i,bz.call(c,c,a.fn),c.clear();return c};k.clear=function(){var a=this.canvas;while(a.firstChild)a.removeChild(a.firstChild);this.bottom=this.top=null,(this.desc=bG("desc"))[l](g.createTextNode("Created with Raphaël")),a[l](this.desc),a[l](this.defs=bG("defs"))},k.remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bF(a)}}if(a.vml){var bW={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},bX=/([clmz]),?([^clmz]*)/gi,bY=/ progid:\S+Blur\([^\)]+\)/g,bZ=/-?[^,\s-]+/g,b$=1e3+q+1e3,b_=10,ca={path:1,rect:1},cb=function(a){var b=/[ahqstv]/ig,c=bq;r(a).match(b)&&(c=bw),b=/[clmz]/g;if(c==bq&&!r(a).match(b)){var d=r(a)[Y](bX,function(a,b,c){var d=[],e=x.call(b)=="m",f=bW[b];c[Y](bZ,function(a){e&&d[w]==2&&(f+=d+bW[b=="m"?"l":"L"],d=[]),d[L](Q(a*b_))});return f+d});return d}var e=c(a),f,g;d=[];for(var h=0,i=e[w];h<i;h++){f=e[h],g=x.call(e[h][0]),g=="z"&&(g="x");for(var j=1,k=f[w];j<k;j++)g+=Q(f[j]*b_)+(j!=k-1?",":p);d[L](g)}return d[v](q)};a[H]=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version},bH=function(a,b){var c=cd("group");c.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px",c.coordsize=b.coordsize,c.coordorigin=b.coordorigin;var d=cd("shape"),e=d.style;e.width=b.width+"px",e.height=b.height+"px",d.coordsize=b$,d.coordorigin=b.coordorigin,c[l](d);var f=new bN(d,c,b),g={fill:"none",stroke:"#000"};a&&(g.path=a),f.type="path",f.path=[],f.Path=p,bK(f,g),b.canvas[l](c);return f},bK=function(c,d){c.attrs=c.attrs||{};var e=c.node,h=c.attrs,i=e.style,j,k=(d.x!=h.x||d.y!=h.y||d.width!=h.width||d.height!=h.height||d.r!=h.r)&&c.type=="rect",m=c;for(var n in d)d[f](n)&&(h[n]=d[n]);k&&(h.path=cc(h.x,h.y,h.width,h.height,h.r),c.X=h.x,c.Y=h.y,c.W=h.width,c.H=h.height),d.href&&(e.href=d.href),d.title&&(e.title=d.title),d.target&&(e.target=d.target),d.cursor&&(i.cursor=d.cursor),"blur"in d&&c.blur(d.blur);if(d.path&&c.type=="path"||k)e.path=cb(h.path);d.rotation!=null&&c.rotate(d.rotation,!0),d.translation&&(j=r(d.translation)[s](b),cA.call(c,j[0],j[1]),c._.rt.cx!=null&&(c._.rt.cx+=+j[0],c._.rt.cy+=+j[1],c.setBox(c.attrs,j[0],j[1]))),d.scale&&(j=r(d.scale)[s](b),c.scale(+j[0]||1,+j[1]||+j[0]||1,+j[2]||null,+j[3]||null));if("clip-rect"in d){var o=r(d["clip-rect"])[s](b);if(o[w]==4){o[2]=+o[2]+ +o[0],o[3]=+o[3]+ +o[1];var q=e.clipRect||g.createElement("div"),t=q.style,u=e.parentNode;t.clip=a.format("rect({1}px {2}px {3}px {0}px)",o),e.clipRect||(t.position="absolute",t.top=0,t.left=0,t.width=c.paper.width+"px",t.height=c.paper.height+"px",u.parentNode.insertBefore(q,u),q[l](u),e.clipRect=q)}d["clip-rect"]||e.clipRect&&(e.clipRect.style.clip=p)}c.type=="image"&&d.src&&(e.src=d.src),c.type=="image"&&d.opacity&&(e.filterOpacity=U+".Alpha(opacity="+d.opacity*100+")",i.filter=(e.filterMatrix||p)+(e.filterOpacity||p)),d.font&&(i.font=d.font),d["font-family"]&&(i.fontFamily='"'+d["font-family"][s](",")[0][Y](/^['"]+|['"]+$/g,p)+'"'),d["font-size"]&&(i.fontSize=d["font-size"]),d["font-weight"]&&(i.fontWeight=d["font-weight"]),d["font-style"]&&(i.fontStyle=d["font-style"]);if(d.opacity!=null||d["stroke-width"]!=null||d.fill!=null||d.stroke!=null||d["stroke-width"]!=null||d["stroke-opacity"]!=null||d["fill-opacity"]!=null||d["stroke-dasharray"]!=null||d["stroke-miterlimit"]!=null||d["stroke-linejoin"]!=null||d["stroke-linecap"]!=null){e=c.shape||e;var v=e.getElementsByTagName(I)&&e.getElementsByTagName(I)[0],x=!1;!v&&(x=v=cd(I));if("fill-opacity"in d||"opacity"in d){var y=((+h["fill-opacity"]+1||2)-1)*((+h.opacity+1||2)-1)*((+a.getRGB(d.fill).o+1||2)-1);y=A(z(y,0),1),v.opacity=y}d.fill&&(v.on=!0);if(v.on==null||d.fill=="none")v.on=!1;if(v.on&&d.fill){var B=d.fill.match(M);B?(v.src=B[1],v.type="tile"):(v.color=a.getRGB(d.fill).hex,v.src=p,v.type="solid",a.getRGB(d.fill).error&&(m.type in{circle:1,ellipse:1}||r(d.fill).charAt()!="r")&&bI(m,d.fill)&&(h.fill="none",h.gradient=d.fill))}x&&e[l](v);var C=e.getElementsByTagName("stroke")&&e.getElementsByTagName("stroke")[0],D=!1;!C&&(D=C=cd("stroke"));if(d.stroke&&d.stroke!="none"||d["stroke-width"]||d["stroke-opacity"]!=null||d["stroke-dasharray"]||d["stroke-miterlimit"]||d["stroke-linejoin"]||d["stroke-linecap"])C.on=!0;(d.stroke=="none"||C.on==null||d.stroke==0||d["stroke-width"]==0)&&(C.on=!1);var E=a.getRGB(d.stroke);C.on&&d.stroke&&(C.color=E.hex),y=((+h["stroke-opacity"]+1||2)-1)*((+h.opacity+1||2)-1)*((+E.o+1||2)-1);var F=(S(d["stroke-width"])||1)*.75;y=A(z(y,0),1),d["stroke-width"]==null&&(F=h["stroke-width"]),d["stroke-width"]&&(C.weight=F),F&&F<1&&(y*=F)&&(C.weight=1),C.opacity=y,d["stroke-linejoin"]&&(C.joinstyle=d["stroke-linejoin"]||"miter"),C.miterlimit=d["stroke-miterlimit"]||8,d["stroke-linecap"]&&(C.endcap=d["stroke-linecap"]=="butt"?"flat":d["stroke-linecap"]=="square"?"square":"round");if(d["stroke-dasharray"]){var G={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};C.dashstyle=G[f](d["stroke-dasharray"])?G[d["stroke-dasharray"]]:p}D&&e[l](C)}if(m.type=="text"){i=m.paper.span.style,h.font&&(i.font=h.font),h["font-family"]&&(i.fontFamily=h["font-family"]),h["font-size"]&&(i.fontSize=h["font-size"]),h["font-weight"]&&(i.fontWeight=h["font-weight"]),h["font-style"]&&(i.fontStyle=h["font-style"]),m.node.string&&(m.paper.span.innerHTML=r(m.node.string)[Y](/</g,"&#60;")[Y](/&/g,"&#38;")[Y](/\n/g,"<br>")),m.W=h.w=m.paper.span.offsetWidth,m.H=h.h=m.paper.span.offsetHeight,m.X=h.x,m.Y=h.y+Q(m.H/2);switch(h["text-anchor"]){case"start":m.node.style["v-text-align"]="left",m.bbx=Q(m.W/2);break;case"end":m.node.style["v-text-align"]="right",m.bbx=-Q(m.W/2);break;default:m.node.style["v-text-align"]="center"}}},bI=function(a,b){a.attrs=a.attrs||{};var c=a.attrs,d,e="linear",f=".5 .5";a.attrs.gradient=b,b=r(b)[Y](bd,function(a,b,c){e="radial",b&&c&&(b=S(b),c=S(c),C(b-.5,2)+C(c-.5,2)>.25&&(c=y.sqrt(.25-C(b-.5,2))*((c>.5)*2-1)+.5),f=b+q+c);return p}),b=b[s](/\s*\-\s*/);if(e=="linear"){var g=b.shift();g=-S(g);if(isNaN(g))return null}var h=bx(b);if(!h)return null;a=a.shape||a.node,d=a.getElementsByTagName(I)[0]||cd(I),!d.parentNode&&a.appendChild(d);if(h[w]){d.on=!0,d.method="none",d.color=h[0].color,d.color2=h[h[w]-1].color;var i=[];for(var j=0,k=h[w];j<k;j++)h[j].offset&&i[L](h[j].offset+q+h[j].color);d.colors&&(d.colors.value=i[w]?i[v]():"0% "+d.color),e=="radial"?(d.type="gradientradial",d.focus="100%",d.focussize=f,d.focusposition=f):(d.type="gradient",d.angle=(270-g)%360)}return 1},bN=function(b,c,d){var e=0,f=0,g=0,h=1;this[0]=b,this.id=a._oid++,this.node=b,b.raphael=this,this.X=0,this.Y=0,this.attrs={},this.Group=c,this.paper=d,this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1},!d.bottom&&(d.bottom=this),this.prev=d.top,d.top&&(d.top.next=this),d.top=this,this.next=null},bO=bN[e],bO.rotate=function(a,c,d){if(this.removed)return this;if(a==null){if(this._.rt.cx)return[this._.rt.deg,this._.rt.cx,this._.rt.cy][v](q);return this._.rt.deg}a=r(a)[s](b),a[w]-1&&(c=S(a[1]),d=S(a[2])),a=S(a[0]),c!=null?this._.rt.deg=a:this._.rt.deg+=a,d==null&&(c=null),this._.rt.cx=c,this._.rt.cy=d,this.setBox(this.attrs,c,d),this.Group.style.rotation=this._.rt.deg;return this},bO.setBox=function(a,b,c){if(this.removed)return this;var d=this.Group.style,e=this.shape&&this.shape.style||this.node.style;a=a||{};for(var g in a)a[f](g)&&(this.attrs[g]=a[g]);b=b||this._.rt.cx,c=c||this._.rt.cy;var h=this.attrs,i,j,k,l;switch(this.type){case"circle":i=h.cx-h.r,j=h.cy-h.r,k=l=h.r*2;break;case"ellipse":i=h.cx-h.rx,j=h.cy-h.ry,k=h.rx*2,l=h.ry*2;break;case"image":i=+h.x,j=+h.y,k=h.width||0,l=h.height||0;break;case"text":this.textpath.v=["m",Q(h.x),", ",Q(h.y-2),"l",Q(h.x)+1,", ",Q(h.y-2)][v](p),i=h.x-Q(this.W/2),j=h.y-this.H/2,k=this.W,l=this.H;break;case"rect":case"path":if(!this.attrs.path)i=0,j=0,k=this.paper.width,l=this.paper.height;else{var m=bn(this.attrs.path);i=m.x,j=m.y,k=m.width,l=m.height}break;default:i=0,j=0,k=this.paper.width,l=this.paper.height}b=b==null?i+k/2:b,c=c==null?j+l/2:c;var n=b-this.paper.width/2,o=c-this.paper.height/2,q;d.left!=(q=n+"px")&&(d.left=q),d.top!=(q=o+"px")&&(d.top=q),this.X=ca[f](this.type)?-n:i,this.Y=ca[f](this.type)?-o:j,this.W=k,this.H=l,ca[f](this.type)?(e.left!=(q=-n*b_+"px")&&(e.left=q),e.top!=(q=-o*b_+"px")&&(e.top=q)):this.type=="text"?(e.left!=(q=-n+"px")&&(e.left=q),e.top!=(q=-o+"px")&&(e.top=q)):(d.width!=(q=this.paper.width+"px")&&(d.width=q),d.height!=(q=this.paper.height+"px")&&(d.height=q),e.left!=(q=i-n+"px")&&(e.left=q),e.top!=(q=j-o+"px")&&(e.top=q),e.width!=(q=k+"px")&&(e.width=q),e.height!=(q=l+"px")&&(e.height=q))},bO.hide=function(){!this.removed&&(this.Group.style.display="none");return this},bO.show=function(){!this.removed&&(this.Group.style.display="block");return this},bO.getBBox=function(){if(this.removed)return this;if(ca[f](this.type))return bn(this.attrs.path);return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}},bO.remove=function(){if(!this.removed){bA(this,this.paper),this.node.parentNode.removeChild(this.node),this.Group.parentNode.removeChild(this.Group),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var a in this)delete this[a];this.removed=!0}},bO.attr=function(b,c){if(this.removed)return this;if(b==null){var d={};for(var e in this.attrs)this.attrs[f](e)&&(d[e]=this.attrs[e]);this._.rt.deg&&(d.rotation=this.rotate()),(this._.sx!=1||this._.sy!=1)&&(d.scale=this.scale()),d.gradient&&d.fill=="none"&&(d.fill=d.gradient)&&delete d.gradient;return d}if(c==null&&a.is(b,"string")){if(b=="translation")return cA.call(this);if(b=="rotation")return this.rotate();if(b=="scale")return this.scale();if(b==I&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[b]}if(this.attrs&&c==null&&a.is(b,G)){var g,h={};for(e=0,g=b[w];e<g;e++)h[b[e]]=this.attr(b[e]);return h}var i;c!=null&&(i={},i[b]=c),c==null&&a.is(b,"object")&&(i=b);if(i){for(var j in this.paper.customAttributes)if(this.paper.customAttributes[f](j)&&i[f](j)&&a.is(this.paper.customAttributes[j],"function")){var k=this.paper.customAttributes[j].apply(this,[][n](i[j]));this.attrs[j]=i[j];for(var l in k)k[f](l)&&(i[l]=k[l])}i.text&&this.type=="text"&&(this.node.string=i.text),bK(this,i),i.gradient&&({circle:1,ellipse:1}[f](this.type)||r(i.gradient).charAt()!="r")&&bI(this,i.gradient),(!ca[f](this.type)||this._.rt.deg)&&this.setBox(this.attrs)}return this},bO.toFront=function(){!this.removed&&this.Group.parentNode[l](this.Group),this.paper.top!=this&&bB(this,this.paper);return this},bO.toBack=function(){if(this.removed)return this;this.Group.parentNode.firstChild!=this.Group&&(this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild),bC(this,this.paper));return this},bO.insertAfter=function(a){if(this.removed)return this;a.constructor==cD&&(a=a[a.length-1]),a.Group.nextSibling?a.Group.parentNode.insertBefore(this.Group,a.Group.nextSibling):a.Group.parentNode[l](this.Group),bD(this,a,this.paper);return this},bO.insertBefore=function(a){if(this.removed)return this;a.constructor==cD&&(a=a[0]),a.Group.parentNode.insertBefore(this.Group,a.Group),bE(this,a,this.paper);return this},bO.blur=function(b){var c=this.node.runtimeStyle,d=c.filter;d=d.replace(bY,p),+b!==0?(this.attrs.blur=b,c.filter=d+q+U+".Blur(pixelradius="+(+b||1.5)+")",c.margin=a.format("-{0}px 0 0 -{0}px",Q(+b||1.5))):(c.filter=d,c.margin=0,delete this.attrs.blur)},bP=function(a,b,c,d){var e=cd("group"),f=cd("oval"),g=f.style;e.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",e.coordsize=b$,e.coordorigin=a.coordorigin,e[l](f);var h=new bN(f,e,a);h.type="circle",bK(h,{stroke:"#000",fill:"none"}),h.attrs.cx=b,h.attrs.cy=c,h.attrs.r=d,h.setBox({x:b-d,y:c-d,width:d*2,height:d*2}),a.canvas[l](e);return h};function cc(b,c,d,e,f){return f?a.format("M{0},{1}l{2},0a{3},{3},0,0,1,{3},{3}l0,{5}a{3},{3},0,0,1,{4},{3}l{6},0a{3},{3},0,0,1,{4},{4}l0,{7}a{3},{3},0,0,1,{3},{4}z",b+f,c,d-f*2,f,-f,e-f*2,f*2-d,f*2-e):a.format("M{0},{1}l{2},0,0,{3},{4},0z",b,c,d,e,-d)}bQ=function(a,b,c,d,e,f){var g=cc(b,c,d,e,f),h=a.path(g),i=h.attrs;h.X=i.x=b,h.Y=i.y=c,h.W=i.width=d,h.H=i.height=e,i.r=f,i.path=g,h.type="rect";return h},bR=function(a,b,c,d,e){var f=cd("group"),g=cd("oval"),h=g.style;f.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",f.coordsize=b$,f.coordorigin=a.coordorigin,f[l](g);var i=new bN(g,f,a);i.type="ellipse",bK(i,{stroke:"#000"}),i.attrs.cx=b,i.attrs.cy=c,i.attrs.rx=d,i.attrs.ry=e,i.setBox({x:b-d,y:c-e,width:d*2,height:e*2}),a.canvas[l](f);return i},bS=function(a,b,c,d,e,f){var g=cd("group"),h=cd("image");g.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",g.coordsize=b$,g.coordorigin=a.coordorigin,h.src=b,g[l](h);var i=new bN(h,g,a);i.type="image",i.attrs.src=b,i.attrs.x=c,i.attrs.y=d,i.attrs.w=e,i.attrs.h=f,i.setBox({x:c,y:d,width:e,height:f}),a.canvas[l](g);return i},bT=function(b,c,d,e){var f=cd("group"),g=cd("shape"),h=g.style,i=cd("path"),j=i.style,k=cd("textpath");f.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px",f.coordsize=b$,f.coordorigin=b.coordorigin,i.v=a.format("m{0},{1}l{2},{1}",Q(c*10),Q(d*10),Q(c*10)+1),i.textpathok=!0,h.width=b.width,h.height=b.height,k.string=r(e),k.on=!0,g[l](k),g[l](i),f[l](g);var m=new bN(k,f,b);m.shape=g,m.textpath=i,m.type="text",m.attrs.text=e,m.attrs.x=c,m.attrs.y=d,m.attrs.w=1,m.attrs.h=1,bK(m,{font:W.font,stroke:"none",fill:"#000"}),m.setBox(),b.canvas[l](f);return m},bU=function(a,b){var c=this.canvas.style;a==+a&&(a+="px"),b==+b&&(b+="px"),c.width=a,c.height=b,c.clip="rect(0 "+a+" "+b+" 0)";return this};var cd;g.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!g.namespaces.rvml&&g.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),cd=function(a){return g.createElement("<rvml:"+a+' class="rvml">')}}catch(ce){cd=function(a){return g.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}bV=function(){var b=by[m](0,arguments),c=b.container,d=b.height,e,f=b.width,h=b.x,i=b.y;if(!c)throw new Error("VML container not found.");var k=new j,n=k.canvas=g.createElement("div"),o=n.style;h=h||0,i=i||0,f=f||512,d=d||342,f==+f&&(f+="px"),d==+d&&(d+="px"),k.width=1e3,k.height=1e3,k.coordsize=b_*1e3+q+b_*1e3,k.coordorigin="0 0",k.span=g.createElement("span"),k.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",n[l](k.span),o.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(g.body[l](n),o.left=h+"px",o.top=i+"px",o.position="absolute"):c.firstChild?c.insertBefore(n,c.firstChild):c[l](n),bz.call(k,k,a.fn);return k},k.clear=function(){this.canvas.innerHTML=p,this.span=g.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas[l](this.span),this.bottom=this.top=null},k.remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bF(a);return!0}}var cf=navigator.userAgent.match(/Version\/(.*?)\s/);navigator.vendor=="Apple Computer, Inc."&&(cf&&cf[1]<4||navigator.platform.slice(0,2)=="iP")?k.safari=function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});h.setTimeout(function(){a.remove()})}:k.safari=function(){};var cg=function(){this.returnValue=!1},ch=function(){return this.originalEvent.preventDefault()},ci=function(){this.cancelBubble=!0},cj=function(){return this.originalEvent.stopPropagation()},ck=function(){if(g.addEventListener)return function(a,b,c,d){var e=o&&u[b]?u[b]:b,g=function(e){if(o&&u[f](b))for(var g=0,h=e.targetTouches&&e.targetTouches.length;g<h;g++)if(e.targetTouches[g].target==a){var i=e;e=e.targetTouches[g],e.originalEvent=i,e.preventDefault=ch,e.stopPropagation=cj;break}return c.call(d,e)};a.addEventListener(e,g,!1);return function(){a.removeEventListener(e,g,!1);return!0}};if(g.attachEvent)return function(a,b,c,d){var e=function(a){a=a||h.event,a.preventDefault=a.preventDefault||cg,a.stopPropagation=a.stopPropagation||ci;return c.call(d,a)};a.attachEvent("on"+b,e);var f=function(){a.detachEvent("on"+b,e);return!0};return f}}(),cl=[],cm=function(a){var b=a.clientX,c=a.clientY,d=g.documentElement.scrollTop||g.body.scrollTop,e=g.documentElement.scrollLeft||g.body.scrollLeft,f,h=cl.length;while(h--){f=cl[h];if(o){var i=a.touches.length,j;while(i--){j=a.touches[i];if(j.identifier==f.el._drag.id){b=j.clientX,c=j.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}}else a.preventDefault();b+=e,c+=d,f.move&&f.move.call(f.move_scope||f.el,b-f.el._drag.x,c-f.el._drag.y,b,c,a)}},cn=function(b){a.unmousemove(cm).unmouseup(cn);var c=cl.length,d;while(c--)d=cl[c],d.el._drag={},d.end&&d.end.call(d.end_scope||d.start_scope||d.move_scope||d.el,b);cl=[]};for(var co=t[w];co--;)(function(b){a[b]=bN[e][b]=function(c,d){a.is(c,"function")&&(this.events=this.events||[],this.events.push({name:b,f:c,unbind:ck(this.shape||this.node||g,b,c,d||this)}));return this},a["un"+b]=bN[e]["un"+b]=function(a){var c=this.events,d=c[w];while(d--)if(c[d].name==b&&c[d].f==a){c[d].unbind(),c.splice(d,1),!c.length&&delete this.events;return this}return this}})(t[co]);bO.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},bO.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)},bO.drag=function(b,c,d,e,f,h){this._drag={},this.mousedown(function(i){(i.originalEvent||i).preventDefault();var j=g.documentElement.scrollTop||g.body.scrollTop,k=g.documentElement.scrollLeft||g.body.scrollLeft;this._drag.x=i.clientX+k,this._drag.y=i.clientY+j,this._drag.id=i.identifier,c&&c.call(f||e||this,i.clientX+k,i.clientY+j,i),!cl.length&&a.mousemove(cm).mouseup(cn),cl.push({el:this,move:b,end:d,move_scope:e,start_scope:f,end_scope:h})});return this},bO.undrag=function(b,c,d){var e=cl.length;while(e--)cl[e].el==this&&cl[e].move==b&&cl[e].end==d&&cl.splice(e++,1);!cl.length&&a.unmousemove(cm).unmouseup(cn)},k.circle=function(a,b,c){return bP(this,a||0,b||0,c||0)},k.rect=function(a,b,c,d,e){return bQ(this,a||0,b||0,c||0,d||0,e||0)},k.ellipse=function(a,b,c,d){return bR(this,a||0,b||0,c||0,d||0)},k.path=function(b){b&&!a.is(b,F)&&!a.is(b[0],G)&&(b+=p);return bH(a.format[m](a,arguments),this)},k.image=function(a,b,c,d,e){return bS(this,a||"about:blank",b||0,c||0,d||0,e||0)},k.text=function(a,b,c){return bT(this,a||0,b||0,r(c))},k.set=function(a){arguments[w]>1&&(a=Array[e].splice.call(arguments,0,arguments[w]));return new cD(a)},k.setSize=bU,k.top=k.bottom=null,k.raphael=a,bO.resetScale=function(){if(this.removed)return this;this._.sx=1,this._.sy=1,this.attrs.scale="1 1"},bO.scale=function(a,b,c,d){if(this.removed)return this;if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:cp};b=b||a,!+b&&(b=a);var e,f,g,h,i=this.attrs;if(a!=0){var j=this.getBBox(),k=j.x+j.width/2,l=j.y+j.height/2,m=B(a/this._.sx),o=B(b/this._.sy);c=+c||c==0?c:k,d=+d||d==0?d:l;var r=this._.sx>0,s=this._.sy>0,t=~~(a/B(a)),u=~~(b/B(b)),x=m*t,y=o*u,z=this.node.style,A=c+B(k-c)*x*(k>c==r?1:-1),C=d+B(l-d)*y*(l>d==s?1:-1),D=a*t>b*u?o:m;switch(this.type){case"rect":case"image":var E=i.width*m,F=i.height*o;this.attr({height:F,r:i.r*D,width:E,x:A-E/2,y:C-F/2});break;case"circle":case"ellipse":this.attr({rx:i.rx*m,ry:i.ry*o,r:i.r*D,cx:A,cy:C});break;case"text":this.attr({x:A,y:C});break;case"path":var G=bp(i.path),H=!0,I=r?x:m,J=s?y:o;for(var K=0,L=G[w];K<L;K++){var M=G[K],N=V.call(M[0]);if(N=="M"&&H)continue;H=!1;if(N=="A")M[G[K][w]-2]*=I,M[G[K][w]-1]*=J,M[1]*=m,M[2]*=o,M[5]=+(t+u?!!+M[5]:!+M[5]);else if(N=="H")for(var O=1,P=M[w];O<P;O++)M[O]*=I;else if(N=="V")for(O=1,P=M[w];O<P;O++)M[O]*=J;else for(O=1,P=M[w];O<P;O++)M[O]*=O%2?I:J}var Q=bn(G);e=A-Q.x-Q.width/2,f=C-Q.y-Q.height/2,G[0][1]+=e,G[0][2]+=f,this.attr({path:G})}this.type in{text:1,image:1}&&(t!=1||u!=1)?this.transformations?(this.transformations[2]="scale("[n](t,",",u,")"),this.node[R]("transform",this.transformations[v](q)),e=t==-1?-i.x-(E||0):i.x,f=u==-1?-i.y-(F||0):i.y,this.attr({x:e,y:f}),i.fx=t-1,i.fy=u-1):(this.node.filterMatrix=U+".Matrix(M11="[n](t,", M12=0, M21=0, M22=",u,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')"),z.filter=(this.node.filterMatrix||p)+(this.node.filterOpacity||p)):this.transformations?(this.transformations[2]=p,this.node[R]("transform",this.transformations[v](q)),i.fx=0,i.fy=0):(this.node.filterMatrix=p,z.filter=(this.node.filterMatrix||p)+(this.node.filterOpacity||p)),i.scale=[a,b,c,d][v](q),this._.sx=a,this._.sy=b}return this},bO.clone=function(){if(this.removed)return null;var a=this.attr();delete a.scale,delete a.translation;return this.paper[this.type]().attr(a)};var cq={},cr=function(b,c,d,e,f,g,h,i,j){var k=0,l=100,m=[b,c,d,e,f,g,h,i].join(),n=cq[m],o,p;!n&&(cq[m]=n={data:[]}),n.timer&&clearTimeout(n.timer),n.timer=setTimeout(function(){delete cq[m]},2e3);if(j!=null){var q=cr(b,c,d,e,f,g,h,i);l=~~q*10}for(var r=0;r<l+1;r++){n.data[j]>r?p=n.data[r*l]:(p=a.findDotsAtSegment(b,c,d,e,f,g,h,i,r/l),n.data[r]=p),r&&(k+=C(C(o.x-p.x,2)+C(o.y-p.y,2),.5));if(j!=null&&k>=j)return p;o=p}if(j==null)return k},cs=function(b,c){return function(d,e,f){d=bw(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;o<p;o++){i=d[o];if(i[0]=="M")g=+i[1],h=+i[2];else{j=cr(g,h,i[1],i[2],i[3],i[4],i[5],i[6]);if(n+j>e){if(c&&!l.start){m=cr(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C",m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M",m.x,m.y+"C",m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]][v](),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=cr(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},ct=cs(1),cu=cs(),cv=cs(0,1);bO.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return ct(this.attrs.path)}},bO.getPointAtLength=function(a){if(this.type=="path")return cu(this.attrs.path,a)},bO.getSubpath=function(a,b){if(this.type=="path"){if(B(this.getTotalLength()-b)<"1e-6")return cv(this.attrs.path,a).end;var c=cv(this.attrs.path,b,1);return a?cv(c,a).end:c}},a.easing_formulas={linear:function(a){return a},"<":function(a){return C(a,3)},">":function(a){return C(a-1,3)+1},"<>":function(a){a=a*2;if(a<1)return C(a,3)/2;a-=2;return(C(a,3)+2)/2},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==0||a==1)return a;var b=.3,c=b/4;return C(2,-10*a)*y.sin((a-c)*2*D/b)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};var cw=[],cx=function(){var b=+(new Date);for(var c=0;c<cw[w];c++)try{var d=cw[c];if(d.stop||d.el.removed)continue;var e=b-d.start,g=d.ms,h=d.easing,i=d.from,j=d.diff,k=d.to,l=d.t,m=d.el,n={},o;if(e<g){var r=h(e/g);for(var s in i)if(i[f](s)){switch(X[s]){case"along":o=r*g*j[s],k.back&&(o=k.len-o);var t=cu(k[s],o);m.translate(j.sx-j.x||0,j.sy-j.y||0),j.x=t.x,j.y=t.y,m.translate(t.x-j.sx,t.y-j.sy),k.rot&&m.rotate(j.r+t.alpha,t.x,t.y);break;case E:o=+i[s]+r*g*j[s];break;case"colour":o="rgb("+[cz(Q(i[s].r+r*g*j[s].r)),cz(Q(i[s].g+r*g*j[s].g)),cz(Q(i[s].b+r*g*j[s].b))][v](",")+")";break;case"path":o=[];for(var u=0,x=i[s][w];u<x;u++){o[u]=[i[s][u][0]];for(var y=1,z=i[s][u][w];y<z;y++)o[u][y]=+i[s][u][y]+r*g*j[s][u][y];o[u]=o[u][v](q)}o=o[v](q);break;case"csv":switch(s){case"translation":var A=r*g*j[s][0]-l.x,B=r*g*j[s][1]-l.y;l.x+=A,l.y+=B,o=A+q+B;break;case"rotation":o=+i[s][0]+r*g*j[s][0],i[s][1]&&(o+=","+i[s][1]+","+i[s][2]);break;case"scale":o=[+i[s][0]+r*g*j[s][0],+i[s][1]+r*g*j[s][1],2 in k[s]?k[s][2]:p,3 in k[s]?k[s][3]:p][v](q);break;case"clip-rect":o=[],u=4;while(u--)o[u]=+i[s][u]+r*g*j[s][u]}break;default:var C=[].concat(i[s]);o=[],u=m.paper.customAttributes[s].length;while(u--)o[u]=+C[u]+r*g*j[s][u]}n[s]=o}m.attr(n),m._run&&m._run.call(m)}else k.along&&(t=cu(k.along,k.len*!k.back),m.translate(j.sx-(j.x||0)+t.x-j.sx,j.sy-(j.y||0)+t.y-j.sy),k.rot&&m.rotate(j.r+t.alpha,t.x,t.y)),(l.x||l.y)&&m.translate(-l.x,-l.y),k.scale&&(k.scale+=p),m.attr(k),cw.splice(c--,1)}catch(d){window.console&&console.error(d)}a.svg&&m&&m.paper&&m.paper.safari(),cw[w]&&setTimeout(cx)},cy=function(b,c,d,e,f){var g=d-e;c.timeouts.push(setTimeout(function(){a.is(f,"function")&&f.call(c),c.animate(b,g,b.easing)},e))},cz=function(a){return z(A(a,255),0)},cA=function(a,b){if(a==null)return{x:this._.tx,y:this._.ty,toString:cp};this._.tx+=+a,this._.ty+=+b;switch(this.type){case"circle":case"ellipse":this.attr({cx:+a+this.attrs.cx,cy:+b+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+a+this.attrs.x,y:+b+this.attrs.y});break;case"path":var c=bp(this.attrs.path);c[0][1]+=+a,c[0][2]+=+b,this.attr({path:c})}return this};bO.animateWith=function(a,b,c,d,e){for(var f=0,g=cw.length;f<g;f++)cw[f].el.id==a.id&&(b.start=cw[f].start);return this.animate(b,c,d,e)},bO.animateAlong=cB(),bO.animateAlongBack=cB(1),bO.onAnimation=function(a){this._run=a||0;return this},bO.animate=function(c,d,e,g){var h=this;h.timeouts=h.timeouts||[];if(a.is(e,"function")||!e)g=e||null;if(h.removed){g&&g.call(h);return h}var i={},j={},k=!1,l={};for(var m in c)if(c[f](m))if(X[f](m)||h.paper.customAttributes[f](m)){k=!0,i[m]=h.attr(m),i[m]==null&&(i[m]=W[m]),j[m]=c[m];switch(X[m]){case"along":var n=ct(c[m]),o=cu(c[m],n*!!c.back),p=h.getBBox();l[m]=n/d,l.tx=p.x,l.ty=p.y,l.sx=o.x,l.sy=o.y,j.rot=c.rot,j.back=c.back,j.len=n,c.rot&&(l.r=S(h.rotate())||0);break;case E:l[m]=(j[m]-i[m])/d;break;case"colour":i[m]=a.getRGB(i[m]);var q=a.getRGB(j[m]);l[m]={r:(q.r-i[m].r)/d,g:(q.g-i[m].g)/d,b:(q.b-i[m].b)/d};break;case"path":var t=bw(i[m],j[m]);i[m]=t[0];var u=t[1];l[m]=[];for(var v=0,x=i[m][w];v<x;v++){l[m][v]=[0];for(var y=1,z=i[m][v][w];y<z;y++)l[m][v][y]=(u[v][y]-i[m][v][y])/d}break;case"csv":var A=r(c[m])[s](b),B=r(i[m])[s](b);switch(m){case"translation":i[m]=[0,0],l[m]=[A[0]/d,A[1]/d];break;case"rotation":i[m]=B[1]==A[1]&&B[2]==A[2]?B:[0,A[1],A[2]],l[m]=[(A[0]-i[m][0])/d,0,0];break;case"scale":c[m]=A,i[m]=r(i[m])[s](b),l[m]=[(A[0]-i[m][0])/d,(A[1]-i[m][1])/d,0,0];break;case"clip-rect":i[m]=r(i[m])[s](b),l[m]=[],v=4;while(v--)l[m][v]=(A[v]-i[m][v])/d}j[m]=A;break;default:A=[].concat(c[m]),B=[].concat(i[m]),l[m]=[],v=h.paper.customAttributes[m][w];while(v--)l[m][v]=((A[v]||0)-(B[v]||0))/d}}if(!k){var C=[],D;for(var F in c)c[f](F)&&Z.test(F)&&(m={value:c[F]},F=="from"&&(F=0),F=="to"&&(F=100),m.key=T(F,10),C.push(m));C.sort(be),C[0].key&&C.unshift({key:0,value:h.attrs});for(v=0,x=C[w];v<x;v++)cy(C[v].value,h,d/100*C[v].key,d/100*(C[v-1]&&C[v-1].key||0),C[v-1]&&C[v-1].value.callback);D=C[C[w]-1].value.callback,D&&h.timeouts.push(setTimeout(function(){D.call(h)},d))}else{var G=a.easing_formulas[e];if(!G){G=r(e).match(P);if(G&&G[w]==5){var H=G;G=function(a){return cC(a,+H[1],+H[2],+H[3],+H[4],d)}}else G=function(a){return a}}cw.push({start:c.start||+(new Date),ms:d,easing:G,from:i,diff:l,to:j,el:h,t:{x:0,y:0}}),a.is(g,"function")&&(h._ac=setTimeout(function(){g.call(h)},d)),cw[w]==1&&setTimeout(cx)}return this},bO.stop=function(){for(var a=0;a<cw.length;a++)cw[a].el.id==this.id&&cw.splice(a--,1);for(a=0,ii=this.timeouts&&this.timeouts.length;a<ii;a++)clearTimeout(this.timeouts[a]);this.timeouts=[],clearTimeout(this._ac),delete this._ac;return this},bO.translate=function(a,b){return this.attr({translation:a+" "+b})},bO[H]=function(){return"Raphaël’s object"},a.ae=cw;var cD=function(a){this.items=[],this[w]=0,this.type="set";if(a)for(var b=0,c=a[w];b<c;b++)a[b]&&(a[b].constructor==bN||a[b].constructor==cD)&&(this[this.items[w]]=this.items[this.items[w]]=a[b],this[w]++)};cD[e][L]=function(){var a,b;for(var c=0,d=arguments[w];c<d;c++)a=arguments[c],a&&(a.constructor==bN||a.constructor==cD)&&(b=this.items[w],this[b]=this.items[b]=a,this[w]++);return this},cD[e].pop=function(){delete this[this[w]--];return this.items.pop()};for(var cE in bO)bO[f](cE)&&(cD[e][cE]=function(a){return function(){for(var b=0,c=this.items[w];b<c;b++)this.items[b][a][m](this.items[b],arguments);return this}}(cE));cD[e].attr=function(b,c){if(b&&a.is(b,G)&&a.is(b[0],"object"))for(var d=0,e=b[w];d<e;d++)this.items[d].attr(b[d]);else for(var f=0,g=this.items[w];f<g;f++)this.items[f].attr(b,c);return this},cD[e].animate=function(b,c,d,e){(a.is(d,"function")||!d)&&(e=d||null);var f=this.items[w],g=f,h,i=this,j;e&&(j=function(){!--f&&e.call(i)}),d=a.is(d,F)?d:j,h=this.items[--g].animate(b,c,d,j);while(g--)this.items[g]&&!this.items[g].removed&&this.items[g].animateWith(h,b,c,d,j);return this},cD[e].insertAfter=function(a){var b=this.items[w];while(b--)this.items[b].insertAfter(a);return this},cD[e].getBBox=function(){var a=[],b=[],c=[],d=[];for(var e=this.items[w];e--;){var f=this.items[e].getBBox();a[L](f.x),b[L](f.y),c[L](f.x+f.width),d[L](f.y+f.height)}a=A[m](0,a),b=A[m](0,b);return{x:a,y:b,width:z[m](0,c)-a,height:z[m](0,d)-b}},cD[e].clone=function(a){a=new cD;for(var b=0,c=this.items[w];b<c;b++)a[L](this.items[b].clone());return a},a.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"];for(var d in a.face)a.face[f](d)&&(b.face[d]=a.face[d]);this.fonts[c]?this.fonts[c][L](b):this.fonts[c]=[b];if(!a.svg){b.face["units-per-em"]=T(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[f](e)){var g=a.glyphs[e];b.glyphs[e]={w:g.w,k:{},d:g.d&&"M"+g.d[Y](/[mlcxtrv]/g,function(a){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a]||"M"})+"z"};if(g.k)for(var h in g.k)g[f](h)&&(b.glyphs[e].k[h]=g.k[h])}}return a},k.getFont=function(b,c,d,e){e=e||"normal",d=d||"normal",c=+c||{normal:400,bold:700,lighter:300,bolder:800}[c]||400;if(!!a.fonts){var g=a.fonts[b];if(!g){var h=new RegExp("(^|\\s)"+b[Y](/[^\w\d\s+!~.:_-]/g,p)+"(\\s|$)","i");for(var i in a.fonts)if(a.fonts[f](i)&&h.test(i)){g=a.fonts[i];break}}var j;if(g)for(var k=0,l=g[w];k<l;k++){j=g[k];if(j.face["font-weight"]==c&&(j.face["font-style"]==d||!j.face["font-style"])&&j.face["font-stretch"]==e)break}return j}},k.print=function(c,d,e,f,g,h,i){h=h||"middle",i=z(A(i||0,1),-1);var j=this.set(),k=r(e)[s](p),l=0,m=p,n;a.is(f,e)&&(f=this.getFont(f));if(f){n=(g||16)/f.face["units-per-em"];var o=f.face.bbox.split(b),q=+o[0],t=+o[1]+(h=="baseline"?o[3]-o[1]+ +f.face.descent:(o[3]-o[1])/2);for(var u=0,v=k[w];u<v;u++){var x=u&&f.glyphs[k[u-1]]||{},y=f.glyphs[k[u]];l+=u?(x.w||f.w)+(x.k&&x.k[k[u]]||0)+f.w*i:0,y&&y.d&&j[L](this.path(y.d).attr({fill:"#000",stroke:"none",translation:[l,0]}))}j.scale(n,n,q,t).translate(c-q,d-t)}return j},a.format=function(b,c){var e=a.is(c,G)?[0][n](c):arguments;b&&a.is(b,F)&&e[w]-1&&(b=b[Y](d,function(a,b){return e[++b]==null?p:e[b]}));return b||p},a.ninja=function(){i.was?h.Raphael=i.is:delete Raphael;return a},a.el=bO,a.st=cD[e],i.was?h.Raphael=a:Raphael=a})
