!function(e){e(function(){var t={desktop:{wrap:e("#zem_rp_desktop_theme_options_wrap"),theme_area:e("#zem_rp_desktop_theme_area"),current_theme:e("#zem_rp_desktop_theme_selected").val()}},n=e("#zem_rp_static_base_url").val(),_=e("#zem_rp_json_url").val(),a=e("#zem_rp_version").val(),s=null,m=function(){e.each(t,function(t,_){var a=_.wrap.find("div.theme-list"),m=_.wrap.find("div.theme-screenshot"),c=function(t){if(t.val()){var t=n+"img/zem-themes/"+t.val().replace(/\.css$/,".jpg"),_=m.find("img");if(_.length){if(_.attr("src")===t)return}else _=e("<img />"),m.html(_);_.attr("src",t)}else m.html("")};a.empty(),e.each(s[t],function(e,n){"custom.css"!=n.location&&a.append('<label class="theme-label"><input '+(n.location===_.current_theme?'checked="checked"':"")+' class="theme-option" type="radio" name="zem_rp_'+t+'_theme_name" value="'+n.location+'" /> '+n.name+"</label><br />")}),a.on("hover","label.theme-label",function(){c(e("input",this))}),a.on("mouseleave",function(){c(a.find("input:checked"))}),c(a.find("input:checked")),_.theme_area.show()})},c=function(t){var n=e("#zem_rp_"+t+"_custom_theme_enabled:checked"),_=e("#zem_rp_"+t+"_theme_custom_css_wrap");n.length?(_.show(),n.closest("label").addClass("zem_rp_settings_button_disabled")):(_.hide(),e("#zem_rp_"+t+"_custom_theme_enabled").closest("label").removeClass("zem_rp_settings_button_disabled"))},o=!1;window.wp_rp_themes_cb=function(t){t&&t.themes&&(s=t.themes)&&(o=!0,m()),o&&e("#wp_rp_theme_options_wrap").show()},e.each(t,function(t){c(t),e("#zem_rp_"+t+"_custom_theme_enabled").on("change",function(){c(t)})}),window.zem_rp_themes_cb=function(e){e&&e.themes&&(s=e.themes)&&m()};var r=document.createElement("script"),l=document.getElementsByTagName("body").item(0);r.type="text/javascript",r.src=_+"themes2.js?plv="+a,l.appendChild(r)})}(jQuery);