PageSourceSearch

http://ykoctpa.ru/wp-s/184cc846ba572bd484f62677eec8197a.js?v=25660815155

js ykoctpa.ru collected 2026-10-02 16:15:53 UTC 150,621 bytes, 704 lines download raw bytes

1/*
2Cache: vpl_scripts_view_poll, bas-bar, bubble-popup, CD_AB_JS, bp-like, blogs_widget_blogs_list-js, groups_widget_groups_list-js, events_widget_events_list-js, places_widget_places_list-js, collapseomatic-js, tabb-widget-init, my-map, cool-map, m-cluster, jquery-cookie, prov-map, sk42, thickbox
3*/
4/* vpl_scripts_view_poll */ 
5jQuery(document).ready(function($){$('#container').on('click','.vote_button',function(){var poll_id=$('.vpl-view-poll').attr('rel').substr(5);var question=$(this).parent();var question_id=question.attr('rel').substr(9);var controls_type=question.find('.vpl-poll-answers').attr('rel').substr(5);var answer='';if(controls_type=='radio'){if(question.find('.vpl-poll-answers input[type=radio]:checked').length>0){answer=question.find('.vpl-poll-answers input[type=radio]:checked').val();}}else if(controls_type=='checkbox'){var checkboxes_values=[];question.find('.vpl-poll-answers input:checkbox:checked').each(function(){checkboxes_values.push($(this).val());});answer=checkboxes_values.join(',')}else{return false;}
6if(answer!=''){$(this).hide();$.post('/wp-admin/admin-ajax.php',{action:'vpl_make_vote',poll_id:poll_id,question_id:question_id,answer:answer},function(response){var result=JSON.parse(response);if(result.type!='error'){if($('.show_results').val()==1||$('.is_admin').val()==1){var total_votes=0;for(var a in result.answers){total_votes+=parseInt(result.answers[a].votes)}
7var statistic='<div class="vpl-poll-statistic" >';$(result.answers).each(function(i,answer){answer.percent=Math.round((parseInt(answer.votes)/total_votes*100)*100)/100;statistic+='<div class="item" ><div class="title">'+answer.answer+' '+answer.percent+'% ('+answer.votes+')</div>';statistic+='<div class="progress-bar" style="width:'+answer.percent+'%" ></div></div>';});statistic+='<p class="total">'+__e('Total')+': '+total_votes+' '+__e('votes')+'</p></div>';if(result.type=='user_error'){statistic+='<p class="already-vote">'+result.error_message+'</p>';}
8question.find('ul, p, input').remove();question.append(statistic)}else{question.find('ul, p, input').remove();question.append('<p class="already-vote">'+__e('Thank you for the vote! It was successfully saved.')+'</p>');}}else{}});}else{}});$('#container').on('click','.dating_vote_button',function(){var poll_id=$('.vpl-view-poll').attr('rel').substr(5);var question=$('.vpl-poll-question:first');var question_id=question.attr('rel').substr(9);var answer='';var checkboxes_values=[];question.find('.user.current_user .checkbox input:checkbox:checked').each(function(){checkboxes_values.push($(this).val());});answer=checkboxes_values.join(',')
9if(answer!=''){$(this).hide();question.find('.user.current_user .checkbox').addClass('loaded');question.find('.user.current_user .checkbox input:checkbox').hide();$.post('/wp-admin/admin-ajax.php',{no_results:'1',action:'vpl_make_vote',poll_id:poll_id,question_id:question_id,answer:answer},function(response){var result=JSON.parse(response);if(result.type!='error'){if($('.show_results').val()==1||$('.is_admin').val()==1){question.find('.user.current_user .checkbox ').removeClass('loaded');question.find('.user.current_user .checkbox input:checkbox:checked').each(function(){$(this).parent().removeClass('checkbox').addClass('yes');var votes=$('.vote_count[rel='+$(this).val()+']');console.log(votes);votes.text(parseInt(votes.text())+1);})
10question.find('.user.current_user .checkbox input:checkbox').parent().removeClass('checkbox').addClass('no');}else{question.find('.vpl-dating-poll-statistic').remove();question.append('<p class="already-vote">'+__e('Thank you for the vote! It was successfully saved.')+'</p>');}}else{question.find('.user.current_user').remove();question.find('.vpl-dating-poll-statistic').after('<p class="already-vote">'+result.error_message+'</p>');}});}else{}});$('#container').on('click','.vpl-poll-answers input:checkbox',function(){var max_options=$(this).parent().parent().parent().find('.options_limit').val();if(max_options>0){if($('.vpl-poll-answers input:checkbox:checked').length>max_options){return false;}}});$('.select_group').click(function(){$('.invite_users_list .friend').removeClass('selected');$('.invite_users_list .friend.is_group_member').addClass('selected');$('.friend_ids').val(getFriendIdsForInvite());})
11$('.select_event').click(function(){$('.invite_users_list .friend').removeClass('selected');$('.invite_users_list .friend.is_event_member').addClass('selected');$('.friend_ids').val(getFriendIdsForInvite());})
12$('.select_friends').click(function(){$('.invite_users_list .friend').removeClass('selected');$('.invite_users_list .friend.is_friend').addClass('selected');$('.friend_ids').val(getFriendIdsForInvite());})
13$('.select_all').click(function(){$('.invite_users_list .friend').addClass('selected');$('.friend_ids').val(getFriendIdsForInvite());})
14$('.invite_user').click(function(){$('.invite_users_list').slideToggle(200);})
15$('.cancel_invites_button').click(function(){$('.invite_users_list .friend').removeClass('selected');$('.invite_users_list').slideToggle(200);});$('.send_invites_button').click(function(){var ids=$('.friend_ids').val();var poll_id=$('.vpl-view-poll .poll_id').val();var poll_name=$('.vpl-view-poll h3').text();var poll_link=$('.vpl-view-poll .poll_link').val();$('.invite_users_list').slideUp(100);$('.invite_users_list .friend').removeClass('selected');if(ids){$.post('/wp-admin/admin-ajax.php',{action:'vpl_send_invites',friends:ids,id:poll_id,name:poll_name,link:poll_link},function(response){var result=JSON.parse(response);if(result.type=='success'){$('.vpl-poll-actions').before('<p class="vpl-message success dissapear">'+__e('Invites have been sent successfully')+'</p>');$('.friend_ids').val('');setTimeout(function(){$('.dissapear').fadeOut(1000)},1000)}});}})
16$('.invite_users_list .friend').toggleClick(function(){$(this).addClass('selected');$('.friend_ids').val(getFriendIdsForInvite());},function(){$(this).removeClass('selected');$('.friend_ids').val(getFriendIdsForInvite());})});function getFriendIdsForInvite(){var ids=[];jQuery('.invite_users_list .friend.selected').each(function(){ids.push(jQuery(this).find('.friend_id').val());})
17return ids.join(',');}
18/* bas-bar */ 
19var nextItem=0,bprotatetime=7000;function rotate(){var list=document.getElementById('rotation').getElementsByTagName('LI');var e,i;for(i=0;e=list[i];i++){e.className=i==nextItem?'':'hide'};nextItem++;if(nextItem==list.length)nextItem=0;}
20jQuery(document).ready(function($){try{if(is_touch_device())
21return;$.get(ajaxurl,{action:'get_activity_bar',},function(ret){if(ret&&ret!='0'){$('#footeractivity').html(ret);try{I("footeractivity").style.display="block";I('rotation').className='rotate';rotate();setInterval(rotate,bprotatetime);}catch(e){}}else
22$('#footeractivity').hide();});}catch(e){}});if(document.getElementById)onload=function(){}
23function rotateback(){if(nextItem==null){nextItem=1;}
24if(nextItem==0){nextItem=1;}
25nextItem--;var list=I('rotation').getElementsByTagName('LI');var e,i;for(i=0;e=list[i];i++){e.className=i==nextItem?'':'hide'}
26if(nextItem==list.length)nextItem=0;}
27function bpactbarclose(){I("footeractivity").style.display="none";I("innerbpclose").style.display="none";I("innerbpopen").style.display="block";}
28function bpactbaropen(){I("footeractivity").style.display="block";I("innerbpclose").style.display="block";I("innerbpopen").style.display="none";}
29/* bubble-popup */ 
30var cd_ab_closePopup;function coolPopup(param){var t=this;var $=jQuery;param=param||{container:'popupContainer',content:'popupContent',};t.hideDelay=param.hideDelay||400;t.showDelay=param.showDelay||400;t.hideTimer=null;t.x=null;t.param=param;t.hideTimer=null;t.nomouse={mouseenter:function(e){e.stopPropagation();},mouseleave:function(e){e.stopPropagation();},};}
31coolPopup.prototype.getData=function(obj,action){var adata,elemID,t=this,$=jQuery,el=$(obj),elem_var=String(el.attr('rel')).split('_');if(!elem_var[1])
32elem_var=String(el.attr('alt')).split('_');if(!elem_var[1])
33elem_var=String(el.attr('id')).split('-');var elemType=elem_var[0];if(!(elemID=elem_var[1]))return;if(el.hasClass('wide'))
34t.container.addClass('wide');else
35t.container.removeClass('wide');if(el.hasClass('no-autoclose'))
36t.container.addClass('no-autoclose');else
37t.container.removeClass('no-autoclose');var adata={ID:elemID,type:elemType,action:action||t.param.action};if(el.hasClass('nonce')){adata['_nonce']=$('#_ajax_nonce',$(obj).parent()).val();}
38return adata;};coolPopup.prototype.show=function(obj,evt,action,delay){var t=this,pos,gd,$=jQuery,parent=t.param.parent||'body';evt.preventDefault();evt.stopPropagation();t.container=$('#'+t.param.container);if(!t.container.length){t.container=$('<div id="'+t.param.container+'"><div class="'+t.param.content+'"></div></div>');$(parent).append(t.container);if(!$(obj).hasClass('live')){t.container.click(function(e){if(!$(e.target).parent().hasClass('live')){try{e.stopPropagation();}catch(e){}}});}}
39if(evt.pageX)
40pos={left:evt.pageX,top:evt.pageY};else
41pos=my_pos;if(t.hideTimer)
42clearTimeout(t.hideTimer);if(t.target==obj)
43return;t.willTarget=obj;$.data(obj,'timer',setTimeout(function(){t.target=obj;t.willTarget=null;var bb=t.param.show||t.bubble;if(t.param.text){bb.call(t,pos,action||t.param.text);}else if(t.param.getText){bb.call(t,pos,t.param.getText());}else if(gd=(t.param.getData||t.getData)){adata=gd.call(t,obj,action);bb.call(t,pos,'<img src="'+ajax_image+'/ajax-loader.gif" alt="Loading" />');if(t.x){t.x.abort();t.x=null;}
44t.x=$.ajax({type:'GET',url:t.param.url||ajaxurl,data:adata,success:function(data){var datas=data.split('|~|'),text=datas[1];if(text&&text.indexOf(''+parseInt(adata.ID))>0){bb.call(t,pos,text);}else
45t.close();}});}
46cd_ab_closePopup=function(){t.close();};$(document).click(function(e){if(t.target&&t.container.has(e.target).length==0&&(e.target.className&&e.target.className.indexOf('ymap')!=0)){t.close();}});$(document).on('closePopups',function(e){if(t.target)
47t.close();});if('ontouchstart'in window){window.ontouchstart=function(e){if(t.target&&t.container.has(e.target).length==0&&(e.target.className&&e.target.className.indexOf('ymap')!=0)){t.close();}};}
48t.container.mouseover(function(){if(t.hideTimer)
49clearTimeout(t.hideTimer);});t.container.mouseout(function(){if($(t.target).hasClass('no-autoclose')){}else
50t.leave();});},delay||t.showDelay));};coolPopup.prototype.hover=function(){if(t.hideTimer)
51clearTimeout(t.hideTimer);};coolPopup.prototype.leave=function(){var t=this,$=jQuery;if(t.target){if($(t.target).hasClass('no-autoclose'))
52return;if(t.hideTimer)
53clearTimeout(t.hideTimer);t.hideTimer=setTimeout(function(){if(t.x){t.x.abort();t.x=null;}
54t.close();},t.hideDelay);}else if(t.willTarget){var to=$.data(t.willTarget,'timer');c_log('leave to='+to);if(to){clearTimeout(to);$.data(t.willTarget,'timer',false);t.willTarget=null;}}};coolPopup.prototype.isShown=function(){var t=this;return t.target;};coolPopup.prototype.close=function(){var t=this;t.target=null;if(t.container)
55t.container.css('display','none');if(t.hideTimer)
56clearTimeout(t.hideTimer);if(t.param.onClose)
57t.param.onClose();if(t.container)
58t.container.off(t.nomouse);};coolPopup.prototype.isOwn=function(el){while(el){el=el.parentNode;if(el==this.container)
59return true;};return false;}
60coolPopup.prototype.bubble=function(pos,text){var t=this,scroll=getScrollXY(),$=jQuery,left=pos.left+33-scroll.x,top=pos.top-12-scroll.y;hide_title();t.content=$('.'+t.param.content,t.container);t.container.on(t.nomouse);
60if(text){t.content.html(text);coolTooltips();}
61t.container.css('display','block');var boxWidth=t.content.width();var boxHeight=t.content.height();var sz={width:screenWidth(),height:screenHeight()};if(left+boxWidth>sz.width-24)
62left=sz.width-boxWidth-24;if(left<6)
63left=6;if(top+boxHeight>sz.height-24)
64top=sz.height-boxHeight-24;if(top<6)
65top=6;left+=scroll.x;top+=scroll.y;t.container.css({left:left+'px',top:top+'px'});}
66var hide_title;function coolTooltips(){"use strict";if(is_touch_device())return;var s_x=15,s_y=8,show_time=5000,to=0,tipShown=false,$=jq,tt=$('span#tooltip');if(tt.length)
67hide_title();else
68tt=$('<span id=tooltip></span>').appendTo('body').hide();var showTip=function(tip,x,y){var scroll=getScrollXY(),left=x-scroll.x,top=y-scroll.y,boxWidth=tip.width(),boxHeight=tip.height(),sz={width:screenWidth(),height:screenHeight()};if(left+boxWidth>sz.width-6)left=sz.width-boxWidth-6;if(left<6)left=6;if(top+boxHeight>sz.height-6)top=sz.height-boxHeight-6;if(top<6)top=6;left+=scroll.x;top+=scroll.y;tip.css({left:left+'px',top:top+'px'});};hide_title=function(){tipShown=false;if(to){clearTimeout(to);to=0;}
69tt.hide();};$('[title]').each(function(i,e){if(this.tagName=='DIV'||this.tagName=='OPTION')
70return;var t=$(this).attr('title')||'',show=function(evt,el){var t=$('#tooltip');if(t.is(':visible'))return;tipShown=true;var tip=t.html($(el).get(0)._title).fadeIn('slow');showTip(tip,evt.pageX+s_x,evt.pageY+s_y);if(show_time)to=setTimeout(function(){hide_title();},show_time);};if(!t)
71return;if(t=='undefined'){$(this).removeAttr('title');return;}
72e._title=$.trim(t).replace(/\\n/gim,'<br>').replace(/\n/gim,'<br>');$(this).removeAttr('title').mousemove(function(evt){showTip($('#tooltip'),evt.pageX+s_x,evt.pageY+s_y);}).mouseenter(function(evt){show(evt,this);}).mouseleave(function(){hide_title();});});}
73function coolTooltipsChangeTitle(el,title){el._title=title.replace(/\\n/gim,'<br>').replace(/\n/gim,'<br>');}
74/* CD_AB_JS */ 
75var cd_ab_closePopup;jQuery(document).ready(function($){var p=new coolPopup({hideDelay:200,showDelay:300,container:'popupContainer',content:'popupContent',});var cont=$('body');if(cont.hasClass('touch')){cont.on('click','.avatar',function(e){try{if(!$(this).attr('rel').length)return;}catch(e){return;}
76p.show(this,e,'cd_ab_the_avatardata');});cont.on('click','.ajax-popup',function(e){try{if(!($(this).attr('rel').length||$(this).attr('alt').length))return;}catch(e){return;}
77p.show(this,e,'cd_ab_popup');});}else{cont.on('mouseover','.avatar',function(e){try{if(!$(this).attr('rel').length)return;}catch(e){return;}
78p.show(this,e,'cd_ab_the_avatardata');});cont.on('mouseover','.ajax-popup',function(e){try{if(!($(this).attr('rel').length||$(this).attr('alt').length))return;}catch(e){return;}
79p.show(this,e,'cd_ab_popup');});}
80cont.on('mouseout','.avatar',function(){p.leave();});cont.on('mouseout','.ajax-popup',function(){p.leave();});cont.on('click','.ajax-clickpopup',function(e){try{if(!($(this).attr('rel').length||$(this).attr('alt').length))return;}catch(e){return;}
81p.show(this,e,'cd_ab_popup',1);});cont.on('mouseout','.ajax-clickpopup',function(){if($(this).hasClass('no-autoclose'))
82return;p.leave();});});
83/* bp-like */ 
84jQuery(document).ready(function($){$('.author-box').each(function(){var id=$(this).attr('id'),box=$(id+' .like-box');$(this).append(box);});$('#content').on('click','.like, .unlike, .like_blogpost, .unlike_blogpost, .like_picture, .unlike_picture',function(){var type=$(this).attr('class'),id=$(this).attr('id');$(this).addClass('loading');$.post(ajaxurl,{action:'activity_like','cookie':encodeURIComponent(document.cookie),'type':type,'id':id},function(data){$('#'+id).fadeOut(100,function(){$(this).html(data).removeClass('loading').fadeIn(100);});var newTitle;if(type.indexOf('like_blogpost')!=-1){var newID=id.replace("like","unlike");$('#'+id).removeClass('like_blogpost').addClass('unlike_blogpost').attr('title',newTitle=bp_like_terms_unlike_message).attr('id',newID);}else if(type.indexOf('unlike_blogpost')!=-1){var newID=id.replace("unlike","like");$('#'+id).removeClass('unlike_blogpost').addClass('like_blogpost').attr('title',newTitle=bp_like_terms_like_message).attr('id',newID);}else if(type.indexOf('like_picture')!=-1){var newID=id.replace("like","unlike");$('#'+id).removeClass('like_picture').addClass('unlike_picture').attr('title',newTitle=bp_like_terms_unlike_message).attr('id',newID);}else if(type.indexOf('unlike_picture')!=-1){var newID=id.replace("unlike","like");$('#'+id).removeClass('unlike_picture').addClass('like_picture').attr('title',newTitle=bp_like_terms_like_message).attr('id',newID);}else if(type.indexOf('like')!=-1){var newID=id.replace("like","unlike");$('#'+id).removeClass('like').addClass('unlike').attr('title',newTitle=bp_like_terms_unlike_message).attr('id',newID);}else{var newID=id.replace("unlike","like");$('#'+id).removeClass('unlike').addClass('like').attr('title',newTitle=bp_like_terms_like_message).attr('id',newID);}
85coolTooltipsChangeTitle($('#'+newID),newTitle);if(data==bp_like_terms_like){var pureID=id.replace("unlike-activity-","");$('.view-likes#view-likes-'+pureID).remove();$('.users-who-like#users-who-like-'+pureID).remove();}
86if(data==bp_like_terms_unlike_1){var pureID=id.replace("like-activity-","");$('li#activity-'+pureID+' .activity-meta').append('<a href="" class="view-likes" id="view-likes-'+pureID+'">'+bp_like_terms_view_likes+'</a><p class="users-who-like" id="users-who-like-'+pureID+'"></p>');}
87coolTooltips();});return false;});$('#content').on('click','.view-likes',function(){var type=$(this).attr('class'),id=$(this).attr('id'),parentID=id.replace("view-likes","users-who-like");if(!$(this).hasClass('open')){$(this).addClass('loading');$.post(ajaxurl,{action:'activity_like','cookie':encodeURIComponent(document.cookie),'type':type,'id':id},function(data){$('#'+id).html(bp_like_terms_hide_likes).removeClass('loading').addClass('open');$('#'+parentID).html(data).slideDown('fast',coolTooltips);});return false;}else{$(this).html(bp_like_terms_view_likes).removeClass('loading, open');$('#'+parentID).slideUp('fast');return false;};});});
88/* blogs_widget_blogs_list-js */ 
89jQuery(document).ready(function($){$('#container').on('click',".widget div#blogs-list-options a",function(){var t=this;$(t).addClass('loading').addClass('selected');$(".widget div#blogs-list-options a").removeClass("selected");$.post(ajaxurl,{action:'widget_blogs_list','cookie':encodeURIComponent(document.cookie),'_wpnonce':$("input#_wpnonce-blogs").val(),'max_groups':$("input#blogs_widget_max").val(),'filter':$(t).attr('id')},function(response){$(t).removeClass('loading');var el=$(".widget ul#blog-post-list");response=response.substr(0,response.length-1);response=response.split('[[SPLIT]]');if(response[0]!="-1"){el.fadeOut(200,function(){el.html(response[1]);el.fadeIn(200,coolTooltips);});}else{el.fadeOut(200,function(){var message='<p>'+response[1]+'</p>';el.html(message);el.fadeIn(200,coolTooltips);});}});return false;});});
90/* groups_widget_groups_list-js */ 
91jQuery(document).ready(function($){$('#container').on('click',".widget div#groups-list-options a",function(){var link=this;$(link).addClass('loading');$(".widget div#groups-list-options a").removeClass("selected");$(this).addClass('selected');$.post(ajaxurl,{action:'widget_groups_list','cookie':encodeURIComponent(document.cookie),'_wpnonce':$("input#_wpnonce-groups").val(),'max_groups':$("input#groups_widget_max").val(),'filter':$(this).attr('id')},function(response)
92{$(link).removeClass('loading');var el=$(".widget ul#groups-list");response=response.substr(0,response.length-1);response=response.split('[[SPLIT]]');if(response[0]!="-1"){el.fadeOut(200,function(){el.html(response[1]);el.fadeIn(200,coolTooltips);});}else{el.fadeOut(200,function(){var message='<p>'+response[1]+'</p>';el.html(message);el.fadeIn(200,coolTooltips);});}});return false;});});
93/* events_widget_events_list-js */ 
94jQuery(document).ready(function($){$('#container').on('click',".widget div#events-list-options a",function(){$('#ajax-loader-events').toggle();$(".widget div#events-list-options a").removeClass("selected");$(this).addClass('selected');$.post(ajaxurl,{action:'widget_events_list','cookie':encodeURIComponent(document.cookie),'_wpnonce':$("input#_wpnonce-events").val(),'max_events':$("input#events_widget_max").val(),'filter':$(this).attr('id')},function(response){$('#ajax-loader-events').toggle();var el=$(".widget ul#events-list");response=response.substr(0,response.length-1);response=response.split('0[[SPLIT]]');if(response[0]!="-1"){el.fadeOut(200,function(){el.html(response[1]);el.fadeIn(200,coolTooltips);});}else{el.fadeOut(200,function(){var message='<p>'+response[1]+'</p>';el.html(message);el.fadeIn(200,coolTooltips);});}});return false;});});
95/* places_widget_places_list-js */ 
96jQuery(document).ready(function($){$('#container').on('click',".widget div#places-list-options a",function(){$('#ajax-loader-places').toggle();$(".widget div#places-list-options a").removeClass("selected");$(this).addClass('selected');$.post(ajaxurl,{action:'widget_places_list','cookie':encodeURIComponent(document.cookie),'_wpnonce':$("input#_wpnonce-places").val(),'max_places':$("input#places_widget_max").val(),'filter':$(this).attr('id')},function(response){$('#ajax-loader-places').toggle();var el=$(".widget ul#places-list");response=response.substr(0,response.length-1);response=response.split('0[[SPLIT]]');if(response[0]!="-1"){el.fadeOut(200,function(){el.html(response[1]);el.fadeIn(200,coolTooltips);});}else{el.fadeOut(200,function(){var message='<p>'+response[1]+'</p>';el.html(message);el.fadeIn(200,coolTooltips);});}});return false;});});
97/* collapseomatic-js */ 
98var duration='fast',slideEffect='slideFade';jQuery(document).ready(function($){$('.force_content_collapse').each(function(index){$(this).css('display','none');});$('.collapseomatic:not(.colomat-close)').each(function(index){var thisid=$(this).attr('id');$('#target-'+thisid).css('display','none');});$('.collapseomatic.colomat-close').each(function(index){var thisid=$(this).attr('id');if($("#swap-"+thisid).length>0){swapTitle(this,thisid);}});$('.find-me').each(function(index){var thisid=$(this).attr('id');if(!$('#find-'+thisid).attr('name')){var target_offset=$(this).offset(),target_top_offset=target_offset.top;$('#find-'+thisid).attr('name',target_top_offset);}});$('.content_collapse_wrapper').each(function(index){$(this).css('display','inline');});$('.collapseomatic').hover(function(){$(this).addClass("colomat-hover");},function(){$(this).removeClass("colomat-hover");});$('.collapseomatic').click(function(){var offest_top;if($(this).hasClass('colomat-expand-only')&&$(this).hasClass('colomat-close')){return;}
99var id=$(this).attr('id');if($(this).hasClass('colomat-close')&&$(this).hasClass('scroll-to-trigger')){var offset_top=$('#scrollonclose-'+id).attr('name');}
100if(id.indexOf('bot-')!='-1'){id=id.substr(4);$('#'+id).toggleClass('colomat-close');if($(this).hasClass('scroll-to-trigger')){var offset_top=$('#scrollonclose-'+id).attr('name');}}
101else{$(this).toggleClass('colomat-close');}
102if($("#swap-"+id).length>0){swapTitle(this,id);}
103$(this).addClass('colomat-visited');
103if(slideEffect=='slideToggle'){$('#target-'+id).slideToggle(durration,function(){});}
104else if(slideEffect=='slideFade'){$('#target-'+id).removeClass('maptastic');$('#target-'+id).animate({height:"toggle",opacity:"toggle"},duration);}
105if($(this).attr('rel')!==undefined){var rel=$(this).attr('rel');if(rel.indexOf('-highlander')!='-1'){closeOtherMembers(rel,id);}
106else{closeOtherGroups(rel);}}
107if(offset_top){$('html, body').animate({scrollTop:offset_top},500);}});function swapTitle(obj,id){var orightml=$(obj).html();var swaphtml=$("#swap-"+id).html();$(obj).html(swaphtml);$("#swap-"+id).html(orightml);if(swaphtml.indexOf("<cufon")!=-1){var trigelem=$(this).get(0).tagName;Cufon.replace(trigelem);}}
108function closeOtherGroups(rel){$('.collapseomatic[rel!="'+rel+'"]').each(function(index){if($(this).hasClass('colomat-close')&&$(this).attr('rel')!==undefined){$(this).removeClass('colomat-close');var id=$(this).attr('id');if($("#swap-"+id).length>0){swapTitle(this,id);}
109if(slideEffect=='slideToggle'){$('#target-'+id).slideToggle(durration,function(){});}
110else if(slideEffect=='slideFade'){$('#target-'+id).animate({height:"toggle",opacity:"toggle"},duration);}
111var ancestors=$('.collapseomatic','#target-'+id);ancestors.each(function(index){$(this).removeClass('colomat-close');var thisid=$(this).attr('id');$('#target-'+thisid).css('display','none');})}});}
112function closeOtherMembers(rel,id){$('.collapseomatic[rel="'+rel+'"]').each(function(index){if($(this).attr('id')!=id&&$(this).hasClass('colomat-close')&&$(this).attr('rel')!==undefined){$(this).removeClass('colomat-close');var thisid=$(this).attr('id');if($("#swap-"+thisid).length>0){swapTitle(this,thisid);}
113if(slideEffect=='slideToggle'){$('#target-'+thisid).slideToggle(durration,function(){});}
114else if(slideEffect=='slideFade'){$('#target-'+thisid).animate({height:"toggle",opacity:"toggle"},duration);}
115var ancestors=$('.collapseomatic','#target-'+id);ancestors.each(function(index){if($(this).attr('id').indexOf('bot-')=='-1'){$(this).removeClass('colomat-close');var thisid=$(this).attr('id');if($("#swap-"+thisid).length>0){swapTitle(this,thisid);}
116$('#target-'+thisid).css('display','none');}})}});}
117$('.expandall').click(function(){if($(this).attr('rel')!==undefined){var rel=$(this).attr('rel');$('.collapseomatic[rel="'+rel+'"].collapseomatic:not(.colomat-close)').each(function(index){$(this).addClass('colomat-close');var thisid=$(this).attr('id');if($("#swap-"+thisid).length>0){swapTitle(this,thisid);}
118if(slideEffect=='slideToggle'){$('#target-'+thisid).slideToggle(durration,function(){});}
119else if(slideEffect=='slideFade'){$('#target-'+thisid).animate({height:"toggle",opacity:"toggle"},duration);}});}
120else{$('.collapseomatic:not(.colomat-close)').each(function(index){$(this).addClass('colomat-close');var thisid=$(this).attr('id');if($("#swap-"+thisid).length>0){swapTitle(this,thisid);}
121if(slideEffect=='slideToggle'){$('#target-'+thisid).slideToggle(durration,function(){});}
122else if(slideEffect=='slideFade'){$('#target-'+thisid).animate({height:"toggle",opacity:"toggle"},duration);}});}});$('.collapseall').click(function(){if($(this).attr('rel')!==undefined){var rel=$(this).attr('rel');$('.collapseomatic[rel="'+rel+'"].collapseomatic.colomat-close').each(function(index){$(this).removeClass('colomat-close');var thisid=$(this).attr('id');if($("#swap-"+thisid).length>0){swapTitle(this,thisid);}
123if(slideEffect=='slideToggle'){$('#target-'+thisid).slideToggle(durration,function(){});}
124else if(slideEffect=='slideFade'){$('#target-'+thisid).animate({height:"toggle",opacity:"toggle"},duration);}});}
125else{$('.collapseomatic.colomat-close').each(function(index){$(this).removeClass('colomat-close');var thisid=$(this).attr('id');if($("#swap-"+thisid).length>0){swapTitle(this,thisid);}
126if(slideEffect=='slideToggle'){$('#target-'+thisid).slideToggle(durration,function(){});}
127else if(slideEffect=='slideFade'){$('#target-'+thisid).animate({height:"toggle",opacity:"toggle"},duration);}});}});$('.find-me').click(function(){var thisid=$(this).attr('id'),offset_top=$('#find-'+thisid).attr('name');$('html, body').animate({scrollTop:offset_top},500);});var myFile=document.location?document.location.toString():'';if(myFile.match('#')){var anchor_arr=myFile.split('#');if(anchor_arr.length>1){junk=anchor_arr.splice(0,1);anchor=anchor_arr.join('#');}
128else{anchor=anchor_arr[0];}
129anchor=anchor.split('/')[0];try{$('#'+anchor).click().parents('.collapseomatic_content').each(function(index){parent_arr=$(this).attr('id').split('-');junk=parent_arr.splice(0,1);parent=parent_arr.join('-');$('#'+parent).click();});}catch(e){}}
130$('a.expandanchor').click(function(){event.preventDefault();var fullurl=$(this).attr('href');if(fullurl.match('#')){var anchor_arr=fullurl.split('#');if(anchor_arr.length>1){junk=anchor_arr.splice(0,1);anchor=anchor_arr.join('#');}
131else{anchor=anchor_arr[0];}
132if(!$('#'+anchor).hasClass('colomat-close')){$('#'+anchor).click();}
133$('#'+anchor).parents('.collapseomatic_content').each(function(index){parent_arr=$(this).attr('id').split('-');junk=parent_arr.splice(0,1);parent=parent_arr.join('-');if(!$('#'+parent).hasClass('colomat-close')){$('#'+parent).click();}})}});});
134/* tabb-widget-init */ 
135jQuery(document).ready(function($){'use strict';var $was_open;try{$was_open=$.cookie('tabbed-widget-open');}catch(e){}
136$('.tabbed-widget').each(function(){var $this_widget=this,$widgetid=$(this).attr("id");
136$widgetid=$widgetid.split("-",3)[2];var opt=$rotateoptions[$widgetid],$widgetstyle=opt.style,$do_rotate=opt.rotate,$rotate_interval=opt.interval,$random_start=opt.random_start,$start_tab=opt.start_tab;if($was_open){if($was_open.split('-')[0]==$widgetid){$start_tab=parseInt($was_open.split('-')[1]);var $open_previous=true;}}else if($random_start&&!$open_previous){$start_tab=Math.floor($tab_count*Math.random());}
137if($widgetstyle=='tabs'){var $tab_count=0;var $tabbed_nav='<ul class="tw-tabbed-nav">';$('.tw-title',this).each(function(i){var cont=$(this).parent();if(cont.hasClass('tw-ajax')){var url=ajaxurl,inner=$('.tw-ajax-data',cont).html(),num=$('.tw-ajax-number',cont).html();$tabbed_nav+='<li id="tab-link-'+$widgetid+'-'+i+'">'+'<a href="'+url+'?action=tw_get_tab&id='+$widgetid+'&tid='+num+'&widget='+inner+'">'+$(this).text()+'</a>'+'</li>';cont.remove();}else{$tabbed_nav+='<li id="tab-link-'+$widgetid+'-'+i+'">'+'<a href="#tw-content-'+$widgetid+'-'+i+'">'+$(this).text()+'</a>'+'</li>';}
138$tab_count++;}).hide();$tabbed_nav+='</ul>';$('.tw-tabs',this).prepend($tabbed_nav);var $options={ajaxOptions:{},cookie:{expires:30,name:'tw-tab-'+$widgetid},cache:true,spinner:false,load:function(e,ui){c_log('tab loaded!');$(ui.tab).find('a').attr('href','#'+$(ui.panel).attr('id'));$(ui.panel).addClass('tw-after-ajax');coolTooltips();},idPrefix:'tw-content-'+$widgetid+'-',panelTemplate:'<div class="tw-content"></div>',};jQuery.extend($options,{active:$start_tab});var tt=$('.tw-tabs',this);if($do_rotate){tt.tabs($options).tabs('rotate',$rotate_interval);tt.hover(function(){$(this).tabs('rotate',null);},function(){$(this).tabs($options).tabs('rotate',$rotate_interval);});}else
139tt.tabs($options);}else if($widgetstyle=='accordion'){var $tab_count=0,$acco=$('.tw-accordion',this);$('.tw-title',this).each(function(i){$(this).html('<a href="#">'+$(this).text()+'</a>');$tab_count++;});var $options={autoHeight:false,header:'.tw-title'};jQuery.extend($options,{active:$start_tab});$acco.accordion($options);$('.tw-content:first',this).addClass('tw-widget-first');$('.tw-content:last',this).addClass('tw-widget-last');if($do_rotate){var $cleared=false,$wasstopped=false;(function(){var t=0,$step=0,$saverotation;function dorotate(){t=++t;if(t==$tab_count){$step=-2;t=t+$step;}
140else if(t==1){t=t;$step=0;}
141else{t=t+$step;}
142$acco.accordion('activate',t);}
143if(!$cleared)
144var rotation=setInterval(function(){dorotate();},$rotate_interval);$acco.bind("mouseenter",function(){clearInterval(rotation);rotation=null;$cleared=true;}).bind("mouseleave",function(){if(!$wasstopped)rotation=setInterval(function(){dorotate();},$rotate_interval);}).bind("click",function(){$wasstopped=true;clearInterval(rotation);rotation=null;});})();}}});$('.ui-accordion-content').click(function(){var $id=$(this).parent().attr('id').replace('tw-content-','');try{c_log($id);}catch(e){}
145if($id.length>0)
146$.cookie('tabbed-widget-open',$id,{path:'/',expires:2,});});});
147/* my-map */ 
148function CloseControl(G,controlDiv,caption,cb){controlDiv.style.padding="5px";var controlUI=document.createElement("DIV"),cs=controlUI.style;cs.background='url("/wp-t/_inc/images/icons.gif") no-repeat scroll 20px 20px transparent';cs.backgroundPosition='-460px -20px';cs.marginTop='-7px';cs.marginRight='-6px';cs.display='block';cs.height='20px';cs.width='20px';cs.borderStyle="solid";cs.borderWidth="0px";cs.cursor="pointer";cs.textAlign="center";controlUI.title=caption||"close";controlDiv.appendChild(controlUI);var controlText=document.createElement("DIV"),ts=controlText.style;ts.fontFamily="Arial,sans-serif";ts.fontSize="12px";ts.paddingLeft="0px";ts.paddingRight="0px";controlText.innerHTML='<span class="map-close" >&nbsp;</span>';controlUI.appendChild(controlText);G.event.addDomListener(controlUI,"click",function(){if(typeof(cb)=='function')
149cb();else{try{eval(cb+'();');}catch(e){c_log('eval error: '+e.description+' cause: '+cb);}}});}
150function MaxControl(G,controlDiv,map,el,title,caption,cb){controlDiv.style.padding="5px";var controlUI=document.createElement("DIV"),cs=controlUI.style;controlUI.id='map-full';
150cs.background='url("/wp-t/_inc/images/icons.gif") no-repeat scroll 20px 20px transparent';cs.backgroundPosition='-100px -20px';cs.marginTop='-8px';cs.marginRight='-9px';cs.display='block';cs.height='20px';cs.width='20px';cs.borderStyle="solid";cs.borderWidth="0px";cs.cursor="pointer";cs.textAlign="center";controlUI.title=caption||"fullscreen";controlDiv.appendChild(controlUI);var controlText=document.createElement("DIV"),ts=controlText.style;ts.fontFamily="Arial,sans-serif";ts.fontSize="12px";ts.paddingLeft="0px";ts.paddingRight="0px";controlText.innerHTML='<span class="map-fullscreen" >&nbsp;</span>';controlUI.appendChild(controlText);G.event.addDomListener(controlUI,"click",function(v){var center=map.getCenter();tb_show(title||"map",'#TB_inline?inlineId='+el.id+'&modal=false',false,function(id,state){controlDiv.style.display='block';el.className=el.className.replace('fullscreen-map','');center=G.getCenter(map);setTimeout(function(){G.event.trigger(map,'resize');if(center)
151G.event.addListenerOnce(map,'idle',function(){map.setCenter(center);});},200);if(cb)cb(state);});el.className+=' fullscreen-map';controlDiv.style.display='none';setTimeout(function(){G.event.trigger(map,'resize');if(center)
152G.event.addListenerOnce(map,'idle',function(){map.setCenter(center);});},200);});}
153function ResizeControl(G,controlDiv,map,elem,callback,caption){var t=this,cs=controlDiv.style,es=window.getComputedStyle(elem,'');cs.padding="0px";cs.marginBottom="-22px";cs.marginRight="-1px";cs.cursor="pointer";controlDiv.id='my_resize';controlDiv.zIndex='1000';if(caption)controlDiv.title=caption;t._map=map;t._elem=elem;t._callback=callback;t.resizable=false;t.mode=0;t.eWidth=elem.offsetWidth||es.width;t.eHeight=elem.offsetHeight||es.height;t.minWidth=Math.min(32,t.eWidth);t.minHeight=Math.min(32,t.eHeight);t.maxWidth=0;t.maxHeight=0;t.diffX=0;t.diffY=0;t.mouseX=0;t.mouseY=0;t.eWidth=0;t.eHeight=0;var controlUI=document.createElement("DIV");cs=controlUI.style;cs.width="20px";cs.height="20px";cs.cursor="pointer";cs.backgroundImage="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUBAMAAAB/pwA+AAAAAXNSR0IArs4c6QAAAA9QTFRFMBg0f39/0dDN7eri/v7+XsdLVAAAAAF0Uk5TAEDm2GYAAABNSURBVAjXRcpBDcAwDEPRKAymImghuCUw/qTWJI7nk/X0zXquZ+tH6E5df3TngPBA+ELY7UW2gWwDq02sNjHbwmwLoyVGS7ytbw62tA8zTA85AeAv2wAAAABJRU5ErkJggg%3D%3D)";controlDiv.appendChild(controlUI);G.event.addDomListener(controlUI,'mousedown',function(){t.eWidth=t._elem.offsetWidth||window.getComputedStyle(t._elem,'').width;t.eHeight=t._elem.offsetHeight||window.getComputedStyle(t._elem,'').height;t.resizable=true;});G.event.addDomListener(controlUI,'dragstart',function(){return false;});G.event.addDomListener(controlUI.parentNode,'dragstart',function(){return false;});G.event.addDomListener(document,'mouseup',function(){t.resizable=false;return true;});G.event.addDomListener(controlUI,'mouseup',function(){t.resizable=false;return true;});G.event.addDomListener(document,'mousemove',function(e){t.onmouseover(e);return true;});G.event.addDomListener(controlUI,'mousemove',function(e){t.onmouseover(e);return true;});var t1=elem.firstElementChild;if(elem)
154var tmp_listener2=G.event.addDomListener(elem,'mousemove',function(){if(G.Engine.id!='google')
155return;G.event.addDomListener(controlUI.parentNode.parentNode,'dragstart',function(){return false;});try{var pattern=(gmap&&gmap.pattern)||"                                         ",el=jQuery('a:contains("'+pattern+'")').parent().parent();ee=jQuery(controlDiv).siblings('.gm-style-cc');if(el.length){el.css('marginRight',"20px");G.event.removeListener(tmp_listener2);}
156if(ee.length)
157ee.css('marginRight',"20px");}catch(e){c_log('error hooking cc='.e.description);}});}
158ResizeControl.RESIZE_BOTH=0;ResizeControl.RESIZE_WIDTH=1;ResizeControl.RESIZE_HEIGHT=2;ResizeControl.prototype.onmouseover=function(e){var sx=window.scrollX||document.documentElement.scrollLeft||0,sy=window.scrollY||document.documentElement.scrollTop||0,t=this;if(!e)e=window.event;t.mouseX=e.clientX+sx;t.mouseY=e.clientY+sy;var deltaX=t.mouseX-t.diffX,deltaY=t.mouseY-t.diffY;t.diffX=t.mouseX;t.diffY=t.mouseY;if(t.resizable){t.changeMapSize(deltaX,deltaY);}
159return false;}
160ResizeControl.prototype.changeMapSize=function(dx,dy){var t=this,container=t._elem,width=t.eWidth+dx,height=t.eHeight+dy;if(t.minWidth){width=Math.max(t.minWidth,width);}
161if(t.maxWidth){width=Math.min(t.maxWidth,width);}
162if(t.minHeight){height=Math.max(t.minHeight,height);}
163if(t.maxHeight){height=Math.min(t.maxHeight,height);}
164if(t._elem){if(t.mode!=ResizeControl.RESIZE_HEIGHT){t._elem.style.width=width+"px";t.eWidth=width;}
165if(t.mode!=ResizeControl.RESIZE_WIDTH){t._elem.style.height=height+"px";t.eHeight=height;}}
166if(t._callback)t._callback();};function yResizeControl(G,controlDiv,map,elem,callback,caption){var $=jQuery,cs=controlDiv.style;cs.padding="0px";cs.marginBottom="-2px";cs.marginRight="-1px";cs.cursor="pointer";cs.position='absolute';cs.bottom='0px';cs.right='0px';controlDiv.id='y_my_resize';controlDiv.zIndex='1000';if(caption)controlDiv.title=caption;var t=this;t._map=map;t._elem=elem;t._callback=callback;t.resizable=false;t.mode=0;t.eWidth=elem.offsetWidth||window.getComputedStyle(elem,'').width;t.eHeight=elem.offsetHeight||window.getComputedStyle(elem,'').height;t.minWidth=Math.min(32,t.eWidth);t.minHeight=Math.min(32,t.eHeight);t.maxWidth=0;t.maxHeight=0;t.diffX=0;t.diffY=0;t.mouseX=0;t.mouseY=0;t.eWidth=0;t.eHeight=0;var controlUI=document.createElement("DIV");cs=controlUI.style;cs.width="20px";cs.height="20px";cs.cursor="pointer";cs.backgroundImage="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUBAMAAAB/pwA+AAAAAXNSR0IArs4c6QAAAA9QTFRFMBg0f39/0dDN7eri/v7+XsdLVAAAAAF0Uk5TAEDm2GYAAABNSURBVAjXRcpBDcAwDEPRKAymImghuCUw/qTWJI7nk/X0zXquZ+tH6E5df3TngPBA+ELY7UW2gWwDq02sNjHbwmwLoyVGS7ytbw62tA8zTA85AeAv2wAAAABJRU5ErkJggg%3D%3D)";controlDiv.appendChild(controlUI);$(controlUI).mousedown(function(){var s=window.getComputedStyle(t._elem,'');t.eWidth=t._elem.offsetWidth||s.width;t.eHeight=t._elem.offsetHeight||s.height;t.resizable=true;});$(controlUI).bind('dragstart',function(){return false;});$(controlUI.parentNode).bind('dragstart',function(){return false;});$(document).mouseup(function(){t.resizable=false;return true;});$(controlUI).mouseup(function(){t.resizable=false;return true;});$(document).mousemove(function(e){t.onmouseover(e);return true;});$(controlUI).mousemove(function(e){t.onmouseover(e);return true;});}
167yResizeControl.RESIZE_BOTH=0;yResizeControl.RESIZE_WIDTH=1;yResizeControl.RESIZE_HEIGHT=2;yResizeControl.prototype.onmouseover=function(e){var t=this,sx=window.scrollX||document.documentElement.scrollLeft||0,sy=window.scrollY||document.documentElement.scrollTop||0;if(!e)e=window.event;t.mouseX=e.clientX+sx;t.mouseY=e.clientY+sy;var deltaX=t.mouseX-t.diffX,deltaY=t.mouseY-t.diffY;t.diffX=t.mouseX;t.diffY=t.mouseY;if(t.resizable){t.changeMapSize(deltaX,deltaY);}
168return false;}
169yResizeControl.prototype.changeMapSize=function(dx,dy){var t=this,container=t._elem,width=t.eWidth+dx,height=t.eHeight+dy;if(t.minWidth){width=Math.max(t.minWidth,width);}
170if(t.maxWidth){width=Math.min(t.maxWidth,width);}
171if(t.minHeight){height=Math.max(t.minHeight,height);}
172if(t.maxHeight){height=Math.min(t.maxHeight,height);}
173if(t._elem){if(t.mode!=ResizeControl.RESIZE_HEIGHT){t._elem.style.width=width+"px";t.eWidth=width;}
174if(t.mode!=ResizeControl.RESIZE_WIDTH){t._elem.style.height=height+"px";t.eHeight=height;}}
175if(t._callback)t._callback();};function ModeControl(G,controlDiv,controlPad,caption,title,cb){controlDiv.style.padding="5px";var cs=controlPad.style;cs.background='#f4f4f4';cs.border='1px solid #999';cs.overflow="hidden";cs.boxShadow="0 2px 4px rgba(0, 0, 0, 0.4)";cs.borderRadius="4px";controlDiv.appendChild(controlPad);var controlUI=document.createElement("DIV");cs=controlUI.style;cs.display='block';cs.cssFloat='right';cs.padding='3px 6px 0 6px';cs.borderStyle="solid";cs.borderWidth="0px";cs.cursor="pointer";cs.textAlign="center";controlUI.title=title||"Select map objects";controlUI.innerHTML=(caption||"Show")+'<img src="http://maps.gstatic.
175com/mapfiles/arrow-down.png" draggable="false" style="-moz-user-select: none; border: 0px none; padding: 0px; margin: 6px 0 0 6px; float:right; width:7px; height:4px;">';controlPad.appendChild(controlUI);G.event.addDomListener(controlUI,"click",function(e){cb(e);});return controlPad;}
176function LinkControl(G,controlDiv,caption,cb){controlDiv.style.margin="5px";var controlUI=document.createElement("DIV"),CS=controlUI.style;CS.background='url("/wp-t/_inc/images/icons.gif") no-repeat scroll 20px 20px #fff';CS.backgroundPosition='-500px 0';CS.display='block';CS.height='20px';CS.width='20px';CS.border='1px solid #999';CS.overflow="hidden";CS.boxShadow="0 2px 4px rgba(0, 0, 0, 0.4)";CS.borderRadius="4px";CS.borderStyle="solid";CS.borderWidth="0px";CS.cursor="pointer";CS.textAlign="center";controlUI.title=caption||"link";CS.cssFloat='right';controlDiv.appendChild(controlUI);var controlText=document.createElement("DIV"),ts=controlText.style;ts.fontFamily="Arial,sans-serif";ts.fontSize="12px";ts.paddingLeft="0px";ts.paddingRight="0px";controlText.innerHTML='<span class="map-link" >&nbsp;</span>';controlUI.appendChild(controlText);G.event.addDomListener(controlUI,"click",function(){cb();});}
177function LineControl(G,controlDiv,caption,cb){controlDiv.style.margin="5px";var controlUI=document.createElement("DIV"),CS=controlUI.style;CS.background='url("/wp-t/_inc/images/icons.gif") no-repeat scroll 20px 20px #fff';CS.backgroundPosition='-500px -20px';CS.display='block';CS.height='20px';CS.width='20px';CS.border='1px solid #999';CS.overflow="hidden";CS.boxShadow="0 2px 4px rgba(0, 0, 0, 0.4)";CS.borderRadius="4px";CS.borderStyle="solid";CS.borderWidth="0px";CS.cursor="pointer";CS.textAlign="center";controlUI.title=caption||"line";CS.cssFloat='right';controlDiv.appendChild(controlUI);var controlText=document.createElement("DIV"),ts=controlText.style;ts.fontFamily="Arial,sans-serif";ts.fontSize="12px";ts.paddingLeft="0px";ts.paddingRight="0px";controlText.innerHTML='<span class="map-line" >&nbsp;</span>';controlUI.appendChild(controlText);G.event.addDomListener(controlUI,"click",function(){cb();});}
178/* cool-map */ 
179var last_track_data;var iCM;function my_cool_map($,param,provider){'use strict';var G=provider.getApi(),t;G.Engine=provider;if(!param.hideDelay)param.hideDelay=200;if(!param.showDelay)param.showDelay=300;if(!param.bounds_time)param.bounds_time=500;if(!param.ajax_url)param.ajax_url='/wp-t/map-ajax.php';var gptr,hideTimer=null,c_hideTimer=null,x,container,max_zindex,leftPane,tabs,tabsCnt=0,sp,marker,container,is_touch=$('body').hasClass('touch'),I=function(e){return document.getElementById(e);},el=I(param.element_id),p={},upd=true,ivCoordId=0,last_lat=-1,last_lon=-1,fCoordUpdate=0,drawMode=0,polyLines=[],lineNo=-1,that=this;that.data={};that.prov=provider;if(el)
180el.innerHTML='';p.getArgs=function(){var html=[],url,url1,tag,c=t.prov.getCenter(t.map).toString();html.push("prov="+encodeURIComponent(t.prov.id));html.push("z="+encodeURIComponent(t.map.getZoom()));c=c.replace('(','').replace(')','').replace(' ','');html.push("ll="+encodeURIComponent(c));html.push("maptype="+encodeURIComponent(t.map.getMapTypeId()));if(param.object)
181html.push("obj="+encodeURIComponent(param.object));if(param.kml)
182html.push("kml="+encodeURIComponent(param.kml));if(param.markers)
183html.push("markers="+encodeURIComponent(param.markers));if(param.mdata)
184html.push("mdata="+encodeURIComponent(param.mdata));if(param.line)
185html.push("line="+encodeURIComponent(param.line));if(param.shape)
186html.push("shape="+encodeURIComponent(param.shape));html.push('mh='+$('#'+param.element_id).height());var on=[];for(tag in param.ajax_map_bounds){var el=param.ajax_map_bounds[tag];if(el.on)
187on.push(tag);}
188if(on.length)
189html.push("on="+encodeURIComponent(on.join('|')));return html.join('&');};p.updateState=function(){if(param.historyUpdate&&history.replaceState){var loc=document.location.href.split('?');history.replaceState(false,window.title,loc[0]+'?'+p.getArgs());}};p.showLinkDialog=function(){var args=p.getArgs(),url=ykoctpa.url+'/map?'+args,url1='<iframe width="400" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+url+'&wm=400&hm=300&iframe=1"></iframe><br /><small><a href="'+url+'" style="color:#0000FF;text-align:left">                                              </a></small>',url2='<a href="'+url+'"><img src="http://www.ykoctpa.ru/wp-map.php?'+args+'&mode=image&wm=400&hm=300" /></a>',url3='http://www.ykoctpa.ru/wp-map.php?'+args+'&mode=image&wm=400&hm=300',url4='[map '+decodeURIComponent(args.replace(new RegExp('&','g'),' '))+' w=320 h=240]',url5=t.prov.getCenter(t.map).toString().replace('(','').replace(')','').replace(' ','');return"<div class='link-pad' >"+"<div class='close' style='width: 10px; height: 10px;
189 background: url(\"//maps.gstatic.com/mapfiles/hpimgs28.png\") no-repeat scroll -108px -26px transparent; float: right; margin: 3px 6px;'></div>"+"<div style='clear:both;'>"+"<label for='link'  style='display:block'>"+gmap.link0+"</label><input type='text' name='link' id='link' value='"+url+"' onclick='this.select()'><br>"+"<label for='link1' style='display:block'>"+gmap.link1+"</label><input type='text' name='link1' id='link1' value='"+url1+"' onclick='this.select()'>"+"<label for='link2' style='display:block'>"+gmap.link2+"</label><input type='text' name='link2' id='link2' value='"+url2+"' onclick='this.select()'>"+"<label for='link3' style='display:block'>"+gmap.link3+"</label><input type='text' name='link3' id='link3' value='"+url3+"' onclick='this.select()'>"+"<label for='link4' style='display:block'>"+gmap.link4+"</label><input type='text' name='link4' id='link4' value='"+url4+"' onclick='this.select()'>"+"<label for='link5' style='display:block'>"+gmap.link5+"</label><input type='text' name='link5' id='link5' value='"+url5+"' onclick='this.select()'>"+"</div>"+"</div>";};p.lineDrawEnable=function(v){drawMode=v;if(window.iLD){iLD.setMode(v,G,p,t);}};p.showLineDialog=function(){return"<div class='line-pad' >"+"<div class='close' style='width: 10px; height: 10px; background: url(\"//maps.gstatic.com/mapfiles/hpimgs28.png\") no-repeat scroll -108px -26px transparent; float: right; margin: 3px 6px;'></div>"+"<div class='pad' style='clear:both;'>"+"</div>"+"</div>";};var adjust_vis=function(was_req,tag,vis){var on=[],off=[],m;if(tag=='track'&&!vis)
190p.clearTracks();for(var i in t.items){m=t.items[i];if(m.nocluster)continue;if(m.orig_tag==tag){if(vis)on.push(m);else off.push(m);}}
191if(t.cluster){if(on.length&&!was_req)
192t.cluster.addMarkers(on);if(off.length)
193t.cluster.removeMarkers(off);}else{if(!was_req){for(var i in on){var m=on[i];if(m.getMap()!=t.map){m.setMap(t.map);p.show_hide_mdata(true,m);}}}
194for(var i in off){m=on[i];if(m.getMap()){m.setMap(null);p.show_hide_mdata(false,m);}}}
195p.adjustBorders(300);};p.showModeChanged=function(tag,vis){param.ajax_map_bounds[tag].on=vis;if(vis){var bounds=t.map.getBounds(),zoom=t.map.getZoom();p.query_bounds(bounds,zoom,function(was_req,tag){adjust_vis(was_req,tag,true);},true,tag);p.addFilter(tag);}else{adjust_vis(0,tag,false);p.removeFilter(tag);}
196var cnt=0;for(var tg in param.ajax_map_bounds){if(param.ajax_map_bounds[tg].on)
197cnt++;}
198if(sp){if(cnt){sp.enable();}else{sp.disable();}}
199p.updateState();};p.addOne=function(f,tag,fn,v){if(!f[tag])f[tag]={};if(!f[tag][fn])f[tag][fn]=[];var vs=v.split('_'),obj={group:1,event:1,place:1,groups:1,events:1,places:1};if(obj[vs[0]])
200v=vs.join(':');else
201v=vs[1]||vs[0];f[tag][fn].push(v);};p.getFilterVals=function(){var ids,inn=$('.lp-inner'),v,f={},ul;$('.filter-list:visible li',inn).each(function(n,t){var v=t.id.split('-');if(v[1]){ul=$(t).closest('ul').attr('id').split('-');p.addOne(f,ul[1],ul[2],v[1]);}});$('.full-list:visible li input:checkbox',inn).each(function(n,t){if($(t).hasClass('filter-inv'))return;if(t.checked){v=t.name.split('-');if(v[1]){ul=$(t).closest('ul').attr('id').split('-');p.addOne(f,ul[1],ul[2],v[1]);}}});$('input:checkbox.single',inn).each(function(n,t){if(t.checked){v=t.id.split('-');if(v[1]){p.addOne(f,v[1],v[2],v[3]);}}});return f;};p.parseAjaxResponce=function(responce,cb){var draw=false;if(!responce){if(cb)cb(-1);return;}
202var resp=responce.split('/*{//}*/'),dtag,data;responce=null;try{data=eval('('+resp[0]+')');resp[0]=null;}catch(e){c_log('eval error: '+e.description+' cause: '+resp[0]);return;}
203var lc=data.listcount;delete data.listcount;for(dtag in data){var el=data[dtag],i;if(!el)continue;if(el.points){if(el.erase){for(i in t.items){if(t.items[i].orig_tag==dtag){p.removeMarker(t.items[i],true);delete t.items[i];draw=true;}}}
204if(el.points.length){p.addMarkers(el.points,dtag,true);draw=true;}}
205if(el.list){$(param.ajax_map_bounds[dtag].list).html(resp[el.list]);}
206if(el.bounds){param.ajax_map_bounds[dtag].bounds=new G.LatLngBounds(new G.LatLng(el.boun
206ds[0],el.bounds[1]),new G.LatLng(el.bounds[2],el.bounds[3]));}
207if(el.setBounds&&el.setBounds.length){param.ajax_map_bounds[dtag].bounds=new G.LatLngBounds(new G.LatLng(el.setBounds[0],el.setBounds[1]),new G.LatLng(el.setBounds[2],el.setBounds[3]));setTimeout(function(){t.recurseBounds=true;t.map.fitBounds(param.ajax_map_bounds[dtag].bounds);},10);}
208if(el.files&&el.files.length){var k,ff=[];for(k in el.files){var id=el.files[k]+lc+1;ff.push(resp[id]);}
209el.files=ff;}
210if(el.kml){p.clearTracks();p.showTrack(el.kml);}
211if(el.tracks){p.clearTracks();if(el.tracks.length)
212p.showTracks(el.tracks,el.files);}}
213if(draw&&t.cluster){t.cluster.resetViewport();t.cluster.redraw();}
214if(cb)cb(1);};p.query_bounds=function(bounds,zoom,cb,force,only_tag){var tag,doit=false,req={},filter={};if(t.recurseBounds){t.recurseBounds=false;if(cb)
215cb(0,tag);return;}
216if(sp){filter=p.getFilterVals();}
217for(tag in param.ajax_map_bounds){if(only_tag&&only_tag!=tag)continue;var el=param.ajax_map_bounds[tag],load=true;if(el.on){if(el.list){if(el.bounds&&el.bounds.equals(bounds)){load=false;}else{req[tag]={};req[tag].list=1;}}else if(el.bounds&&el.bounds.contains(bounds.getNorthEast())&&el.bounds.contains(bounds.getSouthWest
217())){if((!el.kml||this.old_zoom==zoom&&!force)&&!only_tag){load=false;}else{req[tag]={};}}else{req[tag]={};}
218if(load){if(el.filter)
219req[tag].filter=el.filter;else if(filter[tag]){req[tag].filter=filter[tag];}
220if(el.setBounds){req[tag].setBounds=true;el.setBounds=null;}
221el.bounds=bounds;doit=true;}else if(cb)
222cb(0,tag);}}
223this.old_zoom=zoom;if(doit){var pp={action:'map_bounds_query',bounds:t.prov.formatBounds(bounds),id:param.element_id,zoom:zoom,req:JSON.stringify(req),_wpnonce:param._wpnonce,};if(t.x){t.x.abort();t.x=null;}
224if(param.object)
225pp['object']=param.object;if(param.getTZ)
226pp['tz']=-(new Date().getTimezoneOffset());t.x=$.post(param.ajax_url,pp,function(resp){p.parseAjaxResponce(resp,cb);});}};p.clearTracks=function(){if(t.tracks){for(var i in t.tracks)
227if(t.tracks[i]&&t.tracks[i].setMap)
228t.tracks[i].setMap(null);delete t.tracks;}
229t.tracks=[];};p.showTracks=function(tracks,files){for(var i in tracks){var t=tracks[i],lines=files[t.track].replace('\r','').split('\n'),pp=[];for(var k in lines){if(!lines[k])continue;var l=lines[k].split(',');pp.push({lat:l[0],lon:l[1],brk:l[2],alt:l[3],date:l[4],id:l[5],});}
230p.showTrack(pp,t);}};p.showTrack=function(points,track,col){var pp=[],options={strokeColor:col||'#ff0000',strokeWeight:'2',strokeOpacity:0.5,},cbs={},par;if(!t.trkPopup)
231if(runPrefixMethod(document,"FullScreen")||runPrefixMethod(document,"IsFullScreen"))
232par=$(t.el).parent();else
233par='body';t.trkPopup=new coolPopup({parent:par,container:'trkContainer',content:'popupContent',url:'/wp-ajax.php',getData:function(line,action){var tr=line.orig_track,tag='track',act=param.ajax_map_bounds&&param.ajax_map_bounds[tag]&&param.ajax_map_bounds[tag].action;t.param=param;last_track_data=t;return{ID:tr.id,obj:tr.obj,item:tr.item,type:tr.type,action:act||param.ajax_data_action};},});if(track){var cbs={mouseout:function(evt,l){t.trkPopup.leave();var tr=l.orig_track;if(tr)
234for(var i in tr.lines){tr.lines[i].setOptions({strokeWeight:2});}
235else
236var x=l;},};cbs[is_touch?'click':'mouseover']=function(evt,l){var tr=l.orig_track;if(tr)
237for(var i in tr.lines){tr.lines[i].setOptions({strokeWeight:7});}
238else
239var x=l;t.trkPopup.show(l,evt);};cbs[is_touch?'dblclick':'click']=function(evt,l){upd=!upd;if(drawMode==1)
240iLD.DrawPolyClick(evt);};}
241var last=-1,all_lines=[];for(var i in points){if(((points[i].brk-0)||(last!=points[i].id))&&pp.length){var pl=t.prov.drawPolyLine(t.map,options,pp,cbs);pl.orig_track=track;all_lines.push(pl);options.strokeColor='#ff00'+all_lines.length*20;t.tracks.push(pl);pp=[];}
242pp.push(new G.LatLng(points[i].lat,points[i].lon));last=points[i].id;}
243var pl=t.prov.drawPolyLine(t.map,options,pp,cbs);pl.orig_track=track;all_lines.push(pl);t.tracks.push(pl);
243if(track)
244track.lines=all_lines;};p.drawPolylines=function(line,parent,show){var polyOptions,c,path,polyLine,polyLines=[];while(c=line.shift()){if(c.match(/rgba:/i)){c=c.split(',');var th=c[1].split(':'),cl=c[0].split(':');cl=cl[1].replace('0x','');var col="#"+cl.substr(0,6);polyOptions={strokeOpacity:0.8,};polyOptions.strokeColor=col;polyOptions.strokeWeight=th[1];if(cl.length==8)
245polyOptions.strokeOpacity=parseInt(cl.substr(-2),16)/256;polyLine={options:polyOptions,points:[]};path=polyLine.points;polyLines.push(polyLine);}else{var cc=c.split(',');path.push(t.prov.Coord(cc[0],cc[1]));}}
246var pl;while(pl=polyLines.shift()){var l=t.prov.drawPolyLine(show?t.map:null,pl.options,pl.points);if(parent)parent.a.push(l);}};p.drawPolygons=function(line,parent,show){var polyOptions,c,path,polyLine,polyLines=[];while(c=line.shift()){if(c.match(/rgba:/i)){c=c.split(',');var th=c[1].split(':'),cl=c[0].split(':');cl=cl[1].replace('0x','');var col="#"+cl.substr(0,6);polyOptions={strokeOpacity:0.8,};polyOptions.strokeColor=polyOptions.fillColor=col;polyOptions.strokeWeight=th[1];if(cl.length==8){polyOptions.strokeOpacity=parseInt(cl.substr(-2),16)/256;polyOptions.fillOpacity=polyOptions.strokeOpacity/10;}
247polyLine={options:polyOptions,points:[]};path=polyLine.points;polyLines.push(polyLine);}else{var cc=c.split(',');path.push(t.prov.Coord(cc[0],cc[1]));}}
248var pl;var cbs={mouseout:function(evt,marker){if(param.in_popup)
249return;t.mPopup.leave();},};cbs[is_touch?'click':'mouseover']=function(evt,pl){if(param.in_popup)
250return;if(pl.orig_data)
251t.mPopup.show(pl,evt);};while(pl=polyLines.shift()){var l=t.prov.drawPolygon(show?t.map:null,pl.options,pl.points,cbs);if(parent){l.orig_tag=parent.tag;l.orig_data=parent.one;parent.a.push(l);}}};p.LinesMarkers=function(data,parent,show){if(data.line){p.drawPolylines(data.line.split('|'),parent,show);}
252if(data.polygon){p.drawPolygons(data.polygon.split('|'),parent,show);}
253if(data.kml){t.kmllayer=t.prov.drawKML(data.kml,{preserveViewport:param.preserveViewport},{click:function(e){upd=!upd;if(drawMode==1)
254iLD.DrawPolyClick(e);}});t.kmllayer.setMap(show?t.map:null);}
255if(data.address){t.geocoder=new G.Geocoder();t.geocoder.geocode({'address':data.address},function(results,status){if(status==G.GeocoderStatus.OK){t.map.setCenter(t.center=results[0].geometry.location);if(data.gmv3&&!data.nomarker){marker=t.prov.createMarker({map:t.map,loc:t.center,title:data.title,icon:data.markerimage,shape:data.shape,},{click:function(){t.infowindow.setContent(data.info);t.infowindow.open(t.map,marker);}});t.markers.push(marker);if(parent)parent.a.push(marker);if(data.info){if(!t.infowindow)
256t.infowindow=new G.InfoWindow({content:''});}}}else{alert((param.err_geocode||gmap.err_geocode)+status);}});}
257if(data.mdata){for(var i=0;i<data.mdata.length;i++){var one=data.mdata[i],m,loc=t.prov.Coord(one.lat,one.lon),cb={};if(data.mdata[i].info){if(!t.infowindow)
258t.infowindow=new G.InfoWindow({content:""});(function(id){cb.click=function(e,mrk){t.infowindow.setContent(data.mdata[id].info);t.infowindow.open(t.map,mrk);};})(i);}
259if(one.lat&&one.lon){m=t.prov.createMarker({map:t.map,loc:loc,title:one.title,color:one.color,label:one.label},cb);t.markers.push(m);if(parent)parent.a.push(m);if(!t.bounds)t.bounds=new G.LatLngBounds(loc,loc);else t.bounds.extend(loc);}}}
260if(data.markers){var mms=data.markers.split('|'),m,mm=[];while(m=mms.shift()){var m1=m.split(',');mm.push({lat:m1.shift(),lon:m1.shift(),color:m1.shift(),label:m1.shift(),title:decodeURIComponent(m1.join(',').replace(/&7c/,'|'))});}
261while(m=mm.shift()){var mrk=t.prov.createMarker({map:show?t.map:null,loc:t.prov.Coord(m.lat,m.lon),title:m.title,color:m.color,label:m.label});t.markers.push(mrk);if(parent)parent.a.push(mrk);}}
262if(parent){}else{if(t.markers.length){marker=t.markers[0];}else
263if(param.gmv3&&!data.nomarker){if(data.marker&&!data.address){marker=t.prov.createMarker({map:t.map,loc:t.center,title:data.title,icon:data.markerimage,shape:data.shape});t.markers.push(marker);}}}
264if(data.info&&marker&&!parent){if(!t.infowindow)
265t.infowindow=new G.InfoWindow({content:''});G.event.addListener(marker,'click',function(){t.infowindow.setContent(data.info);t.infowindow.open(t.map,marker);});}
266if(t.map&&t.bounds&&param.fit_bounds&&!parent){t.map.fitBounds(t.bounds);}};p.showMap=function(latlng){t.p=p;var to=0,id=param.element_id+t.prov.id;t.el=I(id);if(t.el){t.el.style.display='block';}else{var el=document.createElement("DIV"),pe=I(param.element_id);if(!pe)return;el.id=id;el.style.display='block';el.style.height='100%';el.style.width='100%';el.style.position='relative';pe.appendChild(el);t.el=el;}
267if(!latlng)var latlng=t.prov.clientLocation();t.map=t.prov.createMap(param.forceCenter||latlng,t.el,param.map_options);if(!param.nocluster&&t.prov.MarkerClusterer)
268t.cluster=new t.prov.MarkerClusterer(G,t.map,false,$.extend({},{maxZoom:16,gridSize:25,averageCenter:true,clusterTitle:param.cluster_title,is_touch:is_touch,},param.cluster_opts));if(t.cluster){var cbs={clusterclick:function(c,evt){evt.stopPropagation();t.clusPopup.close();},clusterhover:function(c,evt){t.prov.hideClusterTitle(c);var m=c.getMarkers(),pos,one=m[0].orig_data,tags_m={},tags=[];for(var i=0,l=m.length;i<l;i++){var tag=m[i].orig_tag||'-';if(!tags_m[tag]){tags_m[tag]=[];tags.push(tag);}
269tags_m[tag].push(m[i]);}
270var html='',url,one,tp;for(var k=0,nt=tags.length;k<nt;k++){tag=tags[k];if(param.ajax_map_bounds){tp=param.ajax_map_bounds[tag];var nr=tp.nr||4,nc=tp.nc||4,width=tp.width?' width="'+tp.width+'" height="'+tp.width+'"':'',more=tp.cluster_more||param.cluster_more;}else{tp={url:param.def_url||false,eclass:'',width:75,};var nr=4,nc=4,width='',more=param.cluster_more||false;}
271var cm=tags_m[tag].length;if(nt>1){nr=parseInt(nr/nt);html+='<div class="picture-description">'+tp.title+'</div>';}
272if(nt==1&&cm==9&&nr>=3)
273nc=3;else if(nt==1&&cm==6&&nr>=2)
274nc=3;var m_sort=tags_m[tag].sort(function(a,b){if(a.orig_data.rate>b.orig_data.rate)
275return-1;else if(a.orig_data.rate<b.orig_data.rate)
276return 1;else
277return 0;});for(var i=0,l=m_sort.length;i<l;i++){one=m_sort[i].orig_data;var img='<img src="'+one.icon+'"'+width+' title="'+one.title+'" />';if(tp.url){url=one.slug?tp.url.replace('%SLUG%',one.slug):tp.url.replace('%ID%',one.id);html+='<a id="ci-'+tag+one.id+'"  class="icon '+tp.eclass+'" href="'+url+'" title="'+one.title+'">'+img+'</a>';}else
278html+='<span id="ci-'+tag+one.id+'" class="icon '+tp.eclass+'" title="'+one.title+'">'+img+'</span>';if(!is_touch)
279(function(it,tg){$(t.clusPopup.content).on('mouseenter','#ci-'+tg+one.id,function(e){e.preventDefault();e.stopPropagation();var off=t.clusPopup.content.offset();p.imgBubble($(this.firstChild).offset(),off,it,tg,t.clusPopup.content,this.firstChild.width,'clusimg');});})(one,tag);if((i+1)%nc==0)
280html+='<br>';if(i>=(nc*nr-1)){var ost=cm-nc*nr;if(more&&ost)
281html+='<div class="picture-description">'+more.replace('%',ost)+'</div>';break;}}}
282t.clusPopup.show(c,evt,html);},clusterleave:function(c){t.clusPopup.leave();},onclose:function(){$('#clusimg').hide().empty()
283if(!is_touch);$(t.clusPopup.content).off('mouseenter');},};t.clusPopup=new coolPopup({text:true,container:'clusContainer',content:'clusContent',onClose:cbs.onclose,});t.prov.clusterEvents(t.cluster,cbs,is_touch);}
284t.prov.controls(param,t);if(!param.in_popup)
285G.event.addListener(t.map,t.prov.getEventName('drag'),function(evt){$(document).trigger("closePopups");});if(param.ajax_map_bounds){G.event.addListener(t.map,t.prov.getEventName('bounds_changed'),function(evt){if(!param.in_popup)
286$(document).trigger("closePopups");var bounds=t.map.getBounds(),zoom=t.map.getZoom(),bu=that.prov.formatBounds(bounds)+'';c_log('current zoom='+zoom);try{var b=bu.split(',');if(b[0]==b[2]&&b[1]==b[3]){c_log('singulare bounds! ='+bu);return;}}catch(e){}
287if(param.saveBounds){$('#'+param.saveBounds).val(bu);}
288if(to)clearTimeout(to);to=setTimeout(function(){if(param.ajax_map_bounds){p.query_bounds(bounds,zoom,function(){p.adjustBorders(200);});}
289t.last_zoom=zoom;},param.bounds_time);p.updateState();});}
290G.event.addListener(t.map,'idle',function(){p.updateState();if(!param.noIdleCallback){coolTooltips();setTimeout(function(){p.adjustBorders();},30);}});G.event.addListener(t.map,t.prov.getEventName('mousemove'),function(e){if(upd)
291p.showPosition(e.latLng);});G.event.addListener(t.map,t.prov.getEventName('click'),function(e){upd=!upd;if(drawMode==1)
292iLD.DrawPolyClick(e);});if(!param.const_last)
293p.LinesMarkers(param,false,true);};p.adjustBorders=function(tm){setTimeout(function(){t.prov.adjustBorders(param);},tm||10);};p.addMarkers=function(data,tag,nodraw){var ms=[],m,i;for(i=0;i<data.length;i++){var one=data[i];if(one.lat&&one.lon){var loc=t.prov.Coord(one.lat,one.lon),parent=null;if(t.cluster&&!one.nocluster){m=p.set_marker(one,loc,{show_icons:true,on_map:false,tag:tag});if(m)ms.push(m);}else
294m=p.set_marker(one,loc,{show_icons:true,tag:tag});}}
295if(t.cluster&&ms.length)
296t.cluster.addMarkers(ms,nodraw);};p.imgBubble=function(ot,op,one,tag,el,sz,id){id=id||'floatimg';var fl=$('div#'+id);if(fl.length)
297fl.hide();else
298fl=$('<div id="'+id+'" style="left:0px;top:0px;position: absolute;border: 1px none;z-index: 9800000;"></div>').appendTo(el).hide();if(!op)op={left:0,top:0};var size=(sz=sz||16)+'px',mg=(150-sz)/2;fl.css({left:ot.left-op.left+'px',top:ot.top-op.top+'px',width:size,height:size,});if(param.ajax_map_bounds){var tp=param.ajax_map_bounds[tag];}else{tp={url:param.def_url||false,eclass:''};}
299var im='<img src="'+one.icon+'" alt="'+one.title+'" style="width:'+size+';height:'+size+'" />',html;if(tp.url){var url=one.slug?tp.url.replace('%SLUG%',one.slug):tp.url.replace('%ID%',one.id);html='<a href="'+url+'" title="'+one.title+'">'+im+'</a>';}else
300html='<span class="icon '+tp.eclass+'" title="'+one.title+'">'+im+'</span>';fl.html(html).show();$('img',fl).stop().animate({width:"150px",height:"150px",marginLeft:"-"+mg+"px",marginTop:"-"+mg+"px"},300);if(!param.noIdleCallback)
301coolTooltips();fl.mouseleave(function(){$('img',fl).stop().removeClass('floatimg').animate({width:sz+"px",height:sz+"px",marginLeft:"0px",marginTop:"0px"},300);fl.hide().empty();});};p.imgHoverListener=function(evt,marker){var $=jQuery,img,one=marker.orig_data;if(!one.icon)
302return;
302var r=t.prov.findIcon(evt,t.el,one.icon);if(!r.img){c_log('img not found in '+el);return;}
303evt.preventDefault();evt.stopPropagation();this.imgBubble(r.trg.offset(),el.offset(),one,marker.orig_tag,$(t.el).parent());};p.geocodePosition=function(pos,cb){if(!t.geocoder)
304t.geocoder=new G.Geocoder();t.geocoder.geocode({latLng:pos},function(responses){if(responses&&responses.length>0){var addr=[];cb(responses[0].formatted_address,true);}else
305cb(param.geoErr||gmap.geoErr,false);});};p.updateMarkerPosition=function(el_id,latLng){if(typeOf(el_id)=='function')
306el_id(latLng.lat(),latLng.lng());else
307I(el_id).value=''+latLng.lat()+','+latLng.lng();},p.show_hide_mdata=function(vis,marker){c_log('visibilityChanged to'+marker.is_visible);var data=marker.misc_data,i,l;if(!data)return;if(vis){var map=marker.getMap();for(i=0,l=data.length;i<l;i++)
308if(data[i].getMap()!=map)
309data[i].setMap(map);}else{for(i=0,l=data.length;i<l;i++)
310data[i].setMap(null);}};p.set_marker=function(one,loc,opt){var idx=((opt&&opt.tag)?opt.tag+'-':'')+one.id,cbs={};if(t.items[idx])return false;var options={loc:loc,rate:one.rate,};if(opt.on_map!==false)
311options.map=t.map;if(opt.show_icons&&one.icon){options.icon=one.icon;}
312if(one.movable){options.draggable=true;options.zIndex=max_zindex-1;t.markerTimer=false;cbs={dragstart:function(evt,marker){if(t.markerTimer)clearTimeout(t.markerTimer);$('#'+one.movable).val(param.tMoving||gmap.tMoving||'Moving');},dragend:function(evt,marker){var loc;p.updateMarkerPosition(one.movable,loc=marker.getPosition());if(one.geocode){if(t.markerTimer)clearTimeout(t.markerTimer);t.markerTimer=setTimeout(function(){p.geocodePosition(loc,function(ret,success){if(typeOf(one.geocode)=='function'){one.geocode(ret,success);}else{if(success){$('#'+one.geocode).removeClass('error').val(ret);}else
313$('#'+one.geocode).addClass('error').val(ret);}});},300);}},};}else if(param.showPopups){var act=opt.tag?param.ajax_map_bounds[opt.tag].action:param.ajax_data_action;if(act){cbs={mouseout:function(evt,marker){if(param.in_popup)
314return;t.mPopup.leave();},visibilityChanged:function(evt,marker){var data=marker.misc_data;if(!data)return;p.show_hide_mdata(marker.is_visible,marker);},}
315cbs[is_touch?'click':'mouseover']=function(evt,marker){if(param.in_popup)
316return;t.mPopup.show(marker,evt);};}else{cbs[is_touch?'click':'mouseover']=function(evt,marker){p.imgHoverListener(evt,marker);};}}else if(one.info){if(!t.infowindow)
317t.infowindow=new G.InfoWindow({content:''});cbs['click']=function(evt,marker){infowindow.setContent(one.info);infowindow.open(t.map,marker);};options.title=one.title;}else if(one.title)
318options.title=one.title;var marker=t.prov.createObjMarker(options,cbs);if(one.data){var parent={a:[],name:one.title,one:one,tag:opt.tag};p.LinesMarkers(one.data,parent,one.nocluster?true:!t.cluster);marker.misc_data=parent.a;}
319marker.orig_data=one;if(opt.tag)marker.orig_tag=opt.tag;marker.can_show=function(){if(this.orig_tag)
320return param.ajax_map_bounds[this.orig_tag].on;return true;}
321t.items[idx]=marker;if(one.movable&&one.geocode){var ivId=0,fUpdate=false,last_location='',ctl=I(one.geocode),check_location=function(){c_log('check_location');try{if(last_location!=ctl.value){last_location=ctl.value;
321fUpdate=1;c_log('loc changed='+ctl.value);}else if(fUpdate){fUpdate=0;c_log('loc fix, update! loc='+ctl.value);last_location=ctl.value
322if(!t.geocoder)
323t.geocoder=new G.Geocoder();t.geocoder.geocode({'address':ctl.value},function(results,status){if(status==G.GeocoderStatus.OK){var loc=results[0].geometry.location;one.lat=loc.lat();one.lon=loc.lng();p.updateMarkerPosition(one.movable,loc);marker.setPosition(loc);t.map.setCenter(loc);}else{c_log("Geocode was not successful for the following reason: "+status+' location='+location);}});}}catch(e){c_log('check_location error='+e.description);}},StartTimerLoc=function(){ivId=setInterval(check_location,500);},StopTimerLoc=function(){clearInterval(ivId);check_location();};ctl.onfocus=StartTimerLoc;ctl.onblur=StopTimerLoc;}
324if(!t.bounds)t.bounds=new G.LatLngBounds(loc,loc);else t.bounds.extend(loc);t.pointCount++;return marker;};p.removeMarker=function(m,nodraw){if(m.misc_data){for(var i in m.misc_data){m.misc_data[i].setMap(null);}
325delete m.misc_data;}
326if(t.cluster){try{t.cluster.removeMarkers([m],nodraw);}catch(e){}}
327m.setMap(null);};p.geocodedMarker=function(loc,one,tag){one.lat=loc.lat();one.lon=loc.lng();if(!t.map)
328p.showMap(loc);else if(one.setCenter)
329t.map.setCenter(loc);if(t.cluster&&!one.nocluster)
330t.cluster.addMarker(p.set_marker(one,loc,{show_icons:param.show_icons,on_map:false,tag:tag||one.tag}));else
331p.set_marker(one,loc,{show_icons:param.show_icons,tag:tag||one.tag});if(param.ajax_geocoder){var data={action:'maps_geocoder',lat:loc.lat(),lng:loc.lng(),_wpnonce:param.nonce};data[param.ajax_geocoder]=one.id;jQuery.post(param.ajax_url,data,function(response){var xx=response;if(param.ajax_geocoder)
332setTimeout(function(){param.ajax_geocoder=false;},1000);});}};p.doGeocoder=function(id,location,tag){setTimeout(function(){if(!t.geocoder)
333t.geocoder=new G.Geocoder();t.geocoder.geocode({'address':location},function(results,status){var loc,one=param.geodata[id];if(status==G.GeocoderStatus.OK){p.geocodedMarker(results[0].geometry.location,one,tag);}else{c_log("Geocode was not successful for the following reason: "+status+' location='+location);if(param.def_lat||param.def_lon)
334loc=new t.prov.Coord(param.def_lat,param.def_lon);else
335loc=false;}
336if(!t.map&&loc)
337p.showMap(loc);
337if(t.bounds&&param.fit_bounds&&loc){t.map.fitBounds(t.bounds);}});},100);};p.geo_loop=function(s_id,e_id,tag){var one,ms=[],m,i,loc,delay=100;for(i=s_id;i<e_id;i++){one=param.geodata[i];if(one.lat&&one.lon){loc=t.prov.Coord(one.lat,one.lon);if(!t.map)p.showMap(loc);if(t.cluster&&!one.nocluster){m=p.set_marker(param.geodata[i],loc,{show_icons:param.show_icons,tag:tag||one.tag,on_map:false});if(m)ms.push(m);}else
338m=p.set_marker(param.geodata[i],loc,{show_icons:param.show_icons,tag:tag||one.tag});}else if(one.location)
339p.doGeocoder(i,one.location,tag||one.tag);else if(one.clientlocation){if((loc=t.prov.clientLocation())){p.updateMarkerPosition(one.movable,loc);p.geocodedMarker(loc,one,tag);p.geocodePosition(loc,function(ret,success){if(one.geocode){if(success)
340$('#'+one.geocode).removeClass('error').val(ret);else
341$('#'+one.geocode).addClass('error').val(ret);}});}else{mapEngine.LoadMapScripts(function(prov2){if((loc=prov2.clientLocation())){p.updateMarkerPosition(one.movable,loc);p.geocodedMarker(loc=new G.LatLng(loc[0],loc[1]),one,tag);p.geocodePosition(loc,function(ret,success){if(one.geocode){if(success)
342$('#'+one.geocode).removeClass('error').val(ret);else
343$('#'+one.geocode).addClass('error').val(ret);}});}else
344p.geocodedMarker(new G.LatLng(55.752,37.612),one,tag);},'yandex');}}}
345if(t.cluster&&ms.length)
346t.cluster.addMarkers(ms);if(t.map){if(t.bounds&&param.fit_bounds&&t.pointCount>1)
347t.map.fitBounds(t.bounds);}else if(param.def_lat||param.def_lon)
348p.showMap(t.prov.Coord(param.def_lat,param.def_lon));if(!t.map)
349p.showMap(false);};p.showList=function(ptr,tag){var geoloc=0;if(param.def_lat||param.def_lon){var ll=t.center=t.prov.Coord(param.def_lat||0,param.def_lon||0);p.showMap(ll);}
350p.geo_loop(ptr,param.geodata?param.geodata.length:0,tag);if(param.const_last)
351p.LinesMarkers(param,false,true);};p.getFilter=function(tag){var el=param.ajax_map_bounds[tag];if(el.on&&el.select){var url=param.ajax_url+'?action=map_filters_query&id='+param.element_id+'&tag='+tag+'&req='+encodeURIComponent(JSON.stringify(el.select))+'&_wpnonce='+param._wpnonce;return'<li class="filter-'+tag+'"><a href="'+url+'">'+el.title+'</a></li>';}
352return'';};p.addFilter=function(tag){if(tabs){var li=p.getFilter(tag);if(li){tabsCnt++;tabs.find(".ui-tabs-nav").append(li);tabs.tabs("refresh");}}};p.removeFilter=function(tag){if(tabs){var ai=tabs.tabs("option","active");var pid=tabs.find("li.filter-"+tag).remove().attr("aria-controls");if(pid){$("#"+pid,leftPane).remove();tabs.tabs("refresh");tabsCnt--;if(ai<=tabsCnt)
353ai=tabsCnt-1;if(ai>=0)
354tabs.tabs("option","active",ai);}}};p.showPosition=function(latLng,skip){var lat=latLng.lat(),lon=latLng.lng(),dc=I('datum');if(!skip&&dc&&(dc.value-0)&&window.WGS84_SK42){var ll=WGS84_SK42({lat:lat,lon:lon});lat=ll.lat;lon=ll.lon;}
355if(param.saveLat)
356I(param.saveLat).value=iCM.formatCoords(lat);if(param.saveLon)
357I(param.saveLon).value=iCM.formatCoords(lon);iCM.ClearTimerCoord();};p.check_coords=function(){try{var lat=I(param.saveLat).value,lon=I(param.saveLon).value;lat=iCM.translate_coord(lat,'ns');lon=iCM.translate_coord(lon,'ew');if(last_lat!=lat||last_lon!=lon){last_lat=lat;last_lon=lon;fCoordUpdate=1;}else if(fCoordUpdate){fCoordUpdate=0;t.map.setCenter(new G.LatLng(lat,lon));}}catch(e){}};this.show=function(arg){if(!arg){if(t.kmllayer)t.kmllayer.setMap(null);return;}
358var lat,lon;if(window.userCoords){lat=userCoords.lat;lon=userCoords.lon;}
359if(!lat)lat=55;if(!lon)lon=55;var ll=t.center=t.prov.Coord(param.def_lat||lat,param.def_lon||lon);if(t.map&&arg==1){t.prov.resizeMap(t.map);if(t.map&&t.kmllayer){t.kmllayer.setMap(t.map);}else if(t.map&&t.bounds&&param.fit_bounds){t.map.fitBounds(t.bounds);}else
360t.map.setCenter(marker?marker.getPosition():ll);return;}
361p.showMap(ll);t.prov.resizeMap(t.map);that.t=t;};that.init=function(a){if(param.autoshow)
362that.show(a);};that.refresh=function(mode){if(mode){t.prov.resizeMap(t.map);if(param.fit_bounds&&t.bounds&&t.pointCount>1){t.map.fitBounds(t.bounds);}}else{}};that.refresh.locate=function(a){if(!t.geocoder)t.geocoder=new G.Geocoder();t.geocoder.geocode({'address':a},function(results,status){if(status==G.GeocoderStatus.OK)
363t.map.setCenter(t.center=results[0].geometry.location);});};that.refresh.getCenterLL=function(){return t.prov.getCenter(t.map).toString();};that.refresh.getZoom=function(){return t.map.getZoom();};var reqTo,createSplitter=function(sps,tag){sp=$.splitter(sps,{type:"v",outline:true,minLeft:180,sizeLeft:180,minRight:360,resizeToWidth:true,cookie:"mapsplit",cookiePath:'/',opened:false,enabled:tag,accessKey:'I',onResize:function(sz){if(t&&t.map)
364t.prov.resizeMap(t.map);},onOpenClose:function(v){if(v&&!leftPane){var ul='';for(tag in param.ajax_map_bounds){var li=p.getFilter(tag);ul+=li;if(li)tabsCnt++;}
365if(!ul)return;ul='<ul class="filter-tabs">
365'+ul+'</ul>';ul=$(ul);leftPane=$(".left-pane .lp-inner",sps);leftPane.append(ul);tabs=$(leftPane).tabs({idPrefix:param.selectable+'-',panelTemplate:'<div class="loading filter"></div>',load:function(e,ui){$(ui.tab).find('a').attr('href','#'+$(ui.panel).attr('id'));$(ui.panel).addClass('after-ajax').removeClass('loading').accordion({collapsible:true,active:false,heightStyle:'content',beforeActivate:function(e,ui){if(ui.newHeader.length){var p=$(ui.newHeader[0]).next();if(p.hasClass('loading')){var url=$(ui.newHeader[0]).children('a').attr('href');$.get(url,function(data){p.removeClass("loading").html(data).css({height:'auto',});coolTooltips();});}}},});},});}else if(v&&tabs){var ai=tabs.tabs("option","active");if(ai===false)
366tabs.tabs("option","active",0);}},});var cnt=0;for(var tg in param.ajax_map_bounds){if(param.ajax_map_bounds[tg].on)
367cnt++;}
368if(cnt){sp.enable();}else{sp.disable();}},drawAll=function(force){if(!param.done){param.done=true;t={};t.prov=that.prov;t.map=false;t.bounds=0;t.pointCount=0;t.last_zoom=999;t.last_points=[];t.center=0;t.kmllayer=0;t.geocoder=false;t.markers=[];t.infowindow=false;t.items=[];that.t=t;max_zindex=G.Marker.MAX_ZINDEX-15000;var tag=(param.ajax_map_bounds&&param.ajax_map_bounds['default'])?param.ajax_map_bounds['default']:false;t.mPopup=new coolPopup({container:'popupContainer',content:'popupContent',url:param.ajax_url,getData:function(marker,action){var tag=marker.orig_tag,act=param.ajax_map_bounds&&param.ajax_map_bounds[tag]&&param.ajax_map_bounds[tag].action,one=marker.orig_data;return one?{ID:one.id,action:act||param.ajax_data_action}:false;},});if(param.geodata&&param.geodata.length||param.no_exit_on_empty){setTimeout(function(){p.showList(0,tag);},100);}else if(param.gmv3){if(force)
369that.show(2);}else if(param.ajax_action){var img=$('<img src="'+ajax_image+'/ajax-loader.gif" alt="Loading" />');$('#'+param.element_id).parent().prepend(img);$.post(param.ajax_url,{action:param.ajax_action,start:true,filter:param.filter,_wpnonce:param._wpnonce,},function(responce){if(responce){try{param.geodata=eval(responce);}catch(e){c_log('eval error: '+e.description+' cause: '+responce);}
370setTimeout(function(){img.hide();p.showList(0,tag);},100);}});}}};var sps;if(param.selectable&&(sps=$('#'+param.selectable))&&$.splitter){createSplitter(sps,(param.ajax_map_bounds&&param.ajax_map_bounds['default'])?param.ajax_map_bounds['default']:false);}
371drawAll();if(!param.one_prov){var el=$('#'+param.element_id);mapEngine.add_changer(el,that,function(id){var center,zoom;param.fit_bounds=false;param.preserveViewport=true;that.data[that.prov.id]={obj:t,api:G,center:center=t.prov.getCenter(t.map),zoom:zoom=param.map_options.zoom=t.map.getZoom(),};c_log('old zoom='+zoom+' center='+center.toString());var adjustBounds=function(g){for(var tag in param.ajax_map_bounds){var one=param.ajax_map_bounds[tag];if(one.bounds){one.bounds=new g.LatLngBounds(one.bounds.getNorthEast(),one.bounds.getSouthWest
371());}}};if(that.data[id]){t.el.style.display='none';var dt=that.data[id];t=dt.obj;G=dt.api;that.prov=t.prov;t.el.style.display='block';t.map.setCenter(t.prov.Coord(center.lat(),center.lng()));if(dt.zoom!=zoom)
372t.map.setZoom(zoom);adjustBounds(G);}else{mapEngine.LoadMapScripts(function(prv){t.el.style.display='none';that.prov=prv;G=prv.getApi();G.Engine=prv;param.done=false;param.forceCenter=prv.Coord(center.lat(),center.lng());adjustBounds(G);drawAll(true);mapEngine.setDefault(id,param.map_id);},id);}},param.provPosition||(param.map_options.mapTypeControl?100:10));}
373iCM={getPosition:function(){var t=this;return{xlat:I(param.saveLat).value,xlon:I(param.saveLon).value,lat:function(){return t.translate_coord(this.xlat,'ns');},lng:function(){return t.translate_coord(this.xlon,'ew');}};},ChangeCoordMode:function(){if(!param.saveLat||!param.saveLon)return;var t=this;p.showPosition(t.getPosition());},ChangeDatum:function(){var t=this,latlng=t.getPosition();if((I('datum').value-0)&&window.WGS84_SK42){p.showPosition(latlng);}else if(window.SK42_WGS84){var ll=SK42_WGS84({lat:t.translate_coord(latlng.xlat,'ns'),lon:t.translate_coord(latlng.xlon,'ew')});latlng={lat:function(){return ll.lat;},lng:function(){return ll.lon;}};p.showPosition(latlng,true);}},StartTimerCoord:function(){ivCoordId=setInterval(function(){p.check_coords();},1000);},StopTimerCoord:function(){if(ivCoordId)
374clearInterval(ivCoordId);p.check_coords();},ClearTimerCoord:function(){if(ivCoordId)
375clearInterval(ivCoordId);},translate_coord:function(coord,lett){coord=$.trim(coord).toLowerCase();lett=lett.toLowerCase();var pat='  ',id;if(coord.indexOf(pat)==-1)pat='&deg;';if(coord.indexOf(pat)==-1)pat=':';if(coord.indexOf(pat)==-1)pat='*';if(coord.indexOf(pat)==-1)pat=' ';if((id=coord.indexOf(pat))!=-1){var grd=coord.split(pat),grad=$.trim(grd[0]).replace(lett[0],''),grad=$.trim(grad).replace(lett[1],'-'),mins=grd[1].split('"'),minutes;if(mins[1]){minutes=(parseInt(mins[0])+parseFloat(mins[1])/60);}else
376minutes=grd[1];if(grad<0)coord=''+(parseInt(grad)-parseFloat(minutes)/60);else coord=''+(parseInt(grad)+parseFloat(minutes)/60);}
377coord=coord.trim().replace(lett[0],'');coord=coord.trim().replace(lett[1],'-');return parseFloat(coord);},formatCoords:function(coord){var prefix='';try{var mode=I('coord_mode').value;}catch(e){var mode=0;}
378switch(mode-0){case 0:return coord;case 1:if(coord<0){coord=-coord;prefix='-';}
379var grd=Math.floor(coord),mins=(coord-grd)*60;return''+prefix+grd+'  '+mins;case 2:if(coord<0){coord=-coord;prefix='-';}
380var grd=Math.floor(coord),mins=Math.floor((coord-grd)*60),secs=(coord-grd-mins/60)*3600;return''+prefix+grd+'  '+mins+'"'+secs;}
381return coord;},get_fullist:function(e){var ids=e.id.split('-'),id,id2,url=param.ajax_url+'?action=map_fullist&id='+e.id+'&_wpnonce='+param._wpnonce,w=$('.wait',$(t).closest('table')),tag=ids[1],obj=ids[2];ids[0]='u';id='#'+ids.join('-');ids[0]='ul';id2='#'+ids.join('-');if(e.checked){if($('li',$(id)).length==0){w.show();ids=[];$('li',id2).each(function(n,e){if($(e).hasClass('filter'))return;var v=e.id.split('-');if(v[1])ids.push(v[1]);});if(ids.length)url+="&ids="+ids.join(',');$(id).load(url,function(){w.hide();$('li.friend-tab',id2).remove();$(id2).addClass('search');});}else{$('input:checkbox',$(id2)).removeAttr('checked');$('li',$(id2)).each(function(n,t){var v=t.id.split('-');if(v[1]){v[0]='c';$('#'+v.join('-')).attr('checked','checked');}});$(id).show();$(id2).addClass('search');$('li.friend-tab',id2).remove();}}else{$('li input:checkbox',$(id)).each(function(n,t){if($(t).hasClass('filter-inv'))return;if(t.checked){var v=t.name.split('-');if(v[1]){v[0]='un';var li=$(t).closest('li'),a=$('a',li).clone();li=$('<li>').attr('id',v.join('-')).addClass('friend-tab');$('<span>').appendTo(li).append(a);li.appendTo(id2).append('<span class="p">X</span>');$('.p',li).click(function(){window['acfb-'+tag+'-'+obj].removeFind(this);});}}});$(id).hide();$(id2).removeClass('search');}},requery:function(e){if(reqTo)
382clearTimeout(reqTo);reqTo=setTimeout(function(){if($(e).hasClass('single')){var ids=e.id.split('-'),tag=ids[1];}else{var ids=$(e).closest('ul').attr('id').split('-'),tag=ids[1];}
383var bounds=t.map.getBounds(),zoom=t.map.getZoom();p.query_bounds(bounds,zoom,function(was_req,tag){adjust_vis(was_req,tag,true);},true,tag);reqTo=0;},500);},};}
384var track_map;function show_track_on_map(url,name,button){var $=jQuery,el=$('#track_map');if(!el.length){el=$('<div id="track_map"></div>');$('body').append(el);}
385track_map=new my_cool_map($,{map_id:"track",element_id:"track_map",geodata:false,show_icons:false,title:name,map_options:last_track_data.param.map_options,gmv3:true,autoshow:true,nocluster:true,kml:url,link_control:true,dlButton:button,},last_track_data.prov);$('#trkContainer').hide();tb_show(name,'?TB_inline=1&inlineId=track_map',false,function(id,v){track_map.show(v);});}
386function mapFilterAutocomplete(value,data){var $=jQuery;}
387/* m-cluster */ 
388function MarkerClusterer(G,map,opt_markers,opt_options){'use strict';this.extend(MarkerClusterer,G.OverlayView);this.map_=map;this.G=G;this.markers_=[];
388this.clusters_=[];this.sizes=[38,45,53,61,69,77,85,92];this.styles_=[];this.ready_=false;var options=opt_options||{};this.gridSize_=options['gridSize']||60;this.minClusterSize_=options['minimumClusterSize']||2;this.maxZoom_=options['maxZoom']||null;this.styles_=options['styles']||[];this.imagePath_=options['imagePath']||this.MARKER_CLUSTER_IMAGE_PATH_;this.imageExtension_=options['imageExtension']||this.MARKER_CLUSTER_IMAGE_EXTENSION_;this.zoomOnClick_=true;if(options['zoomOnClick']!=undefined){this.zoomOnClick_=options['zoomOnClick'];}
389this.averageCenter_=false;if(options['averageCenter']!=undefined){this.averageCenter_=options['averageCenter'];}
390this.clusterTitle_=false;if(options['clusterTitle']!=undefined){this.clusterTitle_=options['clusterTitle'];}
391this.is_touch=options['is_touch']||false;this.setupStyles_();this.setMap(map);this.prevZoom_=this.map_.getZoom();var that=this;that.G.event.addListener(this.map_,'zoom_changed',function(){var zoom=that.map_.getZoom();if(that.prevZoom_!=zoom){that.prevZoom_=zoom;that.resetViewport();}});that.G.event.addListener(this.map_,'idle',function(){that.redraw();that.G.event.trigger(that,'redrawclusters',this.cluster_);});if(opt_markers&&opt_markers.length){this.addMarkers(opt_markers,false);}}
392MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_='/wp-t/map/img/m';MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_='png';MarkerClusterer.prototype.extend=function(obj1,obj2){return(function(object){for(var property in object.prototype){this.prototype[property]=object.prototype[property];}
393return this;}).apply(obj1,[obj2]);};MarkerClusterer.prototype.onAdd=function(){this.setReady_(true);};MarkerClusterer.prototype.draw=function(){};MarkerClusterer.prototype.setupStyles_=function(){if(this.styles_.length){return;}
394for(var i=0,size;size=this.sizes[i];i++){this.styles_.push({url:this.imagePath_+(i+1)+'.'+this.imageExtension_,height:size,width:size});}};MarkerClusterer.prototype.fitMapToMarkers=function(){var markers=this.getMarkers();var bounds=new this.G.LatLngBounds();for(var i=0,marker;marker=markers[i];i++){bounds.extend(marker.getPosition());}
395this.map_.fitBounds(bounds);};MarkerClusterer.prototype.setStyles=function(styles){this.styles_=styles;};MarkerClusterer.prototype.getStyles=function(){return this.styles_;};MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_;};MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_;};MarkerClusterer.prototype.getMarkers=function(){return this.markers_;};MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length;};MarkerClusterer.prototype.setMaxZoom=function(maxZoom){this.maxZoom_=maxZoom;};MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_;};MarkerClusterer.prototype.calculator_=function(markers,numStyles){var index=0,count=markers.length,dv=count;while(dv!==0){dv=parseInt(dv/3,10);index++;}
396index=Math.min(index,numStyles);return{text:count,index:index};};MarkerClusterer.prototype.setCalculator=function(calculator){this.calculator_=calculator;};MarkerClusterer.prototype.getCalculator=function(){return this.calculator_;};MarkerClusterer.prototype.addMarkers=function(markers,opt_nodraw){for(var i=0,marker;marker=markers[i];i++){if(marker)
397this.pushMarkerTo_(marker);}
398if(!opt_nodraw){this.redraw();}};MarkerClusterer.prototype.pushMarkerTo_=function(marker){marker.isAdded=false;if(marker['draggable']){var that=this;that.G.event.addListener(marker,'dragend',function(){marker.isAdded=false;that.repaint();});}
399this.markers_.push(marker);};MarkerClusterer.prototype.addMarker=function(marker,opt_nodraw){if(marker){this.pushMarkerTo_(marker);if(!opt_nodraw)
400this.redraw();}};MarkerClusterer.prototype.removeMarker_=function(marker){var index=-1;if(this.markers_.indexOf){index=this.markers_.indexOf(marker);}else{for(var i=0,m;m=this.markers_[i];i++){if(m==marker){index=i;break;}}}
401if(index==-1){return false;}
402marker.setMap(null);this.markers_.splice(index,1);return true;};MarkerClusterer.prototype.removeMarker=function(marker,opt_nodraw){var removed=this.removeMarker_(marker);if(!opt_nodraw&&removed){this.resetViewport();this.redraw();return true;}else{return false;}};MarkerClusterer.prototype.removeMarkers=function(markers,opt_nodraw){var removed=false,i;for(i in markers){var marker=markers[i],r=this.removeMarker_(marker);removed=removed||r;}
403if(!opt_nodraw&&removed){this.resetViewport();this.redraw();return true;}};MarkerClusterer.prototype.setReady_=function(ready){if(!this.ready_){this.ready_=ready;
403this.createClusters_();}};MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length;};MarkerClusterer.prototype.getMap=function(){return this.map_;};MarkerClusterer.prototype.setMap=function(map){this.map_=map;};MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_;};MarkerClusterer.prototype.setGridSize=function(size){this.gridSize_=size;};MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_;};MarkerClusterer.prototype.setMinClusterSize=function(size){this.minClusterSize_=size;};MarkerClusterer.prototype.getExtendedBounds=function(bounds){var projection=this.getProjection(),tr=new this.G.LatLng(bounds.getNorthEast().lat(),bounds.getNorthEast().lng()),bl=new this.G.LatLng(bounds.getSouthWest().lat(),bounds.getSouthWest().lng());var trPix=projection.fromLatLngToDivPixel(tr);trPix.x+=this.gridSize_;trPix.y-=this.gridSize_;var blPix=projection.fromLatLngToDivPixel(bl);blPix.x-=this.gridSize_;blPix.y+=this.gridSize_;var ne=projection.fromDivPixelToLatLng(trPix),sw=projection.fromDivPixelToLatLng(blPix);return new this.G.LatLngBounds(sw,ne);};MarkerClusterer.prototype.isMarkerInBounds_=function(marker,bounds){return bounds.contains(marker.getPosition());};MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(true);this.markers_=[];};MarkerClusterer.prototype.resetViewport=function(opt_hide){for(var i=0,cluster;
403cluster=this.clusters_[i];i++){cluster.remove();}
404for(var i=0,marker;marker=this.markers_[i];i++){marker.isAdded=false;if(opt_hide){marker.setMap(null);}}
405this.clusters_=[];};MarkerClusterer.prototype.repaint=function(optHide){var oldClusters=this.clusters_.slice();this.clusters_.length=0;this.resetViewport(optHide);this.redraw();window.setTimeout(function(){for(var i=0,cluster;cluster=oldClusters[i];i++){cluster.remove();}},0);};MarkerClusterer.prototype.redraw=function(){this.createClusters_();};MarkerClusterer.prototype.distanceBetweenPoints_=function(p1,p2){'use strict';if(!p1||!p2){return 0;}
406var R=6371,dLat=(p2.lat()-p1.lat())*Math.PI/180,dLon=(p2.lng()-p1.lng())*Math.PI/180,a=Math.sin(dLat/2)*Math.sin(dLat/2)+
407Math.cos(p1.lat()*Math.PI/180)*Math.cos(p2.lat()*Math.PI/180)*Math.sin(dLon/2)*Math.sin(dLon/2),c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return R*c;};MarkerClusterer.prototype.distanceInPixels_=function(p1,p2){'use strict';if(!p1||!p2){return 0;}
408var cp1=this.projection.fromLatLngToDivPixel(p1),cp2=this.projection.fromLatLngToDivPixel(p2);var dx=cp1.x-cp2.x,dy=cp1.y-cp2.y;return Math.sqrt(dx*dx+dy*dy);};MarkerClusterer.prototype.addToClosestCluster_=function(marker){'use strict';var distance=40000,clusterToAddTo=null,pos=marker.getPosition();for(var i=0,cluster;
408cluster=this.clusters_[i];i++){var center=cluster.getCenter();if(center){var d=this.distanceBetweenPoints_(center,marker.getPosition());if(d<distance){distance=d;clusterToAddTo=cluster;}}}
409if(clusterToAddTo&&clusterToAddTo.isMarkerInClusterBounds(marker)){clusterToAddTo.addMarker(marker);}else{var cluster=new Cluster(this);cluster.addMarker(marker);this.clusters_.push(cluster);}};MarkerClusterer.prototype.createClusters_=function(){'use strict';if(!this.ready_){return;}
410var mapBounds=new this.G.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast());var bounds=this.getExtendedBounds(mapBounds);for(var i=0,marker;marker=this.markers_[i];i++){if(marker.can_show&&!marker.can_show()){if(marker.is_visible){this.G.event.trigger(marker,'visibilityChanged',(marker.is_visible=false));}
411continue;}
412if(this.isMarkerInBounds_(marker,bounds)){if(!marker.isAdded)
413this.addToClosestCluster_(marker);}else{if(marker.is_visible){this.G.event.trigger(marker,'visibilityChanged',(marker.is_visible=false));}}}};function Cluster(markerClusterer){'use strict';this.markerClusterer_=markerClusterer;this.G=markerClusterer.G;this.map_=markerClusterer.getMap();this.gridSize_=markerClusterer.getGridSize();this.minClusterSize_=markerClusterer.getMinClusterSize();this.averageCenter_=markerClusterer.isAverageCenter();this.center_=null;this.markers_=[];this.bounds_=null;this.e_bounds_=null;this.clusterIcon_=new ClusterIcon(this,markerClusterer.getStyles(),markerClusterer.getGridSize());}
414Cluster.prototype.isMarkerAlreadyAdded=function(marker){if(this.markers_.indexOf){return this.markers_.indexOf(marker)!=-1;}else{for(var i=0,m;m=this.markers_[i];i++){if(m==marker){return true;}}}
415return false;};Cluster.prototype.addMarker=function(marker){if(this.isMarkerAlreadyAdded(marker)){return false;}
416if(!this.center_){this.bounds_=new this.G.LatLngBounds(this.center_=marker.getPosition());}else{if(this.averageCenter_){var l=this.markers_.length+1;var p=marker.getPosition();var lat=(this.center_.lat()*(l-1)+p.lat())/l;var lng=(this.center_.lng()*(l-1)+p.lng())/l;this.center_=new this.G.LatLng(lat,lng);}
417this.bounds_.extend(marker.getPosition());}
418this.e_bounds_=this.markerClusterer_.getExtendedBounds(this.bounds_);marker.isAdded=true;this.markers_.push(marker);var vis=false;var len=this.markers_.length;if(len<this.minClusterSize_){if(marker.getMap()!=this.map_)
419marker.setMap(this.map_);vis=true;}
420if(len==this.minClusterSize_){for(var i=0;i<len;i++){var m=this.markers_[i];m.setMap(null);if(m.is_visible){this.G.event.trigger(m,'visibilityChanged',(m.is_visible=false));}}}
421if(len>=this.minClusterSize_){marker.setMap(null);vis=false;}
422if(!vis!=!marker.is_visible){this.G.event.trigger(marker,'visibilityChanged',(marker.is_visible=vis));}
423this.updateIcon();return true;};Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_;};Cluster.prototype.getBounds=function(force){var t=this;if(force){var bounds=new t.G.LatLngBounds(t.center_,t.center_),markers=t.getMarkers();for(var i=0,marker;marker=markers[i];i++){bounds.extend(marker.getPosition());}
424return t.bounds_=bounds;}
425return t.bounds_;};Cluster.prototype.getRadius=function(){var r=0,cl=this.markerClusterer_,markers=this.getMarkers();for(var i=0,marker;marker=markers[i];i++){var d=cl.distanceBetweenPoints_(this.center,marker.getPosition());if(d>r)
426r=d;}
427return r;};Cluster.prototype.getRadiusPixels=function(){var r=0,t=this,cl=t.markerClusterer_,markers=t.getMarkers(),cp=cl.projection.fromLatLngToDivPixel(t.center);for(var i=0,marker;marker=markers[i];i++){var p=cl.projection.fromLatLngToDivPixel(marker.getPosition());var dx=cp.x-p.x,dy=cp.y-p.y;var d=Math.sqrt(dx*dx+dy*dy);if(d>r)
428r=d;}
429return r;};Cluster.prototype.remove=function(){this.clusterIcon_.remove();this.markers_.length=0;delete this.markers_;};Cluster.prototype.getSize=function(){return this.markers_.length;};Cluster.prototype.getMarkers=function(){return this.markers_;};Cluster.prototype.getCenter=function(){return this.center_;};Cluster.prototype.isMarkerInClusterBounds=function(marker){return this.e_bounds_.contains(marker.getPosition());};Cluster.prototype.isMarkerInClusterRadius=function(marker){return this.getRadiusPixels()>
429this.clusterer_.distanceInPixels_(marker.getPosition(),this.center_);};Cluster.prototype.getMap=function(){return this.map_;};Cluster.prototype.updateIcon=function(){var zoom=this.map_.getZoom(),mz=this.markerClusterer_.getMaxZoom();if(mz&&(zoom>mz)){for(var i=0,marker;marker=this.markers_[i];i++){marker.setMap(this.map_);}
430return;}
431if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return;}
432var numStyles=this.markerClusterer_.getStyles().length,sums=this.markerClusterer_.getCalculator()(this.markers_,numStyles);this.clusterIcon_.setCenter(this.center_);this.clusterIcon_.setSums(sums);this.clusterIcon_.show();};function ClusterIcon(cluster,styles,opt_padding){var cl=cluster.getMarkerClusterer();cl.extend(ClusterIcon,cl.G.OverlayView);this.G=cl.G;this.styles_=styles;this.padding_=opt_padding||0;this.cluster_=cluster;this.center_=null;this.map_=cluster.getMap();this.div_=null;this.sums_=null;this.visible_=false;this.title_=false;this.setMap(this.map_);}
433ClusterIcon.prototype.triggerClusterClick=function(e){var markerClusterer=this.cluster_.getMarkerClusterer();this.G.event.trigger(markerClusterer,'clusterclick',this.cluster_,e);if(markerClusterer.isZoomOnClick()){this.map_.fitBounds(this.cluster_.getBounds());}};ClusterIcon.prototype.triggerClusterHover=function(e){var markerClusterer=this.cluster_.getMarkerClusterer();this.G.event.trigger(markerClusterer,'clusterhover',this.cluster_,e);};ClusterIcon.prototype.triggerClusterLeave=function(e){var markerClusterer=this.cluster_.getMarkerClusterer();this.G.event.trigger(markerClusterer,'clusterleave',this.cluster_,e);};ClusterIcon.prototype.onAdd=function(){var mc=this.cluster_.getMarkerClusterer(),t=this;t.div_=document.createElement('DIV');if(t.visible_){var pos=t.getPosFromLatLng_(t.center_);t.div_.style.cssText=t.createCss(pos);t.div_.innerHTML=t.sums_.text;if(mc.clusterTitle_)
434t.div_.title=mc.clusterTitle_.replace('%',t.sums_.text);}
435var panes=t.getPanes(),p=panes.overlayImage,f=p.firstChild,e=t.G.event;if(f)p.insertBefore(t.div_,f);else p.appendChild(t.div_);if(mc.is_touch){if(t.div_){e.addDomListener(t.div_,'dblclick',function(evt){t.triggerClusterClick(evt);});e.addDomListener(t.div_,'click',function(evt){t.triggerClusterHover(evt);});e.addDomListener(t.div_,'mouseout',function(evt){t.triggerClusterLeave(evt);});}
436else c_log('t.div_ is empty!');e.addDomListener(document,'click',function(e){if(t.div_&&jQuery(t.div_).has(e.target).length==0)
437t.triggerClusterLeave(e);});}else{if(this.div_){e.addDomListener(t.div_,'click',function(evt){t.triggerClusterClick(evt);});e.addDomListener(t.div_,'mouseover',function(evt){t.triggerClusterHover(evt);});e.addDomListener(t.div_,'mouseout',function(evt){t.triggerClusterLeave(evt);});}
438else c_log('t.div_ is empty!');}
439e.addDomListener(document,'closePopups',function(evt){t.triggerClusterLeave(evt);});};ClusterIcon.prototype.getPosFromLatLng_=function(latlng){var pos=this.getProjection().fromLatLngToDivPixel(latlng);pos.x-=parseInt(this.width_/2,10);pos.y-=parseInt(this.height_/2,10);return pos;};ClusterIcon.prototype.draw=function(){if(this.visible_){var pos=this.getPosFromLatLng_(this.center_);this.div_.style.top=pos.y+'px';this.div_.style.left=pos.x+'px';}};ClusterIcon.prototype.hide=function(){if(this.div_){this.div_.style.display='none';}
440this.visible_=false;};ClusterIcon.prototype.show=function(){if(this.div_){var pos=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(pos);this.div_.style.display='';}
441this.visible_=true;};ClusterIcon.prototype.remove=function(){this.setMap(null);};ClusterIcon.prototype.onRemove=function(){if(this.div_&&this.div_.parentNode){this.hide();this.div_.parentNode.removeChild(this.div_);this.div_=null;}};ClusterIcon.prototype.setSums=function(sums){this.sums_=sums;this.text_=sums.text;this.index_=sums.index;if(this.div_){this.div_.innerHTML=sums.text;}
442this.useStyle();};ClusterIcon.prototype.useStyle=function(){var index=Math.max(0,this.sums_.index-1);index=Math.min(this.styles_.length-1,index);var style=this.styles_[index];this.url_=style['url'];this.height_=style['height'];this.width_=style['width'];this.textColor_=style['textColor'];this.anchor_=style['anchor'];this.textSize_=style['textSize'];this.backgroundPosition_=style['backgroundPosition'];};ClusterIcon.prototype.setCenter=function(center){this.center_=center;};ClusterIcon.prototype.createCss=function(pos){var style=[];style.push('background-image:url('+this.url_+');');var backgroundPosition=this.backgroundPosition_?this.backgroundPosition_:'0 0';style.push('background-position:'+backgroundPosition+';');if(typeof this.anchor_==='object'){if(typeof this.anchor_[0]==='number'&&this.anchor_[0]>0&&this.anchor_[0]<this.height_){style.push('height:'+(this.height_-this.anchor_[0])+'px; padding-top:'+this.anchor_[0]+'px;');}else{style.push('height:'+this.height_+'px; line-height:'+this.height_+'px;');}
443if(typeof this.anchor_[1]==='number'&&this.anchor_[1]>0&&this.anchor_[1]<this.width_){style.push('width:'+(this.width_-this.anchor_[1])+'px; padding-left:'+this.anchor_[1]+'px;');}else{style.push('width:'+this.width_+'px; text-align:center;');}}else{style.push('height:'+this.height_+'px; line-height:'+
444this.height_+'px; width:'+this.width_+'px; text-align:center;');}
445var txtColor=this.textColor_?this.textColor_:'black';var txtSize=this.textSize_?this.textSize_:11;style.push('cursor:pointer; top:'+pos.y+'px; left:'+
446pos.x+'px; color:'+txtColor+'; position:absolute; font-size:'+
447txtSize+'px; font-family:Arial,sans-serif; font-weight:bold; z-index:1');return style.join('');};
448/* jquery-cookie */ 
449(function($){$.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
450var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
451expires='; expires='+date.toUTCString();}
452var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
453return cookieValue;}};})(jQuery);
454/* prov-map */ 
455function ymaps_loaded(){mapEngine.loaded('yandex');}
456function mmap(){'use strict';var t=this,$=jQuery,mode=window.Debug_Site?'mode=debug&':'';t['default']=false;t.providers={google:{name:"Google",id:"google",url:["http://maps.google.com/maps/api/js?language=ru&callback=mapEngine.loadedgoogle&key=AIzaSyBfL8fkRdMcIibqmKppdgXKOvkqrN-BN4M",'http://www.google.com/jsapi'],loaded:false,callbacks:[],api:false,getApi:function(pro){if(this.api)
457return this.api;return this.api=$.extend({},google.maps);},Coord:function(lat,lon){return new google.maps.LatLng(lat,lon);},getCenter:function(map){return map.getCenter();},getEventName:function(nm){return nm;},formatBounds:function(t){return t.toUrlValue();},myDrawKml:function(kml,map,args,cbs){var opts={strokeColor:"#ff0000",strokeOpacity:0.7,strokeWeight:3,},g=this.api,pls=[];$.get(ajaxurl,{action:'get_kml_points',kml:kml},function(ret){try{var i,points=eval('('+ret+')');}catch(e){c_log('eval error: '+e.description+' cause: '+ret);}
458if(points)
459while(l=points.shift()){var b,p,l,pl,path;pls.push(pl=new google.maps.Polyline(opts));for(var i in cbs){google.maps.event.addListener(pl,i,cbs[i]);}
460path=pl.getPath();while(p=l.shift()){p=new g.LatLng(p[0],p[1]);path.push(p);if(!args.preserveViewport){if(!b)
461b=new g.LatLngBounds(p,p);else
462b.extend(p);}}}
463c_log('draw KML by hand='+s);if(!args.preserveViewport&&b&&map){map.fitBounds(b);}
464if(map)pl.setMap(map);});return pls;},drawKML:function(kml,args,cbs){args.suppressInfoWindows=true;var t=this,loaded=false,g=t.api,k=new g.KmlLayer(kml,args),pls,map=k.getMap();google.maps.event.addListener(k,'status_changed',function(e){loaded=true;var s=k.getStatus();c_log('google KML status='+s);if(s!=google.maps.KmlLayerStatus.OK){pls=t.myDrawKml(kml,map,args,cbs);}});for(var i in cbs){google.maps.event.addListener(k,i,cbs[i]);}
465setTimeout(function(){if(!loaded){if(k.getStatus()!=google.maps.KmlLayerStatus.OK)
466pls=t.myDrawKml(kml,map,args);}},5000);var x=$.extend({},k,{setMap:function(m){map=m;if(pls){for(var i in pls)
467pls[i].setMap(m);}else
468k.setMap(m);},getMap:function(){return map;},});return x;},getMarkImage:function(c,t){var pinImage;if(!c)c="#ff8080";if(!t)t="   ";return pinImage=new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld="+t+"|"+c.replace('#',''),new google.maps.Size(21,34),new google.maps.Point(0,0),new google.maps.Point(10,34));},createMarker:function(m,cbs){var options={map:m.map,position:m.loc,};if(m.title)
469options.title=m.title;if(m.icon)
470options.icon=m.icon;else if(m.shape){var ss=m.shape.split(',');if((!ss[0]||ss[0]=="#ff8080")&&(!ss[1]||ss[1]=="   ")){}else
471options.icon=this.getMarkImage(ss[0],ss[1]);}else if((!m.color||m.color=="#ff8080")&&(!m.label||m.label=="   ")){}else
472options.icon=this.getMarkImage(m.color,m.label.substring(0,2));var marker=new google.maps.Marker(options);for(var i in cbs)
473(function(cb,k){google.maps.event.addListener(marker,k,function(e){var ee=$.extend({preventDefault:function(){},stopPropagation:e.stop,},e);cb(ee,marker);});})(cbs[i],i);return marker;},createObjMarker:function(m,cbs){var options={position:m.loc,optimized:false,};if(m.title)
474options.title=m.title;if(m.map)
475options.map=m.map;if(m.draggable)
476options.draggable=m.draggable;if(m.icon){var icon=new google.maps.MarkerImage(m.icon,new google.maps.Size(16,16),new google.maps.Point(0,0),new google.maps.Point(8,16),new google.maps.Size(16,16));options.icon=icon;if(m.rate){options.zIndex=100+(m.rate||0)-0;}else{options.zIndex=10;}}
477var marker=new google.maps.Marker(options);for(var i in cbs)
478(function(cb,k){google.maps.event.addListener(marker,k,function(e){var ee=$.extend({preventDefault:function(){},stopPropagation:e.stop,},e);cb(ee,marker);});})(cbs[i],i);return marker;},findIcon:function(evt,el,src){var trg,img;if(evt.b){trg=$(evt.b.target).parent();img=$('img',trg);}else{$(' img',el).each(function(){if($(this).attr('src')==src){img=$(this);trg=img.parent();}});}
479return{img:img,trg:trg};},createMap:function(latlng,el,opt,cbs){var o={};if(opt.navigationControl){var st=opt.navigationControlOptions&&opt.navigationControlOptions.style;if(st)
480o.navigationControlOptions={style:google.maps.NavigationControlStyle[st]};}
481if(opt.mapTypeControl&&opt.mapTypeControlOptions){o.mapTypeControlOptions={mapTypeIds:[google.maps.MapTypeId.ROADMAP,google.maps.MapTypeId.TERRAIN,google.maps.MapTypeId.SATELLITE,google.maps.MapTypeId.HYBRID,'osm'],style:google.maps.MapTypeControlStyle[opt.mapTypeControlOptions.style||'DROPDOWN']};}
482opt=$.extend({},opt,o);opt.center=latlng;opt.streetViewControl=false;var osm=new google.maps.ImageMapType({getTileUrl:function(ll,z){var X=ll.x%(1<<z);return"http://tile.openstreetmap.org/"+z+"/"+X+"/"+ll.y+".png";},tileSize:new google.maps.Size(256,256),isPng:true,maxZoom:18,name:"OSM",alt:"Open Street Map",gestureHandling:"greedy"});var map=new google.maps.Map(el,opt);if(cbs){for(var i in cbs)
483google.maps.event.addListener(map,i,cbs[i]);}
484map.mapTypes.set('osm',osm);map.setOptions({mapTypeId:opt.mapTypeId.toLowerCase()||'roadmap'});return map;},getMapType:function(){t.map.getMapTypeId();},MarkerClusterer:window.MarkerClusterer,clusterEvents:function(clusterer,cbs){for(var i in cbs)
485google.maps.event.addListener(clusterer,i,cbs[i]);},hideClusterTitle:function(c){$(c.clusterIcon_.div_).removeAttr('title').removeAttr('_title');},resizeMap:function(map){google.maps.event.trigger(map,"resize");},controls:function(param,t){var G=t.prov.getApi();if(param.close_control&&param.onClose){var closeControlDiv=document.createElement("DIV"),closeControl=new CloseControl(G,closeControlDiv,param.titleClose,function(){if(param.maximized)
486tb_remove();if(typeof(param.onClose)=='function')
487param.onClose();else{try{eval(param.onClose+'();');}catch(e){c_log('eval error: '+e.description+' cause: '+param.onClose);}}});closeControlDiv.index=-1;t.map.controls[G.ControlPosition.TOP_RIGHT].push(closeControlDiv);}
488if(param.size_control){var resizeControlDiv=document.createElement("DIV"),resizeControl=new ResizeControl(G,resizeControlDiv,t.map,t.el.parentNode,function(){G.event.trigger(t.map,'resize');},param.txt_resize||gmap.txt_resize);resizeControlDiv.index=-1;t.map.controls[G.ControlPosition.RIGHT_BOTTOM].push(resizeControlDiv);if(param.size_control_mode)
489resizeControl.mode=param.size_control_mode;if(param.maximized)
490resizeControlDiv.style.display='none';}
491if(param.max_control){var homeControlDiv=document.createElement("DIV"),homeControl=new MaxControl(G,homeControlDiv,t.map,t.el.parentNode,param.title,param.titleFullscreen||gmap.titleFullscreen,function(v){param.maximized=v;if(v){if(param.in_popup)
492cd_ab_closePopup();t.in_popup=param.in_popup;param.in_popup=false;}else
493param.in_popup=t.in_popup;if(param.close_control&&param.onClose)
494closeControlDiv.style.display=v?'none':'block';if(param.size_control){resizeControlDiv.style.display=v?'none':'block';}});homeControlDiv.index=-1;t.map.controls[G.ControlPosition.TOP_RIGHT].push(homeControlDiv);if(param.maximized)
495homeControlDiv.style.display='none';}
496var c=0;for(var tag in param.ajax_map_bounds)
497c++;if(c>2){var html='<ul id="mapModeControl" style="display:none; padding: 0 6px; border-top: 1px solid #999; clear: both;">';for(var tag in param.ajax_map_bounds){var el=param.ajax_map_bounds[tag];if(!el.title)
498continue;var checked=el.on?'checked="checked" ':'';html+='<li><input type="checkbox" '+checked+'value="'+tag+'" />'+el.title+'</li>';}
499html+='</ul>';var modeControlDiv=document.createElement("DIV"),mapMenu,controlPad=document.createElement("DIV");var modeControl=new ModeControl(G,modeControlDiv,controlPad,gmap.modeText||param.modeText,gmap.modeTitle||param.modeTitle,function(e){if(!mapMenu.is(":visible")){mapMenu.slideDown();setTimeout(function(){if(t.el)
500G.event.addDomListener(t.el,"click",function(e){if(mapMenu.is(":visible")&&$(modeControlDiv).has(e.target).length==0)
501mapMenu.slideUp();});else c_log('t.el is empty!');},10);return false;}else
502mapMenu.slideUp();});$(controlPad).append(mapMenu=$(html));mapMenu.on('click','li',function(e){var chk=$('input',this),tag=chk.val(),sel=param.ajax_map_bounds[tag],on=chk[0].checked;if(!sel.on!=!on){t.p.showModeChanged(tag,on);}
503e.stopPropagation();});t.map.controls[G.ControlPosition.TOP_LEFT].push(modeControlDiv);}
504if(param.link_control&&t.p.showLinkDialog){var linkControlDiv=document.createElement("DIV"),linkPad=document.createElement("DIV"),$lp,closePad=function(e){e.stopPropagation();$lp.slideUp();},ls=linkControlDiv.style;linkPad.style.padding='5px';linkPad.style.display='none';ls.background='#fff';ls.overflow="hidden";
504ls.boxShadow="0 2px 4px rgba(0, 0, 0, 0.4)";ls.borderRadius="4px";var linkControl=new LinkControl(G,linkControlDiv,param.titleLink||gmap.titleLink,function(){if(!$lp.is(":visible")){$lp.html(t.p.showLinkDialog());$lp.slideDown();setTimeout(function(){if(t.el)
505G.event.addDomListener(t.el,"click",function(e){if($lp.is(":visible")&&$(linkControlDiv).has(e.target).length==0)
506$lp.slideUp();});else c_log('t.el is empty 2!');},10);return false;}else $lp.slideUp();});$(linkControlDiv).append($lp=$(linkPad));$lp.on('click','.close',closePad);linkControlDiv.index=-1;t.map.controls[G.ControlPosition.RIGHT_TOP].push(linkControlDiv);}
507if(!param.no_line&&t.p&&t.p.showLineDialog){var lineControlDiv=document.createElement("DIV"),linePad=document.createElement("DIV"),lp,closeLine=function(e){e.stopPropagation();lp.slideUp();t.p.lineDrawEnable(0);},ls=lineControlDiv.style;linePad.style.padding='5px';linePad.style.display='none';ls.background='#fff';ls.overflow="hidden";ls.boxShadow="0 2px 4px rgba(0, 0, 0, 0.4)";ls.borderRadius="4px";var lineControl=new LineControl(G,lineControlDiv,param.titleLineDlg||gmap.titleLineDlg,function(){if(!lp.is(":visible")){if($('#lineDraw',lp).length){lp.slideDown();t.p.lineDrawEnable(1);}else{lp.html(t.p.showLineDialog());var data={'action':'map-line-draw',uid:ykoctpa.id,'_ajax_nonce':gmap.nonce,};getScript(["/wp-p/bp-user-profile-map/js/linedraw.js"],function(arg,tag){c_log('script loaded!');t.p.lineDrawEnable(1);});$('.pad',lp).load('/wp-ax.php',data,function(){lp.slideDown();});}
508return false;}else{lp.slideUp();t.p.lineDrawEnable(0);}});$(lineControlDiv).append(lp=$(linePad));lp.on('click','.close',closeLine);lineControlDiv.index=-1;t.map.controls[G.ControlPosition.RIGHT_TOP].push(lineControlDiv);}
509if(param.dlButton){var dl=document.createElement("DIV"),ds=dl.style;ds.background='#fff';ds.overflow="hidden";ds.boxShadow="0 2px 4px rgba(0, 0, 0, 0.4)";ds.borderRadius="4px";ds.margin="5px";dl.innerHTML=param.dlButton;t.map.controls[G.ControlPosition.RIGHT_TOP].push(dl);}},clientLocation:function(){var g=google.maps;if(google.loader&&google.loader.ClientLocation)
510return new g.LatLng(google.loader.ClientLocation.latitude,google.loader.ClientLocation.longitude);if(window.userCoords&&userCoords.lat)
511return new g.LatLng(userCoords.lat,userCoords.lon);if(window.parent&&parent.userCoords&&parent.userCoords.lat)
512return new g.LatLng(parent.userCoords.lat,parent.userCoords.lon);return new g.LatLng(55.752,37.612);},drawPolyLine:function(map,options,points,cbs){var pl=new google.maps.Polyline(options),p;pl.setMap(map);var path=pl.getPath();while(p=points.shift())
513path.push(p);for(var i in cbs)
514(function(cb,k){google.maps.event.addListener(pl,k,function(e){var ee=$.extend({preventDefault:function(){},stopPropagation:e.stop,},e);cb(ee,pl);});})(cbs[i],i);return pl;},drawPolygon:function(map,options,points,cbs){var pl=new google.maps.Polygon(options),p,i;pl.setMap(map);var path=pl.getPath();while(p=points.shift())
515path.push(p);for(i in cbs)
516(function(cb,k){google.maps.event.addListener(pl,k,function(e){switch(k){case'mouseover':options.fillOpacity=options.strokeOpacity/2;pl.setOptions(options);break;case'mouseout':options.fillOpacity=options.strokeOpacity/10;pl.setOptions(options);break;}
517var ee=$.extend({preventDefault:function(){},stopPropagation:e.stop,},e);cb(ee,pl);});})(cbs[i],i);return pl;},adjustBorders:function(param){var count=0;$('#'+param.element_id+'google div[style*="z-index: 103"] > div:not(.bmarker) > img').each(function(idx,el){var src=this.src;if(src&&src.indexOf('ykoctpa')!==-1)
518$(this).parent().addClass('bmarker');count++;});},},yandex:{name:"Yandex",id:"yandex",url:["http://api-maps.yandex.ru/2.0-stable/?load=package.full,package.geoXml&lang=ru-RU&"+mode+"onload=ymaps_loaded&key=AFa_PlEBAAAA_feebAIAzhkr6DF4CTIxGyLjjgxps3E2A8AAAAAAAAAAAADbq5liO8HSpMwA0oL8rNACj_c2Ew=="],loaded:false,callbacks:[],api:false,getApi:function(pro){var G,prov=this;if(prov.api)
519return prov.api;var v=G=prov.api=$.extend({},ymaps,{LatLng:function(lat,lng){var t=this;this.nm="LatLng";if(!lat)
520var x=lat;else if(typeof(lat)=='object'){this[0]=lat[0];this[1]=lat[1];}else{this[0]=lat;this[1]=lng;}
521this.length=2;this.toString=function(){return'('+t[0]+', '+t[1]+')';};this.lat=function(){return this[0];};this.lng=function(){return this[1];};this.slice=function(){return new G.LatLng(t);};this.equals=function(ll){return(t[0]==ll[0]&&t[1]==ll[1]);};this.a=function(){return[this[0],this[1]];};this.toUrlValue=function(){return t[0]+', '+t[1];}},Size:function(a,b){this[0]=a;this[1]=b;this.length=2;},Point:function(a,b){this[0]=-a;this[1]=-b;this.length=2;},MarkerImage:function(url,size,p1,p2){this.url=url;this.size=size;this.p1=p1;this.p2=p2;},Marker:function(opt,pm){var t=this;if(opt){var o={hintContent:opt.title};if(opt.draggable)
522o.draggable=true;if(opt.icon){o.iconImageHref=opt.icon.url;o.iconImageSize=opt.icon.size;o.iconImageOffset=opt.icon.p2;}
523t.Placemark=new ymaps.GeoObject({geometry:{type:"Point",coordinates:opt.position},properties:{hintContent:opt.title}},o);if(opt.map){opt.map.geoObjects.add(t.Placemark);t.map=opt.map;}
524t.events=t.Placemark.events;}else if(pm){t.Placemark=pm;t.events=pm.events;}
525t.setVisible=function(vis){if(vis){t.map.geoObjects.add(this.Placemark);}else{t.map.geoObjects.remove(this.Placemark);}};t.getMap=function(){return t.map;};t.setMap=function(m){if(m){m.geoObjects.add(this.Placemark);}else{var map=this.Placemark.getMap();if(map)
526map.geoObjects.remove(this.Placemark);}};t.getPosition=function(){return new G.LatLng(t.Placemark.geometry.getCoordinates());};
526t.setPosition=function(ll){t.Placemark.geometry.setCoordinates(ll.a?ll.a():ll);};t.setIcon=function(icon){t.Placemark.options.set('iconImageHref',icon.url);t.Placemark.options.set('iconImageSize',icon.size);t.Placemark.options.set('iconImageOffset',icon.p2);};},InfoWindow:function(data){var t=this;if(data)
527t.content=data.content;t.setContent=function(c){t.content=c;};t.open=function(map,marker){if(!t.baloon){t.balloon=new ymaps.Balloon(map);t.balloon.options.setParent(map.options);}
528t.balloon.setData({content:t.content});t.balloon.open(marker.geometry.getCoordinates());};},OverlayView:function(){},LatLngBounds:function(ll1,ll2){var t=this,ne=1,sw=0;;t.extend=function(ll){var t=this,lat=parseFloat(ll[0]),lon=parseFloat(ll[1]);if(!t[ne])
529t[ne]=[lat,lon];if(!t[sw])
530t[sw]=[lat,lon];if(lat>t[ne][0])
531t[ne][0]=lat;else if(lat<t[sw][0])
532t[sw][0]=lat;if(lon>t[ne][1])
533t[ne][1]=lon;else if(lon<t[sw][1])
534t[sw][1]=lon;};t.equals=function(b){return t[ne][0]==b[ne][0]&&t[ne][1]==b[ne][1]&&t[sw][0]==b[sw][0]&&t[sw][1]==b[sw][1];};t.contains=function(b){return t[ne][0]>=b[0]&&t[ne][1]>=b[1]&&t[sw][0]<=b[0]&&t[sw][1]<=b[1];};t.getNorthEast=function(){return new G.LatLng(t[ne][0],t[ne][1]);};t.getSouthWest=function(){return new G.LatLng(t[sw][0],t[sw][1]);};t[0]=t[1]=null;if(ll1)
535t.extend(ll1);if(ll2)
536t.extend(ll2);},Geocoder:function(){var t=this;t.geocode=function(data,cb){var addr;if(addr=data.address){var gk=ymaps.geocode(addr,{json:false});gk.then(function(res){if(res.geoObjects.getLength()){var obj=res.geoObjects.get(0);var arg=[{geometry:{location:new G.LatLng(obj.geometry.getCoordinates())}}];cb(arg,0);}else{cb([],0);}},function(err){cb([],err);});}else if(data.latLng){var ll=data.latLng,gk=ymaps.geocode([ll[0],ll[1]],{json:true});gk.then(function(res){if(res.GeoObjectCollection.featureMember.length){var obj=res.GeoObjectCollection.featureMember[0].GeoObject,desc=obj.description||'',adesc=desc.split(',').reverse(),arg=[{formatted_address:adesc.join(',')+','+obj.name}];cb(arg,0);}else{cb([],0);}},function(err){cb([],err);});}};},Polyline:function(options){var t=this;options.draggable=false;options.strokeWidth=options.strokeWeight;options.interactivityModel='default#transparent';t.options=options;t.pl=new ymaps.Polyline([],{},options);t.setMap=function(map){if(map)
537map.geoObjects.add(t.pl);else if(t.map)
538t.map.geoObjects.remove(t.pl)
539t.map=map;};t.getMap=function(){return t.map;};t.setOptions=function(o){o.draggable=false;o.strokeWidth=options.strokeWeight;t.pl.options.set(o);t.options=o;};t.getPath=function(){return{push:function(e){var g=t.pl.geometry;g.set(g.getLength(),e.a?e.a():e);},pop:function(){var g=t.pl.geometry,i=g.getLength()-1,p=g.get(i);g.remove(i);return new G.LatLng(p);},getAt:function(i){if(i<0)return null;return new G.LatLng(t.pl.geometry.get(i));},setAt:function(i,d){t.pl.geometry.set(i,d.a?d.a():d);},removeAt:function(i){t.pl.geometry.remove(i);},insertAt:function(i,d){t.pl.geometry.insert(i,d.a?d.a():d);},getLength:function(){return t.pl.geometry.getLength();},};};t.events=t.pl.events;},Polygon:function(options){var t=this,points=[];options.draggable=false;options.strokeWidth=options.strokeWeight;options.interactivityModel='default#transparent';t.options=options;t.pl=new ymaps.Polygon([[]],{},options);t.setMap=function(map){if(map)
540map.geoObjects.add(t.pl);else if(t.map)
541t.map.geoObjects.remove(t.pl);t.map=map;};t.getMap=function(){return t.map;};t.setOptions=function(o){o.draggable=false;o.strokeWidth=options.strokeWeight;t.pl.options.set(o);t.options=o;};t.getPath=function(){return{push:function(e){var gg=t.pl.geometry;points.push(e.a?e.a():e);gg.set(0,points.slice(0));},pop:function(){var g=t.pl.geometry,p=points.pop();g.set(0,points.slice(0));return new G.LatLng(p);},getAt:function(i){if(i<0)return null;return new G.LatLng(points[i]);},setAt:function(i,d){var gg=t.pl.geometry;points[i]=(d.a?d.a():d);gg.set(0,points.slice(0));},removeAt:function(i){var gg=t.pl.geometry;points.splice(i,1);gg.set(0,points.slice(0));},insertAt:function(i,d){var gg=t.pl.geometry;points.splice(i,0,d.a?d.a():d);gg.set(0,points.slice(0));},getLength:function(){return points.length;},};};t.events=t.pl.events;},KmlLayer:function(kml,options){var t=this;$.get(ajaxurl,{action:'get_kml_points',kml:kml},function(ret){try{var i,points=eval('('+ret+')');}catch(e){c_log('eval error: '+e.description+' cause: '+ret);}
542t.pl=new ymaps.GeoObjectCollection();for(var k in points){var a=points[k];t.pl.add(new ymaps.Polyline(a,{hint:kml},{strokeColor:"#ff0000",strokeWidth:3,strokeOpacity:0.7}));}
543if(t.map){t.map.geoObjects.add(t.pl);if(!options.preserveViewport){var b=t.pl.getBounds();if(b)
544t.map.fitBounds(b);}}});t.setMap=function(map){if(t.obj){if(t.map)
545map.geoObjects.add(t.obj);else
546t.map.geoObjects.remove(t.obj);}else if(t.pl){if(map)
547map.geoObjects.add(t.pl);else{var m=t.pl.getMap();m.geoObjects.remove(t.pl);}}
548t.map=map;};},});v.GeocoderStatus={OK:0,};v.MapTypeId={HYBRID:'hybrid',SATELLITE:'satellite',TERRAIN:'map',ROADMAP:'map',};v.LatLng.prototype=[];v.Marker.MAX_ZINDEX=150000;v.Map.prototype.fitBounds=function(llb){this.setBounds(llb);};v.Map.prototype.getMapTypeId=function(){switch(this.getType()){case'yandex#map':case'yandex#publicMap':return'roadmap';break;case'yandex#satellite':return'satellite';break;case'yandex#hybrid':case'yandex#publicMapHybrid':return'hybrid';break;default:return'roadmap';break;}};v.Map.prototype.dv_getBounds=v.Map.prototype.getBounds;v.Map.prototype.getBounds=function(){var b=v.Map.prototype.dv_getBounds.call(this);return new v.LatLngBounds(b[0],b[1]);}
549v.event.addListener=function(target,name,cb){if(target.events)
550target.events.add(prov.translate(name),function(e){var p;try{p=e.get('coordPosition');}catch(e){}
551if(p)
552e.latLng=new G.LatLng(p);cb(e);});else
553c_log('no events in '+target);};v.event.addListenerOnce=function(target,name,cb){var nm=prov.translate(name),my_cb=function(e){target.events.remove(nm,my_cb);var p=e.get('coordPosition');if(p)
554e.latLng=new G.LatLng(p);cb(e);};target.events.add(nm,my_cb);};v.event.addDomListener=function(target,name,cb){jQuery(target).bind(name,cb);};v.event.removeListener=function(target,name){if(target.events)
555target.events.remove(prov.translate(name));};return v;},formatBounds:function(t){return''+t[0][0]+','+t[0][1]+','+t[1][0]+','+t[1][1];},Coord:function(lat,lon){return[lat,lon];},drawKML:function(kml,args){var g=this.api;return new g.KmlLayer(kml,args);},getCenter:function(map){return new this.api.LatLng(map.getCenter());},getEventName:function(nm){switch(nm){case'bounds_changed':return'boundschange';default:return nm;}},getMarkImage:function(c,t){var pinImage;if(!c)c="#ff8080";if(!t)t="   ";return pinImage="http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld="+t+"|"+c.replace('#','');},createMarker:function(m,cbs){var opt={};if(m.title)
556opt.hintContent=m.title;var icon,sz,off;if(m.icon){icon=m.icon;sz=[16,16];off=[-8,-8];}else if(m.shape){var ss=m.shape.split(',');icon=this.getMarkImage(ss[0],ss[1]);sz=[21,34];off=[-10,-34];}else if(m.color||m.label){icon=this.getMarkImage(m.color,m.label);sz=[21,34];off=[-10,-34];}
557if(icon){var mk=new ymaps.Placemark(m.loc,opt,{iconImageHref:icon,iconImageSize:sz,iconImageOffset:off});}else
558var mk=new ymaps.Placemark(m.loc,opt);m.map.geoObjects.add(mk);for(var i in cbs){var j=this.translate(i);mk.events.add(j,function(e){cbs[i](e,mk);});}
559var g=this.api,gm=new g.Marker(false,mk);$.extend(gm,mk);return gm;},createObjMarker:function(m,cbs){var opt={},opt2={};if(m.title)
560opt.hint=m.title;if(m.draggable)
561opt2.draggable=m.draggable;if(m.icon){if(m.rate){opt.zIndex=100+(m.rate||0)-0;}else{opt.zIndex=10;}
562opt2.iconImageHref=m.icon;opt2.iconImageSize=[16,16];opt2.iconImageOffset=[-8,-8];}
563var mk=new ymaps.Placemark(m.loc,opt,opt2),g=this.api,gm=new g.Marker(false,mk);$.extend(gm,mk);if(m.map)
564m.map.geoObjects.add(mk);for(var i in cbs){(function(cb,j){mk.events.add(j,function(e){cb(e,gm);});})(cbs[i],this.translate(i));}
565return gm;},findIcon:function(evt,el,src){var trg,img;trg=evt.originalEvent.domEvent.originalEvent.target;if(trg){img=$(trg.parentNode);trg=$(trg);}else{$(' ymaps.ymaps-image-with-content-content',el).each(function(){if(this.style.backgroundImage.indexOf(src)!=-1){img=$(this);trg=img.parent();}});}
566return{img:img,trg:trg};},translate:function(evt,is_touch){if(is_touch)
567var events={mouseover:'click',mouseout:'mouseleave',clusterhover:'click',clusterleave:'mouseleave',clusterclick:'dblclick',rightclick:'contextmenu',center_changed:'boundschange',};else
568var events={mouseover:'mouseenter',mouseout:'mouseleave',clusterhover:'mouseenter',clusterleave:'mouseleave',clusterclick:'click',rightclick:'contextmenu',center_changed:'boundschange',};if(events[evt])
569return events[evt];return evt;},createMap:function(latlng,el,opt,cbs){var o={},x={yandexMapAutoSwitch:false};var type=opt.mapTypeId.toLowerCase();switch(type){case'roadmap':case'terrain':o.type='yandex#map';break;default:o.type=type?'yandex#'+type:'yandex#map';}
570o.zoom=opt.zoom;o.center=[latlng[0],latlng[1]];o.streetViewControl=false;var g=this.getApi(),map=new g.Map(el,o,x);map.behaviors.enable('scrollZoom');if(opt.disableDoubleClickZoom)
571map.behaviors.disable('dblClickZoom');map.dv_getBounds=map.getBounds;map.getBounds=function(){var b=map.dv_getBounds.call(map);return new g.LatLngBounds(b[0],b[1]);}
572if(cbs){for(var i in cbs){(function(cb,m){if(m)
573map.events.add(m,function(e){try{if(e)
574e.originalEvent.target.latLng=new G.LatLng(e.get('coordPosition'));cb(e.originalEvent.target,e);}catch(e){}});})(cbs[i],this.translate(i));}}
575return map;},MarkerClusterer:function(G,map,opt_markers,opt){var t=this;var clusterIcons=[],sizes=[38,45,53,61,69,77,85,92],path='/wp-t/map/img/m',ext='png',clusterNumbers=[];for(var i=0,size;size=sizes[i];i++){clusterIcons.push({href:path+(i+1)+'.'+ext,size:[size,size],offset:[-size/2,-size/2]});if(i>0)
576clusterNumbers.push(Math.pow(3,i));}
577var MyIconContentLayout=ymaps.templateLayoutFactory.createClass('<div style="color: #000; font-weight: bold;">$[properties.geoObjects.length]</div>');t.y_clus=new ymaps.Clusterer({maxZoom:16,gridSize:32,zoomMargin:32,clusterIcons:clusterIcons,clusterNumbers:clusterNumbers,clusterIconContentLayout:MyIconContentLayout,clusterOpenBalloonOnClick:false,});map.geoObjects.add(t.y_clus);t.addMarkers=function(m){this.y_clus.add(m);};t.removeMarkers=function(m){var i,a=[];for(i in m){m[i].is_visible=false;m[i].events.fire('visibilityChanged',{target:m[i]});a.push(m[i]);}
578this.y_clus.remove(a);};t.addMarker=function(m){this.y_clus.add(m);t.y_markers.push(m);};t.getVisible=function(point){var s=this.y_clus.getObjectState(point);return s.isShown&&!s.isClustered;};t.resetViewport=function(){};t.redraw=function(){this.y_clus.refresh();};t.repaint=function(){this.y_clus.refresh();};t.y_clus.events.add('objectsaddtomap',function(e){var p,it=t.y_clus.getIterator();while(p=it.getNext()){var v=t.getVisible(p),l=p.is_visible;if(!v!=!l){c_log('visibilityChanged yandex marker='+p);p.is_visible=v;p.events.fire('visibilityChanged',{target:p});}}});},clusterEvents:function(clusterer,cbs,is_touch){var p=this;clusterer.y_clus.createCluster=function(center,geoObjects){var i,cluster=ymaps.Clusterer.prototype.createCluster.call(this,center,geoObjects);for(i in cbs){(function(cb,m){cluster.events.add(m,function(e){cb(e.originalEvent.target,e);});})(cbs[i],p.translate(i,is_touch));}
579cluster.getMarkers=cluster.getGeoObjects;return cluster;};},hideClusterTitle:function(c){},resizeMap:function(map){if(map)
580map.container.fitToViewport();},controls:function(param,t){var cbClose,closeControlDiv,resizeControlDiv,maxControlDiv,linkControlDiv,lineControlDiv,pos=5,step=29;if(param.close_control&&(cbClose=param.onClose)){var b=new ymaps.control.Button({data:{content:'<div id="ymap-close"></div>
580',image:'/wp-t/_inc/images/closead.jpg',title:param.titleClose}},{selectOnClick:false});b.events.add('click',function(){closeControlDiv=I('ymap-close');if(param.maximized)
581tb_remove();if(typeof(cbClose)=='function')
582cbClose();else{try{eval(cbClose+'();');}catch(e){c_log('eval error: '+e.description+' cause: '+cbClose);}}});t.map.controls.add(b,{top:5,right:pos});pos+=step;}
583if(param.size_control){resizeControlDiv=document.createElement("DIV");var resizeControl=new yResizeControl(this.getApi(),resizeControlDiv,t.map,t.el.parentNode,function(){t.map.container.fitToViewport();},param.txt_resize||gmap.txt_resize);resizeControlDiv.index=-1;t.el.appendChild(resizeControlDiv);if(param.size_control_mode)
584resizeControl.mode=param.size_control_mode;if(param.maximized)
585resizeControlDiv.style.display='none';}
586if(param.max_control){var b=new ymaps.control.Button({data:{content:'<div id="ymaps_max"></div>',image:'/wp-t/_inc/images/fullscr.png',title:param.titleFullscreen||gmap.titleFullscreen}},{selectOnClick:false});b.events.add('click',function(){var el=t.el.parentNode,maxBtn;cb=function(v){param.maximized=v;if(param.in_popup)
587try{t.mPopup.close();}catch(e){}
588if(v){t.in_popup=param.in_popup;param.in_popup=false;}else
589param.in_popup=t.in_popup;if(param.close_control&&param.onClose){var closeBtn=$('#ymap-close',t.el).parent().parent().parent().parent().parent().parent().parent().parent();v?closeBtn.hide():closeBtn.show();}
590if(param.size_control){var sizeBtn=$(resizeControlDiv).parent().parent().parent().parent().parent().parent().parent().parent();v?sizeBtn.hide():sizeBtn.show();}},div=$('#ymaps_max',t.el),center=t.map.getCenter();tb_show(param.title,'#TB_inline?inlineId='+el.id+'&modal=false',false,function(id,v){maxBtn=$(div).parent().parent().parent().parent().parent().parent().parent().parent();if(maxBtn){if(v)
591maxBtn.hide();else
592maxBtn.show();}
593if(v)
594el.className+=' fullscreen-map';else
595el.className=el.className.replace('fullscreen-map','');center=t.map.getCenter();t.map.container.fitToViewport();if(v&&param.in_popup)
596cd_ab_closePopup();if(center)
597t.map.setCenter(center);if(cb)cb(v);});});t.map.controls.add(b,{top:5,right:pos});if(param.maximized)
598b.hide();pos+=step;}
599var opt=param.map_options;if(opt.scaleControl)
600t.map.controls.add('scaleLine');if(opt.navigationControl){var st=opt.navigationControlOptions&&opt.navigationControlOptions.style;if(st)
601st=st.toLowerCase();switch(st){case'none':break;case'small':t.map.controls.add('smallZoomControl',{top:5});break;case'pan':default:t.map.controls.add('mapTools');t.map.controls.add('zoomControl');}}
602if(opt.mapTypeControl)
603t.map.controls.add('typeSelector',{top:5,right:pos});var c=0;for(var tag in param.ajax_map_bounds)
604c++;if(c>2){var listBoxItems=[];for(var tag in param.ajax_map_bounds){var el=param.ajax_map_bounds[tag];if(!el.title)
605continue;var i=new ymaps.control.ListBoxItem({data:{content:el.title,tag:tag,}});i.state.set('selected',el.on);listBoxItems.push(i);}
606var listBox=new ymaps.control.ListBox({items:listBoxItems,data:{title:gmap.modeText||param.modeText}});listBox.events.add('click',function(e){var item=e.get('target');if(item!=listBox){var tag=item.data.get('tag'),sel=param.ajax_map_bounds[tag],on=item.state.get('selected');item.state.set('selected',on=!on);if(!sel.on!=!on){t.p.showModeChanged(tag,on);}}});t.map.controls.add(listBox,{left:35,top:5});}
607if(param.link_control&&t.p.showLinkDialog){var b=new ymaps.control.Button({data:{content:'<div id="ymap-link"></div>',image:'/wp-t/_inc/images/link16.png',title:param.titleLink||gmap.titleLink}},{selectOnClick:false}),linkPad=document.createElement("DIV"),$lp,closePad=function(e){e.stopPropagation();linkControlDiv[0].style.background='transparent';linkPad.parentNode.style.border='0px solid #aaa';$lp.slideUp();};b.events.add('click',function(evt){if(!linkControlDiv){linkControlDiv=$('#ymap-link',t.el).parent().parent().parent().parent().parent().parent().parent().parent();linkPad.style.padding='5px';linkPad.style.display='none';linkControlDiv[0].style.overflow="hidden";linkControlDiv[0].style.borderRadius="4px";linkControlDiv.append($lp=$(linkPad));$lp.on('click','.close',closePad);}
608if(!$lp.is(":visible")){$lp.html(t.p.showLinkDialog());linkControlDiv[0].style.background='#fff';linkPad.parentNode.style.border='1px solid #aaa';$lp.slideDown();setTimeout(function(){t.map.events.add("click",function(e){if($lp.is(":visible")&&linkControlDiv.has(e.target).length==0)
609$lp.slideUp();});},10);return false;}else if($(linkPad).parent().find('.ymaps-b-form-button').has(event.target).length){linkPad.parentNode.style.border='0px solid #aaa';$lp.slideUp();}});t.map.controls.add(b,{top:5+step,right:5});}
610if(!param.no_line&&t.p&&t.p.showLineDialog){var b=new ymaps.control.Button({data:{content:'<div id="ymap-line"></div>
610',image:'/wp-t/_inc/images/line16.png',title:param.titleLineDlg||gmap.titleLineDlg,}},{selectOnClick:false}),linePad=document.createElement("DIV"),lp,closeLine=function(e){e.stopPropagation();lineControlDiv[0].style.background='transparent';lp.slideUp();linePad.parentNode.style.border='0px solid #aaa';t.p.lineDrawEnable(0);};b.events.add('click',function(evt){if(!lineControlDiv){lineControlDiv=$('#ymap-line',t.el).parent().parent().parent().parent().parent().parent().parent().parent();linePad.style.padding='5px';linePad.style.display='none';linePad.style.marginTop='-28px';lineControlDiv[0].style.overflow="hidden";lineControlDiv[0].style.borderRadius="4px";lineControlDiv.append(lp=$(linePad));lp.on('click','.close',closeLine);}
611if(!lp.is(":visible")){lineControlDiv[0].style.background='#fff';linePad.parentNode.style.border='1px solid #aaa';if($('#lineDraw',lp).length){lp.slideDown();t.p.lineDrawEnable(1);}else{lp.html(t.p.showLineDialog());var data={'action':'map-line-draw',uid:ykoctpa.id,'_ajax_nonce':gmap.nonce,};getScript(["/wp-p/bp-user-profile-map/js/linedraw.js"],function(arg,tag){c_log('script loaded!');t.p.lineDrawEnable(1);});$('.pad',lp).load('/wp-ax.php',data,function(){lp.slideDown();});}
612return false;}
613else{var trg=evt.originalEvent.domEvent.originalEvent.target;if($(linePad).parent().find('.ymaps-b-form-button').has(trg).length){linePad.parentNode.style.border='0px solid #aaa';lp.slideUp();t.p.lineDrawEnable(0);}}});t.map.controls.add(b,{top:5+step*2,right:5});}
614if(param.dlButton){var b=new ymaps.control.Button({data:{content:param.dlButton}},{selectOnClick:false});t.map.controls.add(b,{top:5+step*2,right:5});}
615if(param.ajax_map_bounds){setTimeout(function(){t.map.events.fire('boundschange',{target:t.map});},500);}},clientLocation:function(){var g=this.getApi();if(ymaps.geolocation.latitude||ymaps.geolocation.longitude)
616return new g.LatLng([ymaps.geolocation.latitude,ymaps.geolocation.longitude]);return new g.LatLng(55.752,37.612);},drawPolyLine:function(map,options,points,cbs){var p=this;options.draggable=false;options.strokeWidth=options.strokeWeight;options.hasBalloon=false;options.hasHint=false;var pl=new ymaps.Polyline(points,{},options);if(map)
617map.geoObjects.add(pl);for(var i in cbs){(function(cb,m){pl.events.add(m,function(e){cb(e,e.originalEvent.target.my_wrapper);});})(cbs[i],p.translate(i));}
618var t={line:pl,map:map,options:options,setMap:function(map){if(map){this.map=map;map.geoObjects.add(pl);}else if(this.map){this.map.geoObjects.remove(pl);}},getMap:function(){return this.map;},getPath:function(){return{push:function(e){var g=t.pl.geometry;g.insert(e,g.getLength());},pop:function(){var g=t.pl.geometry,i=g.getLength()-1,p=g.get(i);g.remove(i);return p;},getAt:function(i){return t.pl.geometry.get(i);},setAt:function(i,d){t.pl.geometry.set(i,d);},removeAt:function(i){t.pl.geometry.remove(i);},getLength:function(){return t.pl.geometry.getLength();},};},setOptions:function(opts){for(var i in opts)
619var k=(i=='strokeWeight')?'strokeWidth':i;c_log('set option '+k+'='+opts[i]);this.line.options.set(k,opts[i]);},};pl.my_wrapper=t;return t;},drawPolygon:function(map,options,points,cbs){var p=this,t,i;options.draggable=false;options.strokeWidth=options.strokeWeight;options.hasBalloon=false;options.hasHint=false;var pl=new ymaps.Polygon([points],{},options);t={line:pl,map:map,options:options,setMap:function(map){var oldmap=pl.getMap();if(map){if(oldmap==map)
620return;map.geoObjects.add(pl);}else{if(oldmap)
621oldmap.geoObjects.remove(pl);}
622this.map=map;},getMap:function(){return this.map;},getPath:function(){return{push:function(e){var g=t.pl.geometry;g.insert(e,g.getLength());},pop:function(){var g=t.pl.geometry,i=g.getLength()-1,p=g.get(i);g.remove(i);return p;},getAt:function(i){return t.pl.geometry.get(i);},setAt:function(i,d){t.pl.geometry.set(i,d);},removeAt:function(i){t.pl.geometry.remove(i);},getLength:function(){return t.pl.geometry.getLength();},};},setOptions:function(opts){for(var i in opts)
623this.line.options.set(i,opts[i]);},};for(i in cbs){(function(cb,m){pl.events.add(m,function(e){switch(m){case'mouseenter':pl.options.set('fillOpacity',options.strokeOpacity/2);break;case'mouseleave':pl.options.set('fillOpacity',options.strokeOpacity/10);break;}
624cb(e,e.originalEvent.target.my_wrapper);});})(cbs[i],p.translate(i));}
625if(map)
626map.geoObjects.add(pl);pl.my_wrapper=t;return t;},adjustBorders:function(param){$('#'+param.element_id+'yandex .ymaps-image-with-content').each(function(idx,el){var src=this.style.backgroundImage;if(src&&src.indexOf('ykoctpa')!==-1)
627$(this).addClass('bmarker');});},},};}
628mmap.prototype.LoadMapScripts=function(cb,prov){var t=this;var p=t.providers[prov];if(p.loaded==2){t.loaded(prov);cb(p);return;}
629p.callbacks.push(cb);t['loaded'+prov]=function(){t.loaded(prov);};if(!p.loaded){p.loaded=1;getScript(p.url,function(arg,tag){if(arg==1){t.loaded(prov);}});}}
630mmap.prototype.loaded=function(prov){var t=this,p=t.providers[prov],cb;p.loaded=2;while(cb=p.callbacks.pop()){cb(p);}};mmap.prototype.setDefault=function(prov,id){jQuery.cookie('map-provider-'+id,prov,{path:'/'});};mmap.prototype.add_changer=function(el,t,cb,right){var $=jQuery,e=this,button=$('
630<div class="prov-button" style="cursor: pointer;margin: 0 auto; position: absolute; top: -1px; right: '+(right||100)+'px; "><div class="dl"></div><div class="dh"></div><div class="dc"><div class="dt"></div></div><div class="dr"></div></div>'),p=el;p.append(button);var bt=$('.prov-button',p),dt=$('.dt',bt);dt.html(t.prov.name);bt.mouseenter(function(){var i,html='';for(i in e.providers){var r=e.providers[i],c=((r.id==t.prov.id)?"selected":'');html+='<li class="ymap '+c+'" rel="'+r.id+'">'+r.name+'</li>';}
631dt.html($('<ul>'+html+'</ul>'));}).mouseleave(function(){dt.html(t.prov.name);});bt.on("click","li",function(evt){var l=$(this),id=l.attr('rel');if(id==t.prov.id)
632return;dt.html(e.providers[id].name);cb(id);});};
633/* sk42 */ 
634var WGS84_SK42,SK42_WGS84;(function(){"use strict";var Pi=3.14159265358979,ro=206264.8062,PR=Pi/180,aP=6378245,alP=1/298.3,e2P=2*alP-alP*alP,aW=6378137,alW=1/298.257223563,e2W=2*alW-alW*alW,a=(aP+aW)/2,e2=(e2P+e2W)/2,da=aW-aP,de2=e2W-e2P,dx=23.92,dy=-141.27,dz=-80.9,wx=0,wy=0.35,wz=0.82,ms=-0.12e-6,Sin=Math.sin,Cos=Math.cos,Tan=Math.tan;WGS84_SK42=function(p){var alt=p.alt||0;return{lat:p.lat-x_dB(p.lat,p.lon,alt)/3600,lon:p.lon-x_dL(p.lat,p.lon,alt)/3600};};SK42_WGS84=function(p){var alt=p.alt||0;return{lat:p.lat+x_dB(p.lat,p.lon,alt)/3600,lon:p.lon+x_dL(p.lat,p.lon,alt)/3600,alt:alt?WGS84Alt(p.lat,p.lon,alt):null};};function x_dB(lat,lon,alt){var $B=lat*PR,$L=lon*PR,cL=Cos($L),cB=Cos($B),sL=Sin($L),sB=Sin($B),S2=e2*sB*sB,$M=a*(1-e2)/Math.pow(1-S2,1.5),$N=a*Math.pow(1-S2,-0.5),C2=(1+e2*Cos(2*$B));return ro/($M+alt)*($N/a*e2*sB*cB*da
635+($N*$N/(a*a)+1)*$N*sB*cB*de2/2
636-(dx*cL+dy*sL)*sB+dz*cB)
637-wx*sL*C2
638+wy*cL*C2
639-ro*ms*e2*sB*cB;}
640function x_dL(lat,lon,alt){var $B=lat*PR,$L=lon*PR,cL=Cos($L),sL=Sin($L),cB=Cos($B),sB=Sin($B),$N=a*Math.pow(1-e2*sB*sB,-0.5);return ro/(($N+alt)*cB)*(-dx*sL+dy*cL)+Tan($B)*(1-e2)*(wx*cL+wy*sL)-wz;}
641function WGS84Alt(lat,lon,alt){var $B=lat*Pi/180,$L=lon*Pi/180,sB=Sin($B),cB=Cos($B),cL=Cos($L),sL=Sin($L),sB2=Math.pow(sB,2),$N=a*Math.pow(1-e2*sB2,-0.5),$dH=-a/$N*da+$N*sB2*de2/2
642+(dx*cL+dy*sL)*cB
643+dz*sB
644-$N*e2*sB*cB*(wx/ro*sL-wy/ro*cL)
645+(a*a/$N+alt)*ms;return alt+$dH;}})();
646/* thickbox */ 
647if(typeof tb_pathToImage!='string'){var tb_pathToImage=thickboxL10n.loadingAnimation;}
648if(typeof tb_closeImage!='string'){var tb_closeImage=thickboxL10n.closeImage;}
649if(typeof tb_pathToImage!='string'){var tb_pathToImage="/wp-includes/js/thickbox/loadingAnimation.gif";}
650if(typeof tb_closeImage!='string'){var tb_closeImage="/wp-includes/js/thickbox/closead.jpg";}
651var TB_WIDTH,TB_HEIGHT;var tb_confirm=false,tb_position,tb_position_orig,TB_player=0,tb_showIframe,tb_remove;jQuery(document).ready(function($){tb_init('a.thickbox, area.thickbox, input.thickbox');imgLoader=new Image();imgLoader.src=tb_pathToImage;});function tb_init(domChunk){jQuery('body').on('click',domChunk,tb_click);}
652function tb_click(){var $=jQuery,t=this.title||this.name||null,g=this.rel||false,a,vid=0;if($(this).hasClass('use-id')){a=this.id;}else
653a=this.href||this.alt;if($(this).hasClass('video')){vid={w:$(this).attr('video_width'),h:$(this).attr('video_height')};}
654try{hide_title();}catch(e){}
655tb_show(t,a,g,refresh_map,vid);this.blur();try{var ids=this.id.split('-');ids.length-=1;var id='refresh_'+ids.join('-');if(window.id)
656eval(id+'(1);');var z=id;}catch(e){var x=e;c_log('eval error: '+e.description+' cause: '+id+'(1)');}
657return false;}
658function refresh_map(id){if(!id)return;try{var ids=id.split('-');ids.length-=1;var id='refresh_'+ids.join('-');if(window.id)
659eval(id+'(0);');var z=id;}catch(e){var x=e;c_log('eval error: '+e.description+' cause: '+id+'(0)');}}
660function tb_show(caption,url,imageGroup,callback,video){"use strict";var $=jQuery,vc='',tb_reenter=false;tb_remove=function(e){c_log('tb_remove ='+tb_reenter);if(tb_reenter){c_log('tb_remove reenter');return;}
661if(e!==true&&tb_confirm){c_log('tb_remove try confirm');tb_reenter=true;if((typeof(tb_confirm)=='function')?!tb_confirm():!confirm(tb_confirm)){if(e){e.preventDefault();e.stopPropagation();}
662setTimeout(function(){c_log('tb_remove reset reenter 1');tb_reenter=false;},100);return false;}
663c_log('tb_remove reset reenter 2');tb_reenter=false;}
664if(callback)callback(params['inlineId'],0);$("#TB_imageOff").unbind("click");$("#TB_closeWindowButton").unbind("click");$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("tb_unload").unbind().remove();});$("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","");}
665$(document).unbind('.thickbox');if(TB_player){TB_player.pause();TB_player=0;}
666return false;};if(video)vc=' class="video"';try{if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});$("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){$("body").append("<iframe id='TB_HideSelect'>"+thickboxL10n.noiframes+"</iframe><div id='TB_overlay'></div><div id='TB_window'"+vc+"></div>");$("#TB_overlay").click(tb_remove);}}else{if(document.getElementById("TB_overlay")===null){$("body").append("<div id='TB_overlay'></div><div id='TB_window'"+vc+"></div>");$("#TB_overlay").click(tb_remove);}}
667if(tb_detectMacXFF()){$("#TB_overlay").addClass("TB_overlayMacFFBGHack");}else{$("#TB_overlay").addClass("TB_overlayBG");}
668if(caption===null){caption="";}
669$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");$('#TB_load').show();var baseURL;if(url.indexOf("?")!==-1){baseURL=url.substr(0,url.indexOf("?"));}else{baseURL=url;}
670var urlString=/\.jpg\/?$|\.jpeg\/?$|\.png\/?$|\.gif\/?$|\.bmp\/?$/i,urlType=baseURL.toLowerCase().match(urlString),params=0;if(urlType){if(typeof urlType=='array'||typeof urlType=='object')
671urlType=urlType[0];urlType=urlType.split('/')[0];}
672if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'||urlType=='.bmp'||urlType=='.tiff'||video){var TB_PrevCaption="",TB_PrevURL="",TB_PrevHTML="",TB_NextCaption="",TB_NextURL="",TB_NextHTML="",TB_imageCount="",TB_FoundURL=false;if(imageGroup){TB_TempArray=$("a[rel="+imageGroup+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var urlTypeTemp=TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);if(!(TB_TempArray[TB_Counter].href==url)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>"+thickboxL10n.next+"</a></span>";}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>"+thickboxL10n.prev+"</a></span>";}}else{TB_FoundURL=true;TB_imageCount=thickboxL10n.image+' '+(TB_Counter+1)+' '+thickboxL10n.of+' '+(TB_TempArray.length);}}}
673var imgPreloader=new Image(),process=function(){imgPreloader.onload=null;var gapX=20,gapY=20,bX=video?0:16,bY=16,pagesize=tb_getPageSize(),x=pagesize[0]-(2*gapX+2*bX),y=pagesize[1]-(2*gapY+4*bY),img;if(video){var imageWidth=video.w||640,imageHeight=video.h||480;}else{var imageWidth=imgPreloader.width,imageHeight=imgPreloader.height;}
674if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;}}else if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;}}
675TB_HEIGHT=imageHeight+3*bY;TB_WIDTH=imageWidth+2*bX;if(video){img="<video id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"'></video>";}else{img="<a href='' id='TB_ImageOff' title='"+thickboxL10n.close+"'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>";}
676$("#TB_window").append(img+"<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div>"+"<div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='"+tb_closeImage+"' /></a></div>");$("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){var goPrev=function(){if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
677$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption,TB_PrevURL,imageGroup);return false;};$("#TB_prev").click(goPrev);}
678if(!(TB_NextHTML==="")){var goNext=function(){$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption,TB_NextURL,imageGroup);return false;};$("#TB_next").click(goNext);}
679$(document).bind('keydown.thickbox',function(e){e.stopImmediatePropagation();if(e.which==27){if(!$(document).triggerHandler('wp_CloseOnEscape',[{event:e,what:'thickbox',cb:tb_remove}]))
680tb_remove();}else if(e.which==190){if(!(TB_NextHTML=="")){$(document).unbind('thickbox');goNext();}}else if(e.which==188){if(!(TB_PrevHTML=="")){$(document).unbind('thickbox');goPrev();}}
681else try{console.log(e.which);}catch(e){}
682return false;});tb_position();$("#TB_load").remove();$("#TB_window").css({'visibility':'visible'});$("#TB_overlay").click(tb_remove);if(video){var player=new MediaElementPlayer('#TB_Image',{features:['playpause','progress','current','duration','volume','fullscreen'],success:function(me,domObject){TB_player=me;me.play();},});}else{$("#TB_ImageOff").click(tb_remove);}};if(video){process();}else{imgPreloader.onload=process;imgPreloader.src=url;}}else{var queryString=url.replace(/^[^\?]+\??/,'').replace('?','&').replace('#','&'),pagesize=tb_getPageSize(),x=pagesize[0]-80,y=pagesize[1]-90;params=tb_parseQuery(queryString);TB_WIDTH=(params['width']*1)||x;
682TB_HEIGHT=(params['height']*1)+40||y;var ajaxContentW=TB_WIDTH,ajaxContentH=TB_HEIGHT-45;if(url.indexOf('TB_iframe')!=-1){var urlNoQuery=url.split('TB_'),url1=urlNoQuery[0];if(url1.indexOf('?'))
683url1+='&iframe=true';else
684url1+='?iframe=true';tb_showIframe=function(e){c_log('tb_showIframe');$("#TB_load").remove();$("#TB_window").css({'visibility':'visible'});if(callback)callback(params['inlineId'],1,e);};$("#TB_iframeContent").remove();if(params['modal']!="true"){$("#TB_title").remove();$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='"+tb_closeImage+"' /></a></div></div><iframe frameborder='0' hspace='0' src='"+url1+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe(this)' style='width:"+(ajaxContentW)+"px;height:"+(ajaxContentH+7)+"px;' >"+thickboxL10n.noiframes+"</iframe>");}else{$("#TB_overlay").unbind();$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+url1+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe(this)' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;'>"+thickboxL10n.noiframes+"</iframe>");}}else{if($("#TB_window").css("visibility")!="visible"){if(params['modal']!="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><img src='"+tb_closeImage+"' /></a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");}else{$("#TB_overlay").unbind();$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");}}else{var a=$("#TB_ajaxContent")[0];a.style.width=ajaxContentW+"px";a.style.height=ajaxContentH+"px";a.scrollTop=0;$("#TB_ajaxWindowTitle").html(caption);}}
685if(url.indexOf('TB_inline')!=-1){var el=$('#'+params['inlineId']),prev=el.prev(),parent=el.parent(),unload=function(){if(prev.length){$(el).insertAfter(prev);}else{parent.prepend(el);}
686if(callback)callback(params['inlineId'],0);if(params['callback']){try{eval(params['callback']+'(0)');}catch(e){c_log('error '+e.description);}}};if($("#TB_ajaxContent").html())
687$("#TB_window").trigger('tb_unload');$("#TB_ajaxContent").append(el);$("#TB_window").bind('tb_unload',unload);tb_position();$("#TB_load").remove();$("#TB_window").css({'visibility':'visible'});if(callback)callback(params['inlineId'],1);}else if(url.indexOf('TB_iframe')!=-1){tb_position();if($.browser.safari){$("#TB_load").remove();$("#TB_window").css({'visibility':'visible'});}}else{var afterLoad=function(){tb_position();$("#TB_load").hide();$("#TB_ajaxContent a").each(function(){var t=this,dst=t.href;if(!dst)return;if(dst=='javascript:history.back()'){$(this).click(tb_remove);return false;}
688var h=dst.slice(0,22),d=document.location.href.slice(0,22);if(h!=d){$(this).addClass('extlink');return;}
689if($(this).hasClass('no-tb'))
690return;$(this).click(function(){$("#TB_load").show();var c=(this.href.indexOf('?')===-1)?'?':'&';var url=this.href+c+"inline=true&random="+(new Date().getTime())+'&action='+params['action'];$("#TB_ajaxContent").load(url,afterLoad);return false;});});$("#TB_window").css({'visibility':'visible'});if(callback)callback(params['inlineId'],1);};var c=(url.indexOf('?')===-1)?'?':'&';$("#TB_ajaxContent").load(url+=c+"inline=true&random="+(new Date().getTime()),afterLoad);}
691$("#TB_closeWindowButton").click(tb_remove);if(params['callback']){try{eval(params['callback']+'(1)');}catch(e){c_log('error '+e.description);}}}
692if(!params['modal']){$(document).bind('keyup.thickbox',function(e){if(e.which==27){e.stopImmediatePropagation();if(!$(document).triggerHandler('wp_CloseOnEscape',[{event:e,what:'thickbox',cb:tb_remove}]))
693tb_remove(e);return false;}});}
694if(window.setMouseWeelHandler)
695setMouseWeelHandler(window,function(){if($("#TB_window").length&&!$("#TB_window .map-canvas").length)
696return false;return;});}catch(e){alert("Something wrong, err="+e.name+" "+e.message);tb_remove(true);x=e;}}
697function tb_showIframe(){var $=jQuery;$("#TB_load").remove();$("#TB_window").css({'visibility':'visible'});}
698function tb_init2(domChunk){var $=jQuery;}
699tb_position=tb_position_orig=function(){var isIE6=typeof document.body.style.maxHeight==="undefined";var $=jQuery;$("#TB_window").css({marginLeft:'-'+parseInt((TB_WIDTH/2),10)+'px',width:TB_WIDTH+'px'});if(!isIE6){$("#TB_window").css({marginTop:'-'+parseInt((TB_HEIGHT/2),10)+'px'});}};function tb_parseQuery(query){var Params={};if(!query){return Params;}
700var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){if(Pairs[i]){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2)
701continue;var key=unescape(KeyVal[0]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}}
702return Params;}
703function tb_getPageSize(){var de=document.documentElement;var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;
703var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;arrayPageSize=[w,h];return arrayPageSize;}
704function tb_detectMacXFF(){var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf('mac')!=-1&&userAgent.indexOf('firefox')!=-1){return true;}}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.