var default_location = 'New York';
        var latlng;
        var address;
        var dist = 0;
        var Sgeocoder = (typeof google!=='undefined' && typeof google.maps!=='undefined') ? new google.maps.Geocoder() : {};

		function geodir_setup_submit_search() {
            jQuery('.geodir_submit_search').unbind('click');// unbind any other click events
			jQuery('.geodir_submit_search').click(function(e) {

                e.preventDefault();

				var s = ' ';
				var $form = jQuery(this).closest('form');

				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == 'Search for') jQuery('.search_text', $form).val(s);
				
				// Disable location based search for disabled location post type.
				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
					if (gd_cpt_no_location(jQuery('.search_by_post', $form).val())) {
						jQuery('.snear', $form).remove();
						jQuery('.sgeo_lat', $form).remove();
						jQuery('.sgeo_lon', $form).remove();
						jQuery('select[name="sort_by"]', $form).remove();
						jQuery($form).submit();
						return;
					}
				}
				
				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != 'Near')) {
					geodir_setsearch($form);
				} else {
					jQuery(".snear", $form).val('');
					jQuery($form).submit();
				}
			});
		}

        jQuery(document).ready(function() {
            geodir_setup_submit_search();
            //setup advanced search form on form ajax load
            jQuery("body").on("geodir_setup_search_form", function(){
                geodir_setup_submit_search();
            });
        });
        
		function geodir_setsearch($form) {
			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == 'Near')) jQuery(".snear", $form).val(default_location);
			geocodeAddress($form);
		}

        function updateSearchPosition(latLng, $form) {
            if (window.gdMaps === 'google') {
                jQuery('.sgeo_lat').val(latLng.lat());
                jQuery('.sgeo_lon').val(latLng.lng());
            } else if (window.gdMaps === 'osm') {
                jQuery('.sgeo_lat').val(latLng.lat);
                jQuery('.sgeo_lon').val(latLng.lon);
            }
            jQuery($form).submit(); // submit form after insering the lat long positions
        }

        function geocodeAddress($form) {
            // Call the geocode function
            Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;

            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^In:")) {
                if (jQuery('.snear', $form).val().match("^In:")) {
                    jQuery(".snear", $form).val('');
                }
                jQuery($form).submit();
            } else {
                var address = jQuery(".snear", $form).val();

                if (jQuery('.snear', $form).val() == 'Near') {
                    initialise2();
                } else {
                                        if (window.gdMaps === 'google') {
                        Sgeocoder.geocode({'address': address},
                            function (results, status) {
                                if (status == google.maps.GeocoderStatus.OK) {
                                    updateSearchPosition(results[0].geometry.location, $form);
                                } else {
                                    alert("Search was not successful for the following reason :" + status);
                                }
                            });
                    } else if (window.gdMaps === 'osm') {
                        geocodePositionOSM(false, address, false, false, 
                            function(geo) {
                                if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
                                    updateSearchPosition(geo, $form);
                                } else {
                                    alert("Search was not successful for the requested address.");
                                }
                            });
                    } else {
                        jQuery($form).submit();
                    }
                }
            }
        }

        function initialise2() {
            if (!window.gdMaps) {
                return;
            }
            
            if (window.gdMaps === 'google') {
                var latlng = new google.maps.LatLng(56.494343, -4.205446);
                var myOptions = {
                    zoom: 4,
                    mapTypeId: google.maps.MapTypeId.TERRAIN,
                    disableDefaultUI: true
                }
            } else if (window.gdMaps === 'osm') {
                var latlng = new L.LatLng(56.494343, -4.205446);
                var myOptions = {
                    zoom: 4,
                    mapTypeId: 'TERRAIN',
                    disableDefaultUI: true
                }
            }
            try { prepareGeolocation(); } catch (e) {}
            doGeolocation();
        }

        function doGeolocation() {
            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(positionSuccess, positionError);
            } else {
                positionError(-1);
            }
        }

        function positionError(err) {
            var msg;
            switch (err.code) {
                case err.UNKNOWN_ERROR:
                    msg = "Unable to find your location";
                    break;
                case err.PERMISSION_DENINED:
                    msg = "Permission denied in finding your location";
                    break;
                case err.POSITION_UNAVAILABLE:
                    msg = "Your location is currently unknown";
                    break;
                case err.BREAK:
                    msg = "Attempt to find location took too long";
                    break;
                default:
                    msg = "Location detection not supported in browser";
            }
            jQuery('#info').html(msg);
        }

        function positionSuccess(position) {
            var coords = position.coords || position.coordinate || position;
            jQuery('.sgeo_lat').val(coords.latitude);
            jQuery('.sgeo_lon').val(coords.longitude);

            jQuery('.geodir-listing-search').submit();
        }

        /**
         * On unload page do some cleaning so back button cache does not store these values.
         */
        window.onunload = function(){
            if(jQuery('.sgeo_lat').length ){
                jQuery('.sgeo_lat').val('');
                jQuery('.sgeo_lon').val('');
            }
        };

jQuery(document).ready(function () {
            jQuery('.geodir-bestof-cat-list a, #geodir_bestof_tab_dd').on("click change", function (e) {
                var widgetBox = jQuery(this).closest('.geodir_bestof_widget');
                var loading = jQuery(widgetBox).find("#geodir-bestof-loading");
                var container = jQuery(widgetBox).find('#geodir-bestof-places');

                jQuery(document).ajaxStart(function () {
                    //container.hide(); // Not working when more then one widget on page
                    //loading.show();
                }).ajaxStop(function () {
                    loading.hide();
                    container.fadeIn('slow');
                });

                e.preventDefault();

                var activeTab = jQuery(this).closest('dl').find('dd.geodir-tab-active');
                activeTab.removeClass('geodir-tab-active');
                jQuery(this).parent().addClass('geodir-tab-active');

                var term_id = 0;
                if (e.type === "change") {
                    term_id = jQuery(this).val();
                } else if (e.type === "click") {
                    term_id = jQuery(this).attr('data-termid');
                }

                var post_type = jQuery(widgetBox).find('#bestof_widget_post_type').val();
                var excerpt_type = jQuery(widgetBox).find('#bestof_widget_excerpt_type').val();
                var post_limit = jQuery(widgetBox).find('#bestof_widget_post_limit').val();
                var taxonomy = jQuery(widgetBox).find('#bestof_widget_taxonomy').val();
                var char_count = jQuery(widgetBox).find('#bestof_widget_char_count').val();
                var add_location_filter = jQuery(widgetBox).find('#bestof_widget_location_filter').val();

                var data = {
                    'action': 'geodir_bestof',
                    'geodir_bestof_nonce': '9ce9ac1d22',
                    'post_type': post_type,
                    'excerpt_type': excerpt_type,
                    'post_limit': post_limit,
                    'taxonomy': taxonomy,
                    'geodir_ajax': true,
                    'term_id': term_id,
                    'char_count': char_count,
                    'add_location_filter': add_location_filter
                };

                container.hide();
                loading.show();

                jQuery.post(geodir_var.geodir_ajax_url, data, function (response) {
                    container.html(response);
                    jQuery(widgetBox).find('.geodir_category_list_view li .geodir-post-img .geodir_thumbnail img').css('display', 'block');

                    // start lazy load if it's turned on
                    if(geodir_var.geodir_lazy_load==1){
                        geodir_init_lazy_load();
                    }

                });
            })
        });
        jQuery(document).ready(function () {
            if (jQuery(window).width() < 660) {
                if (jQuery('.bestof-widget-tab-layout').hasClass('bestof-tabs-on-left')) {
                    jQuery('.bestof-widget-tab-layout').removeClass('bestof-tabs-on-left').addClass('bestof-tabs-as-dropdown');
                } else if (jQuery('.bestof-widget-tab-layout').hasClass('bestof-tabs-on-top')) {
                    jQuery('.bestof-widget-tab-layout').removeClass('bestof-tabs-on-top').addClass('bestof-tabs-as-dropdown');
                }
            }
        });

"undefined"!=typeof jQuery?("undefined"==typeof jQuery.fn.hoverIntent&&!function(a){a.fn.hoverIntent=function(b,c,d){var e={interval:100,sensitivity:6,timeout:0};e="object"==typeof b?a.extend(e,b):a.isFunction(c)?a.extend(e,{over:b,out:c,selector:d}):a.extend(e,{over:b,out:b,selector:c});var f,g,h,i,j=function(a){f=a.pageX,g=a.pageY},k=function(b,c){return c.hoverIntent_t=clearTimeout(c.hoverIntent_t),Math.sqrt((h-f)*(h-f)+(i-g)*(i-g))<e.sensitivity?(a(c).off("mousemove.hoverIntent",j),c.hoverIntent_s=!0,e.over.apply(c,[b])):(h=f,i=g,void(c.hoverIntent_t=setTimeout(function(){k(b,c)},e.interval)))},l=function(a,b){return b.hoverIntent_t=clearTimeout(b.hoverIntent_t),b.hoverIntent_s=!1,e.out.apply(b,[a])},m=function(b){var c=a.extend({},b),d=this;d.hoverIntent_t&&(d.hoverIntent_t=clearTimeout(d.hoverIntent_t)),"mouseenter"===b.type?(h=c.pageX,i=c.pageY,a(d).on("mousemove.hoverIntent",j),d.hoverIntent_s||(d.hoverIntent_t=setTimeout(function(){k(c,d)},e.interval))):(a(d).off("mousemove.hoverIntent",j),d.hoverIntent_s&&(d.hoverIntent_t=setTimeout(function(){l(c,d)},e.timeout)))};return this.on({"mouseenter.hoverIntent":m,"mouseleave.hoverIntent":m},e.selector)}}(jQuery),jQuery(document).ready(function(a){var b,c,d,e=a("#wpadminbar"),f=!1;b=function(b,c){var d=a(c),e=d.attr("tabindex");e&&d.attr("tabindex","0").attr("tabindex",e)},c=function(b){e.find("li.menupop").on("click.wp-mobile-hover",function(c){var d=a(this);d.parent().is("#wp-admin-bar-root-default")&&!d.hasClass("hover")?(c.preventDefault(),e.find("li.menupop.hover").removeClass("hover"),d.addClass("hover")):d.hasClass("hover")?a(c.target).closest("div").hasClass("ab-sub-wrapper")||(c.stopPropagation(),c.preventDefault(),d.removeClass("hover")):(c.stopPropagation(),c.preventDefault(),d.addClass("hover")),b&&(a("li.menupop").off("click.wp-mobile-hover"),f=!1)})},d=function(){var b=/Mobile\/.+Safari/.test(navigator.userAgent)?"touchstart":"click";a(document.body).on(b+".wp-mobile-hover",function(b){a(b.target).closest("#wpadminbar").length||e.find("li.menupop.hover").removeClass("hover")})},e.removeClass("nojq").removeClass("nojs"),"ontouchstart"in window?(e.on("touchstart",function(){c(!0),f=!0}),d()):/IEMobile\/[1-9]/.test(navigator.userAgent)&&(c(),d()),e.find("li.menupop").hoverIntent({over:function(){f||a(this).addClass("hover")},out:function(){f||a(this).removeClass("hover")},timeout:180,sensitivity:7,interval:100}),window.location.hash&&window.scrollBy(0,-32),a("#wp-admin-bar-get-shortlink").click(function(b){b.preventDefault(),a(this).addClass("selected").children(".shortlink-input").blur(function(){a(this).parents("#wp-admin-bar-get-shortlink").removeClass("selected")}).focus().select()}),a("#wpadminbar li.menupop > .ab-item").bind("keydown.adminbar",function(c){if(13==c.which){var d=a(c.target),e=d.closest(".ab-sub-wrapper"),f=d.parent().hasClass("hover");c.stopPropagation(),c.preventDefault(),e.length||(e=a("#wpadminbar .quicklinks")),e.find(".menupop").removeClass("hover"),f||d.parent().toggleClass("hover"),d.siblings(".ab-sub-wrapper").find(".ab-item").each(b)}}).each(b),a("#wpadminbar .ab-item").bind("keydown.adminbar",function(c){if(27==c.which){var d=a(c.target);c.stopPropagation(),c.preventDefault(),d.closest(".hover").removeClass("hover").children(".ab-item").focus(),d.siblings(".ab-sub-wrapper").find(".ab-item").each(b)}}),e.click(function(b){"wpadminbar"!=b.target.id&&"wp-admin-bar-top-secondary"!=b.target.id||(e.find("li.menupop.hover").removeClass("hover"),a("html, body").animate({scrollTop:0},"fast"),b.preventDefault())}),a(".screen-reader-shortcut").keydown(function(b){var c,d;13==b.which&&(c=a(this).attr("href"),d=navigator.userAgent.toLowerCase(),d.indexOf("applewebkit")!=-1&&c&&"#"==c.charAt(0)&&setTimeout(function(){a(c).focus()},100))}),a("#adminbar-search").on({focus:function(){a("#adminbarsearch").addClass("adminbar-focused")},blur:function(){a("#adminbarsearch").removeClass("adminbar-focused")}}),"sessionStorage"in window&&a("#wp-admin-bar-logout a").click(function(){try{for(var a in sessionStorage)a.indexOf("wp-autosave-")!=-1&&sessionStorage.removeItem(a)}catch(b){}}),navigator.userAgent&&document.body.className.indexOf("no-font-face")===-1&&/Android (1.0|1.1|1.5|1.6|2.0|2.1)|Nokia|Opera Mini|w(eb)?OSBrowser|webOS|UCWEB|Windows Phone OS 7|XBLWP7|ZuneWP7|MSIE 7/.test(navigator.userAgent)&&(document.body.className+=" no-font-face")})):!function(a,b){var c,d=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,function(){return c.call(a,window.event)})},e=new RegExp("\\bhover\\b","g"),f=[],g=new RegExp("\\bselected\\b","g"),h=function(a){for(var b=f.length;b--;)if(f[b]&&a==f[b][1])return f[b][0];return!1},i=function(b){for(var d,i,j,k,l,m,n=[],o=0;b&&b!=c&&b!=a;)"LI"==b.nodeName.toUpperCase()&&(n[n.length]=b,i=h(b),i&&clearTimeout(i),b.className=b.className?b.className.replace(e,"")+" hover":"hover",k=b),b=b.parentNode;if(k&&k.parentNode&&(l=k.parentNode,l&&"UL"==l.nodeName.toUpperCase()))for(d=l.childNodes.length;d--;)m=l.childNodes[d],m!=k&&(m.className=m.className?m.className.replace(g,""):"");for(d=f.length;d--;){for(j=!1,o=n.length;o--;)n[o]==f[d][1]&&(j=!0);j||(f[d][1].className=f[d][1].className?f[d][1].className.replace(e,""):"")}},j=function(b){for(;b&&b!=c&&b!=a;)"LI"==b.nodeName.toUpperCase()&&!function(a){var b=setTimeout(function(){a.className=a.className?a.className.replace(e,""):""},500);f[f.length]=[b,a]}(b),b=b.parentNode},k=function(b){for(var d,e,f,h=b.target||b.srcElement;;){if(!h||h==a||h==c)return;if(h.id&&"wp-admin-bar-get-shortlink"==h.id)break;h=h.parentNode}for(b.preventDefault&&b.preventDefault(),b.returnValue=!1,-1==h.className.indexOf("selected")&&(h.className+=" selected"),d=0,e=h.childNodes.length;d<e;d++)if(f=h.childNodes[d],f.className&&-1!=f.className.indexOf("shortlink-input")){f.focus(),f.select(),f.onblur=function(){h.className=h.className?h.className.replace(g,""):""};break}return!1},l=function(a){var b,c,d,e,f,g;if(!("wpadminbar"!=a.id&&"wp-admin-bar-top-secondary"!=a.id||(b=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,b<1)))for(g=b>800?130:100,c=Math.min(12,Math.round(b/g)),d=b>800?Math.round(b/30):Math.round(b/20),e=[],f=0;b;)b-=d,b<0&&(b=0),e.push(b),setTimeout(function(){window.scrollTo(0,e.shift())},f*c),f++};d(b,"load",function(){c=a.getElementById("wpadminbar"),a.body&&c&&(a.body.appendChild(c),c.className&&(c.className=c.className.replace(/nojs/,"")),d(c,"mouseover",function(a){i(a.target||a.srcElement)}),d(c,"mouseout",function(a){j(a.target||a.srcElement)}),d(c,"click",k),d(c,"click",function(a){l(a.target||a.srcElement)}),d(document.getElementById("wp-admin-bar-logout"),"click",function(){if("sessionStorage"in window)try{for(var a in sessionStorage)a.indexOf("wp-autosave-")!=-1&&sessionStorage.removeItem(a)}catch(b){}})),b.location.hash&&b.scrollBy(0,-32),navigator.userAgent&&document.body.className.indexOf("no-font-face")===-1&&/Android (1.0|1.1|1.5|1.6|2.0|2.1)|Nokia|Opera Mini|w(eb)?OSBrowser|webOS|UCWEB|Windows Phone OS 7|XBLWP7|ZuneWP7|MSIE 7/.test(navigator.userAgent)&&(document.body.className+=" no-font-face")})}(document,window);

jQuery(document).ready(function(){setTimeout(function(){var keyup_timer;var gdlm_msgWait=geodir_location_all_js_msg.LOCATION_PLEASE_WAIT;var gdlm_ajax_url=geodir_location_all_js_msg.geodir_location_admin_ajax_url;jQuery('input[name="loc_pick_country_filter"]').keyup(function(){var $obj=jQuery(this);jQuery(this).parent().find("ul").html(gdlm_msgWait);clearInterval(keyup_timer);total=parseInt(jQuery(this).parent().data("limit"));if(isNaN(total)||!total>0){total=0}keyup_timer=setTimeout(function(){jQuery.post(gdlm_ajax_url,{action:"geodir_location_ajax",gd_loc_ajax_action:"get_location",gd_formated_for:"location_switcher",gd_which_location:"country",gd_country_val:$obj.val(),lscroll:total},function(data){$obj.parent().find("ul").html(data)})},500)});jQuery('input[name="loc_pick_region_filter"]').keyup(function(){var country_val=jQuery(this).parent().parent().find('input[name="loc_pick_country_filter"]').val();jQuery(this).parent().find("ul").html(gdlm_msgWait);var $obj=jQuery(this);total=parseInt(jQuery(this).parent().data("limit"));if(isNaN(total)||!total>0){total=0}clearInterval(keyup_timer);keyup_timer=setTimeout(function(){jQuery.post(gdlm_ajax_url,{action:"geodir_location_ajax",gd_loc_ajax_action:"get_location",gd_formated_for:"location_switcher",gd_which_location:"region",gd_country_val:country_val,gd_region_val:$obj.val(),lscroll:total},function(data){$obj.parent().find("ul").html(data)})},500)});jQuery('input[name="loc_pick_city_filter"]').keyup(function(){jQuery(this).parent().find("ul").html(gdlm_msgWait);var country_val=jQuery(this).parent().parent().find('input[name="loc_pick_country_filter"]').val();var region_val=jQuery(this).parent().parent().find('input[name="loc_pick_region_filter"]').val();var $obj=jQuery(this);total=parseInt(jQuery(this).parent().data("limit"));if(isNaN(total)||!total>0){total=0}clearInterval(keyup_timer);keyup_timer=setTimeout(function(){jQuery.post(gdlm_ajax_url,{action:"geodir_location_ajax",gd_loc_ajax_action:"get_location",gd_formated_for:"location_switcher",gd_which_location:"city",gd_country_val:country_val,gd_region_val:region_val,gd_city_val:$obj.val(),lscroll:total},function(data){$obj.parent().find("ul").html(data)})},500)});jQuery(".geodir-locListing_column ul").on("click",".geodir_loc_arrow a",function(){var which_location="",country_val="",region_val="",city_val="";var $mainDiv=jQuery(this).parents(".geodir_locListing_main");var $curDiv=jQuery(this).parents(".geodir-locListing_column");var $nextDiv=jQuery($curDiv,$mainDiv).next();var $curUl=jQuery(this).parents("ul");var $curLi=jQuery(this).parents("li");var sVal=jQuery("a",$curLi).text().trim();jQuery("li",$curUl).removeClass("geodir_active");$curLi.addClass("geodir_active");jQuery('input[name^="loc_pick_"]',$curDiv).val(sVal);jQuery('input[name^="loc_pick_"]',$nextDiv).val("");if($curUl.hasClass("geodir_country_column")){which_location="region";country_val=sVal}else if($curUl.hasClass("geodir_city_column")){which_location="neighbourhood";city_val=sVal}else{which_location="city";region_val=sVal}var ul_item=jQuery("ul",$nextDiv).html(gdlm_msgWait);total=parseInt($nextDiv.data("limit"));if(isNaN(total)||!total>0){total=0}jQuery.post(gdlm_ajax_url,{action:"geodir_location_ajax",gd_loc_ajax_action:"get_location",gd_formated_for:"location_switcher",gd_which_location:which_location,gd_country_val:country_val,gd_region_val:region_val,gd_city_val:city_val,lscroll:total},function(data){jQuery("ul",$nextDiv).html(data)})});jQuery(".geodir_location_tab_container .geodir_location_tabs").bind("click",function(){var tab=this;var tab_id=jQuery(this).data("location");var autoredirect=jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_switcher_chosen").data("autoredirect");var show_every_where=jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_switcher_chosen").data("showeverywhere");jQuery.post(gdlm_ajax_url+"?action=geodir_location_ajax&gd_loc_ajax_action=fill_location&autoredirect="+autoredirect+"&gd_which_location="+tab_id+"&show_every_where="+show_every_where,function(data){jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_switcher_chosen").html(data).chosen().trigger("chosen:updated");geodir_enable_click_on_chosen_list_item()});jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_tabs").removeClass("gd-tab-active");jQuery(tab).addClass("gd-tab-active");if(!geodir_lm_chosen_supported()){geodir_no_chosen_add_search(jQuery(tab).parents(".geodir_location_tab_container"))}geodir_location_switcher_chosen_ajax()});if(!geodir_lm_chosen_supported()){jQuery("body").removeClass("gd-chosen-no-support").addClass("gd-chosen-no-support");jQuery(".geodir_location_tab_container").each(function(){var $this=this;geodir_no_chosen_add_search($this)})}else{if(jQuery("select.geodir_location_switcher_chosen").length>0){jQuery("select.geodir_location_switcher_chosen").chosen({no_results_text:geodir_location_all_js_msg.LOCATION_CHOSEN_NO_RESULT_TEXT})}if(jQuery("select.geodir_location_add_listing_chosen").length>0){jQuery("select.geodir_location_add_listing_chosen").chosen({no_results_text:geodir_location_all_js_msg.LOCATION_CHOSEN_NO_RESULT_TEXT})}geodir_location_switcher_chosen_ajax()}geodir_enable_click_on_chosen_list_item();if(!geodir_lm_chosen_supported()){jQuery(document).click(function(e){var isSwitcher=jQuery(e.target).closest(".geodir_location_sugestion").html();if(typeof isSwitcher=="undefined"){jQuery(document).find(".geodir_location_sugestion").each(function(){jQuery(this).find('select[name="gd_location"]').removeAttr("size");jQuery(this).find('select[name="gd_location"]').removeClass("geodir-loc-select-list")})}});jQuery(document).find('.geodir_location_sugestion select[name="gd_location"] option').click(function(){if(jQuery(this).attr("selected")=="selected"||jQuery(this).attr("value")==geodir_location_all_js_msg.gd_base_location){jQuery(this).closest("select").removeAttr("size");jQuery(this).closest("select").removeClass("geodir-loc-select-list")}})}jQuery('input[name="loc_pick_neighbourhood_filter"]').keyup(function(){var $this=jQuery(this);var hoodDiv=$this.closest(".geodir-locListing_column");var mainDiv=jQuery(hoodDiv).parent();var country_val=jQuery('input[name="loc_pick_country_filter"]',mainDiv).val();var region_val=jQuery('input[name="loc_pick_region_filter"]',mainDiv).val();var city_val=jQuery('input[name="loc_pick_city_filter"]',mainDiv).val();total=parseInt(hoodDiv.data("limit"));if(isNaN(total)||!total>0){total=0}jQuery("ul",hoodDiv).html(gdlm_msgWait);clearInterval(keyup_timer);keyup_timer=setTimeout(function(){jQuery.post(gdlm_ajax_url,{action:"geodir_location_ajax",gd_loc_ajax_action:"get_location",gd_formated_for:"location_switcher",gd_which_location:"neighbourhood",gd_country_val:country_val,gd_region_val:region_val,gd_city_val:city_val,gd_neighbourhood_val:$this.val(),lscroll:total},function(data){jQuery("ul",hoodDiv).html(data)})},500)});jQuery(".gd-loc-loadmore button").on("click",function(e){var $this=jQuery(this);if($this.data("title")){$this.find("font").text($this.data("title"))}$this.find(".fa").addClass("fa-spin");var $obj=$this.closest(".geodir-locListing_column"),$mainObj=$obj.closest(".geodir_locListing_main");var type=$obj.data("type"),total=parseInt($obj.data("limit")),pages=parseInt($this.data("pages")),next=parseInt($this.data("next"));if(isNaN(pages)||!pages>0){pages=1}if(isNaN(next)){next=1}if(isNaN(total)||!total>0){total=0}if(!type){return false}var data={action:"geodir_location_ajax",gd_loc_ajax_action:"get_location",gd_formated_for:"location_switcher",gd_which_location:type,_task:"loadmore",_pages:pages,lscroll:total,spage:next};data.gd_country_val=jQuery('input[name="loc_pick_country_filter"]',$mainObj).val();if(type=="region"||type=="city"||type=="neighbourhood"){data.gd_region_val=jQuery('input[name="loc_pick_region_filter"]',$mainObj).val();if(type=="city"||type=="neighbourhood"){data.gd_city_val=jQuery('input[name="loc_pick_city_filter"]',$mainObj).val();if(type=="neighbourhood"){data.gd_neighbourhood_val=jQuery('input[name="loc_pick_neighbourhood_filter"]',$mainObj).val()}}}jQuery.post(gdlm_ajax_url,data,function(response){$obj.find("li.gd-loc-loadmore").remove();if(response&&jQuery.trim(response)!=""){$obj.find("ul").append(response)}})})},100)});function geodir_location_switcher_chosen_ajax(){jQuery("select.geodir_location_switcher_chosen").each(function(){var curr_chosen=jQuery(this);var autoredirect=curr_chosen.data("autoredirect");var countrysearch=curr_chosen.data("countrysearch");var ajax_url=geodir_location_all_js_msg.geodir_location_admin_ajax_url;if(curr_chosen.data("ajaxchosen")=="1"||curr_chosen.data("ajaxchosen")===undefined){var listfor=curr_chosen.parents(".geodir_location_tab_container").find(".gd-tab-active").data("location");var show_every_where=curr_chosen.data("showeverywhere");curr_chosen.ajaxChosen({keepTypingMsg:geodir_location_all_js_msg.LOCATION_CHOSEN_KEEP_TYPE_TEXT,lookingForMsg:geodir_location_all_js_msg.LOCATION_CHOSEN_LOOKING_FOR_TEXT,type:"GET",url:ajax_url+"?action=geodir_location_ajax&gd_loc_ajax_action=fill_location&autoredirect="+autoredirect+"&gd_which_location="+listfor+"&show_every_where="+show_every_where,dataType:"html",success:function(data){curr_chosen.html(data).chosen().trigger("chosen:updated");geodir_enable_click_on_chosen_list_item()}},null,{})}})}jQuery(document).ready(function(){geodir_location_add_listing_chosen();jQuery("select.geodir_location_add_listing_chosen").bind("change",function(){var curr_chosen=jQuery(this);var location_type=curr_chosen.data("location_type");var ajax_url=geodir_location_all_js_msg.geodir_location_admin_ajax_url;var $loader='<div class="location_dl_loader" align="center" style="width:100%;"><img src="'+geodir_all_js_msg.geodir_plugin_url+'/geodirectory-assets/images/loadingAnimation.gif"  /></div>';var gd_loc_chosen=curr_chosen.parents(".geodir_location_add_listing_all_chosen_container");var gd_country_el=gd_loc_chosen.find(".geodir_location_add_listing_country_chosen_div").find('input[name="geodir_location_add_listing_country_val"]');var gd_region_div=gd_loc_chosen.find(".geodir_location_add_listing_region_chosen_div");var gd_city_div=gd_loc_chosen.find(".geodir_location_add_listing_city_chosen_div");var country_val="";var region_val="";var city_val="";if(location_type=="country"){if(curr_chosen.attr("name")!="post_country")return false;gd_country_el.val(curr_chosen.val());country_val=curr_chosen.val();gd_region_div.hide();gd_region_div.after($loader);jQuery.post(ajax_url,{action:"geodir_location_ajax",gd_loc_ajax_action:"fill_location_on_add_listing",gd_which_location:"region",country_val:country_val},function(data){if(data){gd_region_div.next(".location_dl_loader").remove();gd_region_div.show();gd_region_div.find("select").html(data).chosen().trigger("chosen:updated");gd_region_div.find("select").trigger("change");geodir_location_add_listing_chosen()}if(!geodir_lm_chosen_supported()){jQuery(".gd-new-loc-div",gd_region_div).show()}})}if(location_type=="region"){country_val=gd_country_el.val();gd_region_div.find('input[name="geodir_location_add_listing_region_val"]').val(curr_chosen.val());region_val=curr_chosen.val();gd_city_div.hide();gd_city_div.after($loader);jQuery.post(ajax_url,{action:"geodir_location_ajax",gd_loc_ajax_action:"fill_location_on_add_listing",gd_which_location:"city",country_val:country_val,region_val:region_val},function(data){if(data){gd_city_div.next(".location_dl_loader").remove();gd_city_div.show();gd_city_div.find("select").html(data).chosen().trigger("chosen:updated");gd_city_div.find("select").trigger("change");geodir_location_add_listing_chosen()}if(!geodir_lm_chosen_supported()){jQuery(".gd-new-loc-div",gd_city_div).show()}})}if(location_type=="city"){var gd_hood_chosen=gd_loc_chosen.find(".geodir_location_add_listing_neighbourhood_chosen_container");var gd_hood_div=gd_loc_chosen.find(".geodir_location_add_listing_neighbourhood_chosen_div");country_val=gd_country_el.val();region_val=gd_region_div.find('input[name="geodir_location_add_listing_region_val"]').val();gd_city_div.find('input[name="geodir_location_add_listing_city_val"]').val(curr_chosen.val());city_val=curr_chosen.val();if(!window.gdGeo){window.neighbourhood=""}neighbourhood_val=window.neighbourhood?window.neighbourhood:"";gd_hood_chosen.show();gd_hood_div.hide();gd_hood_div.after($loader);jQuery.post(ajax_url,{action:"geodir_location_ajax",gd_loc_ajax_action:"fill_location_on_add_listing",gd_which_location:"neighbourhood",country_val:country_val,region_val:region_val,city_val:city_val,neighbourhood_val:neighbourhood_val},function(data){gd_hood_div.find('input[name="geodir_location_add_listing_neighbourhood_val"]').val(neighbourhood_val);if(data){var hood_val=gd_hood_div.find("select").val();gd_hood_chosen.show();gd_hood_div.next(".location_dl_loader").remove();gd_hood_div.show();gd_hood_div.find("select").html(data);if(!neighbourhood_val&&hood_val){gd_hood_div.find("select").val(hood_val)}gd_hood_div.find("select").chosen().trigger("chosen:updated")}else{gd_hood_div.find("select").val("");gd_hood_div.next(".location_dl_loader").remove();gd_hood_chosen.hide()}window.gdGeo=false})}})});function geodir_location_add_listing_chosen(){jQuery("select.geodir_location_add_listing_chosen").each(function(){var curr_chosen=jQuery(this);var gd_loc_chosen=curr_chosen.parents(".geodir_location_add_listing_all_chosen_container");var ajax_url=geodir_location_all_js_msg.geodir_location_admin_ajax_url;var obj_name=curr_chosen.prop("name");var obbj_info=obj_name.split("_");listfor=obbj_info[1];var country_val="";var region_val="";var city_val="";country_val=gd_loc_chosen.find(".geodir_location_add_listing_country_chosen_div").find('input[name="geodir_location_add_listing_country_val"]').val();if(country_val===undefined){country_val=jQuery("#post_country").val()}region_val=gd_loc_chosen.find(".geodir_location_add_listing_region_chosen_div").find('input[name="geodir_location_add_listing_region_val"]').val();city_val=gd_loc_chosen.find(".geodir_location_add_listing_city_chosen_div").find('input[name="geodir_location_add_listing_city_val"]').val();if(curr_chosen.data("ajaxchosen")=="1"||curr_chosen.data("ajaxchosen")===undefined){curr_chosen.ajaxChosen({keepTypingMsg:geodir_location_all_js_msg.LOCATION_CHOSEN_KEEP_TYPE_TEXT,lookingForMsg:geodir_location_all_js_msg.LOCATION_CHOSEN_LOOKING_FOR_TEXT,type:"GET",url:ajax_url+"?action=geodir_location_ajax&gd_loc_ajax_action=fill_location_on_add_listing&gd_which_location="+listfor+"&country_val="+country_val+"&region_val="+region_val+"&city_val="+city_val,dataType:"html",success:function(data){curr_chosen.html(data).chosen().trigger("chosen:updated");geodir_location_add_listing_chosen()}},null,{})}var search_placeholder=curr_chosen.data("searchplaceholder");if(search_placeholder){setTimeout(function(){curr_chosen.parent().find(".chosen-drop .chosen-search input").attr("placeholder",search_placeholder)},200)}})}function geodir_enable_click_on_chosen_list_item(){jQuery(".chosen-results").bind("click",function(){var first_item_text=jQuery(".chosen-results").find('li[data-option-array-index="0"]').html();var selected_item_text=jQuery(this).parents(".geodir_location_sugestion").find(".chosen-single > span").html();if(first_item_text==selected_item_text){jQuery(this).parents(".geodir_location_sugestion").find("select").trigger("change")}})}function geodir_set_map_default_location(mapid,lat,lng){if(mapid!=""&&lat!=""&&lng!=""){jQuery("#"+mapid).goMap();jQuery.goMap.map.setCenter(new google.maps.LatLng(lat,lng));baseMarker.setPosition(new google.maps.LatLng(lat,lng));updateMarkerPosition(baseMarker.getPosition());geocodePosition(baseMarker.getPosition())}}function geodir_lm_chosen_supported(){if(window.navigator.appName==="Microsoft Internet Explorer"){return document.documentMode>=8}if(/iP(od|hone|ad)/i.test(window.navigator.userAgent)){return false}if(/Android/i.test(window.navigator.userAgent)){if(/Mobile/i.test(window.navigator.userAgent)){return false}}return true}function geodir_no_chosen_add_search(cont,tab){var contLoc=jQuery(cont).find('select[name="gd_location"]');jQuery(contLoc).removeAttr("size");jQuery(contLoc).removeClass("geodir-loc-select-list");jQuery(cont).find(".gd-no-chosen-seach").remove();var inputSearch='<div class="chosen-search"><input type="text" name="term" class="gd-no-chosen-seach" value="" onkeyup="javascript:geodir_no_chosen_search(this);" /></div>';jQuery(contLoc).before(inputSearch);if(typeof tab=="undefined"||tab==""){tab=jQuery(cont).find(".geodir_location_tabs.gd-tab-active").attr("data-location")}var placeHold="";if(tab=="city"){placeHold=geodir_location_all_js_msg.gd_text_search_city}else if(tab=="region"){placeHold=geodir_location_all_js_msg.gd_text_search_region}else if(tab=="country"){placeHold=geodir_location_all_js_msg.gd_text_search_country}placeHold=placeHold!=""?placeHold:geodir_location_all_js_msg.gd_text_search_location;jQuery(cont).find(".gd-no-chosen-seach").attr("placeholder",placeHold)}function geodir_no_chosen_search(obj){var term=jQuery(obj).val();if(typeof term!="undefined"&&term!=""){term=term.replace(/^\s+/,"")}else{term=""}var ajax_url=geodir_location_all_js_msg.geodir_location_admin_ajax_url;var attach_term=term!=""?"&term="+term:"";var cont=jQuery(obj).closest(".geodir_location_tab_container");var tab=jQuery(cont).find(".geodir_location_tabs.gd-tab-active");var tab_id=jQuery(tab).data("location");var autoredirect=jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_switcher_chosen").data("autoredirect");var show_every_where=jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_switcher_chosen").data("showeverywhere");jQuery.post(ajax_url+"?action=geodir_location_ajax&gd_loc_ajax_action=fill_location&autoredirect="+autoredirect+"&gd_which_location="+tab_id+"&show_every_where="+show_every_where+attach_term,function(data){jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_switcher_chosen").html(data).chosen().trigger("chosen:updated");geodir_enable_click_on_chosen_list_item();geodir_expand_option(cont);jQuery(cont).find('select[name="gd_location"] option').each(function(){jQuery(this).bind("click",function(){if(jQuery(this).attr("selected")=="selected"||jQuery(this).attr("value")==geodir_location_all_js_msg.gd_base_location){jQuery(this).closest("select").removeAttr("size");jQuery(this).closest("select").removeClass("geodir-loc-select-list")}})})});geodir_location_switcher_chosen_ajax()}function geodir_expand_option(cont,one){var objSel=jQuery(cont).find('select[name="gd_location"]');var optCount=jQuery(objSel).children("option").length;if(typeof one!="undefined"){jQuery(objSel).removeAttr("size");jQuery(objSel).removeClass("geodir-loc-select-list")}else{if(parseInt(optCount)<2){jQuery(objSel).removeAttr("size");jQuery(objSel).removeClass("geodir-loc-select-list")}else{jQuery(objSel).attr("size",optCount);jQuery(objSel).addClass("geodir-loc-select-list")}}}jQuery(document).ready(function(){locationSPage=[];locationSPage["city"]=1;locationSPage["region"]=1;locationSPage["country"]=1;locationSPage["neighbourhood"]=1;locationSActive=false;setTimeout(function(){jQuery(".geodir_location_sugestion .geodir-chosen-container .chosen-results").scroll(function(){if(jQuery(this).scrollTop()+jQuery(this).innerHeight()>=jQuery(this)[0].scrollHeight){if(locationSActive){return}if(jQuery(this).scrollTop()==0){return}obj=this;var tempScrollTop=jQuery(this).scrollTop();var term="";var ajax_url=geodir_location_all_js_msg.geodir_location_admin_ajax_url;var attach_term=term!=""?"&term="+term:"";var cont=jQuery(obj).closest(".geodir_location_tab_container");var tab=jQuery(cont).find(".geodir_location_tabs.gd-tab-active");var tab_id=jQuery(tab).data("location");var autoredirect=jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_switcher_chosen").data("autoredirect");var show_every_where=jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_switcher_chosen").data("showeverywhere");if(locationSPage[tab_id]=="0"){return}locationSActive=true;jQuery(obj).addClass("loading_div_loc");jQuery.post(ajax_url+"?action=geodir_location_ajax&gd_loc_ajax_action=fill_location&autoredirect="+autoredirect+"&gd_which_location="+tab_id+"&show_every_where="+show_every_where+attach_term+"&lscroll=true&spage="+locationSPage[tab_id],function(data){jQuery(obj).removeClass("loading_div_loc");locationSPage[tab_id]++;if(data==""){locationSPage[tab_id]="0"}var orig_data=jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_switcher_chosen").html();jQuery(tab).parents(".geodir_location_tab_container").find(".geodir_location_switcher_chosen").html(orig_data+data).chosen().trigger("chosen:updated");geodir_enable_click_on_chosen_list_item();geodir_expand_option(cont);jQuery(cont).find('select[name="gd_location"] option').each(function(){jQuery(this).bind("click",function(){if(jQuery(this).attr("selected")=="selected"||jQuery(this).attr("value")==geodir_location_all_js_msg.gd_base_location){jQuery(this).closest("select").removeAttr("size");jQuery(this).closest("select").removeClass("geodir-loc-select-list")}})});jQuery(obj).scrollTop(tempScrollTop);locationSActive=false});geodir_location_switcher_chosen_ajax()}})},1e3)});function gdShareLocationError(error){switch(error.code){case error.PERMISSION_DENIED:alert(geodir_location_all_js_msg.PERMISSION_DENINED);break;case error.POSITION_UNAVAILABLE:alert(geodir_location_all_js_msg.POSITION_UNAVAILABLE);break;case error.TIMEOUT:alert(geodir_location_all_js_msg.DEFAUTL_ERROR);break;case error.UNKNOWN_ERROR:alert(geodir_location_all_js_msg.UNKNOWN_ERROR);break}}function gdLocationSetupUserLoc(){if(my_location){jQuery(".geodir-search .fa-compass").css("color","#087CC9");jQuery(".gt_near_me_s").prop("checked",true);jQuery(".snear").val(geodir_location_all_js_msg.msg_Near+" "+geodir_location_all_js_msg.msg_Me);jQuery(".sgeo_lat").val(lat);jQuery(".sgeo_lon").val(lon)}else{if(lat&&lon){jQuery(".geodir-search .fa-compass").css("color","#087CC9");jQuery(".gt_near_me_s").prop("checked",true);jQuery(".snear").val(geodir_location_all_js_msg.msg_Near+" "+geodir_location_all_js_msg.msg_User_defined);jQuery(".sgeo_lat").val(lat);jQuery(".sgeo_lon").val(lon)}else if(jQuery(".snear").length&&jQuery(".snear").val().match("^"+geodir_location_all_js_msg.msg_Near)){jQuery(".geodir-search .fa-compass").css("color","");jQuery(".gt_near_me_s").prop("checked",false);jQuery(".snear").val("");jQuery(".snear").blur();jQuery(".sgeo_lat").val("");jQuery(".sgeo_lon").val("")}}}function gd_location_admin_filter(el,lt){var o,data,v=jQuery(el).val(),f=jQuery(el).closest("form"),scn=jQuery('select[name="_gd_country"]',f),srg=jQuery('select[name="_gd_region"]',f),sct=jQuery('select[name="_gd_city"]',f),org=jQuery("option:first-child",srg),oct=jQuery("option:first-child",sct);switch(lt){case"cn":sct.html(oct).attr("disabled","disabled");if(!v){srg.html(org).attr("disabled","disabled");return false}data={cn:v};break;case"rg":if(!v){sct.html(oct).attr("disabled","disabled");return false}var cnv=scn.val();if(!cnv){srg.html(org).attr("disabled","disabled");return false}data={cn:cnv,rg:v};break;default:return false;break}data.action="geodir_location_ajax";data.gd_loc_ajax_action="get_location_options";jQuery.ajax({type:"POST",data:data,dataType:"json",url:ajaxurl,success:function(res){if(typeof res=="object"&&typeof res.options!="undefined"){switch(lt){case"cn":srg.html(org).append(res.options).removeAttr("disabled");break;case"rg":sct.html(oct).append(res.options).removeAttr("disabled");break}}}})}function geodir_lm_type_new_location(el,type){var $el=jQuery(el).parent(".gd-new-loc-div");var loc=jQuery('input[type="text"]',$el).val();loc=loc?jQuery.trim(loc):"";if(loc){var $select=$el.closest(".geodir_form_row").find("select.geodir_location_add_listing_chosen");if(!jQuery('option[value=""]',$select).text()){jQuery('option[value=""]',$select).remove()}if(jQuery("option:contains('"+loc+"')",$select).length==0){$select.append('<option value="'+loc+'">'+loc+"</option>")}jQuery('option[value="'+loc+'"]',$select).attr("selected",true);$select.trigger("change");jQuery('input[type="text"]',$el).val("");$el.hide()}else{jQuery('input[type="text"]',$el).focus()}}

!function(e){e.fn.lightBox=function(t){function i(){return a(this,y),!1}function a(i,a){if(e("embed, object, select").css({visibility:"hidden"}),n(),t.imageArray.length=0,t.activeImage=0,1==a.length)t.imageArray.push(new Array(i.getAttribute("href"),i.getAttribute("title")));else for(var r=0;r<a.length;r++)t.imageArray.push(new Array(a[r].getAttribute("href"),a[r].getAttribute("title")));for(;t.imageArray[t.activeImage][0]!=i.getAttribute("href");)t.activeImage++;o()}function n(){e("body").append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+t.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+t.imageBtnClose+'"></a></div></div></div></div>');var i=s();e("#jquery-overlay").css({backgroundColor:t.overlayBgColor,opacity:t.overlayOpacity,width:"100%",height:i[1]}).fadeIn();var a=v();e("#jquery-lightbox").css({top:e(window).scrollTop()+50,left:e(window).scrollLeft()}).show(),e("#jquery-overlay,#jquery-lightbox").click(function(){u()}),e("#lightbox-loading-link,#lightbox-secNav-btnClose").click(function(){return u(),!1}),e(window).resize(function(){var t=s();e("#jquery-overlay").css({width:"100%",height:t[1]});var i=v();e("#jquery-lightbox").css({top:e(window).scrollTop()+50,left:e(window).scrollLeft()})})}function o(){e("#lightbox-loading").show(),t.fixedNavigation?e("#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide():e("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide();var i=new Image;i.onload=function(){var imageHeight;var imageWidth;var maxWidth;var maxHeight;var $container=e("#lightbox-container-image");var $image=e("#lightbox-image",$container);$image.attr("src",t.imageArray[t.activeImage][0]);$image.width(i.width);$image.height(i.height);var containerTopPadding=parseInt($container.css("padding-top"),10);var containerRightPadding=parseInt($container.css("padding-right"),10);var containerBottomPadding=parseInt($container.css("padding-bottom"),10);var containerLeftPadding=parseInt($container.css("padding-left"),10);var heightBtn=parseInt(e("#lightbox-container-image-data-box","#jquery-lightbox").height(),10);var windowWidth=e(window).width();var windowHeight=e(window).height();var maxImageWidth=windowWidth-containerLeftPadding-containerRightPadding-20;var maxImageHeight=windowHeight-containerTopPadding-containerBottomPadding-120;if(maxWidth&&maxWidth<maxImageWidth){maxImageWidth=maxWidth}if(maxHeight&&maxHeight<maxImageWidth){maxImageHeight=maxHeight}if(i.width>maxImageWidth||i.height>maxImageHeight){if(i.width/maxImageWidth>i.height/maxImageHeight){imageWidth=maxImageWidth;imageHeight=parseInt(i.height/(i.width/imageWidth),10);$image.width(imageWidth);$image.height(imageHeight)}else{imageHeight=maxImageHeight;imageWidth=parseInt(i.width/(i.height/imageHeight),10);$image.width(imageWidth);$image.height(imageHeight)}}i.width=$image.width();i.height=$image.height();e("#lightbox-image").attr("src",t.imageArray[t.activeImage][0]),r(i.width,i.height),i.onload=function(){}},i.src=t.imageArray[t.activeImage][0]}function r(i,a){var n=e("#lightbox-container-image-box").width(),o=e("#lightbox-container-image-box").height(),r=i+2*t.containerBorderSize,c=a+2*t.containerBorderSize;intImageWidthDataBox=i,intImageHeightBTN=a+2*t.containerBorderSize;var l=s();r>l[0]&&(r="100%",c="auto",intImageWidthDataBox="100%",intImageHeightBTN=c-2*t.containerBorderSize);var d=n-r,m=o-c;e("#lightbox-container-image-box").animate({width:r,height:c},t.containerResizeSpeed,function(){g()}),0==d&&0==m&&x(e.browser.msie?250:100),e("#lightbox-container-image-data-box").css({width:intImageWidthDataBox}),e("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css({height:intImageHeightBTN})}function g(){e("#lightbox-loading").hide(),e("#lightbox-image").fadeIn(function(){c(),l()}),b()}function c(){e("#lightbox-container-image-data-box").slideDown("fast"),e("#lightbox-image-details-caption").hide(),t.imageArray[t.activeImage][1]&&e("#lightbox-image-details-caption").html(t.imageArray[t.activeImage][1]).show(),t.imageArray.length>1&&e("#lightbox-image-details-currentNumber").html(t.txtImage+" "+(t.activeImage+1)+" "+t.txtOf+" "+t.imageArray.length).show()}function l(){e("#lightbox-nav").show(),e("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css({background:"transparent url("+t.imageBlank+") no-repeat"}),0!=t.activeImage&&(t.fixedNavigation?e("#lightbox-nav-btnPrev").css({background:"url("+t.imageBtnPrev+") left 15% no-repeat"}).unbind().bind("click",function(){return t.activeImage=t.activeImage-1,o(),!1}):e("#lightbox-nav-btnPrev").unbind().hover(function(){e(this).css({background:"url("+t.imageBtnPrev+") left 15% no-repeat"})},function(){e(this).css({background:"transparent url("+t.imageBlank+") no-repeat"})}).show().bind("click",function(){return t.activeImage=t.activeImage-1,o(),!1})),t.activeImage!=t.imageArray.length-1&&(t.fixedNavigation?e("#lightbox-nav-btnNext").css({background:"url("+t.imageBtnNext+") right 15% no-repeat"}).unbind().bind("click",function(){return t.activeImage=t.activeImage+1,o(),!1}):e("#lightbox-nav-btnNext").unbind().hover(function(){e(this).css({background:"url("+t.imageBtnNext+") right 15% no-repeat"})},function(){e(this).css({background:"transparent url("+t.imageBlank+") no-repeat"})}).show().bind("click",function(){return t.activeImage=t.activeImage+1,o(),!1})),d()}function d(){e(document).keydown(function(e){h(e)})}function m(){e(document).unbind()}function h(e){null==e?(keycode=event.keyCode,escapeKey=27):(keycode=e.keyCode,escapeKey=e.DOM_VK_ESCAPE),key=String.fromCharCode(keycode).toLowerCase(),(key==t.keyToClose||"x"==key||keycode==escapeKey)&&u(),(key==t.keyToPrev||37==keycode)&&0!=t.activeImage&&(t.activeImage=t.activeImage-1,o(),m()),(key==t.keyToNext||39==keycode)&&t.activeImage!=t.imageArray.length-1&&(t.activeImage=t.activeImage+1,o(),m())}function b(){t.imageArray.length-1>t.activeImage&&(objNext=new Image,objNext.src=t.imageArray[t.activeImage+1][0]),t.activeImage>0&&(objPrev=new Image,objPrev.src=t.imageArray[t.activeImage-1][0])}function u(){e("#jquery-lightbox").remove(),e("#jquery-overlay").fadeOut(function(){e("#jquery-overlay").remove()}),e("embed, object, select").css({visibility:"visible"})}function s(){var e,t;window.innerHeight&&window.scrollMaxY?(e=window.innerWidth+window.scrollMaxX,t=window.innerHeight+window.scrollMaxY):document.body.scrollHeight>document.body.offsetHeight?(e=document.body.scrollWidth,t=document.body.scrollHeight):(e=document.body.offsetWidth,t=document.body.offsetHeight);var i,a;return self.innerHeight?(i=document.documentElement.clientWidth?document.documentElement.clientWidth:self.innerWidth,a=self.innerHeight):document.documentElement&&document.documentElement.clientHeight?(i=document.documentElement.clientWidth,a=document.documentElement.clientHeight):document.body&&(i=document.body.clientWidth,a=document.body.clientHeight),pageHeight=a>t?a:t,pageWidth=i>e?e:i,arrayPageSize=new Array(pageWidth,pageHeight,i,a),arrayPageSize}function v(){var e,t;return self.pageYOffset?(t=self.pageYOffset,e=self.pageXOffset):document.documentElement&&document.documentElement.scrollTop?(t=document.documentElement.scrollTop,e=document.documentElement.scrollLeft):document.body&&(t=document.body.scrollTop,e=document.body.scrollLeft),arrayPageScroll=new Array(e,t),arrayPageScroll}function x(e){var t=new Date;i=null;do var i=new Date;while(e>i-t)}t=jQuery.extend({overlayBgColor:"#000",overlayOpacity:.8,fixedNavigation:!1,imageLoading:"images/lightbox-ico-loading.gif",imageBtnPrev:"images/lightbox-btn-prev.gif",imageBtnNext:"images/lightbox-btn-next.gif",imageBtnClose:"images/lightbox-btn-close.gif",imageBlank:"images/lightbox-blank.gif",containerBorderSize:10,containerResizeSpeed:400,txtImage:"Image",txtOf:"of",keyToClose:"c",keyToPrev:"p",keyToNext:"n",imageArray:[],activeImage:0},t);var y=this;return this.unbind("click").click(i)}}(jQuery);

/*!
 * jQuery UI Core 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/category/ui-core/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(b,d){var e,f,g,h=b.nodeName.toLowerCase();return"area"===h?(e=b.parentNode,f=e.name,!(!b.href||!f||"map"!==e.nodeName.toLowerCase())&&(g=a("img[usemap='#"+f+"']")[0],!!g&&c(g))):(/^(input|select|textarea|button|object)$/.test(h)?!b.disabled:"a"===h?b.href||d:d)&&c(b)}function c(b){return a.expr.filters.visible(b)&&!a(b).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}a.ui=a.ui||{},a.extend(a.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({scrollParent:function(b){var c=this.css("position"),d="absolute"===c,e=b?/(auto|scroll|hidden)/:/(auto|scroll)/,f=this.parents().filter(function(){var b=a(this);return(!d||"static"!==b.css("position"))&&e.test(b.css("overflow")+b.css("overflow-y")+b.css("overflow-x"))}).eq(0);return"fixed"!==c&&f.length?f:a(this[0].ownerDocument||document)},uniqueId:function(){var a=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(c){return b(c,!isNaN(a.attr(c,"tabindex")))},tabbable:function(c){var d=a.attr(c,"tabindex"),e=isNaN(d);return(e||d>=0)&&b(c,!e)}}),a("<a>").outerWidth(1).jquery||a.each(["Width","Height"],function(b,c){function d(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.css(b,"padding"+this))||0,d&&(c-=parseFloat(a.css(b,"border"+this+"Width"))||0),f&&(c-=parseFloat(a.css(b,"margin"+this))||0)}),c}var e="Width"===c?["Left","Right"]:["Top","Bottom"],f=c.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+c]=function(b){return void 0===b?g["inner"+c].call(this):this.each(function(){a(this).css(f,d(this,b)+"px")})},a.fn["outer"+c]=function(b,e){return"number"!=typeof b?g["outer"+c].call(this,b):this.each(function(){a(this).css(f,d(this,b,!0,e)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=function(b){return function(c){return arguments.length?b.call(this,a.camelCase(c)):b.call(this)}}(a.fn.removeData)),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.fn.extend({focus:function(b){return function(c,d){return"number"==typeof c?this.each(function(){var b=this;setTimeout(function(){a(b).focus(),d&&d.call(b)},c)}):b.apply(this,arguments)}}(a.fn.focus),disableSelection:function(){var a="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(a+".ui-disableSelection",function(a){a.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(b){if(void 0!==b)return this.css("zIndex",b);if(this.length)for(var c,d,e=a(this[0]);e.length&&e[0]!==document;){if(c=e.css("position"),("absolute"===c||"relative"===c||"fixed"===c)&&(d=parseInt(e.css("zIndex"),10),!isNaN(d)&&0!==d))return d;e=e.parent()}return 0}}),a.ui.plugin={add:function(b,c,d){var e,f=a.ui[b].prototype;for(e in d)f.plugins[e]=f.plugins[e]||[],f.plugins[e].push([c,d[e]])},call:function(a,b,c,d){var e,f=a.plugins[b];if(f&&(d||a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType))for(e=0;e<f.length;e++)a.options[f[e][0]]&&f[e][1].apply(a.element,c)}}});

/*!
 * jQuery UI Widget 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/jQuery.widget/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){var b=0,c=Array.prototype.slice;return a.cleanData=function(b){return function(c){var d,e,f;for(f=0;null!=(e=c[f]);f++)try{d=a._data(e,"events"),d&&d.remove&&a(e).triggerHandler("remove")}catch(g){}b(c)}}(a.cleanData),a.widget=function(b,c,d){var e,f,g,h,i={},j=b.split(".")[0];return b=b.split(".")[1],e=j+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][e.toLowerCase()]=function(b){return!!a.data(b,e)},a[j]=a[j]||{},f=a[j][b],g=a[j][b]=function(a,b){return this._createWidget?void(arguments.length&&this._createWidget(a,b)):new g(a,b)},a.extend(g,f,{version:d.version,_proto:a.extend({},d),_childConstructors:[]}),h=new c,h.options=a.widget.extend({},h.options),a.each(d,function(b,d){return a.isFunction(d)?void(i[b]=function(){var a=function(){return c.prototype[b].apply(this,arguments)},e=function(a){return c.prototype[b].apply(this,a)};return function(){var b,c=this._super,f=this._superApply;return this._super=a,this._superApply=e,b=d.apply(this,arguments),this._super=c,this._superApply=f,b}}()):void(i[b]=d)}),g.prototype=a.widget.extend(h,{widgetEventPrefix:f?h.widgetEventPrefix||b:b},i,{constructor:g,namespace:j,widgetName:b,widgetFullName:e}),f?(a.each(f._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,g,c._proto)}),delete f._childConstructors):c._childConstructors.push(g),a.widget.bridge(b,g),g},a.widget.extend=function(b){for(var d,e,f=c.call(arguments,1),g=0,h=f.length;g<h;g++)for(d in f[g])e=f[g][d],f[g].hasOwnProperty(d)&&void 0!==e&&(a.isPlainObject(e)?b[d]=a.isPlainObject(b[d])?a.widget.extend({},b[d],e):a.widget.extend({},e):b[d]=e);return b},a.widget.bridge=function(b,d){var e=d.prototype.widgetFullName||b;a.fn[b]=function(f){var g="string"==typeof f,h=c.call(arguments,1),i=this;return g?this.each(function(){var c,d=a.data(this,e);return"instance"===f?(i=d,!1):d?a.isFunction(d[f])&&"_"!==f.charAt(0)?(c=d[f].apply(d,h),c!==d&&void 0!==c?(i=c&&c.jquery?i.pushStack(c.get()):c,!1):void 0):a.error("no such method '"+f+"' for "+b+" widget instance"):a.error("cannot call methods on "+b+" prior to initialization; attempted to call method '"+f+"'")}):(h.length&&(f=a.widget.extend.apply(null,[f].concat(h))),this.each(function(){var b=a.data(this,e);b?(b.option(f||{}),b._init&&b._init()):a.data(this,e,new d(f,this))})),i}},a.Widget=function(){},a.Widget._childConstructors=[],a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(c,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=b++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=a(),this.hoverable=a(),this.focusable=a(),d!==this&&(a.data(d,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===d&&this.destroy()}}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this.options=a.widget.extend({},this.options,this._getCreateOptions(),c),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:a.noop,_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(a.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:a.noop,widget:function(){return this.element},option:function(b,c){var d,e,f,g=b;if(0===arguments.length)return a.widget.extend({},this.options);if("string"==typeof b)if(g={},d=b.split("."),b=d.shift(),d.length){for(e=g[b]=a.widget.extend({},this.options[b]),f=0;f<d.length-1;f++)e[d[f]]=e[d[f]]||{},e=e[d[f]];if(b=d.pop(),1===arguments.length)return void 0===e[b]?null:e[b];e[b]=c}else{if(1===arguments.length)return void 0===this.options[b]?null:this.options[b];g[b]=c}return this._setOptions(g),this},_setOptions:function(a){var b;for(b in a)this._setOption(b,a[b]);return this},_setOption:function(a,b){return this.options[a]=b,"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!b),b&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(b,c,d){var e,f=this;"boolean"!=typeof b&&(d=c,c=b,b=!1),d?(c=e=a(c),this.bindings=this.bindings.add(c)):(d=c,c=this.element,e=this.widget()),a.each(d,function(d,g){function h(){if(b||f.options.disabled!==!0&&!a(this).hasClass("ui-state-disabled"))return("string"==typeof g?f[g]:g).apply(f,arguments)}"string"!=typeof g&&(h.guid=g.guid=g.guid||h.guid||a.guid++);var i=d.match(/^([\w:-]*)\s*(.*)$/),j=i[1]+f.eventNamespace,k=i[2];k?e.delegate(k,j,h):c.bind(j,h)})},_off:function(b,c){c=(c||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,b.unbind(c).undelegate(c),this.bindings=a(this.bindings.not(b).get()),this.focusable=a(this.focusable.not(b).get()),this.hoverable=a(this.hoverable.not(b).get())},_delay:function(a,b){function c(){return("string"==typeof a?d[a]:a).apply(d,arguments)}var d=this;return setTimeout(c,b||0)},_hoverable:function(b){this.hoverable=this.hoverable.add(b),this._on(b,{mouseenter:function(b){a(b.currentTarget).addClass("ui-state-hover")},mouseleave:function(b){a(b.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(b){this.focusable=this.focusable.add(b),this._on(b,{focusin:function(b){a(b.currentTarget).addClass("ui-state-focus")},focusout:function(b){a(b.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(b,c,d){var e,f,g=this.options[b];if(d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.apply(this.element[0],[c].concat(d))===!1||c.isDefaultPrevented())}},a.each({show:"fadeIn",hide:"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){"string"==typeof e&&(e={effect:e});var g,h=e?e===!0||"number"==typeof e?c:e.effect||c:b;e=e||{},"number"==typeof e&&(e={duration:e}),g=!a.isEmptyObject(e),e.complete=f,e.delay&&d.delay(e.delay),g&&a.effects&&a.effects.effect[h]?d[b](e):h!==b&&d[h]?d[h](e.duration,e.easing,f):d.queue(function(c){a(this)[b](),f&&f.call(d[0]),c()})}}),a.widget});

/*!
 * jQuery UI Position 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/position/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){return function(){function b(a,b,c){return[parseFloat(a[0])*(n.test(a[0])?b/100:1),parseFloat(a[1])*(n.test(a[1])?c/100:1)]}function c(b,c){return parseInt(a.css(b,c),10)||0}function d(b){var c=b[0];return 9===c.nodeType?{width:b.width(),height:b.height(),offset:{top:0,left:0}}:a.isWindow(c)?{width:b.width(),height:b.height(),offset:{top:b.scrollTop(),left:b.scrollLeft()}}:c.preventDefault?{width:0,height:0,offset:{top:c.pageY,left:c.pageX}}:{width:b.outerWidth(),height:b.outerHeight(),offset:b.offset()}}a.ui=a.ui||{};var e,f,g=Math.max,h=Math.abs,i=Math.round,j=/left|center|right/,k=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,m=/^\w+/,n=/%$/,o=a.fn.position;a.position={scrollbarWidth:function(){if(void 0!==e)return e;var b,c,d=a("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),f=d.children()[0];return a("body").append(d),b=f.offsetWidth,d.css("overflow","scroll"),c=f.offsetWidth,b===c&&(c=d[0].clientWidth),d.remove(),e=b-c},getScrollInfo:function(b){var c=b.isWindow||b.isDocument?"":b.element.css("overflow-x"),d=b.isWindow||b.isDocument?"":b.element.css("overflow-y"),e="scroll"===c||"auto"===c&&b.width<b.element[0].scrollWidth,f="scroll"===d||"auto"===d&&b.height<b.element[0].scrollHeight;return{width:f?a.position.scrollbarWidth():0,height:e?a.position.scrollbarWidth():0}},getWithinInfo:function(b){var c=a(b||window),d=a.isWindow(c[0]),e=!!c[0]&&9===c[0].nodeType;return{element:c,isWindow:d,isDocument:e,offset:c.offset()||{left:0,top:0},scrollLeft:c.scrollLeft(),scrollTop:c.scrollTop(),width:d||e?c.width():c.outerWidth(),height:d||e?c.height():c.outerHeight()}}},a.fn.position=function(e){if(!e||!e.of)return o.apply(this,arguments);e=a.extend({},e);var n,p,q,r,s,t,u=a(e.of),v=a.position.getWithinInfo(e.within),w=a.position.getScrollInfo(v),x=(e.collision||"flip").split(" "),y={};return t=d(u),u[0].preventDefault&&(e.at="left top"),p=t.width,q=t.height,r=t.offset,s=a.extend({},r),a.each(["my","at"],function(){var a,b,c=(e[this]||"").split(" ");1===c.length&&(c=j.test(c[0])?c.concat(["center"]):k.test(c[0])?["center"].concat(c):["center","center"]),c[0]=j.test(c[0])?c[0]:"center",c[1]=k.test(c[1])?c[1]:"center",a=l.exec(c[0]),b=l.exec(c[1]),y[this]=[a?a[0]:0,b?b[0]:0],e[this]=[m.exec(c[0])[0],m.exec(c[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?s.left+=p:"center"===e.at[0]&&(s.left+=p/2),"bottom"===e.at[1]?s.top+=q:"center"===e.at[1]&&(s.top+=q/2),n=b(y.at,p,q),s.left+=n[0],s.top+=n[1],this.each(function(){var d,j,k=a(this),l=k.outerWidth(),m=k.outerHeight(),o=c(this,"marginLeft"),t=c(this,"marginTop"),z=l+o+c(this,"marginRight")+w.width,A=m+t+c(this,"marginBottom")+w.height,B=a.extend({},s),C=b(y.my,k.outerWidth(),k.outerHeight());"right"===e.my[0]?B.left-=l:"center"===e.my[0]&&(B.left-=l/2),"bottom"===e.my[1]?B.top-=m:"center"===e.my[1]&&(B.top-=m/2),B.left+=C[0],B.top+=C[1],f||(B.left=i(B.left),B.top=i(B.top)),d={marginLeft:o,marginTop:t},a.each(["left","top"],function(b,c){a.ui.position[x[b]]&&a.ui.position[x[b]][c](B,{targetWidth:p,targetHeight:q,elemWidth:l,elemHeight:m,collisionPosition:d,collisionWidth:z,collisionHeight:A,offset:[n[0]+C[0],n[1]+C[1]],my:e.my,at:e.at,within:v,elem:k})}),e.using&&(j=function(a){var b=r.left-B.left,c=b+p-l,d=r.top-B.top,f=d+q-m,i={target:{element:u,left:r.left,top:r.top,width:p,height:q},element:{element:k,left:B.left,top:B.top,width:l,height:m},horizontal:c<0?"left":b>0?"right":"center",vertical:f<0?"top":d>0?"bottom":"middle"};p<l&&h(b+c)<p&&(i.horizontal="center"),q<m&&h(d+f)<q&&(i.vertical="middle"),g(h(b),h(c))>g(h(d),h(f))?i.important="horizontal":i.important="vertical",e.using.call(this,a,i)}),k.offset(a.extend(B,{using:j}))})},a.ui.position={fit:{left:function(a,b){var c,d=b.within,e=d.isWindow?d.scrollLeft:d.offset.left,f=d.width,h=a.left-b.collisionPosition.marginLeft,i=e-h,j=h+b.collisionWidth-f-e;b.collisionWidth>f?i>0&&j<=0?(c=a.left+i+b.collisionWidth-f-e,a.left+=i-c):j>0&&i<=0?a.left=e:i>j?a.left=e+f-b.collisionWidth:a.left=e:i>0?a.left+=i:j>0?a.left-=j:a.left=g(a.left-h,a.left)},top:function(a,b){var c,d=b.within,e=d.isWindow?d.scrollTop:d.offset.top,f=b.within.height,h=a.top-b.collisionPosition.marginTop,i=e-h,j=h+b.collisionHeight-f-e;b.collisionHeight>f?i>0&&j<=0?(c=a.top+i+b.collisionHeight-f-e,a.top+=i-c):j>0&&i<=0?a.top=e:i>j?a.top=e+f-b.collisionHeight:a.top=e:i>0?a.top+=i:j>0?a.top-=j:a.top=g(a.top-h,a.top)}},flip:{left:function(a,b){var c,d,e=b.within,f=e.offset.left+e.scrollLeft,g=e.width,i=e.isWindow?e.scrollLeft:e.offset.left,j=a.left-b.collisionPosition.marginLeft,k=j-i,l=j+b.collisionWidth-g-i,m="left"===b.my[0]?-b.elemWidth:"right"===b.my[0]?b.elemWidth:0,n="left"===b.at[0]?b.targetWidth:"right"===b.at[0]?-b.targetWidth:0,o=-2*b.offset[0];k<0?(c=a.left+m+n+o+b.collisionWidth-g-f,(c<0||c<h(k))&&(a.left+=m+n+o)):l>0&&(d=a.left-b.collisionPosition.marginLeft+m+n+o-i,(d>0||h(d)<l)&&(a.left+=m+n+o))},top:function(a,b){var c,d,e=b.within,f=e.offset.top+e.scrollTop,g=e.height,i=e.isWindow?e.scrollTop:e.offset.top,j=a.top-b.collisionPosition.marginTop,k=j-i,l=j+b.collisionHeight-g-i,m="top"===b.my[1],n=m?-b.elemHeight:"bottom"===b.my[1]?b.elemHeight:0,o="top"===b.at[1]?b.targetHeight:"bottom"===b.at[1]?-b.targetHeight:0,p=-2*b.offset[1];k<0?(d=a.top+n+o+p+b.collisionHeight-g-f,(d<0||d<h(k))&&(a.top+=n+o+p)):l>0&&(c=a.top-b.collisionPosition.marginTop+n+o+p-i,(c>0||h(c)<l)&&(a.top+=n+o+p))}},flipfit:{left:function(){a.ui.position.flip.left.apply(this,arguments),a.ui.position.fit.left.apply(this,arguments)},top:function(){a.ui.position.flip.top.apply(this,arguments),a.ui.position.fit.top.apply(this,arguments)}}},function(){var b,c,d,e,g,h=document.getElementsByTagName("body")[0],i=document.createElement("div");b=document.createElement(h?"div":"body"),d={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},h&&a.extend(d,{position:"absolute",left:"-1000px",top:"-1000px"});for(g in d)b.style[g]=d[g];b.appendChild(i),c=h||document.documentElement,c.insertBefore(b,c.firstChild),i.style.cssText="position: absolute; left: 10.7432222px;",e=a(i).offset().left,f=e>10&&e<11,b.innerHTML="",c.removeChild(b)}()}(),a.ui.position});

/*!
 * jQuery UI Menu 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/menu/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./position"],a):a(jQuery)}(function(a){return a.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(a){a.preventDefault()},"click .ui-menu-item":function(b){var c=a(b.target);!this.mouseHandled&&c.not(".ui-state-disabled").length&&(this.select(b),b.isPropagationStopped()||(this.mouseHandled=!0),c.has(".ui-menu").length?this.expand(b):!this.element.is(":focus")&&a(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(b){if(!this.previousFilter){var c=a(b.currentTarget);c.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(b,c)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(a,b){var c=this.active||this.element.find(this.options.items).eq(0);b||this.focus(a,c)},blur:function(b){this._delay(function(){a.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(b)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(a){this._closeOnDocumentClick(a)&&this.collapseAll(a),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var b=a(this);b.data("ui-menu-submenu-carat")&&b.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(b){var c,d,e,f,g=!0;switch(b.keyCode){case a.ui.keyCode.PAGE_UP:this.previousPage(b);break;case a.ui.keyCode.PAGE_DOWN:this.nextPage(b);break;case a.ui.keyCode.HOME:this._move("first","first",b);break;case a.ui.keyCode.END:this._move("last","last",b);break;case a.ui.keyCode.UP:this.previous(b);break;case a.ui.keyCode.DOWN:this.next(b);break;case a.ui.keyCode.LEFT:this.collapse(b);break;case a.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(b);break;case a.ui.keyCode.ENTER:case a.ui.keyCode.SPACE:this._activate(b);break;case a.ui.keyCode.ESCAPE:this.collapse(b);break;default:g=!1,d=this.previousFilter||"",e=String.fromCharCode(b.keyCode),f=!1,clearTimeout(this.filterTimer),e===d?f=!0:e=d+e,c=this._filterMenuItems(e),c=f&&c.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):c,c.length||(e=String.fromCharCode(b.keyCode),c=this._filterMenuItems(e)),c.length?(this.focus(b,c),this.previousFilter=e,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}g&&b.preventDefault()},_activate:function(a){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(a):this.select(a))},refresh:function(){var b,c,d=this,e=this.options.icons.submenu,f=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),f.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var b=a(this),c=b.parent(),d=a("<span>").addClass("ui-menu-icon ui-icon "+e).data("ui-menu-submenu-carat",!0);c.attr("aria-haspopup","true").prepend(d),b.attr("aria-labelledby",c.attr("id"))}),b=f.add(this.element),c=b.find(this.options.items),c.not(".ui-menu-item").each(function(){var b=a(this);d._isDivider(b)&&b.addClass("ui-widget-content ui-menu-divider")}),c.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),c.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!a.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(a,b){"icons"===a&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(b.submenu),"disabled"===a&&this.element.toggleClass("ui-state-disabled",!!b).attr("aria-disabled",b),this._super(a,b)},focus:function(a,b){var c,d;this.blur(a,a&&"focus"===a.type),this._scrollIntoView(b),this.active=b.first(),d=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",d.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),a&&"keydown"===a.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),c=b.children(".ui-menu"),c.length&&a&&/^mouse/.test(a.type)&&this._startOpening(c),this.activeMenu=b.parent(),this._trigger("focus",a,{item:b})},_scrollIntoView:function(b){var c,d,e,f,g,h;this._hasScroll()&&(c=parseFloat(a.css(this.activeMenu[0],"borderTopWidth"))||0,d=parseFloat(a.css(this.activeMenu[0],"paddingTop"))||0,e=b.offset().top-this.activeMenu.offset().top-c-d,f=this.activeMenu.scrollTop(),g=this.activeMenu.height(),h=b.outerHeight(),e<0?this.activeMenu.scrollTop(f+e):e+h>g&&this.activeMenu.scrollTop(f+e-g+h))},blur:function(a,b){b||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",a,{item:this.active}))},_startOpening:function(a){clearTimeout(this.timer),"true"===a.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(a)},this.delay))},_open:function(b){var c=a.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(b.parents(".ui-menu")).hide().attr("aria-hidden","true"),b.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(c)},collapseAll:function(b,c){clearTimeout(this.timer),this.timer=this._delay(function(){var d=c?this.element:a(b&&b.target).closest(this.element.find(".ui-menu"));d.length||(d=this.element),this._close(d),this.blur(b),this.activeMenu=d},this.delay)},_close:function(a){a||(a=this.active?this.active.parent():this.element),a.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(b){return!a(b.target).closest(".ui-menu").length},_isDivider:function(a){return!/[^\-\u2014\u2013\s]/.test(a.text())},collapse:function(a){var b=this.active&&this.active.parent().closest(".ui-menu-item",this.element);b&&b.length&&(this._close(),this.focus(a,b))},expand:function(a){var b=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();b&&b.length&&(this._open(b.parent()),this._delay(function(){this.focus(a,b)}))},next:function(a){this._move("next","first",a)},previous:function(a){this._move("prev","last",a)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(a,b,c){var d;this.active&&(d="first"===a||"last"===a?this.active["first"===a?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[a+"All"](".ui-menu-item").eq(0)),d&&d.length&&this.active||(d=this.activeMenu.find(this.options.items)[b]()),this.focus(c,d)},nextPage:function(b){var c,d,e;return this.active?void(this.isLastItem()||(this._hasScroll()?(d=this.active.offset().top,e=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return c=a(this),c.offset().top-d-e<0}),this.focus(b,c)):this.focus(b,this.activeMenu.find(this.options.items)[this.active?"last":"first"]()))):void this.next(b)},previousPage:function(b){var c,d,e;return this.active?void(this.isFirstItem()||(this._hasScroll()?(d=this.active.offset().top,e=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return c=a(this),c.offset().top-d+e>0}),this.focus(b,c)):this.focus(b,this.activeMenu.find(this.options.items).first()))):void this.next(b)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(b){this.active=this.active||a(b.target).closest(".ui-menu-item");var c={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(b,!0),this._trigger("select",b,c)},_filterMenuItems:function(b){var c=b.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),d=new RegExp("^"+c,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return d.test(a.trim(a(this).text()))})}})});

window.wp=window.wp||{},function(a,b){"use strict";function c(a,c){e(),a=b("<p>").html(a).text(),h===a&&(a+="\xa0"),h=a,g&&"assertive"===c?g.text(a):f&&f.text(a)}function d(a){a=a||"polite";var c=b("<div>",{id:"wp-a11y-speak-"+a,"aria-live":a,"aria-relevant":"additions text","aria-atomic":"true","class":"screen-reader-text wp-a11y-speak-region"});return b(document.body).append(c),c}function e(){b(".wp-a11y-speak-region").text("")}var f,g,h="";b(document).ready(function(){f=b("#wp-a11y-speak-polite"),g=b("#wp-a11y-speak-assertive"),f.length||(f=d("polite")),g.length||(g=d("assertive"))}),a.a11y=a.a11y||{},a.a11y.speak=c}(window.wp,window.jQuery);

/* <![CDATA[ */
var uiAutocompleteL10n = {"noResults":"No results found.","oneResult":"1 result found. Use up and down arrow keys to navigate.","manyResults":"%d results found. Use up and down arrow keys to navigate.","itemSelected":"Item selected."};
/* ]]> */

/*!
 * jQuery UI Autocomplete 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/autocomplete/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./position","./menu"],a):a(jQuery)}(function(a){return a.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var b,c,d,e=this.element[0].nodeName.toLowerCase(),f="textarea"===e,g="input"===e;this.isMultiLine=!!f||!g&&this.element.prop("isContentEditable"),this.valueMethod=this.element[f||g?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(e){if(this.element.prop("readOnly"))return b=!0,d=!0,void(c=!0);b=!1,d=!1,c=!1;var f=a.ui.keyCode;switch(e.keyCode){case f.PAGE_UP:b=!0,this._move("previousPage",e);break;case f.PAGE_DOWN:b=!0,this._move("nextPage",e);break;case f.UP:b=!0,this._keyEvent("previous",e);break;case f.DOWN:b=!0,this._keyEvent("next",e);break;case f.ENTER:this.menu.active&&(b=!0,e.preventDefault(),this.menu.select(e));break;case f.TAB:this.menu.active&&this.menu.select(e);break;case f.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(e),e.preventDefault());break;default:c=!0,this._searchTimeout(e)}},keypress:function(d){if(b)return b=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||d.preventDefault());if(!c){var e=a.ui.keyCode;switch(d.keyCode){case e.PAGE_UP:this._move("previousPage",d);break;case e.PAGE_DOWN:this._move("nextPage",d);break;case e.UP:this._keyEvent("previous",d);break;case e.DOWN:this._keyEvent("next",d)}}},input:function(a){return d?(d=!1,void a.preventDefault()):void this._searchTimeout(a)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(a){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(a),void this._change(a))}}),this._initSource(),this.menu=a("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(b){b.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var c=this.menu.element[0];a(b.target).closest(".ui-menu-item").length||this._delay(function(){var b=this;this.document.one("mousedown",function(d){d.target===b.element[0]||d.target===c||a.contains(c,d.target)||b.close()})})},menufocus:function(b,c){var d,e;return this.isNewMenu&&(this.isNewMenu=!1,b.originalEvent&&/^mouse/.test(b.originalEvent.type))?(this.menu.blur(),void this.document.one("mousemove",function(){a(b.target).trigger(b.originalEvent)})):(e=c.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",b,{item:e})&&b.originalEvent&&/^key/.test(b.originalEvent.type)&&this._value(e.value),d=c.item.attr("aria-label")||e.value,void(d&&a.trim(d).length&&(this.liveRegion.children().hide(),a("<div>").text(d).appendTo(this.liveRegion))))},menuselect:function(a,b){var c=b.item.data("ui-autocomplete-item"),d=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=d,this._delay(function(){this.previous=d,this.selectedItem=c})),!1!==this._trigger("select",a,{item:c})&&this._value(c.value),this.term=this._value(),this.close(a),this.selectedItem=c}}),this.liveRegion=a("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(a,b){this._super(a,b),"source"===a&&this._initSource(),"appendTo"===a&&this.menu.element.appendTo(this._appendTo()),"disabled"===a&&b&&this.xhr&&this.xhr.abort()},_appendTo:function(){var b=this.options.appendTo;return b&&(b=b.jquery||b.nodeType?a(b):this.document.find(b).eq(0)),b&&b[0]||(b=this.element.closest(".ui-front")),b.length||(b=this.document[0].body),b},_initSource:function(){var b,c,d=this;a.isArray(this.options.source)?(b=this.options.source,this.source=function(c,d){d(a.ui.autocomplete.filter(b,c.term))}):"string"==typeof this.options.source?(c=this.options.source,this.source=function(b,e){d.xhr&&d.xhr.abort(),d.xhr=a.ajax({url:c,data:b,dataType:"json",success:function(a){e(a)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(a){clearTimeout(this.searching),this.searching=this._delay(function(){var b=this.term===this._value(),c=this.menu.element.is(":visible"),d=a.altKey||a.ctrlKey||a.metaKey||a.shiftKey;b&&(!b||c||d)||(this.selectedItem=null,this.search(null,a))},this.options.delay)},search:function(a,b){return a=null!=a?a:this._value(),this.term=this._value(),a.length<this.options.minLength?this.close(b):this._trigger("search",b)!==!1?this._search(a):void 0},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:a},this._response())},_response:function(){var b=++this.requestIndex;return a.proxy(function(a){b===this.requestIndex&&this.__response(a),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(a){a&&(a=this._normalize(a)),this._trigger("response",null,{content:a}),!this.options.disabled&&a&&a.length&&!this.cancelSearch?(this._suggest(a),this._trigger("open")):this._close()},close:function(a){this.cancelSearch=!0,this._close(a)},_close:function(a){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",a))},_change:function(a){this.previous!==this._value()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return"string"==typeof b?{label:b,value:b}:a.extend({},b,{label:b.label||b.value,value:b.value||b.label})})},_suggest:function(b){var c=this.menu.element.empty();this._renderMenu(c,b),this.isNewMenu=!0,this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItemData(b,c)})},_renderItemData:function(a,b){return this._renderItem(a,b).data("ui-autocomplete-item",b)},_renderItem:function(b,c){return a("<li>").text(c.label).appendTo(b)},_move:function(a,b){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(a)||this.menu.isLastItem()&&/^next/.test(a)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[a](b):void this.search(null,b)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(a,b){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(a,b),b.preventDefault())}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}}),a.widget("ui.autocomplete",a.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(a){return a+(a>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(b){var c;this._superApply(arguments),this.options.disabled||this.cancelSearch||(c=b&&b.length?this.options.messages.results(b.length):this.options.messages.noResults,this.liveRegion.children().hide(),a("<div>").text(c).appendTo(this.liveRegion))}}),a.ui.autocomplete});

(function($){if((window.gdSetMap=="google"||window.gdSetMap=="auto")&&window.google&&typeof google.maps!=="undefined"){gdMaps="google"}else if((window.gdSetMap=="osm"||window.gdSetMap=="auto")&&typeof L!=="undefined"&&typeof L.version!=="undefined"){gdMaps="osm"}else{gdMaps=null}window.gdMaps=window.gdMaps||gdMaps;var geocoder=window.gdMaps=="google"?new google.maps.Geocoder:{};function MyOverlay(map,$this){if(typeof $this!=="undefined"){$this.setMap(map)}else{this.setMap(map)}}MyOverlay.prototype=window.gdMaps=="google"?new google.maps.OverlayView:{};MyOverlay.prototype.onAdd=function(){};MyOverlay.prototype.onRemove=function(){};MyOverlay.prototype.draw=function(){};$.goMap={};$.fn.goMap=function(options){return this.each(function(){var goMap=$(this).data("goMap");if(!goMap&&window.gdMaps=="google"){var goMapBase=$.extend(true,{},$.goMapBase);$(this).data("goMap",goMapBase.init(this,options));$.goMap=goMapBase}else if(!goMap&&window.gdMaps=="osm"){var osmMapBase=$.extend(true,{},$.osmMapBase);$(this).data("goMap",osmMapBase.init(this,options));$.goMap=osmMapBase}else{$.goMap=goMap}})};$.osmMapBase={defaults:{address:"",latitude:56.9,longitude:24.1,zoom:4,delay:200,hideByClick:true,oneInfoWindow:true,prefixId:"gomarker",polyId:"gopoly",groupId:"gogroup",navigationControl:true,navigationControlOptions:{position:"topleft",style:"DEFAULT"},mapTypeControl:true,mapTypeControlOptions:{position:"topright",style:"DEFAULT"},zoomControl:true,zoomControlOptions:{position:"topleft"},scaleControl:false,scrollwheel:true,fullscreenControl:false,directions:false,directionsResult:null,disableDoubleClickZoom:false,streetViewControl:true,streetViewControlOptions:{position:"bottomleft"},markers:[],overlays:[],polyline:{color:"#FF0000",opacity:1,weight:2},polygon:{color:"#FF0000",opacity:1,weight:2,fillColor:"#FF0000",fillOpacity:.2},circle:{color:"#FF0000",opacity:1,weight:2,fillColor:"#FF0000",fillOpacity:.2},rectangle:{color:"#FF0000",opacity:1,weight:2,fillColor:"#FF0000",fillOpacity:.2},maptype:"ROADMAP",html_prepend:"<div class=gomapMarker>",html_append:"</div>",addMarker:false,osmBaseLayer:null,osmOverlays:[]},map:null,count:0,markers:[],polylines:[],polygons:[],circles:[],rectangles:[],tmpMarkers:[],geoMarkers:[],lockGeocode:false,bounds:null,overlays:null,overlay:null,mapId:null,plId:null,pgId:null,cId:null,rId:null,opts:null,centerLatLng:null,init:function(el,options){var opts=$.extend(true,{},$.osmMapBase.defaults,options),baseLayer,customMap;this.mapId=$(el);this.opts=opts;if(opts.address)this.geocode({address:opts.address,center:true});else if($.isArray(opts.markers)&&opts.markers.length>0){if(opts.markers[0].address)this.geocode({address:opts.markers[0].address,center:true});else this.centerLatLng=L.latLng(opts.markers[0].latitude,opts.markers[0].longitude)}else this.centerLatLng=L.latLng(opts.latitude,opts.longitude);var myOptions={center:this.centerLatLng,zoom:opts.zoom,minZoom:opts.minZoom?opts.minZoom:1,maxZoom:opts.maxZoom>18?18:opts.maxZoom,zoomControl:true,doubleClickZoom:opts.disableDoubleClickZoom==="0"||!opts.disableDoubleClickZoom?true:false,dragging:true,scrollWheelZoom:opts.scrollwheel==="0"||!opts.scrollwheel?false:opts.scrollwheel,attributionControl:typeof opts.attributionControl!=="undefined"?opts.attributionControl:true,defaultBaseLayer:typeof opts.osmBaseLayer!=="undefined"&&opts.osmBaseLayer?opts.osmBaseLayer:null,defaultOverlays:typeof opts.osmOverlays!=="undefined"&&opts.osmOverlays?opts.osmOverlays:[]};if(myOptions.defaultBaseLayer){try{baseLayer=L.tileLayer.provider(myOptions.defaultBaseLayer);customMap=true}catch(e){console.log(e)}}if(!baseLayer){var osmUrl="//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",osmAttrib='Map data &copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap</a> contributors',baseLayer=L.tileLayer(osmUrl,{maxZoom:opts.maxZoom,attribution:osmAttrib})}this.map=new L.Map(el,myOptions).addLayer(baseLayer);if(customMap&&myOptions.defaultOverlays&&myOptions.defaultOverlays.length>0){for(var i in myOptions.defaultOverlays){if(myOptions.defaultOverlays[i]){try{L.tileLayer.provider(myOptions.defaultOverlays[i]).addTo(this.map)}catch(e){console.log(e)}}}}if(myOptions.zoomControl&&(zoomPosition=this.parsePosition(opts.zoomControlOptions.position,"topleft"))!=="topleft"){this.map.zoomControl.setPosition(zoomPosition)}if(parseInt(options.enable_marker_cluster)===1&&!options.enable_marker_cluster_server){jQuery("#gdOSMprogress").remove();jQuery("#gdOSMprogressBar").remove();jQuery(el).before('<div id="gdOSMprogress"><div id="gdOSMprogressBar"></div></div>');function gdOSMUpdateProgressBar(processed,total,elapsed,layersArray){processed=Math.min(processed,total);if(elapsed>1e3){jQuery("#gdOSMprogress").show();jQuery("#gdOSMprogressBar").width(Math.round(processed/total*100)+"%")}if(processed===total){jQuery("#gdOSMprogress").hide()}}this.gdlayers=new L.markerClusterGroup({spiderfyOnMaxZoom:true,showCoverageOnHover:false,zoomToBoundsOnClick:true,chunkedLoading:true,chunkProgress:gdOSMUpdateProgressBar})}else{this.gdlayers=new L.featureGroup([])}this.oms=new OverlappingMarkerSpiderfier(this.map);for(var j=0,l=opts.markers.length;j<l;j++)this.createMarker(opts.markers[j]);var goMap=this;if(opts.addMarker==true||opts.addMarker=="multi"){L.DomEvent.addListener(goMap.map,"click",function(event){var options={position:event.latLng,draggable:true};var marker=goMap.createMarker(options);L.DomEvent.addListener(marker,"dblclick",function(event){marker.setMap(null);goMap.removeMarker(marker.id)})})}else if(opts.addMarker=="single"){L.DomEvent.addListener(goMap.map,"click",function(event){if(!goMap.singleMarker){var options={position:event.latLng,draggable:true};var marker=goMap.createMarker(options);goMap.singleMarker=true;L.DomEvent.addListener(marker,"dblclick",function(event){marker.setMap(null);goMap.removeMarker(marker.id);goMap.singleMarker=false})}})}delete opts.markers;delete opts.overlays;return this},ready:function(f){this.map.addOneTimeEventListener("moveend",function(){return f()})},Geocoder:function(options){return new L.Control.gdGeoCode({provider:new L.gdGeoCode.Provider.OpenStreetMap})},geocode:function(address,options){var gdcoder=new L.Control.gdGeoCode({provider:new L.gdGeoCode.Provider.OpenStreetMap});var results=gdcoder.geosearch(address)},parsePosition:function(position,$default){var parsed=position;if(position&&typeof position=="string"){switch(position.toUpperCase()){case"TOP":case"LEFT":case"TOP_LEFT":case"topleft":parsed="topleft";break;case"RIGHT":case"TOP_RIGHT":case"topright":parsed="topright";break;case"BOTTOM":case"BOTTOM_LEFT":case"bottomleft":parsed="bottomleft";break;case"BOTTOM_RIGHT":case"bottomright":parsed="bottomright";break;default:parsed=typeof $default!=="undefined"?$default:parsed;break}}else if(typeof $default!=="undefined"){parsed=$default}return parsed},geoMarker:function(){if(this.geoMarkers.length>0&&!this.lockGeocode){this.lockGeocode=true;var current=this.geoMarkers.splice(0,1);this.geocode({address:current[0].address},current[0])}else if(this.lockGeocode){var goMap=this;setTimeout(function(){goMap.geoMarker()},this.opts.delay)}},setMap:function(options){delete options.mapTypeId;if(options.address){this.geocode({address:options.address,center:true});delete options.address}else if(options.latitude&&options.longitude){options.center=L.latLng(options.latitude,options.longitude);delete options.longitude;delete options.latitude}if(options.mapTypeControlOptions&&options.mapTypeControlOptions.position)options.mapTypeControlOptions.position=options.mapTypeControlOptions.position.toLowerCase();if(options.navigationControlOptions&&options.navigationControlOptions.position)options.navigationControlOptions.position=options.navigationControlOptions.position.toLowerCase();L.Util.setOptions(this.map,options)},getMap:function(){return this.map},setInfoWindow:function(marker,html){var goMap=this;html.content=goMap.opts.html_prepend+html.content+goMap.opts.html_append;var infowindow=marker.bindPopup(html);infowindow.show=false;$(goMap.mapId).data(marker.id+"info",infowindow);if(html.popup){goMap.openWindow(infowindow,marker,html);infowindow.show=true}L.DomEvent.addListener(marker,"click",function(){if(infowindow.show&&goMap.opts.hideByClick){infowindow.close();infowindow.show=false}else{goMap.openWindow(infowindow,marker,html);infowindow.show=true}})},openWindow:function(infowindow,marker,html){if(this.opts.oneInfoWindow)this.clearInfo();if(html.ajax){infowindow.openPopup();$.ajax({url:html.ajax,success:function(html){infowindow.setContent(html)}})}else if(html.id){infowindow.setContent($(html.id).html());infowindow.openPopup()}else{infowindow.openPopup()}},setInfo:function(id,text){var info=$(this.mapId).data(id+"info");if(typeof text=="object")info.setOptions(text);else info.setContent(text)},getInfo:function(id,hideDiv){var info=$(this.mapId).data(id+"info").getContent();if(hideDiv)return $(info).html();else return info},clearInfo:function(){for(var i=0,l=this.markers.length;i<l;i++){var info=$(this.mapId).data(this.markers[i]+"info");if(info){info.popupclose();info.show=false}}},fitBounds:function(type,markers){var goMap=this;if(this.getMarkerCount()!=this.getTmpMarkerCount())setTimeout(function(){goMap.fitBounds(type,markers)},this.opts.delay);else{this.bounds=new L.LatLngBounds([]);if(!type||type&&type=="all"){for(var i=0,l=this.markers.length;i<l;i++){this.bounds.extend($(this.mapId).data(this.markers[i]).position)}}else if(type&&type=="visible"){for(var i=0,l=this.markers.length;i<l;i++){if(this.getVisibleMarker(this.markers[i]))this.bounds.extend($(this.mapId).data(this.markers[i]).position)}}else if(type&&type=="markers"&&$.isArray(markers)){for(var i=0,l=markers.length;i<l;i++){this.bounds.extend($(this.mapId).data(markers[i]).position)}}this.map.fitBounds(this.bounds)}},getBounds:function(){return this.map.getBounds()},getGDMarkers:function(){return this.gdlayers},getMarkerCount:function(){return this.markers.length},getTmpMarkerCount:function(){return this.tmpMarkers.length},getMarkers:function(type,name){var array=[];switch(type){case"markers":for(var i=0,l=this.markers.length;i<l;i++){var temp=$(this.mapId).data(this.markers[i]);array.push(temp)}break;default:for(var i=0,l=this.markers.length;i<l;i++){var temp=$(this.mapId).data(this.markers[i]).getPosition().toUrlValue();array.push(temp)}break}return array},createMarker:function(marker){if(!marker.geocode){this.count++;if(!marker.id)marker.id=this.opts.prefixId+this.count;this.tmpMarkers.push(marker.id)}if(marker.address&&!marker.geocode){this.geoMarkers.push(marker);this.geoMarker()}else if(marker.latitude&&marker.longitude||marker.position){var options={map:this.map};options.id=marker.id;options.group=marker.group?marker.group:this.opts.groupId;options.zIndex=marker.zIndex?marker.zIndex:0;options.zIndexOrg=marker.zIndexOrg?marker.zIndexOrg:0;if(marker.visible==false)options.visible=marker.visible;if(marker.title)options.title=marker.title;if(marker.label)options.label=marker.label;if(marker.draggable)options.draggable=marker.draggable;if(marker.icon&&marker.icon.image){options.icon=marker.icon.image;if(marker.icon.shadow)options.shadow=marker.icon.shadow}else if(marker.icon)options.icon=marker.icon;else if(this.opts.icon&&this.opts.icon.image){options.icon=this.opts.icon.image;if(this.opts.icon.shadow)options.shadow=this.opts.icon.shadow}else if(this.opts.icon)options.icon=this.opts.icon;if(options.icon){iconOptions={iconUrl:options.icon,iconSize:null,iconAnchor:[17,0],popupAnchor:null};if(marker.iconSize){iconOptions.iconSize=marker.iconSize}if(marker.iconAnchor){iconOptions.iconAnchor=marker.iconAnchor}if(marker.popupAnchor){iconOptions.popupAnchor=marker.popupAnchor}if(marker.iconRetinaUrl){iconOptions.iconRetinaUrl=marker.iconRetinaUrl}if(marker.shadowUrl){iconOptions.shadowUrl=marker.shadowUrl}if(marker.shadowRetinaUrl){iconOptions.shadowRetinaUrl=marker.shadowRetinaUrl}if(marker.shadowSize){iconOptions.shadowSize=marker.shadowSize}if(marker.shadowAnchor){iconOptions.shadowAnchor=marker.shadowAnchor}if(marker.className){iconOptions.className=marker.className}if(marker.clustered){options.clustered=true;var c="marker-cluster marker-cluster-";if(marker.title<10){c+="small"}else if(marker.title<100){c+="medium"}else{c+="large"}iconOptions.className=c;iconOptions.html="<div><span>"+marker.title+"</span></div>";marker.w=40;marker.h=40}if(!iconOptions.iconSize&&marker.w&&marker.h&&parseInt(marker.w)>0&&parseInt(marker.h)>0){var w=parseFloat(marker.w);var h=parseFloat(marker.h);iconOptions.iconSize=[w,h];iconOptions.iconAnchor=[w/2-1,h];iconOptions.popupAnchor=[0,h*-1+h*.05]}if(marker.clustered){options.icon=new L.DivIcon(iconOptions)}else{options.icon=L.icon(iconOptions)}}else{options.icon=new L.Icon.Default}options.position=marker.position?marker.position:L.latLng(marker.latitude,marker.longitude);var cmarker=new L.Marker(options.position,options);if(marker.html&&!marker.clustered){if(!marker.html.content&&!marker.html.ajax&&!marker.html.id)marker.html={content:marker.html};else if(!marker.html.content)marker.html.content=null;this.setInfoWindow(cmarker,marker.html)}if(marker.addToMap){cmarker.addTo(this.map);return cmarker}this.addMarker(cmarker);return cmarker}},addMarker:function(marker){this.gdlayers.addLayer(marker)},removeMarker:function(marker){if(marker=="map_me"){if(jQuery.goMap.gdUmarker){this.map.removeLayer(jQuery.goMap.gdUmarker);jQuery.goMap.gdUmarker=null}return true}var index=$.inArray(marker,this.markers),current;if(index>-1){this.tmpMarkers.splice(index,1);current=this.markers.splice(index,1);var markerId=current[0];var marker=$(this.mapId).data(markerId);var info=$(this.mapId).data(markerId+"info");marker.setVisible(false);marker.setMap(null);$(this.mapId).removeData(markerId);if(info){info.close();info.show=false;$(this.mapId).removeData(markerId+"info")}return true}return false},clearMarkers:function(){var allMarkers=this.gdlayers;this.gdlayers.eachLayer(function(marker){allMarkers.removeLayer(marker)});this.gdlayers=allMarkers;this.singleMarker=false;this.lockGeocode=false;this.markers=[];this.tmpMarkers=[];this.geoMarkers=[]},isVisible:function(latlng){return this.map.getBounds().contains(latlng)}};$.goMapBase={defaults:{address:"",latitude:56.9,longitude:24.1,zoom:4,delay:200,hideByClick:true,oneInfoWindow:true,prefixId:"gomarker",polyId:"gopoly",groupId:"gogroup",navigationControl:true,navigationControlOptions:{position:"TOP_LEFT",style:"DEFAULT"},mapTypeControl:true,mapTypeControlOptions:{position:"TOP_RIGHT",style:"DEFAULT"},zoomControl:true,zoomControlOptions:{position:"LEFT_CENTER"},scaleControl:false,scrollwheel:true,fullscreenControl:false,directions:false,directionsResult:null,disableDoubleClickZoom:false,streetViewControl:true,streetViewControlOptions:{position:"LEFT_CENTER"},markers:[],overlays:[],polyline:{color:"#FF0000",opacity:1,weight:2},polygon:{color:"#FF0000",opacity:1,weight:2,fillColor:"#FF0000",fillOpacity:.2},circle:{color:"#FF0000",opacity:1,weight:2,fillColor:"#FF0000",fillOpacity:.2},rectangle:{color:"#FF0000",opacity:1,weight:2,fillColor:"#FF0000",fillOpacity:.2},maptype:"ROADMAP",html_prepend:"<div class=gomapMarker>",html_append:"</div>",addMarker:false},map:null,count:0,markers:[],polylines:[],polygons:[],circles:[],rectangles:[],tmpMarkers:[],geoMarkers:[],lockGeocode:false,bounds:null,overlays:null,overlay:null,mapId:null,plId:null,pgId:null,cId:null,rId:null,opts:null,centerLatLng:null,init:function(el,options){var opts=$.extend(true,{},$.goMapBase.defaults,options);this.mapId=$(el);this.opts=opts;if(opts.address)this.geocode({address:opts.address,center:true});else if($.isArray(opts.markers)&&opts.markers.length>0){if(opts.markers[0].address)this.geocode({address:opts.markers[0].address,center:true});else this.centerLatLng=new google.maps.LatLng(opts.markers[0].latitude,opts.markers[0].longitude)}else this.centerLatLng=new google.maps.LatLng(opts.latitude,opts.longitude);var myOptions={center:this.centerLatLng,disableDoubleClickZoom:opts.disableDoubleClickZoom,mapTypeControl:opts.mapTypeControl,streetViewControl:opts.streetViewControl,streetViewControlOptions:{position:google.maps.ControlPosition[opts.streetViewControlOptions.position.toUpperCase()]},mapTypeControlOptions:{position:google.maps.ControlPosition[opts.mapTypeControlOptions.position.toUpperCase()],style:google.maps.MapTypeControlStyle[opts.mapTypeControlOptions.style.toUpperCase()]},mapTypeId:google.maps.MapTypeId[opts.maptype.toUpperCase()],navigationControl:opts.navigationControl,navigationControlOptions:{position:google.maps.ControlPosition[opts.navigationControlOptions.position.toUpperCase()],style:google.maps.NavigationControlStyle[opts.navigationControlOptions.style.toUpperCase()]},zoomControl:true,zoomControlOptions:{position:google.maps.ControlPosition[opts.zoomControlOptions.position.toUpperCase()]},scaleControl:opts.scaleControl,scrollwheel:opts.scrollwheel,fullscreenControl:opts.fullscreenControl,zoom:opts.zoom,minZoom:parseInt(opts.minZoom),maxZoom:parseInt(opts.maxZoom)};this.map=new google.maps.Map(el,myOptions);this.overlay=new MyOverlay(this.map);this.oms=new OverlappingMarkerSpiderfier(this.map,{markersWontMove:true,markersWontHide:true,basicFormatEvents:true});this.overlays={polyline:{id:"plId",array:"polylines",create:"createPolyline"},polygon:{id:"pgId",array:"polygons",create:"createPolygon"},circle:{id:"cId",array:"circles",create:"createCircle"},rectangle:{id:"rId",array:"rectangles",create:"createRectangle"}};this.plId=$('<div style="display:none;"/>').appendTo(this.mapId);this.pgId=$('<div style="display:none;"/>').appendTo(this.mapId);this.cId=$('<div style="display:none;"/>').appendTo(this.mapId);this.rId=$('<div style="display:none;"/>').appendTo(this.mapId);for(var j=0,l=opts.markers.length;j<l;j++)this.createMarker(opts.markers[j]);for(var j=0,l=opts.overlays.length;j<l;j++)this[this.overlays[opts.overlays[j].type].create](opts.overlays[j]);var goMap=this;if(opts.addMarker==true||opts.addMarker=="multi"){google.maps.event.addListener(goMap.map,"click",function(event){var options={position:event.latLng,draggable:true};var marker=goMap.createMarker(options);google.maps.event.addListener(marker,"dblclick",function(event){marker.setMap(null);goMap.removeMarker(marker.id)})})}else if(opts.addMarker=="single"){google.maps.event.addListener(goMap.map,"click",function(event){if(!goMap.singleMarker){var options={position:event.latLng,draggable:true};var marker=goMap.createMarker(options);goMap.singleMarker=true;google.maps.event.addListener(marker,"dblclick",function(event){marker.setMap(null);goMap.removeMarker(marker.id);goMap.singleMarker=false})}})}delete opts.markers;delete opts.overlays;return this},ready:function(f){google.maps.event.addListenerOnce(this.map,"bounds_changed",function(){return f()})},geocode:function(address,options){var goMap=this;setTimeout(function(){geocoder.geocode({address:address.address},function(results,status){if(status==google.maps.GeocoderStatus.OK&&address.center)goMap.map.setCenter(results[0].geometry.location);if(status==google.maps.GeocoderStatus.OK&&options&&options.markerId)options.markerId.setPosition(results[0].geometry.location);else if(status==google.maps.GeocoderStatus.OK&&options){if(goMap.lockGeocode){goMap.lockGeocode=false;options.position=results[0].geometry.location;options.geocode=true;goMap.createMarker(options)}}else if(status==google.maps.GeocoderStatus.OVER_QUERY_LIMIT){goMap.geocode(address,options)}})},this.opts.delay)},geoMarker:function(){if(this.geoMarkers.length>0&&!this.lockGeocode){this.lockGeocode=true;var current=this.geoMarkers.splice(0,1);this.geocode({address:current[0].address},current[0])}else if(this.lockGeocode){var goMap=this;setTimeout(function(){goMap.geoMarker()},this.opts.delay)}},setMap:function(options){delete options.mapTypeId;if(options.address){this.geocode({address:options.address,center:true});delete options.address}else if(options.latitude&&options.longitude){options.center=new google.maps.LatLng(options.latitude,options.longitude);delete options.longitude;delete options.latitude}if(options.mapTypeControlOptions&&options.mapTypeControlOptions.position)options.mapTypeControlOptions.position=google.maps.ControlPosition[options.mapTypeControlOptions.position.toUpperCase()];if(options.mapTypeControlOptions&&options.mapTypeControlOptions.style)options.mapTypeControlOptions.style=google.maps.MapTypeControlStyle[options.mapTypeControlOptions.style.toUpperCase()];if(options.navigationControlOptions&&options.navigationControlOptions.position)options.navigationControlOptions.position=google.maps.ControlPosition[options.navigationControlOptions.position.toUpperCase()];if(options.navigationControlOptions&&options.navigationControlOptions.style)options.navigationControlOptions.style=google.maps.NavigationControlStyle[options.navigationControlOptions.style.toUpperCase()];this.map.setOptions(options)},getMap:function(){return this.map},createListener:function(type,event,data){var target;if(typeof type!="object")type={type:type};if(type.type=="map")target=this.map;else if(type.type=="marker"&&type.marker)target=$(this.mapId).data(type.marker);else if(type.type=="info"&&type.marker)target=$(this.mapId).data(type.marker+"info");if(target)return google.maps.event.addListener(target,event,data);else if((type.type=="marker"||type.type=="info")&&this.getMarkerCount()!=this.getTmpMarkerCount())var goMap=this;setTimeout(function(){goMap.createListener(type,event,data)},this.opts.delay)},removeListener:function(listener){google.maps.event.removeListener(listener)},setInfoWindow:function(marker,html){var goMap=this;html.content=goMap.opts.html_prepend+html.content+goMap.opts.html_append;var infowindow=new google.maps.InfoWindow(html);infowindow.show=false;$(goMap.mapId).data(marker.id+"info",infowindow);if(html.popup){goMap.openWindow(infowindow,marker,html);infowindow.show=true}google.maps.event.addListener(marker,"click",function(){if(infowindow.show&&goMap.opts.hideByClick){infowindow.close();infowindow.show=false}else{goMap.openWindow(infowindow,marker,html);infowindow.show=true}})},openWindow:function(infowindow,marker,html){if(this.opts.oneInfoWindow)this.clearInfo();if(html.ajax){infowindow.open(this.map,marker);$.ajax({url:html.ajax,success:function(html){infowindow.setContent(html)}})}else if(html.id){infowindow.setContent($(html.id).html());infowindow.open(this.map,marker)}else infowindow.open(this.map,marker)},setInfo:function(id,text){var info=$(this.mapId).data(id+"info");if(typeof text=="object")info.setOptions(text);else info.setContent(text)},getInfo:function(id,hideDiv){var info=$(this.mapId).data(id+"info").getContent();if(hideDiv)return $(info).html();else return info},clearInfo:function(){for(var i=0,l=this.markers.length;i<l;i++){var info=$(this.mapId).data(this.markers[i]+"info");if(info){info.close();info.show=false}}},fitBounds:function(type,markers){var goMap=this;if(this.getMarkerCount()!=this.getTmpMarkerCount())setTimeout(function(){goMap.fitBounds(type,markers)},this.opts.delay);else{this.bounds=new google.maps.LatLngBounds;if(!type||type&&type=="all"){for(var i=0,l=this.markers.length;i<l;i++){this.bounds.extend($(this.mapId).data(this.markers[i]).position)}}else if(type&&type=="visible"){for(var i=0,l=this.markers.length;i<l;i++){if(this.getVisibleMarker(this.markers[i]))this.bounds.extend($(this.mapId).data(this.markers[i]).position)}}else if(type&&type=="markers"&&$.isArray(markers)){for(var i=0,l=markers.length;i<l;i++){this.bounds.extend($(this.mapId).data(markers[i]).position)}}this.map.fitBounds(this.bounds)}},getBounds:function(){return this.map.getBounds()},createPolyline:function(poly){poly.type="polyline";return this.createOverlay(poly)},createPolygon:function(poly){poly.type="polygon";return this.createOverlay(poly)},createCircle:function(poly){poly.type="circle";return this.createOverlay(poly)},createRectangle:function(poly){poly.type="rectangle";return this.createOverlay(poly)},createOverlay:function(poly){var overlay=[];if(!poly.id){this.count++;poly.id=this.opts.polyId+this.count}switch(poly.type){case"polyline":if(poly.coords.length>0){for(var j=0,l=poly.coords.length;j<l;j++)overlay.push(new google.maps.LatLng(poly.coords[j].latitude,poly.coords[j].longitude));overlay=new google.maps.Polyline({map:this.map,path:overlay,strokeColor:poly.color?poly.color:this.opts.polyline.color,strokeOpacity:poly.opacity?poly.opacity:this.opts.polyline.opacity,strokeWeight:poly.weight?poly.weight:this.opts.polyline.weight})}else return false;break;case"polygon":if(poly.coords.length>0){for(var j=0,l=poly.coords.length;j<l;j++)overlay.push(new google.maps.LatLng(poly.coords[j].latitude,poly.coords[j].longitude));overlay=new google.maps.Polygon({map:this.map,path:overlay,strokeColor:poly.color?poly.color:this.opts.polygon.color,strokeOpacity:poly.opacity?poly.opacity:this.opts.polygon.opacity,strokeWeight:poly.weight?poly.weight:this.opts.polygon.weight,fillColor:poly.fillColor?poly.fillColor:this.opts.polygon.fillColor,fillOpacity:poly.fillOpacity?poly.fillOpacity:this.opts.polygon.fillOpacity})}else return false;break;case"circle":overlay=new google.maps.Circle({map:this.map,center:new google.maps.LatLng(poly.latitude,poly.longitude),radius:poly.radius,strokeColor:poly.color?poly.color:this.opts.circle.color,strokeOpacity:poly.opacity?poly.opacity:this.opts.circle.opacity,strokeWeight:poly.weight?poly.weight:this.opts.circle.weight,fillColor:poly.fillColor?poly.fillColor:this.opts.circle.fillColor,fillOpacity:poly.fillOpacity?poly.fillOpacity:this.opts.circle.fillOpacity});break;case"rectangle":overlay=new google.maps.Rectangle({map:this.map,bounds:new google.maps.LatLngBounds(new google.maps.LatLng(poly.sw.latitude,poly.sw.longitude),new google.maps.LatLng(poly.ne.latitude,poly.ne.longitude)),strokeColor:poly.color?poly.color:this.opts.circle.color,strokeOpacity:poly.opacity?poly.opacity:this.opts.circle.opacity,strokeWeight:poly.weight?poly.weight:this.opts.circle.weight,fillColor:poly.fillColor?poly.fillColor:this.opts.circle.fillColor,fillOpacity:poly.fillOpacity?poly.fillOpacity:this.opts.circle.fillOpacity});break;default:return false;break}this.addOverlay(poly,overlay);return overlay},addOverlay:function(poly,overlay){$(this[this.overlays[poly.type].id]).data(poly.id,overlay);this[this.overlays[poly.type].array].push(poly.id)},setOverlay:function(type,overlay,options){overlay=$(this[this.overlays[type].id]).data(overlay);if(options.coords&&options.coords.length>0){var array=[];for(var j=0,l=options.coords.length;j<l;j++)array.push(new google.maps.LatLng(options.coords[j].latitude,options.coords[j].longitude));options.path=array;delete options.coords}else if(options.ne&&options.sw){options.bounds=new google.maps.LatLngBounds(new google.maps.LatLng(options.sw.latitude,options.sw.longitude),new google.maps.LatLng(options.ne.latitude,options.ne.longitude));delete options.ne;delete options.sw}else if(options.latitude&&options.longitude){options.center=new google.maps.LatLng(options.latitude,options.longitude);delete options.latitude;delete options.longitude}overlay.setOptions(options)},showHideOverlay:function(type,overlay,display){if(typeof display==="undefined"){if(this.getVisibleOverlay(type,overlay))display=false;else display=true}if(display)$(this[this.overlays[type].id]).data(overlay).setMap(this.map);else $(this[this.overlays[type].id]).data(overlay).setMap(null)},getVisibleOverlay:function(type,overlay){if($(this[this.overlays[type].id]).data(overlay).getMap())return true;else return false},getOverlaysCount:function(type){return this[this.overlays[type].array].length},removeOverlay:function(type,overlay){var index=$.inArray(overlay,this[this.overlays[type].array]),current;if(index>-1){current=this[this.overlays[type].array].splice(index,1);var markerId=current[0];$(this[this.overlays[type].id]).data(markerId).setMap(null);$(this[this.overlays[type].id]).removeData(markerId);return true}return false},clearOverlays:function(type){for(var i=0,l=this[this.overlays[type].array].length;i<l;i++){var markerId=this[this.overlays[type].array][i];$(this[this.overlays[type].id]).data(markerId).setMap(null);$(this[this.overlays[type].id]).removeData(markerId)}this[this.overlays[type].array]=[]},showHideMarker:function(marker,display){if(typeof display==="undefined"){if(this.getVisibleMarker(marker)){$(this.mapId).data(marker).setVisible(false);var info=$(this.mapId).data(marker+"info");if(info&&info.show){info.close();info.show=false}}else $(this.mapId).data(marker).setVisible(true)}else $(this.mapId).data(marker).setVisible(display)},showHideMarkerByGroup:function(group,display){for(var i=0,l=this.markers.length;i<l;i++){var markerId=this.markers[i];var marker=$(this.mapId).data(markerId);if(marker.group==group){if(typeof display==="undefined"){if(this.getVisibleMarker(markerId)){marker.setVisible(false);var info=$(this.mapId).data(markerId+"info");if(info&&info.show){info.close();info.show=false}}else{marker.setVisible(true)}}else marker.setVisible(display)}}},getVisibleMarker:function(marker){return $(this.mapId).data(marker).getVisible()},getMarkerCount:function(){return this.markers.length},getTmpMarkerCount:function(){return this.tmpMarkers.length},getVisibleMarkerCount:function(){return this.getMarkers("visiblesInMap").length},getMarkerByGroupCount:function(group){return this.getMarkers("group",group).length},getMarkers:function(type,name){var array=[];switch(type){case"json":for(var i=0,l=this.markers.length;i<l;i++){var temp="'"+i+"': '"+$(this.mapId).data(this.markers[i]).getPosition().toUrlValue()+"'";array.push(temp)}array="{'markers':{"+array.join(",")+"}}";break;case"data":for(var i=0,l=this.markers.length;i<l;i++){var temp="marker["+i+"]="+$(this.mapId).data(this.markers[i]).getPosition().toUrlValue();array.push(temp)}array=array.join("&");break;case"visiblesInBounds":for(var i=0,l=this.markers.length;i<l;i++){if(this.isVisible($(this.mapId).data(this.markers[i]).getPosition()))array.push(this.markers[i])}break;case"visiblesInMap":for(var i=0,l=this.markers.length;i<l;i++){if(this.getVisibleMarker(this.markers[i]))array.push(this.markers[i])}break;case"group":if(name)for(var i=0,l=this.markers.length;i<l;i++){if($(this.mapId).data(this.markers[i]).group==name)array.push(this.markers[i])}break;case"markers":for(var i=0,l=this.markers.length;i<l;i++){var temp=$(this.mapId).data(this.markers[i]);array.push(temp)}break;default:for(var i=0,l=this.markers.length;i<l;i++){var temp=$(this.mapId).data(this.markers[i]).getPosition().toUrlValue();array.push(temp)}break}return array},getVisibleMarkers:function(){return this.getMarkers("visiblesInBounds")},createMarker:function(marker){if(!marker.geocode){this.count++;if(!marker.id)marker.id=this.opts.prefixId+this.count;this.tmpMarkers.push(marker.id)}if(marker.address&&!marker.geocode){this.geoMarkers.push(marker);this.geoMarker()}else if(marker.latitude&&marker.longitude||marker.position){var options={map:this.map};options.id=marker.id;options.group=marker.group?marker.group:this.opts.groupId;options.zIndex=marker.zIndex?marker.zIndex:0;options.zIndexOrg=marker.zIndexOrg?marker.zIndexOrg:0;options.optimized=false;if(marker.visible==false)options.visible=marker.visible;if(marker.title)options.title=marker.title;if(marker.label)options.label=marker.label;if(marker.draggable)options.draggable=marker.draggable;if(marker.icon&&marker.icon.image){options.icon=marker.icon.image;if(marker.icon.shadow)options.shadow=marker.icon.shadow}else if(marker.icon)options.icon=marker.icon;else if(this.opts.icon&&this.opts.icon.image){options.icon=this.opts.icon.image;if(this.opts.icon.shadow)options.shadow=this.opts.icon.shadow}else if(this.opts.icon)options.icon=this.opts.icon;options.position=marker.position?marker.position:new google.maps.LatLng(marker.latitude,marker.longitude);var cmarker=new google.maps.Marker(options);if(marker.html){if(!marker.html.content&&!marker.html.ajax&&!marker.html.id)marker.html={
content:marker.html};else if(!marker.html.content)marker.html.content=null;this.setInfoWindow(cmarker,marker.html)}this.addMarker(cmarker);return cmarker}},addMarker:function(marker){$(this.mapId).data(marker.id,marker);this.markers.push(marker.id)},setMarker:function(marker,options){var tmarker=$(this.mapId).data(marker);delete options.id;delete options.visible;if(options.icon){var toption=options.icon;delete options.icon;if(toption&&toption=="default"){if(this.opts.icon&&this.opts.icon.image){options.icon=this.opts.icon.image;if(this.opts.icon.shadow)options.shadow=this.opts.icon.shadow}else if(this.opts.icon)options.icon=this.opts.icon}else if(toption&&toption.image){options.icon=toption.image;if(toption.shadow)options.shadow=toption.shadow}else if(toption)options.icon=toption}if(options.address){this.geocode({address:options.address},{markerId:tmarker});delete options.address;delete options.latitude;delete options.longitude;delete options.position}else if(options.latitude&&options.longitude||options.position){if(!options.position)options.position=new google.maps.LatLng(options.latitude,options.longitude)}tmarker.setOptions(options)},removeMarker:function(marker){var index=$.inArray(marker,this.markers),current;if(index>-1){this.tmpMarkers.splice(index,1);current=this.markers.splice(index,1);var markerId=current[0];var marker=$(this.mapId).data(markerId);var info=$(this.mapId).data(markerId+"info");marker.setVisible(false);marker.setMap(null);$(this.mapId).removeData(markerId);if(info){info.close();info.show=false;$(this.mapId).removeData(markerId+"info")}return true}return false},clearMarkers:function(){for(var i=0,l=this.markers.length;i<l;i++){var markerId=this.markers[i];var marker=$(this.mapId).data(markerId);var info=$(this.mapId).data(markerId+"info");marker.setVisible(false);marker.setMap(null);$(this.mapId).removeData(markerId);if(info){info.close();info.show=false;$(this.mapId).removeData(markerId+"info")}}this.singleMarker=false;this.lockGeocode=false;this.markers=[];this.tmpMarkers=[];this.geoMarkers=[]},clearMarkersDelay:function(){var old_markers=this.markers;setTimeout(function(){for(var i=0,l=old_markers.length;i<l;i++){var markerId=old_markers[i];var marker=$(this.mapId).data(markerId);var info=$(this.mapId).data(markerId+"info");marker.setVisible(false);marker.setMap(null);$(this.mapId).removeData(markerId);if(info){info.close();info.show=false;$(this.mapId).removeData(markerId+"info")}}this.singleMarker=false;this.lockGeocode=false;this.markers=[];this.tmpMarkers=[];this.geoMarkers=[]},3e3)},isVisible:function(latlng){return this.map.getBounds().contains(latlng)}}})(jQuery);function gdGeoLocateMe(el,type){window.gdLocate="";if(typeof type!="undefined"){window.gdLocate=type}if(navigator.geolocation){navigator.geolocation.getCurrentPosition(gdGeoLocateMeSuccess,gdGeoLocateMeError)}else{gdGeoLocateMeError(-1)}}function gdGeoLocateMeSuccess(position){var coords=position.coords||position.coordinate||position;if(coords&&coords.latitude&&coords.longitude){var myLat=coords.latitude,myLng=coords.longitude;var geoAddress=myLat+", "+myLng;if(window.gdMaps=="google"||window.gdMaps=="osm"){if(window.gdLocate&&window.gdLocate=="add-listing"){if(typeof geocodePosition!="undefined"){jQuery("#postmap").goMap();user_address=false;if(window.gdMaps=="google"){jQuery.goMap.map.setCenter(new google.maps.LatLng(myLat,myLng));baseMarker.setPosition(new google.maps.LatLng(myLat,myLng));updateMarkerPosition(baseMarker.getPosition());geocodePosition(baseMarker.getPosition())}else if(window.gdMaps=="osm"){centerMap(new L.latLng(myLat,myLng));baseMarker.setLatLng(new L.latLng(myLat,myLng));updateMarkerPositionOSM(baseMarker.getLatLng());geocodePositionOSM(baseMarker.getLatLng())}}}else{}}}}function gdGeoLocateMeError(err){var msg;switch(err.code){case err.UNKNOWN_ERROR:msg=geodir_all_js_msg.geoErrUNKNOWN_ERROR;break;case err.PERMISSION_DENINED:msg=geodir_all_js_msg.geoErrPERMISSION_DENINED;break;case err.POSITION_UNAVAILABLE:msg=geodir_all_js_msg.geoErrPOSITION_UNAVAILABLE;break;case err.BREAK:msg=geodir_all_js_msg.geoErrBREAK;break;default:msg=geodir_all_js_msg.geoErrDEFAULT}alert(msg)}

/*!
 * jQuery UI Datepicker 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/datepicker/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./core"],a):a(jQuery)}(function(a){function b(a){for(var b,c;a.length&&a[0]!==document;){if(b=a.css("position"),("absolute"===b||"relative"===b||"fixed"===b)&&(c=parseInt(a.css("zIndex"),10),!isNaN(c)&&0!==c))return c;a=a.parent()}return 0}function c(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},a.extend(this._defaults,this.regional[""]),this.regional.en=a.extend(!0,{},this.regional[""]),this.regional["en-US"]=a.extend(!0,{},this.regional.en),this.dpDiv=d(a("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function d(b){var c="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return b.delegate(c,"mouseout",function(){a(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&a(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&a(this).removeClass("ui-datepicker-next-hover")}).delegate(c,"mouseover",e)}function e(){a.datepicker._isDisabledDatepicker(g.inline?g.dpDiv.parent()[0]:g.input[0])||(a(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),a(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&a(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&a(this).addClass("ui-datepicker-next-hover"))}function f(b,c){a.extend(b,c);for(var d in c)null==c[d]&&(b[d]=c[d]);return b}a.extend(a.ui,{datepicker:{version:"1.11.4"}});var g;return a.extend(c.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return f(this._defaults,a||{}),this},_attachDatepicker:function(b,c){var d,e,f;d=b.nodeName.toLowerCase(),e="div"===d||"span"===d,b.id||(this.uuid+=1,b.id="dp"+this.uuid),f=this._newInst(a(b),e),f.settings=a.extend({},c||{}),"input"===d?this._connectDatepicker(b,f):e&&this._inlineDatepicker(b,f)},_newInst:function(b,c){var e=b[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:e,input:b,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:c,dpDiv:c?d(a("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(b,c){var d=a(b);c.append=a([]),c.trigger=a([]),d.hasClass(this.markerClassName)||(this._attachments(d,c),d.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(c),a.data(b,"datepicker",c),c.settings.disabled&&this._disableDatepicker(b))},_attachments:function(b,c){var d,e,f,g=this._get(c,"appendText"),h=this._get(c,"isRTL");c.append&&c.append.remove(),g&&(c.append=a("<span class='"+this._appendClass+"'>"+g+"</span>"),b[h?"before":"after"](c.append)),b.unbind("focus",this._showDatepicker),c.trigger&&c.trigger.remove(),d=this._get(c,"showOn"),"focus"!==d&&"both"!==d||b.focus(this._showDatepicker),"button"!==d&&"both"!==d||(e=this._get(c,"buttonText"),f=this._get(c,"buttonImage"),c.trigger=a(this._get(c,"buttonImageOnly")?a("<img/>").addClass(this._triggerClass).attr({src:f,alt:e,title:e}):a("<button type='button'></button>").addClass(this._triggerClass).html(f?a("<img/>").attr({src:f,alt:e,title:e}):e)),b[h?"before":"after"](c.trigger),c.trigger.click(function(){return a.datepicker._datepickerShowing&&a.datepicker._lastInput===b[0]?a.datepicker._hideDatepicker():a.datepicker._datepickerShowing&&a.datepicker._lastInput!==b[0]?(a.datepicker._hideDatepicker(),a.datepicker._showDatepicker(b[0])):a.datepicker._showDatepicker(b[0]),!1}))},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b,c,d,e,f=new Date(2009,11,20),g=this._get(a,"dateFormat");g.match(/[DM]/)&&(b=function(a){for(c=0,d=0,e=0;e<a.length;e++)a[e].length>c&&(c=a[e].length,d=e);return d},f.setMonth(b(this._get(a,g.match(/MM/)?"monthNames":"monthNamesShort"))),f.setDate(b(this._get(a,g.match(/DD/)?"dayNames":"dayNamesShort"))+20-f.getDay())),a.input.attr("size",this._formatDate(a,f).length)}},_inlineDatepicker:function(b,c){var d=a(b);d.hasClass(this.markerClassName)||(d.addClass(this.markerClassName).append(c.dpDiv),a.data(b,"datepicker",c),this._setDate(c,this._getDefaultDate(c),!0),this._updateDatepicker(c),this._updateAlternate(c),c.settings.disabled&&this._disableDatepicker(b),c.dpDiv.css("display","block"))},_dialogDatepicker:function(b,c,d,e,g){var h,i,j,k,l,m=this._dialogInst;return m||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=a("<input type='text' id='"+h+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),a("body").append(this._dialogInput),m=this._dialogInst=this._newInst(this._dialogInput,!1),m.settings={},a.data(this._dialogInput[0],"datepicker",m)),f(m.settings,e||{}),c=c&&c.constructor===Date?this._formatDate(m,c):c,this._dialogInput.val(c),this._pos=g?g.length?g:[g.pageX,g.pageY]:null,this._pos||(i=document.documentElement.clientWidth,j=document.documentElement.clientHeight,k=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[i/2-100+k,j/2-150+l]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),m.settings.onSelect=d,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),a.blockUI&&a.blockUI(this.dpDiv),a.data(this._dialogInput[0],"datepicker",m),this},_destroyDatepicker:function(b){var c,d=a(b),e=a.data(b,"datepicker");d.hasClass(this.markerClassName)&&(c=b.nodeName.toLowerCase(),a.removeData(b,"datepicker"),"input"===c?(e.append.remove(),e.trigger.remove(),d.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!==c&&"span"!==c||d.removeClass(this.markerClassName).empty(),g===e&&(g=null))},_enableDatepicker:function(b){var c,d,e=a(b),f=a.data(b,"datepicker");e.hasClass(this.markerClassName)&&(c=b.nodeName.toLowerCase(),"input"===c?(b.disabled=!1,f.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==c&&"span"!==c||(d=e.children("."+this._inlineClass),d.children().removeClass("ui-state-disabled"),d.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=a.map(this._disabledInputs,function(a){return a===b?null:a}))},_disableDatepicker:function(b){var c,d,e=a(b),f=a.data(b,"datepicker");e.hasClass(this.markerClassName)&&(c=b.nodeName.toLowerCase(),"input"===c?(b.disabled=!0,f.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==c&&"span"!==c||(d=e.children("."+this._inlineClass),d.children().addClass("ui-state-disabled"),d.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=a.map(this._disabledInputs,function(a){return a===b?null:a}),this._disabledInputs[this._disabledInputs.length]=b)},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]===a)return!0;return!1},_getInst:function(b){try{return a.data(b,"datepicker")}catch(c){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(b,c,d){var e,g,h,i,j=this._getInst(b);return 2===arguments.length&&"string"==typeof c?"defaults"===c?a.extend({},a.datepicker._defaults):j?"all"===c?a.extend({},j.settings):this._get(j,c):null:(e=c||{},"string"==typeof c&&(e={},e[c]=d),void(j&&(this._curInst===j&&this._hideDatepicker(),g=this._getDateDatepicker(b,!0),h=this._getMinMaxDate(j,"min"),i=this._getMinMaxDate(j,"max"),f(j.settings,e),null!==h&&void 0!==e.dateFormat&&void 0===e.minDate&&(j.settings.minDate=this._formatDate(j,h)),null!==i&&void 0!==e.dateFormat&&void 0===e.maxDate&&(j.settings.maxDate=this._formatDate(j,i)),"disabled"in e&&(e.disabled?this._disableDatepicker(b):this._enableDatepicker(b)),this._attachments(a(b),j),this._autoSize(j),this._setDate(j,g),this._updateAlternate(j),this._updateDatepicker(j))))},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);return c&&!c.inline&&this._setDateFromField(c,b),c?this._getDate(c):null},_doKeyDown:function(b){var c,d,e,f=a.datepicker._getInst(b.target),g=!0,h=f.dpDiv.is(".ui-datepicker-rtl");if(f._keyEvent=!0,a.datepicker._datepickerShowing)switch(b.keyCode){case 9:a.datepicker._hideDatepicker(),g=!1;break;case 13:return e=a("td."+a.datepicker._dayOverClass+":not(."+a.datepicker._currentClass+")",f.dpDiv),e[0]&&a.datepicker._selectDay(b.target,f.selectedMonth,f.selectedYear,e[0]),c=a.datepicker._get(f,"onSelect"),c?(d=a.datepicker._formatDate(f),c.apply(f.input?f.input[0]:null,[d,f])):a.datepicker._hideDatepicker(),!1;case 27:a.datepicker._hideDatepicker();break;case 33:a.datepicker._adjustDate(b.target,b.ctrlKey?-a.datepicker._get(f,"stepBigMonths"):-a.datepicker._get(f,"stepMonths"),"M");break;case 34:a.datepicker._adjustDate(b.target,b.ctrlKey?+a.datepicker._get(f,"stepBigMonths"):+a.datepicker._get(f,"stepMonths"),"M");break;case 35:(b.ctrlKey||b.metaKey)&&a.datepicker._clearDate(b.target),g=b.ctrlKey||b.metaKey;break;case 36:(b.ctrlKey||b.metaKey)&&a.datepicker._gotoToday(b.target),g=b.ctrlKey||b.metaKey;break;case 37:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,h?1:-1,"D"),g=b.ctrlKey||b.metaKey,b.originalEvent.altKey&&a.datepicker._adjustDate(b.target,b.ctrlKey?-a.datepicker._get(f,"stepBigMonths"):-a.datepicker._get(f,"stepMonths"),"M");break;case 38:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,-7,"D"),g=b.ctrlKey||b.metaKey;break;case 39:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,h?-1:1,"D"),g=b.ctrlKey||b.metaKey,b.originalEvent.altKey&&a.datepicker._adjustDate(b.target,b.ctrlKey?+a.datepicker._get(f,"stepBigMonths"):+a.datepicker._get(f,"stepMonths"),"M");break;case 40:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,7,"D"),g=b.ctrlKey||b.metaKey;break;default:g=!1}else 36===b.keyCode&&b.ctrlKey?a.datepicker._showDatepicker(this):g=!1;g&&(b.preventDefault(),b.stopPropagation())},_doKeyPress:function(b){var c,d,e=a.datepicker._getInst(b.target);if(a.datepicker._get(e,"constrainInput"))return c=a.datepicker._possibleChars(a.datepicker._get(e,"dateFormat")),d=String.fromCharCode(null==b.charCode?b.keyCode:b.charCode),b.ctrlKey||b.metaKey||d<" "||!c||c.indexOf(d)>-1},_doKeyUp:function(b){var c,d=a.datepicker._getInst(b.target);if(d.input.val()!==d.lastVal)try{c=a.datepicker.parseDate(a.datepicker._get(d,"dateFormat"),d.input?d.input.val():null,a.datepicker._getFormatConfig(d)),c&&(a.datepicker._setDateFromField(d),a.datepicker._updateAlternate(d),a.datepicker._updateDatepicker(d))}catch(e){}return!0},_showDatepicker:function(c){if(c=c.target||c,"input"!==c.nodeName.toLowerCase()&&(c=a("input",c.parentNode)[0]),!a.datepicker._isDisabledDatepicker(c)&&a.datepicker._lastInput!==c){var d,e,g,h,i,j,k;d=a.datepicker._getInst(c),a.datepicker._curInst&&a.datepicker._curInst!==d&&(a.datepicker._curInst.dpDiv.stop(!0,!0),d&&a.datepicker._datepickerShowing&&a.datepicker._hideDatepicker(a.datepicker._curInst.input[0])),e=a.datepicker._get(d,"beforeShow"),g=e?e.apply(c,[c,d]):{},g!==!1&&(f(d.settings,g),d.lastVal=null,a.datepicker._lastInput=c,a.datepicker._setDateFromField(d),a.datepicker._inDialog&&(c.value=""),a.datepicker._pos||(a.datepicker._pos=a.datepicker._findPos(c),a.datepicker._pos[1]+=c.offsetHeight),h=!1,a(c).parents().each(function(){return h|="fixed"===a(this).css("position"),!h}),i={left:a.datepicker._pos[0],top:a.datepicker._pos[1]},a.datepicker._pos=null,d.dpDiv.empty(),d.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),a.datepicker._updateDatepicker(d),i=a.datepicker._checkOffset(d,i,h),d.dpDiv.css({position:a.datepicker._inDialog&&a.blockUI?"static":h?"fixed":"absolute",display:"none",left:i.left+"px",top:i.top+"px"}),d.inline||(j=a.datepicker._get(d,"showAnim"),k=a.datepicker._get(d,"duration"),d.dpDiv.css("z-index",b(a(c))+1),a.datepicker._datepickerShowing=!0,a.effects&&a.effects.effect[j]?d.dpDiv.show(j,a.datepicker._get(d,"showOptions"),k):d.dpDiv[j||"show"](j?k:null),a.datepicker._shouldFocusInput(d)&&d.input.focus(),a.datepicker._curInst=d))}},_updateDatepicker:function(b){this.maxRows=4,g=b,b.dpDiv.empty().append(this._generateHTML(b)),this._attachHandlers(b);var c,d=this._getNumberOfMonths(b),f=d[1],h=17,i=b.dpDiv.find("."+this._dayOverClass+" a");i.length>0&&e.apply(i.get(0)),b.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&b.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",h*f+"em"),b.dpDiv[(1!==d[0]||1!==d[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),b.dpDiv[(this._get(b,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),b===a.datepicker._curInst&&a.datepicker._datepickerShowing&&a.datepicker._shouldFocusInput(b)&&b.input.focus(),b.yearshtml&&(c=b.yearshtml,setTimeout(function(){c===b.yearshtml&&b.yearshtml&&b.dpDiv.find("select.ui-datepicker-year:first").replaceWith(b.yearshtml),c=b.yearshtml=null},0))},_shouldFocusInput:function(a){return a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&!a.input.is(":focus")},_checkOffset:function(b,c,d){var e=b.dpDiv.outerWidth(),f=b.dpDiv.outerHeight(),g=b.input?b.input.outerWidth():0,h=b.input?b.input.outerHeight():0,i=document.documentElement.clientWidth+(d?0:a(document).scrollLeft()),j=document.documentElement.clientHeight+(d?0:a(document).scrollTop());return c.left-=this._get(b,"isRTL")?e-g:0,c.left-=d&&c.left===b.input.offset().left?a(document).scrollLeft():0,c.top-=d&&c.top===b.input.offset().top+h?a(document).scrollTop():0,c.left-=Math.min(c.left,c.left+e>i&&i>e?Math.abs(c.left+e-i):0),c.top-=Math.min(c.top,c.top+f>j&&j>f?Math.abs(f+h):0),c},_findPos:function(b){for(var c,d=this._getInst(b),e=this._get(d,"isRTL");b&&("hidden"===b.type||1!==b.nodeType||a.expr.filters.hidden(b));)b=b[e?"previousSibling":"nextSibling"];return c=a(b).offset(),[c.left,c.top]},_hideDatepicker:function(b){var c,d,e,f,g=this._curInst;!g||b&&g!==a.data(b,"datepicker")||this._datepickerShowing&&(c=this._get(g,"showAnim"),d=this._get(g,"duration"),e=function(){a.datepicker._tidyDialog(g)},a.effects&&(a.effects.effect[c]||a.effects[c])?g.dpDiv.hide(c,a.datepicker._get(g,"showOptions"),d,e):g.dpDiv["slideDown"===c?"slideUp":"fadeIn"===c?"fadeOut":"hide"](c?d:null,e),c||e(),this._datepickerShowing=!1,f=this._get(g,"onClose"),f&&f.apply(g.input?g.input[0]:null,[g.input?g.input.val():"",g]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),a.blockUI&&(a.unblockUI(),a("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(b){if(a.datepicker._curInst){var c=a(b.target),d=a.datepicker._getInst(c[0]);(c[0].id===a.datepicker._mainDivId||0!==c.parents("#"+a.datepicker._mainDivId).length||c.hasClass(a.datepicker.markerClassName)||c.closest("."+a.datepicker._triggerClass).length||!a.datepicker._datepickerShowing||a.datepicker._inDialog&&a.blockUI)&&(!c.hasClass(a.datepicker.markerClassName)||a.datepicker._curInst===d)||a.datepicker._hideDatepicker()}},_adjustDate:function(b,c,d){var e=a(b),f=this._getInst(e[0]);this._isDisabledDatepicker(e[0])||(this._adjustInstDate(f,c+("M"===d?this._get(f,"showCurrentAtPos"):0),d),this._updateDatepicker(f))},_gotoToday:function(b){var c,d=a(b),e=this._getInst(d[0]);this._get(e,"gotoCurrent")&&e.currentDay?(e.selectedDay=e.currentDay,e.drawMonth=e.selectedMonth=e.currentMonth,e.drawYear=e.selectedYear=e.currentYear):(c=new Date,e.selectedDay=c.getDate(),e.drawMonth=e.selectedMonth=c.getMonth(),e.drawYear=e.selectedYear=c.getFullYear()),this._notifyChange(e),this._adjustDate(d)},_selectMonthYear:function(b,c,d){var e=a(b),f=this._getInst(e[0]);f["selected"+("M"===d?"Month":"Year")]=f["draw"+("M"===d?"Month":"Year")]=parseInt(c.options[c.selectedIndex].value,10),this._notifyChange(f),this._adjustDate(e)},_selectDay:function(b,c,d,e){var f,g=a(b);a(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(g[0])||(f=this._getInst(g[0]),f.selectedDay=f.currentDay=a("a",e).html(),f.selectedMonth=f.currentMonth=c,f.selectedYear=f.currentYear=d,this._selectDate(b,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear)))},_clearDate:function(b){var c=a(b);this._selectDate(c,"")},_selectDate:function(b,c){var d,e=a(b),f=this._getInst(e[0]);c=null!=c?c:this._formatDate(f),f.input&&f.input.val(c),this._updateAlternate(f),d=this._get(f,"onSelect"),d?d.apply(f.input?f.input[0]:null,[c,f]):f.input&&f.input.trigger("change"),f.inline?this._updateDatepicker(f):(this._hideDatepicker(),this._lastInput=f.input[0],"object"!=typeof f.input[0]&&f.input.focus(),this._lastInput=null)},_updateAlternate:function(b){var c,d,e,f=this._get(b,"altField");f&&(c=this._get(b,"altFormat")||this._get(b,"dateFormat"),d=this._getDate(b),e=this.formatDate(c,d,this._getFormatConfig(b)),a(f).each(function(){a(this).val(e)}))},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b,c=new Date(a.getTime());return c.setDate(c.getDate()+4-(c.getDay()||7)),b=c.getTime(),c.setMonth(0),c.setDate(1),Math.floor(Math.round((b-c)/864e5)/7)+1},parseDate:function(b,c,d){if(null==b||null==c)throw"Invalid arguments";if(c="object"==typeof c?c.toString():c+"",""===c)return null;var e,f,g,h,i=0,j=(d?d.shortYearCutoff:null)||this._defaults.shortYearCutoff,k="string"!=typeof j?j:(new Date).getFullYear()%100+parseInt(j,10),l=(d?d.dayNamesShort:null)||this._defaults.dayNamesShort,m=(d?d.dayNames:null)||this._defaults.dayNames,n=(d?d.monthNamesShort:null)||this._defaults.monthNamesShort,o=(d?d.monthNames:null)||this._defaults.monthNames,p=-1,q=-1,r=-1,s=-1,t=!1,u=function(a){var c=e+1<b.length&&b.charAt(e+1)===a;return c&&e++,c},v=function(a){var b=u(a),d="@"===a?14:"!"===a?20:"y"===a&&b?4:"o"===a?3:2,e="y"===a?d:1,f=new RegExp("^\\d{"+e+","+d+"}"),g=c.substring(i).match(f);if(!g)throw"Missing number at position "+i;return i+=g[0].length,parseInt(g[0],10)},w=function(b,d,e){var f=-1,g=a.map(u(b)?e:d,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)});if(a.each(g,function(a,b){var d=b[1];if(c.substr(i,d.length).toLowerCase()===d.toLowerCase())return f=b[0],i+=d.length,!1}),f!==-1)return f+1;throw"Unknown name at position "+i},x=function(){if(c.charAt(i)!==b.charAt(e))throw"Unexpected literal at position "+i;i++};for(e=0;e<b.length;e++)if(t)"'"!==b.charAt(e)||u("'")?x():t=!1;else switch(b.charAt(e)){case"d":r=v("d");break;case"D":w("D",l,m);break;case"o":s=v("o");break;case"m":q=v("m");break;case"M":q=w("M",n,o);break;case"y":p=v("y");break;case"@":h=new Date(v("@")),p=h.getFullYear(),q=h.getMonth()+1,r=h.getDate();break;case"!":h=new Date((v("!")-this._ticksTo1970)/1e4),p=h.getFullYear(),q=h.getMonth()+1,r=h.getDate();break;case"'":u("'")?x():t=!0;break;default:x()}if(i<c.length&&(g=c.substr(i),!/^\s+/.test(g)))throw"Extra/unparsed characters found in date: "+g;if(p===-1?p=(new Date).getFullYear():p<100&&(p+=(new Date).getFullYear()-(new Date).getFullYear()%100+(p<=k?0:-100)),s>-1)for(q=1,r=s;;){if(f=this._getDaysInMonth(p,q-1),r<=f)break;q++,r-=f}if(h=this._daylightSavingAdjust(new Date(p,q-1,r)),h.getFullYear()!==p||h.getMonth()+1!==q||h.getDate()!==r)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d,e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=function(b){var c=d+1<a.length&&a.charAt(d+1)===b;return c&&d++,c},j=function(a,b,c){var d=""+b;if(i(a))for(;d.length<c;)d="0"+d;return d},k=function(a,b,c,d){return i(a)?d[b]:c[b]},l="",m=!1;if(b)for(d=0;d<a.length;d++)if(m)"'"!==a.charAt(d)||i("'")?l+=a.charAt(d):m=!1;else switch(a.charAt(d)){case"d":l+=j("d",b.getDate(),2);break;case"D":l+=k("D",b.getDay(),e,f);break;case"o":l+=j("o",Math.round((new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime()-new Date(b.getFullYear(),0,0).getTime())/864e5),3);break;case"m":l+=j("m",b.getMonth()+1,2);break;case"M":l+=k("M",b.getMonth(),g,h);break;case"y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":l+=b.getTime();break;case"!":l+=1e4*b.getTime()+this._ticksTo1970;break;case"'":i("'")?l+="'":m=!0;break;default:l+=a.charAt(d)}return l},_possibleChars:function(a){var b,c="",d=!1,e=function(c){var d=b+1<a.length&&a.charAt(b+1)===c;return d&&b++,d};for(b=0;b<a.length;b++)if(d)"'"!==a.charAt(b)||e("'")?c+=a.charAt(b):d=!1;else switch(a.charAt(b)){case"d":case"m":case"y":case"@":c+="0123456789";break;case"D":case"M":return null;case"'":e("'")?c+="'":d=!0;break;default:c+=a.charAt(b)}return c},_get:function(a,b){return void 0!==a.settings[b]?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!==a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e=this._getDefaultDate(a),f=e,g=this._getFormatConfig(a);try{f=this.parseDate(c,d,g)||e}catch(h){d=b?"":d}a.selectedDay=f.getDate(),a.drawMonth=a.selectedMonth=f.getMonth(),a.drawYear=a.selectedYear=f.getFullYear(),a.currentDay=d?f.getDate():0,a.currentMonth=d?f.getMonth():0,a.currentYear=d?f.getFullYear():0,this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(b,c,d){var e=function(a){var b=new Date;return b.setDate(b.getDate()+a),b},f=function(c){try{return a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),c,a.datepicker._getFormatConfig(b))}catch(d){}for(var e=(c.toLowerCase().match(/^c/)?a.datepicker._getDate(b):null)||new Date,f=e.getFullYear(),g=e.getMonth(),h=e.getDate(),i=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,j=i.exec(c);j;){switch(j[2]||"d"){case"d":case"D":h+=parseInt(j[1],10);break;case"w":case"W":h+=7*parseInt(j[1],10);break;case"m":case"M":g+=parseInt(j[1],10),h=Math.min(h,a.datepicker._getDaysInMonth(f,g));break;case"y":case"Y":f+=parseInt(j[1],10),h=Math.min(h,a.datepicker._getDaysInMonth(f,g))}j=i.exec(c)}return new Date(f,g,h)},g=null==c||""===c?d:"string"==typeof c?f(c):"number"==typeof c?isNaN(c)?d:e(c):new Date(c.getTime());return g=g&&"Invalid Date"===g.toString()?d:g,g&&(g.setHours(0),g.setMinutes(0),g.setSeconds(0),g.setMilliseconds(0)),this._daylightSavingAdjust(g)},_daylightSavingAdjust:function(a){return a?(a.setHours(a.getHours()>12?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),e===a.selectedMonth&&f===a.selectedYear||c||this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&""===a.input.val()?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_attachHandlers:function(b){var c=this._get(b,"stepMonths"),d="#"+b.id.replace(/\\\\/g,"\\");b.dpDiv.find("[data-handler]").map(function(){var b={prev:function(){a.datepicker._adjustDate(d,-c,"M")},next:function(){a.datepicker._adjustDate(d,+c,"M")},hide:function(){a.datepicker._hideDatepicker()},today:function(){a.datepicker._gotoToday(d)},selectDay:function(){return a.datepicker._selectDay(d,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return a.datepicker._selectMonthYear(d,this,"M"),!1},selectYear:function(){return a.datepicker._selectMonthYear(d,this,"Y"),!1}};a(this).bind(this.getAttribute("data-event"),b[this.getAttribute("data-handler")])})},_generateHTML:function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O=new Date,P=this._daylightSavingAdjust(new Date(O.getFullYear(),O.getMonth(),O.getDate())),Q=this._get(a,"isRTL"),R=this._get(a,"showButtonPanel"),S=this._get(a,"hideIfNoPrevNext"),T=this._get(a,"navigationAsDateFormat"),U=this._getNumberOfMonths(a),V=this._get(a,"showCurrentAtPos"),W=this._get(a,"stepMonths"),X=1!==U[0]||1!==U[1],Y=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),Z=this._getMinMaxDate(a,"min"),$=this._getMinMaxDate(a,"max"),_=a.drawMonth-V,aa=a.drawYear;if(_<0&&(_+=12,aa--),$)for(b=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-U[0]*U[1]+1,$.getDate())),b=Z&&b<Z?Z:b;this._daylightSavingAdjust(new Date(aa,_,1))>b;)_--,_<0&&(_=11,aa--);for(a.drawMonth=_,a.drawYear=aa,c=this._get(a,"prevText"),c=T?this.formatDate(c,this._daylightSavingAdjust(new Date(aa,_-W,1)),this._getFormatConfig(a)):c,d=this._canAdjustMonth(a,-1,aa,_)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+c+"'><span class='ui-icon ui-icon-circle-triangle-"+(Q?"e":"w")+"'>"+c+"</span></a>":S?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+c+"'><span class='ui-icon ui-icon-circle-triangle-"+(Q?"e":"w")+"'>"+c+"</span></a>",e=this._get(a,"nextText"),e=T?this.formatDate(e,this._daylightSavingAdjust(new Date(aa,_+W,1)),this._getFormatConfig(a)):e,f=this._canAdjustMonth(a,1,aa,_)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+e+"'><span class='ui-icon ui-icon-circle-triangle-"+(Q?"w":"e")+"'>"+e+"</span></a>":S?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+e+"'><span class='ui-icon ui-icon-circle-triangle-"+(Q?"w":"e")+"'>"+e+"</span></a>",g=this._get(a,"currentText"),h=this._get(a,"gotoCurrent")&&a.currentDay?Y:P,g=T?this.formatDate(g,h,this._getFormatConfig(a)):g,i=a.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(a,"closeText")+"</button>",j=R?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Q?i:"")+(this._isInRange(a,h)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+g+"</button>":"")+(Q?"":i)+"</div>":"",k=parseInt(this._get(a,"firstDay"),10),k=isNaN(k)?0:k,l=this._get(a,"showWeek"),m=this._get(a,"dayNames"),n=this._get(a,"dayNamesMin"),o=this._get(a,"monthNames"),p=this._get(a,"monthNamesShort"),q=this._get(a,"beforeShowDay"),r=this._get(a,"showOtherMonths"),s=this._get(a,"selectOtherMonths"),t=this._getDefaultDate(a),u="",w=0;w<U[0];w++){for(x="",this.maxRows=4,y=0;y<U[1];y++){if(z=this._daylightSavingAdjust(new Date(aa,_,a.selectedDay)),A=" ui-corner-all",B="",X){if(B+="<div class='ui-datepicker-group",U[1]>1)switch(y){case 0:B+=" ui-datepicker-group-first",A=" ui-corner-"+(Q?"right":"left");break;case U[1]-1:B+=" ui-datepicker-group-last",A=" ui-corner-"+(Q?"left":"right");break;default:B+=" ui-datepicker-group-middle",A=""}B+="'>"}for(B+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+A+"'>"+(/all|left/.test(A)&&0===w?Q?f:d:"")+(/all|right/.test(A)&&0===w?Q?d:f:"")+this._generateMonthYearHeader(a,_,aa,Z,$,w>0||y>0,o,p)+"</div><table class='ui-datepicker-calendar'><thead><tr>",C=l?"<th class='ui-datepicker-week-col'>"+this._get(a,"weekHeader")+"</th>":"",v=0;v<7;v++)D=(v+k)%7,C+="<th scope='col'"+((v+k+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+m[D]+"'>"+n[D]+"</span></th>";for(B+=C+"</tr></thead><tbody>",E=this._getDaysInMonth(aa,_),aa===a.selectedYear&&_===a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,E)),F=(this._getFirstDayOfMonth(aa,_)-k+7)%7,G=Math.ceil((F+E)/7),H=X&&this.maxRows>G?this.maxRows:G,this.maxRows=H,I=this._daylightSavingAdjust(new Date(aa,_,1-F)),J=0;J<H;J++){for(B+="<tr>",K=l?"<td class='ui-datepicker-week-col'>"+this._get(a,"calculateWeek")(I)+"</td>":"",v=0;v<7;v++)L=q?q.apply(a.input?a.input[0]:null,[I]):[!0,""],M=I.getMonth()!==_,N=M&&!s||!L[0]||Z&&I<Z||$&&I>$,K+="<td class='"+((v+k+6)%7>=5?" ui-datepicker-week-end":"")+(M?" ui-datepicker-other-month":"")+(I.getTime()===z.getTime()&&_===a.selectedMonth&&a._keyEvent||t.getTime()===I.getTime()&&t.getTime()===z.getTime()?" "+this._dayOverClass:"")+(N?" "+this._unselectableClass+" ui-state-disabled":"")+(M&&!r?"":" "+L[1]+(I.getTime()===Y.getTime()?" "+this._currentClass:"")+(I.getTime()===P.getTime()?" ui-datepicker-today":""))+"'"+(M&&!r||!L[2]?"":" title='"+L[2].replace(/'/g,"&#39;")+"'")+(N?"":" data-handler='selectDay' data-event='click' data-month='"+I.getMonth()+"' data-year='"+I.getFullYear()+"'")+">"+(M&&!r?"&#xa0;":N?"<span class='ui-state-default'>"+I.getDate()+"</span>":"<a class='ui-state-default"+(I.getTime()===P.getTime()?" ui-state-highlight":"")+(I.getTime()===Y.getTime()?" ui-state-active":"")+(M?" ui-priority-secondary":"")+"' href='#'>"+I.getDate()+"</a>")+"</td>",I.setDate(I.getDate()+1),I=this._daylightSavingAdjust(I);B+=K+"</tr>"}_++,_>11&&(_=0,aa++),B+="</tbody></table>"+(X?"</div>"+(U[0]>0&&y===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=B}u+=x}return u+=j,a._keyEvent=!1,u},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q=this._get(a,"changeMonth"),r=this._get(a,"changeYear"),s=this._get(a,"showMonthAfterYear"),t="<div class='ui-datepicker-title'>",u="";if(f||!q)u+="<span class='ui-datepicker-month'>"+g[b]+"</span>";else{
for(i=d&&d.getFullYear()===c,j=e&&e.getFullYear()===c,u+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",k=0;k<12;k++)(!i||k>=d.getMonth())&&(!j||k<=e.getMonth())&&(u+="<option value='"+k+"'"+(k===b?" selected='selected'":"")+">"+h[k]+"</option>");u+="</select>"}if(s||(t+=u+(!f&&q&&r?"":"&#xa0;")),!a.yearshtml)if(a.yearshtml="",f||!r)t+="<span class='ui-datepicker-year'>"+c+"</span>";else{for(l=this._get(a,"yearRange").split(":"),m=(new Date).getFullYear(),n=function(a){var b=a.match(/c[+\-].*/)?c+parseInt(a.substring(1),10):a.match(/[+\-].*/)?m+parseInt(a,10):parseInt(a,10);return isNaN(b)?m:b},o=n(l[0]),p=Math.max(o,n(l[1]||"")),o=d?Math.max(o,d.getFullYear()):o,p=e?Math.min(p,e.getFullYear()):p,a.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";o<=p;o++)a.yearshtml+="<option value='"+o+"'"+(o===c?" selected='selected'":"")+">"+o+"</option>";a.yearshtml+="</select>",t+=a.yearshtml,a.yearshtml=null}return t+=this._get(a,"yearSuffix"),s&&(t+=(!f&&q&&r?"":"&#xa0;")+u),t+="</div>"},_adjustInstDate:function(a,b,c){var d=a.drawYear+("Y"===c?b:0),e=a.drawMonth+("M"===c?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+("D"===c?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),"M"!==c&&"Y"!==c||this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;return d&&e>d?d:e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return null==b?[1,1]:"number"==typeof b?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return new Date(a,b,1).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c,d,e=this._getMinMaxDate(a,"min"),f=this._getMinMaxDate(a,"max"),g=null,h=null,i=this._get(a,"yearRange");return i&&(c=i.split(":"),d=(new Date).getFullYear(),g=parseInt(c[0],10),h=parseInt(c[1],10),c[0].match(/[+\-].*/)&&(g+=d),c[1].match(/[+\-].*/)&&(h+=d)),(!e||b.getTime()>=e.getTime())&&(!f||b.getTime()<=f.getTime())&&(!g||b.getFullYear()>=g)&&(!h||b.getFullYear()<=h)},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");return b="string"!=typeof b?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?"object"==typeof b?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),a.fn.datepicker=function(b){if(!this.length)return this;a.datepicker.initialized||(a(document).mousedown(a.datepicker._checkExternalClick),a.datepicker.initialized=!0),0===a("#"+a.datepicker._mainDivId).length&&a("body").append(a.datepicker.dpDiv);var c=Array.prototype.slice.call(arguments,1);return"string"!=typeof b||"isDisabled"!==b&&"getDate"!==b&&"widget"!==b?"option"===b&&2===arguments.length&&"string"==typeof arguments[1]?a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(c)):this.each(function(){"string"==typeof b?a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this].concat(c)):a.datepicker._attachDatepicker(this,b)}):a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(c))},a.datepicker=new c,a.datepicker.initialized=!1,a.datepicker.uuid=(new Date).getTime(),a.datepicker.version="1.11.4",a.datepicker});

jQuery(document).ready(function(jQuery){jQuery.datepicker.setDefaults({"closeText":"Close","currentText":"Today","monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"nextText":"Next","prevText":"Previous","dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"dateFormat":"MM d, yy","firstDay":1,"isRTL":false});});

/*!
 * jQuery UI Mouse 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/mouse/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./widget"],a):a(jQuery)}(function(a){var b=!1;return a(document).mouseup(function(){b=!1}),a.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(c){if(!b){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(c),this._mouseDownEvent=c;var d=this,e=1===c.which,f=!("string"!=typeof this.options.cancel||!c.target.nodeName)&&a(c.target).closest(this.options.cancel).length;return!(e&&!f&&this._mouseCapture(c))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(c)&&this._mouseDelayMet(c)&&(this._mouseStarted=this._mouseStart(c)!==!1,!this._mouseStarted)?(c.preventDefault(),!0):(!0===a.data(c.target,this.widgetName+".preventClickEvent")&&a.removeData(c.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),c.preventDefault(),b=!0,!0))}},_mouseMove:function(b){if(this._mouseMoved){if(a.ui.ie&&(!document.documentMode||document.documentMode<9)&&!b.button)return this._mouseUp(b);if(!b.which)return this._mouseUp(b)}return(b.which||b.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted)},_mouseUp:function(c){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,c.target===this._mouseDownEvent.target&&a.data(c.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(c)),b=!1,!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})});

/*!
 * jQuery UI Slider 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/slider/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],a):a(jQuery)}(function(a){return a.widget("ui.slider",a.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var b,c,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",g=[];for(c=d.values&&d.values.length||1,e.length>c&&(e.slice(c).remove(),e=e.slice(0,c)),b=e.length;b<c;b++)g.push(f);this.handles=e.add(a(g.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(b){a(this).data("ui-slider-handle-index",b)})},_createRange:function(){var b=this.options,c="";b.range?(b.range===!0&&(b.values?b.values.length&&2!==b.values.length?b.values=[b.values[0],b.values[0]]:a.isArray(b.values)&&(b.values=b.values.slice(0)):b.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=a("<div></div>").appendTo(this.element),c="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(c+("min"===b.range||"max"===b.range?" ui-slider-range-"+b.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(b){var c,d,e,f,g,h,i,j,k=this,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),c={x:b.pageX,y:b.pageY},d=this._normValueFromMouse(c),e=this._valueMax()-this._valueMin()+1,this.handles.each(function(b){var c=Math.abs(d-k.values(b));(e>c||e===c&&(b===k._lastChangedValue||k.values(b)===l.min))&&(e=c,f=a(this),g=b)}),h=this._start(b,g),h!==!1&&(this._mouseSliding=!0,this._handleIndex=g,f.addClass("ui-state-active").focus(),i=f.offset(),j=!a(b.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=j?{left:0,top:0}:{left:b.pageX-i.left-f.width()/2,top:b.pageY-i.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,g,d),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return"horizontal"===this.orientation?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),"vertical"===this.orientation&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),2===this.options.values.length&&this.options.range===!0&&(0===b&&c>d||1===b&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._lastChangedValue=b,this._trigger("change",a,c)}},value:function(a){return arguments.length?(this.options.value=this._trimAlignValue(a),this._refreshValue(),void this._change(null,0)):this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)return this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),void this._change(null,b);if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();for(d=this.options.values,e=arguments[0],f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()},_setOption:function(b,c){var d,e=0;switch("range"===b&&this.options.range===!0&&("min"===c?(this.options.value=this._values(0),this.options.values=null):"max"===c&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),a.isArray(this.options.values)&&(e=this.options.values.length),"disabled"===b&&this.element.toggleClass("ui-state-disabled",!!c),this._super(b,c),b){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===c?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c,d;if(arguments.length)return b=this.options.values[a],b=this._trimAlignValue(b);if(this.options.values&&this.options.values.length){for(c=this.options.values.slice(),d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c}return[]},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;return 2*Math.abs(c)>=b&&(d+=c>0?b:-b),parseFloat(d.toFixed(5))},_calculateNewMax:function(){var a=this.options.max,b=this._valueMin(),c=this.options.step,d=Math.floor(+(a-b).toFixed(this._precision())/c)*c;a=d+b,this.max=parseFloat(a.toFixed(this._precision()))},_precision:function(){var a=this._precisionOf(this.options.step);return null!==this.options.min&&(a=Math.max(a,this._precisionOf(this.options.min))),a},_precisionOf:function(a){var b=a.toString(),c=b.indexOf(".");return c===-1?0:b.length-c-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var b,c,d,e,f,g=this.options.range,h=this.options,i=this,j=!this._animateOff&&h.animate,k={};this.options.values&&this.options.values.length?this.handles.each(function(d){c=(i.values(d)-i._valueMin())/(i._valueMax()-i._valueMin())*100,k["horizontal"===i.orientation?"left":"bottom"]=c+"%",a(this).stop(1,1)[j?"animate":"css"](k,h.animate),i.options.range===!0&&("horizontal"===i.orientation?(0===d&&i.range.stop(1,1)[j?"animate":"css"]({left:c+"%"},h.animate),1===d&&i.range[j?"animate":"css"]({width:c-b+"%"},{queue:!1,duration:h.animate})):(0===d&&i.range.stop(1,1)[j?"animate":"css"]({bottom:c+"%"},h.animate),1===d&&i.range[j?"animate":"css"]({height:c-b+"%"},{queue:!1,duration:h.animate}))),b=c}):(d=this.value(),e=this._valueMin(),f=this._valueMax(),c=f!==e?(d-e)/(f-e)*100:0,k["horizontal"===this.orientation?"left":"bottom"]=c+"%",this.handle.stop(1,1)[j?"animate":"css"](k,h.animate),"min"===g&&"horizontal"===this.orientation&&this.range.stop(1,1)[j?"animate":"css"]({width:c+"%"},h.animate),"max"===g&&"horizontal"===this.orientation&&this.range[j?"animate":"css"]({width:100-c+"%"},{queue:!1,duration:h.animate}),"min"===g&&"vertical"===this.orientation&&this.range.stop(1,1)[j?"animate":"css"]({height:c+"%"},h.animate),"max"===g&&"vertical"===this.orientation&&this.range[j?"animate":"css"]({height:100-c+"%"},{queue:!1,duration:h.animate}))},_handleEvents:{keydown:function(b){var c,d,e,f,g=a(b.target).data("ui-slider-handle-index");switch(b.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(b.preventDefault(),!this._keySliding&&(this._keySliding=!0,a(b.target).addClass("ui-state-active"),c=this._start(b,g),c===!1))return}switch(f=this.options.step,d=e=this.options.values&&this.options.values.length?this.values(g):this.value(),b.keyCode){case a.ui.keyCode.HOME:e=this._valueMin();break;case a.ui.keyCode.END:e=this._valueMax();break;case a.ui.keyCode.PAGE_UP:e=this._trimAlignValue(d+(this._valueMax()-this._valueMin())/this.numPages);break;case a.ui.keyCode.PAGE_DOWN:e=this._trimAlignValue(d-(this._valueMax()-this._valueMin())/this.numPages);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(d===this._valueMax())return;e=this._trimAlignValue(d+f);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(d===this._valueMin())return;e=this._trimAlignValue(d-f)}this._slide(b,g,e)},keyup:function(b){var c=a(b.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(b,c),this._change(b,c),a(b.target).removeClass("ui-state-active"))}}})});

/*!
 * jQuery UI Effects 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/category/effects-core/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){var b="ui-effects-",c=a;/*!
 * jQuery Color Animations v2.1.2
 * https://github.com/jquery/jquery-color
 *
 * Copyright 2014 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * Date: Wed Jan 16 08:47:09 2013 -0600
 */
return a.effects={effect:{}},function(a,b){function c(a,b,c){var d=l[b.type]||{};return null==a?c||!b.def?null:b.def:(a=d.floor?~~a:parseFloat(a),isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max<a?d.max:a)}function d(b){var c=j(),d=c._rgba=[];return b=b.toLowerCase(),o(i,function(a,e){var f,g=e.re.exec(b),h=g&&e.parse(g),i=e.space||"rgba";if(h)return f=c[i](h),c[k[i].cache]=f[k[i].cache],d=c._rgba=f._rgba,!1}),d.length?("0,0,0,0"===d.join()&&a.extend(d,f.transparent),c):f[b]}function e(a,b,c){return c=(c+1)%1,6*c<1?a+(b-a)*c*6:2*c<1?b:3*c<2?a+(b-a)*(2/3-c)*6:a}var f,g="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",h=/^([\-+])=\s*(\d+\.?\d*)/,i=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],a[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(a){return[a[1],a[2]/100,a[3]/100,a[4]]}}],j=a.Color=function(b,c,d,e){return new a.Color.fn.parse(b,c,d,e)},k={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},l={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},m=j.support={},n=a("<p>")[0],o=a.each;n.style.cssText="background-color:rgba(1,1,1,.5)",m.rgba=n.style.backgroundColor.indexOf("rgba")>-1,o(k,function(a,b){b.cache="_"+a,b.props.alpha={idx:3,type:"percent",def:1}}),j.fn=a.extend(j.prototype,{parse:function(e,g,h,i){if(e===b)return this._rgba=[null,null,null,null],this;(e.jquery||e.nodeType)&&(e=a(e).css(g),g=b);var l=this,m=a.type(e),n=this._rgba=[];return g!==b&&(e=[e,g,h,i],m="array"),"string"===m?this.parse(d(e)||f._default):"array"===m?(o(k.rgba.props,function(a,b){n[b.idx]=c(e[b.idx],b)}),this):"object"===m?(e instanceof j?o(k,function(a,b){e[b.cache]&&(l[b.cache]=e[b.cache].slice())}):o(k,function(b,d){var f=d.cache;o(d.props,function(a,b){if(!l[f]&&d.to){if("alpha"===a||null==e[a])return;l[f]=d.to(l._rgba)}l[f][b.idx]=c(e[a],b,!0)}),l[f]&&a.inArray(null,l[f].slice(0,3))<0&&(l[f][3]=1,d.from&&(l._rgba=d.from(l[f])))}),this):void 0},is:function(a){var b=j(a),c=!0,d=this;return o(k,function(a,e){var f,g=b[e.cache];return g&&(f=d[e.cache]||e.to&&e.to(d._rgba)||[],o(e.props,function(a,b){if(null!=g[b.idx])return c=g[b.idx]===f[b.idx]})),c}),c},_space:function(){var a=[],b=this;return o(k,function(c,d){b[d.cache]&&a.push(c)}),a.pop()},transition:function(a,b){var d=j(a),e=d._space(),f=k[e],g=0===this.alpha()?j("transparent"):this,h=g[f.cache]||f.to(g._rgba),i=h.slice();return d=d[f.cache],o(f.props,function(a,e){var f=e.idx,g=h[f],j=d[f],k=l[e.type]||{};null!==j&&(null===g?i[f]=j:(k.mod&&(j-g>k.mod/2?g+=k.mod:g-j>k.mod/2&&(g-=k.mod)),i[f]=c((j-g)*b+g,e)))}),this[e](i)},blend:function(b){if(1===this._rgba[3])return this;var c=this._rgba.slice(),d=c.pop(),e=j(b)._rgba;return j(a.map(c,function(a,b){return(1-d)*e[b]+d*a}))},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return null==a?b>2?1:0:a});return 1===c[3]&&(c.pop(),b="rgb("),b+c.join()+")"},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){return null==a&&(a=b>2?1:0),b&&b<3&&(a=Math.round(100*a)+"%"),a});return 1===c[3]&&(c.pop(),b="hsl("),b+c.join()+")"},toHexString:function(b){var c=this._rgba.slice(),d=c.pop();return b&&c.push(~~(255*d)),"#"+a.map(c,function(a){return a=(a||0).toString(16),1===a.length?"0"+a:a}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),j.fn.parse.prototype=j.fn,k.hsla.to=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b,c,d=a[0]/255,e=a[1]/255,f=a[2]/255,g=a[3],h=Math.max(d,e,f),i=Math.min(d,e,f),j=h-i,k=h+i,l=.5*k;return b=i===h?0:d===h?60*(e-f)/j+360:e===h?60*(f-d)/j+120:60*(d-e)/j+240,c=0===j?0:l<=.5?j/k:j/(2-k),[Math.round(b)%360,c,l,null==g?1:g]},k.hsla.from=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],f=a[3],g=d<=.5?d*(1+c):d+c-d*c,h=2*d-g;return[Math.round(255*e(h,g,b+1/3)),Math.round(255*e(h,g,b)),Math.round(255*e(h,g,b-1/3)),f]},o(k,function(d,e){var f=e.props,g=e.cache,i=e.to,k=e.from;j.fn[d]=function(d){if(i&&!this[g]&&(this[g]=i(this._rgba)),d===b)return this[g].slice();var e,h=a.type(d),l="array"===h||"object"===h?d:arguments,m=this[g].slice();return o(f,function(a,b){var d=l["object"===h?a:b.idx];null==d&&(d=m[b.idx]),m[b.idx]=c(d,b)}),k?(e=j(k(m)),e[g]=m,e):j(m)},o(f,function(b,c){j.fn[b]||(j.fn[b]=function(e){var f,g=a.type(e),i="alpha"===b?this._hsla?"hsla":"rgba":d,j=this[i](),k=j[c.idx];return"undefined"===g?k:("function"===g&&(e=e.call(this,k),g=a.type(e)),null==e&&c.empty?this:("string"===g&&(f=h.exec(e),f&&(e=k+parseFloat(f[2])*("+"===f[1]?1:-1))),j[c.idx]=e,this[i](j)))})})}),j.hook=function(b){var c=b.split(" ");o(c,function(b,c){a.cssHooks[c]={set:function(b,e){var f,g,h="";if("transparent"!==e&&("string"!==a.type(e)||(f=d(e)))){if(e=j(f||e),!m.rgba&&1!==e._rgba[3]){for(g="backgroundColor"===c?b.parentNode:b;(""===h||"transparent"===h)&&g&&g.style;)try{h=a.css(g,"backgroundColor"),g=g.parentNode}catch(i){}e=e.blend(h&&"transparent"!==h?h:"_default")}e=e.toRgbaString()}try{b.style[c]=e}catch(i){}}},a.fx.step[c]=function(b){b.colorInit||(b.start=j(b.elem,c),b.end=j(b.end),b.colorInit=!0),a.cssHooks[c].set(b.elem,b.start.transition(b.end,b.pos))}})},j.hook(g),a.cssHooks.borderColor={expand:function(a){var b={};return o(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a}),b}},f=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(c),function(){function b(b){var c,d,e=b.ownerDocument.defaultView?b.ownerDocument.defaultView.getComputedStyle(b,null):b.currentStyle,f={};if(e&&e.length&&e[0]&&e[e[0]])for(d=e.length;d--;)c=e[d],"string"==typeof e[c]&&(f[a.camelCase(c)]=e[c]);else for(c in e)"string"==typeof e[c]&&(f[c]=e[c]);return f}function d(b,c){var d,e,g={};for(d in c)e=c[d],b[d]!==e&&(f[d]||!a.fx.step[d]&&isNaN(parseFloat(e))||(g[d]=e));return g}var e=["add","remove","toggle"],f={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(b,d){a.fx.step[d]=function(a){("none"!==a.end&&!a.setAttr||1===a.pos&&!a.setAttr)&&(c.style(a.elem,d,a.end),a.setAttr=!0)}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a.effects.animateClass=function(c,f,g,h){var i=a.speed(f,g,h);return this.queue(function(){var f,g=a(this),h=g.attr("class")||"",j=i.children?g.find("*").addBack():g;j=j.map(function(){var c=a(this);return{el:c,start:b(this)}}),f=function(){a.each(e,function(a,b){c[b]&&g[b+"Class"](c[b])})},f(),j=j.map(function(){return this.end=b(this.el[0]),this.diff=d(this.start,this.end),this}),g.attr("class",h),j=j.map(function(){var b=this,c=a.Deferred(),d=a.extend({},i,{queue:!1,complete:function(){c.resolve(b)}});return this.el.animate(this.diff,d),c.promise()}),a.when.apply(a,j.get()).done(function(){f(),a.each(arguments,function(){var b=this.el;a.each(this.diff,function(a){b.css(a,"")})}),i.complete.call(g[0])})})},a.fn.extend({addClass:function(b){return function(c,d,e,f){return d?a.effects.animateClass.call(this,{add:c},d,e,f):b.apply(this,arguments)}}(a.fn.addClass),removeClass:function(b){return function(c,d,e,f){return arguments.length>1?a.effects.animateClass.call(this,{remove:c},d,e,f):b.apply(this,arguments)}}(a.fn.removeClass),toggleClass:function(b){return function(c,d,e,f,g){return"boolean"==typeof d||void 0===d?e?a.effects.animateClass.call(this,d?{add:c}:{remove:c},e,f,g):b.apply(this,arguments):a.effects.animateClass.call(this,{toggle:c},d,e,f)}}(a.fn.toggleClass),switchClass:function(b,c,d,e,f){return a.effects.animateClass.call(this,{add:c,remove:b},d,e,f)}})}(),function(){function c(b,c,d,e){return a.isPlainObject(b)&&(c=b,b=b.effect),b={effect:b},null==c&&(c={}),a.isFunction(c)&&(e=c,d=null,c={}),("number"==typeof c||a.fx.speeds[c])&&(e=d,d=c,c={}),a.isFunction(d)&&(e=d,d=null),c&&a.extend(b,c),d=d||c.duration,b.duration=a.fx.off?0:"number"==typeof d?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,b.complete=e||c.complete,b}function d(b){return!(b&&"number"!=typeof b&&!a.fx.speeds[b])||("string"==typeof b&&!a.effects.effect[b]||(!!a.isFunction(b)||"object"==typeof b&&!b.effect))}a.extend(a.effects,{version:"1.11.4",save:function(a,c){for(var d=0;d<c.length;d++)null!==c[d]&&a.data(b+c[d],a[0].style[c[d]])},restore:function(a,c){var d,e;for(e=0;e<c.length;e++)null!==c[e]&&(d=a.data(b+c[e]),void 0===d&&(d=""),a.css(c[e],d))},setMode:function(a,b){return"toggle"===b&&(b=a.is(":hidden")?"show":"hide"),b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:b.width(),height:b.height()},f=document.activeElement;try{f.id}catch(g){f=document.body}return b.wrap(d),(b[0]===f||a.contains(b[0],f))&&a(f).focus(),d=b.parent(),"static"===b.css("position")?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),b.css(e),d.css(c).show()},removeWrapper:function(b){var c=document.activeElement;return b.parent().is(".ui-effects-wrapper")&&(b.parent().replaceWith(b),(b[0]===c||a.contains(b[0],c))&&a(c).focus()),b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(){function b(b){function c(){a.isFunction(f)&&f.call(e[0]),a.isFunction(b)&&b()}var e=a(this),f=d.complete,h=d.mode;(e.is(":hidden")?"hide"===h:"show"===h)?(e[h](),c()):g.call(e[0],d,c)}var d=c.apply(this,arguments),e=d.mode,f=d.queue,g=a.effects.effect[d.effect];return a.fx.off||!g?e?this[e](d.duration,d.complete):this.each(function(){d.complete&&d.complete.call(this)}):f===!1?this.each(b):this.queue(f||"fx",b)},show:function(a){return function(b){if(d(b))return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="show",this.effect.call(this,e)}}(a.fn.show),hide:function(a){return function(b){if(d(b))return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="hide",this.effect.call(this,e)}}(a.fn.hide),toggle:function(a){return function(b){if(d(b)||"boolean"==typeof b)return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="toggle",this.effect.call(this,e)}}(a.fn.toggle),cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}})}(),function(){var b={};a.each(["Quad","Cubic","Quart","Quint","Expo"],function(a,c){b[c]=function(b){return Math.pow(b,a+2)}}),a.extend(b,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return 0===a||1===a?a:-Math.pow(2,8*(a-1))*Math.sin((80*(a-1)-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){for(var b,c=4;a<((b=Math.pow(2,--c))-1)/11;);return 1/Math.pow(4,3-c)-7.5625*Math.pow((3*b-2)/22-a,2)}}),a.each(b,function(b,c){a.easing["easeIn"+b]=c,a.easing["easeOut"+b]=function(a){return 1-c(1-a)},a.easing["easeInOut"+b]=function(a){return a<.5?c(2*a)/2:1-c(a*-2+2)/2}})}(),a.effects});

/*!
 * jQuery UI Effects Slide 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/slide-effect/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./effect"],a):a(jQuery)}(function(a){return a.effects.effect.slide=function(b,c){var d,e=a(this),f=["position","top","bottom","left","right","width","height"],g=a.effects.setMode(e,b.mode||"show"),h="show"===g,i=b.direction||"left",j="up"===i||"down"===i?"top":"left",k="up"===i||"left"===i,l={};a.effects.save(e,f),e.show(),d=b.distance||e["top"===j?"outerHeight":"outerWidth"](!0),a.effects.createWrapper(e).css({overflow:"hidden"}),h&&e.css(j,k?isNaN(d)?"-"+d:-d:d),l[j]=(h?k?"+=":"-=":k?"-=":"+=")+d,e.animate(l,{queue:!1,duration:b.duration,easing:b.easing,complete:function(){"hide"===g&&e.hide(),a.effects.restore(e,f),a.effects.removeWrapper(e),c()}})}});

(function($){$.ui.timepicker=$.ui.timepicker||{};if($.ui.timepicker.version){return}$.extend($.ui,{timepicker:{version:"@@version"}});var Timepicker=function(){this.regional=[];this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:false};this._defaults={showButtonPanel:true,timeOnly:false,timeOnlyShowDate:false,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:true,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:true,separator:" ",altFieldTimeOnly:true,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:true,timezoneList:null,addSliderAccess:false,sliderAccessArgs:null,controlType:"slider",defaultValue:null,parse:"strict"};$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults){if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue){try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}}overrides={beforeShow:function(input,dp_inst){if($.isFunction(tp_inst._defaults.evnts.beforeShow)){return tp_inst._defaults.evnts.beforeShow.call($input[0],input,dp_inst,tp_inst)}},onChangeMonthYear:function(year,month,dp_inst){tp_inst._updateDateTime(dp_inst);if($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)){tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],year,month,dp_inst,tp_inst)}},onClose:function(dateText,dp_inst){if(tp_inst.timeDefined===true&&$input.val()!==""){tp_inst._updateDateTime(dp_inst)}if($.isFunction(tp_inst._defaults.evnts.onClose)){tp_inst._defaults.evnts.onClose.call($input[0],dateText,dp_inst,tp_inst)}}};for(i in overrides){if(overrides.hasOwnProperty(i)){fns[i]=opts[i]||null}}tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst});tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(val){return val.toUpperCase()});tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(val){return val.toUpperCase()});tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:""));if(typeof tp_inst._defaults.controlType==="string"){if(tp_inst._defaults.controlType==="slider"&&typeof $.ui.slider==="undefined"){tp_inst._defaults.controlType="select"}tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]}else{tp_inst.control=tp_inst._defaults.controlType}var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];if(tp_inst._defaults.timezoneList!==null){timezoneList=tp_inst._defaults.timezoneList}var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&typeof timezoneList[0]!=="object"){for(;tzi<tzl;tzi++){tzv=timezoneList[tzi];timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)}}}tp_inst._defaults.timezoneList=timezoneList;tp_inst.timezone=tp_inst._defaults.timezone!==null?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):(new Date).getTimezoneOffset()*-1;tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour;tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute;tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second;tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec;tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec;tp_inst.ampm="";tp_inst.$input=$input;if(tp_inst._defaults.altField){tp_inst.$altInput=$(tp_inst._defaults.altField).css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})}if(tp_inst._defaults.minDate===0||tp_inst._defaults.minDateTime===0){tp_inst._defaults.minDate=new Date}if(tp_inst._defaults.maxDate===0||tp_inst._defaults.maxDateTime===0){tp_inst._defaults.maxDate=new Date}if(tp_inst._defaults.minDate!==undefined&&tp_inst._defaults.minDate instanceof Date){tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())}if(tp_inst._defaults.minDateTime!==undefined&&tp_inst._defaults.minDateTime instanceof Date){tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())}if(tp_inst._defaults.maxDate!==undefined&&tp_inst._defaults.maxDate instanceof Date){tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())}if(tp_inst._defaults.maxDateTime!==undefined&&tp_inst._defaults.maxDateTime instanceof Date){tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())}tp_inst.$input.bind("focus",function(){tp_inst._onFocus()});return tp_inst},_addTimePicker:function(dp_inst){var currDT=this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val();this.timeDefined=this._parseTime(currDT);this._limitMinMaxDateTime(dp_inst,false);this._injectTimePicker()},_parseTime:function(timeString,withDate){if(!this.inst){this.inst=$.datepicker._getInst(this.$input[0])}if(withDate||!this._defaults.timeOnly){var dp_dateFormat=$.datepicker._get(this.inst,"dateFormat");try{var parseRes=parseDateTimeInternal(dp_dateFormat,this._defaults.timeFormat,timeString,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!parseRes.timeObj){return false}$.extend(this,parseRes.timeObj)}catch(err){$.timepicker.log("Error parsing the date/time string: "+err+"\ndate/time string = "+timeString+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+dp_dateFormat);return false}return true}else{var timeObj=$.datepicker.parseTime(this._defaults.timeFormat,timeString,this._defaults);if(!timeObj){return false}$.extend(this,timeObj);return true}},_injectTimePicker:function(){var $dp=this.inst.dpDiv,o=this.inst.settings,tp_inst=this,litem="",uitem="",show=null,max={},gridSize={},size=null,i=0,l=0;if($dp.find("div.ui-timepicker-div").length===0&&o.showTimepicker){var noDisplay=' style="display:none;"',html='<div class="ui-timepicker-div'+(o.isRTL?" ui-timepicker-rtl":"")+'"><dl>'+'<dt class="ui_tpicker_time_label"'+(o.showTime?"":noDisplay)+">"+o.timeText+"</dt>"+'<dd class="ui_tpicker_time"'+(o.showTime?"":noDisplay)+"></dd>";for(i=0,l=this.units.length;i<l;i++){litem=this.units[i];uitem=litem.substr(0,1).toUpperCase()+litem.substr(1);show=o["show"+uitem]!==null?o["show"+uitem]:this.support[litem];max[litem]=parseInt(o[litem+"Max"]-(o[litem+"Max"]-o[litem+"Min"])%o["step"+uitem],10);gridSize[litem]=0;html+='<dt class="ui_tpicker_'+litem+'_label"'+(show?"":noDisplay)+">"+o[litem+"Text"]+"</dt>"+'<dd class="ui_tpicker_'+litem+'"><div class="ui_tpicker_'+litem+'_slider"'+(show?"":noDisplay)+"></div>";if(show&&o[litem+"Grid"]>0){html+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';if(litem==="hour"){for(var h=o[litem+"Min"];h<=max[litem];h+=parseInt(o[litem+"Grid"],10)){gridSize[litem]++;var tmph=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:h},o);html+='<td data-for="'+litem+'">'+tmph+"</td>"}}else{for(var m=o[litem+"Min"];m<=max[litem];m+=parseInt(o[litem+"Grid"],10)){gridSize[litem]++;html+='<td data-for="'+litem+'">'+(m<10?"0":"")+m+"</td>"}}html+="</tr></table></div>"}html+="</dd>"}var showTz=o.showTimezone!==null?o.showTimezone:this.support.timezone;html+='<dt class="ui_tpicker_timezone_label"'+(showTz?"":noDisplay)+">"+o.timezoneText+"</dt>";html+='<dd class="ui_tpicker_timezone" '+(showTz?"":noDisplay)+"></dd>";html+="</dl></div>";var $tp=$(html);if(o.timeOnly===true){$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">'+'<div class="ui-datepicker-title">'+o.timeOnlyTitle+"</div>"+"</div>");$dp.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()}for(i=0,l=tp_inst.units.length;i<l;i++){litem=tp_inst.units[i];uitem=litem.substr(0,1).toUpperCase()+litem.substr(1);show=o["show"+uitem]!==null?o["show"+uitem]:this.support[litem];tp_inst[litem+"_slider"]=tp_inst.control.create(tp_inst,$tp.find(".ui_tpicker_"+litem+"_slider"),litem,tp_inst[litem],o[litem+"Min"],max[litem],o["step"+uitem]);if(show&&o[litem+"Grid"]>0){size=100*gridSize[litem]*o[litem+"Grid"]/(max[litem]-o[litem+"Min"]);$tp.find(".ui_tpicker_"+litem+" table").css({width:size+"%",marginLeft:o.isRTL?"0":size/(-2*gridSize[litem])+"%",marginRight:o.isRTL?size/(-2*gridSize[litem])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(e){var $t=$(this),h=$t.html(),n=parseInt(h.replace(/[^0-9]/g),10),ap=h.replace(/[^apm]/gi),f=$t.data("for");if(f==="hour"){if(ap.indexOf("p")!==-1&&n<12){n+=12}else{if(ap.indexOf("a")!==-1&&n===12){n=0}}}tp_inst.control.value(tp_inst,tp_inst[f+"_slider"],litem,n);tp_inst._onTimeChange();tp_inst._onSelectHandler()}).css({cursor:"pointer",width:100/gridSize[litem]+"%",textAlign:"center",overflow:"hidden"})}}this.timezone_select=$tp.find(".ui_tpicker_timezone").append("<select></select>").find("select");$.fn.append.apply(this.timezone_select,$.map(o.timezoneList,function(val,idx){return $("<option />").val(typeof val==="object"?val.value:val).text(typeof val==="object"?val.label:val)}));if(typeof this.timezone!=="undefined"&&this.timezone!==null&&this.timezone!==""){var local_timezone=new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset()*-1;if(local_timezone===this.timezone){selectLocalTimezone(tp_inst)}else{this.timezone_select.val(this.timezone)}}else{if(typeof this.hour!=="undefined"&&this.hour!==null&&this.hour!==""){this.timezone_select.val(o.timezone)}else{selectLocalTimezone(tp_inst)}}this.timezone_select.change(function(){tp_inst._onTimeChange();tp_inst._onSelectHandler()});var $buttonPanel=$dp.find(".ui-datepicker-buttonpane");if($buttonPanel.length){$buttonPanel.before($tp)}else{$dp.append($tp)}this.$timeObj=$tp.find(".ui_tpicker_time");if(this.inst!==null){var timeDefined=this.timeDefined;this._onTimeChange();this.timeDefined=timeDefined}if(this._defaults.addSliderAccess){var sliderAccessArgs=this._defaults.sliderAccessArgs,rtl=this._defaults.isRTL;sliderAccessArgs.isRTL=rtl;setTimeout(function(){if($tp.find(".ui-slider-access").length===0){$tp.find(".ui-slider:visible").sliderAccess(sliderAccessArgs);var sliderAccessWidth=$tp.find(".ui-slider-access:eq(0)").outerWidth(true);if(sliderAccessWidth){$tp.find("table:visible").each(function(){var $g=$(this),oldWidth=$g.outerWidth(),oldMarginLeft=$g.css(rtl?"marginRight":"marginLeft").toString().replace("%",""),newWidth=oldWidth-sliderAccessWidth,newMarginLeft=oldMarginLeft*newWidth/oldWidth+"%",css={width:newWidth,marginRight:0,marginLeft:0};css[rtl?"marginRight":"marginLeft"]=newMarginLeft;$g.css(css)})}}},10)}tp_inst._limitMinMaxDateTime(this.inst,true)}},_limitMinMaxDateTime:function(dp_inst,adjustSliders){var o=this._defaults,dp_date=new Date(dp_inst.selectedYear,dp_inst.selectedMonth,dp_inst.selectedDay);if(!this._defaults.showTimepicker){return}if($.datepicker._get(dp_inst,"minDateTime")!==null&&$.datepicker._get(dp_inst,"minDateTime")!==undefined&&dp_date){var minDateTime=$.datepicker._get(dp_inst,"minDateTime"),minDateTimeDate=new Date(minDateTime.getFullYear(),minDateTime.getMonth(),minDateTime.getDate(),0,0,0,0);if(this.hourMinOriginal===null||this.minuteMinOriginal===null||this.secondMinOriginal===null||this.millisecMinOriginal===null||this.microsecMinOriginal===null){this.hourMinOriginal=o.hourMin;this.minuteMinOriginal=o.minuteMin;this.secondMinOriginal=o.secondMin;this.millisecMinOriginal=o.millisecMin;this.microsecMinOriginal=o.microsecMin}if(dp_inst.settings.timeOnly||minDateTimeDate.getTime()===dp_date.getTime()){this._defaults.hourMin=minDateTime.getHours();if(this.hour<=this._defaults.hourMin){this.hour=this._defaults.hourMin;this._defaults.minuteMin=minDateTime.getMinutes();if(this.minute<=this._defaults.minuteMin){this.minute=this._defaults.minuteMin;this._defaults.secondMin=minDateTime.getSeconds();if(this.second<=this._defaults.secondMin){this.second=this._defaults.secondMin;this._defaults.millisecMin=minDateTime.getMilliseconds();if(this.millisec<=this._defaults.millisecMin){this.millisec=this._defaults.millisecMin;this._defaults.microsecMin=minDateTime.getMicroseconds()}else{if(this.microsec<this._defaults.microsecMin){this.microsec=this._defaults.microsecMin}this._defaults.microsecMin=this.microsecMinOriginal}}else{this._defaults.millisecMin=this.millisecMinOriginal;this._defaults.microsecMin=this.microsecMinOriginal}}else{this._defaults.secondMin=this.secondMinOriginal;this._defaults.millisecMin=this.millisecMinOriginal;this._defaults.microsecMin=this.microsecMinOriginal}}else{this._defaults.minuteMin=this.minuteMinOriginal;this._defaults.secondMin=this.secondMinOriginal;this._defaults.millisecMin=this.millisecMinOriginal;this._defaults.microsecMin=this.microsecMinOriginal}}else{this._defaults.hourMin=this.hourMinOriginal;this._defaults.minuteMin=this.minuteMinOriginal;this._defaults.secondMin=this.secondMinOriginal;this._defaults.millisecMin=this.millisecMinOriginal;this._defaults.microsecMin=this.microsecMinOriginal}}if($.datepicker._get(dp_inst,"maxDateTime")!==null&&$.datepicker._get(dp_inst,"maxDateTime")!==undefined&&dp_date){var maxDateTime=$.datepicker._get(dp_inst,"maxDateTime"),maxDateTimeDate=new Date(maxDateTime.getFullYear(),maxDateTime.getMonth(),maxDateTime.getDate(),0,0,0,0);if(this.hourMaxOriginal===null||this.minuteMaxOriginal===null||this.secondMaxOriginal===null||this.millisecMaxOriginal===null){this.hourMaxOriginal=o.hourMax;this.minuteMaxOriginal=o.minuteMax;this.secondMaxOriginal=o.secondMax;this.millisecMaxOriginal=o.millisecMax;this.microsecMaxOriginal=o.microsecMax}if(dp_inst.settings.timeOnly||maxDateTimeDate.getTime()===dp_date.getTime()){this._defaults.hourMax=maxDateTime.getHours();if(this.hour>=this._defaults.hourMax){this.hour=this._defaults.hourMax;this._defaults.minuteMax=maxDateTime.getMinutes();if(this.minute>=this._defaults.minuteMax){this.minute=this._defaults.minuteMax;this._defaults.secondMax=maxDateTime.getSeconds();if(this.second>=this._defaults.secondMax){this.second=this._defaults.secondMax;this._defaults.millisecMax=maxDateTime.getMilliseconds();if(this.millisec>=this._defaults.millisecMax){this.millisec=this._defaults.millisecMax;this._defaults.microsecMax=maxDateTime.getMicroseconds()}else{if(this.microsec>this._defaults.microsecMax){this.microsec=this._defaults.microsecMax}this._defaults.microsecMax=this.microsecMaxOriginal}}else{this._defaults.millisecMax=this.millisecMaxOriginal;this._defaults.microsecMax=this.microsecMaxOriginal}}else{this._defaults.secondMax=this.secondMaxOriginal;this._defaults.millisecMax=this.millisecMaxOriginal;this._defaults.microsecMax=this.microsecMaxOriginal}}else{this._defaults.minuteMax=this.minuteMaxOriginal;this._defaults.secondMax=this.secondMaxOriginal;this._defaults.millisecMax=this.millisecMaxOriginal;this._defaults.microsecMax=this.microsecMaxOriginal}}else{this._defaults.hourMax=this.hourMaxOriginal;this._defaults.minuteMax=this.minuteMaxOriginal;this._defaults.secondMax=this.secondMaxOriginal;this._defaults.millisecMax=this.millisecMaxOriginal;this._defaults.microsecMax=this.microsecMaxOriginal}}if(dp_inst.settings.minTime!==null){var tempMinTime=new Date("01/01/1970 "+dp_inst.settings.minTime);if(this.hour<tempMinTime.getHours()){this.hour=this._defaults.hourMin=tempMinTime.getHours();this.minute=this._defaults.minuteMin=tempMinTime.getMinutes()}else if(this.hour===tempMinTime.getHours()&&this.minute<tempMinTime.getMinutes()){this.minute=this._defaults.minuteMin=tempMinTime.getMinutes()}else{if(this._defaults.hourMin<tempMinTime.getHours()){this._defaults.hourMin=tempMinTime.getHours();this._defaults.minuteMin=tempMinTime.getMinutes()}else if(this._defaults.hourMin===tempMinTime.getHours()===this.hour&&this._defaults.minuteMin<tempMinTime.getMinutes()){this._defaults.minuteMin=tempMinTime.getMinutes()}else{this._defaults.minuteMin=0}}}if(dp_inst.settings.maxTime!==null){var tempMaxTime=new Date("01/01/1970 "+dp_inst.settings.maxTime);if(this.hour>tempMaxTime.getHours()){this.hour=this._defaults.hourMax=tempMaxTime.getHours();this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes()}else if(this.hour===tempMaxTime.getHours()&&this.minute>tempMaxTime.getMinutes()){this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes()}else{if(this._defaults.hourMax>tempMaxTime.getHours()){this._defaults.hourMax=tempMaxTime.getHours();this._defaults.minuteMax=tempMaxTime.getMinutes()}else if(this._defaults.hourMax===tempMaxTime.getHours()===this.hour&&this._defaults.minuteMax>tempMaxTime.getMinutes()){this._defaults.minuteMax=tempMaxTime.getMinutes()}else{this._defaults.minuteMax=59}}}if(adjustSliders!==undefined&&adjustSliders===true){var hourMax=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),minMax=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),secMax=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),millisecMax=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),microsecMax=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);if(this.hour_slider){this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:hourMax,step:this._defaults.stepHour});this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)}if(this.minute_slider){this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:minMax,step:this._defaults.stepMinute});this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)}if(this.second_slider){this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:secMax,step:this._defaults.stepSecond});this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)}if(this.millisec_slider){this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:millisecMax,step:this._defaults.stepMillisec});this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)}if(this.microsec_slider){this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:microsecMax,step:this._defaults.stepMicrosec});this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec)}}},_onTimeChange:function(){if(!this._defaults.showTimepicker){return}var hour=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):false,minute=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):false,second=this.second_slider?this.control.value(this,this.second_slider,"second"):false,millisec=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):false,microsec=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):false,timezone=this.timezone_select?this.timezone_select.val():false,o=this._defaults,pickerTimeFormat=o.pickerTimeFormat||o.timeFormat,pickerTimeSuffix=o.pickerTimeSuffix||o.timeSuffix;if(typeof hour==="object"){hour=false}if(typeof minute==="object"){minute=false}if(typeof second==="object"){second=false}if(typeof millisec==="object"){millisec=false}if(typeof microsec==="object"){microsec=false}if(typeof timezone==="object"){timezone=false}if(hour!==false){hour=parseInt(hour,10)}if(minute!==false){minute=parseInt(minute,10)}if(second!==false){second=parseInt(second,10)}if(millisec!==false){millisec=parseInt(millisec,10)}if(microsec!==false){microsec=parseInt(microsec,10)}if(timezone!==false){timezone=timezone.toString()}var ampm=o[hour<12?"amNames":"pmNames"][0];var hasChanged=hour!==parseInt(this.hour,10)||minute!==parseInt(this.minute,10)||second!==parseInt(this.second,10)||millisec!==parseInt(this.millisec,10)||microsec!==parseInt(this.microsec,10)||this.ampm.length>0&&hour<12!==($.inArray(this.ampm.toUpperCase(),this.amNames)!==-1)||this.timezone!==null&&timezone!==this.timezone.toString();if(hasChanged){if(hour!==false){this.hour=hour}if(minute!==false){this.minute=minute}if(second!==false){this.second=second}if(millisec!==false){this.millisec=millisec}if(microsec!==false){this.microsec=microsec}if(timezone!==false){this.timezone=timezone}if(!this.inst){this.inst=$.datepicker._getInst(this.$input[0])}this._limitMinMaxDateTime(this.inst,true)}if(this.support.ampm){this.ampm=ampm}this.formattedTime=$.datepicker.formatTime(o.timeFormat,this,o);if(this.$timeObj){if(pickerTimeFormat===o.timeFormat){this.$timeObj.text(this.formattedTime+pickerTimeSuffix)}else{this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat,this,o)+pickerTimeSuffix)}}this.timeDefined=true;if(hasChanged){this._updateDateTime()}},_onSelectHandler:function(){var onSelect=this._defaults.onSelect||this.inst.settings.onSelect;var inputEl=this.$input?this.$input[0]:null;if(onSelect&&inputEl){onSelect.apply(inputEl,[this.formattedDateTime,this])}},_updateDateTime:function(dp_inst){dp_inst=this.inst||dp_inst;var dtTmp=dp_inst.currentYear>0?new Date(dp_inst.currentYear,dp_inst.currentMonth,dp_inst.currentDay):new Date(dp_inst.selectedYear,dp_inst.selectedMonth,dp_inst.selectedDay),dt=$.datepicker._daylightSavingAdjust(dtTmp),dateFmt=$.datepicker._get(dp_inst,"dateFormat"),formatCfg=$.datepicker._getFormatConfig(dp_inst),timeAvailable=dt!==null&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(dateFmt,dt===null?new Date:dt,formatCfg);var formattedDateTime=this.formattedDate;if(dp_inst.lastVal===""){dp_inst.currentYear=dp_inst.selectedYear;dp_inst.currentMonth=dp_inst.selectedMonth;dp_inst.currentDay=dp_inst.selectedDay}if(this._defaults.timeOnly===true&&this._defaults.timeOnlyShowDate===false){formattedDateTime=this.formattedTime}else if(this._defaults.timeOnly!==true&&(this._defaults.alwaysSetTime||timeAvailable)||this._defaults.timeOnly===true&&this._defaults.timeOnlyShowDate===true){formattedDateTime+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix}this.formattedDateTime=formattedDateTime;if(!this._defaults.showTimepicker){this.$input.val(this.formattedDate)}else if(this.$altInput&&this._defaults.timeOnly===false&&this._defaults.altFieldTimeOnly===true){this.$altInput.val(this.formattedTime);this.$input.val(this.formattedDate)}else if(this.$altInput){this.$input.val(formattedDateTime);var altFormattedDateTime="",altSeparator=this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,altTimeSuffix=this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;if(!this._defaults.timeOnly){if(this._defaults.altFormat){altFormattedDateTime=$.datepicker.formatDate(this._defaults.altFormat,dt===null?new Date:dt,formatCfg)}else{altFormattedDateTime=this.formattedDate}if(altFormattedDateTime){altFormattedDateTime+=altSeparator}}if(this._defaults.altTimeFormat){altFormattedDateTime+=$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+altTimeSuffix}else{altFormattedDateTime+=this.formattedTime+altTimeSuffix}this.$altInput.val(altFormattedDateTime)}else{this.$input.val(formattedDateTime)}this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var inst=$.datepicker._getInst(this.$input.get(0)),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst){if(tp_inst._defaults.timeOnly&&inst.input.val()!==inst.lastVal){try{$.datepicker._updateDatepicker(inst)}catch(err){$.timepicker.log(err)}}}}},_controls:{slider:{create:function(tp_inst,obj,unit,val,min,max,step){var rtl=tp_inst._defaults.isRTL;return obj.prop("slide",null).slider({orientation:"horizontal",value:rtl?val*-1:val,min:rtl?max*-1:min,max:rtl?min*-1:max,step:step,slide:function(event,ui){tp_inst.control.value(tp_inst,$(this),unit,rtl?ui.value*-1:ui.value);tp_inst._onTimeChange()},stop:function(event,ui){tp_inst._onSelectHandler()}})},options:function(tp_inst,obj,unit,opts,val){if(tp_inst._defaults.isRTL){if(typeof opts==="string"){if(opts==="min"||opts==="max"){if(val!==undefined){return obj.slider(opts,val*-1)}return Math.abs(obj.slider(opts))}return obj.slider(opts)}var min=opts.min,max=opts.max;opts.min=opts.max=null;if(min!==undefined){opts.max=min*-1}if(max!==undefined){opts.min=max*-1}return obj.slider(opts)}if(typeof opts==="string"&&val!==undefined){return obj.slider(opts,val)}return obj.slider(opts)},value:function(tp_inst,obj,unit,val){if(tp_inst._defaults.isRTL){if(val!==undefined){return obj.slider("value",val*-1)}return Math.abs(obj.slider("value"))}if(val!==undefined){return obj.slider("value",val)}return obj.slider("value")}},select:{create:function(tp_inst,obj,unit,val,min,max,step){var sel='<select class="ui-timepicker-select" data-unit="'+unit+'" data-min="'+min+'" data-max="'+max+'" data-step="'+step+'">',format=tp_inst._defaults.pickerTimeFormat||tp_inst._defaults.timeFormat;for(var i=min;i<=max;i+=step){sel+='<option value="'+i+'"'+(i===val?" selected":"")+">";if(unit==="hour"){sel+=$.datepicker.formatTime($.trim(format.replace(/[^ht ]/gi,"")),{hour:i},tp_inst._defaults)}else if(unit==="millisec"||unit==="microsec"||i>=10){sel+=i}else{sel+="0"+i.toString()}sel+="</option>"}sel+="</select>";obj.children("select").remove();$(sel).appendTo(obj).change(function(e){tp_inst._onTimeChange();tp_inst._onSelectHandler()});return obj},options:function(tp_inst,obj,unit,opts,val){var o={},$t=obj.children("select");if(typeof opts==="string"){if(val===undefined){return $t.data(opts)}o[opts]=val}else{o=opts}return tp_inst.control.create(tp_inst,obj,$t.data("unit"),$t.val(),o.min||$t.data("min"),o.max||$t.data("max"),o.step||$t.data("step"))},value:function(tp_inst,obj,unit,val){var $t=obj.children("select");if(val!==undefined){return $t.val(val)}return $t.val()}}}});$.fn.extend({timepicker:function(o){o=o||{};var tmp_args=Array.prototype.slice.call(arguments);if(typeof o==="object"){tmp_args[0]=$.extend(o,{timeOnly:true})}return $(this).each(function(){$.fn.datetimepicker.apply($(this),tmp_args)})},datetimepicker:function(o){o=o||{};var tmp_args=arguments;if(typeof o==="string"){if(o==="getDate"){return $.fn.datepicker.apply($(this[0]),tmp_args)}else{return this.each(function(){var $t=$(this);$t.datepicker.apply($t,tmp_args)})}}else{return this.each(function(){var $t=$(this);$t.datepicker($.timepicker._newInst($t,o)._defaults)})}}});$.datepicker.parseDateTime=function(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings){var parseRes=parseDateTimeInternal(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings);if(parseRes.timeObj){var t=parseRes.timeObj;parseRes.date.setHours(t.hour,t.minute,t.second,t.millisec);parseRes.date.setMicroseconds(t.microsec)}return parseRes.date};$.datepicker.parseTime=function(timeFormat,timeString,options){var o=extendRemove(extendRemove({},$.timepicker._defaults),options||{}),iso8601=timeFormat.replace(/\'.*?\'/g,"").indexOf("Z")!==-1;var strictParse=function(f,s,o){var getPatternAmpm=function(amNames,pmNames){var markers=[];if(amNames){$.merge(markers,amNames)}if(pmNames){$.merge(markers,pmNames)}markers=$.map(markers,function(val){return val.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")});return"("+markers.join("|")+")?"};var getFormatPositions=function(timeFormat){var finds=timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),orders={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(finds){for(var i=0;i<finds.length;i++){if(orders[finds[i].toString().charAt(0)]===-1){orders[finds[i].toString().charAt(0)]=i+1}}}return orders};var regstr="^"+f.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(match){var ml=match.length;switch(match.charAt(0).toLowerCase()){case"h":return ml===1?"(\\d?\\d)":"(\\d{"+ml+"})";case"m":return ml===1?"(\\d?\\d)":"(\\d{"+ml+"})";case"s":return ml===1?"(\\d?\\d)":"(\\d{"+ml+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return getPatternAmpm(o.amNames,o.pmNames);default:return"("+match.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(m){return"\\"+m})+")?"}}).replace(/\s/g,"\\s?")+o.timeSuffix+"$",order=getFormatPositions(f),ampm="",treg;treg=s.match(new RegExp(regstr,"i"));var resTime={hour:0,minute:0,second:0,millisec:0,microsec:0};if(treg){if(order.t!==-1){if(treg[order.t]===undefined||treg[order.t].length===0){ampm="";resTime.ampm=""}else{ampm=$.inArray(treg[order.t].toUpperCase(),o.amNames)!==-1?"AM":"PM";resTime.ampm=o[ampm==="AM"?"amNames":"pmNames"][0]}}if(order.h!==-1){if(ampm==="AM"&&treg[order.h]==="12"){resTime.hour=0}else{if(ampm==="PM"&&treg[order.h]!=="12"){resTime.hour=parseInt(treg[order.h],10)+12}else{resTime.hour=Number(treg[order.h])}}}if(order.m!==-1){resTime.minute=Number(treg[order.m])}if(order.s!==-1){resTime.second=Number(treg[order.s])}if(order.l!==-1){resTime.millisec=Number(treg[order.l])}if(order.c!==-1){resTime.microsec=Number(treg[order.c])}if(order.z!==-1&&treg[order.z]!==undefined){resTime.timezone=$.timepicker.timezoneOffsetNumber(treg[order.z])}return resTime}return false};var looseParse=function(f,s,o){try{var d=new Date("2012-01-01 "+s);if(isNaN(d.getTime())){d=new Date("2012-01-01T"+s);if(isNaN(d.getTime())){d=new Date("01/01/2012 "+s);if(isNaN(d.getTime())){throw"Unable to parse time with native Date: "+s}}}return{hour:d.getHours(),minute:d.getMinutes(),second:d.getSeconds(),millisec:d.getMilliseconds(),microsec:d.getMicroseconds(),timezone:d.getTimezoneOffset()*-1}}catch(err){try{return strictParse(f,s,o)}catch(err2){$.timepicker.log("Unable to parse \ntimeString: "+s+"\ntimeFormat: "+f);
}}return false};if(typeof o.parse==="function"){return o.parse(timeFormat,timeString,o)}if(o.parse==="loose"){return looseParse(timeFormat,timeString,o)}return strictParse(timeFormat,timeString,o)};$.datepicker.formatTime=function(format,time,options){options=options||{};options=$.extend({},$.timepicker._defaults,options);time=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},time);var tmptime=format,ampmName=options.amNames[0],hour=parseInt(time.hour,10);if(hour>11){ampmName=options.pmNames[0]}tmptime=tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(match){switch(match){case"HH":return("0"+hour).slice(-2);case"H":return hour;case"hh":return("0"+convert24to12(hour)).slice(-2);case"h":return convert24to12(hour);case"mm":return("0"+time.minute).slice(-2);case"m":return time.minute;case"ss":return("0"+time.second).slice(-2);case"s":return time.second;case"l":return("00"+time.millisec).slice(-3);case"c":return("00"+time.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(time.timezone===null?options.timezone:time.timezone,false);case"Z":return $.timepicker.timezoneOffsetString(time.timezone===null?options.timezone:time.timezone,true);case"T":return ampmName.charAt(0).toUpperCase();case"TT":return ampmName.toUpperCase();case"t":return ampmName.charAt(0).toLowerCase();case"tt":return ampmName.toLowerCase();default:return match.replace(/'/g,"")}});return tmptime};$.datepicker._base_selectDate=$.datepicker._selectDate;$.datepicker._selectDate=function(id,dateStr){var inst=this._getInst($(id)[0]),tp_inst=this._get(inst,"timepicker");if(tp_inst&&inst.settings.showTimepicker){tp_inst._limitMinMaxDateTime(inst,true);inst.inline=inst.stay_open=true;this._base_selectDate(id,dateStr);inst.inline=inst.stay_open=false;this._notifyChange(inst);this._updateDatepicker(inst)}else{this._base_selectDate(id,dateStr)}};$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker;$.datepicker._updateDatepicker=function(inst){var input=inst.input[0];if($.datepicker._curInst&&$.datepicker._curInst!==inst&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==input){return}if(typeof inst.stay_open!=="boolean"||inst.stay_open===false){this._base_updateDatepicker(inst);var tp_inst=this._get(inst,"timepicker");if(tp_inst){tp_inst._addTimePicker(inst)}}};$.datepicker._base_doKeyPress=$.datepicker._doKeyPress;$.datepicker._doKeyPress=function(event){var inst=$.datepicker._getInst(event.target),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst){if($.datepicker._get(inst,"constrainInput")){var ampm=tp_inst.support.ampm,tz=tp_inst._defaults.showTimezone!==null?tp_inst._defaults.showTimezone:tp_inst.support.timezone,dateChars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat")),datetimeChars=tp_inst._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,ampm?"APM":"").replace(/Tt/g,ampm?"AaPpMm":"").replace(/tT/g,ampm?"AaPpMm":"").replace(/T/g,ampm?"AP":"").replace(/tt/g,ampm?"apm":"").replace(/t/g,ampm?"ap":"")+" "+tp_inst._defaults.separator+tp_inst._defaults.timeSuffix+(tz?tp_inst._defaults.timezoneList.join(""):"")+tp_inst._defaults.amNames.join("")+tp_inst._defaults.pmNames.join("")+dateChars,chr=String.fromCharCode(event.charCode===undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!dateChars||datetimeChars.indexOf(chr)>-1)}}return $.datepicker._base_doKeyPress(event)};$.datepicker._base_updateAlternate=$.datepicker._updateAlternate;$.datepicker._updateAlternate=function(inst){var tp_inst=this._get(inst,"timepicker");if(tp_inst){var altField=tp_inst._defaults.altField;if(altField){var altFormat=tp_inst._defaults.altFormat||tp_inst._defaults.dateFormat,date=this._getDate(inst),formatCfg=$.datepicker._getFormatConfig(inst),altFormattedDateTime="",altSeparator=tp_inst._defaults.altSeparator?tp_inst._defaults.altSeparator:tp_inst._defaults.separator,altTimeSuffix=tp_inst._defaults.altTimeSuffix?tp_inst._defaults.altTimeSuffix:tp_inst._defaults.timeSuffix,altTimeFormat=tp_inst._defaults.altTimeFormat!==null?tp_inst._defaults.altTimeFormat:tp_inst._defaults.timeFormat;altFormattedDateTime+=$.datepicker.formatTime(altTimeFormat,tp_inst,tp_inst._defaults)+altTimeSuffix;if(!tp_inst._defaults.timeOnly&&!tp_inst._defaults.altFieldTimeOnly&&date!==null){if(tp_inst._defaults.altFormat){altFormattedDateTime=$.datepicker.formatDate(tp_inst._defaults.altFormat,date,formatCfg)+altSeparator+altFormattedDateTime}else{altFormattedDateTime=tp_inst.formattedDate+altSeparator+altFormattedDateTime}}$(altField).val(altFormattedDateTime)}}else{$.datepicker._base_updateAlternate(inst)}};$.datepicker._base_doKeyUp=$.datepicker._doKeyUp;$.datepicker._doKeyUp=function(event){var inst=$.datepicker._getInst(event.target),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst){if(tp_inst._defaults.timeOnly&&inst.input.val()!==inst.lastVal){try{$.datepicker._updateDatepicker(inst)}catch(err){$.timepicker.log(err)}}}return $.datepicker._base_doKeyUp(event)};$.datepicker._base_gotoToday=$.datepicker._gotoToday;$.datepicker._gotoToday=function(id){var inst=this._getInst($(id)[0]),$dp=inst.dpDiv;this._base_gotoToday(id);var tp_inst=this._get(inst,"timepicker");selectLocalTimezone(tp_inst);var now=new Date;this._setTime(inst,now);$(".ui-datepicker-today",$dp).click()};$.datepicker._disableTimepickerDatepicker=function(target){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");$(target).datepicker("getDate");if(tp_inst){inst.settings.showTimepicker=false;tp_inst._defaults.showTimepicker=false;tp_inst._updateDateTime(inst)}};$.datepicker._enableTimepickerDatepicker=function(target){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");$(target).datepicker("getDate");if(tp_inst){inst.settings.showTimepicker=true;tp_inst._defaults.showTimepicker=true;tp_inst._addTimePicker(inst);tp_inst._updateDateTime(inst)}};$.datepicker._setTime=function(inst,date){var tp_inst=this._get(inst,"timepicker");if(tp_inst){var defaults=tp_inst._defaults;tp_inst.hour=date?date.getHours():defaults.hour;tp_inst.minute=date?date.getMinutes():defaults.minute;tp_inst.second=date?date.getSeconds():defaults.second;tp_inst.millisec=date?date.getMilliseconds():defaults.millisec;tp_inst.microsec=date?date.getMicroseconds():defaults.microsec;tp_inst._limitMinMaxDateTime(inst,true);tp_inst._onTimeChange();tp_inst._updateDateTime(inst)}};$.datepicker._setTimeDatepicker=function(target,date,withDate){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");if(tp_inst){this._setDateFromField(inst);var tp_date;if(date){if(typeof date==="string"){tp_inst._parseTime(date,withDate);tp_date=new Date;tp_date.setHours(tp_inst.hour,tp_inst.minute,tp_inst.second,tp_inst.millisec);tp_date.setMicroseconds(tp_inst.microsec)}else{tp_date=new Date(date.getTime());tp_date.setMicroseconds(date.getMicroseconds())}if(tp_date.toString()==="Invalid Date"){tp_date=undefined}this._setTime(inst,tp_date)}}};$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker;$.datepicker._setDateDatepicker=function(target,date){var inst=this._getInst(target);if(!inst){return}if(typeof date==="string"){date=new Date(date);if(!date.getTime()){$.timepicker.log("Error creating Date object from string.")}}var tp_inst=this._get(inst,"timepicker");var tp_date;if(date instanceof Date){tp_date=new Date(date.getTime());tp_date.setMicroseconds(date.getMicroseconds())}else{tp_date=date}if(tp_inst&&tp_date){if(!tp_inst.support.timezone&&tp_inst._defaults.timezone===null){tp_inst.timezone=tp_date.getTimezoneOffset()*-1}date=$.timepicker.timezoneAdjust(date,tp_inst.timezone);tp_date=$.timepicker.timezoneAdjust(tp_date,tp_inst.timezone)}this._updateDatepicker(inst);this._base_setDateDatepicker.apply(this,arguments);this._setTimeDatepicker(target,tp_date,true)};$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker;$.datepicker._getDateDatepicker=function(target,noDefault){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");if(tp_inst){if(inst.lastVal===undefined){this._setDateFromField(inst,noDefault)}var date=this._getDate(inst);if(date&&tp_inst._parseTime($(target).val(),tp_inst.timeOnly)){date.setHours(tp_inst.hour,tp_inst.minute,tp_inst.second,tp_inst.millisec);date.setMicroseconds(tp_inst.microsec);if(tp_inst.timezone!=null){if(!tp_inst.support.timezone&&tp_inst._defaults.timezone===null){tp_inst.timezone=date.getTimezoneOffset()*-1}date=$.timepicker.timezoneAdjust(date,tp_inst.timezone)}}return date}return this._base_getDateDatepicker(target,noDefault)};$.datepicker._base_parseDate=$.datepicker.parseDate;$.datepicker.parseDate=function(format,value,settings){var date;try{date=this._base_parseDate(format,value,settings)}catch(err){if(err.indexOf(":")>=0){date=this._base_parseDate(format,value.substring(0,value.length-(err.length-err.indexOf(":")-2)),settings);$.timepicker.log("Error parsing the date string: "+err+"\ndate string = "+value+"\ndate format = "+format)}else{throw err}}return date};$.datepicker._base_formatDate=$.datepicker._formatDate;$.datepicker._formatDate=function(inst,day,month,year){var tp_inst=this._get(inst,"timepicker");if(tp_inst){tp_inst._updateDateTime(inst);return tp_inst.$input.val()}return this._base_formatDate(inst)};$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker;$.datepicker._optionDatepicker=function(target,name,value){var inst=this._getInst(target),name_clone;if(!inst){return null}var tp_inst=this._get(inst,"timepicker");if(tp_inst){var min=null,max=null,onselect=null,overrides=tp_inst._defaults.evnts,fns={},prop;if(typeof name==="string"){if(name==="minDate"||name==="minDateTime"){min=value}else if(name==="maxDate"||name==="maxDateTime"){max=value}else if(name==="onSelect"){onselect=value}else if(overrides.hasOwnProperty(name)){if(typeof value==="undefined"){return overrides[name]}fns[name]=value;name_clone={}}}else if(typeof name==="object"){if(name.minDate){min=name.minDate}else if(name.minDateTime){min=name.minDateTime}else if(name.maxDate){max=name.maxDate}else if(name.maxDateTime){max=name.maxDateTime}for(prop in overrides){if(overrides.hasOwnProperty(prop)&&name[prop]){fns[prop]=name[prop]}}}for(prop in fns){if(fns.hasOwnProperty(prop)){overrides[prop]=fns[prop];if(!name_clone){name_clone=$.extend({},name)}delete name_clone[prop]}}if(name_clone&&isEmptyObject(name_clone)){return}if(min){if(min===0){min=new Date}else{min=new Date(min)}tp_inst._defaults.minDate=min;tp_inst._defaults.minDateTime=min}else if(max){if(max===0){max=new Date}else{max=new Date(max)}tp_inst._defaults.maxDate=max;tp_inst._defaults.maxDateTime=max}else if(onselect){tp_inst._defaults.onSelect=onselect}}if(value===undefined){return this._base_optionDatepicker.call($.datepicker,target,name)}return this._base_optionDatepicker.call($.datepicker,target,name_clone||name,value)};var isEmptyObject=function(obj){var prop;for(prop in obj){if(obj.hasOwnProperty(prop)){return false}}return true};var extendRemove=function(target,props){$.extend(target,props);for(var name in props){if(props[name]===null||props[name]===undefined){target[name]=props[name]}}return target};var detectSupport=function(timeFormat){var tf=timeFormat.replace(/'.*?'/g,"").toLowerCase(),isIn=function(f,t){return f.indexOf(t)!==-1?true:false};return{hour:isIn(tf,"h"),minute:isIn(tf,"m"),second:isIn(tf,"s"),millisec:isIn(tf,"l"),microsec:isIn(tf,"c"),timezone:isIn(tf,"z"),ampm:isIn(tf,"t")&&isIn(timeFormat,"h"),iso8601:isIn(timeFormat,"Z")}};var convert24to12=function(hour){hour%=12;if(hour===0){hour=12}return String(hour)};var computeEffectiveSetting=function(settings,property){return settings&&settings[property]?settings[property]:$.timepicker._defaults[property]};var splitDateTime=function(dateTimeString,timeSettings){var separator=computeEffectiveSetting(timeSettings,"separator"),format=computeEffectiveSetting(timeSettings,"timeFormat"),timeParts=format.split(separator),timePartsLen=timeParts.length,allParts=dateTimeString.split(separator),allPartsLen=allParts.length;if(allPartsLen>1){return{dateString:allParts.splice(0,allPartsLen-timePartsLen).join(separator),timeString:allParts.splice(0,timePartsLen).join(separator)}}return{dateString:dateTimeString,timeString:""}};var parseDateTimeInternal=function(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings){var date,parts,parsedTime;parts=splitDateTime(dateTimeString,timeSettings);date=$.datepicker._base_parseDate(dateFormat,parts.dateString,dateSettings);if(parts.timeString===""){return{date:date}}parsedTime=$.datepicker.parseTime(timeFormat,parts.timeString,timeSettings);if(!parsedTime){throw"Wrong time format"}return{date:date,timeObj:parsedTime}};var selectLocalTimezone=function(tp_inst,date){if(tp_inst&&tp_inst.timezone_select){var now=date||new Date;tp_inst.timezone_select.val(-now.getTimezoneOffset())}};$.timepicker=new Timepicker;$.timepicker.timezoneOffsetString=function(tzMinutes,iso8601){if(isNaN(tzMinutes)||tzMinutes>840||tzMinutes<-720){return tzMinutes}var off=tzMinutes,minutes=off%60,hours=(off-minutes)/60,iso=iso8601?":":"",tz=(off>=0?"+":"-")+("0"+Math.abs(hours)).slice(-2)+iso+("0"+Math.abs(minutes)).slice(-2);if(tz==="+00:00"){return"Z"}return tz};$.timepicker.timezoneOffsetNumber=function(tzString){var normalized=tzString.toString().replace(":","");if(normalized.toUpperCase()==="Z"){return 0}if(!/^(\-|\+)\d{4}$/.test(normalized)){return tzString}return(normalized.substr(0,1)==="-"?-1:1)*(parseInt(normalized.substr(1,2),10)*60+parseInt(normalized.substr(3,2),10))};$.timepicker.timezoneAdjust=function(date,toTimezone){var toTz=$.timepicker.timezoneOffsetNumber(toTimezone);if(!isNaN(toTz)){date.setMinutes(date.getMinutes()+-date.getTimezoneOffset()-toTz)}return date};$.timepicker.timeRange=function(startTime,endTime,options){return $.timepicker.handleRange("timepicker",startTime,endTime,options)};$.timepicker.datetimeRange=function(startTime,endTime,options){$.timepicker.handleRange("datetimepicker",startTime,endTime,options)};$.timepicker.dateRange=function(startTime,endTime,options){$.timepicker.handleRange("datepicker",startTime,endTime,options)};$.timepicker.handleRange=function(method,startTime,endTime,options){options=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},options);var timeOnly=false;if(method==="timepicker"){timeOnly=true;method="datetimepicker"}function checkDates(changed,other){var startdt=startTime[method]("getDate"),enddt=endTime[method]("getDate"),changeddt=changed[method]("getDate");if(startdt!==null){var minDate=new Date(startdt.getTime()),maxDate=new Date(startdt.getTime());minDate.setMilliseconds(minDate.getMilliseconds()+options.minInterval);maxDate.setMilliseconds(maxDate.getMilliseconds()+options.maxInterval);if(options.minInterval>0&&minDate>enddt){endTime[method]("setDate",minDate)}else if(options.maxInterval>0&&maxDate<enddt){endTime[method]("setDate",maxDate)}else if(startdt>enddt){other[method]("setDate",changeddt)}}}function selected(changed,other,option){if(!changed.val()){return}var date=changed[method].call(changed,"getDate");if(date!==null&&options.minInterval>0){if(option==="minDate"){date.setMilliseconds(date.getMilliseconds()+options.minInterval)}if(option==="maxDate"){date.setMilliseconds(date.getMilliseconds()-options.minInterval)}}if(date.getTime){other[method].call(other,"option",option,date)}}$.fn[method].call(startTime,$.extend({timeOnly:timeOnly,onClose:function(dateText,inst){checkDates($(this),endTime)},onSelect:function(selectedDateTime){selected($(this),endTime,"minDate")}},options,options.start));$.fn[method].call(endTime,$.extend({timeOnly:timeOnly,onClose:function(dateText,inst){checkDates($(this),startTime)},onSelect:function(selectedDateTime){selected($(this),startTime,"maxDate")}},options,options.end));checkDates(startTime,endTime);selected(startTime,endTime,"minDate");selected(endTime,startTime,"maxDate");return $([startTime.get(0),endTime.get(0)])};$.timepicker.log=function(err){if(window.console){window.console.log(err)}};$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal};if(!Date.prototype.getMicroseconds){Date.prototype.microseconds=0;Date.prototype.getMicroseconds=function(){return this.microseconds};Date.prototype.setMicroseconds=function(m){this.setMilliseconds(this.getMilliseconds()+Math.floor(m/1e3));this.microseconds=m%1e3;return this}}$.timepicker.version="@@version"})(jQuery);

/*!
 * jQuery UI Sortable 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/sortable/
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],a):a(jQuery)}(function(a){return a.widget("ui.sortable",a.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(a,b,c){return a>=b&&a<b+c},_isFloating:function(a){return/left|right/.test(a.css("float"))||/inline|table-cell/.test(a.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(a,b){this._super(a,b),"handle"===a&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),a.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(b,c){var d=null,e=!1,f=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(b),a(b.target).parents().each(function(){if(a.data(this,f.widgetName+"-item")===f)return d=a(this),!1}),a.data(b.target,f.widgetName+"-item")===f&&(d=a(b.target)),!!d&&(!(this.options.handle&&!c&&(a(this.options.handle,d).find("*").addBack().each(function(){this===b.target&&(e=!0)}),!e))&&(this.currentItem=d,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(b,c,d){var e,f,g=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,g.cursorAt&&this._adjustOffsetFromHelper(g.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),g.containment&&this._setContainment(),g.cursor&&"auto"!==g.cursor&&(f=this.document.find("body"),this.storedCursor=f.css("cursor"),f.css("cursor",g.cursor),this.storedStylesheet=a("<style>*{ cursor: "+g.cursor+" !important; }</style>").appendTo(f)),g.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",g.opacity)),g.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",g.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!d)for(e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("activate",b,this._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!g.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){var c,d,e,f,g=this.options,h=!1;for(this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<g.scrollSensitivity?this.scrollParent[0].scrollTop=h=this.scrollParent[0].scrollTop+g.scrollSpeed:b.pageY-this.overflowOffset.top<g.scrollSensitivity&&(this.scrollParent[0].scrollTop=h=this.scrollParent[0].scrollTop-g.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<g.scrollSensitivity?this.scrollParent[0].scrollLeft=h=this.scrollParent[0].scrollLeft+g.scrollSpeed:b.pageX-this.overflowOffset.left<g.scrollSensitivity&&(this.scrollParent[0].scrollLeft=h=this.scrollParent[0].scrollLeft-g.scrollSpeed)):(b.pageY-this.document.scrollTop()<g.scrollSensitivity?h=this.document.scrollTop(this.document.scrollTop()-g.scrollSpeed):this.window.height()-(b.pageY-this.document.scrollTop())<g.scrollSensitivity&&(h=this.document.scrollTop(this.document.scrollTop()+g.scrollSpeed)),b.pageX-this.document.scrollLeft()<g.scrollSensitivity?h=this.document.scrollLeft(this.document.scrollLeft()-g.scrollSpeed):this.window.width()-(b.pageX-this.document.scrollLeft())<g.scrollSensitivity&&(h=this.document.scrollLeft(this.document.scrollLeft()+g.scrollSpeed))),h!==!1&&a.ui.ddmanager&&!g.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),c=this.items.length-1;c>=0;c--)if(d=this.items[c],e=d.item[0],f=this._intersectsWithPointer(d),f&&d.instance===this.currentContainer&&!(e===this.currentItem[0]||this.placeholder[1===f?"next":"prev"]()[0]===e||a.contains(this.placeholder[0],e)||"semi-dynamic"===this.options.type&&a.contains(this.element[0],e))){if(this.direction=1===f?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(d))break;this._rearrange(b,d),this._trigger("change",b,this._uiHash());break}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(b){if(a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b),this.options.revert){var d=this,e=this.placeholder.offset(),f=this.options.axis,g={};f&&"x"!==f||(g.left=e.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),f&&"y"!==f||(g.top=e.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,a(this.helper).animate(g,parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--)this.containers[b]._trigger("deactivate",null,this._uiHash(this)),this.containers[b].containerCache.over&&(this.containers[b]._trigger("out",null,this._uiHash(this)),this.containers[b].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[\-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l="x"===this.options.axis||d+j>h&&d+j<i,m="y"===this.options.axis||b+k>f&&b+k<g,n=l&&m;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?n:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(a){var b="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height),c="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width),d=b&&c,e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return!!d&&(this.floating?f&&"right"===f||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(a){var b=this._isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height),c=this._isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width),d=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?"right"===e&&c||"left"===e&&!c:d&&("down"===d&&b||"up"===d&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return 0!==a&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return 0!==a&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor===String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){function c(){h.push(this)}var d,e,f,g,h=[],i=[],j=this._connectWith();if(j&&b)for(d=j.length-1;d>=0;d--)for(f=a(j[d],this.document[0]),e=f.length-1;e>=0;e--)g=a.data(f[e],this.widgetFullName),g&&g!==this&&!g.options.disabled&&i.push([a.isFunction(g.options.items)?g.options.items.call(g.element):a(g.options.items,g.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),g]);for(i.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),d=i.length-1;d>=0;d--)i[d][0].each(c);return a(h)},_removeCurrentsFromItems:function(){var b=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=a.grep(this.items,function(a){for(var c=0;c<b.length;c++)if(b[c]===a.item[0])return!1;return!0})},_refreshItems:function(b){this.items=[],this.containers=[this];var c,d,e,f,g,h,i,j,k=this.items,l=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],m=this._connectWith();if(m&&this.ready)for(c=m.length-1;c>=0;c--)for(e=a(m[c],this.document[0]),d=e.length-1;d>=0;d--)f=a.data(e[d],this.widgetFullName),f&&f!==this&&!f.options.disabled&&(l.push([a.isFunction(f.options.items)?f.options.items.call(f.element[0],b,{item:this.currentItem}):a(f.options.items,f.element),f]),this.containers.push(f));for(c=l.length-1;c>=0;c--)for(g=l[c][1],h=l[c][0],d=0,j=h.length;d<j;d++)i=a(h[d]),i.data(this.widgetName+"-item",g),k.push({item:i,instance:g,width:0,height:0,left:0,top:0})},refreshPositions:function(b){this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var c,d,e,f;for(c=this.items.length-1;c>=0;c--)d=this.items[c],d.instance!==this.currentContainer&&this.currentContainer&&d.item[0]!==this.currentItem[0]||(e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item,b||(d.width=e.outerWidth(),d.height=e.outerHeight()),f=e.offset(),d.left=f.left,d.top=f.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(c=this.containers.length-1;c>=0;c--)f=this.containers[c].element.offset(),this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight();return this},_createPlaceholder:function(b){b=b||this;var c,d=b.options;d.placeholder&&d.placeholder.constructor!==String||(c=d.placeholder,d.placeholder={element:function(){var d=b.currentItem[0].nodeName.toLowerCase(),e=a("<"+d+">",b.document[0]).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===d?b._createTrPlaceholder(b.currentItem.find("tr").eq(0),a("<tr>",b.document[0]).appendTo(e)):"tr"===d?b._createTrPlaceholder(b.currentItem,e):"img"===d&&e.attr("src",b.currentItem.attr("src")),c||e.css("visibility","hidden"),e},update:function(a,e){c&&!d.forcePlaceholderSize||(e.height()||e.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10)))}}),b.placeholder=a(d.placeholder.element.call(b.element,b.currentItem)),b.currentItem.after(b.placeholder),d.placeholder.update(b,b.placeholder)},_createTrPlaceholder:function(b,c){var d=this;b.children().each(function(){a("<td>&#160;</td>",d.document[0]).attr("colspan",a(this).attr("colspan")||1).appendTo(c)})},_contactContainers:function(b){var c,d,e,f,g,h,i,j,k,l,m=null,n=null;for(c=this.containers.length-1;c>=0;c--)if(!a.contains(this.currentItem[0],this.containers[c].element[0]))if(this._intersectsWith(this.containers[c].containerCache)){if(m&&a.contains(this.containers[c].element[0],m.element[0]))continue;m=this.containers[c],n=c}else this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",b,this._uiHash(this)),this.containers[c].containerCache.over=0);if(m)if(1===this.containers.length)this.containers[n].containerCache.over||(this.containers[n]._trigger("over",b,this._uiHash(this)),this.containers[n].containerCache.over=1);else{for(e=1e4,f=null,k=m.floating||this._isFloating(this.currentItem),g=k?"left":"top",h=k?"width":"height",l=k?"clientX":"clientY",d=this.items.length-1;d>=0;d--)a.contains(this.containers[n].element[0],this.items[d].item[0])&&this.items[d].item[0]!==this.currentItem[0]&&(i=this.items[d].item.offset()[g],j=!1,b[l]-i>this.items[d][h]/2&&(j=!0),Math.abs(b[l]-i)<e&&(e=Math.abs(b[l]-i),f=this.items[d],this.direction=j?"up":"down"));if(!f&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[n])return void(this.currentContainer.containerCache.over||(this.containers[n]._trigger("over",b,this._uiHash()),this.currentContainer.containerCache.over=1));f?this._rearrange(b,f,null,!0):this._rearrange(b,null,this.containers[n].element,!0),this._trigger("change",b,this._uiHash()),this.containers[n]._trigger("change",b,this._uiHash(this)),this.currentContainer=this.containers[n],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[n]._trigger("over",b,this._uiHash(this)),this.containers[n].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):"clone"===c.helper?this.currentItem.clone():this.currentItem;return d.parents("body").length||a("parent"!==c.appendTo?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),d[0].style.width&&!c.forceHelperSize||d.width(this.currentItem.width()),d[0].style.height&&!c.forceHelperSize||d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&a.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&a.ui.ie)&&(b={top:0,left:0}),{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b,c,d,e=this.options;"parent"===e.containment&&(e.containment=this.helper[0].parentNode),"document"!==e.containment&&"window"!==e.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===e.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===e.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(e.containment)||(b=a(e.containment)[0],c=a(e.containment).offset(),d="hidden"!==a(b).css("overflow"),this.containment=[c.left+(parseInt(a(b).css("borderLeftWidth"),10)||0)+(parseInt(a(b).css("paddingLeft"),10)||0)-this.margins.left,c.top+(parseInt(a(b).css("borderTopWidth"),10)||0)+(parseInt(a(b).css("paddingTop"),10)||0)-this.margins.top,c.left+(d?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(a(b).css("borderLeftWidth"),10)||0)-(parseInt(a(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,c.top+(d?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(a(b).css("borderTopWidth"),10)||0)-(parseInt(a(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(b,c){c||(c=this.position);var d="absolute"===b?1:-1,e="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&a.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,f=/(html|body)/i.test(e[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():f?0:e.scrollTop())*d,left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():f?0:e.scrollLeft())*d}},_generatePosition:function(b){var c,d,e=this.options,f=b.pageX,g=b.pageY,h="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&a.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(h[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top)),e.grid&&(c=this.originalPageY+Math.round((g-this.originalPageY)/e.grid[1])*e.grid[1],g=this.containment?c-this.offset.click.top>=this.containment[1]&&c-this.offset.click.top<=this.containment[3]?c:c-this.offset.click.top>=this.containment[1]?c-e.grid[1]:c+e.grid[1]:c,d=this.originalPageX+Math.round((f-this.originalPageX)/e.grid[0])*e.grid[0],f=this.containment?d-this.offset.click.left>=this.containment[0]&&d-this.offset.click.left<=this.containment[2]?d:d-this.offset.click.left>=this.containment[0]?d-e.grid[0]:d+e.grid[0]:d)),{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():i?0:h.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():i?0:h.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this.counter;this._delay(function(){e===this.counter&&this.refreshPositions(!d)})},_clear:function(a,b){function c(a,b,c){return function(d){c._trigger(a,d,b._uiHash(b))}}this.reverting=!1;var d,e=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(d in this._storedCSS)"auto"!==this._storedCSS[d]&&"static"!==this._storedCSS[d]||(this._storedCSS[d]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!b&&e.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||b||e.push(function(a){this._trigger("update",a,this._uiHash())}),this!==this.currentContainer&&(b||(e.push(function(a){this._trigger("remove",a,this._uiHash())}),e.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.currentContainer)),e.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.currentContainer)))),d=this.containers.length-1;d>=0;d--)b||e.push(c("deactivate",this,this.containers[d])),this.containers[d].containerCache.over&&(e.push(c("out",this,this.containers[d])),this.containers[d].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,b||this._trigger("beforeStop",a,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!b){for(d=0;d<e.length;d++)e[d].call(this,a);this._trigger("stop",a,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}})});

/* <![CDATA[ */
var gd_plupload = {"base_plupload_config":"{\"runtimes\":\"html5,silverlight,flash,browserplus,gears,html4\",\"browse_button\":\"plupload-browse-button\",\"container\":\"plupload-upload-ui\",\"drop_element\":\"dropbox\",\"file_data_name\":\"async-upload\",\"multiple_queues\":true,\"max_file_size\":\"2mb\",\"url\":\"http:\\\/\\\/www.new-brennanhealingscience.org\\\/directory\\\/wp-admin\\\/admin-ajax.php\",\"flash_swf_url\":\"http:\\\/\\\/www.new-brennanhealingscience.org\\\/directory\\\/wp-includes\\\/js\\\/plupload\\\/plupload.flash.swf\",\"silverlight_xap_url\":\"http:\\\/\\\/www.new-brennanhealingscience.org\\\/directory\\\/wp-includes\\\/js\\\/plupload\\\/plupload.silverlight.xap\",\"filters\":[{\"title\":\"Allowed Files\",\"extensions\":\"*\"}],\"multipart\":true,\"urlstream_upload\":true,\"multi_selection\":false,\"multipart_params\":{\"_ajax_nonce\":\"\",\"action\":\"plupload_action\",\"imgid\":0}}","upload_img_size":"2mb"};
/* ]]> */

jQuery.fn.exists=function(){return jQuery(this).length>0};jQuery(document).ready(function($){if($(".plupload-upload-uic").exists()){var pconfig=false;var msgErr="";$(".plupload-upload-uic").each(function(){var $this=$(this);var id1=$this.attr("id");var imgId=id1.replace("plupload-upload-ui","");plu_show_thumbs(imgId);pconfig=JSON.parse(gd_plupload.base_plupload_config);pconfig["browse_button"]=imgId+pconfig["browse_button"];pconfig["container"]=imgId+pconfig["container"];pconfig["drop_element"]=imgId+pconfig["drop_element"];pconfig["file_data_name"]=imgId+pconfig["file_data_name"];pconfig["multipart_params"]["imgid"]=imgId;pconfig["multipart_params"]["_ajax_nonce"]=$this.find(".ajaxnonceplu").attr("id").replace("ajaxnonceplu","");if($this.hasClass("plupload-upload-uic-multiple")){pconfig["multi_selection"]=true}if($this.find(".plupload-resize").exists()){var w=parseInt($this.find(".plupload-width").attr("id").replace("plupload-width",""));var h=parseInt($this.find(".plupload-height").attr("id").replace("plupload-height",""));pconfig["resize"]={width:w,height:h,quality:90}}var allowed_exts=jQuery("#"+imgId+"_allowed_types").val();allowed_exts=allowed_exts&&allowed_exts!=""?allowed_exts:"";if(imgId=="post_images"&&typeof geodir_all_js_msg.gd_allowed_img_types!="undefined"&&geodir_all_js_msg.gd_allowed_img_types!=""){allowed_exts=geodir_all_js_msg.gd_allowed_img_types}if(allowed_exts&&allowed_exts!=""){var txt_all_files=typeof geodir_all_js_msg.geodir_txt_all_files!="undefined"&&geodir_all_js_msg.geodir_txt_all_files!=""?geodir_all_js_msg.geodir_txt_all_files:"Allowed files";pconfig["filters"]=[{title:txt_all_files,extensions:allowed_exts}]}var uploader=new plupload.Uploader(pconfig);uploader.bind("Init",function(up){});uploader.init();uploader.bind("Error",function(up,files){if(files.code==-600){jQuery("#"+imgId+"upload-error").addClass("upload-error");if(typeof geodir_all_js_msg.geodir_err_max_file_size!="undefined"&&geodir_all_js_msg.geodir_err_max_file_size!=""){msgErr=geodir_all_js_msg.geodir_err_max_file_size}else{msgErr="File size error : You tried to upload a file over %s"}msgErr=msgErr.replace("%s",gd_plupload.upload_img_size);jQuery("#"+imgId+"upload-error").html(msgErr)}else if(files.code==-601){jQuery("#"+imgId+"upload-error").addClass("upload-error");if(typeof geodir_all_js_msg.geodir_err_file_type!="undefined"&&geodir_all_js_msg.geodir_err_file_type!=""){msgErr=geodir_all_js_msg.geodir_err_file_type}else{msgErr="File type error. Allowed file types: %s"}if(imgId=="post_images"){var txtReplace=allowed_exts!=""?"."+allowed_exts.replace(/,/g,", ."):"*";msgErr=msgErr.replace("%s",txtReplace)}else{msgErr=msgErr.replace("%s",jQuery("#"+imgId+"_allowed_types").attr("data-exts"))}jQuery("#"+imgId+"upload-error").html(msgErr)}else{jQuery("#"+imgId+"upload-error").addClass("upload-error");jQuery("#"+imgId+"upload-error").html(files.message)}});totalImg=jQuery("#"+imgId+"totImg").val();limitImg=jQuery("#"+imgId+"image_limit").val();uploader.bind("FilesAdded",function(up,files){jQuery("#"+imgId+"upload-error").html("");jQuery("#"+imgId+"upload-error").removeClass("upload-error");if(limitImg&&$this.hasClass("plupload-upload-uic-multiple")&&jQuery("#"+imgId+"image_limit").val()){if(totalImg==limitImg&&parseInt(limitImg)>0){while(up.files.length>0){up.removeFile(up.files[0])}if(typeof geodir_all_js_msg.geodir_err_file_upload_limit!="undefined"&&geodir_all_js_msg.geodir_err_file_upload_limit!=""){msgErr=geodir_all_js_msg.geodir_err_file_upload_limit}else{msgErr="You have reached your upload limit of %s files."}msgErr=msgErr.replace("%s",limitImg);jQuery("#"+imgId+"upload-error").addClass("upload-error");jQuery("#"+imgId+"upload-error").html(msgErr);return false}if(up.files.length>limitImg&&parseInt(limitImg)>0){while(up.files.length>0){up.removeFile(up.files[0])}if(typeof geodir_all_js_msg.geodir_err_pkg_upload_limit!="undefined"&&geodir_all_js_msg.geodir_err_pkg_upload_limit!=""){msgErr=geodir_all_js_msg.geodir_err_pkg_upload_limit}else{msgErr="You may only upload %s files with this package, please try again."}msgErr=msgErr.replace("%s",limitImg);jQuery("#"+imgId+"upload-error").addClass("upload-error");jQuery("#"+imgId+"upload-error").html(msgErr);return false}}$.each(files,function(i,file){$this.find(".filelist").append('<div class="file" id="'+file.id+'"><b>'+file.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(file.size)+") "+'<div class="fileprogress"></div></div>')});up.refresh();up.start()});uploader.bind("UploadProgress",function(up,file){$("#"+file.id+" .fileprogress").width(file.percent+"%");$("#"+file.id+" span").html(plupload.formatSize(parseInt(file.size*file.percent/100)))});var timer;var i=0;var indexes=new Array;uploader.bind("FileUploaded",function(up,file,response){indexes[i]=up;clearInterval(timer);timer=setTimeout(function(){},1e3);i++;$("#"+file.id).fadeOut();response=response["response"];if($this.hasClass("plupload-upload-uic-multiple")){totalImg++;var v1=$.trim($("#"+imgId).val());if(v1){v1=v1+","+response}else{v1=response}$("#"+imgId).val(v1)}else{$("#"+imgId).val(response+"")}plu_show_thumbs(imgId)})})}});function geodir_remove_file_index(indexes){for(var i=0;i<indexes.length;i++){if(indexes[i].files.length>0){indexes[i].removeFile(indexes[i].files[0])}}}function plu_show_thumbs(imgId){var $=jQuery;var thumbsC=$("#"+imgId+"plupload-thumbs");thumbsC.html("");var imagesS=$("#"+imgId).val();var txtRemove="Remove";if(typeof geodir_all_js_msg.geodir_action_remove!="undefined"&&geodir_all_js_msg.geodir_action_remove!=""){txtRemove=geodir_all_js_msg.geodir_action_remove}var images=imagesS.split(",");for(var i=0;i<images.length;i++){if(images[i]&&images[i]!="null"){var file_ext=images[i].substring(images[i].lastIndexOf(".")+1);file_ext=file_ext.split("?").shift();var fileNameIndex=images[i].lastIndexOf("/")+1;var dotIndex=images[i].lastIndexOf(".");if(dotIndex<fileNameIndex){continue}var file_name=images[i].substr(fileNameIndex,dotIndex<fileNameIndex?loc.length:dotIndex);if(file_ext=="jpg"||file_ext=="jpe"||file_ext=="jpeg"||file_ext=="png"||file_ext=="gif"||file_ext=="bmp"||file_ext=="ico"){var thumb=$('<div class="thumb" id="thumb'+imgId+i+'"><div class="thumbi"><a id="thumbremovelink'+imgId+i+'" href="#">'+txtRemove+'</a></div><img src="'+images[i]+'" alt=""  /></div>')}else{file_name=file_name.split(imgId+"_");var thumb=$('<div class="thumb geodir_file" id="thumb'+imgId+i+'"><div class="thumbi"><a id="thumbremovelink'+imgId+i+'" href="#">'+txtRemove+'</a></div><a target="_blank" href="'+images[i]+'">'+file_name[file_name.length-1]+"</a></div>")}thumbsC.append(thumb);thumb.find("a","thumbi").click(function(){if(jQuery("#"+imgId+"plupload-upload-ui").hasClass("plupload-upload-uic-multiple"))totalImg--;jQuery("#"+imgId+"upload-error").html("");jQuery("#"+imgId+"upload-error").removeClass("upload-error");var ki=$(this).attr("id").replace("thumbremovelink"+imgId,"");ki=parseInt(ki);var kimages=[];imagesS=$("#"+imgId).val();images=imagesS.split(",");for(var j=0;j<images.length;j++){if(j!=ki){kimages[kimages.length]=images[j]}}$("#"+imgId).val(kimages.join());plu_show_thumbs(imgId);return false})}}if(images.length>1){thumbsC.sortable({update:function(event,ui){var kimages=[];thumbsC.find("img").each(function(){kimages[kimages.length]=$(this).attr("src");$("#"+imgId).val(kimages.join());plu_show_thumbs(imgId)})}});thumbsC.disableSelection()}}

!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){var t=function(){function t(){var t=this,n=function(){var n=[t.options.wrapperClass];""!==t.options.theme&&n.push("br-theme-"+t.options.theme),t.$elem.wrap(e("<div />",{"class":n.join(" ")}))},r=function(){t.$elem.unwrap()},a=function(){var n;return n=t.options.initialRating?e('option[value="'+t.options.initialRating+'"]',t.$elem):e("option:selected",t.$elem)},i=function(e){var n=t.$elem.data("barrating");return"undefined"!=typeof e?n[e]:n},o=function(e,n){null!==n&&"object"==typeof n?t.$elem.data("barrating",n):t.$elem.data("barrating")[e]=n},s=function(){var e=a();o(null,{userOptions:t.options,ratingValue:e.val(),ratingText:e.data("html")?e.data("html"):e.text(),originalRatingValue:e.val(),originalRatingText:e.data("html")?e.data("html"):e.text(),readOnly:t.options.readonly,deselectable:t.$elem.find("option:first").val()?!1:!0})},l=function(){t.$elem.removeData("barrating")},u=function(){return i("ratingText")},d=function(){return i("ratingValue")},c=function(){var n=e("<div />",{"class":"br-widget"});return t.$elem.find("option").each(function(){var r,a,i,o;r=e(this).val(),r&&(a=e(this).text(),i=e(this).data("html"),i&&(a=i),o=e("<a />",{href:"#","data-rating-value":r,"data-rating-text":a,html:t.options.showValues?a:""}),n.append(o))}),t.options.showSelectedRating&&n.append(e("<div />",{text:"","class":"br-current-rating"})),t.options.reverse&&n.addClass("br-reverse"),t.options.readonly&&n.addClass("br-readonly"),n},f=function(){return t.options.reverse?"nextAll":"prevAll"},g=function(e){t.$elem.find('option[value="'+e+'"]').prop("selected",!0),t.$elem.change()},p=function(e){e=e?e:u(),t.options.showSelectedRating&&t.$elem.parent().find(".br-current-rating").text(e)},h=function(){t.$widget.find("a").removeClass("br-selected br-current"),t.$widget.find('a[data-rating-value="'+d()+'"]').addClass("br-selected br-current")[f()]().addClass("br-selected")},v=function(e){return e.hasClass("br-current")&&i("deselectable")},b=function(n){n.on("click.barrating",function(r){var a,i,s=e(this);return r.preventDefault(),n.removeClass("br-active br-selected"),s.addClass("br-selected")[f()]().addClass("br-selected"),a=s.attr("data-rating-value"),i=s.attr("data-rating-text"),v(s)?(s.removeClass("br-selected br-current")[f()]().removeClass("br-selected br-current"),a="",i=""):(n.removeClass("br-current"),s.addClass("br-current")),o("ratingValue",a),o("ratingText",i),g(a),p(i),t.options.onSelect.call(t,d(),u(),r),!1})},m=function(t){t.on("mouseenter.barrating",function(){var n=e(this);t.removeClass("br-active br-selected"),n.addClass("br-active")[f()]().addClass("br-active"),p(n.attr("data-rating-text"))})},$=function(e){t.$widget.on("mouseleave.barrating",function(){e.removeClass("br-active"),p(),h()})},w=function(t){t.on("touchstart.barrating",function(t){t.preventDefault(),t.stopPropagation(),e(this).click()})},y=function(e){e.on("click.barrating",function(e){e.preventDefault()})},C=function(e){b(e),t.options.hoverState&&(m(e),$(e))},x=function(e){e.off(".barrating")},R=function(e){$elements=t.$widget.find("a"),w&&w($elements),e?(x($elements),y($elements)):C($elements)};this.show=function(){i()||(n(),s(),t.$widget=c(),t.$widget.insertAfter(t.$elem),h(),p(),R(t.options.readonly),t.$elem.hide())},this.readonly=function(e){"boolean"==typeof e&&i("readOnly")!=e&&(R(e),o("readOnly",e),t.$widget.toggleClass("br-readonly"))},this.set=function(e){var n=i("userOptions");t.$elem.find('option[value="'+e+'"]').val()&&(o("ratingValue",e),o("ratingText",t.$elem.find('option[value="'+e+'"]').text()),g(d()),p(u()),h(),n.silent||n.onSelect.call(this,d(),u()))},this.clear=function(){var e=i("userOptions");o("ratingValue",i("originalRatingValue")),o("ratingText",i("originalRatingText")),g(d()),p(u()),h(),e.onClear.call(this,d(),u())},this.destroy=function(){var e=d(),n=u(),a=i("userOptions");x(t.$widget.find("a")),t.$widget.remove(),l(),r(),t.$elem.show(),a.onDestroy.call(this,e,n)}}return t.prototype.init=function(t,n){return this.$elem=e(n),this.options=e.extend({},e.fn.barrating.defaults,t),this.options},t}();e.fn.barrating=function(n,r){return this.each(function(){var a=new t;if(e(this).is("select")||e.error("Sorry, this plugin only works with select fields."),a.hasOwnProperty(n)){if(a.init(r,this),"show"===n)return a.show(r);if(a.$elem.data("barrating"))return a.$widget=e(this).next(".br-widget"),a[n](r)}else{if("object"==typeof n||!n)return r=n,a.init(r,this),a.show();e.error("Method "+n+" does not exist on jQuery.barrating")}})},e.fn.barrating.defaults={theme:"",initialRating:null,showValues:!1,showSelectedRating:!0,reverse:!1,readonly:!1,fastClicks:!0,hoverState:!0,silent:!1,wrapperClass:"br-wrapper",onSelect:function(e,t,n){},onClear:function(e,t){},onDestroy:function(e,t){}},e.fn.barrating.BarRating=t});

function geodir_click_search($this){setTimeout(function(){jQuery($this).parent().find(".geodir_submit_search").click()},100)}function addToFavourite(post_id,action){var fav_url;var ajax_action;if(action=="add"){ajax_action="add"}else{ajax_action="remove"}jQuery.ajax({url:geodir_all_js_msg.geodir_admin_ajax_url,type:"GET",dataType:"html",data:{action:"geodir_ajax_action",geodir_ajax:"favorite",ajax_action:ajax_action,pid:post_id},timeout:2e4,error:function(){alert(geodir_all_js_msg.loading_listing_error_favorite)},success:function(html){jQuery(".favorite_property_"+post_id).html(html)}});return false}jQuery(document).ready(function($){if(geodir_all_js_msg.fa_rating){jQuery(".gd-fa-rating").barrating({theme:"fontawesome-stars",onSelect:function(value,text,event){if(geodir_all_js_msg.multirating){if(jQuery(this.$elem).closest("form").attr("id")=="post"){jQuery(this.$elem).closest(".br-theme-fontawesome-stars").parent().find("[name^=geodir_rating]").val(value)}else{jQuery(this.$elem).parent().parent().find(".geodir_reviewratings_current_rating").val(value)}}else{jQuery("#geodir_overallrating").val(value)}}})}else{jQuery(".gd_rating").jRating({bigStarsPath:geodir_all_js_msg.geodir_default_rating_star_icon,smallStarsPath:geodir_all_js_msg.geodir_plugin_url+"/geodirectory-assets/images/small.png",phpPath:geodir_all_js_msg.geodir_plugin_url+"/jRating.php",type:"big",step:true,isDisabled:false,showRateInfo:true,canRateAgain:true,length:5,decimalLength:0,rateMax:5,rateInfosX:-45,rateInfosY:5,nbRates:100,onSuccess:function(element,rate){jQuery("#geodir_overallrating").val(rate)},onTouchstart:function(element,rate){jQuery("#geodir_overallrating").val(rate)},onError:function(){alert(geodir_all_js_msg.rating_error_msg)}})}jQuery("#geodir_location_prefix").attr("disabled","disabled");jQuery(".button-primary").click(function(){var error=false;var characterReg=/^\s*[a-zA-Z0-9,\s]+\s*$/;var listing_prefix=jQuery("#geodir_listing_prefix").val();var location_prefix=jQuery("#geodir_location_prefix").val();var listingurl_separator=jQuery("#geodir_listingurl_separator").val();var detailurl_separator=jQuery("#geodir_detailurl_separator").val();if(listing_prefix==""){alert(geodir_all_js_msg.listing_url_prefix_msg);jQuery("#geodir_listing_prefix").focus();error=true}if(/^[a-z0-90\_9_-]*$/.test(listing_prefix)==false&&listing_prefix!=""){jQuery("#geodir_listing_prefix").focus();alert(geodir_all_js_msg.invalid_listing_prefix_msg);error=true}if(error==true){return false}else{return true}});jQuery(".map_post_type").click(function(){var divshow=jQuery(this).val();if(jQuery(this).is(":checked")){jQuery("#"+divshow+" input").each(function(){jQuery(this).attr("checked","checked")})}else{jQuery("#"+divshow+" input").each(function(){jQuery(this).removeAttr("checked")})}})});function gd_replace_accents(s){var chars=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];for(var i=0;i<chars.length;i++){s=s.replace(chars[i].letters,chars[i].base)}return s}jQuery(function($){try{if(window.gdMaps=="osm"){$('input[name="post_address"]').autocomplete({source:function(request,response){$.ajax({url:(location.protocol==="https:"?"https:":"http:")+"//nominatim.openstreetmap.org/search",dataType:"json",data:{q:request.term,format:"json",addressdetails:1,limit:5},success:function(data,textStatus,jqXHR){jQuery('input[name="post_address"]').removeClass("ui-autocomplete-loading");response(data)},error:function(jqXHR,textStatus,errorThrown){console.log(errorThrown)},complete:function(jqXHR,textStatus){jQuery('input[name="post_address"]').removeClass("ui-autocomplete-loading")}})},autoFocus:true,minLength:1,appendTo:jQuery('input[name="post_address"]').closest(".geodir_form_row"),open:function(event,ui){jQuery('input[name="post_address"]').removeClass("ui-autocomplete-loading")},select:function(event,ui){item=gd_osm_parse_item(ui.item);event.preventDefault();$('input[name="post_address"]').val(item.display_address);geocodeResponseOSM(item,true)},close:function(event,ui){jQuery('input[name="post_address"]').removeClass("ui-autocomplete-loading")}}).autocomplete("instance")._renderItem=function(ul,item){if(!ul.hasClass("gd-osm-results")){ul.addClass("gd-osm-results")}var label=item.display_name;if(label&&this.term){label=gd_highlight(label,this.term)}return $("<li>").width($('input[name="post_address"]').outerWidth()).append('<i class="fa fa-map-marker"></i><span>'+label+"</span>").appendTo(ul)}}}catch(e){}$("#gd_make_duplicates").click(function(){var $btn=$(this);var $el=$(this).closest(".gd-duplicate-table");var nonce=$(this).data("nonce");var post_id=$(this).data("post-id");var dups=[];$.each($('input[name="gd_icl_dup[]"]:checked',$el),function(){dups.push($(this).val())});if(!dups.length||!post_id){$('input[name="gd_icl_dup[]"]',$el).focus();return false}var data={action:"geodir_ajax_action",geodir_ajax:"duplicate",post_id:post_id,dups:dups.join(","),_nonce:nonce};jQuery.ajax({url:geodir_all_js_msg.geodir_admin_ajax_url,data:data,type:"POST",cache:false,dataType:"json",beforeSend:function(xhr){$(".fa-refresh",$el).show();$btn.attr("disabled","disabled")},success:function(res,status,xhr){if(typeof res=="object"&&res){if(res.success){window.location.href=document.location.href;return}if(res.error){alert(res.error)}}}}).complete(function(xhr,status){$(".fa-refresh",$el).hide();$btn.removeAttr("disabled")})})});jQuery(function(){if(window.gdMaps==="google"){console.log("Google Maps API Loaded :)");jQuery("body").addClass("gd-google-maps")}else if(window.gdMaps==="osm"){console.log("Leaflet | OpenStreetMap API Loaded :)");jQuery("body").addClass("gd-osm-gmaps")}else{console.log("Maps API Not Loaded :(");jQuery("body").addClass("gd-no-gmaps")}});var gdMaps=null;if((window.gdSetMap=="google"||window.gdSetMap=="auto")&&window.google&&typeof google.maps!=="undefined"){gdMaps="google"}else if((window.gdSetMap=="osm"||window.gdSetMap=="auto")&&typeof L!=="undefined"&&typeof L.version!=="undefined"){gdMaps="osm"}window.gdMaps=window.gdMaps||gdMaps;

function prepareGeolocation(opt_force){if(opt_force||typeof navigator.geolocation=="undefined"||navigator.geolocation.shim)(function(){(function(){if(window.google&&google.gears){return}var factory=null;if(typeof GearsFactory!="undefined"){factory=new GearsFactory}else{try{factory=new ActiveXObject("Gears.Factory");if(factory.getBuildInfo().indexOf("ie_mobile")!=-1){factory.privateSetGlobalObject(this)}}catch(e){if(typeof navigator.mimeTypes!="undefined"&&navigator.mimeTypes["application/x-googlegears"]){factory=document.createElement("object");factory.style.display="none";factory.width=0;factory.height=0;factory.type="application/x-googlegears";document.documentElement.appendChild(factory)}}}if(!factory){return}if(!window.google){google={}}if(!google.gears){google.gears={factory:factory}}})();var GearsGeoLocation=function(){var geo=google.gears.factory.create("beta.geolocation");var wrapSuccess=function(callback,self){return function(position){callback(position);self.lastPosition=position}};return{shim:true,type:"Gears",lastPosition:null,getCurrentPosition:function(successCallback,errorCallback,options){var self=this;var sc=wrapSuccess(successCallback,self);geo.getCurrentPosition(sc,errorCallback,options)},watchPosition:function(successCallback,errorCallback,options){geo.watchPosition(successCallback,errorCallback,options)},clearWatch:function(watchId){geo.clearWatch(watchId)},getPermission:function(siteName,imageUrl,extraMessage){geo.getPermission(siteName,imageUrl,extraMessage)}}}();var AjaxGeoLocation=function(){var loading=false;var loadGoogleLoader=function(){if(!hasGoogleLoader()&&!loading){loading=true;var s=document.createElement("script");s.src="http://www.google.com/jsapi?callback=_google_loader_apiLoaded";s.type="text/javascript";document.getElementsByTagName("body")[0].appendChild(s)}};var queue=[];var addLocationQueue=function(callback){queue.push(callback)};var runLocationQueue=function(){if(hasGoogleLoader()){while(queue.length>0){var call=queue.pop();call()}}};window["_google_loader_apiLoaded"]=function(){runLocationQueue()};var hasGoogleLoader=function(){return window["google"]&&google["loader"]};var checkGoogleLoader=function(callback){if(hasGoogleLoader())return true;addLocationQueue(callback);loadGoogleLoader();return false};loadGoogleLoader();return{shim:true,type:"ClientLocation",lastPosition:null,getCurrentPosition:function(successCallback,errorCallback,options){var self=this;if(!checkGoogleLoader(function(){self.getCurrentPosition(successCallback,errorCallback,options)}))return;if(google.loader.ClientLocation){var cl=google.loader.ClientLocation;var position={latitude:cl.latitude,longitude:cl.longitude,altitude:null,accuracy:43e3,altitudeAccuracy:null,heading:null,velocity:null,timestamp:new Date,address:{city:cl.address.city,country:cl.address.country,country_code:cl.address.country_code,region:cl.address.region}};successCallback(position);this.lastPosition=position}else if(errorCallback==="function"){errorCallback({code:3,message:"Using the Google ClientLocation API and it is not able to calculate a location."})}},watchPosition:function(successCallback,errorCallback,options){this.getCurrentPosition(successCallback,errorCallback,options);var self=this;var watchId=setInterval(function(){self.getCurrentPosition(successCallback,errorCallback,options)},1e4);return watchId},clearWatch:function(watchId){clearInterval(watchId)},getPermission:function(siteName,imageUrl,extraMessage){return true}}}();navigator.geolocation=window.google&&google.gears&&google.gears.factory.create?GearsGeoLocation:AjaxGeoLocation})()}

/*!
 * jQuery blockUI plugin
 * Version 2.70.0-2014.11.23
 * Requires jQuery v1.7 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2013 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */
!function(){"use strict";function a(a){function b(b,d){var f,p,q=b==window,r=d&&void 0!==d.message?d.message:void 0;if(d=a.extend({},a.blockUI.defaults,d||{}),!d.ignoreIfBlocked||!a(b).data("blockUI.isBlocked")){if(d.overlayCSS=a.extend({},a.blockUI.defaults.overlayCSS,d.overlayCSS||{}),f=a.extend({},a.blockUI.defaults.css,d.css||{}),d.onOverlayClick&&(d.overlayCSS.cursor="pointer"),p=a.extend({},a.blockUI.defaults.themedCSS,d.themedCSS||{}),r=void 0===r?d.message:r,q&&n&&c(window,{fadeOut:0}),r&&"string"!=typeof r&&(r.parentNode||r.jquery)){var s=r.jquery?r[0]:r,t={};a(b).data("blockUI.history",t),t.el=s,t.parent=s.parentNode,t.display=s.style.display,t.position=s.style.position,t.parent&&t.parent.removeChild(s)}a(b).data("blockUI.onUnblock",d.onUnblock);var u,v,w,x,y=d.baseZ;u=a(k||d.forceIframe?'<iframe class="blockUI" style="z-index:'+y++ +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+d.iframeSrc+'"></iframe>':'<div class="blockUI" style="display:none"></div>'),v=a(d.theme?'<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+y++ +';display:none"></div>':'<div class="blockUI blockOverlay" style="z-index:'+y++ +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),d.theme&&q?(x='<div class="blockUI '+d.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(y+10)+';display:none;position:fixed">',d.title&&(x+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(d.title||"&nbsp;")+"</div>"),x+='<div class="ui-widget-content ui-dialog-content"></div>',x+="</div>"):d.theme?(x='<div class="blockUI '+d.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(y+10)+';display:none;position:absolute">',d.title&&(x+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(d.title||"&nbsp;")+"</div>"),x+='<div class="ui-widget-content ui-dialog-content"></div>',x+="</div>"):x=q?'<div class="blockUI '+d.blockMsgClass+' blockPage" style="z-index:'+(y+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+d.blockMsgClass+' blockElement" style="z-index:'+(y+10)+';display:none;position:absolute"></div>',w=a(x),r&&(d.theme?(w.css(p),w.addClass("ui-widget-content")):w.css(f)),d.theme||v.css(d.overlayCSS),v.css("position",q?"fixed":"absolute"),(k||d.forceIframe)&&u.css("opacity",0);var z=[u,v,w],A=a(q?"body":b);a.each(z,function(){this.appendTo(A)}),d.theme&&d.draggable&&a.fn.draggable&&w.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var B=m&&(!a.support.boxModel||a("object,embed",q?null:b).length>0);if(l||B){if(q&&d.allowBodyStretch&&a.support.boxModel&&a("html,body").css("height","100%"),(l||!a.support.boxModel)&&!q)var C=i(b,"borderTopWidth"),D=i(b,"borderLeftWidth"),E=C?"(0 - "+C+")":0,F=D?"(0 - "+D+")":0;a.each(z,function(a,b){var c=b[0].style;if(c.position="absolute",2>a)q?c.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+d.quirksmodeOffsetHack+') + "px"'):c.setExpression("height",'this.parentNode.offsetHeight + "px"'),q?c.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):c.setExpression("width",'this.parentNode.offsetWidth + "px"'),F&&c.setExpression("left",F),E&&c.setExpression("top",E);else if(d.centerY)q&&c.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),c.marginTop=0;else if(!d.centerY&&q){var e=d.css&&d.css.top?parseInt(d.css.top,10):0,f="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+e+') + "px"';c.setExpression("top",f)}})}if(r&&(d.theme?w.find(".ui-widget-content").append(r):w.append(r),(r.jquery||r.nodeType)&&a(r).show()),(k||d.forceIframe)&&d.showOverlay&&u.show(),d.fadeIn){var G=d.onBlock?d.onBlock:j,H=d.showOverlay&&!r?G:j,I=r?G:j;d.showOverlay&&v._fadeIn(d.fadeIn,H),r&&w._fadeIn(d.fadeIn,I)}else d.showOverlay&&v.show(),r&&w.show(),d.onBlock&&d.onBlock.bind(w)();if(e(1,b,d),q?(n=w[0],o=a(d.focusableElements,n),d.focusInput&&setTimeout(g,20)):h(w[0],d.centerX,d.centerY),d.timeout){var J=setTimeout(function(){q?a.unblockUI(d):a(b).unblock(d)},d.timeout);a(b).data("blockUI.timeout",J)}}}function c(b,c){var f,g=b==window,h=a(b),i=h.data("blockUI.history"),j=h.data("blockUI.timeout");j&&(clearTimeout(j),h.removeData("blockUI.timeout")),c=a.extend({},a.blockUI.defaults,c||{}),e(0,b,c),null===c.onUnblock&&(c.onUnblock=h.data("blockUI.onUnblock"),h.removeData("blockUI.onUnblock"));var k;k=g?a(document.body).children().filter(".blockUI").add("body > .blockUI"):h.find(">.blockUI"),c.cursorReset&&(k.length>1&&(k[1].style.cursor=c.cursorReset),k.length>2&&(k[2].style.cursor=c.cursorReset)),g&&(n=o=null),c.fadeOut?(f=k.length,k.stop().fadeOut(c.fadeOut,function(){0===--f&&d(k,i,c,b)})):d(k,i,c,b)}function d(b,c,d,e){var f=a(e);if(!f.data("blockUI.isBlocked")){b.each(function(a,b){this.parentNode&&this.parentNode.removeChild(this)}),c&&c.el&&(c.el.style.display=c.display,c.el.style.position=c.position,c.el.style.cursor="default",c.parent&&c.parent.appendChild(c.el),f.removeData("blockUI.history")),f.data("blockUI.static")&&f.css("position","static"),"function"==typeof d.onUnblock&&d.onUnblock(e,d);var g=a(document.body),h=g.width(),i=g[0].style.width;g.width(h-1).width(h),g[0].style.width=i}}function e(b,c,d){var e=c==window,g=a(c);if((b||(!e||n)&&(e||g.data("blockUI.isBlocked")))&&(g.data("blockUI.isBlocked",b),e&&d.bindEvents&&(!b||d.showOverlay))){var h="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";b?a(document).bind(h,d,f):a(document).unbind(h,f)}}function f(b){if("keydown"===b.type&&b.keyCode&&9==b.keyCode&&n&&b.data.constrainTabKey){var c=o,d=!b.shiftKey&&b.target===c[c.length-1],e=b.shiftKey&&b.target===c[0];if(d||e)return setTimeout(function(){g(e)},10),!1}var f=b.data,h=a(b.target);return h.hasClass("blockOverlay")&&f.onOverlayClick&&f.onOverlayClick(b),h.parents("div."+f.blockMsgClass).length>0?!0:0===h.parents().children().filter("div.blockUI").length}function g(a){if(o){var b=o[a===!0?o.length-1:0];b&&b.focus()}}function h(a,b,c){var d=a.parentNode,e=a.style,f=(d.offsetWidth-a.offsetWidth)/2-i(d,"borderLeftWidth"),g=(d.offsetHeight-a.offsetHeight)/2-i(d,"borderTopWidth");b&&(e.left=f>0?f+"px":"0"),c&&(e.top=g>0?g+"px":"0")}function i(b,c){return parseInt(a.css(b,c),10)||0}a.fn._fadeIn=a.fn.fadeIn;var j=a.noop||function(){},k=/MSIE/.test(navigator.userAgent),l=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),m=(document.documentMode||0,a.isFunction(document.createElement("div").style.setExpression));a.blockUI=function(a){b(window,a)},a.unblockUI=function(a){c(window,a)},a.growlUI=function(b,c,d,e){var f=a('<div class="growlUI"></div>');b&&f.append("<h1>"+b+"</h1>"),c&&f.append("<h2>"+c+"</h2>"),void 0===d&&(d=3e3);var g=function(b){b=b||{},a.blockUI({message:f,fadeIn:"undefined"!=typeof b.fadeIn?b.fadeIn:700,fadeOut:"undefined"!=typeof b.fadeOut?b.fadeOut:1e3,timeout:"undefined"!=typeof b.timeout?b.timeout:d,centerY:!1,showOverlay:!1,onUnblock:e,css:a.blockUI.defaults.growlCSS})};g();f.css("opacity");f.mouseover(function(){g({fadeIn:0,timeout:3e4});var b=a(".blockMsg");b.stop(),b.fadeTo(300,1)}).mouseout(function(){a(".blockMsg").fadeOut(1e3)})},a.fn.block=function(c){if(this[0]===window)return a.blockUI(c),this;var d=a.extend({},a.blockUI.defaults,c||{});return this.each(function(){var b=a(this);d.ignoreIfBlocked&&b.data("blockUI.isBlocked")||b.unblock({fadeOut:0})}),this.each(function(){"static"==a.css(this,"position")&&(this.style.position="relative",a(this).data("blockUI.static",!0)),this.style.zoom=1,b(this,c)})},a.fn.unblock=function(b){return this[0]===window?(a.unblockUI(b),this):this.each(function(){c(this,b)})},a.blockUI.version=2.7,a.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var n=null,o=[]}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],a):a(jQuery)}();

jQuery(document).ready(function () {



    if ( jQuery( "a.sd-my-account-link" ).length ) {
        jQuery('a.sd-my-account-link').click(function (e) {
            e.preventDefault();
            e.stopPropagation();
            jQuery('.sd-my-account-dd').toggle();
        });

        jQuery(document).click(function (e) {
            if (e.target.class != 'sd-my-account-dd' && !jQuery('.sd-my-account-dd').find(e.target).length) {
                jQuery('.sd-my-account-dd').hide();
            }
        });
    }

    jQuery("body").on("geodir_setup_search_form", function(){
        if (jQuery(".geodir-cat-list-tax").length) {
            var postType = jQuery('.featured-area .search_by_post').val()
            jQuery(".geodir-cat-list-tax").val(postType + "category");
            jQuery(".geodir-cat-list-tax").change();
        }
    });

    jQuery("#showMap").click(function () {
        jQuery('body').addClass('sd-map-only').removeClass('sd-listings-only');
        jQuery( "#hideMap" ).appendTo( ".gd_listing_map_TopLeft" );

    });

    jQuery("#hideMap").click(function () {
        jQuery('body').addClass('sd-listings-only').removeClass('sd-map-only');
        jQuery( "#hideMap" ).appendTo( ".sd-mobile-search-controls" );

    });

    jQuery("#showSearch").click(function () {
        jQuery("body").toggleClass('sd-show-search');

        if ( typeof geodir_reposition_compass == 'function' ) {
                    geodir_reposition_compass();
        }

    });
    

    if ( jQuery( ".sd-detail-cta a.dt-btn" ).length ) {
        jQuery(".sd-detail-cta a.dt-btn").click(function () {
            sd_scroll_to_reviews();
        });
    }

    if ( jQuery( ".sd-ratings a.geodir-pcomments" ).length ) {
        jQuery(".sd-ratings a.geodir-pcomments").click(function () {
            sd_scroll_to_reviews();
        });
    }

});

function sd_scroll_to_reviews(){
    jQuery('.geodir-tab-head [data-tab="#reviews"]').closest('dd').trigger('click');
    setTimeout(function(){jQuery('html,body').animate({scrollTop:jQuery('#respond').offset().top}, 'slow');console.log('scroll')}, 200);
}


function sd_adjust_head(){
    var headHeight = jQuery('#site-header').height();

    if ( jQuery( "body").hasClass('admin-bar') ) {

        // if admin bar present then set margin top to 0 so we can adjust things later
        if(jQuery('html').css("margin-top")!='0px'){
            jQuery('html').attr('style', jQuery('html').attr('style') + '; ' + 'margin-top: 0 !important');
        }


        var winWidth = jQuery( window ).width();

        if(winWidth>782){
            headHeight = headHeight + 32;
        }else{
            headHeight = headHeight + 46;
        }

    }

    if(headHeight>0){headHeight = headHeight-1;}
    jQuery("#geodir_wrapper").css({
        'margin-top': headHeight+"px"
    });

    jQuery("#geodir_content").css({
        height: "calc(100vh - "+headHeight+"px)",
       // 'margin-top': headHeight+"px",
        'overflow-y': "scroll",
        '-webkit-overflow-scrolling': "touch"
    });

    jQuery("#gd-sidebar-wrapper").css({
        height: "calc(100vh - "+headHeight+"px)",
       // 'margin-top': headHeight+"px",
        'overflow': "hidden"
    });

    jQuery(".sd.search.geodir-page #sticky_map_gd_listing_map, .sd.archive.geodir-page #sticky_map_gd_listing_map").css({
        height: "calc(100vh - "+headHeight+"px)",
       // 'margin-top': headHeight+"px",
        'overflow': "hidden"
    });

    jQuery(".sd.search.geodir-page #gd_listing_map_wrapper, .sd.search.geodir-page #gd_listing_map, .sd.search.geodir-page #gd_listing_map_loading_div, .sd.archive.geodir-page #gd_listing_map_wrapper, .sd.archive.geodir-page #gd_listing_map, .sd.archive.geodir-page #gd_listing_map_loading_div").css({
        height: "calc(100vh - "+headHeight+"px)",
        // 'margin-top': headHeight+"px",
        'overflow': "hidden"
    });




}

(function(){

    // if header is fixed adjest the content to push it down and make it 100vh
    if(jQuery('#site-header').css("position") == "fixed") {
        sd_adjust_head();

        jQuery( window ).resize(function() {
            sd_adjust_head();
        });
    }


    if ( jQuery( ".featured-img" ).length ) {

        var windowHeight = screen.height;


        var parallax = document.querySelectorAll(".featured-img"),
            speed = 0.6;
        var bPos = jQuery( ".featured-img").css("background-position");
        var arrBpos= bPos.split(' ');
        var originalBpos = arrBpos[1];
        var fetHeight = parseInt(jQuery( ".featured-area").css("height"));
        var fetAreHeight = jQuery( ".featured-area").offset().top + fetHeight;


        window.onscroll = function () {
            var f =0;
            [].slice.call(parallax).forEach(function (el, i) {
                if(f>1){return;}
                var windowYOffset = window.pageYOffset;

                originalBpos = parseInt(originalBpos);

                var perc =  windowYOffset / fetAreHeight + (originalBpos / 100);

                //"50% calc("+originalBpos+" - " + (windowYOffset * speed) + "px)"

                parallaxPercent = 100*perc;
                if(parallaxPercent>100){parallaxPercent=100;}

                jQuery(el).css("background-position","50% "+parallaxPercent+"%" );
                f++;

            });
        };
    }

    jQuery("#sd-home-scroll").click(function(event) {
        event.preventDefault();
        jQuery('html, body').animate({
            scrollTop: jQuery(".featured-area").outerHeight()
        }, 1000);
    });

})();


/**
 * @todo findout what we are doing about account mobile menu, using GD or building our own.
 */
jQuery(document).ready(function ($) {

    var $dt_menuright = jQuery("#primary-nav");
    $dt_menuright.mmenu({
        offCanvas: {
            position: "right"
        }
    }, {
        clone: 1
    }); // clone it so we can do responsive


    // if the location switcher present then make it swap the switcher to the correct position when open
    if (jQuery('#menu-item-gd-location-switcher').length) {
        jQuery('#mm-primary-nav').on(
            "opened.mm",
            function () {
                jQuery("#menu-item-gd-location-switcher:first .geodir_location_tab_container").detach().appendTo('#mm-primary-nav .gd-location-switcher-menu-item');
                jQuery('#mm-primary-nav .geodir_location_tab_container.mm-panel').remove();
            }
        );

        jQuery('#mm-primary-nav').on(
            "closed.mm",
            function () {
                jQuery("#mm-primary-nav .geodir_location_tab_container").detach().appendTo('#menu-item-gd-location-switcher:first .gd-location-switcher-menu-item');
            }
        );
    }


    if (jQuery('#gd-account-nav').length) {

        var $dt_menuleft = jQuery("#gd-account-nav");
        $dt_menuleft.mmenu({}, {});

        // The chosen select is broken after load so we destroy and rebuild
        jQuery(".mm-menu .geodir-loginbox-list li select").chosen("destroy");
        jQuery(".mm-menu .geodir-loginbox-list li select").chosen({});

    }
});


/*	
 * jQuery mmenu v4.7.5
 * @requires jQuery 1.7.0 or later
 *
 * mmenu.frebsite.nl
 *	
 * Copyright (c) Fred Heusschen
 * www.frebsite.nl
 *
 * Licensed under the MIT license:
 * http://en.wikipedia.org/wiki/MIT_License
 */
!function(e){function n(){l=!0,d.$wndw=e(window),d.$html=e("html"),d.$body=e("body"),e.each([i,a,o],function(e,n){n.add=function(e){e=e.split(" ");for(var t in e)n[e[t]]=n.mm(e[t])}}),i.mm=function(e){return"mm-"+e},i.add("wrapper menu inline panel nopanel list nolist subtitle selected label spacer current highest hidden opened subopened subopen fullsubopen subclose"),i.umm=function(e){return"mm-"==e.slice(0,3)&&(e=e.slice(3)),e},a.mm=function(e){return"mm-"+e},a.add("parent"),o.mm=function(e){return e+".mm"},o.add("toggle open close setSelected transitionend webkitTransitionEnd mousedown mouseup touchstart touchmove touchend scroll resize click keydown keyup"),e[t]._c=i,e[t]._d=a,e[t]._e=o,e[t].glbl=d}var t="mmenu",s="4.7.5";if(!e[t]){var i={},a={},o={},l=!1,d={$wndw:null,$html:null,$body:null};e[t]=function(n,s,i){this.$menu=n,this.opts=s,this.conf=i,this.vars={},"function"==typeof this.___deprecated&&this.___deprecated(),this._initMenu(),this._initAnchors(),this._initEvents();var a=this.$menu.children(this.conf.panelNodetype);for(var o in e[t].addons)e[t].addons[o]._add.call(this),e[t].addons[o]._add=function(){},e[t].addons[o]._setup.call(this);return this._init(a),"function"==typeof this.___debug&&this.___debug(),this},e[t].version=s,e[t].addons={},e[t].uniqueId=0,e[t].defaults={classes:"",slidingSubmenus:!0,onClick:{setSelected:!0}},e[t].configuration={panelNodetype:"ul, ol, div",transitionDuration:400,openingInterval:25,classNames:{panel:"Panel",selected:"Selected",label:"Label",spacer:"Spacer"}},e[t].prototype={_init:function(n){n=n.not("."+i.nopanel),n=this._initPanels(n);for(var s in e[t].addons)e[t].addons[s]._init.call(this,n);this._update()},_initMenu:function(){this.opts.offCanvas&&this.conf.clone&&(this.$menu=this.$menu.clone(!0),this.$menu.add(this.$menu.find("*")).filter("[id]").each(function(){e(this).attr("id",i.mm(e(this).attr("id")))})),this.$menu.contents().each(function(){3==e(this)[0].nodeType&&e(this).remove()}),this.$menu.parent().addClass(i.wrapper);var n=[i.menu];n.push(i.mm(this.opts.slidingSubmenus?"horizontal":"vertical")),this.opts.classes&&n.push(this.opts.classes),this.$menu.addClass(n.join(" "))},_initPanels:function(n){var t=this;this.__findAddBack(n,"ul, ol").not("."+i.nolist).addClass(i.list);var s=this.__findAddBack(n,"."+i.list).find("> li");this.__refactorClass(s,this.conf.classNames.selected,"selected"),this.__refactorClass(s,this.conf.classNames.label,"label"),this.__refactorClass(s,this.conf.classNames.spacer,"spacer"),s.off(o.setSelected).on(o.setSelected,function(n,t){n.stopPropagation(),s.removeClass(i.selected),"boolean"!=typeof t&&(t=!0),t&&e(this).addClass(i.selected)}),this.__refactorClass(this.__findAddBack(n,"."+this.conf.classNames.panel),this.conf.classNames.panel,"panel"),n.add(this.__findAddBack(n,"."+i.list).children().children().filter(this.conf.panelNodetype).not("."+i.nopanel)).addClass(i.panel);var l=this.__findAddBack(n,"."+i.panel),d=e("."+i.panel,this.$menu);if(l.each(function(){var n=e(this),s=n.attr("id")||t.__getUniqueId();n.attr("id",s)}),l.each(function(){var n=e(this),s=n.is("ul, ol")?n:n.find("ul ,ol").first(),o=n.parent(),l=o.children("a, span"),d=o.closest("."+i.panel);if(o.parent().is("."+i.list)&&!n.data(a.parent)){n.data(a.parent,o);var r=e('<a class="'+i.subopen+'" href="#'+n.attr("id")+'" />').insertBefore(l);l.is("a")||r.addClass(i.fullsubopen),t.opts.slidingSubmenus&&s.prepend('<li class="'+i.subtitle+'"><a class="'+i.subclose+'" href="#'+d.attr("id")+'">'+l.text()+"</a></li>")}}),this.opts.slidingSubmenus){var r=this.__findAddBack(n,"."+i.list).find("> li."+i.selected);r.parents("li").removeClass(i.selected).end().add(r.parents("li")).each(function(){var n=e(this),t=n.find("> ."+i.panel);t.length&&(n.parents("."+i.panel).addClass(i.subopened),t.addClass(i.opened))}).closest("."+i.panel).addClass(i.opened).parents("."+i.panel).addClass(i.subopened)}else{var r=e("li."+i.selected,d);r.parents("li").removeClass(i.selected).end().add(r.parents("li")).addClass(i.opened)}var u=d.filter("."+i.opened);return u.length||(u=l.first()),u.addClass(i.opened).last().addClass(i.current),this.opts.slidingSubmenus&&l.not(u.last()).addClass(i.hidden).end().appendTo(this.$menu),l},_initAnchors:function(){var n=this;d.$body.on(o.click,"a",function(s){var a=e(this),l=!1,r=n.$menu.find(a).length;for(var u in e[t].addons)if(e[t].addons[u]._clickAnchor&&(l=e[t].addons[u]._clickAnchor.call(n,a,r)))break;if(!l&&r){var c=a.attr("href")||"";if("#"==c.slice(0,1))try{e(c,n.$menu).is("."+i.panel)&&(l=!0,e(c).trigger(n.opts.slidingSubmenus?o.open:o.toggle))}catch(p){}}if(l&&s.preventDefault(),!l&&r&&a.is("."+i.list+" > li > a")&&!a.is('[rel="external"]')&&!a.is('[target="_blank"]')){n.__valueOrFn(n.opts.onClick.setSelected,a)&&a.parent().trigger(o.setSelected);var h=n.__valueOrFn(n.opts.onClick.preventDefault,a,"#"==c.slice(0,1));h&&s.preventDefault(),n.__valueOrFn(n.opts.onClick.blockUI,a,!h)&&d.$html.addClass(i.blocking),n.__valueOrFn(n.opts.onClick.close,a,h)&&n.$menu.trigger(o.close)}})},_initEvents:function(){var n=this;this.$menu.on(o.toggle+" "+o.open+" "+o.close,"."+i.panel,function(e){e.stopPropagation()}),this.opts.slidingSubmenus?this.$menu.on(o.open,"."+i.panel,function(){return n._openSubmenuHorizontal(e(this))}):this.$menu.on(o.toggle,"."+i.panel,function(){var n=e(this);n.trigger(n.parent().hasClass(i.opened)?o.close:o.open)}).on(o.open,"."+i.panel,function(){e(this).parent().addClass(i.opened)}).on(o.close,"."+i.panel,function(){e(this).parent().removeClass(i.opened)})},_openSubmenuHorizontal:function(n){if(n.hasClass(i.current))return!1;var t=e("."+i.panel,this.$menu),s=t.filter("."+i.current);return t.removeClass(i.highest).removeClass(i.current).not(n).not(s).addClass(i.hidden),n.hasClass(i.opened)?s.addClass(i.highest).removeClass(i.opened).removeClass(i.subopened):(n.addClass(i.highest),s.addClass(i.subopened)),n.removeClass(i.hidden).addClass(i.current),setTimeout(function(){n.removeClass(i.subopened).addClass(i.opened)},this.conf.openingInterval),"open"},_update:function(e){if(this.updates||(this.updates=[]),"function"==typeof e)this.updates.push(e);else for(var n=0,t=this.updates.length;t>n;n++)this.updates[n].call(this,e)},__valueOrFn:function(e,n,t){return"function"==typeof e?e.call(n[0]):"undefined"==typeof e&&"undefined"!=typeof t?t:e},__refactorClass:function(e,n,t){return e.filter("."+n).removeClass(n).addClass(i[t])},__findAddBack:function(e,n){return e.find(n).add(e.filter(n))},__transitionend:function(e,n,t){var s=!1,i=function(){s||n.call(e[0]),s=!0};e.one(o.transitionend,i),e.one(o.webkitTransitionEnd,i),setTimeout(i,1.1*t)},__getUniqueId:function(){return i.mm(e[t].uniqueId++)}},e.fn[t]=function(s,i){return l||n(),s=e.extend(!0,{},e[t].defaults,s),i=e.extend(!0,{},e[t].configuration,i),this.each(function(){var n=e(this);n.data(t)||n.data(t,new e[t](n,s,i))})},e[t].support={touch:"ontouchstart"in window||navigator.msMaxTouchPoints}}}(jQuery);
/*	
 * jQuery mmenu offCanvas addon
 * mmenu.frebsite.nl
 *
 * Copyright (c) Fred Heusschen
 */
!function(e){var t="mmenu",o="offCanvas";e[t].addons[o]={_init:function(){},_setup:function(){if(this.opts[o]){var t=this,s=this.opts[o],p=this.conf[o];"string"!=typeof p.pageSelector&&(p.pageSelector="> "+p.pageNodetype),a.$allMenus=(a.$allMenus||e()).add(this.$menu),this.vars.opened=!1;var r=[n.offcanvas];"left"!=s.position&&r.push(n.mm(s.position)),"back"!=s.zposition&&r.push(n.mm(s.zposition)),this.$menu.addClass(r.join(" ")).parent().removeClass(n.wrapper),this.setPage(a.$page),this[o+"_initBlocker"](),this[o+"_initWindow"](),this.$menu.on(i.open+" "+i.opening+" "+i.opened+" "+i.close+" "+i.closing+" "+i.closed+" "+i.setPage,function(e){e.stopPropagation()}).on(i.open+" "+i.close+" "+i.setPage,function(e){t[e.type]()}),this.$menu[p.menuInjectMethod+"To"](p.menuWrapperSelector)}},_add:function(){n=e[t]._c,s=e[t]._d,i=e[t]._e,n.add("offcanvas slideout modal background opening blocker page"),s.add("style"),i.add("opening opened closing closed setPage"),a=e[t].glbl},_clickAnchor:function(e){if(!this.opts[o])return!1;var t=this.$menu.attr("id");if(t&&t.length&&(this.conf.clone&&(t=n.umm(t)),e.is('[href="#'+t+'"]')))return this.open(),!0;if(a.$page){var t=a.$page.attr("id");return t&&t.length&&e.is('[href="#'+t+'"]')?(this.close(),!0):!1}}},e[t].defaults[o]={position:"left",zposition:"back",modal:!1,moveBackground:!0},e[t].configuration[o]={pageNodetype:"div",pageSelector:null,menuWrapperSelector:"body",menuInjectMethod:"prepend"},e[t].prototype.open=function(){if(this.vars.opened)return!1;var e=this;return this._openSetup(),setTimeout(function(){e._openFinish()},this.conf.openingInterval),"open"},e[t].prototype._openSetup=function(){var e=this;a.$allMenus.not(this.$menu).trigger(i.close),a.$page.data(s.style,a.$page.attr("style")||""),a.$wndw.trigger(i.resize,[!0]);var t=[n.opened];this.opts[o].modal&&t.push(n.modal),this.opts[o].moveBackground&&t.push(n.background),"left"!=this.opts[o].position&&t.push(n.mm(this.opts[o].position)),"back"!=this.opts[o].zposition&&t.push(n.mm(this.opts[o].zposition)),this.opts.classes&&t.push(this.opts.classes),a.$html.addClass(t.join(" ")),setTimeout(function(){e.vars.opened=!0},this.conf.openingInterval),this.$menu.addClass(n.current+" "+n.opened)},e[t].prototype._openFinish=function(){var e=this;this.__transitionend(a.$page,function(){e.$menu.trigger(i.opened)},this.conf.transitionDuration),a.$html.addClass(n.opening),this.$menu.trigger(i.opening)},e[t].prototype.close=function(){if(!this.vars.opened)return!1;var e=this;return this.__transitionend(a.$page,function(){e.$menu.removeClass(n.current).removeClass(n.opened),a.$html.removeClass(n.opened).removeClass(n.modal).removeClass(n.background).removeClass(n.mm(e.opts[o].position)).removeClass(n.mm(e.opts[o].zposition)),e.opts.classes&&a.$html.removeClass(e.opts.classes),a.$page.attr("style",a.$page.data(s.style)),e.vars.opened=!1,e.$menu.trigger(i.closed)},this.conf.transitionDuration),a.$html.removeClass(n.opening),this.$menu.trigger(i.closing),"close"},e[t].prototype.setPage=function(t){t||(t=e(this.conf[o].pageSelector,a.$body),t.length>1&&(t=t.wrapAll("<"+this.conf[o].pageNodetype+" />").parent())),t.addClass(n.page+" "+n.slideout),a.$page=t},e[t].prototype[o+"_initWindow"]=function(){a.$wndw.on(i.keydown,function(e){return a.$html.hasClass(n.opened)&&9==e.keyCode?(e.preventDefault(),!1):void 0});var s=0;a.$wndw.on(i.resize,function(e,t){if(t||a.$html.hasClass(n.opened)){var o=a.$wndw.height();(t||o!=s)&&(s=o,a.$page.css("minHeight",o))}}),e[t].prototype[o+"_initWindow"]=function(){}},e[t].prototype[o+"_initBlocker"]=function(){var s=e('<div id="'+n.blocker+'" class="'+n.slideout+'" />').appendTo(a.$body);s.on(i.touchstart,function(e){e.preventDefault(),e.stopPropagation(),s.trigger(i.mousedown)}).on(i.mousedown,function(e){e.preventDefault(),a.$html.hasClass(n.modal)||a.$allMenus.trigger(i.close)}),e[t].prototype[o+"_initBlocker"]=function(){}};var n,s,i,a}(jQuery);

!function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c<i.length;c++){if(d=i[c],!d.getAttribute("data-secret"))f=Math.random().toString(36).substr(2,10),d.src+="#?secret="+f,d.setAttribute("data-secret",f);if(g||h)a=d.cloneNode(!0),a.removeAttribute("security"),d.parentNode.replaceChild(a,d)}}}var d=!1,e=!1;if(b.querySelector)if(a.addEventListener)d=!0;if(a.wp=a.wp||{},!a.wp.receiveEmbedMessage)if(a.wp.receiveEmbedMessage=function(c){var d=c.data;if(d.secret||d.message||d.value)if(!/[^a-zA-Z0-9]/.test(d.secret)){var e,f,g,h,i,j=b.querySelectorAll('iframe[data-secret="'+d.secret+'"]'),k=b.querySelectorAll('blockquote[data-secret="'+d.secret+'"]');for(e=0;e<k.length;e++)k[e].style.display="none";for(e=0;e<j.length;e++)if(f=j[e],c.source===f.contentWindow){if(f.removeAttribute("style"),"height"===d.message){if(g=parseInt(d.value,10),g>1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);

(function() {
				var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');

						request = true;
		
				b[c] = b[c].replace( rcs, ' ' );
				// The customizer requires postMessage and CORS (if the site is cross domain)
				b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;
			}());

