var tokenKey;if(typeof console=="undefined"){this.console={log:function(){}}}function getToken(a){tokenKey=a}function getParam(a,b){return"&"+a+"="+encodeURIComponent(b)}function setCookie(d,c){if(window.widget){widget.setPreferenceForKey(encodeURIComponent(c),d)}else{document.cookie=d+"="+encodeURIComponent(c)+"; expires="+(new Date(new Date().getTime()+(360*24*60*60*1000))).toGMTString()+"; path=/"}}function getCookie(b){if(window.widget){return decodeURIComponent(widget.preferenceForKey(b))||null}if(new RegExp(b+"=([^;]*);","").test(document.cookie+";")){return decodeURIComponent(RegExp.$1)}return null}function changeLanguage(a,c,b){var e=document.location.pathname;var f=e.toLowerCase().indexOf("/"+a);var d="";if(f>=0){d=e.substring(0,f);d=d+"/"+c;d=d+e.substring(f+3,e.length)}else{d+=b}document.location.pathname=d}function loadingImg(a){$(a).each(function(){$(this).loading()})}function tag(a){return document.getElementById(a)}function action(d,c,b){if($("#action").size()==0){var a="type="+d+"&token="+tokenKey+"&"+b;$.ajax({type:"POST",url:"/"+c,data:a,success:function(e){$("body").append('<div id="action"><script>'+e+"<\/script></div>");$("#action").remove()}})}}(function(a){a.fn.hoverImg=function(b){var c=a(this).attr("src");a(this).bind("mouseover",function(){a(this).attr("src",b)});a(this).bind("mouseout",function(){a(this).attr("src",c)})};a.fn.ok=function(c){a(this).bind("focusin",e);function e(){a(this).bind("focusout",b);a(document).bind("keypress",d)}function b(){a(this).unbind("focusout",b);a(document).unbind("keypress",d)}function d(f){if(f.keyCode==13){c()}}};a.fn.reloadCaptcha=function(){a(this).attr("src","/actionServlet?type=captcha")};a.fn.browserClass=function(){var b;if(a.browser.mozilla){b="gecko gecko"+a.browser.version}else{if(a.browser.msie){b="ie ie"+a.browser.version}else{if(a.browser.safari){b="safari"}else{if(a.browser.opera){b="opera"}else{b=navigator.appName.toLowerCase()}}}}a("body").addClass(b)};a.fn.showLoading=function(b){a(this).empty();a("<img class='loading_img' src='/images/loading.gif'/>").appendTo(a(this));if(b!=null){a(this).show("fast",b())}else{a(this).show("fast")}};a.fn.closeLoading=function(){a(this).empty();a(this).hide()};a.fn.loading=function(){var g=a(this);var h=g.attr("loading");if(h!=null){var b=g[0].tagName;if(b=="IMG"||b=="IFRAME"){var f=a("<span class='loading_warp' style='display: none;'/>");f.insertBefore(g);if(g.attr("process")!=null){g.appendTo(f);g.bind("load",function(j){f.attr("style",null);g.unbind(j)});g.attr("process",null)}else{var d=a("<img class='loading_img' src='/images/loading.gif'/>");d.insertAfter(f);g.appendTo(f);g.bind("load",function(j){d.remove();f.attr("style",null);g.unbind(j)})}g.attr("loading",null);g.attr("src",h)}else{if(b=="EMBED"){g.attr("loading",null);g.attr("src",h)}else{var f=a("<span class='loading_warp' style='display: none;'/>");f.insertBefore(g);var c=g.attr("class");var e=g.attr("style");g.remove();var i=a("<img />");i.attr("class",c);i.attr("style",e);if(g.attr("process")!=null){i.appendTo(f);i.bind("load",function(j){f.attr("style",null);i.unbind(j)})}else{var d=a("<img class='loading_img' src='/images/loading.gif'/>");d.insertAfter(f);i.appendTo(f);i.bind("load",function(j){d.remove();f.attr("style",null);i.unbind(j)})}i.attr("src",h)}}}}})(jQuery);
