(function(g,m,c){m.var_export=function(A,H){var z="",s="",t=0,C=[],y=0,u=[],G=arguments[2]||2,w="",r="",v=function(J){var I=(/\W*function\s+([\w\$]+)\s*\(/).exec(J);if(!I){return"(Anonymous)"}return I[1]},E=function(I){return(new Array(I+1)).join(" ")},F=function(N){var L=0;var J,M=typeof N;if(M==="object"&&N.constructor&&v(N.constructor)==="PHPJS_Resource"){return"resource"}if(M==="function"){return"function"}if(M==="object"&&!N){return"null"}if(M==="object"){if(!N.constructor){return"object"}var I=N.constructor.toString();J=I.match(/(\w+)\(/);if(J){I=J[1].toLowerCase()}var K=["boolean","number","string","array"];for(L=0;L<K.length;L++){if(I===K[L]){M=K[L];break}}}return M},B=F(A);if(B===null){z="NULL"}else{if(B==="array"||B==="object"){r=E(G-2);w=E(G);for(y in A){var D=var_export(A[y],true,G+2);D=typeof D==="string"?D.replace(/</g,"&lt;").replace(/>/g,"&gt;"):D;C[t++]=w+y+" => "+(F(A[y])==="array"?"\n":"")+D}s=C.join(",\n");z=r+"array (\n"+s+"\n"+r+")"}else{if(B==="function"){u=A.toString().match(/function .*?\((.*?)\) \{([\s\S]*)\}/);z="create_function ('"+u[1]+"', '"+u[2].replace(new RegExp("'","g"),"\\'")+"')"}else{if(B==="resource"){z="NULL"}else{z=(typeof(A)!=="string")?A:"'"+A.replace(/(["'])/g,"\\$1").replace(/\0/g,"\\0")+"'"}}}}if(H!==true){alert(g("<div/>").html(z).text());return null}else{return z}};m.my_concat=function(){var s={},r=0;while(r<my_concat.arguments.length){s=g.extend({},s,my_concat.arguments[r++])}return s};m.get_highest_zindex=function(){return Math.max.apply(null,g.map(g("body > *"),function(r,s){if(g(r).css("position")=="absolute"){return parseInt(g(r).css("z-index"))||1}}))};m.refresh_page=function(){location.replace(location.href.replace(/\?.*$/,"")+"?"+Math.random())};m.show_modal=function(r,A,w,z,s,u){var B=g("body > .a-aa-ce-Vk"),y=g("body > .a-aa-ce-Vk > .va-Q-R > .va-Q-R-G"),t=g("body > .a-aa-ce-Vk > .va-Q-p > .a-aa-ce-Vk-Rf"),v=g("body > .a-aa-ce-Vk > .va-Q-p > .a-b-aa-ce-Vk-y");modal_f=g("body > .a-aa-ce-Vk > .va-Q-bb"),modal_if=g("body > iframe.va-Q-zb"),modal_dv=g("body > div.va-Q-zb"),x=g('<div class="c-b c-b-modal c-b-x">Cancel</div>'),resize=function(){B.css({left:g(m).width()/2-B.width()/2,top:g(m).height()/2-B.height()/2}),modal_if.css({height:g(document).height(),width:g(document).width()}),modal_dv.css({height:g(document).height(),width:g(document).width()})};modal_if.show();modal_dv.show();modal_if.show().css((g.browser.msie)?"filter":"opacity",(g.browser.msie)?"alpha(opacity=0)":"0"),modal_dv.show().css((g.browser.msie)?"filter":"opacity",(g.browser.msie)?"alpha(opacity=75)":"0.75");y.text(A);t.text(w);g.each(z,function(C,D){v.append(D)});x.insertBefore(modal_f.children("span"));s.insertBefore(modal_f.children("span"));x.click(function(){modal_if.hide();modal_dv.hide();B.hide();y.text("");t.text("");v.children().remove();x.remove();s.remove();g(m).unbind("resize",resize)}),s.click(function(){u(B,y,t,v,x)}),g(m).resize(resize),resize(),B.css("width",r).show()};m.show_modal_no_x=function(r,A,w,z,s,u){var B=g("body > .a-aa-ce-Vk"),y=g("body > .a-aa-ce-Vk > .va-Q-R > .va-Q-R-G"),t=g("body > .a-aa-ce-Vk > .va-Q-p > .a-aa-ce-Vk-Rf"),v=g("body > .a-aa-ce-Vk > .va-Q-p > .a-b-aa-ce-Vk-y");modal_f=g("body > .a-aa-ce-Vk > .va-Q-bb"),modal_if=g("body > iframe.va-Q-zb"),modal_dv=g("body > div.va-Q-zb"),resize=function(){B.css({left:g(m).width()/2-B.width()/2,top:g(m).height()/2-B.height()/2}),modal_if.css({height:g(document).height(),width:g(document).width()}),modal_dv.css({height:g(document).height(),width:g(document).width()})};modal_if.show();modal_dv.show();modal_if.show().css((g.browser.msie)?"filter":"opacity",(g.browser.msie)?"alpha(opacity=0)":"0"),modal_dv.show().css((g.browser.msie)?"filter":"opacity",(g.browser.msie)?"alpha(opacity=75)":"0.75");y.text(A);t.text(w);g.each(z,function(C,D){v.append(D)});s.insertBefore(modal_f.children("span"));s.click(function(){modal_if.hide();modal_dv.hide();B.hide();y.text("");t.text("");v.children().remove();s.remove();g(m).unbind("resize",resize);u()}),g(m).resize(resize),resize(),B.css("width",r).show()};m.my_ajax=function(u){var v=g("body > iframe.va-Q-zb").clone(),s=g("body > div.va-Q-zb").clone(),w=g('<img src="public/images/loader.gif" />').css({"background-color":"#FFFFFF",display:"block",position:"fixed","z-index":get_highest_zindex()+1}),t=function(){v.css("height",g(document).height());s.css("height",g(document).height());w.css({left:g(m).width()/2-w.width()/2,top:g(m).height()/2-w.height()/2})},r=function(){v.remove(),s.remove(),w.remove();g(m).unbind("resize",t)};g("body").append(v).append(s).append(w),v.show().css((g.browser.msie)?"filter":"opacity",(g.browser.msie)?"alpha(opacity=0)":"0"),s.show().css((g.browser.msie)?"filter":"opacity",(g.browser.msie)?"alpha(opacity=75)":"0.75"),t(),g(m).resize(t),g.ajax({url:u.url,type:u.type,dataType:u.dataType,data:u.data,error:function(){r(),(u.error||function(){})()},success:function(y){r(),(u.success||function(){})(y)},complete:function(){r(),(u.complete||function(){})()}})};g.fn.disable_selection=g.fn.disable_selection||function(){if(!this.length){return this}return this.each(function(){if(typeof this.onselectstart!="undefined"){this.onselectstart=function(){return false}}else{if(typeof this.style.MozUserSelect!="undefined"){this.style.MozUserSelect="none"}else{this.onmousedown=function(){return false}}}});return this};var h="show-watermark",b="hide-watermark",q="input:text,input:password,input[type=search],input:not([type]),textarea";g.fn.watermark_set=g.fn.watermark_set||function(r){if(!this.length){return this}return this.each(function(){var s=g(this);if(!s.is(q)){return}if(!(s.hasClass(h)||s.hasClass(b))){s.addClass(h)}s.val(r).focusin(function(){if(s.hasClass(h)){s.removeClass(h).addClass(b).val("")}}).focusout(function(){if(s.hasClass(b)&&s.val()==""){s.removeClass(b).addClass(h).val(r)}});s.attr("title",r)})};g.fn.watermark_get=g.fn.watermark_get||function(){var r=g(this);return r.hasClass(b)?r.val():""};var a={display:"inline-block",position:"relative",color:"#444",font:"13px arial,sans-serif",cursor:"pointer","list-style":"none outside none","text-decoration":"none"},n=my_concat(a,{"padding-right":"10px","vertical-align":"top"}),i=my_concat(a,{"border-bottom":"#777 0 solid","border-left":"transparent 5px solid","border-right":"transparent 5px solid","border-top":"#777 5px solid",width:"0",height:"0","margin-top":"6px","vertical-align":"middle"}),l=my_concat(a,{margin:"0","-moz-border-radius":"2px","-webkit-border-radius":"2px","border-radius":"2px",background:"#F1F1F1",border:"1px solid #DCDCDC","outline-color":"invert","outline-style":"none","outline-width":"medium","padding-bottom":"6px","padding-left":"10px","padding-right":"10px","padding-top":"6px","vertical-align":"middle"}),p={background:"#F1F1F1","border-color":"#DCDCDC",color:"#444"},j={background:"#F5F5F5","border-color":"#C6C6C6",color:"#333"},k=g('<ol id="sb_l" />').css({margin:"0",display:"none",position:"absolute",background:"#FFF",border:"1px solid #CCC",cursor:"default","font-size":"13px","outline-color":"invert","outline-style":"none","outline-width":"medium",padding:"0"}),f={margin:"0",color:"#666",cursor:"pointer","list-style":"none outside none","padding-left":"30px","padding-right":"72px","white-space":"nowrap"},d={"background-color":"transparent",border:"none","padding-bottom":"6px","padding-top":"6px"},e=my_concat(f,d),o={"background-color":"#eee","border-bottom":"#eee 1px dotted","border-left":"#eee 0 dotted","border-right":"#eee 0 dotted","border-top":"#eee 1px dotted","padding-bottom":"5px","padding-top":"5px"};g.fn.selectbox_set=g.fn.selectbox_set||function(r){var s=g.extend({items:{},selectedIndex:0,selectedCallback:function(){}},r);this.each(function(){var C=g(this),w=[],v=s.selectedIndex,G=s.items[v],z=g("<div />").css(n),A=g("<div />").css(i);for(var B in s.items){var D=s.items[B].html(),y=s.items[B].val(),E=g("<li />").css(e).attr("value",y).append(g("<div />").css({overflow:"hidden"}).append(D));onSelectBoxItemClick=function(J){var H=g(this),K=H.attr("value"),I=H.children(":first").text();C.attr("data-selected",K),C.attr("data-text",I),z.text(I),k.hide(),s.selectedCallback()},onSelectBoxItemEnter=function(){var H=g(this);H.css(o)},onSelectBoxItemLeave=function(){var H=g(this);H.css(d)};E.click(onSelectBoxItemClick),E.hover(onSelectBoxItemEnter,onSelectBoxItemLeave),w.push(E)}var u=function(J){var I=C.offset().top+C.outerHeight(true),K=C.offset().left;if(k.css("top")!=I||k.css("left")!=K){k.children().detach();for(var H in w){k.append(w[H])}k.css({top:I,left:K,"z-index":(get_highest_zindex()+1)})}g("body").append(k),k.toggle();g("body").one("click",function(L){k.hide()});return false},F=function(){C.css(j)},t=function(){C.css(p)};C.attr("data-selected",G.val()),C.attr("data-text",G.html());z.text(G.html()),A.text("\u00a0"),C.click(u),C.hover(F,t),C.disable_selection(),C.css(l).append(z).append(A)});return this};g.fn.selectbox_get=g.fn.selectbox_get||function(){var r=g(this).attr("data-selected");return(typeof r!=="undefined"&&r!==false)?r:""};g.fn.selectbox_get_text=g.fn.selectbox_get_text||function(){var r=g(this).attr("data-text");return(typeof r!=="undefined"&&r!==false)?r:""};g.fn.autoresize_set=g.fn.autoresize_set||function(r){var s=g.extend({onResize:function(){},animate:false,animateDuration:150,animateCallback:function(){},extraSpace:0,limit:1000},r);this.filter("textarea").each(function(){var u=g(this).css({resize:"none","overflow-y":"hidden"}),w=u.height(),y=(function(){var z=["height","width","lineHeight","textDecoration","letterSpacing"],A={};g.each(z,function(B,C){A[C]=u.css(C)});return u.clone().removeAttr("id").removeAttr("name").css({position:"absolute",top:0,left:-9999}).css(A).attr("tabIndex","-1").insertBefore(u)})(),v=null,t=function(){y.height(0).val(g(this).val()).scrollTop(10000);var A=Math.max(y.scrollTop(),w)+s.extraSpace,z=g(this).add(y);if(v===A){return}v=A;if(A>=s.limit){g(this).css("overflow-y","");return}s.onResize.call(this);s.animate&&u.css("display")==="block"?z.stop().animate({height:A},s.animateDuration,s.animateCallback):z.height(A)};u.unbind(".dynSiz").bind("keyup.dynSiz",t).bind("keydown.dynSiz",t).bind("change.dynSiz",t)});return this}})(jQuery,window);
