// same as jQuery $
// but throw an exception if no elements are found
$_=function(a,b){var c=jQuery(a,b);if(!c.length)throw b?"expected '$('"+a+"','"+b+"') to match something":"expected '"+a+"' to match something";return c};if(window.WebvantaVersions===undefined){var v;v=window.WebvantaVersions={library:{},add:function(a,b,c){var d=b.split(/\s+/),e=v.library[a]||{};while(d.length)e[d.shift()]=c;v.library[a]=e},use:function(a,b){return v.library[a][b]||v.error("non-existent library version: "+a+"-"+b)},debug:!1,error:function(a){v.debug&&(window.console?(console.error||console.log)(a):window.opera&&opera.postError?opera.postError(a):alert(a))}}}if(typeof WebvantaAdmin=="undefined"||!WebvantaAdmin)var WebvantaAdmin={};WebvantaAdmin={version:"2.0.0",readCookie:function(a){var b=a+"=",c=document.cookie.split(";");for(var d=0;d<c.length;d++){var e=c[d];while(e.charAt(0)==" ")e=e.substring(1,e.length);if(e.indexOf(b)==0)return e.substring(b.length,e.length)}return null},writeCookie:function(a,b,c){c=c||{},b===null&&(b="",c.expires=-1);var d="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString)){var e;typeof c.expires=="number"?(e=new Date,e.setTime(e.getTime()+c.expires*24*60*60*1e3)):e=c.expires,d="; expires="+e.toUTCString()}var f=c.path?"; path="+c.path:"",g=c.domain?"; domain="+c.domain:"",h=c.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),d,f,g,h].join("")},isAdmin:function(){var a;if(a=WebvantaAdmin.readCookie("wv_user_info")){var b=decodeURIComponent(a).split(","),c;return b&&b[1]&&(c=b[1].split("="))&&c[1].match(/(admin|content.editor|support|super)/)!=null}return!1},getKeyValue:function(a,b){var c;if(c=WebvantaAdmin.readCookie(a)){var d=decodeURIComponent(c).split(",");if(d)for(var e=0;e<d.length;e++)if(d[e]){var f=d[e].split("=");if(f[0]==b)return f[1]?f[1].replace(/\+/g," "):""}}return""},getUIRValue:function(a){return WebvantaAdmin.getKeyValue("wv_user_info",a)},getSetting:function(a){return WebvantaAdmin.getKeyValue("wv_settings",a)},toSlug:function(a){return a.replace(/^\s*/,"").replace(/\s*$/,'""').toLowerCase().replace(/[^-a-z0-9~\s\.:;+=_]/g,"").replace(/[\s:;=+]+/g,"-")},queuedScripts:[],loadScriptXhrInjection:function(a,b,c){var d=WebvantaAdmin.queuedScripts.length;if(c){var e={response:null,onload:b,done:!1};WebvantaAdmin.queuedScripts[d]=e}var f=WebvantaAdmin.getXHRObject();f.onreadystatechange=function(){if(f.readyState==4)if(c)WebvantaAdmin.queuedScripts[d].response=f.responseText,WebvantaAdmin.injectScripts();else{var a=document.createElement("script");document.getElementsByTagName("head")[0].appendChild(a),a.text=f.responseText,b&&b()}},f.open("GET",a,!0),f.send("")},injectScripts:function(){var a=WebvantaAdmin.queuedScripts.length;for(var b=0;b<a;b++){var c=WebvantaAdmin.queuedScripts[b];if(!c.done){if(!c.response)break;var d=document.createElement("script");document.getElementsByTagName("head")[0].appendChild(d),d.text=c.response,c.onload&&c.onload(),c.done=!0}}},getXHRObject:function(){var a=!1;try{a=new XMLHttpRequest}catch(b){var c=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"],d=c.length;for(var e=0;e<d;e++){try{a=new ActiveXObject(c[e])}catch(b){continue}break}}finally{return a}}},WebvantaAdmin.addHandler=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)};if(typeof WebvantaPrefs=="undefined"||!WebvantaPrefs)var WebvantaPrefs={};WebvantaPrefs={version:"2.0.0",readPref:function(a){return WebvantaAdmin.readCookie("wv-pref-"+a)},writePref:function(a,b,c){WebvantaAdmin.writeCookie("wv-pref-"+a,b,{expires:new Date(2020,12,21),path:"/"})}}
