jQuery(document).on("ready widget-updated widget-added",function(){jQuery(".accordion_advance h4").click(function(){jQuery(this).next(".pane_advance").slideToggle("slow").siblings(".pane_advance:visible").slideUp("slow");jQuery(this).toggleClass("current");jQuery(this).siblings("h4").removeClass("current")})});jQuery(document).ready(function(a){function b(c){var d=true,e=wp.media.editor.send.attachment;a("body").on("click",c,function(j){var i="#"+a(this).attr("id");var g=a(i);var f=wp.media.editor.send.attachment;var h=a(i);var k=h.attr("id").replace("_button","");d=true;wp.media.editor.send.attachment=function(l,m){if(d){a(".custom_media_id").val(m.id);a(".custom_media_url").val(m.url);a(".custom_media_image").attr("src",m.url).css("display","block")}else{return e.apply(i,[l,m])}};wp.media.editor.open(h);return false})}b(".custom_media_button.button")});function mediaPicker(c){var a;var b;b=jQuery("#"+c).prev().attr("id");if(a){a.open();return}a=wp.media.frames.file_frame=wp.media({title:"Insert Images",button:{text:"Insert Images"},type:"image",multiple:false});a.on("select",function(){var d=a.state().get("selection");d.map(function(e){e=e.toJSON();jQuery("#"+b).val(""+e.url+"").trigger("change");jQuery("#"+b).parent().find(".media-picker-preview, .media-picker-remove").remove();if(e.sizes.medium){jQuery("#"+b).parent().prepend('')}else{jQuery("#"+b).parent().prepend('')}});jQuery(".media-picker-remove").on("click",function(f){jQuery(this).parent().find(".media-picker").val("").trigger("change");jQuery(this).parent().find(".media-picker-preview, .media-picker-remove").remove()})});a.open()}jQuery(document).on("ready widget-updated widget-added",function(){jQuery(".media-picker-remove").on("click",function(a){jQuery(this).parent().find(".media-picker").val("").trigger("change");jQuery(this).parent().find(".media-picker-preview, .media-picker-remove").remove()})});jQuery(document).ready(function(a){a(".my_meta_control .color-picker").wpColorPicker()});(function(c){function b(d){d.find(".color-picker").wpColorPicker({change:_.throttle(function(){c(this).trigger("change")},2000)})}function a(d,e){b(e)}c(document).on("widget-added widget-updated",a);c(document).ready(function(){c("#widgets-right .widget:has(.color-picker)").each(function(){b(c(this))})})}(jQuery));jQuery(document).ready(function(a){var b;a("#meta-image-button").click(function(c){c.preventDefault();if(b){b.open();return}b=wp.media.frames.meta_image_frame=wp.media({title:meta_image.title,button:{text:meta_image.button},library:{type:"image"}});b.on("select",function(){var d=b.state().get("selection").first().toJSON();a("#meta-image").val(d.url)});b.open()})});