if(polopoly){throw ("Initialized twice")}var polopoly={};polopoly.service={};polopoly.user={init:function(){polopoly.user.data=polopoly.user._initCookie("cata");polopoly.user.sessionData=polopoly.user._initCookie("data")},_initCookie:function(c){var a=polopoly.cookie.get(c);if(!a){return}var d=polopoly.base64.stringDecode(a);if(!d){return}try{var b=polopoly.json.parse(d)}catch(f){return}return b},getServiceSettings:function(b,a){if(!polopoly.user.data||!polopoly.user.data[b]){return}return polopoly.user.data[b][a]},setServiceSettings:function(c,a,b){if(!polopoly.user.data){polopoly.user.data={}}if(!polopoly.user.data[c]){polopoly.user.data[c]={}}polopoly.user.data[c][a]=b;polopoly.user._persistDataInCookie()},getSessionServiceSettings:function(b,a){if(!polopoly.user.sessionData||!polopoly.user.sessionData[b]){return}return polopoly.user.sessionData[b][a]},setSessionServiceSettings:function(c,a,b){if(!polopoly.user.sessionData){polopoly.user.sessionData={}}if(!polopoly.user.sessionData[c]){polopoly.user.sessionData[c]={}}polopoly.user.sessionData[c][a]=b;polopoly.user._persistSessionDataInCookie()},_persistDataInCookie:function(){var a=polopoly.json.stringify(polopoly.user.data);var b=polopoly.base64.stringEncode(a);polopoly.cookie.set("cata",b)},_persistSessionDataInCookie:function(){var a=polopoly.json.stringify(polopoly.user.sessionData);var b=polopoly.base64.stringEncode(a);polopoly.cookie.setForSession("data",b)},isLoggedIn:function(){return polopoly.cookie.get("sessionKey")!=null&&polopoly.cookie.get("loginName")!=null&&polopoly.cookie.get("userId")!=null},name:function(){return polopoly.base64.stringDecode(polopoly.cookie.get("loginName"))},screenName:function(){return polopoly.base64.stringDecode(polopoly.cookie.get("screenName"))},popMessageCookie:function(a){var f=polopoly.cookie.get(a);var b=polopoly.base64.stringDecode(f);if(b.length){var c;try{c=polopoly.json.parse(b)}catch(d){}polopoly.cookie.clear(a);return c}},refreshUserData:function(b,a){jQuery.ajax({cache:false,error:b,success:a,timeout:10000,type:"GET",url:"/membership/refresh"})},persistUserServiceData:function(d,c,b,a){jQuery.ajax({cache:false,data:{sdid:d,siid:c,csrf_token:polopoly.cookie.get("sessionKey")},error:b,success:a,timeout:10000,type:"POST",url:"/membership/persist"})}};polopoly.cookie={clear:function(a){document.cookie=a+"= ; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"},set:function(a,b){document.cookie=a+"="+b+"; expires=Fri, 01 Jan 2038 00:00:00 UTC; path=/"},setForSession:function(a,b){document.cookie=a+"="+b+"; path=/"},get:function(a){return polopoly.util.stringAsHashValue(a,document.cookie,";")}};polopoly.comments={get:function(c,e,a,d,b){var f={comments:e,ajax:"true",ot:"example.AjaxPageLayout.ot"};if(b!==undefined){f.showCommentId=b}jQuery.get(c,f,function(g){$(a).html(g);if(d){d(a)}},"html")}};polopoly.json={_cx:/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_escapable:/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_gap:null,_indent:null,_meta:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},_rep:null,_f:function(a){return a<10?"0"+a:a},init:function(){if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(a){return this.getUTCFullYear()+"-"+this._f(this.getUTCMonth()+1)+"-"+this._f(this.getUTCDate())+"T"+this._f(this.getUTCHours())+":"+this._f(this.getUTCMinutes())+":"+this._f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()}}},_quote:function(a){this._escapable.lastIndex=0;return this._escapable.test(a)?'"'+a.replace(this._escapable,function(b){var d=this._meta[b];return typeof d==="string"?d:"\\u"+("0000"+b.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'},_str:function(h,e){var c,b,j,a,f=this._gap,d,g=e[h];if(g&&typeof g==="object"&&typeof g.toJSON==="function"){g=g.toJSON(h)}if(typeof this._rep==="function"){g=this._rep.call(e,h,g)}switch(typeof g){case"string":return this._quote(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g){return"null"}this._gap+=this._indent;d=[];if(Object.prototype.toString.apply(g)==="[object Array]"){a=g.length;for(c=0;c").attr({type:"hidden",name:"csrf_token",value:a}).appendTo(b)}};polopoly.base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",stringDecode:function(a){return this._utf8_decode(this.decode(a))},decode:function(d){try{if(d.length==0){return""}}catch(c){return""}d=d.replace(/[^A-Za-z0-9\+\/\=]/g,"");d=this._padIfNecessary(d);var a="";var m,k,h;var l,j,g,f;var b=0;do{l=this._keyStr.indexOf(d.charAt(b++)||"=");j=this._keyStr.indexOf(d.charAt(b++)||"=");g=this._keyStr.indexOf(d.charAt(b++)||"=");f=this._keyStr.indexOf(d.charAt(b++)||"=");m=(l<<2)|(j>>4);k=((j&15)<<4)|(g>>2);h=((g&3)<<6)|f;a=a+String.fromCharCode(m);if(g!=64){a=a+String.fromCharCode(k)}if(f!=64){a=a+String.fromCharCode(h)}}while(b>2;g=((k&3)<<4)|(h>>4);e=((h&15)<<2)|(f>>6);d=f&63;if(isNaN(h)){e=d=64}else{if(isNaN(f)){d=64}}a=a+this._keyStr.charAt(j)+this._keyStr.charAt(g)+this._keyStr.charAt(e)+this._keyStr.charAt(d)}return a},_utf8_encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},_utf8_decode:function(a){var d="";var f=0;var h=0;var g=0;var e=0;while(f191)&&(h<224)){e=a.charCodeAt(f+1);d+=String.fromCharCode(((h&31)<<6)|(e&63));f+=2}else{e=a.charCodeAt(f+1);var b=a.charCodeAt(f+2);d+=String.fromCharCode(((h&15)<<12)|((e&63)<<6)|(b&63));f+=3}}}return d}};polopoly.loginBox={_login:{auth:"authError",perm:"permError",down:"downError",user:"userError","default":"defaultError"},init:function(){document.__ppUseDefLogin=false;try{this.defLogin=p_l_i18n.defaultLoginName}catch(c){this.defLogin="E-mail"}var a=this.defLogin;window.setTimeout(this._tryAutoFill,500);jQuery(".clearable").focus(function(){c=jQuery(this);if(document.__ppUseDefLogin&&c.val()==a){c.val("")}});jQuery(".clearable").blur(function(){c=jQuery(this);if(document.__ppUseDefLogin&&c.val()==""){c.val(a)}});jQuery(".not-loggedin .submit").click(function(){var f=jQuery(this).parents(".not-loggedin");var g=f.find(".loginname");var e=f.find(".password");if(g.val()==a&&e.val()==a){g.val("");e.val("")}});jQuery(".clearable").blur();var b=polopoly.cookie.get("loginName");var d=polopoly.cookie.get("sessionKey");if(polopoly.user.isLoggedIn()){jQuery(".loggedin").show();jQuery(".loggedin .user-name").append(polopoly.user.name())}else{jQuery(".not-loggedin").show()}this._trySetError(".not-loggedin .form-error",polopoly.util.querystringValue("login_formerror"));if(polopoly.util.querystringValue("login_formerror")){jQuery("#loginForm").show()}},_trySetError:function(a,b){if(!b){return}var c=p_l_i18n[this._login[b]]||p_l_i18n[this._login["default"]];jQuery(a).css("display","block").text(c)},_tryAutoFill:function(){if(jQuery(".loginname").val()==""&&jQuery(".password").val()==""){jQuery(".loginname").val(this.defLogin);jQuery(".password").val(this.defLogin);document.__ppUseDefLogin=true}}};polopoly.util.lrumap=function(b,a){var c;if(b){c=b}else{c=[]}if(!a){a=10}return{map:c,size:a,get:function(f){var e=this._findId(f);if(e){var d=this.map[e][1];this._setLeader(e);return d}},rawMap:function(){return this.map},put:function(f,e){var d=this._findId(f);if(d){this.map[d]=[f,e]}else{this.map.unshift([f,e])}if(this.map.length>this.size){this.map.splice(this.size)}},remove:function(e){var d=this._findId(e);if(d){this.map.splice(d,1)}},_findId:function(d){for(key in this.map){if(this.map[key][0]==d){return key}}},_setLeader:function(e){var d=this.map[key];this.map.splice(key,1);this.map.unshift(d)}}};polopoly.Newslist=function(n,m,f,h,q){var b=n,p=m,o="newsList_"+p.replace(".","_"),r=jQuery("#"+o),s=jQuery("#edit_"+o);var d=function(){if(q){return polopoly.user.getSessionServiceSettings(b,p)}else{return polopoly.user.getServiceSettings(b,p)}};var t=function(){return d()||h};var j=function(u){var v=r.find("input:checkbox:checked").map(function(){return this.value}).get();if(u){polopoly.user.setSessionServiceSettings(n,m,v)}else{polopoly.user.setServiceSettings(n,m,v)}};var k=function(u,v,x,w){return function(z){u[v]=z;var A=true;for(var y=0;y-1){w.push(x[y])}}var u=[],z=w.length;for(y=0;y");var e=jQuery(f).width();var c=function a(g,h){return function(j){var l=jQuery(d).val();var k=g(l);var i=k>0?Math.ceil(k/4*e):(l.length>0?0.01*e:0);jQuery("#"+b).css("width",i+"px");jQuery("#"+b).css("background-color",h[k])}}(this._testPassword,this._colors);jQuery(d).keyup(c)},_testPassword:function(a){var b=0;if(a.length<5){b+=3}else{if(a.length>4&&a.length<8){b+=6}else{if(a.length>7&&a.length<16){b+=12}else{if(a.length>15){b+=18}}}}if(a.match(/[a-z]/)){b+=1}if(a.match(/[A-Z]/)){b+=5}if(a.match(/\d+/)){b+=5}if(a.match(/(.*[0-9].*[0-9].*[0-9])/)){b+=5}if(a.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)){b+=5}if(a.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){b+=5}if(a.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){b+=2}if(a.match(/([a-zA-Z])/)&&a.match(/([0-9])/)){b+=2}if(a.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)){b+=2}if(b<5){return 0}else{if(b>=5&&b<15){return 1}else{if(b>=15&&b<30){return 2}else{if(b>=30&&b<35){return 3}else{return 4}}}}}};jQuery().ready(function(){return function(b){for(var a=0;a