 if(!BigApi.ObjectController) BigApi.ObjectController = {}; BigApi.ObjectController.Pool = { registeredControllers:$H(), registerController:function(id, controller) { oldcontroller = this.registeredControllers.get(id); if(oldcontroller && oldcontroller.dispose) { elog('Controller already registered for id '+id); oldcontroller.dispose()} this.registeredControllers.set(id, controller)}, unregisterController:function(id) { this.registeredControllers.unset(id)} }; BigApi.ObjectController.ZonesPool = { registeredControllers:$H(), registeredIdToZone:$H(), registeredZoneToId:$H(), registerController:function(zone, id, controller) { if(!this.registeredZoneToId.get(zone)) { this.registeredZoneToId.set(zone, $H())} this.registeredZoneToId.get(zone).set(id, controller); this.registeredControllers.set(id, controller); this.registeredIdToZone.set(id, zone)}, unregisterController:function(id) { this.registeredControllers.unset(id); var zone = this.registeredIdToZone.get(id); if(zone) { this.registeredZoneToId.get(zone).unset(id)} else { dlog('unregistering controller for '+id+' - no zone associated')} this.registeredIdToZone.unset(id)}, unregisterZoneControllers:function(zone) { var zonea = this.registeredZoneToId.get(zone); if(zonea) { zonea.each(function(pair){ this.registeredIdToZone.unset(pair.key); pair.value.dispose()}.bind(this)); this.registeredZoneToId.unset(zone)} } }; BigApi.ObjectController.IBasic = Class.create(BigApi.IObservable, { initialize:function($super, displayContainerId, options) { $super(); this.displayContainerId = displayContainerId; this.options = options || {}; BigApi.ObjectController.Pool.registerController(displayContainerId, this); this.objectManager = null; if(BigApi.ObjectModule && BigApi.ObjectModule.Pool) { var manager = BigApi.ObjectModule.Pool.getManager(displayContainerId); if (manager) { manager.registerController(this); this.objectManager = manager; this.mainContainer = this.objectManager.mainContainer} } else { this.mainContainer = $(displayContainerId); if(!this.mainContainer) { elog('[BUG] BigApi.ObjectController.IBasic => Can\'t find object container of id '+displayContainerId); return} } this.objectClass = this.mainContainer.classNames().reject(function(e){e == 'BigApiObj'}).last(); var bodyContainer = this.mainContainer.down(); if(bodyContainer && bodyContainer.hasClassName('BigApiObjControlBar')) bodyContainer = bodyContainer.next(); if(bodyContainer) this.templateClass = bodyContainer.className}, getBodyContainer:function() { var bodyContainer = this.mainContainer.down(); if(bodyContainer && bodyContainer.hasClassName('BigApiObjControlBar')) bodyContainer = bodyContainer.next(); return bodyContainer}, getTemplateClass:function() { var bodyContainer = this.getBodyContainer(); if(bodyContainer) { return bodyContainer.className} else return null}, dispose:function($super) { $super(); BigApi.ObjectController.Pool.unregisterController(this.displayContainerId)} }); BigApi.ObjectController.IBasicForm = Class.create(BigApi.ObjectController.IBasic, { initialize:function($super, displayContainerId, options) { $super(displayContainerId, options); this.errorsContainer = null; this.successContainer = null; this.fieldBaseName = this.objectClass+'[Fields]'; this.lastSubmitParams = {}; this.tips = $A(); this._findFormElement(); if(this.form) { this.addObserver(this.form, 'submit', this._onSubmit.bindAsEventListener(this)); this.addObserver(document, this.objectClass+':Submit', this._onSubmit.bindAsEventListener(this))} }, _findFormElement:function() { this.form = this.mainContainer.down('form')}, dispose:function($super) { $super(); this.tips.each(function(tip) { Tips.remove(tip.element)}); this.tips.clear()}, _onSubmit:function(event) { Event.stop(event); if(event.memo) this.lastSubmitParams = event.memo; else this.lastSubmitParams = {}; var inputs = this.form.getElements(); var errors = $A(); this.tips.each(function(tip) { Tips.remove(tip.element)}); this.tips.clear(); if(!this.options.ignoreFieldsPreValidation) inputs.each(function(input) { if(input.type != 'submit' && input.type != 'button') { var has_error = false; var paragraph = input.up('.paragraph'); if(input.value == '' && paragraph && paragraph.hasClassName('mandatory')) { message = 'Ce champ doit être obligatoirement rempli'; has_error = true} if(!has_error) { if(paragraph) input.up('.paragraph').removeClassName('error')} else { if(paragraph) input.up('.paragraph').addClassName('error'); errors.push({input:input, message:message}) } } }.bind(this)); $A(this._postValidateFields()).each(function(error){ errors.push(error)}); if (errors.size()) this._errorsDisplay(errors); else { this._errorsDisplay(null); var ajaxParams = this.form.serialize(true); ajaxParams.displayContainerId = this.displayContainerId; ajaxParams.objectClass = this.objectClass; if(this.lastSubmitParams.actionOnSuccess) ajaxParams[this.objectClass+'[actionOnSuccess]'] = this.lastSubmitParams.actionOnSuccess; new Ajax.Request('ajax/ObjectControllerBasicForm', { parameters:ajaxParams, onSuccess:this._onSubmitSuccess.bind(this) }) } }, _postValidateFields:function() { return []}, _errorsDisplay:function(errors) { if(errors) { if(this.successContainer) this.successContainer.hide(); if(!this.errorsContainer) { this.errorsContainer = new Element('div', {className:'errors_container'}); this.form.insertBefore(this.errorsContainer, this.form.down())} this.errorsContainer.update(); var global_messages = $A(); errors.each(function(obj) { if(typeof(obj) == 'string') { obj = { type:'global', message:obj } } if(obj.type == 'global' && obj.message) { global_messages.push(obj.message)} else { var input = null; if(obj.input) input = obj.input; else if(obj.fieldName && obj.fieldGroup) { input = this.getInput(obj.fieldName, obj.fieldGroup)} else if(obj.fieldName) { input = this.getInput(obj.fieldName)} if(input) { var paragraph = input.up('.paragraph'); if(obj.message && paragraph) this.tips.push(new Tip(paragraph.down('label'), obj.message, { delay:0, showOn:'mouseover', viewport: false, fixed:true, hook: {target: 'bottomRight', tip: 'topLeft'}, offset:{x:-10, y:-15} })); if(paragraph) input.up('.paragraph').addClassName('error')} } }.bind(this)); if(global_messages.length) { global_messages.each(function(message) { var div_message = new Element('div', {className:'error'}); div_message.update(message); this.errorsContainer.appendChild(div_message)}.bind(this))} else { var div_message = new Element('div', {className:'error'}); div_message.update('Des erreurs ont été détectées, veuillez vérifier les champs marqués en rouge'); this.errorsContainer.appendChild(div_message); window.scrollTo(0,0)} this.errorsContainer.show()} else { if(this.errorsContainer) { this.errorsContainer.hide(); this.errorsContainer.update()} } }, _successDisplay:function(obj) { if(!this.successContainer) { this.successContainer = new Element('div', {className:'success_container', style:'display:none;'}); this.form.insertBefore(this.successContainer, this.form.down())} message = obj.message; if(!message) message = 'Les données ont été traitées avec succès'; this.successContainer.update(); this.successContainer.update(message); Effect.Appear(this.successContainer); window.scrollTo(0,0)}, getInput:function(name, group) { var fieldname = this.fieldBaseName; if(group) fieldname += '['+group+']'; fieldname += '['+name+']'; result = this.form.getInputs(null, fieldname); if(result.length) return result[0]}, _onSubmitSuccess:function(transport) { var obj = BigApi.Utils.ajaxJsonEval(transport); if(obj.success) { this._onSuccessActions(obj)} else { this._errorsDisplay($A(obj.errors))} }, _onSuccessActions:function(obj) { this._successDisplay(obj); if(this.options.resetFormOnSuccess) this.form.reset()} }); if(!BigApi.Context) BigApi.Context = {}; BigApi.Context.Pool = { registeredObjects:$H(), registeredContextSwitchers:$A(), registerContext:function(id, infos) { if(!this.registeredObjects.get(id)) this.registeredObjects.set(id, new BigApi.Context.Manager(id, infos))}, getObject:function(id) { return this.registeredObjects.get(id)}, registerContextSwitcher:function(object) { this.registeredContextSwitchers.push(object)}, unregisterContextSwitcher:function(object) { this.registeredContextSwitchers = this.registeredContextSwitchers.without(object)}, getContextSwitchers:function() { return this.registeredContextSwitchers}, getCurrentContextDatas:function() { return BigApi.Context.Loader.getCurrentParams()} }; BigApi.Context.Loader = { params:{ global:{}, extra:{}, routes:{} }, baseParams:null, baseUrls:{}, load:function() { new Ajax.Request('ajax/ContextAction', { parameters:{ action:'load' }, onSuccess:this._onAjaxLoadSuccess.bind(this) })}, _onAjaxLoadSuccess:function(transport) { var array = BigApi.Utils.ajaxJsonEval(transport); $H(array.datas).each(function(pair) { BigApi.Context.Pool.registerContext(pair.key, pair.value)}); this.params = array.currentParams; this.baseParams = Object.clone(this.params); if(!this.params.routes) this.params.routes = {}; if(!this.params.extra) this.params.extra = {}; this.baseUrls = array.baseUrls; hash = this.getContextHash(); BigApi.Context.History.load(hash)}, updateContext:function(url, params, dontFireEvent, dontUpdateWindowLocation) { if (!url && !params) { if(!dontFireEvent) document.fire('BigApi.Context:onUpdateContext', { lastParams:Object.clone(this.params), newParams:Object.clone(this.params) })} else { new Ajax.Request('ajax/ContextAction', { parameters: { url: url, action:'update', params: $H(params).toJSON() }, onSuccess: this._onAjaxUpdateSuccess.bind(this, url, dontFireEvent, dontUpdateWindowLocation) })} }, _onAjaxUpdateSuccess:function(url, dontFireEvent, dontUpdateWindowLocation, transport) { var datas = BigApi.Utils.ajaxJsonEval(transport); if(!datas.params.routes) datas.params.routes = {}; if(!datas.params.extra) datas.params.extra = {}; if(BigApi.ObjectModule && (datas.params.global.zone != this.params.global.zone || datas.params.global.lang != this.params.global.lang)) { BigApi.ObjectModule.LoaderDocument.reload()} else { if(!dontFireEvent) document.fire('BigApi.Context:onUpdateContext', { lastParams:Object.clone(this.params), newParams:datas.params, url:url }); if(window.pmv_click && url && url.length && window.phpmyvisitesURL && window.phpmyvisitesSite) { window.pmv_click(window.phpmyvisitesURL, window.phpmyvisitesSite, url, '', '')} } this.params = Object.clone(datas.params); if(!dontUpdateWindowLocation) this.updateWindowLocation()}, getCurrentParams:function() { return Object.clone(this.params)}, getContextHash:function() { var hash = ''; $H(this.params.routes).each(function(pair) { if(hash != '') hash += '/'; hash += pair.key+(pair.value && pair.value != '' ? '-'+this._formalizeHashPairValue(pair.value) : '')}.bind(this)); $H(this.params.extra).each(function(pair) { if(hash != '') hash += '/'; hash += pair.key+(pair.value && pair.value != '' ? '-'+this._formalizeHashPairValue(pair.value) : '')}.bind(this)); return hash}, onContextHashUpdated:function(newHash) { var hash = this.getContextHash(); if(newHash != hash) { var params = {}; if(newHash) { $A(newHash.split('/')).each(function(couple){ var tab = couple.split('-'); params[tab[0]] = tab[1] ? this._formalizeHashPairValue(decodeURI(tab[1])) : ''}.bind(this)); this.updateContext('',params, null, null)} else { this.updateContext('',this.baseParams, null, true)} } }, _formalizeHashPairValue:function(value) { if(value && isNaN(value)) return value.replace(/[ \'\"]+/g, '_'); else return value}, updateWindowLocation:function() { var lastUrl = window.location.href; var hash = this.getContextHash(); var i = window.location.href.indexOf('#'); var clurl = i < 0 ? window.location.href : window.location.href.substr(0, i); var found = null; $H(this.baseUrls).each(function(pair){ if(!found && (pair.value == clurl || pair.value.substr(0,pair.value.length-1) == clurl)) found = clurl}); if(!found) found = this.baseUrls.base; var newUrl = found+'#'+hash; if(lastUrl != newUrl) { window.location.href=newUrl; BigApi.Context.History.updateCurrentToken(hash)} } }; BigApi.Context.Manager = Class.create({ initialize:function(id, infos) { this.id = id; this.infos = infos}, getId:function() { return this.id}, getParam:function() { return this.infos.param}, getName:function() { return this.infos.name}, getPackage:function() { return this.infos.pack} }); BigApi.Context.History = { iframe:null, hiddenField:null, ready: false, currentToken : null, fieldId: 'x-history-field', iframeId: 'x-history-frame', load:function(baseHash) { this.startUp()}, startUp:function() { this.currentToken = this.getToken(); if (BigApi.Browser.IE) { } else { var hash = this.getHash(); setInterval(function () { var newHash = this.getHash(); if (newHash !== hash) { hash = newHash; this.handleStateChange(hash)} }.bind(this), 50); this.ready = true} }, updateIFrame:function (token) { var html = ['<html><body><div id="state">',token,'</div></body></html>'].join(''); try { var doc = this.iframe.contentWindow.document; doc.open(); doc.write(html); doc.close(); return true} catch (e) { return false} }, checkIFrame:function() { if (!this.iframe.contentWindow || !this.iframe.contentWindow.document) { setTimeout(this.checkIFrame, 10); return} var doc = this.iframe.contentWindow.document; var elem = doc.getElementById("state"); var token = elem ? elem.innerText : null; var hash = getHash(); setInterval(function () { doc = this.iframe.contentWindow.document; elem = doc.getElementById("state"); var newtoken = elem ? elem.innerText : null; var newHash = this.getHash(); if (newtoken !== token) { token = newtoken; this.handleStateChange(token); top.location.hash = token; hash = token} else if (newHash !== hash) { hash = newHash; this.updateIFrame(newHash)} }.bind(this), 50); this.ready = true; Ext.History.fireEvent('ready', Ext.History); this.startUp()}, getHash:function() { var href = top.location.href, i = href.indexOf("#"); return i >= 0 ? href.substr(i + 1) : null}, updateCurrentToken:function(token) { this.currentToken = token}, handleStateChange:function(token) { this.updateCurrentToken(token); BigApi.Context.Loader.onContextHashUpdated(token)}, getToken: function() { return this.ready ? this.currentToken : this.getHash()}, back: function() { history.go(-1)}, forward: function() { history.go(1)} }; BigApi.Context.Loader.load(); var Prototip = { Version: '1.3.0' }; var Tips = { options: { className: 'default', closeButtons: false, zIndex: 6000 } }; eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('o.1w(z,{3L:"1.6.0.2",3K:"1.8.1",2I:c(){5.2k("21");h.1Z();q.10(2f,"2d",5.2d)},2k:c(A){b((3n 2f[A]=="3l")||(5.2c(2f[A].3d)<5.2c(5["2v"+A]))){34("31 45 "+A+" >= "+5["2v"+A]);}},2c:c(A){i B=A.3U(/2T.*|\\./g,"");B=3P(B+"0".3O(4-B.1U));p A.3C("2T")>-1?B-1:B},1J:c(A){b(!21.2N.2L){A=A.1M(c(E,D){i C=o.28(5)?5:5.e,B=D.3j;b(B!=C&&!$A(C.2A("*")).3e(B)){E(D)}})}p A},1v:c(B){B=$(B);i A=B.3c(),C=[],E=[];A.1p(B);A.20(c(F){b(F!=B&&F.t()){p}C.1p(F);E.1p({1H:F.1I("1H"),17:F.1I("17"),1e:F.1I("1e")});F.j({1H:"3Z",17:"3W",1e:"t"})});i D={u:B.3T,R:B.3R};C.20(c(G,F){G.j(E[F])});p D},2d:c(){h.2S()}});o.1w(h,{V:[],t:[],1Z:c(){5.1X=5.U},1m:(c(A){p{1a:(A?"1E":"1a"),12:(A?"1x":"12"),1E:(A?"1E":"1a"),1x:(A?"1x":"12")}})(21.2N.2L),11:(c(B){i A=N 3F("3B ([\\\\d.]+)").3x(B);p A?(3w(A[1])<7):O})(3u.3s),2J:c(A){5.V.1p(A)},1f:c(A){i B=5.V.3r(c(C){p C.e==$(A)});b(B){B.2G();b(B.v){B.f.1f();b(h.11){B.Z.1f()}}5.V=5.V.2E(B)}},2S:c(){5.V.20(c(A){5.1f(A.e)}.Y(5))},27:c(B){b(B.26){p}b(5.t.1U==0){5.1X=5.9.U;1O(i A=0;A<5.V.1U;A++){5.V[A].f.j({U:5.9.U})}}B.f.j({U:5.1X++});b(B.m){B.m.j({U:5.1X})}1O(i A=0;A<5.V.1U;A++){5.V[A].26=O}B.26=1D},2z:c(A){5.24(A);5.t.1p(A)},24:c(A){5.t=5.t.2E(A)},L:c(D,E){D=$(D),E=$(E);i C=o.1w({e:"2y",n:"3b",13:{x:0,y:0}},2u[2]||{});i B=E.2j();B.14+=C.13.x;B.Q+=C.13.y;i G={e:z.1v(D),n:z.1v(E)},A={e:o.2n(B),n:o.2n(B)};1O(i F 2q A){30(C[F]){1q"2Y":A[F][0]+=G[F].u;1r;1q"44":A[F][0]+=(G[F].u/2);1r;1q"43":A[F][0]+=G[F].u;A[F][1]+=(G[F].R/2);1r;1q"2y":A[F][1]+=G[F].R;1r;1q"42":A[F][0]+=G[F].u;A[F][1]+=G[F].R;1r;1q"41":A[F][0]+=(G[F].u/2);A[F][1]+=G[F].R;1r;1q"40":A[F][1]+=(G[F].R/2);1r}}B.14+=-1*(A.e[0]-A.n[0]);B.Q+=-1*(A.e[1]-A.n[1]);D.j({14:B.14+"1z",Q:B.Q+"1z"})}});h.1Z();i 3Y=3X.3V({1Z:c(C,D){5.e=$(C);h.1f(5.e);i A=(o.2m(D)||o.28(D)),B=A?2u[2]||[]:D;5.1d=A?D:2W;5.9=o.1w({P:O,M:h.9.M,W:h.9.3S,15:!(B.s&&B.s=="1Y")?0.2:O,1G:0.3,S:O,1o:O,1k:"1x",L:B.L,13:B.L?{x:0,y:0}:{x:16,y:16},1n:B.L?1D:O,s:"1W",n:5.e,r:O,1V:B.L?O:1D},B);5.n=$(5.9.n);b(5.9.P){5.9.P.9=o.1w({2i:21.3N},5.9.P.9||{})}5.2R();b(5.9.S){z.2k("3J");5.1l={17:"3H",3G:1,2h:5.f.2Q()}}h.2J(5);5.2P()},2R:c(){5.f=N q("1c",{M:"1T"}).j({1H:"1S",U:h.9.U});5.f.2Q();b(h.11){5.Z=N q("3E",{M:"Z",3D:"3A:O;",3z:0}).j({1H:"1S",U:h.9.U-1,3y:0})}b(5.9.P){5.1F=5.1F.1M(5.2O);$(1B.22).T(5.m=N q("1c",{M:"3v"}).k())}5.1s=N q("1c",{M:"1d"});5.r=N q("1c",{M:"r"}).k();b(5.9.W||(5.9.1k.e&&5.9.1k.e=="W")){5.W=N q("a",{3t:"#",M:"2K"})}},2b:c(){b(h.11){$(1B.22).T(5.Z)}i A="f";b(5.9.S){A="18";5.f.T(5.18=N q("1c",{M:"18"}))}5[A].T(5.v=N q("1c",{M:"v "+5.9.M}).T(5.1g=N q("1c",{M:"1g"}).T(5.r)));5.v.T(5.1s);$(1B.22).T(5.f);b(!5.9.P){5.1A({r:5.9.r,1d:5.1d})}},1A:c(E){i A=5.v.1I("1e"),B=5.f.j("R:1C;u:1C;").1I("1e");[5.v,5.f].1u("j","1e:2H;");5.1g.j("u: 1C;");b(5.9.S){5.18.j("R:1C;u:1C;")}b(E.r){5.r.l().1A(E.r);5.1g.l()}1j{b(!5.W){5.r.k();5.1g.k()}}b(o.2m(E.1d)||o.28(E.1d)){5.1s.1A(E.1d).T(N q("1c").j("3q:3p;"))}i C={u:z.1v(5.f).u+"1z"},D=[5.f];b(5.9.S){D.1p(5.18)}b(h.11){D.1p(5.Z)}b(5.W){5.r.l().T({Q:5.W});5.1g.l()}5.1g.j("u: 3o%;");C.R=z.1v(5.f).R+"1z";5.f.j({1e:B});5.v.j({1e:A});D.1u("j",C)},2P:c(){5.29=5.1F.19(5);5.2F=5.k.19(5);b(5.9.1n&&5.9.s=="1W"){5.9.s="1a"}b(5.9.s==5.9.1k){5.1i=5.2D.19(5);5.e.10(5.9.s,5.1i)}i C={e:5.1i?[]:[5.e],n:5.1i?[]:[5.n],1s:5.1i?[]:[5.f],W:[],1S:[]};i A=5.9.1k.e;5.25=A||(!5.9.1k?"1S":"e");5.1h=C[5.25];b(!5.1h&&A&&o.2m(A)){5.1h=5.1s.2A(A)}i D={1E:"1a",1x:"12"};$w("l k").20(c(H){i G=H.3m(),F=(5.9[H+"2C"].2a||5.9[H+"2C"]);5[H+"2B"]=F;b(["1E","1x","1a","12"].3k(F)){5[H+"2B"]=(h.1m[F]||F);5["2a"+G]=z.1J(5["2a"+G])}}.Y(5));b(!5.1i){5.e.10(5.9.s,5.29)}b(5.1h){5.1h.1u("10",5.3i,5.2F)}b(!5.9.1n&&5.9.s=="1Y"){5.1K=5.17.19(5);5.e.10("1W",5.1K)}5.2M=5.k.1M(c(G,F){F.3h();i E=F.3g(".2K");b(E){E.3f();G(F)}}).19(5);b(5.W){5.f.10("1Y",5.2M)}b(5.9.s!="1Y"&&(5.25!="e")){5.1N=z.1J(c(){5.X("l")}).19(5);5.e.10(h.1m.12,5.1N)}i B=[5.e,5.f];5.2e=z.1J(c(){h.27(5);5.2g()}).19(5);5.23=z.1J(5.1o).19(5);B.1u("10",h.1m.1a,5.2e).1u("10",h.1m.12,5.23)},2G:c(){b(5.9.s==5.9.1k){5.e.1b(5.9.s,5.1i)}1j{5.e.1b(5.9.s,5.29);b(5.1h){5.1h.1u("1b")}}b(5.1K){5.e.1b("1W",5.1K)}b(5.1N){5.e.1b("12",5.1N)}5.f.1b();5.e.1b(h.1m.1a,5.2e).1b(h.1m.12,5.23)},2O:c(C,B){b(!5.v){5.2b()}5.17(B);b(5.2x){C(B);p}1j{b(5.1P){p}}i D={2w:{1Q:1L.1Q(B),1R:1L.1R(B)}};i A=o.2n(5.9.P.9);A.2i=A.2i.1M(c(F,E){5.1A({r:5.9.r,1d:E.3a});5.17(D);b(!5.m.t()){p}(c(){F(E);b(5.m.t()){5.l()}5.X("m");5.m.k();5.2x=1D;5.1P=O}.Y(5)).15(0.4)}.Y(5));5.3I=q.l.15(5.9.15,5.m);5.f.k();5.1P=1D;(c(){5.39=N 38.37(5.9.P.3M,A)}.Y(5)).15(5.9.15)},1F:c(A){b(!5.v){5.2b()}b(!5.9.P){5.17(A)}b(5.f.t()){p}5.X("l");5.36=5.l.Y(5).15(5.9.15)},X:c(A){b(5[A+"2U"]){35(5[A+"2U"])}},l:c(){b(5.f.t()&&5.9.S!="3Q"){p}b(h.11){5.Z.l()}h.2z(5.f);5.v.k();b(5.9.S){5.18.k();5.f.l();b(5.1t){1y.2t.2s(5.1l.2h).1f(5.1t)}5.1t=1y[1y.2r[5.9.S][0]](5.18,{33:q.l.32(5.v),1G:5.9.1G,1l:5.1l,2V:q.2l.Y(5,5.e,"1T:2p")})}1j{5.v.l();5.f.l();5.e.2l("1T:2p")}},1o:c(A){b(5.9.P){5.m.k();5.X("m");5.X("P");5.1P=2W}b(!5.9.1o){p}5.2g();5.2Z=5.k.Y(5).15(5.9.1o)},2g:c(){b(5.9.1o){5.X("1o")}},k:c(){5.X("l");5.X("m");b(!5.f.t()){p}b(5.9.S){b(5.1t){1y.2t.2s(5.1l.2h).1f(5.1t)}5.1t=1y[1y.2r[5.9.S][1]](5.18,{1G:5.9.1G,1l:5.1l,2V:5.2o.Y(5)})}1j{5.2o()}},2o:c(){b(h.11){5.Z.k()}b(5.m){5.m.k()}5.f.k();h.24(5.f);5.e.2l("1T:2H")},2D:c(A){b(5.f&&5.f.t()){5.k(A)}1j{5.1F(A)}},17:c(A){h.27(5);b(5.9.L){i J=o.1w({13:5.9.13},{e:5.9.L.1s,n:5.9.L.n});h.L(5.f,5.n,J);b(5.m){h.L(5.m,5.n,J)}b(h.11){h.L(5.Z,5.n,J)}}1j{i E=5.n.2j(),I=z.1v(5.f),C=A.2w||{},F={14:((5.9.1n)?E[0]:C.1Q||1L.1Q(A))+5.9.13.x,Q:((5.9.1n)?E[1]:C.1R||1L.1R(A))+5.9.13.y};b(!5.9.1n&&5.e!==5.n){i B=5.e.2j();F.14+=-1*(B[0]-E[0]);F.Q+=-1*(B[1]-E[1])}b(!5.9.1n&&5.9.1V){i K=1B.1V.2X(),G=1B.1V.46(),D={14:"u",Q:"R"};1O(i H 2q D){b((F[H]+I[D[H]]-K[H])>G[D[H]]){F[H]=F[H]-I[D[H]]-2*5.9.13[H=="Q"?"x":"y"]}}}F={14:F.14+"1z",Q:F.Q+"1z"};5.f.j(F);b(5.m){5.m.j(F)}b(h.11){5.Z.j(F)}}}});z.2I();',62,255,'|||||this||||options||if|function||element|wrapper||Tips|var|setStyle|hide|show|loader|target|Object|return|Element|title|showOn|visible|width|tooltip||||Prototip||||||||||||hook|className|new|false|ajax|top|height|effect|insert|zIndex|tips|closeButton|clearTimer|bind|iframeShim|observe|fixIE|mouseout|offset|left|delay||position|effectWrapper|bindAsEventListener|mouseover|stopObserving|div|content|visibility|remove|toolbar|hideTargets|eventToggle|else|hideOn|queue|useEvent|fixed|hideAfter|push|case|break|tip|activeEffect|invoke|getHiddenDimensions|extend|mouseleave|Effect|px|update|document|auto|true|mouseenter|showDelayed|duration|display|getStyle|capture|eventPosition|Event|wrap|eventCheckDelay|for|ajaxContentLoading|pointerX|pointerY|none|prototip|length|viewport|mousemove|zIndexTop|click|initialize|each|Prototype|body|activityLeave|removeVisible|hideElement|highest|raise|isElement|eventShow|event|build|convertVersionString|unload|activityEnter|window|cancelHideAfter|scope|onComplete|cumulativeOffset|require|fire|isString|clone|afterHide|shown|in|PAIRS|get|Queues|arguments|REQUIRED_|ajaxPointer|ajaxContentLoaded|bottomLeft|addVisibile|select|Action|On|toggle|without|eventHide|deactivate|hidden|start|add|close|IE|buttonEvent|Browser|showAjax|activate|identify|setup|removeAll|_|Timer|afterFinish|null|getScrollOffsets|topRight|hideAfterTimer|switch|Lightview|curry|beforeStart|throw|clearTimeout|showTimer|Request|Ajax|ajaxTimer|responseText|topLeft|ancestors|Version|member|blur|findElement|stop|hideAction|relatedTarget|include|undefined|capitalize|typeof|100|both|clear|find|userAgent|href|navigator|prototipLoader|parseFloat|exec|opacity|frameBorder|javascript|MSIE|indexOf|src|iframe|RegExp|limit|end|loaderTimer|Scriptaculous|REQUIRED_Scriptaculous|REQUIRED_Prototype|url|emptyFunction|times|parseInt|appear|clientHeight|closeButtons|clientWidth|replace|create|absolute|Class|Tip|block|leftMiddle|bottomMiddle|bottomRight|rightMiddle|topMiddle|requires|getDimensions'.split('|'),0,{})); if(!BigApi.Graphic) BigApi.Graphic = {}; BigApi.Graphic.SlidingContainer = Class.create(BigApi.IObservable, { initialize:function($super, container, options) { $super(); this.buttons=$A(); this.buttons_actives=$A(); this.options={}; this.inAnimation=false; this.container = $(container); if(!this.container) return; this.options = Object.extend( { duration : 0.5, classNames : { toggle : 'sliding_container_toggle', toggleActive : 'sliding_container_toggle_active', content : 'sliding_container_content' }, defaultSize: { width:null, height:null }, randomOpen:false, headersBeforeContent:true, enableEventOnActive:false, onEvent : 'click', onEventCustom: null, mode:'accordion', disableEffects:false }, options || {}); if(BigApi.Browser.IE && BigApi.Browser.IEVersion <= 6) this.options.disableEffects = true; this.buttons = container.select('.'+this.options.classNames.toggle); this.buttons.each(function(button) { if(this.options.headersBeforeContent) var content = button.next('.'+this.options.classNames.content); else var content = button.previous('.'+this.options.classNames.content); if(content) { if(content.style.height != '0px') { button.addClassName(this.options.classNames.toggleActive); content.style.height = 'auto'; this.buttons_actives.push(button)} this.addObserver(button, this.options.onEvent, this.toggle.bind(this, button)); if(this.options.onEventCustom) this.addObserver(button, this.options.onEventCustom, this.toggle.bind(this, button))} }.bind(this)); if(!this.buttons_actives.length && this.options.randomOpen) { var rand = Math.floor((this.buttons.length)*Math.random()); if(this.options.randomOpenDelay) { setTimeout(this.open.bind(this, this.buttons[rand]),this.options.randomOpenDelay*1000)} else this.open(this.buttons[rand])} }, dispose:function($super) { $super()}, openFirst:function() { var button = this.buttons.first(); this.open(button)}, openAll:function() { this.buttons.each(function(button) { this.open(button, 'normal')}.bind(this))}, closeAll:function() { this.buttons_actives.each(function(button) { this.close(button, 'normal')}.bind(this))}, open:function(button, force_mode) { if(this.inAnimation) return false; if(!button || button.hasClassName(this.options.classNames.toggleActive)) return false; var mode = force_mode || this.options.mode; if(this.options.headersBeforeContent) var next_elem = button.next('.'+this.options.classNames.content); else var next_elem = button.previous('.'+this.options.classNames.content); var anim_options = { transition: Effect.Transitions.sinoidal, duration: this.options.duration, scaleContent: false, scaleFrom:1, scaleX: false, scaleY: true, scaleMode: { originalHeight: this.options.defaultSize.height ? this.options.defaultSize.height : next_elem.down('div').scrollHeight, originalWidth: this.options.defaultSize.width ? this.options.defaultSize.width : next_elem.down('div').scrollWidth }, beforeStart: function(next_elem) { next_elem.setStyle({height:'0px'}); this.inAnimation = true}.bind(this, next_elem), afterFinish: function(next_elem) { next_elem.setStyle({height:'auto'}); this.inAnimation = false}.bind(this, next_elem) }; button.addClassName(this.options.classNames.toggleActive); if(mode == 'accordion') { this.buttons_actives.each(function(button) { this.close(button)}.bind(this))} this.buttons_actives.push(button); if(!this.options.disableEffects) new Effect.Scale(next_elem, 100, anim_options); else { this.inAnimation = false; next_elem.setStyle({height:'auto'})} }, close:function(button) { if(!button || !button.hasClassName(this.options.classNames.toggleActive)) return false; if(this.options.headersBeforeContent) var next_elem = button.next('.'+this.options.classNames.content); else var next_elem = button.previous('.'+this.options.classNames.content); var anim_options = { transition: Effect.Transitions.sinoidal, duration: this.options.duration, scaleContent: false, scaleX: false, scaleY: true, scaleMode: { originalHeight: this.options.defaultSize.height ? this.options.defaultSize.height : next_elem.down('div').scrollHeight, originalWidth: this.options.defaultSize.width ? this.options.defaultSize.width : next_elem.down('div').scrollWidth }, beforeStart: function(next_elem) { this.inAnimation = true; next_elem.setStyle({overflow:'hidden'})}.bind(this, next_elem), afterFinish: function(next_elem) { this.inAnimation = false; next_elem.setStyle({height:'0px'})}.bind(this, next_elem) }; button.removeClassName(this.options.classNames.toggleActive); this.buttons_actives = this.buttons_actives.without(button); if(!this.options.disableEffects) new Effect.Scale(next_elem, 0, anim_options); else { next_elem.setStyle({height:'0px', overflow:'hidden'}); this.inAnimation = false} }, toggle:function(button) { if(button.hasClassName(this.options.classNames.toggleActive)) { if(this.options.enableEventOnActive) { this.close(button)} } else { this.open(button)} }, hasButton:function(item) { return this.buttons.member(item)}, hasButtonActive:function(item) { return this.buttons_actives.member(item)} }); if(!BigApi.Graphic) BigApi.Graphic = {}; BigApi.Graphic.SlidingContainer2 = Class.create(BigApi.IObservable, { initialize:function($super, container, options) { $super(); this.buttons=$A(); this.buttons_actives=$A(); this.options={}; this.inAnimation=false; this.container = $(container); if(!this.container) return; this.options = Object.extend( { duration : 0.5, classNames : { toggle : 'sliding_container_toggle', toggleRegexp : 'sliding_container_toggle_([0-9]+)', toggleActive : 'sliding_container_toggle_active', content : 'sliding_container_content' }, defaultSize: { width:null, height:null }, randomOpen:false, enableEventOnActive:false, onEvent : 'click', mode:'accordion', disableEffects:false }, options || {}); if(BigApi.Browser.IE && BigApi.Browser.IEVersion <= 6) this.options.disableEffects = true; this.buttons = this.container.select('.'+this.options.classNames.toggle); this.buttons.each(function(button) { content = this.findContent(button); if(content) { if(content.style.height != '0px') { button.addClassName(this.options.classNames.toggleActive); content.style.height = 'auto'; this.buttons_actives.push(button)} this.addObserver(button, this.options.onEvent, this.toggle.bind(this, button))} }.bind(this)); if(!this.buttons_actives.length && this.options.randomOpen) { var rand = Math.floor((this.buttons.length)*Math.random()); if(this.options.randomOpenDelay) { setTimeout(this.open.bind(this, this.buttons[rand]),this.options.randomOpenDelay*1000)} else this.open(this.buttons[rand])} }, findContent:function(button) { regexp = new RegExp(this.options.classNames.toggleRegexp); className = button.classNames().find(function(className){ return regexp.test(className)}); return this.container.select('.'+this.options.classNames.content+'.'+className).first()}, dispose:function($super) { $super()}, openFirst:function() { var button = this.buttons.first(); this.open(button)}, openAll:function() { this.buttons.each(function(button) { this.open(button, 'normal')}.bind(this))}, closeAll:function() { this.buttons_actives.each(function(button) { this.close(button, 'normal')}.bind(this))}, open:function(button, force_mode) { if(this.inAnimation) return false; if(!button || button.hasClassName(this.options.classNames.toggleActive)) return false; var mode = force_mode || this.options.mode; var next_elem = this.findContent(button); var anim_options = { transition: Effect.Transitions.sinoidal, duration: this.options.duration, scaleContent: false, scaleFrom:1, scaleX: false, scaleY: true, scaleMode: { originalHeight: this.options.defaultSize.height ? this.options.defaultSize.height : next_elem.down('div').scrollHeight, originalWidth: this.options.defaultSize.width ? this.options.defaultSize.width : next_elem.down('div').scrollWidth }, beforeStart: function(next_elem) { next_elem.setStyle({height:'0px'}); this.inAnimation = true}.bind(this, next_elem), afterFinish: function(next_elem) { next_elem.setStyle({height:'auto'}); this.inAnimation = false}.bind(this, next_elem) }; button.addClassName(this.options.classNames.toggleActive); if(mode == 'accordion') { this.buttons_actives.each(function(button) { this.close(button)}.bind(this))} this.buttons_actives.push(button); if(!this.options.disableEffects) new Effect.Scale(next_elem, 100, anim_options); else { this.inAnimation = false; next_elem.setStyle({height:'auto'})} }, close:function(button) { if(!button || !button.hasClassName(this.options.classNames.toggleActive)) return false; var next_elem = this.findContent(button); var anim_options = { transition: Effect.Transitions.sinoidal, duration: this.options.duration, scaleContent: false, scaleX: false, scaleY: true, scaleMode: { originalHeight: this.options.defaultSize.height ? this.options.defaultSize.height : next_elem.down('div').scrollHeight, originalWidth: this.options.defaultSize.width ? this.options.defaultSize.width : next_elem.down('div').scrollWidth }, beforeStart: function(next_elem) { this.inAnimation = true; next_elem.setStyle({overflow:'hidden'})}.bind(this, next_elem), afterFinish: function(next_elem) { this.inAnimation = false; next_elem.setStyle({height:'0px'})}.bind(this, next_elem) }; button.removeClassName(this.options.classNames.toggleActive); this.buttons_actives = this.buttons_actives.without(button); if(!this.options.disableEffects) new Effect.Scale(next_elem, 0, anim_options); else { next_elem.setStyle({height:'0px', overflow:'hidden'}); this.inAnimation = false} }, toggle:function(button) { if(button.hasClassName(this.options.classNames.toggleActive)) { if(this.options.enableEventOnActive) this.close(button)} else { this.open(button)} }, hasButton:function(item) { return this.buttons.member(item)} , hasButtonActive:function(item) { return this.buttons_actives.member(item)} }); 