var dateActuelle=new Date();var dateDebut=null;var dateFin=null;function empecherDateDebut(date,y,m,d){var TexteDateFin=$("lb_date_fin").value;if(TexteDateFin!=""){TexteDateFin=TexteDateFin.split(new RegExp("/","g"));dateFin=new Date();dateFin.setFullYear(TexteDateFin[2]);dateFin.setMonth(TexteDateFin[1]-1);dateFin.setDate(TexteDateFin[0])}if(((y>dateActuelle.getFullYear())||((y==dateActuelle.getFullYear())&&(m>dateActuelle.getMonth()))||((m==dateActuelle.getMonth())&&(d>=dateActuelle.getDate())))&&((dateFin==null)||(y<=dateFin.getFullYear())&&(m<=dateFin.getMonth())&&(d<=dateFin.getDate()))){return false}return true}function empecherDateFin(date,y,m,d){if(((y>dateActuelle.getFullYear())||((y==dateActuelle.getFullYear())&&(m>dateActuelle.getMonth()))||((m==dateActuelle.getMonth())&&(d>=dateActuelle.getDate())))&&((dateDebut==null)||((y>=dateDebut.getFullYear())&&(m>=dateDebut.getMonth())&&(d>=dateDebut.getDate())))){return false}return true}var Annonce=Class.create();Annonce.prototype=Object.extend(new AbstractFormulaire(),{initialize:function(){this.initForm("nouvelleAnnonce","srv_emp");this.initLocalisation("lb_ville","lb_code_postal","autocompletion_emp","indicatorMobilite");this.idInputVille="lb_ville";this.idAutocomplete="autocompletion_emp";this.idIndicatorAutocomplete="indicatorMobilite";this.idInfoBox="infoBox";this.idTarif="lb_tarif";this.idConteneurTarif="conteneurTarif";this.idInfosCompl="infosCompl";this.idShowDetails="showDetails";this.elAutocomplete=$(this.idAutocomplete);this.elInfoBox=$(this.idInfoBox);this.elTarif=$(this.idTarif);this.elInfosCompl=$(this.idInfosCompl);this.elShowDetails=$(this.idShowDetails);this.elCategories=$(this.idCategories);this.elServices=$(this.idServices);this.urlAutocomplete="/utilisateur/getVillesDepartementsAjax/0/0.html";var me=this;this.smic=6.84;this.elInfosCompl.observe("click",function(evt){if(!me.elShowDetails.visible()){new Effect.SlideDown(me.elShowDetails)}else{me.elInfoBox.hide();new Effect.SlideUp(me.elShowDetails)}});this.elTarif.observe("focus",function(){Position.clone(me.elTarif,me.elInfoBox,{setLeft:true,setTop:true,setWidth:false,setHeight:false,offsetLeft:200});new Form.Element.Observer(me.elTarif,0.8,function(el,value){me.checkTarif(el,value)})})},setAutocompleter:function(){new Ajax.Autocompleter(this.idInputVille,this.idAutocomplete,this.urlAutocomplete,{minChars:3,frequency:0.1,indicator:this.idIndicatorAutocomplete,paramName:"input",updateElement:this.updateInputFields})},checkTarif:function(el,value){if(""!=value){value=value.replace(/,/,".");if(parseFloat(value)<this.smic&&!this.elInfoBox.visible()){new Effect.Appear(this.elInfoBox)}else{if(parseFloat(value)>=this.smic&&this.elInfoBox.visible()){new Effect.Fade(this.elInfoBox)}}}else{if(""==value&&this.elInfoBox.visible()){new Effect.Fade(this.elInfoBox)}}}});var annonce=null;Event.observe(window,"load",function(){annonce=new Annonce()});
