var MarchePublicMenuClass=new Class({options:{bpintro:"",bpliste:"",bprecherche:"",bpaide:"",comboorg:"",combocat:"",comborechorg:"",comborechcat:"",keywordentry:"",closedentry:"",rechercheform:""},initialize:function(panel,defpanel,options,data){if($defined(options)){this.setOptions(options);}this.panel=$(panel);ApplySimplePanel(this.panel);this.recherchematcher=new InputMatcher(this.options.rechercheform,{autostart:false,timout:700});if(!Browser.Engine.trident){$(this.options.rechercheform).addEvent("keypress",function(event){if(event.code==event.event.DOM_VK_RETURN){this.doFind();return(false);}return(true);}.bind(this));}this.comboorganisme=new ComboBox($(this.options.comboorg),OrganismeListe,{onSelect:function(index){menu.doAction("organisme",index);},popupfx:{transition:Fx.Transitions.Bounce.easeOut,duration:500},size:{width:200,height:24},startindex:(mode=="liste"?data:0)});this.combocategorie=new ComboBox($(this.options.combocat),CategorieListe,{onSelect:function(index){menu.doAction("categorie",index);},popupfx:{transition:Fx.Transitions.Bounce.easeOut,duration:500},size:{width:200,height:24}});this.comboorganismerecherche=new ComboBox($(this.options.comborechorg),OrganismeListe,{onSelect:function(index){menu.doAction("organismerecherche",index);},popupfx:{transition:Fx.Transitions.Bounce.easeOut,duration:500},size:{width:200,height:24}});this.combocategorierecherche=new ComboBox($(this.options.comborechcat),CategorieListe,{onSelect:function(index){menu.doAction("categorierecherche",index);},popupfx:{transition:Fx.Transitions.Bounce.easeOut,duration:500},size:{width:200,height:24}});this.changePanel(defpanel,mode=="offre"?data:null);},doAction:function(action,index){switch(action){case"categorie":case"organisme":obj.doAction("combo",{keyword:"",type:false,organisme:this.comboorganisme.getid(),categorie:this.combocategorie.getid()});break;}},changePanel:function(p,offre){if(this.currentpanel==p){return ;}$(this.options.bpintro).removeClass("lien_accueilsel");$(this.options.bpliste).removeClass("lien_offressel");$(this.options.bprecherche).removeClass("lien_recherchesel");$(this.options.bpaide).removeClass("lien_aidesel");action=p;data=null;switch(p){case"recherche":$(this.options.bprecherche).addClass("lien_recherchesel");this.recherchematcher.setActivate(true);break;case"intro":$(this.options.bpintro).addClass("lien_accueilsel");this.recherchematcher.setActivate(false);break;case"aide":$(this.options.bpaide).addClass("lien_aidesel");this.recherchematcher.setActivate(false);break;case"offre":p="liste";$(this.options.bpliste).addClass("lien_offressel");this.recherchematcher.setActivate(false);data=$defined(offre)?offre:null;break;case"liste":$(this.options.bpliste).addClass("lien_offressel");this.recherchematcher.setActivate(false);data={keyword:"",type:false,organisme:this.comboorganisme.getid(),categorie:this.combocategorie.getid()};break;}this.currentpanel=p;this.panel.maximizePanel(p);try{obj.setMode(action,data);}catch(e){}},doFind:function(){if(!this.recherchematcher.isFormOk()){obj.doAction("recherche",null);}obj.doAction("recherche",{keywork:$(this.options.rechercheform).keyword.value,type:$(this.options.rechercheform).closed.checked,organisme:this.comboorganismerecherche.getid(),categorie:this.combocategorierecherche.getid()});}});MarchePublicMenuClass.implement(new Options);
