var tokenKey;if(typeof console=="undefined"){this.console={log:function(){}}}function getToken(b){tokenKey=b}function getParam(d,c){return"&"+d+"="+encodeURIComponent(c)}function setCookie(a,b){if(window.widget){widget.setPreferenceForKey(encodeURIComponent(b),a)}else{document.cookie=a+"="+encodeURIComponent(b)+"; expires="+(new Date(new Date().getTime()+(360*24*60*60*1000))).toGMTString()+"; path=/"}}function getCookie(a){if(window.widget){return decodeURIComponent(widget.preferenceForKey(a))||null}if(new RegExp(a+"=([^;]*);","").test(document.cookie+";")){return decodeURIComponent(RegExp.$1)}return null}function setSession(a,b){if(new RegExp(a+"=([^;]*);","").test(window.name+";")){window.name=window.name.replace(new RegExp(a+"=([^;]*);",""),a+"="+encodeURIComponent(b)+";")}else{window.name+=a+"="+encodeURIComponent(b)+";"}}function getSession(a){if(new RegExp(a+"=([^;]*);","").test(window.name+";")){return decodeURIComponent(RegExp.$1)}return null}function changeLanguage(h,m,g){var j=document.location.pathname;var i=j.toLowerCase().indexOf("/"+h);var l="";if(i>=0){l=j.substring(0,i);l=l+"/"+m;l=l+j.substring(i+3,j.length)}else{l+=g}document.location.pathname=l}function loadingImg(b){$(b).each(function(){$(this).loading()})}function tag(b){return document.getElementById(b)}function action(g,h,e){if($("#action").size()==0){var f="type="+g+"&token="+tokenKey+"&"+e;$.ajax({type:"POST",url:"/"+h,data:f,success:function(a){$("body").append("<div id='action'><script>"+a+"<\/script></div>");$("#action").remove()}})}}function getLoadingTag(){return $("<img class='loading_img' src='/images/loading.gif'/>")}function getBlankSrc(){return"/images/blank.gif"}(function(b){b.fn.groupCheckbox=function(){var a=b(this);b("input[for="+a.attr("id")+"]").each(function(){b(this).change(function(){var m=b(this);var i=jQuery.trim(a.val());var c=m.val();if(m.attr("checked")==undefined){var g="";i=i.split(",");for(var l=0;l<i.length;l++){if(i[l]==c){continue}g=(g==""?i[l]:g+","+i[l])}a.val(g)}else{a.val(i==""?c:i+","+c)}})})};b.fn.hoverImg=function(a){var d=b(this).attr("src");b(this).bind("mouseover",function(){b(this).attr("src",a)});b(this).bind("mouseout",function(){b(this).attr("src",d)})};b.fn.ok=function(h){b(this).bind("focusin",f);function f(){b(this).bind("focusout",a);b(document).bind("keypress",g)}function a(){b(this).unbind("focusout",a);b(document).unbind("keypress",g)}function g(c){if(c.keyCode==13){h()}}};b.fn.reloadCaptcha=function(){b(this).attr("src","/actionServlet?type=captcha")};b.fn.browserClass=function(){var a;if(b.browser.mozilla){a="gecko gecko"+b.browser.version}else{if(b.browser.msie){a="ie ie"+b.browser.version}else{if(b.browser.safari){a="safari"}else{if(b.browser.opera){a="opera"}else{a=navigator.appName.toLowerCase()}}}}b("body").addClass(a)};b.fn.showLoading=function(a){b(this).empty();getLoadingTag().appendTo(b(this));if(a!=null){b(this).show("fast",a())}else{b(this).show("fast")}};b.fn.closeLoading=function(){b(this).empty();b(this).hide()};b.fn.loading=function(){root=b(this);src=root.attr("loading");if(src!=null){op={display:root.css("display"),src:src,l:null};root.data("loading",op);tag=root[0].tagName;pro=root.attr("process");if(tag=="IMG"||tag=="IFRAME"){g(root);if(pro!=null){root.attr("process",null)}else{op.l=getLoadingTag();op.l.insertAfter(root)}h(root)}else{if(tag!="EMBED"){n=b("<img />");n.attr("class",root.attr("class"));n.attr("style",root.attr("style"));n.insertAfter(o);n.data("loading",op);root.remove();if(pro==null){op.l=getLoadingTag();op.l.insertAfter(n)}h(n)}}j(root)}function g(c){c.css("display","none")}function i(d,c){d.css("display",c.display)}function j(c){c.attr("loading",null);c.attr("src",src)}function h(c){c.bind("load",function(d){op=b(this).data("loading");if(op.l!=null){op.l.remove()}b(this).unbind(d);i(b(this),op);a(b(this))});c.error(function(){b(this).attr("src",getBlankSrc())})}function a(c){c.removeData("loading")}}})(jQuery);(function(q){q.tiny=q.tiny||{};q.tiny.ajaxRequest={options:{type:"GET",init:function(){},success:function(){},error:function(){},validate:function(){return true},sendAll:true,waiting:true,processing:true,process:null,show:null,apply:null,ids:null,params:{}}};q.fn.isEmpty=function(){return q(this).val()==null||jQuery.trim(q(this).val())==""};q.fn.disabled=function(a){k="disabled";if(a==null){return q(this).data(k)}if(a){q(this).attr(k,k);q(this).addClass(k);q(this).data(k,true)}else{q(this).attr(k,null);q(this).removeClass(k);q(this).removeData(k)}};q.fn.ajaxRequest=function(e,g,b){root=q(this);if(!e.jquery){e=q(e)}opt=q.extend({},q.tiny.ajaxRequest.options,b);if(opt.apply==null){opt.apply=root.attr("apply")}if(opt.sendAll){opt.ids=new Array();q("[ajax=true]",root).each(function(h){opt.ids[h]={id:encodeURIComponent(q(this).attr("id")),name:encodeURIComponent(q(this).attr("name")),type:q(this).attr("type"),o:q(this)}})}else{if(opt.ids!=null){arr=new Array();for(var a=0;a<opt.ids.length;a++){var d=opt.ids[a];var f;if(d.jquery){f=d}else{f=q(d)}arr[a]=data={id:encodeURIComponent(f.attr("id")),name:encodeURIComponent(f.attr("name")),type:f.attr("type"),o:f}}opt.ids=arr}}if(opt.process==null&&opt.processing){opt.process=q(".processing",root);if(opt.process.attr("class")==null){opt.process=q("<div class='processing'></div>");opt.process.appendTo(root)}}e.data(g,opt);e.bind(g,function(h){e=q(this);if(!e.disabled()){c(e,e.data(h.type),h)}});function c(H,I,D){m(H,I.waiting);if(I.validate()){var h=I.apply;var C="type=ajax";var J=H.attr("id");C+=getParam("apply",h);C+=getParam("target",J==null?H.attr("name"):J);C+=getParam("event",D.type);C+=getParam("token",tokenKey);q.map(I.params,function(v,u){try{v=v()}catch(t){}if(v!=null){C+=getParam(u,v)}});if(I.ids!=null){for(var E=0;E<I.ids.length;E++){var F=I.ids[E];var G=p(F);if(G.length>0){var J=r(F.o)?F.name:(F.id==null?F.name:F.id);C+=getParam(J,G)}}}req=q.ajax({type:(C.length<2000?I.type:"POST"),url:"/actionServlet",data:C,beforeSend:function(t){I.init(D);if(I.process!=null){I.process.empty();getLoadingTag().appendTo(I.process)}if(I.show!=null){I.show(I.process)}else{if(I.process!=null){I.process.show()}}}});req.done(function(t){if(I.process!=null){I.process.html(t)}else{q("body").append(t)}I.success(t,D);j(H,I.waiting)});req.fail(function(u,t){I.error(u,D);if(u.status=="404"){u=getLabel("pagenotfound")}else{u=getLabel("serviceunavailable")}if(I.process!=null){I.process.html("<span class='error'>"+u+"</span>")}else{alert(u)}j(H,I.waiting)})}else{if(I.process!=null){I.process.empty()}j(H,I.waiting)}}};function m(b,a){if(a){b.disabled(true)}}function j(b,a){if(a){b.disabled(false)}}function r(a){return a=="radio"}function s(a){return a=="checkbox"}function l(a){return a.attr("checked")!=undefined}function i(a){return a.tagName=="INPUT"||a.tagName=="SELECT"||a.tagName=="TEXTAREA"}function p(c){var a=c.o;if((r(c.type)||s(c.type))){return l(a)?jQuery.trim(a.val()):""}var b=jQuery.trim(i(a[0])?a.val():a.attr("value"));b=b.replace(/\s{2,}/," ");a.val(b);if(a.attr("search")){return a.searchVal()}return jQuery.trim(a.val())}})(jQuery);
