(function(){var m,t,w,y,u,z={}.hasOwnProperty,A=[].slice;this.OverlappingMarkerSpiderfier=function(){function r(a,d){var b,f,e;this.map=a;null==d&&(d={});null==this.constructor.N&&(this.constructor.N=!0,h=google.maps,l=h.event,p=h.MapTypeId,c.keepSpiderfied=!1,c.ignoreMapClick=!1,c.markersWontHide=!1,c.markersWontMove=!1,c.basicFormatEvents=!1,c.nearbyDistance=20,c.circleSpiralSwitchover=9,c.circleFootSeparation=23,c.circleStartAngle=x/12,c.spiralFootSeparation=26,c.spiralLengthStart=11,c.spiralLengthFactor=
4,c.spiderfiedZIndex=h.Marker.MAX_ZINDEX+2E4,c.highlightedLegZIndex=h.Marker.MAX_ZINDEX+1E4,c.usualLegZIndex=h.Marker.MAX_ZINDEX+1,c.legWeight=1.5,c.legColors={usual:{},highlighted:{}},e=c.legColors.usual,f=c.legColors.highlighted,e[p.HYBRID]=e[p.SATELLITE]="#fff",f[p.HYBRID]=f[p.SATELLITE]="#f00",e[p.TERRAIN]=e[p.ROADMAP]="#444",f[p.TERRAIN]=f[p.ROADMAP]="#f00",this.constructor.j=function(a){return this.setMap(a)},this.constructor.j.prototype=new h.OverlayView,this.constructor.j.prototype.draw=function(){});
for(b in d)z.call(d,b)&&(f=d[b],this[b]=f);this.g=new this.constructor.j(this.map);this.C();this.c={};this.B=this.l=null;this.addListener("click",function(a,b){return l.trigger(a,"spider_click",b)});this.addListener("format",function(a,b){return l.trigger(a,"spider_format",b)});this.ignoreMapClick||l.addListener(this.map,"click",function(a){return function(){return a.unspiderfy()}}(this));l.addListener(this.map,"maptypeid_changed",function(a){return function(){return a.unspiderfy()}}(this));l.addListener(this.map,
"zoom_changed",function(a){return function(){a.unspiderfy();if(!a.basicFormatEvents)return a.h()}}(this))}var l,h,m,v,p,c,t,x,u;c=r.prototype;t=[r,c];m=0;for(v=t.length;m<v;m++)u=t[m],u.VERSION="1.0.3";x=2*Math.PI;h=l=p=null;r.markerStatus={SPIDERFIED:"SPIDERFIED",SPIDERFIABLE:"SPIDERFIABLE",UNSPIDERFIABLE:"UNSPIDERFIABLE",UNSPIDERFIED:"UNSPIDERFIED"};c.C=function(){this.a=[];this.s=[]};c.addMarker=function(a,d){a.setMap(this.map);return this.trackMarker(a,d)};c.trackMarker=function(a,d){var b;if(null!=a._oms)return this;a._oms=!0;b=[l.addListener(a,"click",function(b){return function(d){return b.V(a,d)}}(this))];this.markersWontHide||b.push(l.addListener(a,"visible_changed",function(b){return function(){return b.D(a,!1)}}(this)));this.markersWontMove||b.push(l.addListener(a,"position_changed",function(b){return function(){return b.D(a,!0)}}(this)));null!=d&&b.push(l.addListener(a,"spider_click",d));this.s.push(b);this.a.push(a);this.basicFormatEvents?this.trigger("format",a,this.constructor.markerStatus.UNSPIDERFIED):
(this.trigger("format",a,this.constructor.markerStatus.UNSPIDERFIABLE),this.h());return this};c.D=function(a,d){if(!this.J&&!this.K)return null==a._omsData||!d&&a.getVisible()||this.unspiderfy(d?a:null),this.h()};c.getMarkers=function(){return this.a.slice(0)};c.removeMarker=function(a){this.forgetMarker(a);return a.setMap(null)};c.forgetMarker=function(a){var d,b,f,e,g;null!=a._omsData&&this.unspiderfy();d=this.A(this.a,a);if(0>d)return this;g=this.s.splice(d,1)[0];b=0;for(f=g.length;b<f;b++)e=g[b],
l.removeListener(e);delete a._oms;this.a.splice(d,1);this.h();return this};c.removeAllMarkers=c.clearMarkers=function(){var a,d,b,f;f=this.getMarkers();this.forgetAllMarkers();a=0;for(d=f.length;a<d;a++)b=f[a],b.setMap(null);return this};c.forgetAllMarkers=function(){var a,d,b,f,e,g,c,q;this.unspiderfy();q=this.a;a=d=0;for(b=q.length;d<b;a=++d){g=q[a];e=this.s[a];c=0;for(a=e.length;c<a;c++)f=e[c],l.removeListener(f);delete g._oms}this.C();return this};c.addListener=function(a,d){var b;(null!=(b=this.c)[a]?
b[a]:b[a]=[]).push(d);return this};c.removeListener=function(a,d){var b;b=this.A(this.c[a],d);0>b||this.c[a].splice(b,1);return this};c.clearListeners=function(a){this.c[a]=[];return this};c.trigger=function(){var a,d,b,f,e,g;d=arguments[0];a=2<=arguments.length?A.call(arguments,1):[];d=null!=(b=this.c[d])?b:[];g=[];f=0;for(e=d.length;f<e;f++)b=d[f],g.push(b.apply(null,a));return g};c.L=function(a,d){var b,f,e,g,c;g=this.circleFootSeparation*(2+a)/x;f=x/a;c=[];for(b=e=0;0<=a?e<a:e>a;b=0<=a?++e:--e)b=
this.circleStartAngle+b*f,c.push(new h.Point(d.x+g*Math.cos(b),d.y+g*Math.sin(b)));return c};c.M=function(a,d){var b,f,e,c,k;c=this.spiralLengthStart;b=0;k=[];for(f=e=0;0<=a?e<a:e>a;f=0<=a?++e:--e)b+=this.spiralFootSeparation/c+5E-4*f,f=new h.Point(d.x+c*Math.cos(b),d.y+c*Math.sin(b)),c+=x*this.spiralLengthFactor/b,k.push(f);return k};c.V=function(a,d){var b,f,e,c,k,q,n,l,h;(q=null!=a._omsData)&&this.keepSpiderfied||this.unspiderfy();if(q||this.map.getStreetView().getVisible()||"GoogleEarthAPI"===this.map.getMapTypeId())return this.trigger("click",a,d);q=[];n=[];b=this.nearbyDistance;l=b*b;k=this.f(a.position);h=this.a;b=0;for(f=h.length;b<f;b++)e=h[b],null!=e.map&&e.getVisible()&&(c=this.f(e.position),this.i(c,k)<l?q.push({R:e,G:c}):n.push(e));return 1===q.length?this.trigger("click",a,d):this.W(q,n)};c.markersNearMarker=function(a,d){var b,f,e,c,k,q,n,l,h,m;null==d&&(d=!1);if(null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearMarker";b=this.nearbyDistance;
n=b*b;k=this.f(a.position);q=[];l=this.a;b=0;for(f=l.length;b<f&&!(e=l[b],e!==a&&null!=e.map&&e.getVisible()&&(c=this.f(null!=(h=null!=(m=e._omsData)?m.v:void 0)?h:e.position),this.i(c,k)<n&&(q.push(e),d)));b++);return q};c.F=function(){var a,d,b,f,e,c,k,l,n,h,m;if(null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearAnyOtherMarker";n=this.nearbyDistance;n*=n;var p;e=this.a;p=[];h=0;for(d=e.length;h<d;h++)f=e[h],p.push({H:this.f(null!=(a=null!=(b=f._omsData)?
b.v:void 0)?a:f.position),b:!1});h=this.a;a=b=0;for(f=h.length;b<f;a=++b)if(d=h[a],null!=d.getMap()&&d.getVisible()&&(c=p[a],!c.b))for(m=this.a,d=l=0,e=m.length;l<e;d=++l)if(k=m[d],d!==a&&null!=k.getMap()&&k.getVisible()&&(k=p[d],(!(d<a)||k.b)&&this.i(c.H,k.H)<n)){c.b=k.b=!0;break}return p};c.markersNearAnyOtherMarker=function(){var a,d,b,c,e,g,k;e=this.F();g=this.a;k=[];a=d=0;for(b=g.length;d<b;a=++d)c=g[a],e[a].b&&k.push(c);return k};c.setImmediate=function(a){return window.setTimeout(a,0)};c.h=
function(){if(!this.basicFormatEvents&&null==this.l)return this.l=this.setImmediate(function(a){return function(){a.l=null;return null!=a.g.getProjection()?a.w():null!=a.B?void 0:a.B=l.addListenerOnce(a.map,"idle",function(){return a.w()})}}(this))};c.w=function(){var a,d,b,c,e,g,k;if(this.basicFormatEvents){e=[];d=0;for(b=markers.length;d<b;d++)c=markers[d],a=null!=c._omsData?"SPIDERFIED":"UNSPIDERFIED",e.push(this.trigger("format",c,this.constructor.markerStatus[a]));return e}e=this.F();g=this.a;
k=[];a=b=0;for(d=g.length;b<d;a=++b)c=g[a],a=null!=c._omsData?"SPIDERFIED":e[a].b?"SPIDERFIABLE":"UNSPIDERFIABLE",k.push(this.trigger("format",c,this.constructor.markerStatus[a]));return k};c.P=function(a){return{m:function(d){return function(){return a._omsData.o.setOptions({strokeColor:d.legColors.highlighted[d.map.mapTypeId],zIndex:d.highlightedLegZIndex})}}(this),u:function(d){return function(){return a._omsData.o.setOptions({strokeColor:d.legColors.usual[d.map.mapTypeId],zIndex:d.usualLegZIndex})}}(this)}};
c.W=function(a,d){var b,c,e,g,k,q,n,m,p,r;this.J=!0;r=a.length;b=this.T(function(){var b,d,c;c=[];b=0;for(d=a.length;b<d;b++)m=a[b],c.push(m.G);return c}());g=r>=this.circleSpiralSwitchover?this.M(r,b).reverse():this.L(r,b);b=function(){var b,d,f;f=[];b=0;for(d=g.length;b<d;b++)e=g[b],c=this.U(e),p=this.S(a,function(a){return function(b){return a.i(b.G,e)}}(this)),n=p.R,q=new h.Polyline({map:this.map,path:[n.position,c],strokeColor:this.legColors.usual[this.map.mapTypeId],strokeWeight:this.legWeight,
zIndex:this.usualLegZIndex}),n._omsData={v:n.getPosition(),X:n.getZIndex(),o:q},this.legColors.highlighted[this.map.mapTypeId]!==this.legColors.usual[this.map.mapTypeId]&&(k=this.P(n),n._omsData.O={m:l.addListener(n,"mouseover",k.m),u:l.addListener(n,"mouseout",k.u)}),this.trigger("format",n,this.constructor.markerStatus.SPIDERFIED),n.setPosition(c),n.setZIndex(Math.round(this.spiderfiedZIndex+e.y)),f.push(n);return f}.call(this);delete this.J;this.I=!0;return this.trigger("spiderfy",b,d)};c.unspiderfy=
function(a){var d,b,c,e,g,k,h;null==a&&(a=null);if(null==this.I)return this;this.K=!0;h=[];g=[];k=this.a;d=0;for(b=k.length;d<b;d++)e=k[d],null!=e._omsData?(e._omsData.o.setMap(null),e!==a&&e.setPosition(e._omsData.v),e.setZIndex(e._omsData.X),c=e._omsData.O,null!=c&&(l.removeListener(c.m),l.removeListener(c.u)),delete e._omsData,e!==a&&(c=this.basicFormatEvents?"UNSPIDERFIED":"SPIDERFIABLE",this.trigger("format",e,this.constructor.markerStatus[c])),h.push(e)):g.push(e);delete this.K;delete this.I;
this.trigger("unspiderfy",h,g);return this};c.i=function(a,d){var b,c;b=a.x-d.x;c=a.y-d.y;return b*b+c*c};c.T=function(a){var c,b,f,e,g;c=e=g=0;for(b=a.length;c<b;c++)f=a[c],e+=f.x,g+=f.y;a=a.length;return new h.Point(e/a,g/a)};c.f=function(a){return this.g.getProjection().fromLatLngToDivPixel(a)};c.U=function(a){return this.g.getProjection().fromDivPixelToLatLng(a)};c.S=function(a,c){var b,d,e,g,k,h;e=k=0;for(h=a.length;k<h;e=++k)if(g=a[e],g=c(g),"undefined"===typeof b||null===b||g<d)d=g,b=e;return a.splice(b,
1)[0]};c.A=function(a,c){var b,d,e,g;if(null!=a.indexOf)return a.indexOf(c);b=d=0;for(e=a.length;d<e;b=++d)if(g=a[b],g===c)return b;return-1};return r}();t=/(\?.*(&|&amp;)|\?)spiderfier_callback=(\w+)/;m=document.currentScript;null==m&&(m=function(){var m,l,h,w,v;h=document.getElementsByTagName("script");v=[];m=0;for(l=h.length;m<l;m++)u=h[m],null!=(w=u.getAttribute("src"))&&w.match(t)&&v.push(u);return v}()[0]);if(null!=m&&(m=null!=(w=m.getAttribute("src"))?null!=(y=w.match(t))?y[3]:void 0:void 0)&&
"function"===typeof window[m])window[m]();"function"===typeof window.spiderfier_callback&&window.spiderfier_callback()}).call(this);
var sbd_enable_map_addr_phone_clickable=sld_variables.pd_enable_map_addr_phone_clickable;
var sbd_map_fitbounds=sld_variables.sbd_map_fitbounds;
var disableAutoPan=sld_variables.pd_enable_map_autopan;
if(disableAutoPan!='off'){
disableAutoPan=false;
}else{
disableAutoPan=true;
}
var popup_click_instead_hover=sld_variables.popup_click_instead_hover;
var sbd_custom_marker_image_width=30;
if((sld_variables.sbd_custom_marker_image_width!=='undefined')&&(typeof Number(sld_variables.sbd_custom_marker_image_width)=='number')){
sbd_custom_marker_image_width=Number(sld_variables.sbd_custom_marker_image_width);
}
var sbd_custom_marker_image_height=30;
if((sld_variables.sbd_custom_marker_image_height!=='undefined')&&(typeof Number(sld_variables.sbd_custom_marker_image_height)=='number')){
sbd_custom_marker_image_height=Number(sld_variables.sbd_custom_marker_image_height);
}
if(localStorage.getItem("qcld_google_undefined_check")!=1&&sld_variables.map_privacy_policies=='on'){
jQuery('#sbd_all_location').after('<div class="qcld_gdpr_check"> <span>'+sld_variables.qcld_google_check_lang+'</span> <span class="qcld_gdpr_check_click"> '+sld_variables.qcld_google_load_map_lang+' </span></div>');
jQuery('#sbd_all_location').hide();
}
var lat=parseFloat(sld_variables.latitute);
var lon=parseFloat(sld_variables.longitute);
if(! localStorage.getItem("qcld_map_latitite")){
localStorage.setItem("qcld_map_latitite",  lat);
}
if(! localStorage.getItem("qcld_map_longitute")){
localStorage.setItem("qcld_map_longitute", lon);
}
if(sld_variables.current_location_map=='on'){
if(typeof google!=='undefined'){
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(showMapPositions);
}
function showMapPositions(position){
var latVal=position.coords.latitude;
var lonVal=position.coords.longitude;
if(latVal!=''&&lonVal!=''&&! localStorage.getItem("qcld_map_current_position")){
localStorage.setItem("qcld_map_latitite",  latVal);
localStorage.setItem("qcld_map_longitute", lonVal);
localStorage.setItem("qcld_map_current_position", 1);
location.reload();
}}
}}
jQuery(document).ready(function($){
$(document).on("click",".qcld_gdpr_check_click", function(event){
localStorage.setItem("qcld_google_undefined_check", 1);
location.reload(true);
});
jQuery('input[name="pd_default_tags_other"]').on('change',function(){
if(jQuery(this).is(':checked')){
jQuery('.pd_default_tags_input').show();
}else{
jQuery('.pd_default_tags_input').hide();
}});
jQuery('.sbd_main_wrapper').each(function(){
var main_wrapper=jQuery(this);
if(main_wrapper.hasClass('sbd-distance-order')){
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(function (position){
var current_latitude=position.coords.latitude;
var current_longitude=position.coords.longitude;
console.log(current_latitude+', '+current_longitude);
main_wrapper.find('#sbdopd-list-holder ul li').each(function(){
var obj=jQuery(this);
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var distance=google.maps.geometry.spherical.computeDistanceBetween(new google.maps.LatLng(current_latitude, current_longitude), new google.maps.LatLng(latlng[0],latlng[1]));
if(jQuery.isNumeric(distance) ){
obj.attr('data-searched-distance',distance);
}else{
obj.attr('data-searched-distance','9999999999999999');
}});
main_wrapper.find('ul').each(function(){
jQuery(this).addClass('test');
jQuery(this).html(jQuery(this).children('li').sort(function(a, b){
return (jQuery(b).attr('data-searched-distance')) < (jQuery(a).attr('data-searched-distance')) ? 1:-1;
}));
});
});
}}
});
$('#sld_claim_list').on('change',function(e){
e.preventDefault();
if($(this).val()!==''){
$.post(ajaxurl,
{
action:'qcld_sbd_show_list_item',
listid: $(this).val()
},
function(data){
$('#sld_list_item').html(data);
}
);
}else{
$('#sld_list_item').html('');
}})
var $grid=$('.qc-grid').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
if(typeof(cluster)!='undefined'&&cluster.main_click==3){
jQuery("#sbdopd-list-holder ul li").on('click', function(e){
if(typeof google!=='undefined'){
if(jQuery('#sbd_all_location').length>0){
map=new google.maps.Map(document.getElementById("sbd_all_location"), {
center: new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute")),
zoom: parseInt(sld_variables.zoom),
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
});
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
oms=new OverlappingMarkerSpiderfier(map, {
markersWontMove: true,
markersWontHide: true,
basicFormatEvents: true
});
}
var obj=jQuery(this);
var icons=obj.find('.pd-bottom-area').clone();
icons.find('.pd-map').removeClass('open-mpf-sld-link');
if(typeof(obj.attr('data-address'))!=='undefined'&&obj.attr('data-address')!=''){
icons.find('.pd-map').attr("href", "https://www.google.com/maps/dir/?api=1&origin=none&destination="+encodeURIComponent(obj.attr('data-address'))+"&travelmode=driving");
icons.find('.pd-map').attr("target", "_blank");
}
icons.find('.open-mpf-sld-link').remove();
icons.find('.pd-map').remove();
icons=icons.html();
var custom_content=obj.find('.sbd_custom_content').clone();
custom_content=custom_content.html();
var others_info='';
if(obj.attr('data-local')!=''){
others_info +="<p><b><i class='fa fa-location-arrow' aria-hidden='true'></i> </b>"+obj.attr('data-local')+"</p>";
}
if(obj.attr('data-phone')!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b><a href='tel:"+obj.attr('data-phone')+"'>"+obj.attr('data-phone')+"</a></p>";
}else{
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b>"+obj.attr('data-phone')+"</p>";
}}
if(obj.attr('data-businesshour')!=''){
others_info +="<p><b><i class='fa fa-clock-o fa-clock' aria-hidden='true'></i> </b>"+obj.attr('data-businesshour')+"</p>";
}
var imgurl='';
if(obj.find('img').length>0){
imgurl=obj.find('img').attr('src');
}
var target='';
if(typeof(obj.find('a').attr('target'))!=='undefined'){
target='target="_blank"';
}
if(typeof(obj.find('a').attr('data-newtab'))!=='undefined'){
target='target="_blank"';
}
if(obj.attr('data-latlon')!==''&&typeof(obj.attr('data-latlon'))!=='undefined'){
i++;
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var title=obj.attr('data-title');
var address=obj.attr('data-address');
var url;
if(typeof(obj.find('a').attr('href'))!=='undefined'&&obj.find('a').is('a:not([href^="#"])')&&obj.find('a').is('a:not([href^="tel"])')){
url=obj.find('a').attr('href');
}else{
url=obj.attr('data-url');
}
var subtitle=obj.attr('data-subtitle');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
var map_marker_id=jQuery(this).attr('id');
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
};}
var marker=new google.maps.Marker({
map: map,
icon: icon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
position:  new google.maps.LatLng(latlng[0],latlng[1]),
title: title,
animation: google.maps.Animation.DROP,
address: address,
url: url,
mapSelectorID: map_marker_id
});
markers.push(marker);
infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info);
if(sbd_map_fitbounds=='on'){
bounds.extend(marker.getPosition());
map.fitBounds(bounds);
}}
}})
}
var filters=[];
$(document).on("click",".sbd-filter-area a", function(event){
var sbd_mode='';
markers=[];
if(jQuery(this).parent('.sbd-filter-area').parent().hasClass('qcld_pd_tabcontent')){
sbd_mode='categoryTab';
return false;
}
if($('.pd_tag_filter').length>0){
if($('.pd_tag_filter:not(:first)').hasClass('pd_tag_filter-active')){
$('.pd_tag_filter:first-of-type').addClass('pd_tag_filter-active').click();
}else{
$('.pd_tag_filter:first-of-type').removeClass('pd_tag_filter-active').click();
}}
if($('.sbd_tag_filter_select').length > 0){
$('.sbd_tag_filter_select').val('').change();
}
event.preventDefault();
if(typeof google!=='undefined'){
if(jQuery('#sbd_all_location').length>0){
map=new google.maps.Map(document.getElementById("sbd_all_location"), {
center: new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute")),
zoom: parseInt(sld_variables.zoom),
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
});
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
oms=new OverlappingMarkerSpiderfier(map, {
markersWontMove: true,
markersWontHide: true,
basicFormatEvents: true
});
}
var bounds=new google.maps.LatLngBounds();
}
var filterName=$(this).attr("data-filter");
var inclusive_list_filter=sld_variables.inclusive_list_filter;
if(inclusive_list_filter=='on'){
$(this).toggleClass("filter-active");
}else{
$(".sbd-filter-area a").removeClass("filter-active");
$(this).addClass("filter-active");
}
if(filterName=="all"){
if(inclusive_list_filter=='on'){
filters=[];
jQuery(this).siblings().removeClass('filter-active');
}
$("#sbdopd-list-holder .qc-grid-item").css("display", "block");
if(jQuery('#sbd_all_location').length>0){
myLoop();
}}else{
var inclusive_list_filter=sld_variables.inclusive_list_filter;
if(inclusive_list_filter=='on'){
if($(this).hasClass('filter-active')){
filters.push(filterName);
}else{
var index=filters.indexOf(filterName);
if(index > -1){
filters.splice(index, 1);
}}
if(filterName){
filters=filters.filter(function(item, pos){
return item;
});
jQuery(this).siblings().eq(0).removeClass('filter-active');
}
if(filters.length > 0){
filters=filters.filter(function(item, pos){
return filters.indexOf(item)==pos;
});
var search_term=new RegExp(filters.join('|'), "ig");
$("#sbdopd-list-holder .qc-grid-item").css("display", "none");
for (var i=0; i <=filters.length; i++){
if(filters[i]&&filters[i]!=''){
jQuery('.filter-btn[data-filter="'+filters[i]+'"]').addClass('filter-active');
$("#sbdopd-list-holder .qc-grid-item."+filters[i]+"").css("display", "block");
if(jQuery('#sbd_all_location').length>0){
jQuery("#sbdopd-list-holder ."+filters[i]+" ul li").each(function(){
var obj=jQuery(this);
var icons=obj.find('.pd-bottom-area').clone();
icons.find('.pd-map').removeClass('open-mpf-sld-link');
if(typeof google!=='undefined'){
if(typeof(obj.attr('data-address'))!=='undefined'&&obj.attr('data-address')!=''){
icons.find('.pd-map').attr("href", "https://www.google.com/maps/dir/?api=1&origin=none&destination="+encodeURIComponent(obj.attr('data-address'))+"&travelmode=driving");
icons.find('.pd-map').attr("target", "_blank");
}
icons.find('.open-mpf-sld-link').remove();
icons.find('.pd-map').remove();
icons=icons.html();
var custom_content=obj.find('.sbd_custom_content').clone();
custom_content=custom_content.html();
var others_info='';
if(obj.attr('data-local')!=''){
others_info +="<p><b><i class='fa fa-location-arrow' aria-hidden='true'></i> </b>"+obj.attr('data-local')+"</p>";
}
if(obj.attr('data-phone')!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b><a href='tel:"+obj.attr('data-phone')+"'>"+obj.attr('data-phone')+"</a></p>";
}else{
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b>"+obj.attr('data-phone')+"</p>";
}}
if(obj.attr('data-businesshour')!=''){
others_info +="<p><b><i class='fa fa-clock-o fa-clock' aria-hidden='true'></i> </b>"+obj.attr('data-businesshour')+"</p>";
}
var imgurl='';
if(obj.find('img').length>0){
imgurl=obj.find('img').attr('src');
}
var target='';
if(typeof(obj.find('a').attr('target'))!=='undefined'){
target='target="_blank"';
}
if(typeof(obj.find('a').attr('data-newtab'))!=='undefined'){
target='target="_blank"';
}
if(obj.attr('data-latlon')!==''&&typeof(obj.attr('data-latlon'))!=='undefined'){
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var title=obj.attr('data-title');
var address=obj.attr('data-address');
var url;
if(typeof(obj.find('a').attr('href'))!=='undefined'&&obj.find('a').is('a:not([href^="#"])')&&obj.find('a').is('a:not([href^="tel"])')){
url=obj.find('a').attr('href');
}else{
url=obj.attr('data-url');
}
var subtitle=obj.attr('data-subtitle');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
var map_marker_id=jQuery(this).attr('id');
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
};}
var marker=new google.maps.Marker({
icon:icon,
map: map,
position:  new google.maps.LatLng(latlng[0],latlng[1]),
title: title,
animation: google.maps.Animation.DROP,
address: address,
url: url,
mapSelectorID: map_marker_id
});
markers.push(marker);
infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info);
bounds.extend(marker.getPosition());
map.fitBounds(bounds);
}}
})
}}
}}
if(typeof(search_term)=='undefined'){
jQuery('.sbd-filter-area a[data-filter="all"]').trigger('click');
}}else{
$("#sbdopd-list-holder .qc-grid-item").css("display", "none");
$("#sbdopd-list-holder .qc-grid-item."+filterName+"").css("display", "block");
if(jQuery('#sbd_all_location').length>0){
jQuery("#sbdopd-list-holder ."+filterName+" ul li:visible").each(function(){
var obj=jQuery(this);
var icons=obj.find('.pd-bottom-area').clone();
icons.find('.pd-map').removeClass('open-mpf-sld-link');
if(typeof google!=='undefined'){
if(typeof(obj.attr('data-address'))!=='undefined'&&obj.attr('data-address')!=''){
icons.find('.pd-map').attr("href", "https://www.google.com/maps/dir/?api=1&origin=none&destination="+encodeURIComponent(obj.attr('data-address'))+"&travelmode=driving");
icons.find('.pd-map').attr("target", "_blank");
}
icons.find('.open-mpf-sld-link').remove();
icons.find('.pd-map').remove();
icons=icons.html();
var custom_content=obj.find('.sbd_custom_content').clone();
custom_content=custom_content.html();
var others_info='';
if(obj.attr('data-local')!=''){
others_info +="<p><b><i class='fa fa-location-arrow' aria-hidden='true'></i> </b>"+obj.attr('data-local')+"</p>";
}
if(obj.attr('data-phone')!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b><a href='tel:"+obj.attr('data-phone')+"'>"+obj.attr('data-phone')+"</a></p>";
}else{
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b>"+obj.attr('data-phone')+"</p>";
}}
if(obj.attr('data-businesshour')!=''){
others_info +="<p><b><i class='fa fa-clock-o fa-clock' aria-hidden='true'></i> </b>"+obj.attr('data-businesshour')+"</p>";
}
var imgurl='';
if(obj.find('img').length>0){
imgurl=obj.find('img').attr('src');
}
var target='';
if(typeof(obj.find('a').attr('target'))!=='undefined'){
target='target="_blank"';
}
if(typeof(obj.find('a').attr('data-newtab'))!=='undefined'){
target='target="_blank"';
}
if(obj.attr('data-latlon')!==''&&typeof(obj.attr('data-latlon'))!=='undefined'){
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var title=obj.attr('data-title');
var address=obj.attr('data-address');
var url;
if(typeof(obj.find('a').attr('href'))!=='undefined'&&obj.find('a').is('a:not([href^="#"])')&&obj.find('a').is('a:not([href^="tel"])')){
url=obj.find('a').attr('href');
}else{
url=obj.attr('data-url');
}
var subtitle=obj.attr('data-subtitle');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
var map_marker_id=jQuery(this).attr('id');
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
};}
var marker=new google.maps.Marker({
icon:icon,
map: map,
position:  new google.maps.LatLng(latlng[0],latlng[1]),
title: title,
animation: google.maps.Animation.DROP,
address: address,
url: url,
mapSelectorID: map_marker_id
});
markers.push(marker);
infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info);
bounds.extend(marker.getPosition());
map.fitBounds(bounds);
}}
})
}}
}
if(cluster.cluster){
var markerCluster=new MarkerClusterer(map, markers,
{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
}
$('.qc-grid').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
if($('.qcld_pd_tab').length<1){
if(typeof google!=='undefined'&&cluster.map=='true'){
google.maps.event.addListener(map, "click", function(event){
jQuery('.gm-style-iw').each(function(){
jQuery(this).next().click();
})
});
}}
});
var inclusive_default_list_filter=sld_variables.inclusive_default_list_filter;
if(inclusive_default_list_filter.length > 0){
setTimeout(function(e){
var default_list_filter=inclusive_default_list_filter.split(',');
for (var i=0; i <=default_list_filter.length; i++){
if(default_list_filter[i]&&default_list_filter[i]!=''){
var default_list_filter_val='opd-list-id-' + default_list_filter[i].trim();
jQuery('.sbd-filter-area a[data-filter="'+default_list_filter_val+'"]').trigger('click');
}}
},1000);
}
jQuery(document).on('click','.pdp-holder a', function(event){
event.preventDefault();
markers=[];
if(jQuery('#sbd_all_location').length>0){
map=new google.maps.Map(document.getElementById("sbd_all_location"), {
center: new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute")),
zoom: parseInt(sld_variables.zoom),
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
});
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
oms=new OverlappingMarkerSpiderfier(map, {
markersWontMove: true,
markersWontHide: true,
basicFormatEvents: true
});
}
var filterName=$(this).text();
var parentDom=$(this).closest('.qcpd-single-list-pd').find('ul li:visible').not('.jp-hidden');
var parentDom=$('.qcpd-single-list-pd ul li');
$(parentDom).each(function(){
var obj=$(this);
if(!obj.hasClass('jp-hidden')&&obj.parent().parent().parent().is(':visible')){
var icons=obj.find('.pd-bottom-area').clone();
icons.find('.pd-map').removeClass('open-mpf-sld-link');
if(typeof google!=='undefined'){
if(typeof(obj.attr('data-address'))!=='undefined'&&obj.attr('data-address')!=''){
icons.find('.pd-map').attr("href", "https://www.google.com/maps/dir/?api=1&origin=none&destination="+encodeURIComponent(obj.attr('data-address'))+"&travelmode=driving");
icons.find('.pd-map').attr("target", "_blank");
}
icons.find('.open-mpf-sld-link').remove();
icons.find('.pd-map').remove();
icons=icons.html();
var custom_content=obj.find('.sbd_custom_content').clone();
custom_content=custom_content.html();
var others_info='';
if(obj.attr('data-local')!=''){
others_info +="<p><b><i class='fa fa-location-arrow' aria-hidden='true'></i> </b>"+obj.attr('data-local')+"</p>";
}
if(obj.attr('data-phone')!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b><a href='tel:"+obj.attr('data-phone')+"'>"+obj.attr('data-phone')+"</a></p>";
}else{
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b>"+obj.attr('data-phone')+"</p>";
}}
if(obj.attr('data-businesshour')!=''){
others_info +="<p><b><i class='fa fa-clock-o fa-clock' aria-hidden='true'></i> </b>"+obj.attr('data-businesshour')+"</p>";
}
var imgurl='';
if(obj.find('img').length>0){
imgurl=obj.find('img').attr('src');
}
var target='';
if(typeof(obj.find('a').attr('target'))!=='undefined'){
target='target="_blank"';
}
if(typeof(obj.find('a').attr('data-newtab'))!=='undefined'){
target='target="_blank"';
}
if(obj.attr('data-latlon')!==''&&typeof(obj.attr('data-latlon'))!=='undefined'){
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var title=obj.attr('data-title');
var address=obj.attr('data-address');
var url;
if(typeof(obj.find('a').attr('href'))!=='undefined'&&obj.find('a').is('a:not([href^="#"])')&&obj.find('a').is('a:not([href^="tel"])')){
url=obj.find('a').attr('href');
}else{
url=obj.attr('data-url');
}
var subtitle=obj.attr('data-subtitle');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
var map_marker_id=jQuery(this).attr('id');
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
};}
var marker=new google.maps.Marker({
icon:icon,
map: map,
position:  new google.maps.LatLng(latlng[0],latlng[1]),
title: title,
animation: google.maps.Animation.DROP,
address: address,
url: url,
mapSelectorID: map_marker_id
});
markers.push(marker);
infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info);
bounds.extend(marker.getPosition());
map.fitBounds(bounds);
}}
}});
if(cluster.cluster){
var markerCluster=new MarkerClusterer(map, markers,
{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
}
$('.sbd_main_wrapper ul li[style*="display: list-item"]').each(function(index){
$(this).css('display', '');
});
$('.qc-grid').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
if($('.qcld_pd_tab').length<1){
if(typeof google!=='undefined'&&cluster.map=='true'){
google.maps.event.addListener(map, "click", function(event){
jQuery('.gm-style-iw').each(function(){
jQuery(this).next().click();
})
});
}}
jQuery(window).trigger('resize');
})
$(document).on("change",".sbd-filter-area-select-desktop select,.sbd-filter-area-select-mobile select",function(){
var value=jQuery(this).val();
if(value!='all'){
value="opd-list-id-"+value;
}
jQuery('.sbd-filter-area a[data-filter="'+value+'"]').trigger('click');
});
var filter=[];
$(document).on("click",".sbd-tag-filter-area a", function(event){
event.preventDefault();
var combined_search=0;
if(sld_variables.sbd_combine_distant_tag_live_search=="on"){
var location_name=jQuery('#sbd_location_name').val();
var distance=jQuery('.sbd_distance').val();
if(location_name!=''&&distance!=''&&event.type=='click'){
combined_search=1;
}}
var mapIDselector='sbd_all_location';
var sbd_mode='';
if(jQuery(this).parent('.sbd-tag-filter-area').parent().hasClass('qcld_pd_tabcontent')){
var mapIDselector=jQuery('.sbd_map:visible').attr('id');
sbd_mode='categoryTab';
}
$(this).toggleClass("pd_tag_filter-active");
var currently_tag=$(this).attr('data-tag');
if(!currently_tag&&$(this).hasClass('pd_tag_filter-active')){
currently_tag='all';
filter=[];
}
var inclusive_tag_filter=sld_variables.inclusive_tag_filter;
if(inclusive_tag_filter=='on'&&currently_tag=='all'){
jQuery(this).siblings('.pd_tag_filter').removeClass('pd_tag_filter-active');
}
if(inclusive_tag_filter!='on'){
jQuery('.pd_tag_filter').removeClass('pd_tag_filter-active');
jQuery(this).addClass('pd_tag_filter-active');
markers=[];
if(jQuery('#sbd_all_location').length>0){
map=new google.maps.Map(document.getElementById("sbd_all_location"), {
center: new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute")),
zoom: parseInt(sld_variables.zoom),
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
});
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
oms=new OverlappingMarkerSpiderfier(map, {
markersWontMove: true,
markersWontHide: true,
basicFormatEvents: true
});
}
var bounds=new google.maps.LatLngBounds();
}
if(sbd_mode=='categoryTab'){
filter=[];
jQuery('.sbd-tag-filter-area:visible .pd_tag_filter-active').each(function(){
var current_tag=$(this).attr('data-tag');
filter.push(current_tag);
});
var count=0;
var search_term=new RegExp(filter.join('|'), "i");
}else{
var current_tag=$(this).attr('data-tag');
if($(this).hasClass('pd_tag_filter-active')){
filter.push(current_tag);
}else{
var index=filter.indexOf(current_tag);
if(index > -1){
filter.splice(index, 1);
}}
var count=0;
if(current_tag){
filter=filter.filter(function(item, pos){
return item;
});
jQuery(this).siblings().eq(0).removeClass('pd_tag_filter-active');
}
if(filter.length > 0){
filter=filter.filter(function(item, pos){
return filter.indexOf(item)==pos;
});
}
if(inclusive_tag_filter=='on'){
var search_term=new RegExp(filter.join('|'), "ig");
}else if(sld_variables.sbd_combine_distant_tag_live_search!="on"){
var search_term=new RegExp(filter.join('|'), "i");
filter=[];
}else{
var search_term=new RegExp(filter.join('|'), "i");
}}
if(inclusive_tag_filter=='on'&&currently_tag!='all'&&filter.length > 0){
for (var i=0; i <=filter.length; i++){
if(filter[i]&&filter[i]!=''){
jQuery('.pd_tag_filter[data-tag="'+filter[i]+'"]').addClass('pd_tag_filter-active');
}}
}
if(typeof google!=='undefined'&&cluster.map=='true'){
if(jQuery('#'+mapIDselector).length>0&&combined_search==0){
markers=[];
map=new google.maps.Map(document.getElementById(mapIDselector), {
center: new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute")),
zoom: parseInt(sld_variables.zoom),
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
});
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
oms=new OverlappingMarkerSpiderfier(map, {
markersWontMove: true,
markersWontHide: true,
basicFormatEvents: true
});
}
var bounds=new google.maps.LatLngBounds();
}
var loopedItemSeclector="#sbdopd-list-holder ul li";
if(sbd_mode=='categoryTab'){
loopedItemSeclector=".qcld_pd_tabcontent:visible .qc-grid ul li";
if($(loopedItemSeclector).length==0){
loopedItemSeclector=".qcld_pd_tabcontent:visible .qcpd-list-hoder ul li";
}}
$(loopedItemSeclector).each(function(){
var dataTitleTxt=$(this).find('a').attr('data-tag');
if(typeof(dataTitleTxt)=='undefined'){
dataTitleTxt="-----";
}
if(inclusive_tag_filter=='on'&&currently_tag!='all'){
var main_array=dataTitleTxt.split(',');
var match_array=qcsbd_CheckArray(main_array, filter);
if(match_array){
$(this).show();
$(this).addClass("showMe");
var filterButton=$('.sbd-filter-area').find('.filter-active:not([data-filter="all"])');
if(sbd_mode=='categoryTab'){
filterButton=$('qcld_pd_tabcontent:visible').find('.sbd-filter-area').find('.filter-active:not([data-filter="all"])');
}
if(filterButton.length){
if($(this).parents('.qc-grid-item').is(':hidden')){
return;
}}
count++;
if(typeof google!=='undefined'){
if(jQuery('#'+mapIDselector).length>0&&combined_search==0){
var obj=$(this);
var icons=obj.find('.pd-bottom-area').clone();
icons.find('.pd-map').removeClass('open-mpf-sld-link');
if(typeof(obj.attr('data-address'))!=='undefined'&&obj.attr('data-address')!=''){
icons.find('.pd-map').attr("href", "https://www.google.com/maps/dir/?api=1&origin=none&destination="+encodeURIComponent(obj.attr('data-address'))+"&travelmode=driving");
icons.find('.pd-map').attr("target", "_blank");
}
icons.find('.open-mpf-sld-link').remove();
icons.find('.pd-map').remove();
icons=icons.html();
var custom_content=obj.find('.sbd_custom_content').clone();
custom_content=custom_content.html();
var others_info='';
if(obj.attr('data-local')!=''){
others_info +="<p><b><i class='fa fa-location-arrow' aria-hidden='true'></i> </b>"+obj.attr('data-local')+"</p>";
}
if(obj.attr('data-phone')!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b><a href='tel:"+obj.attr('data-phone')+"'>"+obj.attr('data-phone')+"</a></p>";
}else{
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b>"+obj.attr('data-phone')+"</p>";
}}
if(obj.attr('data-businesshour')!=''){
others_info +="<p><b><i class='fa fa-clock-o fa-clock' aria-hidden='true'></i> </b>"+obj.attr('data-businesshour')+"</p>";
}
var imgurl='';
if(obj.find('img').length>0){
imgurl=obj.find('img').attr('src');
}
var target='';
if(typeof(obj.find('a').attr('target'))!=='undefined'){
target='target="_blank"';
}
if(typeof(obj.find('a').attr('data-newtab'))!=='undefined'){
target='target="_blank"';
}
if(obj.attr('data-latlon')!==''&&typeof(obj.attr('data-latlon'))!=='undefined'){
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var title=obj.attr('data-title');
var address=obj.attr('data-address');
var url;
if(typeof(obj.find('a').attr('href'))!=='undefined'&&obj.find('a').is('a:not([href^="#"])')&&obj.find('a').is('a:not([href^="tel"])')){
url=obj.find('a').attr('href');
}else{
url=obj.attr('data-url');
}
var subtitle=obj.attr('data-subtitle');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
var map_marker_id=jQuery(this).attr('id');
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
};}
var marker=new google.maps.Marker({
icon:icon,
map: map,
position:  new google.maps.LatLng(latlng[0],latlng[1]),
title: title,
animation: google.maps.Animation.DROP,
address: address,
url: url,
mapSelectorID: map_marker_id
});
markers.push(marker);
infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info);
bounds.extend(marker.getPosition());
map.fitBounds(bounds);
}}
}}else{
$(this).fadeOut();
$(this).removeClass("showMe");
}}
if(inclusive_tag_filter!='on'||currently_tag=='all'){
if(dataTitleTxt.search(search_term) < 0){
$(this).fadeOut();
$(this).removeClass("showMe");
}else{
$(this).show();
$(this).addClass("showMe");
var filterButton=$('.sbd-filter-area').find('.filter-active:not([data-filter="all"])');
if(sbd_mode=='categoryTab'){
filterButton=$('qcld_pd_tabcontent:visible').find('.sbd-filter-area').find('.filter-active:not([data-filter="all"])');
}
if(filterButton.length){
if($(this).parents('.qc-grid-item').is(':hidden')){
return;
}}
count++;
if(jQuery('#'+mapIDselector).length>0&&combined_search==0){
var obj=$(this);
var icons=obj.find('.pd-bottom-area').clone();
icons.find('.pd-map').removeClass('open-mpf-sld-link');
if(typeof google!=='undefined'){
if(typeof(obj.attr('data-address'))!=='undefined'&&obj.attr('data-address')!=''){
icons.find('.pd-map').attr("href", "https://www.google.com/maps/dir/?api=1&origin=none&destination="+encodeURIComponent(obj.attr('data-address'))+"&travelmode=driving");
icons.find('.pd-map').attr("target", "_blank");
}
icons.find('.open-mpf-sld-link').remove();
icons.find('.pd-map').remove();
icons=icons.html();
var custom_content=obj.find('.sbd_custom_content').clone();
custom_content=custom_content.html();
var others_info='';
if(obj.attr('data-local')!=''){
others_info +="<p><b><i class='fa fa-location-arrow' aria-hidden='true'></i> </b>"+obj.attr('data-local')+"</p>";
}
if(obj.attr('data-phone')!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b><a href='tel:"+obj.attr('data-phone')+"'>"+obj.attr('data-phone')+"</a></p>";
}else{
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b>"+obj.attr('data-phone')+"</p>";
}}
if(obj.attr('data-businesshour')!=''){
others_info +="<p><b><i class='fa fa-clock-o fa-clock' aria-hidden='true'></i> </b>"+obj.attr('data-businesshour')+"</p>";
}
var imgurl='';
if(obj.find('img').length>0){
imgurl=obj.find('img').attr('src');
}
var target='';
if(typeof(obj.find('a').attr('target'))!=='undefined'){
target='target="_blank"';
}
if(typeof(obj.find('a').attr('data-newtab'))!=='undefined'){
target='target="_blank"';
}
if(obj.attr('data-latlon')!==''&&typeof(obj.attr('data-latlon'))!=='undefined'){
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var title=obj.attr('data-title');
var address=obj.attr('data-address');
var url;
if(typeof(obj.find('a').attr('href'))!=='undefined'&&obj.find('a').is('a:not([href^="#"])')&&obj.find('a').is('a:not([href^="tel"])')){
url=obj.find('a').attr('href');
}else{
url=obj.attr('data-url');
}
var subtitle=obj.attr('data-subtitle');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
var map_marker_id=jQuery(this).attr('id');
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
};}
var marker=new google.maps.Marker({
icon:icon,
map: map,
position:  new google.maps.LatLng(latlng[0],latlng[1]),
title: title,
animation: google.maps.Animation.DROP,
address: address,
url: url,
mapSelectorID: map_marker_id
});
markers.push(marker);
infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info);
bounds.extend(marker.getPosition());
map.fitBounds(bounds);
}}
}}
}});
if(cluster.cluster){
var markerCluster=new MarkerClusterer(map, markers,
{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
}
var singleItemSelector=$(".qcpd-single-list-pd, .qc-sbd-single-item-11, .qcpd-single-list-pd-1, .opd-list-pd-style-8, .opd-list-pd-style-9, .pd-container");
if(sbd_mode=='categoryTab'){
singleItemSelector=$('.qcld_pd_tabcontent:visible').find(".qcpd-single-list-pd, .qcpd-single-list-pd-1, .opd-list-pd-style-8, .opd-list-pd-style-9, .pd-container");
}
singleItemSelector.each(function(){
var visibleItems=$(this).find("li.showMe").length;
if(visibleItems==0){
$(this).hide();
}else{
$(this).show();
}});
setTimeout(function(e){
$grid=$('.qc-grid');
$grid.packery('destroy').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
},1000);
$grid=$('.qc-grid');
$grid.packery('destroy').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
if(typeof google!=='undefined'){
if(typeof map!=='undefined'){
google.maps.event.addListener(map, "click", function(event){
jQuery('.gm-style-iw').each(function(){
jQuery(this).next().click();
})
});
}}
if(combined_search==1){
setTimeout(function(){
sbdradius_();
}, 500)
}})
$(document).on("change",".sbd_tag_filter_select", function(event){
var tag_filter_dropdown=$('.sbd_tag_filter_dropdown').length;
if(!tag_filter_dropdown){
return;
}
event.preventDefault();
if(cluster.pagination=='true'){
jQuery('.pdp-holder').show();
jQuery(".qc-grid-item ul").each(function(){
$("#"+jQuery(this).attr('id').replace("list", "holder")).jPages("destroy");
})
}
var tag_select_box=jQuery(this);
var filter=this.value, count=0;
var map_selector='sbd_all_location';
if(tag_select_box.parents('.sbd_tag_filter_dropdown').parent().hasClass('qcld_pd_tabcontent')){
map_selector=tag_select_box.parents('.sbd_tag_filter_dropdown').siblings('.sbd_map').attr('id');
}
if(typeof google!=='undefined'){
if(jQuery('#'+map_selector).length>0){
map=new google.maps.Map(document.getElementById(map_selector), {
center: new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute")),
zoom: parseInt(sld_variables.zoom),
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
});
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
oms=new OverlappingMarkerSpiderfier(map, {
markersWontMove: true,
markersWontHide: true,
basicFormatEvents: true
});
}}
$("#sbdopd-list-holder ul li").each(function(){
var dataTitleTxt=$(this).find('a').attr('data-tag');
if(typeof(dataTitleTxt)=='undefined'){
dataTitleTxt="-----";
}
if(dataTitleTxt.search(new RegExp(filter, "i")) < 0){
$(this).fadeOut();
$(this).removeClass("showMe");
}else{
$(this).show();
$(this).addClass("showMe");
count++;
map_selector='sbd_all_location';
if(tag_select_box.parents('.sbd_tag_filter_dropdown').parent().hasClass('qcld_pd_tabcontent')){
map_selector=tag_select_box.parents('.sbd_tag_filter_dropdown').siblings('.sbd_map').attr('id');
}
if(typeof google!=='undefined'){
if(jQuery('#'+map_selector).length>0){
var obj=$(this);
if(obj.hasClass('showMe')&&obj.parent().parent().parent().is(':visible')){
var icons=obj.find('.pd-bottom-area').clone();
icons.find('.pd-map').removeClass('open-mpf-sld-link');
if(typeof(obj.attr('data-address'))!=='undefined'&&obj.attr('data-address')!=''){
icons.find('.pd-map').attr("href", "https://www.google.com/maps/dir/?api=1&origin=none&destination="+encodeURIComponent(obj.attr('data-address'))+"&travelmode=driving");
icons.find('.pd-map').attr("target", "_blank");
}
icons.find('.open-mpf-sld-link').remove();
icons.find('.pd-map').remove();
icons=icons.html();
var custom_content=obj.find('.sbd_custom_content').clone();
custom_content=custom_content.html();
var others_info='';
if(obj.attr('data-local')!=''){
others_info +="<p><b><i class='fa fa-location-arrow' aria-hidden='true'></i> </b>"+obj.attr('data-local')+"</p>";
}
if(obj.attr('data-phone')!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b><a href='tel:"+obj.attr('data-phone')+"'>"+obj.attr('data-phone')+"</a></p>";
}else{
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b>"+obj.attr('data-phone')+"</p>";
}}
if(obj.attr('data-businesshour')!=''){
others_info +="<p><b><i class='fa fa-clock-o fa-clock' aria-hidden='true'></i> </b>"+obj.attr('data-businesshour')+"</p>";
}
var imgurl='';
if(obj.find('img').length>0){
imgurl=obj.find('img').attr('src');
}
var target='';
if(typeof(obj.find('a').attr('target'))!=='undefined'){
target='target="_blank"';
}
if(typeof(obj.find('a').attr('data-newtab'))!=='undefined'){
target='target="_blank"';
}
if(obj.attr('data-latlon')!==''&&typeof(obj.attr('data-latlon'))!=='undefined'){
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var title=obj.attr('data-title');
var address=obj.attr('data-address');
var url;
if(typeof(obj.find('a').attr('href'))!=='undefined'&&obj.find('a').is('a:not([href^="#"])')&&obj.find('a').is('a:not([href^="tel"])')){
url=obj.find('a').attr('href');
}else{
url=obj.attr('data-url');
}
var subtitle=obj.attr('data-subtitle');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
var map_marker_id=jQuery(this).attr('id');
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
};}
var marker=new google.maps.Marker({
icon:icon,
map: map,
position:  new google.maps.LatLng(latlng[0],latlng[1]),
title: title,
animation: google.maps.Animation.DROP,
address: address,
url: url,
mapSelectorID: map_marker_id
});
infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info);
bounds.extend(marker.getPosition());
map.fitBounds(bounds);
}}
}}
}});
if(cluster.cluster){
var markerCluster=new MarkerClusterer(map, markers,
{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
}
$(".qcpd-single-list-pd, .qcpd-single-list-pd-1, .opd-list-pd-style-8, .opd-list-pd-style-9, .pd-container").each(function(){
var visibleItems=$(this).find("li.showMe").length;
if(visibleItems==0){
$(this).hide();
$(this).parent('.qc-grid-item').hide();
}else{
$(this).show();
$(this).parent('.qc-grid-item').show();
}});
setTimeout(function(e){
if(cluster.pagination=='true'){
jQuery('.pdp-holder').show();
jQuery(".qc-grid-item ul").each(function(){
$("#"+jQuery(this).attr('id').replace("list", "holder")).jPages({
containerID:jQuery(this).attr('id'),
perPage:cluster.per_page,
});
})
}
$grid=$('.qc-grid');
$grid.packery('destroy').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
},1000);
$grid=$('.qc-grid');
$grid.packery('destroy').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
if(typeof google!=='undefined'){
google.maps.event.addListener(map, "click", function(event){
jQuery('.gm-style-iw').each(function(){
jQuery(this).next().click();
})
});
}})
$(document).on("click",".sbd-upvote-btn", function(event){
var chk=$(this);
event.preventDefault();
if(chk.data('requestRunning')){
return;
}
chk.data('requestRunning', true);
if($(this).hasClass('pd_upvote_animation')){
$(this).removeClass('pd_upvote_animation')
}
$(this).addClass('pd_upvote_animation');
var data_id=$(this).attr("data-post-id");
var data_title=$(this).attr("data-item-title");
var data_link=$(this).attr("data-item-link");
var parentLI=$(this).closest('li').attr("id");
var selectorBody=$('.qc-grid-item span[data-post-id="'+data_id+'"][data-item-title="'+data_title+'"][data-item-link="'+data_link+'"]');
var selectorWidget=$('.widget span[data-post-id="'+data_id+'"][data-item-title="'+data_title+'"][data-item-link="'+data_link+'"]');
var bodyLiId=$(".qc-grid-item").find(selectorBody).closest('li').attr("id");
var WidgetLiId=$(selectorWidget).closest('li').attr("id");
$.post(ajaxurl, {
action: 'qcpd_upvote_action',
post_id: data_id,
meta_title: data_title,
meta_link: data_link,
li_id: parentLI,
security: qc_sbd_get_ajax_nonce
}, function(data){
var json=$.parseJSON(data);
if(json.vote_status=='success'){
$('#'+parentLI+' .upvote-section .upvote-count').html(json.votes);
$('#'+parentLI+' .upvote-section .sbd-upvote-btn').css("color", "green");
$('#'+parentLI+' .upvote-section .upvote-count').css("color", "green");
$('#'+bodyLiId+' .upvote-section .upvote-count').html(json.votes);
$('#'+bodyLiId+' .upvote-section .sbd-upvote-btn').css("color", "green");
$('#'+bodyLiId+' .upvote-section .upvote-count').css("color", "green");
$('#'+WidgetLiId+' .upvote-section .upvote-count').html(json.votes);
$('#'+WidgetLiId+' .upvote-section .sbd-upvote-btn').css("color", "green");
$('#'+WidgetLiId+' .upvote-section .upvote-count').css("color", "green");
}});
});
$(document).on("click",".pd-sbd-upvote-btn-single", function(event){
event.preventDefault();
var chk=$(this);
if(chk.data('requestRunning')){
return;
}
chk.data('requestRunning', true);
if($(this).hasClass('pd_upvote_animation')){
$(this).removeClass('pd_upvote_animation')
}
$(this).addClass('pd_upvote_animation');
var data_id=$(this).attr("data-post-id");
var data_title=$(this).attr("data-item-title");
var data_link=$(this).attr("data-item-link");
var uniqueId=$(this).attr("data-unique");
$.post(ajaxurl, {
action: 'qcpd_upvote_action',
post_id: data_id,
meta_title: data_title,
meta_link: data_link,
li_id: '',
uniqueid: uniqueId,
security: qc_sbd_get_ajax_nonce
}, function(data){
var json=$.parseJSON(data);
if(json.vote_status=='success'){
$('.upvote-section-style-single .upvote-count').html(json.votes);
$('.upvote-section-style-single .upvote-on').css("color", "green");
$('.upvote-section-style-single .upvote-count').css("color", "green");
}});
});
$(document).on('click','.bookmark-btn',function(event){
event.preventDefault();
var data_id=$(this).attr("data-post-id");
var item_code=$(this).attr("data-item-code");
var is_bookmarked=$(this).attr("data-is-bookmarked");
var li_id=$(this).attr('data-li-id');
var parentLi=$(this).closest('li').attr('id');
var obj=$(this);
if(!bookmark.is_user_logged_in){
if(typeof login_url_pd==="undefined"||login_url_pd==''){
if(typeof(pduserMessage)!=="undefined"&&pduserMessage!==''){
alert(pduserMessage);
}else{
alert('You need to log in to add items to your favorite list.');
}}else{
if(typeof(pduserMessage)!=="undefined"&&pduserMessage!==''){
if(confirm(pduserMessage)){
window.location.href=login_url_pd;
}else{
}}else{
if(confirm('You need to log in to add items to your favorite list.')){
window.location.href=login_url_pd;
}else{
}}
}}else{
if(is_bookmarked==0){
$.post(ajaxurl, {
action: 'qcpd_bookmark_insert_action',
post_id: data_id,
item_code: item_code,
userid: bookmark.userid,
}, function(data){
obj.attr('data-is-bookmarked',1);
obj.children().removeClass('fa-star-o').addClass('fa-star');
if(typeof(template)!=="undefined"){
var newliid=parentLi+'_clone';
var cloneElem=$('#'+parentLi).clone();
cloneElem.prop({ id: newliid});
cloneElem.find('.upvote-section').remove();
cloneElem.find('.bookmark-section').find('span').attr("data-li-id",newliid);
cloneElem.find('.bookmark-section').find('span').find('i').removeClass('fa-star').addClass('fa-times-circle');
cloneElem.prependTo("#pd_bookmark_ul");
$('.qc-grid').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
}});
}else{
$.post(ajaxurl, {
action: 'qcpd_bookmark_remove_action',
post_id: data_id,
item_code: item_code,
userid: bookmark.userid,
}, function(data){
if(typeof li_id==="undefined"||li_id==''){
obj.attr('data-is-bookmarked',0);
obj.children().removeClass('fa-star').addClass('fa-star-o');
}else{
obj.closest('li').remove();
$('.qc-grid').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
}});
}}
})
$(document).on("click",".open-mpf-sld-link, .popup_instead_marker_details", function(e){
e.preventDefault();
var obj=$(this);
var getParent=obj.closest('li');
var mailto='false';
if(jQuery(this).data('mailto')==true){
mailto='true';
}
console.log('working')
var data_id=$(this).attr("data-post-id");
var data_title=$(this).attr("data-item-title");
var data_link=$(this).attr("data-item-link");
var container=$(this).attr("data-mfp-src");
var markericon='';
markericon=$(this).parent().data('marker');
var popup_map="true";
if($('.pd-map')[0]){
popup_map="true";
}else{
popup_map="false";
}
var upvote='on';
if(jQuery('.upvote-btn').length<1){
var upvote='off';
}
$(this).magnificPopup({
type:'inline',
midClick: true
});
$.post(ajaxurl, {
action: 'qcpd_load_long_description',
post_id: data_id,
meta_title: data_title,
meta_link: data_link,
popup_map: popup_map,
upvote: upvote,
mailto: mailto
}, function(data){
$(container+' .sbd_business_container').html(data);
if(typeof google!=='undefined'){
if(typeof getParent.attr('data-latlon')!=='undefined'||getParent.attr('data-latlon')!=''){
pos=getParent.attr('data-latlon').split(',');
var myLatlng=new google.maps.LatLng(pos[0],pos[1]);
var myOptions={
zoom: parseInt(sld_variables.popup_zoom),
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
}
var popup_map_container=document.getElementById("pd_popup_map_container");
if(popup_map_container){
map=new google.maps.Map(popup_map_container, myOptions);
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(getParent.attr('data-paid'))!='undefined'&&getParent.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(getParent.attr('data-marker'))!='undefined'&&getParent.attr('data-marker')!=''){
markericon=getParent.attr('data-marker');
}
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(parseFloat(sbd_custom_marker_image_width), parseFloat(sbd_custom_marker_image_height) ),
};}
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
if(typeof(markericon)!='undefined'&&markericon!=''){
var marker=new google.maps.Marker({
icon:icon,
position: myLatlng,
map: map,
title:data_title
});
}else{
var marker=new google.maps.Marker({
position: myLatlng,
map: map,
title:data_title
});
}}
}else{
pos=getParent.attr('data-latlon').split(',');
var myLatlng=new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute"));
var myOptions={
zoom: parseInt(sld_variables.popup_zoom),
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
}
var popup_map_container=document.getElementById("pd_popup_map_container");
if(popup_map_container){
map=new google.maps.Map(popup_map_container, myOptions);
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(getParent.attr('data-paid'))!='undefined'&&getParent.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(getParent.attr('data-marker'))!='undefined'&&getParent.attr('data-marker')!=''){
markericon=getParent.attr('data-marker');
}
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(parseFloat(sbd_custom_marker_image_width), parseFloat(sbd_custom_marker_image_height) ),
};}
if(typeof(markericon)!='undefined'&&markericon!=''){
var marker=new google.maps.Marker({
icon:icon,
position: myLatlng,
map: map,
title:data_title
});
}else{
var marker=new google.maps.Marker({
position: myLatlng,
map: map,
title:data_title
});
}}
}}
});
});
jQuery(document).on('click', '.style-7 .item-list-title', function(e){
if(jQuery(this).parents('.ilist-item-main').find('.feature-img-box').parent('a').hasClass('open-mpf-sld-link')){
e.preventDefault();
e.stopPropagation();
jQuery(this).parents('.ilist-item-main').find('.open-mpf-sld-link').trigger('click');
}});
/*$('.testclass').click(function(e){
e.preventDefault();
var data_id=$(this).attr("data-post-id");
var data_title=$(this).attr("data-item-title");
var data_link=$(this).attr("data-item-link");
var container=$(this).attr("data-mfp-src");
$.post(ajaxurl, {
action: 'qcpd_load_long_description',
post_id: data_id,
meta_title: data_title,
meta_link: data_link,
}, function(data){
$(container+' .sbd_business_container').html(data);
});
})*/
$('.open-mpf-sld-link').magnificPopup({
type:'inline',
midClick: true
});
$('.open-mpf-sbd').magnificPopup({
type:'inline',
midClick: true
});
/*$('.fa-map').click(function(e){
var obj=$(this).parent();
var address=obj.attr('full-address');
var mapId=obj.attr('data-mfp-src');
var geocoder;
var map;
var mapDiv=mapId.replace(/^#+/i, '');
var mapcontainer=jQuery('#'+mapDiv+' > .pd_map_container').attr('id');
var toAddress=address;
geocoder=new google.maps.Geocoder();
var latlng=new google.maps.LatLng(40.84, 14.25);
var myOptions={
zoom: sld_variables.zoom,
center: latlng,
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
navigationControl: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map=new google.maps.Map(document.getElementById(mapcontainer), myOptions);
if(geocoder){
geocoder.geocode({ 'address': toAddress}, function(results, status){
if(status==google.maps.GeocoderStatus.OK){
if(status!=google.maps.GeocoderStatus.ZERO_RESULTS){
map.setCenter(results[0].geometry.location);
var infowindow=new google.maps.InfoWindow({ content: '<b>'+toAddress+'</b>',
size: new google.maps.Size(150,50)
});
var marker=new google.maps.Marker({
position: results[0].geometry.location,
map: map,
title:toAddress
});
google.maps.event.addListener(marker, 'click', function(){
infowindow.open(map,marker);
});
}else{
alert("No results found");
}}else{
alert("Geocode was not successful for the following reason: " + status);
}});
}})*/
jQuery(document).on('click', '.sbd_email_form' , function(e){
e.preventDefault();
e.stopPropagation();
var obj=$(this);
if(sld_variables.mailto_send_email=='on'){
var send_email=obj.attr('data-email');
window.location='mailto:' + send_email;
return false;
}
jQuery('#sbd_email_name').val('');
jQuery('#sbd_email_email').val('');
jQuery('#sbd_email_subject').val('');
jQuery('#sbd_email_message').val('');
jQuery('#pdcode').val('');
jQuery('#sbd_email_to').val(obj.attr('data-email'));
jQuery('#sbd_email_status').html('');
var sbd_email_title=obj.closest('li').attr('data-title')
var sbd_email_subtitle=obj.closest('li').attr('data-subtitle')
jQuery('#sbd_email_title').val('');
jQuery('#sbd_email_title').val(sbd_email_title);
jQuery('#sbd_email_subtitle').val('');
jQuery('#sbd_email_subtitle').val(sbd_email_subtitle);
jQuery.magnificPopup.open({
items: {
src: '#sbd_email_form'
},
type: 'inline'
});
jQuery('#captcha_reload1').click();
})
jQuery("#sbd_email_form_id").submit(function(event){
event.preventDefault();
jQuery('#sbd_email_loading').hide();
jQuery("#sbd_email_status").html('');
var name=jQuery('#sbd_email_name').val();
var email=jQuery('#sbd_email_email').val();
var subject=jQuery('#sbd_email_subject').val();
var message=jQuery('#sbd_email_message').val();
var to=jQuery('#sbd_email_to').val();
var pdcode=jQuery('#pdcode').val();
var pdccode=jQuery('#pdccode').val();
var sbd_email_title=jQuery('#sbd_email_title').val();
var sbd_email_subtitle=jQuery('#sbd_email_subtitle').val();
var error=false;
if(name==''){
alert('Please provide the name');
error=true;
}
if(email==''){
alert('please provide the email');
error=true;
}
if(subject==''){
alert('please provide the subject');
error=true;
}
if(message==''){
alert('please provide the message content');
error=true;
}
if(pdcode==''){
alert('please provide the Captcha code');
error=true;
}
if(error==false){
jQuery('#sbd_email_loading').show();
var data={
'name':name,
'email':email,
'to': to,
'subject': subject,
'message': message,
'sbd_email_title': sbd_email_title,
'sbd_email_subtitle': sbd_email_subtitle,
}
if(jQuery(this).find('#pdcode').length > 0){
data.captcha=pdcode;
data.ccaptcha=pdccode;
}
if(jQuery(this).find('.sbd-ajaxmail-recaptcha').length > 0){
var recaptcha=$('#g-recaptcha-response').val();
data.recaptcha=recaptcha;
}
$.post(ajaxurl,
{
action:'qcld_pd_send_visitors_email',
data: data,
security: sld_variables.qcajax_nonce
},
function(data){
jQuery('#sbd_email_loading').hide();
var json=$.parseJSON(data);
if(json.status){
jQuery("#sbd_email_status").html(sld_variables.email_sent);
}else{
jQuery("#sbd_email_status").html(json.message);
}}
);
}});
jQuery('.pd-map').on('click', function(e){
if(typeof google!=='undefined'){
e.preventDefault();
e.stopPropagation();
var obj=$(this);
var address=obj.attr('full-address');
var mapId=obj.attr('data-mfp-src');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
var mapDiv=jQuery(mapId).find('.pd_map_container').attr('id');
jQuery('#'+mapDiv).height('400px');
var myOptions={
zoom: parseInt(sld_variables.zoom),
center: new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute")),
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
};
var toAddress=address;
navigator.geolocation.getCurrentPosition(function(position){
var geocoder=new google.maps.Geocoder();
geocoder.geocode({
"location": new google.maps.LatLng(position.coords.latitude, position.coords.longitude)
},
function(results, status){
if(status==google.maps.GeocoderStatus.OK){
var fromAddress=results[0].formatted_address;
var directionsRequest={
origin: fromAddress,
destination: toAddress,
travelMode: google.maps.DirectionsTravelMode.DRIVING,
unitSystem: google.maps.UnitSystem.METRIC
};
var mapObject=new google.maps.Map(document.getElementById(mapDiv), myOptions);
var directionsService=new google.maps.DirectionsService();
directionsService.route(directionsRequest,
function(response, status){
if(response.status=='OK'){
if(status==google.maps.DirectionsStatus.OK){
new google.maps.DirectionsRenderer({
map: mapObject,
directions: response
});
}else{
jQuery("#error").append("Unable to retrieve your route<br />");
}}else{
alert("Unable to retrieve your route. The Destination is too long.");
}}
);
}else{
console.log("Unable to retrieve your address");
}});
},
function(positionError){
console.log("Error: "+ positionError.message);
},
{
enableHighAccuracy: true,
timeout: 10 * 1000 
});
}});
$('#pd_enable_recurring').on('click', function(){
if(this.checked){
$('#paypalProcessor').hide();
$('#paypalProcessor_recurring').show();
}else{
$('#paypalProcessor').show();
$('#paypalProcessor_recurring').hide();
}})
});
jQuery(document).ready(function($){
if(sld_variables.pd_enable_autocomplete_search=='on'){
$(".pd_search_filter").autocomplete({
source: function(request, response){
if(request.term.length < 2){
$('.live_search_loader').remove();
$('#live-search').removeClass('live_search_loader_wrap');
return;
}
$('#live-search').addClass('live_search_loader_wrap');
$('.live_search_loader').remove();
$('.pd_search_filter').after('<i class="live_search_loader"></i>');
$.post(ajaxurl,
{
action:'qcpd_ajax_live_search_functions',
search: request.term,
},
function(data){
response($.parseJSON(data));
$('.live_search_loader').remove();
$('#live-search').removeClass('live_search_loader_wrap');
}
);
},
select: function (event, ui){
$('.pd_search_filter').val(ui.item.label);
jQuery('.pd_search_filter').trigger('keyup');
return false;
},
focus: function(event, ui){
$(".pd_search_filter").val(ui.item.label);
return false;
},
});
}
$(".pd_search_filter").keyup(function(){
var filter=$(this).val(), count=0;
if(typeof google!=='undefined'){
if(jQuery('#sbd_all_location').length>0){
markers=[];
map=new google.maps.Map(document.getElementById("sbd_all_location"), {
center: new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute")),
zoom: parseInt(sld_variables.zoom),
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
});
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
oms=new OverlappingMarkerSpiderfier(map, {
markersWontMove: true,
markersWontHide: true,
basicFormatEvents: true
});
if(sbd_map_fitbounds=='on'){
var bounds=new google.maps.LatLngBounds();
}}
}
$("#sbdopd-list-holder ul li").each(function(){
var dataTitleTxt=$(this).children('a').attr('data-title');
var dataurl=$(this).find('a').attr('href');
var datatag=$(this).find('a').attr('data-tag');
if(typeof(dataurl)=='undefined'){
dataurl="-----";
}
if(typeof(datatag)=='undefined'){
datatag="-----";
}
if(typeof(dataTitleTxt)=='undefined'){
dataTitleTxt="-----";
}
var parentH3=$(this).parentsUntil('.qc-grid-item').children('h3').text();
var pattern=filter.trim().match(/[a-zA-Z]+|[0-9]+/g)||"";
if(pattern){
pattern=pattern.map(function(el){
return '(?=.*' + el + ')';
});
pattern=pattern.join("");
}
if($(this).text().search(new RegExp(pattern, "i")) < 0&&dataurl.search(new RegExp(filter, "i")) < 0&&dataTitleTxt.search(new RegExp(filter, "i")) < 0&&parentH3.search(new RegExp(filter, "i")) < 0&&datatag.search(new RegExp(filter, "i")) < 0){
$(this).fadeOut();
$(this).removeClass("showMe").addClass('hideMe');
}else{
$(this).show();
$(this).addClass("showMe").removeClass('hideMe');
count++;
if(typeof google!=='undefined'){
if(jQuery('#sbd_all_location').length>0){
var obj=$(this);
var icons=obj.find('.pd-bottom-area').clone();
icons.find('.pd-map').removeClass('open-mpf-sld-link');
if(typeof(obj.attr('data-address'))!=='undefined'&&obj.attr('data-address')!=''){
icons.find('.pd-map').attr("href", "https://www.google.com/maps/dir/?api=1&origin=none&destination="+encodeURIComponent(obj.attr('data-address'))+"&travelmode=driving");
icons.find('.pd-map').attr("target", "_blank");
}
icons.find('.open-mpf-sld-link').remove();
icons.find('.pd-map').remove();
icons=icons.html();
var custom_content=obj.find('.sbd_custom_content').clone();
custom_content=custom_content.html();
var others_info='';
if(obj.attr('data-local')!=''){
others_info +="<p><b><i class='fa fa-location-arrow' aria-hidden='true'></i> </b>"+obj.attr('data-local')+"</p>";
}
if(obj.attr('data-phone')!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b><a href='tel:"+obj.attr('data-phone')+"'>"+obj.attr('data-phone')+"</a></p>";
}else{
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b>"+obj.attr('data-phone')+"</p>";
}}
if(obj.attr('data-businesshour')!=''){
others_info +="<p><b><i class='fa fa-clock-o fa-clock' aria-hidden='true'></i> </b>"+obj.attr('data-businesshour')+"</p>";
}
var imgurl='';
if(obj.find('img').length>0){
imgurl=obj.find('img').attr('src');
}
var target='';
if(typeof(obj.find('a').attr('target'))!=='undefined'){
target='target="_blank"';
}
if(typeof(obj.find('a').attr('data-newtab'))!=='undefined'){
target='target="_blank"';
}
if(obj.attr('data-latlon')!==''&&typeof(obj.attr('data-latlon'))!=='undefined'){
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var title=obj.attr('data-title');
var address=obj.attr('data-address');
var url;
if(typeof(obj.find('a').attr('href'))!=='undefined'&&obj.find('a').is('a:not([href^="#"])')&&obj.find('a').is('a:not([href^="tel"])')){
url=obj.find('a').attr('href');
}else{
url=obj.attr('data-url');
}
var subtitle=obj.attr('data-subtitle');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
var map_marker_id=jQuery(this).attr('id');
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
};}
var marker=new google.maps.Marker({
icon:icon,
map: map,
position:  new google.maps.LatLng(latlng[0],latlng[1]),
title: title,
animation: google.maps.Animation.DROP,
address: address,
url: url,
mapSelectorID: map_marker_id
});
markers.push(marker);
infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info);
if(sbd_map_fitbounds=='on'){
bounds.extend(marker.getPosition());
map.fitBounds(bounds);
}}
}}
}});
var visibleItems=0;
$(".qcpd-single-list-pd, .qc-sbd-single-item-11, .qcpd-single-list-pd-1, .opd-list-pd-style-8, .opd-list-pd-style-9, .pd-container").each(function(){
visibleItems=$(this).find("li.showMe").length;
if(visibleItems==0){
$(this).hide();
jQuery(this).parent('.qc-grid-item').addClass('sbd_hide_main_parent');
}else{
$(this).show();
jQuery(this).parent('.qc-grid-item').removeClass('sbd_hide_main_parent');
}});
if(visibleItems==0){
}
var invisibleItems=jQuery('.hideMe');
$('.qc-grid').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
if(typeof google!=='undefined'&&cluster.map=='true'){
google.maps.event.addListener(map, "click", function(event){
jQuery('.gm-style-iw').each(function(){
jQuery(this).next().click();
})
});
}
if(cluster.cluster){
var markerCluster=new MarkerClusterer(map, markers,
{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
}
jQuery(window).trigger('resize');
});
$('#live-search').on('submit',function(e){
e.preventDefault();
})
$('#captcha_reload').on('click', function(e){
e.preventDefault();
$.post(ajaxurl,
{
action:'qcld_pd_change_captcha1',
security: sld_variables.qcajax_nonce
},
function(data){
var json=$.parseJSON(data);
$('#pd_captcha_image_register').attr('src', json.url);
$('#pdccode_register').val(json.code);
}
);
})
$('#captcha_reload1').on('click', function(e){
e.preventDefault();
$.post(ajaxurl,
{
action:'qcld_pd_change_captcha1',
security: sld_variables.qcajax_nonce
},
function(data){
var json=$.parseJSON(data);
$('#pd_captcha_image').attr('src', json.url);
$('#pdccode').val(json.code);
}
);
})
$('#sbd_full_address').on('focusout', function(e){
var objc=$(this);
var geocoder=new google.maps.Geocoder();
var address=objc.val();
geocoder.geocode({ 'address': address}, function(results, status){
if(status==google.maps.GeocoderStatus.OK){
var latitude=results[0].geometry.location.lat();
var longitude=results[0].geometry.location.lng();
$('#sbd_lat').val(latitude);
$('#sbd_long').val(longitude);
}else{
console.log('Unable to retrive lat, lng from this address');
}});
})
$('#sbd_full_address').on('focus', function(e){
var objc=$(this);
var input=document.getElementById(objc.attr('id'));
var autocomplete=new google.maps.places.Autocomplete(input);
var geocoder=new google.maps.Geocoder;
autocomplete.addListener('place_changed', function(){
var place=autocomplete.getPlace();
if(!place.place_id){
return;
}
geocoder.geocode({'placeId': place.place_id}, function(results, status){
if(status!=='OK'){
alert('Geocoder failed due to: ' + status);
return;
}
var latitude=results[0].geometry.location.lat();
var longitude=results[0].geometry.location.lng();
$('#sbd_lat').val(latitude);
$('#sbd_long').val(longitude);
})
})
})
jQuery(window).resize(function(){
setTimeout(function(){
jQuery('.qc-grid').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
console.log('resize');
}, 500);
});
});
if(typeof google!=='undefined'){
if(cluster.map=='true'){
var geocoder;
var map;
var circle=null;
var markers=[];
var iw;
var bounds=new google.maps.LatLngBounds();
if(document.getElementById("sbd_all_location")!==null){
window.addEventListener("load", initialize);
}
var oms;
initialize();
}}
function initialize(){
if(typeof google!=='undefined'){
var map_styles=[];
if(sld_variables.enable_landmarks=='off'){
map_styles=[
{
"featureType": "administrative",
"elementType": "geometry",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "poi",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "transit",
"stylers": [
{
"visibility": "off"
}
]
}
];
}else{
map_styles=[];
}
if(jQuery('#sbd_all_location').length>0){
map=new google.maps.Map(document.getElementById("sbd_all_location"), {
center: new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute")),
zoom: parseInt(sld_variables.zoom),
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative',
styles: map_styles,
});
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
geocoder=new google.maps.Geocoder();
oms=new OverlappingMarkerSpiderfier(map, {
markersWontMove: true,
markersWontHide: true,
basicFormatEvents: true
});
myLoop();
}}
}
function clearmarker(){
if(typeof google!=='undefined'){
for (var i=0; i < markers.length; i++){
markers[i].setMap(null);
}}
}
function sbdradius_(){
jQuery('.qcpd-single-list-pd').removeAttr("style");
jQuery('.qc-grid-item ul li').removeAttr("style");
jQuery('#distance_no_result_found').remove();
if(typeof google!=='undefined'){
if(sld_variables.sbd_combine_distant_tag_live_search=="on"){
jQuery('.sbd-tag-filter-area.pd_tag_filter-active').removeClass('pd_tag_filter-active').trigger('click');
var search_filter=jQuery('.pd_search_filter').val();
if(search_filter!=''){
jQuery('.pd_search_filter').trigger('keyup');
}}
var address=jQuery('.sbd_location_name:visible').val();
var radiusi=jQuery('.sbd_distance:visible').val();
var sbd_location_name=jQuery('.sbd_location_name').length;
var sbd_distance=jQuery('.sbd_distance').length;
if((cluster.distance_search=='true')&&(address==undefined||address=='') ){
alert(sld_variables.distance_location_text);
return;
}
if((cluster.distance_search=='true')&&(radiusi==undefined||radiusi=='')){
alert(sld_variables.distance_value_text);
return;
}
if(jQuery('.sdb_distance_cal').val()=='miles'){
radiusi=radiusi*1.60934;
}
var radius=parseInt(radiusi, 10)*1000;
if(jQuery('#sbd_all_location').length>0){
map=new google.maps.Map(document.getElementById("sbd_all_location"), {
center: new google.maps.LatLng(localStorage.getItem("qcld_map_latitite"), localStorage.getItem("qcld_map_longitute")),
zoom: parseInt(sld_variables.zoom),
mapTypeId: google.maps.MapTypeId.ROADMAP,
gestureHandling: 'cooperative'
});
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
oms=new OverlappingMarkerSpiderfier(map, {
markersWontMove: true,
markersWontHide: true,
basicFormatEvents: true
});
}
var counter=0;
if(typeof geocoder==="undefined"){
var geocoder=new google.maps.Geocoder();
}
if(typeof map==="undefined"){
var map;
}
geocoder.geocode({ 'address': address}, function(results, status){
if(status==google.maps.GeocoderStatus.OK){
map.setCenter(results[0].geometry.location);
var searchCenter=results[0].geometry.location;
if(circle) circle.setMap(null);
circle=new google.maps.Circle({center:searchCenter,
radius: radius,
strokeColor: sld_variables.radius_circle_color,
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: sld_variables.radius_circle_color,
fillOpacity: 0.35,
map: map});
clearmarker();
markers=[];
var list_selector=".qc-grid-item ul li";
if(sld_variables.sbd_combine_distant_tag_live_search=="on"){
if(jQuery('.pdp-holder').is(':visible')){
list_selector=".qc-grid-item ul li";
}else{
list_selector=".qc-grid-item ul li:visible";
}}
jQuery(list_selector).each(function(){
var obj=jQuery(this);
var icons=obj.find('.pd-bottom-area').clone();
icons.find('.pd-map').removeClass('open-mpf-sld-link');
if(typeof(obj.attr('data-address'))!=='undefined'&&obj.attr('data-address')!=''){
icons.find('.pd-map').attr("href", "https://www.google.com/maps/dir/?api=1&origin=none&destination="+encodeURIComponent(obj.attr('data-address'))+"&travelmode=driving");
icons.find('.pd-map').attr("target", "_blank");
}
icons.find('.open-mpf-sld-link').remove();
icons.find('.pd-map').remove();
icons=icons.html();
var custom_content=obj.find('.sbd_custom_content').clone();
custom_content=custom_content.html();
var others_info='';
if(obj.attr('data-local')!=''){
others_info +="<p><b><i class='fa fa-location-arrow' aria-hidden='true'></i> </b>"+obj.attr('data-local')+"</p>";
}
if(obj.attr('data-phone')!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b><a href='tel:"+obj.attr('data-phone')+"'>"+obj.attr('data-phone')+"</a></p>";
}else{
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b>"+obj.attr('data-phone')+"</p>";
}}
if(obj.attr('data-businesshour')!=''){
others_info +="<p><b><i class='fa fa-clock-o fa-clock' aria-hidden='true'></i> </b>"+obj.attr('data-businesshour')+"</p>";
}
var imgurl='';
if(obj.find('img').length>0){
imgurl=obj.find('img').attr('src');
}
var target='';
if(typeof(obj.find('a').attr('target'))!=='undefined'){
target='target="_blank"';
}
if(typeof(obj.find('a').attr('data-newtab'))!=='undefined'){
target='target="_blank"';
}
if(obj.attr('data-latlon')!==''&&typeof(obj.attr('data-latlon'))!=='undefined'){
i++;
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var title=obj.attr('data-title');
var address=obj.attr('data-address');
var url;
if(typeof(obj.find('a').attr('href'))!=='undefined'&&obj.find('a').is('a:not([href^="#"])')&&obj.find('a').is('a:not([href^="tel"])')){
url=obj.find('a').attr('href');
}else{
url=obj.attr('data-url');
}
var subtitle=obj.attr('data-subtitle');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
if(google.maps.geometry.spherical.computeDistanceBetween(new google.maps.LatLng(latlng[0],latlng[1]),searchCenter) < radius){
var map_marker_id=jQuery(this).attr('id');
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
};}
var marker=new google.maps.Marker({
map: map,
icon: icon,
position:  new google.maps.LatLng(latlng[0],latlng[1]),
title: title,
animation: google.maps.Animation.DROP,
address: address,
url: url,
mapSelectorID: map_marker_id
});
markers.push(marker);
infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info);
bounds.extend(marker.getPosition());
if(sbd_map_fitbounds=='on'){
map.fitBounds(bounds);
}
obj.removeClass("showMe");
obj.show();
obj.addClass("showMe");
}else{
obj.fadeOut();
obj.hide();
obj.removeClass("showMe");
}}else{
obj.fadeOut();
obj.hide();
obj.removeClass("showMe");
}});
if(cluster.pagination=='true'){
jQuery('.pdp-holder').hide();
}
map.fitBounds(circle.getBounds());
setTimeout(function(){
var visibleItems=0;
var totalvisibleitem=0;
jQuery(".qcpd-single-list-pd, .qcpd-single-list-pd-1, .opd-list-pd-style-8, .opd-list-pd-style-9, .pd-container, .qc-sbd-single-item-11, .qc-sld-masonary-15").each(function(){
visibleItems=jQuery(this).find("li.showMe").length;
totalvisibleitem +=jQuery(this).find("li.showMe").length;
if(visibleItems==0){
jQuery(this).hide();
}else{
jQuery(this).show();
}});
setTimeout(function(){
jQuery('.qc-grid').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
setTimeout(function(){
if(totalvisibleitem==0){
jQuery('#sbdopd-list-holder').append('<h2 id="distance_no_result_found">'+sld_variables.distance_no_result_text+'</h2>');
}},500)
},1000)
},1000)
if(cluster.cluster){
var markerCluster=new MarkerClusterer(map, markers,
{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
}}else{
console.log('Geocode was not successful for the following reason: ' + status);
counter++;
/*if(counter<2){
setTimeout(function(){
sbdradius_();
}, 1500);
}*/
}});
}
return;
}
function sbdclearradius_(){
if(typeof google!=='undefined'){
var obj=jQuery(this);
jQuery('.sbd_location_name').val('');
jQuery('.sbd_distance').val('');
if(circle) circle.setMap(null);
jQuery(".qcpd-single-list-pd, .qcpd-single-list-pd-1, .opd-list-pd-style-8, .opd-list-pd-style-9, .pd-container, .qc-sbd-single-item-11, .qc-sld-masonary-15").each(function(){
jQuery(this).show();
});
jQuery(".qc-grid-item ul li").each(function(){
jQuery(this).show();
})
clearmarker();
myLoop ();
if(cluster.pagination=='true'){
jQuery('.pdp-holder').show();
jQuery(".qc-grid-item ul").each(function(){
console.log("#"+jQuery(this).attr('id'));
$("#"+jQuery(this).attr('id').replace("list", "holder")).jPages({
containerID:jQuery(this).attr('id'),
perPage:cluster.per_page,
});
})
}
setTimeout(function(){
jQuery('.qc-grid').packery({
itemSelector: '.qc-grid-item',
gutter: 10
});
},1000)
}}
var i=0;
function myLoop (){
if(typeof google!=='undefined'){
markers=[];
jQuery("#sbdopd-list-holder ul li").each(function(){
var obj=jQuery(this);
var icons=obj.find('.pd-bottom-area').clone();
icons.find('.pd-map').removeClass('open-mpf-sld-link');
if(typeof(obj.attr('data-address'))!=='undefined'&&obj.attr('data-address')!=''){
icons.find('.pd-map').attr("href", "https://www.google.com/maps/dir/?api=1&origin=none&destination="+encodeURIComponent(obj.attr('data-address'))+"&travelmode=driving");
icons.find('.pd-map').attr("target", "_blank");
}
icons.find('.open-mpf-sld-link').remove();
icons.find('.pd-map').remove();
icons=icons.html();
var custom_content=obj.find('.sbd_custom_content').clone();
custom_content=custom_content.html();
var others_info='';
if(obj.attr('data-local')!=''){
others_info +="<p><b><i class='fa fa-location-arrow' aria-hidden='true'></i> </b>"+obj.attr('data-local')+"</p>";
}
if(obj.attr('data-phone')!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b><a href='tel:"+obj.attr('data-phone')+"'>"+obj.attr('data-phone')+"</a></p>";
}else{
others_info +="<p><b><i class='fa fa-phone' aria-hidden='true'></i> </b>"+obj.attr('data-phone')+"</p>";
}}
if(obj.attr('data-businesshour')!=''){
others_info +="<p><b><i class='fa fa-clock-o fa-clock' aria-hidden='true'></i> </b>"+obj.attr('data-businesshour')+"</p>";
}
var imgurl='';
if(obj.find('img').length>0){
imgurl=obj.find('img').attr('src');
}
var target='';
if(typeof(obj.find('a').attr('target'))!=='undefined'){
target='target="_blank"';
}
if(typeof(obj.find('a').attr('data-newtab'))!=='undefined'){
target='target="_blank"';
}
if(obj.attr('data-latlon')!==''&&typeof(obj.attr('data-latlon'))!=='undefined'){
i++;
var locations=obj.attr('data-latlon');
var latlng=locations.split(',');
var title=obj.attr('data-title');
var address=obj.attr('data-address');
var url;
if(typeof(obj.find('a').attr('href'))!=='undefined'&&obj.find('a').is('a:not([href^="#"])')&&obj.find('a').is('a:not([href^="tel"])')){
url=obj.find('a').attr('href');
}else{
url=obj.attr('data-url');
}
var subtitle=obj.attr('data-subtitle');
var markericon='';
if(sld_variables.global_marker!=''){
markericon=sld_variables.global_marker;
}
if(typeof(obj.attr('data-paid'))!='undefined'&&obj.attr('data-paid')!=''){
markericon=sld_variables.paid_marker_default;
if(sld_variables.paid_marker!=''){
markericon=sld_variables.paid_marker;
}}
if(typeof(obj.attr('data-marker'))!='undefined'&&obj.attr('data-marker')!=''){
markericon=obj.attr('data-marker');
}
var map_marker_id=jQuery(this).attr('id');
var icon=markericon;
if(markericon!=''){
icon={
url: markericon,
scaledSize: new google.maps.Size(sbd_custom_marker_image_width, sbd_custom_marker_image_height),
};}
var marker=new google.maps.Marker({
map: map,
icon: icon,
position:  new google.maps.LatLng(latlng[0],latlng[1]),
title: title,
animation: google.maps.Animation.DROP,
address: address,
url: url,
mapSelectorID: map_marker_id
});
markers.push(marker);
infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info);
if(sbd_map_fitbounds=='on'){
bounds.extend(marker.getPosition());
map.fitBounds(bounds);
}}
})
if(markers.length==1){
setTimeout(function(){
map.setZoom(parseInt(sld_variables.zoom));
}, 100)
}
if(cluster.cluster){
var markerCluster=new MarkerClusterer(map, markers,
{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
}
var default_lat=localStorage.getItem("qcld_map_latitite");
var default_long=localStorage.getItem("qcld_map_longitute");
if((default_lat > -90&&default_lat < 90)&&(default_long > -180&&default_long < 180)){
map.setCenter(new google.maps.LatLng(default_lat, default_long));
}
}}
function infoWindow(marker, map, title, address, url, subtitle, imgurl, target, icons, custom_content, others_info){
if(typeof google!=='undefined'){
if(sld_variables.popup_click_instead_hover!='on'){
google.maps.event.addListener(marker, 'mouseover', function(){
if(iw){
iw.close();
}
var main_click_check=cluster.main_click;
var html="<div>";
if(imgurl!=''&&!cluster.image_infowindow){
html +="<div class='sbd_pop_img'><img src='"+imgurl+"' /></div>";
}
html +="<div class='sbd_pop_text'><h3>" + title + "</h3><p>" + subtitle + "</p>";
if(address!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
html+="<p><b><i class='fa fa-map-marker fa-map-marker-alt' aria-hidden='true'></i> </b><a href='http://maps.google.com/maps?q=" + encodeURIComponent(address) + "' target='_blank'>" + address + "</a></p>";
}else{
html+="<p><b><i class='fa fa-map-marker fa-map-marker-alt' aria-hidden='true'></i> </b>" + address + "</p>";
}}
if(others_info!=''){
html+=others_info;
}
if(custom_content!=''&&typeof(custom_content)!='undefined'){
html+=custom_content;
}
html +="</div></div>";
if(url!=''&&url.length > 2){
html +="<a style='text-align: center;display:block;font-weight: bold;' href='" + url + "' "+ target +">"+sld_variables.view_details+"</a>";
}else if(main_click_check==2){
html +="<a style='text-align: center;display:block;font-weight: bold;' class='popup_instead_marker_details_trigger' item-id='"+marker.mapSelectorID+"' href='#' >"+sld_variables.view_details+"</a>";
}
html +="<div class='sbd_bottom_area_marker'>"+icons+"</div>";
html+="</div></div>";
iw=new google.maps.InfoWindow({
content: html,
maxWidth: 230,
disableAutoPan: disableAutoPan
});
marker.setAnimation(google.maps.Animation.BOUNCE);
iw.setZIndex(9999);
iw.open(map, marker);
});
}
google.maps.event.addListener(marker, 'click', function(){
if(iw){
iw.close();
}
var pd_enable_des_popup_instead_marker_details=sld_variables.pd_enable_des_popup_instead_marker_details;
var main_click_check=cluster.main_click;
if(pd_enable_des_popup_instead_marker_details=='on'&&main_click_check==2){
jQuery('#'+marker.mapSelectorID + ' .popup_instead_marker_details.open-mpf-sld-link').trigger('click');
return false;
}
var html="<div>";
if(imgurl!=''&&!cluster.image_infowindow){
html +="<div class='sbd_pop_img'><img src='"+imgurl+"' /></div>";
}
html +="<div class='sbd_pop_text'><h3>" + title + "</h3><p>" + subtitle + "</p>";
if(address!=''){
if(sbd_enable_map_addr_phone_clickable=='on'){
html+="<p><b><i class='fa fa-map-marker fa-map-marker-alt' aria-hidden='true'></i> </b><a href='http://maps.google.com/maps?q=" + encodeURIComponent(address) + "' target='_blank'>" + address + "</a></p>";
}else{
html+="<p><b><i class='fa fa-map-marker fa-map-marker-alt' aria-hidden='true'></i> </b>" + address + "</p>";
}}
if(others_info!=''){
html+=others_info;
}
if(custom_content!=''&&typeof(custom_content)!='undefined'){
html+=custom_content;
}
html +="</div></div>";
if(url!=''&&url.length > 2&&main_click_check!==2){
html +="<a style='text-align: center;display:block;font-weight: bold;' href='" + url + "' "+ target +">"+sld_variables.view_details+"</a>";
}else if(main_click_check==2){
html +="<a style='text-align: center;display:block;font-weight: bold;' class='popup_instead_marker_details_trigger' item-id='"+marker.mapSelectorID+"' href='#' >"+sld_variables.view_details+"</a>";
}
html +="<div class='sbd_bottom_area_marker'>"+icons+"</div>";
html+="</div></div>";
iw=new google.maps.InfoWindow({
content: html,
maxWidth: 230,
disableAutoPan: disableAutoPan
});
marker.setAnimation(null);
iw.setZIndex(9999);
iw.open(map, marker);
});
google.maps.event.addListener(marker, 'mouseout', function(){
marker.setAnimation(null);
});
oms.addMarker(marker);
}}
jQuery(document).ready(function($){
$('.sbd_location_name').focus(function(){
$('.sbd_current_location').show();
})
$('.sbd_location_name').blur(function(){
setTimeout(function(){
$('.sbd_current_location').hide();
},400)
})
$(document).on('click','.sbd_current_location', function(e){
if(typeof google!=='undefined'){
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(showPosition);
}else{
console.log('Geolocation is not supported by this browser.');
}
function showPosition(position){
var geocoder=new google.maps.Geocoder();
var latLng=new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
if(geocoder){
geocoder.geocode({ 'latLng': latLng}, function (results, status){
if(status==google.maps.GeocoderStatus.OK){
$('.sbd_location_name').val(results[0].formatted_address);
}else{
}});//geocoder.geocode()
}}
}})
$(document).on('click', "#sbd_generate", function(e){
var objc=$(this);
if($('#sbd_item_link').val()!=''){
var html="<div id='sbd_ajax_preloader'><div class='sbd_ajax_loader'></div></div>";
$('body').append(html);
$.post(ajaxurl, {
action: 'qcpd_generate_text',
url: $('#sbd_item_link').val(),
},
function(data){
$('#sbd_ajax_preloader').remove();
var data=JSON.parse(data);
$('#sbd_title').val(data.title)
$('#sbd_subtitle').val(data.description)
});
}else{
alert('Item link field cannot left empty!');
}})
$(".sbd_filter_toggle").click(function(){
$(".sbd_filter_parent").slideToggle("fast", function(){
});
});
$("body").on('focus', ".sbd_location_name", function(e){
var objc=$(this);
var input=document.getElementById(objc.attr('id'));
if(typeof google!=='undefined'){
var autocomplete=new google.maps.places.Autocomplete(input);
var geocoder=new google.maps.Geocoder;
autocomplete.addListener('place_changed', function(){
var place=autocomplete.getPlace();
if(!place.place_id){
return;
}
/*geocoder.geocode({'placeId': place.place_id}, function(results, status){
if(status!=='OK'){
alert('Geocoder failed due to: ' + status);
return;
}
var latitude=results[0].geometry.location.lat();
var longitude=results[0].geometry.location.lng();
objc.closest('.cmb_metabox').find('#qcpd_item_latitude input').val(latitude);
objc.closest('.cmb_metabox').find('#qcpd_item_longitude input').val(longitude);
})*/
})
}})
$(document).on('click','#pd_tag_select', function(){
$('#'+$('#pd-tags').attr('data')).val($('#pdtagvalue').val());
$('#fa-field-modal-tag').remove();
})
/*$(document).on('click', '.pd_default_tags_other', function(e){
var elem=$(this);
var elemid=this.id;
$.post(ajaxurl, {
action: 'qcpd_tag_pd_page',
},
function(data){
$('#main-footer').append(data);
$('#pdtagvalue').val(elem.val());
$('#pd-tags').attr('data', elemid);
$('#pd-tags').tagInput();
$('.labelinput').focus();
$.post(ajaxurl, {
action: 'qcpd_search_pd_tags',
},
function(data){
console.log(data);
$('.labelinput').autocomplete({
source: data.split(','),
});
});
});
})*/
})
jQuery('.sbd-single-item-map').each(function(){
if(typeof google!=='undefined'){
var item_id=jQuery(this).attr('id');
sbd_single_item_initMap(item_id);
}});
function sbd_single_item_initMap(map_id){
var latitude=parseFloat(jQuery('#'+map_id).siblings('.sbd-single-item').attr('data-latitude'));
var longitude=parseFloat(jQuery('#'+map_id).siblings('.sbd-single-item').attr('data-longitude'));
var uluru={lat: latitude, lng: longitude};
var map=new google.maps.Map(document.getElementById(map_id), {
zoom: parseInt(sld_variables.zoom),
center: uluru
});
if((typeof pd_snazzymap_js==="object"||typeof pd_snazzymap_js==='function')&&(pd_snazzymap_js!==null)){
map.setOptions({styles: pd_snazzymap_js});
}
var contentString='<div class="sbd-single-item-infoWindow">'+jQuery('#'+map_id).siblings('.sbd-single-item').html()+'</div>';
var map_title=jQuery('#'+map_id).siblings('.sbd-single-item').find('.sbd-single-item-title').text();
var infowindow=new google.maps.InfoWindow({
content: contentString,
disableAutoPan: disableAutoPan
});
var marker=new google.maps.Marker({
position: uluru,
map: map,
title: map_title
});
marker.addListener('click', function(){
infowindow.open(map, marker);
});
infowindow.open(map, marker);
}
jQuery(document).ready(function(){
if(typeof google!=='undefined'){
jQuery("body").on('keyup focusout keypress', "input[name*='[qcpd_item_latitude]']", function(e){
var val=jQuery(this).val();
var error=0;
var error_code='';
if(val.trim()){
if(!jQuery(this).parent('.field-item').next().hasClass('sbd_error_field')){
jQuery(this).parent('.field-item').after('<p class="sbd_error_field"></p>');
}
if(isNaN(val)){
error=1;
error_code='NaN';
}
if(error==1&&error_code=='NaN'){
}else{
if(val > -90&&val < 90){
}else{
error=1;
error_code='invalid_lat';
}}
if(error==1){
console.log(error_code);
jQuery(this).parent('.field-item').next('.sbd_error_field').html('Please enter a valid Latitude');
jQuery(this).parents('form#post').attr('onsubmit', 'return false');
jQuery(this).parents('form#post').find('#publish').attr('disabled', true);
}}
if(error==0){
jQuery(this).parent('.field-item').next('.sbd_error_field').remove();
if(!jQuery("input[name*='[qcpd_item_longitude]']").parent('.field-item').next().hasClass('sbd_error_field')){
jQuery(this).parents('form#post').removeAttr('onsubmit');
jQuery(this).parents('form#post').find('#publish').removeAttr('disabled').removeClass('disabled');
}}
});
jQuery("body").on('keyup focusout keypress', "input[name*='[qcpd_item_longitude]']", function(e){
var val=jQuery(this).val();
var error=0;
var error_code='';
if(val.trim()){
if(!jQuery(this).parent('.field-item').next().hasClass('sbd_error_field')){
jQuery(this).parent('.field-item').after('<p class="sbd_error_field"></p>');
}
if(isNaN(val)){
error=1;
error_code='NaN';
}
if(error==1&&error_code=='NaN'){
}else{
if(val > -180&&val < 180){
}else{
error=1;
error_code='invalid_long';
}}
if(error==1){
console.log(error_code);
jQuery(this).parent('.field-item').next('.sbd_error_field').html('Please enter a valid Longitude');
jQuery(this).parents('form#post').attr('onsubmit', 'return false');
jQuery(this).parents('form#post').find('#publish').attr('disabled', true);
}}
if(error==0){
jQuery(this).parent('.field-item').next('.sbd_error_field').remove();
if(!jQuery("input[name*='[qcpd_item_latitude]']").parent('.field-item').next().hasClass('sbd_error_field')){
jQuery(this).parents('form#post').removeAttr('onsubmit');
jQuery(this).parents('form#post').find('#publish').removeAttr('disabled').removeClass('disabled');
}}
});
jQuery('.sbd-frontend-submission-form').on('submit', function(e){
var lat_error=0;
var lat_error_code='';
var long_error=0;
var long_error_code='';
var latitude=jQuery(this).find('input[name="item_latitude"]').val();
var longitude=jQuery(this).find('input[name="item_longitude"]').val();
if(latitude > -90&&latitude < 90){
}else{
lat_error=1;
lat_error_code='invalid_lat';
}
if(longitude > -180&&longitude < 180){
}else{
long_error=1;
long_error_code='invalid_long';
}
if(!latitude){
lat_error=1;
lat_error_code='invalid_lat';
}
if(!longitude){
long_error=1;
long_error_code='invalid_long';
}
if(lat_error==1||long_error==1){
if(jQuery(this).find('input[name="item_latitude"]').siblings('label').find('.pd_required').length > 0){
if(lat_error_code=='invalid_lat'){
e.preventDefault();
alert("Invalid Latitude. Please Enter a valid Latitude");
}}
if(jQuery(this).find('input[name="item_longitude"]').siblings('label').find('.pd_required').length > 0){
if(long_error_code=='invalid_long'){
e.preventDefault();
alert("Invalid Longitude. Please Enter a valid Longitude");
}}
}});
}});
jQuery('.qc-grid-item ul li a:first-of-type').on('mouseover mousemove', function(){
if(typeof google!=='undefined'&&cluster.map=='true'&&cluster.map_marker_scroll=='true'){
var selectorID=jQuery(this).parent('li').attr('id');
SBDselectMarker(selectorID, 'start');
}});
jQuery('.qc-grid-item ul li a:first-of-type').on('mouseout', function(){
if(typeof google!=='undefined'&&cluster.map=='true'&&cluster.map_marker_scroll=='true'){
var selectorID=jQuery(this).parent('li').attr('id');
SBDselectMarker(selectorID, 'stop');
}});
function SBDselectMarker(mapSelectorID, status){
if(typeof google!=='undefined'){
var i, len, map_marker;
for (i=0; i < markers.length; i++){
if(markers[i].mapSelectorID==mapSelectorID){
map_marker=markers[i];
if(status=="start"){
map_marker.setAnimation(google.maps.Animation.BOUNCE);
google.maps.event.trigger(map_marker, 'mouseover');
}else{
map_marker.setAnimation(null);
}}
}}
}
function qcsbd_CheckArray(array1, array2){
if(Array.isArray(array1)&&Array.isArray(array2)){
return array2.every(function (v){
return array1.includes(v);
});
}else{
return false;
}}
jQuery(document).ready(function($){
$(document).on("click",".sbd_sidebar_pop_text",function(){
var value=jQuery(this).attr('data-id');
jQuery('#'+value + ' a.open-mpf-sld-link').trigger('click');
});
$('.pd_required').parent().parent().find('select').prop('required', true);
$('.pd_required').parent().parent().find('input[type="text"]').prop('required', true);
$('.pd_default_tags_input').prop('required',false);
if($('input[type=checkbox][name="pd_default_tags_other"]:checked').val()=='other'){
$('.pd_default_tags_input').prop('required', true);
}
$(document).on('click', 'input[type=checkbox][name="pd_default_tags_other"]', function(e){
$('.pd_default_tags_input').prop('required', false);
$('.pd_default_tags_input').hide();
if($('input[type=checkbox][name="pd_default_tags_other"]:checked').val()=='other'){
$('.pd_default_tags_input').show();
$('.pd_default_tags_input').prop('required', true);
}});
$(document).on("click", ".popup_instead_marker_details_trigger", function(e){
e.preventDefault();
var value=jQuery(this).attr('item-id');
jQuery('#'+value + ' .popup_instead_marker_details.open-mpf-sld-link').trigger('click');
});
});
/*
jQuery(document).ready(function($){
if(typeof google!=='undefined'){
console.log(markers);
for (var i=0; i < markers.length; i++){
google.maps.event.addListener(markers[i], 'click', function(){
if(iw){
iw.close();
}
alert('Marker clicked!');
});
google.maps.event.addListener(markers[i], 'click', function(){
console.log(theMarker.get('id'));
});
google.maps.event.addListener(marker, 'click', toggleBounce);
}}
});*/;
(function(){
var supportsPassive=false;
try {
var opts=Object.defineProperty({}, 'passive', {
get:function(){
supportsPassive=true;
}});
window.addEventListener('testPassive', null, opts);
window.removeEventListener('testPassive', null, opts);
} catch(e){}
function init(){
var input_begin='';
var keydowns={};
var lastKeyup=null;
var lastKeydown=null;
var keypresses=[];
var modifierKeys=[];
var correctionKeys=[];
var lastMouseup=null;
var lastMousedown=null;
var mouseclicks=[];
var mouseclickCoordinates=[];
var mousemoveTimer=null;
var lastMousemoveX=null;
var lastMousemoveY=null;
var mousemoveStart=null;
var mousemoves=[];
var touchmoveCountTimer=null;
var touchmoveCount=0;
var lastTouchEnd=null;
var lastTouchStart=null;
var touchEvents=[];
var scrollCountTimer=null;
var scrollCount=0;
var correctionKeyCodes=[ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ];
var modifierKeyCodes=[ 'Shift', 'CapsLock' ];
var forms=document.querySelectorAll('form[method=post]');
for(var i=0; i < forms.length; i++){
var form=forms[i];
var formAction=form.getAttribute('action');
if(formAction){
if(formAction.indexOf('http://')==0||formAction.indexOf('https://')==0){
if(formAction.indexOf('http://' + window.location.hostname + '/')!=0&&formAction.indexOf('https://' + window.location.hostname + '/')!=0){
continue;
}}
}
form.addEventListener('submit', function (){
var ak_bkp=prepare_array_for_request(keypresses);
var ak_bmc=prepare_array_for_request(mouseclicks);
var ak_bte=prepare_array_for_request(touchEvents);
var ak_bmm=prepare_array_for_request(mousemoves);
var ak_bcc=prepare_array_for_request(mouseclickCoordinates);
var input_fields={
'bib': input_begin,
'bfs': Date.now(),
'bkpc': keypresses.length,
'bkp': ak_bkp,
'bmc': ak_bmc,
'bmcc': mouseclicks.length,
'bmk': modifierKeys.join(';'),
'bck': correctionKeys.join(';'),
'bmmc': mousemoves.length,
'btmc': touchmoveCount,
'bsc': scrollCount,
'bte': ak_bte,
'btec':touchEvents.length,
'bmm':ak_bmm,
'bcc':ak_bcc
};
var akismet_field_prefix='ak_';
if(this.getElementsByClassName){
var possible_akismet_containers=this.getElementsByClassName('akismet-fields-container');
for(var containerIndex=0; containerIndex < possible_akismet_containers.length; containerIndex++){
var container=possible_akismet_containers.item(containerIndex);
if(container.getAttribute('data-prefix') ){
akismet_field_prefix=container.getAttribute('data-prefix');
break;
}}
}
for(var field_name in input_fields){
var field=document.createElement('input');
field.setAttribute('type', 'hidden');
field.setAttribute('name', akismet_field_prefix + field_name);
field.setAttribute('value', input_fields[ field_name ]);
this.appendChild(field);
}}, supportsPassive ? { passive: true }:false);
form.addEventListener('keydown', function(e){
if(e.key in keydowns){
return;
}
var keydownTime=(new Date()).getTime();
keydowns[ e.key ]=[ keydownTime ];
if(! input_begin){
input_begin=keydownTime;
}
var lastKeyEvent=Math.max(lastKeydown, lastKeyup);
if(lastKeyEvent){
keydowns[ e.key ].push(keydownTime - lastKeyEvent);
}
lastKeydown=keydownTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener('keyup', function(e){
if(!(e.key in keydowns) ){
return;
}
var keyupTime=(new Date()).getTime();
if('TEXTAREA'===e.target.nodeName||'INPUT'===e.target.nodeName){
if(-1!==modifierKeyCodes.indexOf(e.key) ){
modifierKeys.push(keypresses.length - 1);
}else if(-1!==correctionKeyCodes.indexOf(e.key) ){
correctionKeys.push(keypresses.length - 1);
}else{
var keydownTime=keydowns[ e.key ][0];
var keypress=[];
keypress.push(keyupTime - keydownTime);
if(keydowns[ e.key ].length > 1){
keypress.push(keydowns[ e.key ][1]);
}
keypresses.push(keypress);
}}
delete keydowns[ e.key ];
lastKeyup=keyupTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusin", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusout", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
}
document.addEventListener('mousedown', function(e){
lastMousedown=(new Date()).getTime();
var mouseclickCoordinate=[];
var rect=e.target.getBoundingClientRect();
var relativeX=e.clientX - rect.left;
var relativeY=e.clientY - rect.top;
mouseclickCoordinate.push(Math.round(relativeX) );
mouseclickCoordinate.push(Math.round(relativeY) );
mouseclickCoordinate.push(rect.width > 0 ? Math.round(relativeX / rect.width * 100):0);
mouseclickCoordinate.push(rect.height > 0 ? Math.round(relativeY / rect.height * 100):0);
mouseclickCoordinates.push(mouseclickCoordinate);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('mouseup', function(e){
if(! lastMousedown){
return;
}
var now=(new Date()).getTime();
var mouseclick=[];
mouseclick.push(now - lastMousedown);
if(lastMouseup){
mouseclick.push(lastMousedown - lastMouseup);
}
mouseclicks.push(mouseclick);
lastMouseup=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('mousemove', function(e){
if(mousemoveTimer){
clearTimeout(mousemoveTimer);
mousemoveTimer=null;
}else{
mousemoveStart=(new Date()).getTime();
lastMousemoveX=e.offsetX;
lastMousemoveY=e.offsetY;
}
mousemoveTimer=setTimeout(function(theEvent, originalMousemoveStart){
var now=(new Date()).getTime() - 500;
var mousemove=[];
mousemove.push(now - originalMousemoveStart);
mousemove.push(Math.round(Math.sqrt(Math.pow(theEvent.offsetX - lastMousemoveX, 2) +
Math.pow(theEvent.offsetY - lastMousemoveY, 2)
)
)
);
if(mousemove[1] > 0){
mousemoves.push(mousemove);
}
mousemoveStart=null;
mousemoveTimer=null;
}, 500, e, mousemoveStart);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchmove', function(e){
if(touchmoveCountTimer){
clearTimeout(touchmoveCountTimer);
}
touchmoveCountTimer=setTimeout(function (){
touchmoveCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchstart', function(e){
lastTouchStart=(new Date()).getTime();
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchend', function(e){
if(! lastTouchStart){
return;
}
var now=(new Date()).getTime();
var touchEvent=[];
touchEvent.push(now - lastTouchStart);
if(lastTouchEnd){
touchEvent.push(lastTouchStart - lastTouchEnd);
}
touchEvents.push(touchEvent);
lastTouchEnd=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('scroll', function(e){
if(scrollCountTimer){
clearTimeout(scrollCountTimer);
}
scrollCountTimer=setTimeout(function (){
scrollCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
}
function prepare_array_for_request(a, limit){
if(! limit){
limit=100;
}
var rv='';
if(a.length > 0){
var random_starting_point=Math.max(0, Math.floor(Math.random() * a.length - limit) );
for(var i=0; i < limit&&i < a.length; i++){
var entry=a[ random_starting_point + i ];
rv +=entry.join(',') + ';';
}}
return rv;
}
if(document.readyState!=='loading'){
init();
}else{
document.addEventListener('DOMContentLoaded', init);
}})();
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var b=arguments,g=null,e,c,f;for(e=0;e<b.length;e=e+1){f=(""+b[e]).split(".");g=YAHOO;for(c=(f[0]=="YAHOO")?1:0;c<f.length;c=c+1){g[f[c]]=g[f[c]]||{};g=g[f[c]];}}return g;};YAHOO.log=function(d,a,c){var b=YAHOO.widget.Logger;if(b&&b.log){return b.log(d,a,c);}else{return false;}};YAHOO.register=function(a,f,e){var k=YAHOO.env.modules,c,j,h,g,d;if(!k[a]){k[a]={versions:[],builds:[]};}c=k[a];j=e.version;h=e.build;g=YAHOO.env.listeners;c.name=a;c.version=j;c.build=h;c.versions.push(j);c.builds.push(h);c.mainClass=f;for(d=0;d<g.length;d=d+1){g[d](c);}if(f){f.VERSION=j;f.BUILD=h;}else{YAHOO.log("mainClass is undefined for module "+a,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(a){return YAHOO.env.modules[a]||null;};YAHOO.env.parseUA=function(d){var e=function(i){var j=0;return parseFloat(i.replace(/\./g,function(){return(j++==1)?"":".";}));},h=navigator,g={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:h&&h.cajaVersion,secure:false,os:null},c=d||(navigator&&navigator.userAgent),f=window&&window.location,b=f&&f.href,a;g.secure=b&&(b.toLowerCase().indexOf("https")===0);if(c){if((/windows|win32/i).test(c)){g.os="windows";}else{if((/macintosh/i).test(c)){g.os="macintosh";}else{if((/rhino/i).test(c)){g.os="rhino";}}}if((/KHTML/).test(c)){g.webkit=1;}a=c.match(/AppleWebKit\/([^\s]*)/);if(a&&a[1]){g.webkit=e(a[1]);if(/ Mobile\//.test(c)){g.mobile="Apple";a=c.match(/OS ([^\s]*)/);if(a&&a[1]){a=e(a[1].replace("_","."));}g.ios=a;g.ipad=g.ipod=g.iphone=0;a=c.match(/iPad|iPod|iPhone/);if(a&&a[0]){g[a[0].toLowerCase()]=g.ios;}}else{a=c.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(a){g.mobile=a[0];}if(/webOS/.test(c)){g.mobile="WebOS";a=c.match(/webOS\/([^\s]*);/);if(a&&a[1]){g.webos=e(a[1]);}}if(/ Android/.test(c)){g.mobile="Android";a=c.match(/Android ([^\s]*);/);if(a&&a[1]){g.android=e(a[1]);}}}a=c.match(/Chrome\/([^\s]*)/);if(a&&a[1]){g.chrome=e(a[1]);}else{a=c.match(/AdobeAIR\/([^\s]*)/);if(a){g.air=a[0];}}}if(!g.webkit){a=c.match(/Opera[\s\/]([^\s]*)/);if(a&&a[1]){g.opera=e(a[1]);a=c.match(/Version\/([^\s]*)/);if(a&&a[1]){g.opera=e(a[1]);}a=c.match(/Opera Mini[^;]*/);if(a){g.mobile=a[0];}}else{a=c.match(/MSIE\s([^;]*)/);if(a&&a[1]){g.ie=e(a[1]);}else{a=c.match(/Gecko\/([^\s]*)/);if(a){g.gecko=1;a=c.match(/rv:([^\s\)]*)/);if(a&&a[1]){g.gecko=e(a[1]);}}}}}}return g;};YAHOO.env.ua=YAHOO.env.parseUA();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var b=YAHOO_config.listener,a=YAHOO.env.listeners,d=true,c;if(b){for(c=0;c<a.length;c++){if(a[c]==b){d=false;break;}}if(d){a.push(b);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var f=YAHOO.lang,a=Object.prototype,c="[object Array]",h="[object Function]",i="[object Object]",b=[],g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;"},d=["toString","valueOf"],e={isArray:function(j){return a.toString.apply(j)===c;},isBoolean:function(j){return typeof j==="boolean";},isFunction:function(j){return(typeof j==="function")||a.toString.apply(j)===h;},isNull:function(j){return j===null;},isNumber:function(j){return typeof j==="number"&&isFinite(j);},isObject:function(j){return(j&&(typeof j==="object"||f.isFunction(j)))||false;},isString:function(j){return typeof j==="string";},isUndefined:function(j){return typeof j==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(l,k){var j,n,m;for(j=0;j<d.length;j=j+1){n=d[j];m=k[n];if(f.isFunction(m)&&m!=a[n]){l[n]=m;}}}:function(){},escapeHTML:function(j){return j.replace(/[&<>"'\/`]/g,function(k){return g[k];});},extend:function(m,n,l){if(!n||!m){throw new Error("extend failed, please check that "+"all dependencies are included.");}var k=function(){},j;k.prototype=n.prototype;m.prototype=new k();m.prototype.constructor=m;m.superclass=n.prototype;if(n.prototype.constructor==a.constructor){n.prototype.constructor=n;}if(l){for(j in l){if(f.hasOwnProperty(l,j)){m.prototype[j]=l[j];}}f._IEEnumFix(m.prototype,l);}},augmentObject:function(n,m){if(!m||!n){throw new Error("Absorb failed, verify dependencies.");}var j=arguments,l,o,k=j[2];if(k&&k!==true){for(l=2;l<j.length;l=l+1){n[j[l]]=m[j[l]];}}else{for(o in m){if(k||!(o in n)){n[o]=m[o];}}f._IEEnumFix(n,m);}return n;},augmentProto:function(m,l){if(!l||!m){throw new Error("Augment failed, verify dependencies.");}var j=[m.prototype,l.prototype],k;for(k=2;k<arguments.length;k=k+1){j.push(arguments[k]);}f.augmentObject.apply(this,j);return m;},dump:function(j,p){var l,n,r=[],t="{...}",k="f(){...}",q=", ",m=" => ";if(!f.isObject(j)){return j+"";}else{if(j instanceof Date||("nodeType" in j&&"tagName" in j)){return j;}else{if(f.isFunction(j)){return k;}}}p=(f.isNumber(p))?p:3;if(f.isArray(j)){r.push("[");for(l=0,n=j.length;l<n;l=l+1){if(f.isObject(j[l])){r.push((p>0)?f.dump(j[l],p-1):t);}else{r.push(j[l]);}r.push(q);}if(r.length>1){r.pop();}r.push("]");}else{r.push("{");for(l in j){if(f.hasOwnProperty(j,l)){r.push(l+m);if(f.isObject(j[l])){r.push((p>0)?f.dump(j[l],p-1):t);}else{r.push(j[l]);}r.push(q);}}if(r.length>1){r.pop();}r.push("}");}return r.join("");},substitute:function(x,y,E,l){var D,C,B,G,t,u,F=[],p,z=x.length,A="dump",r=" ",q="{",m="}",n,w;for(;;){D=x.lastIndexOf(q,z);if(D<0){break;}C=x.indexOf(m,D);if(D+1>C){break;}p=x.substring(D+1,C);G=p;u=null;B=G.indexOf(r);if(B>-1){u=G.substring(B+1);G=G.substring(0,B);}t=y[G];if(E){t=E(G,t,u);}if(f.isObject(t)){if(f.isArray(t)){t=f.dump(t,parseInt(u,10));}else{u=u||"";n=u.indexOf(A);if(n>-1){u=u.substring(4);}w=t.toString();if(w===i||n>-1){t=f.dump(t,parseInt(u,10));}else{t=w;}}}else{if(!f.isString(t)&&!f.isNumber(t)){t="~-"+F.length+"-~";F[F.length]=p;}}x=x.substring(0,D)+t+x.substring(C+1);if(l===false){z=D-1;}}for(D=F.length-1;D>=0;D=D-1){x=x.replace(new RegExp("~-"+D+"-~"),"{"+F[D]+"}","g");}return x;},trim:function(j){try{return j.replace(/^\s+|\s+$/g,"");}catch(k){return j;
}},merge:function(){var n={},k=arguments,j=k.length,m;for(m=0;m<j;m=m+1){f.augmentObject(n,k[m],true);}return n;},later:function(t,k,u,n,p){t=t||0;k=k||{};var l=u,s=n,q,j;if(f.isString(u)){l=k[u];}if(!l){throw new TypeError("method undefined");}if(!f.isUndefined(n)&&!f.isArray(s)){s=[n];}q=function(){l.apply(k,s||b);};j=(p)?setInterval(q,t):setTimeout(q,t);return{interval:p,cancel:function(){if(this.interval){clearInterval(j);}else{clearTimeout(j);}}};},isValue:function(j){return(f.isObject(j)||f.isString(j)||f.isNumber(j)||f.isBoolean(j));}};f.hasOwnProperty=(a.hasOwnProperty)?function(j,k){return j&&j.hasOwnProperty&&j.hasOwnProperty(k);}:function(j,k){return !f.isUndefined(j[k])&&j.constructor.prototype[k]!==j[k];};e.augmentObject(f,e,true);YAHOO.util.Lang=f;f.augment=f.augmentProto;YAHOO.augment=f.augmentProto;YAHOO.extend=f.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.9.0",build:"2800"});YAHOO.util.Get=function(){var m={},k=0,r=0,l=false,n=YAHOO.env.ua,s=YAHOO.lang,q,d,e,i=function(x,t,y){var u=y||window,z=u.document,A=z.createElement(x),v;for(v in t){if(t.hasOwnProperty(v)){A.setAttribute(v,t[v]);}}return A;},h=function(u,v,t){var w={id:"yui__dyn_"+(r++),type:"text/css",rel:"stylesheet",href:u};if(t){s.augmentObject(w,t);}return i("link",w,v);},p=function(u,v,t){var w={id:"yui__dyn_"+(r++),type:"text/javascript",src:u};if(t){s.augmentObject(w,t);}return i("script",w,v);},a=function(t,u){return{tId:t.tId,win:t.win,data:t.data,nodes:t.nodes,msg:u,purge:function(){d(this.tId);}};},b=function(t,w){var u=m[w],v=(s.isString(t))?u.win.document.getElementById(t):t;if(!v){q(w,"target node not found: "+t);}return v;},c=function(w){YAHOO.log("Finishing transaction "+w);var u=m[w],v,t;u.finished=true;if(u.aborted){v="transaction "+w+" was aborted";q(w,v);return;}if(u.onSuccess){t=u.scope||u.win;u.onSuccess.call(t,a(u));}},o=function(v){YAHOO.log("Timeout "+v,"info","get");var u=m[v],t;if(u.onTimeout){t=u.scope||u;u.onTimeout.call(t,a(u));}},f=function(v,A){YAHOO.log("_next: "+v+", loaded: "+A,"info","Get");var u=m[v],D=u.win,C=D.document,B=C.getElementsByTagName("head")[0],x,y,t,E,z;if(u.timer){u.timer.cancel();}if(u.aborted){y="transaction "+v+" was aborted";q(v,y);return;}if(A){u.url.shift();if(u.varName){u.varName.shift();}}else{u.url=(s.isString(u.url))?[u.url]:u.url;if(u.varName){u.varName=(s.isString(u.varName))?[u.varName]:u.varName;}}if(u.url.length===0){if(u.type==="script"&&n.webkit&&n.webkit<420&&!u.finalpass&&!u.varName){z=p(null,u.win,u.attributes);z.innerHTML='YAHOO.util.Get._finalize("'+v+'");';u.nodes.push(z);B.appendChild(z);}else{c(v);}return;}t=u.url[0];if(!t){u.url.shift();YAHOO.log("skipping empty url");return f(v);}YAHOO.log("attempting to load "+t,"info","Get");if(u.timeout){u.timer=s.later(u.timeout,u,o,v);}if(u.type==="script"){x=p(t,D,u.attributes);}else{x=h(t,D,u.attributes);}e(u.type,x,v,t,D,u.url.length);u.nodes.push(x);if(u.insertBefore){E=b(u.insertBefore,v);if(E){E.parentNode.insertBefore(x,E);}}else{B.appendChild(x);}YAHOO.log("Appending node: "+t,"info","Get");if((n.webkit||n.gecko)&&u.type==="css"){f(v,t);}},j=function(){if(l){return;}l=true;var t,u;for(t in m){if(m.hasOwnProperty(t)){u=m[t];if(u.autopurge&&u.finished){d(u.tId);delete m[t];}}}l=false;},g=function(u,t,v){var x="q"+(k++),w;v=v||{};if(k%YAHOO.util.Get.PURGE_THRESH===0){j();}m[x]=s.merge(v,{tId:x,type:u,url:t,finished:false,aborted:false,nodes:[]});w=m[x];w.win=w.win||window;w.scope=w.scope||w.win;w.autopurge=("autopurge" in w)?w.autopurge:(u==="script")?true:false;w.attributes=w.attributes||{};w.attributes.charset=v.charset||w.attributes.charset||"utf-8";s.later(0,w,f,x);return{tId:x};};e=function(H,z,x,u,D,E,G){var F=G||f,B,t,I,v,J,A,C,y;if(n.ie){z.onreadystatechange=function(){B=this.readyState;if("loaded"===B||"complete"===B){YAHOO.log(x+" onload "+u,"info","Get");z.onreadystatechange=null;F(x,u);}};}else{if(n.webkit){if(H==="script"){if(n.webkit>=420){z.addEventListener("load",function(){YAHOO.log(x+" DOM2 onload "+u,"info","Get");F(x,u);});}else{t=m[x];if(t.varName){v=YAHOO.util.Get.POLL_FREQ;YAHOO.log("Polling for "+t.varName[0]);t.maxattempts=YAHOO.util.Get.TIMEOUT/v;t.attempts=0;t._cache=t.varName[0].split(".");t.timer=s.later(v,t,function(w){I=this._cache;A=I.length;J=this.win;for(C=0;C<A;C=C+1){J=J[I[C]];if(!J){this.attempts++;if(this.attempts++>this.maxattempts){y="Over retry limit, giving up";t.timer.cancel();q(x,y);}else{YAHOO.log(I[C]+" failed, retrying");}return;}}YAHOO.log("Safari poll complete");t.timer.cancel();F(x,u);},null,true);}else{s.later(YAHOO.util.Get.POLL_FREQ,null,F,[x,u]);}}}}else{z.onload=function(){YAHOO.log(x+" onload "+u,"info","Get");F(x,u);};}}};q=function(w,v){YAHOO.log("get failure: "+v,"warn","Get");var u=m[w],t;if(u.onFailure){t=u.scope||u.win;u.onFailure.call(t,a(u,v));}};d=function(z){if(m[z]){var t=m[z],u=t.nodes,x=u.length,C=t.win.document,A=C.getElementsByTagName("head")[0],v,y,w,B;if(t.insertBefore){v=b(t.insertBefore,z);if(v){A=v.parentNode;}}for(y=0;y<x;y=y+1){w=u[y];if(w.clearAttributes){w.clearAttributes();}else{for(B in w){if(w.hasOwnProperty(B)){delete w[B];}}}A.removeChild(w);}t.nodes=[];}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(t){YAHOO.log(t+" finalized ","info","Get");s.later(0,null,c,t);},abort:function(u){var v=(s.isString(u))?u:u.tId,t=m[v];if(t){YAHOO.log("Aborting "+v,"info","Get");t.aborted=true;}},script:function(t,u){return g("script",t,u);},css:function(t,u){return g("css",t,u);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.9.0",build:"2800"});(function(){var Y=YAHOO,util=Y.util,lang=Y.lang,env=Y.env,PROV="_provides",SUPER="_supersedes",REQ="expanded",AFTER="_after",VERSION="2.9.0";var YUI={dupsAllowed:{"yahoo":true,"get":true},info:{"root":VERSION+"/build/","base":"http://yui.yahooapis.com/"+VERSION+"/build/","comboBase":"http://yui.yahooapis.com/combo?","skin":{"defaultSkin":"sam","base":"assets/skins/","path":"skin.css","after":["reset","fonts","grids","base"],"rollup":3},dupsAllowed:["yahoo","get"],"moduleInfo":{"animation":{"type":"js","path":"animation/animation-min.js","requires":["dom","event"]},"autocomplete":{"type":"js","path":"autocomplete/autocomplete-min.js","requires":["dom","event","datasource"],"optional":["connection","animation"],"skinnable":true},"base":{"type":"css","path":"base/base-min.css","after":["reset","fonts","grids"]},"button":{"type":"js","path":"button/button-min.js","requires":["element"],"optional":["menu"],"skinnable":true},"calendar":{"type":"js","path":"calendar/calendar-min.js","requires":["event","dom"],supersedes:["datemath"],"skinnable":true},"carousel":{"type":"js","path":"carousel/carousel-min.js","requires":["element"],"optional":["animation"],"skinnable":true},"charts":{"type":"js","path":"charts/charts-min.js","requires":["element","json","datasource","swf"]},"colorpicker":{"type":"js","path":"colorpicker/colorpicker-min.js","requires":["slider","element"],"optional":["animation"],"skinnable":true},"connection":{"type":"js","path":"connection/connection-min.js","requires":["event"],"supersedes":["connectioncore"]},"connectioncore":{"type":"js","path":"connection/connection_core-min.js","requires":["event"],"pkg":"connection"},"container":{"type":"js","path":"container/container-min.js","requires":["dom","event"],"optional":["dragdrop","animation","connection"],"supersedes":["containercore"],"skinnable":true},"containercore":{"type":"js","path":"container/container_core-min.js","requires":["dom","event"],"pkg":"container"},"cookie":{"type":"js","path":"cookie/cookie-min.js","requires":["yahoo"]},"datasource":{"type":"js","path":"datasource/datasource-min.js","requires":["event"],"optional":["connection"]},"datatable":{"type":"js","path":"datatable/datatable-min.js","requires":["element","datasource"],"optional":["calendar","dragdrop","paginator"],"skinnable":true},datemath:{"type":"js","path":"datemath/datemath-min.js","requires":["yahoo"]},"dom":{"type":"js","path":"dom/dom-min.js","requires":["yahoo"]},"dragdrop":{"type":"js","path":"dragdrop/dragdrop-min.js","requires":["dom","event"]},"editor":{"type":"js","path":"editor/editor-min.js","requires":["menu","element","button"],"optional":["animation","dragdrop"],"supersedes":["simpleeditor"],"skinnable":true},"element":{"type":"js","path":"element/element-min.js","requires":["dom","event"],"optional":["event-mouseenter","event-delegate"]},"element-delegate":{"type":"js","path":"element-delegate/element-delegate-min.js","requires":["element"]},"event":{"type":"js","path":"event/event-min.js","requires":["yahoo"]},"event-simulate":{"type":"js","path":"event-simulate/event-simulate-min.js","requires":["event"]},"event-delegate":{"type":"js","path":"event-delegate/event-delegate-min.js","requires":["event"],"optional":["selector"]},"event-mouseenter":{"type":"js","path":"event-mouseenter/event-mouseenter-min.js","requires":["dom","event"]},"fonts":{"type":"css","path":"fonts/fonts-min.css"},"get":{"type":"js","path":"get/get-min.js","requires":["yahoo"]},"grids":{"type":"css","path":"grids/grids-min.css","requires":["fonts"],"optional":["reset"]},"history":{"type":"js","path":"history/history-min.js","requires":["event"]},"imagecropper":{"type":"js","path":"imagecropper/imagecropper-min.js","requires":["dragdrop","element","resize"],"skinnable":true},"imageloader":{"type":"js","path":"imageloader/imageloader-min.js","requires":["event","dom"]},"json":{"type":"js","path":"json/json-min.js","requires":["yahoo"]},"layout":{"type":"js","path":"layout/layout-min.js","requires":["element"],"optional":["animation","dragdrop","resize","selector"],"skinnable":true},"logger":{"type":"js","path":"logger/logger-min.js","requires":["event","dom"],"optional":["dragdrop"],"skinnable":true},"menu":{"type":"js","path":"menu/menu-min.js","requires":["containercore"],"skinnable":true},"paginator":{"type":"js","path":"paginator/paginator-min.js","requires":["element"],"skinnable":true},"profiler":{"type":"js","path":"profiler/profiler-min.js","requires":["yahoo"]},"profilerviewer":{"type":"js","path":"profilerviewer/profilerviewer-min.js","requires":["profiler","yuiloader","element"],"skinnable":true},"progressbar":{"type":"js","path":"progressbar/progressbar-min.js","requires":["element"],"optional":["animation"],"skinnable":true},"reset":{"type":"css","path":"reset/reset-min.css"},"reset-fonts-grids":{"type":"css","path":"reset-fonts-grids/reset-fonts-grids.css","supersedes":["reset","fonts","grids","reset-fonts"],"rollup":4},"reset-fonts":{"type":"css","path":"reset-fonts/reset-fonts.css","supersedes":["reset","fonts"],"rollup":2},"resize":{"type":"js","path":"resize/resize-min.js","requires":["dragdrop","element"],"optional":["animation"],"skinnable":true},"selector":{"type":"js","path":"selector/selector-min.js","requires":["yahoo","dom"]},"simpleeditor":{"type":"js","path":"editor/simpleeditor-min.js","requires":["element"],"optional":["containercore","menu","button","animation","dragdrop"],"skinnable":true,"pkg":"editor"},"slider":{"type":"js","path":"slider/slider-min.js","requires":["dragdrop"],"optional":["animation"],"skinnable":true},"storage":{"type":"js","path":"storage/storage-min.js","requires":["yahoo","event","cookie"],"optional":["swfstore"]},"stylesheet":{"type":"js","path":"stylesheet/stylesheet-min.js","requires":["yahoo"]},"swf":{"type":"js","path":"swf/swf-min.js","requires":["element"],"supersedes":["swfdetect"]},"swfdetect":{"type":"js","path":"swfdetect/swfdetect-min.js","requires":["yahoo"]},"swfstore":{"type":"js","path":"swfstore/swfstore-min.js","requires":["element","cookie","swf"]},"tabview":{"type":"js","path":"tabview/tabview-min.js","requires":["element"],"optional":["connection"],"skinnable":true},"treeview":{"type":"js","path":"treeview/treeview-min.js","requires":["event","dom"],"optional":["json","animation","calendar"],"skinnable":true},"uploader":{"type":"js","path":"uploader/uploader-min.js","requires":["element"]},"utilities":{"type":"js","path":"utilities/utilities.js","supersedes":["yahoo","event","dragdrop","animation","dom","connection","element","yahoo-dom-event","get","yuiloader","yuiloader-dom-event"],"rollup":8},"yahoo":{"type":"js","path":"yahoo/yahoo-min.js"},"yahoo-dom-event":{"type":"js","path":"yahoo-dom-event/yahoo-dom-event.js","supersedes":["yahoo","event","dom"],"rollup":3},"yuiloader":{"type":"js","path":"yuiloader/yuiloader-min.js","supersedes":["yahoo","get"]},"yuiloader-dom-event":{"type":"js","path":"yuiloader-dom-event/yuiloader-dom-event.js","supersedes":["yahoo","dom","event","get","yuiloader","yahoo-dom-event"],"rollup":5},"yuitest":{"type":"js","path":"yuitest/yuitest-min.js","requires":["logger"],"optional":["event-simulate"],"skinnable":true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0;
i<a.length;i=i+1){o[a[i]]=true;}}},keys:function(o,ordered){var a=[],i;for(i in o){if(lang.hasOwnProperty(o,i)){a.push(i);}}return a;}},ArrayUtil:{appendArray:function(a1,a2){Array.prototype.push.apply(a1,a2);},indexOf:function(a,val){for(var i=0;i<a.length;i=i+1){if(a[i]===val){return i;}}return -1;},toObject:function(a){var o={};for(var i=0;i<a.length;i=i+1){o[a[i]]=true;}return o;},uniq:function(a){return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));}}};YAHOO.util.YUILoader=function(o){this._internalCallback=null;this._useYahooListener=false;this.onSuccess=null;this.onFailure=Y.log;this.onProgress=null;this.onTimeout=null;this.scope=this;this.data=null;this.insertBefore=null;this.charset=null;this.varName=null;this.base=YUI.info.base;this.comboBase=YUI.info.comboBase;this.combine=false;this.root=YUI.info.root;this.timeout=0;this.ignore=null;this.force=null;this.allowRollup=true;this.filter=null;this.required={};this.moduleInfo=lang.merge(YUI.info.moduleInfo);this.rollups=null;this.loadOptional=false;this.sorted=[];this.loaded={};this.dirty=true;this.inserted={};var self=this;env.listeners.push(function(m){if(self._useYahooListener){self.loadNext(m.name);}});this.skin=lang.merge(YUI.info.skin);this._config(o);};Y.util.YUILoader.prototype={FILTERS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},SKIN_PREFIX:"skin-",_config:function(o){if(o){for(var i in o){if(lang.hasOwnProperty(o,i)){if(i=="require"){this.require(o[i]);}else{this[i]=o[i];}}}}var f=this.filter;if(lang.isString(f)){f=f.toUpperCase();if(f==="DEBUG"){this.require("logger");}if(!Y.widget.LogWriter){Y.widget.LogWriter=function(){return Y;};}this.filter=this.FILTERS[f];}},addModule:function(o){if(!o||!o.name||!o.type||(!o.path&&!o.fullpath)){return false;}o.ext=("ext" in o)?o.ext:true;o.requires=o.requires||[];this.moduleInfo[o.name]=o;this.dirty=true;return true;},require:function(what){var a=(typeof what==="string")?arguments:what;this.dirty=true;YUI.ObjectUtil.appendArray(this.required,a);},_addSkin:function(skin,mod){var name=this.formatSkin(skin),info=this.moduleInfo,sinf=this.skin,ext=info[mod]&&info[mod].ext;if(!info[name]){this.addModule({"name":name,"type":"css","path":sinf.base+skin+"/"+sinf.path,"after":sinf.after,"rollup":sinf.rollup,"ext":ext});}if(mod){name=this.formatSkin(skin,mod);if(!info[name]){var mdef=info[mod],pkg=mdef.pkg||mod;this.addModule({"name":name,"type":"css","after":sinf.after,"path":pkg+"/"+sinf.base+skin+"/"+mod+".css","ext":ext});}}return name;},getRequires:function(mod){if(!mod){return[];}if(!this.dirty&&mod.expanded){return mod.expanded;}mod.requires=mod.requires||[];var i,d=[],r=mod.requires,o=mod.optional,info=this.moduleInfo,m;for(i=0;i<r.length;i=i+1){d.push(r[i]);m=info[r[i]];YUI.ArrayUtil.appendArray(d,this.getRequires(m));}if(o&&this.loadOptional){for(i=0;i<o.length;i=i+1){d.push(o[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[o[i]]));}}mod.expanded=YUI.ArrayUtil.uniq(d);return mod.expanded;},getProvides:function(name,notMe){var addMe=!(notMe),ckey=(addMe)?PROV:SUPER,m=this.moduleInfo[name],o={};if(!m){return o;}if(m[ckey]){return m[ckey];}var s=m.supersedes,done={},me=this;var add=function(mm){if(!done[mm]){done[mm]=true;lang.augmentObject(o,me.getProvides(mm));}};if(s){for(var i=0;i<s.length;i=i+1){add(s[i]);}}m[SUPER]=o;m[PROV]=lang.merge(o);m[PROV][name]=true;return m[ckey];},calculate:function(o){if(o||this.dirty){this._config(o);this._setup();this._explode();if(this.allowRollup){this._rollup();}this._reduce();this._sort();this.dirty=false;}},_setup:function(){var info=this.moduleInfo,name,i,j;for(name in info){if(lang.hasOwnProperty(info,name)){var m=info[name];if(m&&m.skinnable){var o=this.skin.overrides,smod;if(o&&o[name]){for(i=0;i<o[name].length;i=i+1){smod=this._addSkin(o[name][i],name);}}else{smod=this._addSkin(this.skin.defaultSkin,name);}if(YUI.ArrayUtil.indexOf(m.requires,smod)==-1){m.requires.push(smod);}}}}var l=lang.merge(this.inserted);if(!this._sandbox){l=lang.merge(l,env.modules);}if(this.ignore){YUI.ObjectUtil.appendArray(l,this.ignore);}if(this.force){for(i=0;i<this.force.length;i=i+1){if(this.force[i] in l){delete l[this.force[i]];}}}for(j in l){if(lang.hasOwnProperty(l,j)){lang.augmentObject(l,this.getProvides(j));}}this.loaded=l;},_explode:function(){var r=this.required,i,mod;for(i in r){if(lang.hasOwnProperty(r,i)){mod=this.moduleInfo[i];if(mod){var req=this.getRequires(mod);if(req){YUI.ObjectUtil.appendArray(r,req);}}}}},_skin:function(){},formatSkin:function(skin,mod){var s=this.SKIN_PREFIX+skin;if(mod){s=s+"-"+mod;}return s;},parseSkin:function(mod){if(mod.indexOf(this.SKIN_PREFIX)===0){var a=mod.split("-");return{skin:a[1],module:a[2]};}return null;},_rollup:function(){var i,j,m,s,rollups={},r=this.required,roll,info=this.moduleInfo;if(this.dirty||!this.rollups){for(i in info){if(lang.hasOwnProperty(info,i)){m=info[i];if(m&&m.rollup){rollups[i]=m;}}}this.rollups=rollups;}for(;;){var rolled=false;for(i in rollups){if(!r[i]&&!this.loaded[i]){m=info[i];s=m.supersedes;roll=false;if(!m.rollup){continue;}var skin=(m.ext)?false:this.parseSkin(i),c=0;if(skin){for(j in r){if(lang.hasOwnProperty(r,j)){if(i!==j&&this.parseSkin(j)){c++;roll=(c>=m.rollup);if(roll){break;}}}}}else{for(j=0;j<s.length;j=j+1){if(this.loaded[s[j]]&&(!YUI.dupsAllowed[s[j]])){roll=false;break;}else{if(r[s[j]]){c++;roll=(c>=m.rollup);if(roll){break;}}}}}if(roll){r[i]=true;rolled=true;this.getRequires(m);}}}if(!rolled){break;}}},_reduce:function(){var i,j,s,m,r=this.required;for(i in r){if(i in this.loaded){delete r[i];}else{var skinDef=this.parseSkin(i);if(skinDef){if(!skinDef.module){var skin_pre=this.SKIN_PREFIX+skinDef.skin;for(j in r){if(lang.hasOwnProperty(r,j)){m=this.moduleInfo[j];var ext=m&&m.ext;if(!ext&&j!==i&&j.indexOf(skin_pre)>-1){delete r[j];}}}}}else{m=this.moduleInfo[i];s=m&&m.supersedes;if(s){for(j=0;j<s.length;j=j+1){if(s[j] in r){delete r[s[j]];}}}}}}},_onFailure:function(msg){YAHOO.log("Failure","info","loader");
var f=this.onFailure;if(f){f.call(this.scope,{msg:"failure: "+msg,data:this.data,success:false});}},_onTimeout:function(){YAHOO.log("Timeout","info","loader");var f=this.onTimeout;if(f){f.call(this.scope,{msg:"timeout",data:this.data,success:false});}},_sort:function(){var s=[],info=this.moduleInfo,loaded=this.loaded,checkOptional=!this.loadOptional,me=this;var requires=function(aa,bb){var mm=info[aa];if(loaded[bb]||!mm){return false;}var ii,rr=mm.expanded,after=mm.after,other=info[bb],optional=mm.optional;if(rr&&YUI.ArrayUtil.indexOf(rr,bb)>-1){return true;}if(after&&YUI.ArrayUtil.indexOf(after,bb)>-1){return true;}if(checkOptional&&optional&&YUI.ArrayUtil.indexOf(optional,bb)>-1){return true;}var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;ii<ss.length;ii=ii+1){if(requires(aa,ss[ii])){return true;}}}if(mm.ext&&mm.type=="css"&&!other.ext&&other.type=="css"){return true;}return false;};for(var i in this.required){if(lang.hasOwnProperty(this.required,i)){s.push(i);}}var p=0;for(;;){var l=s.length,a,b,j,k,moved=false;for(j=p;j<l;j=j+1){a=s[j];for(k=j+1;k<l;k=k+1){if(requires(a,s[k])){b=s.splice(k,1);s.splice(j,0,b[0]);moved=true;break;}}if(moved){break;}else{p=p+1;}}if(!moved){break;}}this.sorted=s;},toString:function(){var o={type:"YUILoader",base:this.base,filter:this.filter,required:this.required,loaded:this.loaded,inserted:this.inserted};lang.dump(o,1);},_combine:function(){this._combining=[];var self=this,s=this.sorted,len=s.length,js=this.comboBase,css=this.comboBase,target,startLen=js.length,i,m,type=this.loadType;YAHOO.log("type "+type);for(i=0;i<len;i=i+1){m=this.moduleInfo[s[i]];if(m&&!m.ext&&(!type||type===m.type)){target=this.root+m.path;target+="&";if(m.type=="js"){js+=target;}else{css+=target;}this._combining.push(s[i]);}}if(this._combining.length){YAHOO.log("Attempting to combine: "+this._combining,"info","loader");var callback=function(o){var c=this._combining,len=c.length,i,m;for(i=0;i<len;i=i+1){this.inserted[c[i]]=true;}this.loadNext(o.data);},loadScript=function(){if(js.length>startLen){YAHOO.util.Get.script(self._filter(js),{data:self._loading,onSuccess:callback,onFailure:self._onFailure,onTimeout:self._onTimeout,insertBefore:self.insertBefore,charset:self.charset,timeout:self.timeout,scope:self});}else{this.loadNext();}};if(css.length>startLen){YAHOO.util.Get.css(this._filter(css),{data:this._loading,onSuccess:loadScript,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,scope:self});}else{loadScript();}return;}else{this.loadNext(this._loading);}},insert:function(o,type){this.calculate(o);this._loading=true;this.loadType=type;if(this.combine){return this._combine();}if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(null,"js");};this.insert(null,"css");return;}this.loadNext();},sandbox:function(o,type){var self=this,success=function(o){var idx=o.argument[0],name=o.argument[2];self._scriptText[idx]=o.responseText;if(self.onProgress){self.onProgress.call(self.scope,{name:name,scriptText:o.responseText,xhrResponse:o,data:self.data});}self._loadCount++;if(self._loadCount>=self._stopCount){var v=self.varName||"YAHOO";var t="(function(){\n";var b="\nreturn "+v+";\n})();";var ref=eval(t+self._scriptText.join("\n")+b);self._pushEvents(ref);if(ref){self.onSuccess.call(self.scope,{reference:ref,data:self.data});}else{self._onFailure.call(self.varName+" reference failure");}}},failure=function(o){self.onFailure.call(self.scope,{msg:"XHR failure",xhrResponse:o,data:self.data});};self._config(o);if(!self.onSuccess){throw new Error("You must supply an onSuccess handler for your sandbox");}self._sandbox=true;if(!type||type!=="js"){self._internalCallback=function(){self._internalCallback=null;self.sandbox(null,"js");};self.insert(null,"css");return;}if(!util.Connect){var ld=new YAHOO.util.YUILoader();ld.insert({base:self.base,filter:self.filter,require:"connection",insertBefore:self.insertBefore,charset:self.charset,onSuccess:function(){self.sandbox(null,"js");},scope:self},"js");return;}self._scriptText=[];self._loadCount=0;self._stopCount=self.sorted.length;self._xhr=[];self.calculate();var s=self.sorted,l=s.length,i,m,url;for(i=0;i<l;i=i+1){m=self.moduleInfo[s[i]];if(!m){self._onFailure("undefined module "+m);for(var j=0;j<self._xhr.length;j=j+1){self._xhr[j].abort();}return;}if(m.type!=="js"){self._loadCount++;continue;}url=m.fullpath;url=(url)?self._filter(url):self._url(m.path);var xhrData={success:success,failure:failure,scope:self,argument:[i,url,s[i]]};self._xhr.push(util.Connect.asyncRequest("GET",url,xhrData));}},loadNext:function(mname){if(!this._loading){return;}var self=this,donext=function(o){self.loadNext(o.data);},successfn,s=this.sorted,len=s.length,i,fn,m,url;if(mname){if(mname!==this._loading){return;}this.inserted[mname]=true;if(this.onProgress){this.onProgress.call(this.scope,{name:mname,data:this.data});}}for(i=0;i<len;i=i+1){if(s[i] in this.inserted){continue;}if(s[i]===this._loading){return;}m=this.moduleInfo[s[i]];if(!m){this.onFailure.call(this.scope,{msg:"undefined module "+m,data:this.data});return;}if(!this.loadType||this.loadType===m.type){successfn=donext;this._loading=s[i];fn=(m.type==="css")?util.Get.css:util.Get.script;url=m.fullpath;url=(url)?this._filter(url):this._url(m.path);if(env.ua.webkit&&env.ua.webkit<420&&m.type==="js"&&!m.varName){successfn=null;this._useYahooListener=true;}fn(url,{data:s[i],onSuccess:successfn,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,varName:m.varName,scope:self});return;}}this._loading=null;if(this._internalCallback){var f=this._internalCallback;this._internalCallback=null;f.call(this);}else{if(this.onSuccess){this._pushEvents();this.onSuccess.call(this.scope,{data:this.data});}}},_pushEvents:function(ref){var r=ref||YAHOO;if(r.util&&r.util.Event){r.util.Event._load();}},_filter:function(str){var f=this.filter;return(f)?str.replace(new RegExp(f.searchExp,"g"),f.replaceStr):str;
},_url:function(path){return this._filter((this.base||"")+path);}};})();YAHOO.register("yuiloader",YAHOO.util.YUILoader,{version:"2.9.0",build:"2800"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var e=YAHOO.util,k=YAHOO.lang,L=YAHOO.env.ua,a=YAHOO.lang.trim,B={},F={},m=/^t(?:able|d|h)$/i,w=/color$/i,j=window.document,v=j.documentElement,C="ownerDocument",M="defaultView",U="documentElement",S="compatMode",z="offsetLeft",o="offsetTop",T="offsetParent",x="parentNode",K="nodeType",c="tagName",n="scrollLeft",H="scrollTop",p="getBoundingClientRect",V="getComputedStyle",y="currentStyle",l="CSS1Compat",A="BackCompat",E="class",f="className",i="",b=" ",R="(?:^|\\s)",J="(?=|$)",t="g",O="position",D="fixed",u="relative",I="left",N="top",Q="medium",P="borderLeftWidth",q="borderTopWidth",d=L.opera,h=L.webkit,g=L.gecko,s=L.ie;e.Dom={CUSTOM_ATTRIBUTES:(!v.hasAttribute)?{"for":"htmlFor","class":f}:{"htmlFor":"for","className":E},DOT_ATTRIBUTES:{checked:true},get:function(aa){var ac,X,ab,Z,W,G,Y=null;if(aa){if(typeof aa=="string"||typeof aa=="number"){ac=aa+"";aa=j.getElementById(aa);G=(aa)?aa.attributes:null;if(aa&&G&&G.id&&G.id.value===ac){return aa;}else{if(aa&&j.all){aa=null;X=j.all[ac];if(X&&X.length){for(Z=0,W=X.length;Z<W;++Z){if(X[Z].id===ac){return X[Z];}}}}}}else{if(e.Element&&aa instanceof e.Element){aa=aa.get("element");}else{if(!aa.nodeType&&"length" in aa){ab=[];for(Z=0,W=aa.length;Z<W;++Z){ab[ab.length]=e.Dom.get(aa[Z]);}aa=ab;}}}Y=aa;}return Y;},getComputedStyle:function(G,W){if(window[V]){return G[C][M][V](G,null)[W];}else{if(G[y]){return e.Dom.IE_ComputedStyle.get(G,W);}}},getStyle:function(G,W){return e.Dom.batch(G,e.Dom._getStyle,W);},_getStyle:function(){if(window[V]){return function(G,Y){Y=(Y==="float")?Y="cssFloat":e.Dom._toCamel(Y);var X=G.style[Y],W;if(!X){W=G[C][M][V](G,null);if(W){X=W[Y];}}return X;};}else{if(v[y]){return function(G,Y){var X;switch(Y){case"opacity":X=100;try{X=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(Z){try{X=G.filters("alpha").opacity;}catch(W){}}return X/100;case"float":Y="styleFloat";default:Y=e.Dom._toCamel(Y);X=G[y]?G[y][Y]:null;return(G.style[Y]||X);}};}}}(),setStyle:function(G,W,X){e.Dom.batch(G,e.Dom._setStyle,{prop:W,val:X});},_setStyle:function(){if(!window.getComputedStyle&&j.documentElement.currentStyle){return function(W,G){var X=e.Dom._toCamel(G.prop),Y=G.val;if(W){switch(X){case"opacity":if(Y===""||Y===null||Y===1){W.style.removeAttribute("filter");}else{if(k.isString(W.style.filter)){W.style.filter="alpha(opacity="+Y*100+")";if(!W[y]||!W[y].hasLayout){W.style.zoom=1;}}}break;case"float":X="styleFloat";default:W.style[X]=Y;}}else{}};}else{return function(W,G){var X=e.Dom._toCamel(G.prop),Y=G.val;if(W){if(X=="float"){X="cssFloat";}W.style[X]=Y;}else{}};}}(),getXY:function(G){return e.Dom.batch(G,e.Dom._getXY);},_canPosition:function(G){return(e.Dom._getStyle(G,"display")!=="none"&&e.Dom._inDoc(G));},_getXY:function(W){var X,G,Z,ab,Y,aa,ac=Math.round,ad=false;if(e.Dom._canPosition(W)){Z=W[p]();ab=W[C];X=e.Dom.getDocumentScrollLeft(ab);G=e.Dom.getDocumentScrollTop(ab);ad=[Z[I],Z[N]];if(Y||aa){ad[0]-=aa;ad[1]-=Y;}if((G||X)){ad[0]+=X;ad[1]+=G;}ad[0]=ac(ad[0]);ad[1]=ac(ad[1]);}else{}return ad;},getX:function(G){var W=function(X){return e.Dom.getXY(X)[0];};return e.Dom.batch(G,W,e.Dom,true);},getY:function(G){var W=function(X){return e.Dom.getXY(X)[1];};return e.Dom.batch(G,W,e.Dom,true);},setXY:function(G,X,W){e.Dom.batch(G,e.Dom._setXY,{pos:X,noRetry:W});},_setXY:function(G,Z){var aa=e.Dom._getStyle(G,O),Y=e.Dom.setStyle,ad=Z.pos,W=Z.noRetry,ab=[parseInt(e.Dom.getComputedStyle(G,I),10),parseInt(e.Dom.getComputedStyle(G,N),10)],ac,X;ac=e.Dom._getXY(G);if(!ad||ac===false){return false;}if(aa=="static"){aa=u;Y(G,O,aa);}if(isNaN(ab[0])){ab[0]=(aa==u)?0:G[z];}if(isNaN(ab[1])){ab[1]=(aa==u)?0:G[o];}if(ad[0]!==null){Y(G,I,ad[0]-ac[0]+ab[0]+"px");}if(ad[1]!==null){Y(G,N,ad[1]-ac[1]+ab[1]+"px");}if(!W){X=e.Dom._getXY(G);if((ad[0]!==null&&X[0]!=ad[0])||(ad[1]!==null&&X[1]!=ad[1])){e.Dom._setXY(G,{pos:ad,noRetry:true});}}},setX:function(W,G){e.Dom.setXY(W,[G,null]);},setY:function(G,W){e.Dom.setXY(G,[null,W]);},getRegion:function(G){var W=function(X){var Y=false;if(e.Dom._canPosition(X)){Y=e.Region.getRegion(X);}else{}return Y;};return e.Dom.batch(G,W,e.Dom,true);},getClientWidth:function(){return e.Dom.getViewportWidth();},getClientHeight:function(){return e.Dom.getViewportHeight();},getElementsByClassName:function(ab,af,ac,ae,X,ad){af=af||"*";ac=(ac)?e.Dom.get(ac):null||j;if(!ac){return[];}var W=[],G=ac.getElementsByTagName(af),Z=e.Dom.hasClass;for(var Y=0,aa=G.length;Y<aa;++Y){if(Z(G[Y],ab)){W[W.length]=G[Y];}}if(ae){e.Dom.batch(W,ae,X,ad);}return W;},hasClass:function(W,G){return e.Dom.batch(W,e.Dom._hasClass,G);},_hasClass:function(X,W){var G=false,Y;if(X&&W){Y=e.Dom._getAttribute(X,f)||i;if(Y){Y=Y.replace(/\s+/g,b);}if(W.exec){G=W.test(Y);}else{G=W&&(b+Y+b).indexOf(b+W+b)>-1;}}else{}return G;},addClass:function(W,G){return e.Dom.batch(W,e.Dom._addClass,G);},_addClass:function(X,W){var G=false,Y;if(X&&W){Y=e.Dom._getAttribute(X,f)||i;if(!e.Dom._hasClass(X,W)){e.Dom.setAttribute(X,f,a(Y+b+W));G=true;}}else{}return G;},removeClass:function(W,G){return e.Dom.batch(W,e.Dom._removeClass,G);},_removeClass:function(Y,X){var W=false,aa,Z,G;if(Y&&X){aa=e.Dom._getAttribute(Y,f)||i;e.Dom.setAttribute(Y,f,aa.replace(e.Dom._getClassRegex(X),i));Z=e.Dom._getAttribute(Y,f);if(aa!==Z){e.Dom.setAttribute(Y,f,a(Z));W=true;if(e.Dom._getAttribute(Y,f)===""){G=(Y.hasAttribute&&Y.hasAttribute(E))?E:f;Y.removeAttribute(G);}}}else{}return W;},replaceClass:function(X,W,G){return e.Dom.batch(X,e.Dom._replaceClass,{from:W,to:G});},_replaceClass:function(Y,X){var W,ab,aa,G=false,Z;if(Y&&X){ab=X.from;aa=X.to;if(!aa){G=false;}else{if(!ab){G=e.Dom._addClass(Y,X.to);}else{if(ab!==aa){Z=e.Dom._getAttribute(Y,f)||i;W=(b+Z.replace(e.Dom._getClassRegex(ab),b+aa).replace(/\s+/g,b)).split(e.Dom._getClassRegex(aa));W.splice(1,0,b+aa);e.Dom.setAttribute(Y,f,a(W.join(i)));G=true;}}}}else{}return G;},generateId:function(G,X){X=X||"yui-gen";var W=function(Y){if(Y&&Y.id){return Y.id;}var Z=X+YAHOO.env._id_counter++;
if(Y){if(Y[C]&&Y[C].getElementById(Z)){return e.Dom.generateId(Y,Z+X);}Y.id=Z;}return Z;};return e.Dom.batch(G,W,e.Dom,true)||W.apply(e.Dom,arguments);},isAncestor:function(W,X){W=e.Dom.get(W);X=e.Dom.get(X);var G=false;if((W&&X)&&(W[K]&&X[K])){if(W.contains&&W!==X){G=W.contains(X);}else{if(W.compareDocumentPosition){G=!!(W.compareDocumentPosition(X)&16);}}}else{}return G;},inDocument:function(G,W){return e.Dom._inDoc(e.Dom.get(G),W);},_inDoc:function(W,X){var G=false;if(W&&W[c]){X=X||W[C];G=e.Dom.isAncestor(X[U],W);}else{}return G;},getElementsBy:function(W,af,ab,ad,X,ac,ae){af=af||"*";ab=(ab)?e.Dom.get(ab):null||j;var aa=(ae)?null:[],G;if(ab){G=ab.getElementsByTagName(af);for(var Y=0,Z=G.length;Y<Z;++Y){if(W(G[Y])){if(ae){aa=G[Y];break;}else{aa[aa.length]=G[Y];}}}if(ad){e.Dom.batch(aa,ad,X,ac);}}return aa;},getElementBy:function(X,G,W){return e.Dom.getElementsBy(X,G,W,null,null,null,true);},batch:function(X,ab,aa,Z){var Y=[],W=(Z)?aa:null;X=(X&&(X[c]||X.item))?X:e.Dom.get(X);if(X&&ab){if(X[c]||X.length===undefined){return ab.call(W,X,aa);}for(var G=0;G<X.length;++G){Y[Y.length]=ab.call(W||X[G],X[G],aa);}}else{return false;}return Y;},getDocumentHeight:function(){var W=(j[S]!=l||h)?j.body.scrollHeight:v.scrollHeight,G=Math.max(W,e.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var W=(j[S]!=l||h)?j.body.scrollWidth:v.scrollWidth,G=Math.max(W,e.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,W=j[S];if((W||s)&&!d){G=(W==l)?v.clientHeight:j.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,W=j[S];if(W||s){G=(W==l)?v.clientWidth:j.body.clientWidth;}return G;},getAncestorBy:function(G,W){while((G=G[x])){if(e.Dom._testElement(G,W)){return G;}}return null;},getAncestorByClassName:function(W,G){W=e.Dom.get(W);if(!W){return null;}var X=function(Y){return e.Dom.hasClass(Y,G);};return e.Dom.getAncestorBy(W,X);},getAncestorByTagName:function(W,G){W=e.Dom.get(W);if(!W){return null;}var X=function(Y){return Y[c]&&Y[c].toUpperCase()==G.toUpperCase();};return e.Dom.getAncestorBy(W,X);},getPreviousSiblingBy:function(G,W){while(G){G=G.previousSibling;if(e.Dom._testElement(G,W)){return G;}}return null;},getPreviousSibling:function(G){G=e.Dom.get(G);if(!G){return null;}return e.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,W){while(G){G=G.nextSibling;if(e.Dom._testElement(G,W)){return G;}}return null;},getNextSibling:function(G){G=e.Dom.get(G);if(!G){return null;}return e.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,X){var W=(e.Dom._testElement(G.firstChild,X))?G.firstChild:null;return W||e.Dom.getNextSiblingBy(G.firstChild,X);},getFirstChild:function(G,W){G=e.Dom.get(G);if(!G){return null;}return e.Dom.getFirstChildBy(G);},getLastChildBy:function(G,X){if(!G){return null;}var W=(e.Dom._testElement(G.lastChild,X))?G.lastChild:null;return W||e.Dom.getPreviousSiblingBy(G.lastChild,X);},getLastChild:function(G){G=e.Dom.get(G);return e.Dom.getLastChildBy(G);},getChildrenBy:function(W,Y){var X=e.Dom.getFirstChildBy(W,Y),G=X?[X]:[];e.Dom.getNextSiblingBy(X,function(Z){if(!Y||Y(Z)){G[G.length]=Z;}return false;});return G;},getChildren:function(G){G=e.Dom.get(G);if(!G){}return e.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||j;return Math.max(G[U].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||j;return Math.max(G[U].scrollTop,G.body.scrollTop);},insertBefore:function(W,G){W=e.Dom.get(W);G=e.Dom.get(G);if(!W||!G||!G[x]){return null;}return G[x].insertBefore(W,G);},insertAfter:function(W,G){W=e.Dom.get(W);G=e.Dom.get(G);if(!W||!G||!G[x]){return null;}if(G.nextSibling){return G[x].insertBefore(W,G.nextSibling);}else{return G[x].appendChild(W);}},getClientRegion:function(){var X=e.Dom.getDocumentScrollTop(),W=e.Dom.getDocumentScrollLeft(),Y=e.Dom.getViewportWidth()+W,G=e.Dom.getViewportHeight()+X;return new e.Region(X,Y,G,W);},setAttribute:function(W,G,X){e.Dom.batch(W,e.Dom._setAttribute,{attr:G,val:X});},_setAttribute:function(X,W){var G=e.Dom._toCamel(W.attr),Y=W.val;if(X&&X.setAttribute){if(e.Dom.DOT_ATTRIBUTES[G]&&X.tagName&&X.tagName!="BUTTON"){X[G]=Y;}else{G=e.Dom.CUSTOM_ATTRIBUTES[G]||G;X.setAttribute(G,Y);}}else{}},getAttribute:function(W,G){return e.Dom.batch(W,e.Dom._getAttribute,G);},_getAttribute:function(W,G){var X;G=e.Dom.CUSTOM_ATTRIBUTES[G]||G;if(e.Dom.DOT_ATTRIBUTES[G]){X=W[G];}else{if(W&&"getAttribute" in W){if(/^(?:href|src)$/.test(G)){X=W.getAttribute(G,2);}else{X=W.getAttribute(G);}}else{}}return X;},_toCamel:function(W){var X=B;function G(Y,Z){return Z.toUpperCase();}return X[W]||(X[W]=W.indexOf("-")===-1?W:W.replace(/-([a-z])/gi,G));},_getClassRegex:function(W){var G;if(W!==undefined){if(W.exec){G=W;}else{G=F[W];if(!G){W=W.replace(e.Dom._patterns.CLASS_RE_TOKENS,"\\$1");W=W.replace(/\s+/g,b);G=F[W]=new RegExp(R+W+J,t);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}\\])/g},_testElement:function(G,W){return G&&G[K]==1&&(!W||W(G));},_calcBorders:function(X,Y){var W=parseInt(e.Dom[V](X,q),10)||0,G=parseInt(e.Dom[V](X,P),10)||0;if(g){if(m.test(X[c])){W=0;G=0;}}Y[0]+=G;Y[1]+=W;return Y;}};var r=e.Dom[V];if(L.opera){e.Dom[V]=function(W,G){var X=r(W,G);if(w.test(G)){X=e.Dom.Color.toRGB(X);}return X;};}if(L.webkit){e.Dom[V]=function(W,G){var X=r(W,G);if(X==="rgba(0, 0, 0, 0)"){X="transparent";}return X;};}if(L.ie&&L.ie>=8){e.Dom.DOT_ATTRIBUTES.type=true;}})();YAHOO.util.Region=function(d,e,a,c){this.top=d;this.y=d;this[1]=d;this.right=e;this.bottom=a;this.left=c;this.x=c;this[0]=c;this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(a){return(a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(f){var d=Math.max(this.top,f.top),e=Math.min(this.right,f.right),a=Math.min(this.bottom,f.bottom),c=Math.max(this.left,f.left);
if(a>=d&&e>=c){return new YAHOO.util.Region(d,e,a,c);}else{return null;}};YAHOO.util.Region.prototype.union=function(f){var d=Math.min(this.top,f.top),e=Math.max(this.right,f.right),a=Math.max(this.bottom,f.bottom),c=Math.min(this.left,f.left);return new YAHOO.util.Region(d,e,a,c);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(e){var g=YAHOO.util.Dom.getXY(e),d=g[1],f=g[0]+e.offsetWidth,a=g[1]+e.offsetHeight,c=g[0];return new YAHOO.util.Region(d,f,a,c);};YAHOO.util.Point=function(a,b){if(YAHOO.lang.isArray(a)){b=a[1];a=a[0];}YAHOO.util.Point.superclass.constructor.call(this,b,a,b,a);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var b=YAHOO.util,a="clientTop",f="clientLeft",j="parentNode",k="right",w="hasLayout",i="px",u="opacity",l="auto",d="borderLeftWidth",g="borderTopWidth",p="borderRightWidth",v="borderBottomWidth",s="visible",q="transparent",n="height",e="width",h="style",t="currentStyle",r=/^width|height$/,o=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,m={get:function(x,z){var y="",A=x[t][z];if(z===u){y=b.Dom.getStyle(x,u);}else{if(!A||(A.indexOf&&A.indexOf(i)>-1)){y=A;}else{if(b.Dom.IE_COMPUTED[z]){y=b.Dom.IE_COMPUTED[z](x,z);}else{if(o.test(A)){y=b.Dom.IE.ComputedStyle.getPixel(x,z);}else{y=A;}}}}return y;},getOffset:function(z,E){var B=z[t][E],x=E.charAt(0).toUpperCase()+E.substr(1),C="offset"+x,y="pixel"+x,A="",D;if(B==l){D=z[C];if(D===undefined){A=0;}A=D;if(r.test(E)){z[h][E]=D;if(z[C]>D){A=D-(z[C]-D);}z[h][E]=l;}}else{if(!z[h][y]&&!z[h][E]){z[h][E]=B;}A=z[h][y];}return A+i;},getBorderWidth:function(x,z){var y=null;if(!x[t][w]){x[h].zoom=1;}switch(z){case g:y=x[a];break;case v:y=x.offsetHeight-x.clientHeight-x[a];break;case d:y=x[f];break;case p:y=x.offsetWidth-x.clientWidth-x[f];break;}return y+i;},getPixel:function(y,x){var A=null,B=y[t][k],z=y[t][x];y[h][k]=z;A=y[h].pixelRight;y[h][k]=B;return A+i;},getMargin:function(y,x){var z;if(y[t][x]==l){z=0+i;}else{z=b.Dom.IE.ComputedStyle.getPixel(y,x);}return z;},getVisibility:function(y,x){var z;while((z=y[t])&&z[x]=="inherit"){y=y[j];}return(z)?z[x]:s;},getColor:function(y,x){return b.Dom.Color.toRGB(y[t][x])||q;},getBorderColor:function(y,x){var z=y[t],A=z[x]||z.color;return b.Dom.Color.toRGB(b.Dom.Color.toHex(A));}},c={};c.top=c.right=c.bottom=c.left=c[e]=c[n]=m.getOffset;c.color=m.getColor;c[g]=c[p]=c[v]=c[d]=m.getBorderWidth;c.marginTop=c.marginRight=c.marginBottom=c.marginLeft=m.getMargin;c.visibility=m.getVisibility;c.borderColor=c.borderTopColor=c.borderRightColor=c.borderBottomColor=c.borderLeftColor=m.getBorderColor;b.Dom.IE_COMPUTED=c;b.Dom.IE_ComputedStyle=m;})();(function(){var c="toString",a=parseInt,b=RegExp,d=YAHOO.util;d.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(e){if(!d.Dom.Color.re_RGB.test(e)){e=d.Dom.Color.toHex(e);}if(d.Dom.Color.re_hex.exec(e)){e="rgb("+[a(b.$1,16),a(b.$2,16),a(b.$3,16)].join(", ")+")";}return e;},toHex:function(f){f=d.Dom.Color.KEYWORDS[f]||f;if(d.Dom.Color.re_RGB.exec(f)){f=[Number(b.$1).toString(16),Number(b.$2).toString(16),Number(b.$3).toString(16)];for(var e=0;e<f.length;e++){if(f[e].length<2){f[e]="0"+f[e];}}f=f.join("");}if(f.length<6){f=f.replace(d.Dom.Color.re_hex3,"$1$1");}if(f!=="transparent"&&f.indexOf("#")<0){f="#"+f;}return f.toUpperCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.9.0",build:"2800"});YAHOO.util.CustomEvent=function(d,c,b,a,e){this.type=d;this.scope=c||window;this.silent=b;this.fireOnce=e;this.fired=false;this.firedWith=null;this.signature=a||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var f="_YUICEOnSubscribe";if(d!==f){this.subscribeEvent=new YAHOO.util.CustomEvent(f,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(b,c,d){if(!b){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(b,c,d);}var a=new YAHOO.util.Subscriber(b,c,d);if(this.fireOnce&&this.fired){this.notify(a,this.firedWith);}else{this.subscribers.push(a);}},unsubscribe:function(d,f){if(!d){return this.unsubscribeAll();}var e=false;for(var b=0,a=this.subscribers.length;b<a;++b){var c=this.subscribers[b];if(c&&c.contains(d,f)){this._delete(b);e=true;}}return e;},fire:function(){this.lastError=null;var h=[],a=this.subscribers.length;var d=[].slice.call(arguments,0),c=true,f,b=false;if(this.fireOnce){if(this.fired){return true;}else{this.firedWith=d;}}this.fired=true;if(!a&&this.silent){return true;}if(!this.silent){}var e=this.subscribers.slice();for(f=0;f<a;++f){var g=e[f];if(!g||!g.fn){b=true;}else{c=this.notify(g,d);if(false===c){if(!this.silent){}break;}}}return(c!==false);},notify:function(g,c){var b,i=null,f=g.getScope(this.scope),a=YAHOO.util.Event.throwErrors;if(!this.silent){}if(this.signature==YAHOO.util.CustomEvent.FLAT){if(c.length>0){i=c[0];}try{b=g.fn.call(f,i,g.obj);}catch(h){this.lastError=h;if(a){throw h;}}}else{try{b=g.fn.call(f,this.type,c,g.obj);}catch(d){this.lastError=d;if(a){throw d;}}}return b;},unsubscribeAll:function(){var a=this.subscribers.length,b;for(b=a-1;b>-1;b--){this._delete(b);}this.subscribers=[];return a;},_delete:function(a){var b=this.subscribers[a];if(b){delete b.fn;delete b.obj;}this.subscribers.splice(a,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(a,b,c){this.fn=a;this.obj=YAHOO.lang.isUndefined(b)?null:b;this.overrideContext=c;};YAHOO.util.Subscriber.prototype.getScope=function(a){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return a;};YAHOO.util.Subscriber.prototype.contains=function(a,b){if(b){return(this.fn==a&&this.obj==b);}else{return(this.fn==a);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var g=false,h=[],j=[],a=0,e=[],b=0,c={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},d=YAHOO.env.ua.ie,f="focusin",i="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:d,_interval:null,_dri:null,_specialTypes:{focusin:(d?"focusin":"focus"),focusout:(d?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(q,m,o,p,n){var k=(YAHOO.lang.isString(q))?[q]:q;for(var l=0;l<k.length;l=l+1){e.push({id:k[l],fn:m,obj:o,overrideContext:p,checkReady:n});}a=this.POLL_RETRYS;this.startInterval();},onContentReady:function(n,k,l,m){this.onAvailable(n,k,l,m,true);},onDOMReady:function(){this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent,arguments);},_addListener:function(m,k,v,p,t,y){if(!v||!v.call){return false;}if(this._isValidCollection(m)){var w=true;for(var q=0,s=m.length;q<s;++q){w=this.on(m[q],k,v,p,t)&&w;}return w;}else{if(YAHOO.lang.isString(m)){var o=this.getEl(m);if(o){m=o;}else{this.onAvailable(m,function(){YAHOO.util.Event._addListener(m,k,v,p,t,y);});return true;}}}if(!m){return false;}if("unload"==k&&p!==this){j[j.length]=[m,k,v,p,t];return true;}var l=m;if(t){if(t===true){l=p;}else{l=t;}}var n=function(z){return v.call(l,YAHOO.util.Event.getEvent(z,m),p);};var x=[m,k,v,n,l,p,t,y];var r=h.length;h[r]=x;try{this._simpleAdd(m,k,n,y);}catch(u){this.lastError=u;this.removeListener(m,k,v);return false;}return true;},_getType:function(k){return this._specialTypes[k]||k;},addListener:function(m,p,l,n,o){var k=((p==f||p==i)&&!YAHOO.env.ua.ie)?true:false;return this._addListener(m,this._getType(p),l,n,o,k);},addFocusListener:function(l,k,m,n){return this.on(l,f,k,m,n);},removeFocusListener:function(l,k){return this.removeListener(l,f,k);},addBlurListener:function(l,k,m,n){return this.on(l,i,k,m,n);},removeBlurListener:function(l,k){return this.removeListener(l,i,k);},removeListener:function(l,k,r){var m,p,u;k=this._getType(k);if(typeof l=="string"){l=this.getEl(l);}else{if(this._isValidCollection(l)){var s=true;for(m=l.length-1;m>-1;m--){s=(this.removeListener(l[m],k,r)&&s);}return s;}}if(!r||!r.call){return this.purgeElement(l,false,k);}if("unload"==k){for(m=j.length-1;m>-1;m--){u=j[m];if(u&&u[0]==l&&u[1]==k&&u[2]==r){j.splice(m,1);return true;}}return false;}var n=null;var o=arguments[3];if("undefined"===typeof o){o=this._getCacheIndex(h,l,k,r);}if(o>=0){n=h[o];}if(!l||!n){return false;}var t=n[this.CAPTURE]===true?true:false;try{this._simpleRemove(l,k,n[this.WFN],t);}catch(q){this.lastError=q;return false;}delete h[o][this.WFN];delete h[o][this.FN];h.splice(o,1);return true;},getTarget:function(m,l){var k=m.target||m.srcElement;return this.resolveTextNode(k);},resolveTextNode:function(l){try{if(l&&3==l.nodeType){return l.parentNode;}}catch(k){return null;}return l;},getPageX:function(l){var k=l.pageX;if(!k&&0!==k){k=l.clientX||0;if(this.isIE){k+=this._getScrollLeft();}}return k;},getPageY:function(k){var l=k.pageY;if(!l&&0!==l){l=k.clientY||0;if(this.isIE){l+=this._getScrollTop();}}return l;},getXY:function(k){return[this.getPageX(k),this.getPageY(k)];},getRelatedTarget:function(l){var k=l.relatedTarget;
if(!k){if(l.type=="mouseout"){k=l.toElement;}else{if(l.type=="mouseover"){k=l.fromElement;}}}return this.resolveTextNode(k);},getTime:function(m){if(!m.time){var l=new Date().getTime();try{m.time=l;}catch(k){this.lastError=k;return l;}}return m.time;},stopEvent:function(k){this.stopPropagation(k);this.preventDefault(k);},stopPropagation:function(k){if(k.stopPropagation){k.stopPropagation();}else{k.cancelBubble=true;}},preventDefault:function(k){if(k.preventDefault){k.preventDefault();}else{k.returnValue=false;}},getEvent:function(m,k){var l=m||window.event;if(!l){var n=this.getEvent.caller;while(n){l=n.arguments[0];if(l&&Event==l.constructor){break;}n=n.caller;}}return l;},getCharCode:function(l){var k=l.keyCode||l.charCode||0;if(YAHOO.env.ua.webkit&&(k in c)){k=c[k];}return k;},_getCacheIndex:function(n,q,r,p){for(var o=0,m=n.length;o<m;o=o+1){var k=n[o];if(k&&k[this.FN]==p&&k[this.EL]==q&&k[this.TYPE]==r){return o;}}return -1;},generateId:function(k){var l=k.id;if(!l){l="yuievtautoid-"+b;++b;k.id=l;}return l;},_isValidCollection:function(l){try{return(l&&typeof l!=="string"&&l.length&&!l.tagName&&!l.alert&&typeof l[0]!=="undefined");}catch(k){return false;}},elCache:{},getEl:function(k){return(typeof k==="string")?document.getElementById(k):k;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",YAHOO,0,0,1),_load:function(l){if(!g){g=true;var k=YAHOO.util.Event;k._ready();k._tryPreloadAttach();}},_ready:function(l){var k=YAHOO.util.Event;if(!k.DOMReady){k.DOMReady=true;k.DOMReadyEvent.fire();k._simpleRemove(document,"DOMContentLoaded",k._ready);}},_tryPreloadAttach:function(){if(e.length===0){a=0;if(this._interval){this._interval.cancel();this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var q=!g;if(!q){q=(a>0&&e.length>0);}var p=[];var r=function(t,u){var s=t;if(u.overrideContext){if(u.overrideContext===true){s=u.obj;}else{s=u.overrideContext;}}u.fn.call(s,u.obj);};var l,k,o,n,m=[];for(l=0,k=e.length;l<k;l=l+1){o=e[l];if(o){n=this.getEl(o.id);if(n){if(o.checkReady){if(g||n.nextSibling||!q){m.push(o);e[l]=null;}}else{r(n,o);e[l]=null;}}else{p.push(o);}}}for(l=0,k=m.length;l<k;l=l+1){o=m[l];r(this.getEl(o.id),o);}a--;if(q){for(l=e.length-1;l>-1;l--){o=e[l];if(!o||!o.id){e.splice(l,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(p,q,s){var n=(YAHOO.lang.isString(p))?this.getEl(p):p;var r=this.getListeners(n,s),o,k;if(r){for(o=r.length-1;o>-1;o--){var m=r[o];this.removeListener(n,m.type,m.fn);}}if(q&&n&&n.childNodes){for(o=0,k=n.childNodes.length;o<k;++o){this.purgeElement(n.childNodes[o],q,s);}}},getListeners:function(n,k){var q=[],m;if(!k){m=[h,j];}else{if(k==="unload"){m=[j];}else{k=this._getType(k);m=[h];}}var s=(YAHOO.lang.isString(n))?this.getEl(n):n;for(var p=0;p<m.length;p=p+1){var u=m[p];if(u){for(var r=0,t=u.length;r<t;++r){var o=u[r];if(o&&o[this.EL]===s&&(!k||k===o[this.TYPE])){q.push({type:o[this.TYPE],fn:o[this.FN],obj:o[this.OBJ],adjust:o[this.OVERRIDE],scope:o[this.ADJ_SCOPE],index:r});}}}}return(q.length)?q:null;},_unload:function(s){var m=YAHOO.util.Event,p,o,n,r,q,t=j.slice(),k;for(p=0,r=j.length;p<r;++p){n=t[p];if(n){try{k=window;if(n[m.ADJ_SCOPE]){if(n[m.ADJ_SCOPE]===true){k=n[m.UNLOAD_OBJ];}else{k=n[m.ADJ_SCOPE];}}n[m.FN].call(k,m.getEvent(s,n[m.EL]),n[m.UNLOAD_OBJ]);}catch(w){}t[p]=null;}}n=null;k=null;j=null;if(h){for(o=h.length-1;o>-1;o--){n=h[o];if(n){try{m.removeListener(n[m.EL],n[m.TYPE],n[m.FN],o);}catch(v){}}}n=null;}try{m._simpleRemove(window,"unload",m._unload);m._simpleRemove(window,"load",m._load);}catch(u){}},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var k=document.documentElement,l=document.body;if(k&&(k.scrollTop||k.scrollLeft)){return[k.scrollTop,k.scrollLeft];}else{if(l){return[l.scrollTop,l.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(m,n,l,k){m.addEventListener(n,l,(k));};}else{if(window.attachEvent){return function(m,n,l,k){m.attachEvent("on"+n,l);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(m,n,l,k){m.removeEventListener(n,l,(k));};}else{if(window.detachEvent){return function(l,m,k){l.detachEvent("on"+m,k);};}else{return function(){};}}}()};}();(function(){var a=YAHOO.util.Event;a.on=a.addListener;a.onFocus=a.addFocusListener;a.onBlur=a.addBlurListener;
if(a.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;a._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var b=document.createElement("p");a._dri=setInterval(function(){try{b.doScroll("left");clearInterval(a._dri);a._dri=null;a._ready();b=null;}catch(c){}},a.POLL_INTERVAL);}}else{if(a.webkit&&a.webkit<525){a._dri=setInterval(function(){var c=document.readyState;if("loaded"==c||"complete"==c){clearInterval(a._dri);a._dri=null;a._ready();}},a.POLL_INTERVAL);}else{a._simpleAdd(document,"DOMContentLoaded",a._ready);}}a._simpleAdd(window,"load",a._load);a._simpleAdd(window,"unload",a._unload);a._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(a,c,f,e){this.__yui_events=this.__yui_events||{};var d=this.__yui_events[a];if(d){d.subscribe(c,f,e);}else{this.__yui_subscribers=this.__yui_subscribers||{};var b=this.__yui_subscribers;if(!b[a]){b[a]=[];}b[a].push({fn:c,obj:f,overrideContext:e});}},unsubscribe:function(c,e,g){this.__yui_events=this.__yui_events||{};var a=this.__yui_events;if(c){var f=a[c];if(f){return f.unsubscribe(e,g);}}else{var b=true;for(var d in a){if(YAHOO.lang.hasOwnProperty(a,d)){b=b&&a[d].unsubscribe(e,g);
}}return b;}return false;},unsubscribeAll:function(a){return this.unsubscribe(a);},createEvent:function(b,g){this.__yui_events=this.__yui_events||{};var e=g||{},d=this.__yui_events,f;if(d[b]){}else{f=new YAHOO.util.CustomEvent(b,e.scope||this,e.silent,YAHOO.util.CustomEvent.FLAT,e.fireOnce);d[b]=f;if(e.onSubscribeCallback){f.subscribeEvent.subscribe(e.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var a=this.__yui_subscribers[b];if(a){for(var c=0;c<a.length;++c){f.subscribe(a[c].fn,a[c].obj,a[c].overrideContext);}}}return d[b];},fireEvent:function(b){this.__yui_events=this.__yui_events||{};var d=this.__yui_events[b];if(!d){return null;}var a=[];for(var c=1;c<arguments.length;++c){a.push(arguments[c]);}return d.fire.apply(d,a);},hasEvent:function(a){if(this.__yui_events){if(this.__yui_events[a]){return true;}}return false;}};(function(){var a=YAHOO.util.Event,c=YAHOO.lang;YAHOO.util.KeyListener=function(d,i,e,f){if(!d){}else{if(!i){}else{if(!e){}}}if(!f){f=YAHOO.util.KeyListener.KEYDOWN;}var g=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(c.isString(d)){d=document.getElementById(d);}if(c.isFunction(e)){g.subscribe(e);}else{g.subscribe(e.fn,e.scope,e.correctScope);}function h(o,n){if(!i.shift){i.shift=false;}if(!i.alt){i.alt=false;}if(!i.ctrl){i.ctrl=false;}if(o.shiftKey==i.shift&&o.altKey==i.alt&&o.ctrlKey==i.ctrl){var j,m=i.keys,l;if(YAHOO.lang.isArray(m)){for(var k=0;k<m.length;k++){j=m[k];l=a.getCharCode(o);if(j==l){g.fire(l,o);break;}}}else{l=a.getCharCode(o);if(m==l){g.fire(l,o);}}}}this.enable=function(){if(!this.enabled){a.on(d,f,h);this.enabledEvent.fire(i);}this.enabled=true;};this.disable=function(){if(this.enabled){a.removeListener(d,f,h);this.disabledEvent.fire(i);}this.enabled=false;};this.toString=function(){return"KeyListener ["+i.keys+"] "+d.tagName+(d.id?"["+d.id+"]":"");};};var b=YAHOO.util.KeyListener;b.KEYDOWN="keydown";b.KEYUP="keyup";b.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.9.0",build:"2800"});YAHOO.register("yuiloader-dom-event", YAHOO, {version: "2.9.0", build: "2800"});
jQuery(function(){function e(e){return $.browser.msie?window[e]:document[e]}function n(e){e.className.indexOf("b-ball__right")>-1&&(e=e.parentNode);var n=/b-ball_n(\d+)/.exec(e.className),o=/b-head-decor__inner_n(\d+)/.exec(e.parentNode.className);n&&o&&(n=parseInt(n[1],10)-1,o=parseInt(o[1],10)-1,t((n+9*o)%s))}function o(e){function n(){function e(){function e(){function e(){o.removeClass("bounce3")}o.removeClass("bounce2").addClass("bounce3"),setTimeout(e,300)}o.removeClass("bounce1").addClass("bounce2"),setTimeout(e,300)}o.removeClass("bounce").addClass("bounce1"),setTimeout(e,300)}var o=jQuery(e);e.className.indexOf(" bounce")>-1||(o.addClass("bounce"),setTimeout(n,300))}var t=function(){};jQuery(document).delegate(".b-ball_bounce","mouseenter",function(){n(this),o(this)}).delegate(".b-ball_bounce .b-ball__right","mouseenter",function(e){e.stopPropagation(),n(this),o(this)}),window.flashInited=function(){t=function(n){try{e("z-audio__player").playSound(n)}catch(o){}}},window.swfobject&&window.setTimeout(function(){$("body").append('<div class="g-invisible"><div id="z-audio__player"></div></div>'),f()},100);for(var a=["1","2","3","4","5","6","7","8","9","0","-","=","q","w","e","r","t","y","u","i","o","p","[","]","a","s","d","f","g","h","j","k","l",";","'","\\"],i=["z","x","c","v","b","n","m",",",".","/"],s=36,u={},c=0,d=a.length;d>c;c++)u[a[c].charCodeAt(0)]=c;for(var c=0,d=i.length;d>c;c++)u[i[c].charCodeAt(0)]=c;jQuery(document).keypress(function(e){var n=$(e.target);!n.is("input")&&e.which in u&&t(u[e.which])})});
!function(){var e=document.currentScript;function t(t){var n=document.createElement("script"),o=e||document.getElementsByTagName("script")[0];n.setAttribute("async",!0),n.setAttribute("src",t),o.parentNode.insertBefore(n,o)}function n(e,t){return Element.prototype.matches?e.matches(t):Element.prototype.msMatchesSelector?e.msMatchesSelector(t):void 0}function o(e,t){if(e.closest)return e.closest(t);var o=e;do{if(n(o,t))return o;o=o.parentElement||o.parentNode}while(null!==o&&1===o.nodeType);return null}function i(e,t){for(var n=0;n<e.length;n++)t(e[n],n,e)}var r=".sharing-hidden .inner",s="data-sharing-more-button-id";function a(e){this.button=e,this.pane=o(e,"div").querySelector(r),this.openedBy=null,this.recentlyOpenedByHover=!1,a.instances.push(this),this.pane.setAttribute(s,a.instances.length-1),this.attachHandlers()}if(a.instances=[],a.hoverOpenDelay=200,a.recentOpenDelay=400,a.hoverCloseDelay=300,a.instantiateOrReuse=function(e){var t=o(e,"div").querySelector(r),n=t&&t.getAttribute(s),i=a.instances[n];return i||new a(e)},a.getButtonInstanceFromPane=function(e){var t=e&&e.getAttribute(s);return a.instances[t]},a.closeAll=function(){for(var e=0;e<a.instances.length;e++)a.instances[e].close()},a.prototype.open=function(){var e,t,n=[0,0];function o(e){var t=e.getBoundingClientRect();return[t.left+(window.scrollX||window.pageXOffset||0),t.top+(window.scrollY||window.pageYOffset||0)]}function i(e,t){return parseInt(getComputedStyle(e).getPropertyValue(t)||0)}for(e=o(this.button),t=this.button.offsetParent||document.documentElement;t&&(t===document.body||t===document.documentElement)&&"static"===getComputedStyle(t).getPropertyValue("position");)t=t.parentNode;t&&t!==this.button&&1===t.nodeType&&(n=[(n=o(t))[0]+i(t,"border-left-width"),n[1]+i(t,"border-top-width")]);var r,s=e[0]-n[0]-i(this.button,"margin-left"),a=e[1]-n[1]-i(this.button,"margin-top");this.pane.style.left=s+"px",this.pane.style.top=a+this.button.offsetHeight+3+"px",(r=this.pane)&&r.style.removeProperty("display")},a.prototype.close=function(){var e;(e=this.pane)&&(e.style.display="none"),this.openedBy=null},a.prototype.toggle=function(){var e;(e=this.pane)&&"none"!==e.style.display?this.close():this.open()},a.prototype.nonHoverOpen=function(){clearTimeout(this.openTimer),clearTimeout(this.closeTimer),this.recentlyOpenedByHover?(this.recentlyOpenedByHover=!1,clearTimeout(this.hoverOpenTimer),this.open()):this.toggle()},a.prototype.resetCloseTimer=function(){clearTimeout(this.closeTimer),this.closeTimer=setTimeout(this.close.bind(this),a.hoverCloseDelay)},a.prototype.attachHandlers=function(){this.buttonClick=function(e){e.preventDefault(),e.stopPropagation(),this.openedBy="click",this.nonHoverOpen()}.bind(this),this.buttonKeydown=function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),e.stopPropagation(),this.openedBy="keydown",this.nonHoverOpen())}.bind(this),this.buttonEnter=function(){this.openedBy||(this.openTimer=setTimeout(function(){this.open(),this.openedBy="hover",this.recentlyOpenedByHover=!0,this.hoverOpenTimer=setTimeout(function(){this.recentlyOpenedByHover=!1}.bind(this),a.recentOpenDelay)}.bind(this),a.hoverOpenDelay)),clearTimeout(this.closeTimer)}.bind(this),this.buttonLeave=function(){"hover"===this.openedBy&&this.resetCloseTimer(),clearTimeout(this.openTimer)}.bind(this),this.paneEnter=function(){clearTimeout(this.closeTimer)}.bind(this),this.paneLeave=function(){"hover"===this.openedBy&&this.resetCloseTimer()}.bind(this),this.documentClick=function(){this.close()}.bind(this),this.button.addEventListener("click",this.buttonClick),this.button.addEventListener("keydown",this.buttonKeydown),document.addEventListener("click",this.documentClick),void 0===document.ontouchstart&&(this.button.addEventListener("mouseenter",this.buttonEnter),this.button.addEventListener("mouseleave",this.buttonLeave),this.pane.addEventListener("mouseenter",this.paneEnter),this.pane.addEventListener("mouseleave",this.paneLeave))},window.sharing_js_options&&window.sharing_js_options.counts){var c={done_urls:[],get_counts:function(){var e,n,o,i,r;if("undefined"!=typeof WPCOM_sharing_counts)for(e in WPCOM_sharing_counts)if(o=WPCOM_sharing_counts[e],void 0===c.done_urls[o]){for(i in n={pinterest:[window.location.protocol+"//api.pinterest.com/v1/urls/count.json?callback=WPCOMSharing.update_pinterest_count&url="+encodeURIComponent(e)]})if(document.querySelector("a[data-shared=sharing-"+i+"-"+o+"]")){for(;r=n[i].pop();)t(r);window.sharing_js_options.is_stats_active&&c.bump_sharing_count_stat(i)}c.done_urls[o]=!0}},update_pinterest_count:function(e){void 0!==e.count&&1*e.count>0&&c.inject_share_count("sharing-pinterest-"+WPCOM_sharing_counts[e.url],e.count)},inject_share_count:function(e,t){i(document.querySelectorAll("a[data-shared="+e+"] > span"),function(e){var n,o=e.querySelector(".share-count");(n=o)&&n.parentNode&&n.parentNode.removeChild(n);var i=document.createElement("span");i.className="share-count",i.textContent=c.format_count(t),e.appendChild(i)})},format_count:function(e){return e<1e3?e:e>=1e3&&e<1e4?String(e).substring(0,1)+"K+":"10K+"},bump_sharing_count_stat:function(e){(new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv&x_sharing-count-request="+e+"&r="+Math.random()}};window.WPCOMSharing=c}function u(e,t){e.setAttribute("jetpack-share-click-count",t)}function d(e){var t=e.getAttribute("jetpack-share-click-count");return null===t?0:parseInt(t,10)}function l(e,t){var n,o=new XMLHttpRequest;o.open("POST",e,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),o.setRequestHeader("x-requested-with","XMLHttpRequest"),o.send((n=t,(encodeURIComponent("email-share-nonce")+"="+encodeURIComponent(n)).replace(/%20/g,"+")))}function h(){p()}function p(){window.WPCOMSharing&&window.WPCOMSharing.get_counts(),i(document.querySelectorAll(".sharedaddy a"),function(e){var t=e.getAttribute("href");t&&-1!==t.indexOf("share=")&&-1===t.indexOf("&nb=1")&&e.setAttribute("href",t+"&nb=1")}),i(document.querySelectorAll(".sharedaddy a.sharing-anchor"),function(e){a.instantiateOrReuse(e)}),void 0!==document.ontouchstart&&document.body.classList.add("jp-sharing-input-touch"),i(document.querySelectorAll(".sharedaddy ul"),function(e){"true"!==e.getAttribute("data-sharing-events-added")&&(e.setAttribute("data-sharing-events-added","true"),i(e.querySelectorAll("a.share-print"),function(e){e.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation();var n=e.getAttribute("href")||"",i=function(){if(-1===n.indexOf("#print")){var e=(new Date).getTime();t=e,o=n,(i=document.createElement("iframe")).setAttribute("style","position:fixed; top:100; left:100; height:1px; width:1px; border:none;"),i.setAttribute("id","printFrame-"+t),i.setAttribute("name",i.getAttribute("id")),i.setAttribute("src",o),i.setAttribute("onload",'frames["printFrame-'+t+'"].focus();frames["printFrame-'+t+'"].print();'),document.body.appendChild(i)}else window.print();var t,o,i},s=o(e,r);if(s){var c=a.getButtonInstanceFromPane(s);c&&(c.close(),i())}else i()})}),i(e.querySelectorAll("a.share-press-this"),function(e){e.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation();var n="";if(window.getSelection?n=window.getSelection():document.getSelection?n=document.getSelection():document.selection&&(n=document.selection.createRange().text),n){var o=e.getAttribute("href");e.setAttribute("href",o+"&sel="+encodeURI(n))}window.open(e.getAttribute("href"),"t","toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=570")||(document.location.href=e.getAttribute("href"))})}),i(e.querySelectorAll("a.share-email"),function(t){u(t,0);var n,o,r=t.getAttribute("data-email-share-nonce"),s=t.getAttribute("data-email-share-track-url");r&&s&&(n=s,o=window.location.protocol+"//"+window.location.hostname+"/",0===String(n).indexOf(o))&&t.addEventListener("click",function(){var n;u(n=t,d(n)+1),d(t)>2&&function(e,t){var n=t.parentElement;if(n.classList.contains("sd-content")){i(n.querySelectorAll(".share-email-error"),function(e){e.parentElement.removeChild(e)});var o=document.createElement("div");o.className="share-email-error";var r=document.createElement("h6");r.className="share-email-error-title",r.innerText=e.getAttribute("data-email-share-error-title"),o.appendChild(r);var s=document.createElement("p");s.className="share-email-error-text",s.innerText=e.getAttribute("data-email-share-error-text"),o.appendChild(s),n.appendChild(o)}}(t,e),l(s,r)})}))}),i(document.querySelectorAll("li.share-email, li.share-custom a.sharing-anchor"),function(e){e.classList.add("share-service-visible")})}"loading"!==document.readyState?h():document.addEventListener("DOMContentLoaded",h),document.body.addEventListener("is.post-load",p)}();