/*
 G8_Worx_ax: Version 0.0.4
 G8_Worx_Src_ax: Version 0.0.1
 G8_Worx_String_ax: Version 0.0.3
 G8_Worx_Ajax_ax: Version 0.0.3
 G8_Worx_Json_ax: Version 0.0.1
 G8_Worx_Dom_ax: Version 0.0.3
 G8_Worx_Src_ax: Version 0.0.1
 G8_Worx_Math_ax: Version 0.0.3
*/
(function(){(function m(){function g(a){var b=$(a.target);a=a.data.callback;a(b)}function c(a){a=$.makeArray(a);a.shift();return a}function d(){f||(f=$("<div></div>"));f.empty();return f}var f;window.G8=window.G8||{};window.G8.worx={};G8.worx.extendMethods=function a(b){$.each(b,function(e,i){G8.worx[e]=i})};window.$Self=function a(b,e){return e.find(b).add(e.filter(b))};G8.worx.extendMethods({prxy:function(a,b){return $.proxy(b,a)},dbg:function(){if(typeof console!="undefined")console.info(arguments);
else{var a="";$.each(arguments,function(b,e){if($.isArray(e)||typeof e=="object")$.each(arguments,function(i,j){a+="  "+i+":"+j+"\n"});else a+=e+"\n\n"})}},makeDom:function(a){var b=a[0],e=a[1];a=a[2]!=undefined?c(c(a)).join(""):"";var i=e.cl?' class="'+e.cl+'"':"",j=e.id?' id="'+e.id+'"':"",h=e.pos?"position:"+e.pos+";":"";e=e.hid?"display:none;":"";e=h!=""||e!=""?' style="'+h+e+'"':"";return"<"+b+j+i+e+">"+a+"</"+b+">"},makeDiv:function(){var a=[];a.push("div");$.each(arguments,function(b,e){a.push(e)});
return G8.worx.makeDom(a)},addGlobalListener:function(a,b){$(document).bind(a,{callback:b},g)},extendObject:function(a,b){for(var e in b)a[e]=b[e];return a}});G8.worx.extendObject(String.prototype,{hasStr:function(){for(var a=$.isArray(arguments[0])?arguments[0]:arguments,b=0;b<a.length;b++)if(this.toLowerCase().indexOf(a[b].toLowerCase())!=-1)return true;return false}});jQuery.fn.extend({tgl:function(a){return a?this.show():this.hide()},tglFadeIn:function(a,b){a=this.opacity()*a;return this.stopp().show().fadeTo(a,
1,b)},tglFadeOut:function(a,b){return this.is(":visible")?this.stopp().show().opacity(1).fadeOut(a,b):this.hide()},opacity:function(a){return a||a===0?this.css({opacity:a}):this.css("opacity")},stopp:function(){return this.stop(true)},isOrIsChildOf:function(a){var b=false,e=this[0];a.each(function(){var i=this;if($.contains(i,e)||i==e){b=true;return false}});return b},readInputVal:function(){return $.trim(this.val())},outerHtml:function(){return d().html(this.clone()).html()},getIdFromClass:function(a){var b=
"";this.attr("class")&&$.each(this.attr("class").split(/\s+/),function(){if(this.hasStr(a))b=this.replace(a,"")});return b},bindProxy:function(a,b,e,i){a=a;var j=!$.isFunction(b)?b:false;b=j?e:b;e=j?i:e;j?this.bind(a,j,$.proxy(b,e)):this.bind(a,$.proxy(b,e));return this},bindOnce:function(a,b,e){a=a;var i=!$.isFunction(b)?b:false;b=i?e:b;this.unbind(a,b);i?this.bind(a,i,b):this.bind(a,b);return this},bindOnceProxy:function(a,b,e,i){a=a;var j=!$.isFunction(b)?b:false;b=j?e:b;e=j?i:e;j?this.bindOnce(a,
j,$.proxy(b,e)):this.bindOnce(a,$.proxy(b,e));return this}});return{}})();var q=function m(){jQuery.fn.extend({imgSetHi:function(){return this.switchSrc("_lo.","_hi.").switchSrc("_act.","_hi.")},imgSetLo:function(){return this.switchSrc("_hi.","_lo.").switchSrc("_act.","_lo.")},imgSetAct:function(){return this.switchSrc("_hi.","_act.").switchSrc("_lo.","_act.")},imgFilterNonAct:function(){return this.filter(function(){return $(this).attr("src").indexOf("_act.")==-1})},imgSetExp:function(){return this.switchSrc("_col",
"_exp")},imgSetCol:function(){return this.switchSrc("_exp","_col")},switchSrc:function(g,c){return this.attr("src",function(){return this.src.replace(g,c)})}});return{}}();(function m(){function g(){c||(c=$("<div></div>"));c.empty();return c}var c;G8.worx.extendObject(String.prototype,{stripScripts:function(){return this.replace(new RegExp("<s*script[^>]*>([\\S\\s]*?)</s*script[^>]*>","img"),"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripNl:function(){return this.replace(/(\r\n)|(\n\r)|\r|\n/g,
"")},truncate:function(d,f){d=d||30;f=f===undefined?"...":f;return this.length>d?this.slice(0,d-f.length)+f:String(this)},nl2br:function(){return this.replace(/(\r\n)|(\n\r)|\r|\n/g,"<br />").replace(/<br \/><br \/>/g,"<br />&nbsp;<br />")},br2nl:function(){return this.replace(/<br \/>/g,"\n").replace(/<br\/>/g,"\n").replace(/<br>/g,"\n")},space2Nbsp:function(){return this.replace(/  /g,"&nbsp;&nbsp;")},nbsp2Space:function(){return this.replace(/&nbsp;/g," ").replace(/&#160;/g," ")},hasStrExact:function(){for(var d=
$.isArray(arguments[0])?arguments[0]:arguments,f=0;f<d.length;f++)if(this==d[f].toString())return true;return false}});G8.worx.extendMethods({escapeHtml:function(d){if(!d)return"";return g().text(d).html()},unescapeHtml:function(d){if(!d)return"";return g().html(d).text()},inputToHtml:function(d){if(!d)return"";return escapeHtml(d).nl2br().space2Nbsp()},htmlToInput:function(d){if(!d)return"";return unescapeHtml(d.br2nl().nbsp2Space())},findFirstRegExp:function(d,f){return(d=d.match(f))?d[0]:""}});
return{}})();(function m(){G8.worx.extendMethods({jsonToObj:function g(c){try{return eval("("+c+")")}catch(d){dbg("ERROR: malformed json string",c);return{}}},getJsonFromIframeReturn:function g(c){if(c.indexOf("<pre>")==0||c.indexOf("<PRE>")==0)c=c.substring(5,c.length-6);return c=jsonToObj(c)},ajaxResponseToJObj:function g(c){var d=c;c=G8.worx.findFirstRegExp(c,/<body>[\s\S]*(?=<\/body>)/);if(c!="")d=c.replace("<body>","");d=d.stripScripts();return d=$("<div></div>").append(d)},objectizeForm:function g(c,
d){var f=c;if(!f.is("form")&&!f.is(":input"))f=c.find(":input");c=f.serializeArray();f={};for(var a in c)f[c[a].name]=c[a].value;d&&$.extend(f,d);return f},getTitleFromAjaxResponse:function g(c){return c=G8.worx.findFirstRegExp(c,/[^>]*(?=<\/title>)/)}});return{}})();(function m(){G8.worx.extendMethods({jsonEncode:function g(){var c={"\u0008":"b","\t":"t","\n":"n","\u000c":"f","\r":"r",'"':'"',"\\":"\\","/":"/"},d=function(k){return k<10?"0".concat(k):k},f=function(k,o,r){return 1*k.substr(o,r)},
a=["","000","00","0",""],b=/(\x5c|\x2F|\x22|[\x0c-\x0d]|[\x08-\x0a])/g,e=/([\x00-\x07]|\x0b|[\x0e-\x1f])/g,i=function(k,o){return"\\".concat(c[o])},j=function(k,o){k=o.charCodeAt(0).toString(16);return"\\u".concat(a[k.length],k)};f={"boolean":function(){return Boolean},"function":function(){return Function},number:function(){return Number},object:function(k){return k instanceof k.constructor?k.constructor:null},string:function(){return String},undefined:function(){return null}};var h=arguments.length?
arguments[0]:this,l,n;if(h===null)l="null";else if(h!==undefined&&(n=f[typeof h](h)))switch(n){case Array:l=[];d=f=0;for(b=h.length;d<b;d++)if(h[d]!==undefined&&(n=G8.worx.jsonEncode(h[d])))l[f++]=n;l="[".concat(l.join(","),"]");break;case Boolean:l=String(h);break;case Date:l='"'.concat(h.getFullYear(),"-",d(h.getMonth()+1),"-",d(h.getDate()),"T",d(h.getHours()),":",d(h.getMinutes()),":",d(h.getSeconds()),'"');break;case Function:break;case Number:l=isFinite(h)?String(h):"null";break;case String:l=
'"'.concat(h.replace(b,i).replace(e,j),'"');break;default:f=0;var p;l=[];for(p in h)if(h[p]!==undefined&&(n=G8.worx.jsonEncode(h[p])))l[f++]='"'.concat(p.replace(b,i).replace(e,j),'":',n);l="{".concat(l.join(","),"}");break}return l}});return{}})();(function m(){jQuery.fn.extend({tglClass:function(g,c){return c?this.addClass(g):this.removeClass(g)},parentsSelf:function(g){return this.parents(g).add(this.filter(g))},switchClassF:function(g,c){this.filter("."+g).removeClass(g).addClass(c);return this},
findNonGrandChild:function g(c,d){return this.find(d).not(this.find(c+" "+d))}});return{}})();q=function m(){jQuery.fn.extend({imgSetHi:function(){return this.switchSrc("_lo.","_hi.").switchSrc("_act.","_hi.")},imgSetLo:function(){return this.switchSrc("_hi.","_lo.").switchSrc("_act.","_lo.")},imgSetAct:function(){return this.switchSrc("_hi.","_act.").switchSrc("_lo.","_act.")},imgFilterNonAct:function(){return this.filter(function(){return $(this).attr("src").indexOf("_act.")==-1})},imgSetExp:function(){return this.switchSrc("_col",
"_exp")},imgSetCol:function(){return this.switchSrc("_exp","_col")},switchSrc:function(g,c){return this.attr("src",function(){return this.src.replace(g,c)})}});return{}}();(function m(){G8.worx.extendMethods({getRange:function(g,c){if(g==c)return g;return g+parseInt(Math.random()*(c-g+1))}});return{}})();window.dbg=G8.worx.dbg;window.mD=G8.worx.makeDiv;window.prxy=G8.worx.prxy;$(function(){})})();

