var gpPublic,$gp,gp_error="There was an error processing the last request. Please reload this page to continue.";function createCookie(a,g,b){if(b){var c=new Date;c.setTime(c.getTime()+864E5*b);b="; expires="+c.toGMTString()}else b="";document.cookie=a+"="+g+b+"; path=/"}function eraseCookie(a){createCookie(a,"",-1)}function jPrep(a,g){g="undefined"==typeof g?"gpreq=json&jsoncallback=?":g;a=strip_from(a,"#");a+=-1==a.indexOf("?")?"?":"&";return a+g}
function ajaxResponse(a,g,b){$(".messages").detach();var c=!1;$.each(a,function(a,e){if("function"==typeof gpresponse[e.DO])gpresponse[e.DO].call(this,e,g,b);else switch(e.DO){case "replace":$(e.SELECTOR).replaceWith(e.CONTENT);break;case "inner":$(e.SELECTOR).html(e.CONTENT);break;case "eval":eval(e.CONTENT);break;case "renameprep":RenamePrep();break;case "admin_box_data":c=$gp.AdminBoxC(e.CONTENT);break;case "messages":$(e.CONTENT).appendTo("body").show().css({top:0})}});if(!c){try{$gp.CloseAdminBox()}catch(e){}try{$.fn.colorbox.close()}catch(f){}}loaded()}
$(function(){$("body").addClass("STCLASS");eraseCookie("cookie_cmd");gpPublic=$gp=function(){return this};$gp.jGoTo=function(b){loading();b=jPrep(b);$.getJSON(b,ajaxResponse)};$gp.cGoTo=function(b,c){var e;e=c?window.location.href:strip_from(b.href,"?");createCookie("cookie_cmd",encodeURIComponent(b.search+"&verified="+post_nonce),1);window.location=strip_from(e,"#")};$gp.post=function(b,c){loading();var e=$(b).closest("form"),a=e.serialize()+"&verified="+encodeURIComponent(post_nonce);"INPUT"==b.nodeName&&
(a+="&"+encodeURIComponent(b.name)+"="+encodeURIComponent(b.value));c&&(a+="&"+c);$.post(jPrep(e.attr("action")),a,ajaxResponse,"json");return!1};$gp.post_link=function(b){loading();var c=b.search;"?"==c[0]&&(c=c.substring(1));$gp.postC(b.href,c)};$gp.postC=function(b,c,a,f){a=a||ajaxResponse;f=f||"json";"object"==typeof c&&(c=jQuery.param(c,!0));c+="&verified="+encodeURIComponent(post_nonce);"json"==f&&(c+="&gpreq=json&jsoncallback=?");$.post(strip_from(b,"?"),c,a,f)};$gp.cboxSettings=function(b){b=
b||{};colorbox_lang=colorbox_lang||{};return $.extend(colorbox_lang,{opacity:0.75,maxWidth:"90%",minWidth:300,minHeight:300,maxHeight:"90%"},b)};var a=function(b){$(b).filter("[method=post]").append('<input type="hidden" name="verified" value="'+post_nonce+'" />')},g=function(b,c){var a=$(b).find("form").get(0);a&&$(c).find("input").each(function(b,c){a[c.name]&&(a[c.name].value=c.value)})};$(document).ajaxError(function(b,c,a,f){loaded();"function"!=typeof a.error&&""!=f&&("undefined"!==typeof debugjs?
(b={thrownError:f,text:c.responseText,status:c.status,statusText:c.statusText,url:a.url,type:a.type,browser:$.param($.browser)},a.data&&(b.data=a.data.substr(0,100)),debug(b)):alert(gp_error))});$("form").live("mousedown",function(){var b=$(this);"checked"!=b.data("gpForms")&&("undefined"!==typeof this["return"]&&(this["return"].value=window.location),b.data("gpForms","checked"))});$("input").live("click",function(b){a(this.form);var c=$(this),c=strip_from(c.attr("class")," ");if("function"==typeof gpinputs[c])return gpinputs[c].call(this,
b,b);switch(c){case "gppost":case "gpajax":return $gp.post(this)}return!0});$("form").live("submit",function(){a(this)});$(".expand_child").live("mouseenter",function(){$(this).addClass("expand");$(this).hasClass("simple_top")&&$(this).addClass("simple_top_hover")}).live("mouseleave",function(){$(this).removeClass("expand").removeClass("simple_top_hover")});$("a[name]").live("click",function(b){var a=$(this),e=a.attr("name"),f=a.attr("rel");if(a.hasClass("gpconfirm")&&!confirm(this.title))b.preventDefault();
else{if("function"==typeof gplinks[e])return gplinks[e].call(this,f,b);switch(e){case "tabs":tabs(this);break;case "toggle_show":$(f).toggle();break;case "inline_box":g(f,this);$.fn.colorbox($gp.cboxSettings({inline:!0,href:f,open:!0}));break;case "iadmin_box":g(f,this);$gp.AdminBoxC($(f),"inline");break;case "postlink":$gp.post_link(this);break;case "gpajax":$gp.jGoTo(this.href);break;case "creq":$gp.cGoTo(this,!0);break;case "cnreq":$gp.cGoTo(this,!1);break;case "close_message":a.closest("div").slideUp();
break;case "gallery":$(""==f?this:"a[rel="+f+"]").colorbox($gp.cboxSettings({resize:!0}));$.fn.colorbox.launch(this);break;default:return!0}b.preventDefault();return!1}});$("body").trigger("gpReady")});function loading(){$("#loading1").css("zIndex",99E3).fadeTo(1,0.3).next().css("zIndex",99001).show()}function loaded(){$("#loading1, #loading2").clearQueue().hide()}function message(){$("#loading1, #loading2").clearQueue().hide()}
function tabs(a){$(a.parentNode).find("a").removeClass("selected").each(function(a,b){var c=strip_to(b.href,"#");c&&$("#"+c).hide()});d=strip_to(a.href,"#");$("#"+d).show();a.className="selected"}function strip_to(a,g){if(!a)return a;var b=a.indexOf(g);return-1<b?a.substr(b+1):!1}function strip_from(a,g){if(!a)return a;var b=a.indexOf(g);0<b&&(a=a.substr(0,b));return a};