﻿(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);(function(a){var r=a.fn.domManip,d="_tmplitem",q=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,b={},f={},e,p={key:0,data:{}},i=0,c=0,l=[];function g(g,d,h,e){var c={data:e||(e===0||e===false)?e:d?d.data:{},_wrap:d?d._wrap:null,tmpl:null,parent:d||null,nodes:[],calls:u,nest:w,wrap:x,html:v,update:t};g&&a.extend(c,g,{nodes:[],parent:d});if(h){c.tmpl=h;c._ctnt=c._ctnt||c.tmpl(a,c);c.key=++i;(l.length?f:b)[i]=c}return c}a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(f,d){a.fn[f]=function(n){var g=[],i=a(n),k,h,m,l,j=this.length===1&&this[0].parentNode;e=b||{};if(j&&j.nodeType===11&&j.childNodes.length===1&&i.length===1){i[d](this[0]);g=this}else{for(h=0,m=i.length;h<m;h++){c=h;k=(h>0?this.clone(true):this).get();a(i[h])[d](k);g=g.concat(k)}c=0;g=this.pushStack(g,f,i.selector)}l=e;e=null;a.tmpl.complete(l);return g}});a.fn.extend({tmpl:function(d,c,b){return a.tmpl(this[0],d,c,b)},tmplItem:function(){return a.tmplItem(this[0])},template:function(b){return a.template(b,this[0])},domManip:function(d,m,k){if(d[0]&&a.isArray(d[0])){var g=a.makeArray(arguments),h=d[0],j=h.length,i=0,f;while(i<j&&!(f=a.data(h[i++],"tmplItem")));if(f&&c)g[2]=function(b){a.tmpl.afterManip(this,b,k)};r.apply(this,g)}else r.apply(this,arguments);c=0;!e&&a.tmpl.complete(b);return this}});a.extend({tmpl:function(d,h,e,c){var i,k=!c;if(k){c=p;d=a.template[d]||a.template(null,d);f={}}else if(!d){d=c.tmpl;b[c.key]=c;c.nodes=[];c.wrapped&&n(c,c.wrapped);return a(j(c,null,c.tmpl(a,c)))}if(!d)return[];if(typeof h==="function")h=h.call(c||{});e&&e.wrapped&&n(e,e.wrapped);i=a.isArray(h)?a.map(h,function(a){return a?g(e,c,d,a):null}):[g(e,c,d,h)];return k?a(j(c,null,i)):i},tmplItem:function(b){var c;if(b instanceof a)b=b[0];while(b&&b.nodeType===1&&!(c=a.data(b,"tmplItem"))&&(b=b.parentNode));return c||p},template:function(c,b){if(b){if(typeof b==="string")b=o(b);else if(b instanceof a)b=b[0]||{};if(b.nodeType)b=a.data(b,"tmpl")||a.data(b,"tmpl",o(b.innerHTML));return typeof c==="string"?(a.template[c]=b):b}return c?typeof c!=="string"?a.template(null,c):a.template[c]||a.template(null,q.test(c)?c:a(c)):null},encode:function(a){return(""+a).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}});a.extend(a.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){b={}},afterManip:function(f,b,d){var e=b.nodeType===11?a.makeArray(b.childNodes):b.nodeType===1?[b]:[];d.call(f,b);m(e);c++}});function j(e,g,f){var b,c=f?a.map(f,function(a){return typeof a==="string"?e.key?a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+d+'="'+e.key+'" $2'):a:j(a,e,a._ctnt)}):e;if(g)return c;c=c.join("");c.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(f,c,e,d){b=a(e).get();m(b);if(c)b=k(c).concat(b);if(d)b=b.concat(k(d))});return b?b:k(c)}function k(c){var b=document.createElement("div");b.innerHTML=c;return a.makeArray(b.childNodes)}function o(b){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+a.trim(b).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(m,l,k,g,b,c,d){var j=a.tmpl.tag[k],i,e,f;if(!j)throw"Unknown template tag: "+k;i=j._default||[];if(c&&!/\w$/.test(b)){b+=c;c=""}if(b){b=h(b);d=d?","+h(d)+")":c?")":"";e=c?b.indexOf(".")>-1?b+h(c):"("+b+").call($item"+d:b;f=c?e:"(typeof("+b+")==='function'?("+b+").call($item):("+b+"))"}else f=e=i.$1||"null";g=h(g);return"');"+j[l?"close":"open"].split("$notnull_1").join(b?"typeof("+b+")!=='undefined' && ("+b+")!=null":"true").split("$1a").join(f).split("$1").join(e).split("$2").join(g||i.$2||"")+"__.push('"})+"');}return __;")}function n(c,b){c._wrap=j(c,true,a.isArray(b)?b:[q.test(b)?b:a(b).html()]).join("")}function h(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function s(b){var a=document.createElement("div");a.appendChild(b.cloneNode(true));return a.innerHTML}function m(o){var n="_"+c,k,j,l={},e,p,h;for(e=0,p=o.length;e<p;e++){if((k=o[e]).nodeType!==1)continue;j=k.getElementsByTagName("*");for(h=j.length-1;h>=0;h--)m(j[h]);m(k)}function m(j){var p,h=j,k,e,m;if(m=j.getAttribute(d)){while(h.parentNode&&(h=h.parentNode).nodeType===1&&!(p=h.getAttribute(d)));if(p!==m){h=h.parentNode?h.nodeType===11?0:h.getAttribute(d)||0:0;if(!(e=b[m])){e=f[m];e=g(e,b[h]||f[h]);e.key=++i;b[i]=e}c&&o(m)}j.removeAttribute(d)}else if(c&&(e=a.data(j,"tmplItem"))){o(e.key);b[e.key]=e;h=a.data(j.parentNode,"tmplItem");h=h?h.key:0}if(e){k=e;while(k&&k.key!=h){k.nodes.push(j);k=k.parent}delete e._ctnt;delete e._wrap;a.data(j,"tmplItem",e)}function o(a){a=a+n;e=l[a]=l[a]||g(e,b[e.parent.key+n]||e.parent)}}}function u(a,d,c,b){if(!a)return l.pop();l.push({_:a,tmpl:d,item:this,data:c,options:b})}function w(d,c,b){return a.tmpl(a.template(d),c,b,this)}function x(b,d){var c=b.options||{};c.wrapped=d;return a.tmpl(a.template(b.tmpl),b.data,c,b.item)}function v(d,c){var b=this._wrap;return a.map(a(a.isArray(b)?b.join(""):b).filter(d||"*"),function(a){return c?a.innerText||a.textContent:a.outerHTML||s(a)})}function t(){var b=this.nodes;a.tmpl(null,null,null,this).insertBefore(b[0]);a(b).remove()}})(jQuery);(function($){var $window=$(window);$.fn.asynchImageLoader=$.fn.jail=function(options){options=$.extend({timeout:10,effect:false,speed:400,selector:null,offset:0,event:"load+scroll",callback:jQuery.noop,callbackAfterEachImage:jQuery.noop,placeholder:false},options);var images=this;$.jail.initialStack=this;this.data("triggerEl",(options.selector)?$(options.selector):$window);if(options.placeholder!==false){images.each(function(){$(this).attr("src",options.placeholder);});}if(/^load/.test(options.event)){$.asynchImageLoader.later.call(this,options);}else{$.asynchImageLoader.onEvent.call(this,options,images);}return this;};$.asynchImageLoader=$.jail={_purgeStack:function(stack){var i=0;while(true){if(i===stack.length){break;}else{if(stack[i].getAttribute("data-href")){i++;}else{stack.splice(i,1);}}}},_loadOnEvent:function(e){var $img=$(this),options=e.data.options,images=e.data.images;$.asynchImageLoader._loadImage(options,$img);$img.unbind(options.event,$.asynchImageLoader._loadOnEvent);$.asynchImageLoader._purgeStack(images);if(!!options.callback){$.asynchImageLoader._purgeStack($.jail.initialStack);$.asynchImageLoader._launchCallback($.jail.initialStack,options);}},_bufferedEventListener:function(e){var images=e.data.images,options=e.data.options,triggerEl=images.data("triggerEl");clearTimeout(images.data("poller"));images.data("poller",setTimeout(function(){images.each(function _imageLoader(){$.asynchImageLoader._loadImageIfVisible(options,this,triggerEl);});$.asynchImageLoader._purgeStack(images);if(!!options.callback){$.asynchImageLoader._purgeStack($.jail.initialStack);$.asynchImageLoader._launchCallback($.jail.initialStack,options);}},options.timeout));},onEvent:function(options,images){images=images||this;if(options.event==="scroll"||options.selector){var triggerEl=images.data("triggerEl");if(images.length>0){triggerEl.bind(options.event,{images:images,options:options},$.asynchImageLoader._bufferedEventListener);if(options.event==="scroll"||!options.selector){$window.resize({images:images,options:options},$.asynchImageLoader._bufferedEventListener);}return;}else{if(!!triggerEl){triggerEl.unbind(options.event,$.asynchImageLoader._bufferedEventListener);}}}else{images.bind(options.event,{options:options,images:images},$.asynchImageLoader._loadOnEvent);}},later:function(options){var images=this;if(options.event==="load"){images.each(function(){$.asynchImageLoader._loadImageIfVisible(options,this,images.data("triggerEl"));});}$.asynchImageLoader._purgeStack(images);$.asynchImageLoader._launchCallback(images,options);setTimeout(function(){if(options.event==="load"){images.each(function(){$.asynchImageLoader._loadImage(options,$(this));});}else{images.each(function(){$.asynchImageLoader._loadImageIfVisible(options,this,images.data("triggerEl"));});}$.asynchImageLoader._purgeStack(images);$.asynchImageLoader._launchCallback(images,options);if(options.event==="load+scroll"){options.event="scroll";$.asynchImageLoader.onEvent(options,images);}},options.timeout);},_launchCallback:function(images,options){if(images.length===0&&!$.jail.isCallback){options.callback.call(this,options);$.jail.isCallback=true;}},_loadImageIfVisible:function(options,image,triggerEl){var $img=$(image),container=(options.event==="scroll"?triggerEl:$window);if($.asynchImageLoader._isInTheScreen(container,$img,options.offset)){$.asynchImageLoader._loadImage(options,$img);}},_isInTheScreen:function($ct,$img,optionOffset){var is_ct_window=$ct[0]===window,ct_offset=(is_ct_window?{top:0,left:0}:$ct.offset()),ct_top=ct_offset.top+(is_ct_window?$ct.scrollTop():0),ct_left=ct_offset.left+(is_ct_window?$ct.scrollLeft():0),ct_right=ct_left+$ct.width(),ct_bottom=ct_top+$ct.height(),img_offset=$img.offset(),img_width=$img.width(),img_height=$img.height();return(ct_top-optionOffset)<=(img_offset.top+img_height)&&(ct_bottom+optionOffset)>=img_offset.top&&(ct_left-optionOffset)<=(img_offset.left+img_width)&&(ct_right+optionOffset)>=img_offset.left;},_loadImage:function(options,$img){$img.hide();$img.attr("src",$img.attr("data-href"));$img.removeAttr("data-href");if(options.effect){if(options.speed){$img[options.effect](options.speed);}else{$img[options.effect]();}}else{$img.show();}options.callbackAfterEachImage.call(this,options);}};}(jQuery));(function(a){a.fn.validationEngineLanguage=function(){};a.validationEngineLanguage={newLang:function(){a.validationEngineLanguage.allRules={required:{regex:"none",alertText:"* Ce champs est requis",alertTextCheckboxMultiple:"* Choisir une option",alertTextCheckboxe:"* Cette option est requise"},minSize:{regex:"none",alertText:"* Minimum ",alertText2:" caracteres requis"},groupRequired:{regex:"none",alertText:"* Vous devez remplir un des champs suivant"},maxSize:{regex:"none",alertText:"* Maximum ",alertText2:" caracteres requis"},min:{regex:"none",alertText:"* Valeur minimum requise "},max:{regex:"none",alertText:"* Valeur maximum requise "},past:{regex:"none",alertText:"* Date antérieure au "},future:{regex:"none",alertText:"* Date postérieure au "},maxCheckbox:{regex:"none",alertText:"* Nombre max de choix excédé"},minCheckbox:{regex:"none",alertText:"* Veuillez choisir ",alertText2:" options"},equals:{regex:"none",alertText:"* Votre champs n'est pas identique"},phone:{regex:/^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,alertText:"* Numéro de téléphone invalide"},email:{regex:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,alertText:"* Adresse email invalide"},integer:{regex:/^[\-\+]?\d+$/,alertText:"* Nombre entier invalide"},number:{regex:/^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/,alertText:"* Nombre flottant invalide"},date:{regex:/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,alertText:"* Date invalide, format YYYY-MM-DD requis"},ipv4:{regex:/^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,alertText:"* Adresse IP invalide"},url:{regex:/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,alertText:"* URL invalide"},onlyNumberSp:{regex:/^[0-9\ ]+$/,alertText:"* Seules les chiffres sont acceptées"},onlyLetterSp:{regex:/^[a-zA-Z\ \']+$/,alertText:"* Seules les lettres sont acceptées"},onlyLetterNumber:{regex:/^[0-9a-zA-Z]+$/,alertText:"* Aucun caractère spécial n'est accepté"},ajaxUserCall:{url:"ajaxValidateFieldUser",extraData:"name=eric",alertTextLoad:"* Chargement, veuillez attendre",alertText:"* Ce nom est déjà pris"},ajaxNameCall:{url:"ajaxValidateFieldName",alertText:"* Ce nom est déjà pris",alertTextOk:"*Ce nom est disponible",alertTextLoad:"* Chargement, veuillez attendre"},validate2fields:{alertText:"Veuillez taper le mot HELLO"}}}};a.validationEngineLanguage.newLang()})(jQuery);(function(b){var a={init:function(d){var c=this;if(!c.data("jqv")||c.data("jqv")==null){a._saveOptions(c,d);b(".formError").live("click",function(){b(this).fadeOut(150,function(){b(this).remove()})})}},attach:function(d){var b=this,c;if(d)c=a._saveOptions(b,d);else c=b.data("jqv");var e=b.find("[data-validation-engine*=validate]")?"data-validation-engine":"class";if(!c.binded){if(c.bindMethod=="bind"){b.find("[class*=validate]:not([type=checkbox])").not("[type=radio]").not(".datepicker").bind(c.validationEventTrigger,a._onFieldEvent);b.find("[class*=validate][type=checkbox],[class*=validate][type=radio]").bind("click",a._onFieldEvent);b.find("[class*=validate][class*=datepicker]").bind(c.validationEventTrigger,{delay:300},a._onFieldEvent);b.bind("submit",a._onSubmitEvent)}else if(c.bindMethod=="live"){b.find("[class*=validate]:not([type=checkbox])").not(".datepicker").live(c.validationEventTrigger,a._onFieldEvent);b.find("[class*=validate][type=checkbox]").live("click",a._onFieldEvent);b.find("[class*=validate][class*=datepicker]").live(c.validationEventTrigger,{delay:300},a._onFieldEvent);b.live("submit",a._onSubmitEvent)}c.binded=true}},detach:function(){var b=this,c=b.data("jqv");if(c.binded){b.find("[class*=validate]").not("[type=checkbox]").unbind(c.validationEventTrigger,a._onFieldEvent);b.find("[class*=validate][type=checkbox],[class*=validate][type=radio]").unbind("click",a._onFieldEvent);b.unbind("submit",a.onAjaxFormComplete);b.find("[class*=validate]").not("[type=checkbox]").die(c.validationEventTrigger,a._onFieldEvent);b.find("[class*=validate][type=checkbox]").die("click",a._onFieldEvent);b.die("submit",a.onAjaxFormComplete);b.removeData("jqv")}},validate:function(){return a._validateFields(this)},validateField:function(d){var c=b(this).data("jqv");return a._validateField(b(d),c)},validateform:function(){return a._onSubmitEvent.call(this)},updatePromptsPosition:function(){var c=this.closest("form"),d=c.data("jqv");c.find("[class*=validate]").not(":hidden").not(":disabled").each(function(){var e=b(this),c=a._getPrompt(e),f=b(c).find(".formErrorContent").html();c&&a._updatePrompt(e,b(c),f,undefined,false,d)})},showPrompt:function(d,g,c,e){var f=this.closest("form"),b=f.data("jqv");if(!b)b=a._saveOptions(this,b);if(c)b.promptPosition=c;b.showArrow=e==true;a._showPrompt(this,d,g,false,b)},hidePrompt:function(){var c="."+a._getClassName(b(this).attr("id"))+"formError";b(c).fadeTo("fast",.3,function(){b(this).remove()})},hide:function(){var a;if(b(this).is("form"))a="parentForm"+b(this).attr("id");else a=b(this).attr("id")+"formError";b("."+a).fadeTo("fast",.3,function(){b(this).remove()})},hideAll:function(){b(".formError").fadeTo("fast",.3,function(){b(this).remove()})},_onFieldEvent:function(c){var d=b(this),f=d.closest("form"),e=f.data("jqv");window.setTimeout(function(){a._validateField(d,e)},c.data?c.data.delay:0)},_onSubmitEvent:function(){var d=b(this),c=d.data("jqv"),e=a._validateFields(d,true);if(e&&c.ajaxFormValidation){a._validateFormWithAjax(d,c);return false}if(c.onValidationComplete){c.onValidationComplete(d,e);return false}return e},_checkAjaxStatus:function(c){var a=true;b.each(c.ajaxValidCache,function(c,b){if(!b){a=false;return false}});return a},_validateFields:function(e,n){var d=e.data("jqv"),h=false;e.trigger("jqv.form.validating");e.find("[class*=validate]").not(":hidden").not(":disabled").each(function(){var c=b(this);h|=a._validateField(c,d,n)});e.trigger("jqv.form.result",[h]);if(h){if(d.scroll){for(var c=Number.MAX_VALUE,i=0,j=b(".formError:not('.greenPopup')"),f=0;f<j.length;f++){var k=b(j[f]).offset().top;if(k<c){c=k;i=b(j[f]).offset().left}}if(!d.isOverflown)b("html:not(:animated),body:not(:animated)").animate({scrollTop:c,scrollLeft:i},1100);else{var g=b(d.overflownDIV),l=g.scrollTop(),m=-parseInt(g.offset().top);c+=l+m-5;var o=b(d.overflownDIV+":not(:animated)");o.animate({scrollTop:c},1100);b("html:not(:animated),body:not(:animated)").animate({scrollTop:g.offset().top,scrollLeft:i},1100)}}return false}return true},_validateFormWithAjax:function(d,c){var e=d.serialize(),f=c.ajaxFormValidationURL?c.ajaxFormValidationURL:d.attr("action");b.ajax({type:"GET",url:f,cache:false,dataType:"json",data:e,form:d,methods:a,options:c,beforeSend:function(){return c.onBeforeAjaxFormValidation(d,c)},error:function(c,b){a._ajaxError(c,b)},success:function(g){if(g!==true){for(var k=false,j=0;j<g.length;j++){var i=g[j],l=i[0],f=b(b("#"+l)[0]);if(f.length==1){var e=i[2];if(i[1]==true)if(e==""||!e)a._closePrompt(f);else{if(c.allrules[e]){var h=c.allrules[e].alertTextOk;if(h)e=h}a._showPrompt(f,e,"pass",false,c,true)}else{k|=true;if(c.allrules[e]){var h=c.allrules[e].alertText;if(h)e=h}a._showPrompt(f,e,"",false,c,true)}}}c.onAjaxFormComplete(!k,d,g,c)}else c.onAjaxFormComplete(true,d,"",c)}})},_validateField:function(c,d,l){!c.attr("id")&&b.error("jQueryValidate: an ID attribute is required for this field: "+c.attr("name")+" class:"+c.attr("class"));var p=c.attr("class"),o=/validate\[(.*)\]/.exec(p);if(!o)return false;var r=o[1],f=r.split(/\[|,|\]/),m=false,h=c.attr("name"),i="",k=false;d.isError=false;d.showArrow=true;for(var e=0;e<f.length;e++){var g=undefined;switch(f[e]){case"required":k=true;g=a._required(c,f,e,d);break;case"custom":g=a._customRegex(c,f,e,d);break;case"groupRequired":var q="[class*="+f[e+1]+"]",n=c.closest("form").find(q).eq(0);if(n[0]!=c[0]){a._validateField(n,d,l);d.showArrow=true;continue}g=a._groupRequired(c,f,e,d);if(g)k=true;d.showArrow=false;break;case"ajax":if(!l){a._ajax(c,f,e,d);m=true}break;case"minSize":g=a._minSize(c,f,e,d);break;case"maxSize":g=a._maxSize(c,f,e,d);break;case"min":g=a._min(c,f,e,d);break;case"max":g=a._max(c,f,e,d);break;case"past":g=a._past(c,f,e,d);break;case"future":g=a._future(c,f,e,d);break;case"dateRange":g=a._dateRange(c,f,e,d);c=b(b("input[name='"+h+"']"));break;case"dateTimeRange":g=a._dateTimeRange(c,f,e,d);c=b(b("input[name='"+h+"']"));break;case"maxCheckbox":g=a._maxCheckbox(c,f,e,d);c=b(b("input[name='"+h+"']"));break;case"minCheckbox":g=a._minCheckbox(c,f,e,d);c=b(b("input[name='"+h+"']"));break;case"equals":g=a._equals(c,f,e,d);break;case"funcCall":g=a._funcCall(c,f,e,d)}if(g!==undefined){i+=g+"<br/>";d.isError=true}}if(!k)if(c.val()=="")d.isError=false;var j=c.attr("type");if((j=="radio"||j=="checkbox")&&b("input[name='"+h+"']").size()>1){c=b(b("input[name='"+h+"'][type!=hidden]:first"));d.showArrow=false}if(j=="text"&&b("input[name='"+h+"']").size()>1){c=b(b("input[name='"+h+"'][type!=hidden]:first"));d.showArrow=false}if(d.isError)a._showPrompt(c,i,"",false,d);else!m&&a._closePrompt(c);c.trigger("jqv.field.result",[c,d.isError,i]);return d.isError},_required:function(c,d,e,a){switch(c.attr("type")){case"text":case"password":case"textarea":case"file":default:if(!c.val())return a.allrules[d[e]].alertText;break;case"radio":case"checkbox":var f=c.attr("name");if(b("input[name='"+f+"']:checked").size()==0)return b("input[name='"+f+"']").size()==1?a.allrules[d[e]].alertTextCheckboxe:a.allrules[d[e]].alertTextCheckboxMultiple;break;case"dateTimeRange":case"dateRange":var f=c.attr("name"),g=b("input[name='"+f+"']");if(!g[0].val()||!g[1].val())return a.allrules[d[e]].alertTextDateRange;break;case"select-one":if(!c.val())return a.allrules[d[e]].alertText;break;case"select-multiple":if(!c.find("option:selected").val())return a.allrules[d[e]].alertText}},_groupRequired:function(h,c,d,f){var g="[class*="+c[d+1]+"]",e=false;h.closest("form").find(g).each(function(){if(!a._required(b(this),c,d,f)){e=true;return false}});if(!e)return f.allrules[c[d]].alertText},_customRegex:function(f,g,h,b){var a=g[h+1],c=b.allrules[a];if(!c){alert("jqv:custom rule not found "+a);return}var d=c.regex;if(!d){alert("jqv:custom regex not found "+a);return}var e=new RegExp(d);if(!e.test(f.val()))return b.allrules[a].alertText},_funcCall:function(f,a,c,e){var d=a[c+1],b=window[d];if(typeof b=="function")return b(f,a,c,e)},_equals:function(d,e,f,c){var a=e[f+1];if(d.val()!=b("#"+a).val())return c.allrules.equals.alertText},_maxSize:function(d,e,g,c){var b=e[g+1],f=d.val().length;if(f>b){var a=c.allrules.maxSize;return a.alertText+b+a.alertText2}},_minSize:function(d,e,g,c){var b=e[g+1],f=d.val().length;if(f<b){var a=c.allrules.minSize;return a.alertText+b+a.alertText2}},_min:function(d,e,g,c){var b=parseFloat(e[g+1]),f=parseFloat(d.val());if(f<b){var a=c.allrules.min;return a.alertText2?a.alertText+b+a.alertText2:a.alertText+b}},_max:function(d,e,g,c){var b=parseFloat(e[g+1]),f=parseFloat(d.val());if(f>b){var a=c.allrules.max;return a.alertText2?a.alertText+b+a.alertText2:a.alertText+b}},_past:function(f,g,i,e){var d=g[i+1],c=d.toLowerCase()=="now"?new Date:a._parseDate(d),h=a._parseDate(f.val());if(h<c){var b=e.allrules.past;return b.alertText2?b.alertText+a._dateToString(c)+b.alertText2:b.alertText+a._dateToString(c)}},_future:function(f,g,i,e){var d=g[i+1],c=d.toLowerCase()=="now"?new Date:a._parseDate(d),h=a._parseDate(f.val());if(h>c){var b=e.allrules.future;return b.alertText2?b.alertText+a._dateToString(c)+b.alertText2:b.alertText+a._dateToString(c)}},_isDate:function(b){var a=new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/);return a.test(b)?true:false},_isDateTime:function(b){var a=new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/);return a.test(b)?true:false},_dateCompare:function(a,b){return new Date(a.toString())<new Date(b.toString())},_dateRange:function(f){var c=f.attr("name");if(b("input[name='"+c+"']").length==2){var d=b("input[name='"+c+"']")[0].value,e=b("input[name='"+c+"']")[1].value;if(a._isDate(d)&&a._isDate(e)){if(!a._dateCompare(d,e))return"* Invalid Date Range"}else return"* Invalid Date Range"}else return"* Invalid Date Range"},_dateTimeRange:function(f){var c=f.attr("name");if(b("input[name='"+c+"']").length==2){var d=b("input[name='"+c+"']")[0].value,e=b("input[name='"+c+"']")[1].value;if(a._isDateTime(d)&&a._isDateTime(e)){if(!a._dateCompare(d,e))return"* Invalid Date Time Range"}else return"* Invalid Date Time Range"}else return"* Invalid Date Time Range"},_maxCheckbox:function(f,g,h,a){var c=g[h+1],d=f.attr("name"),e=b("input[name='"+d+"']:checked").size();if(e>c){a.showArrow=false;return a.allrules.maxCheckbox.alertText2?a.allrules.maxCheckbox.alertText+" "+c+" "+a.allrules.maxCheckbox.alertText2:a.allrules.maxCheckbox.alertText}},_minCheckbox:function(f,g,h,a){var c=g[h+1],d=f.attr("name"),e=b("input[name='"+d+"']:checked").size();if(e<c){a.showArrow=false;return a.allrules.minCheckbox.alertText+" "+c+" "+a.allrules.minCheckbox.alertText2}},_ajax:function(f,o,g,c){var l=o[g+1],d=c.allrules[l],h=d.extraData,e=d.extraDataDynamic;if(!h)h="";if(e){for(var j=[],k=String(e).split(","),g=0;g<k.length;g++){var i=k[g];if(b(i).length){var m=f.closest("form").find(i).val(),n=i.replace("#","")+"="+escape(m);j.push(n)}}e=j.join("&")}else e="";!c.isError&&b.ajax({type:"GET",url:d.url,cache:false,dataType:"json",data:"fieldId="+f.attr("id")+"&fieldValue="+f.val()+"&extraData="+h+"&"+e,field:f,rule:d,methods:a,options:c,beforeSend:function(){var b=d.alertTextLoad;b&&a._showPrompt(f,b,"load",true,c)},error:function(c,b){a._ajaxError(c,b)},success:function(i){var f=i[0],g=b(b("#"+f)[0]);if(g.length==1){var j=i[1],e=i[2];if(!j){c.ajaxValidCache[f]=false;c.isError=true;if(e){if(c.allrules[e]){var h=c.allrules[e].alertText;if(h)e=h}}else e=d.alertText;a._showPrompt(g,e,"",true,c)}else{if(c.ajaxValidCache[f]!==undefined)c.ajaxValidCache[f]=true;if(e){if(c.allrules[e]){var h=c.allrules[e].alertTextOk;if(h)e=h}}else e=d.alertTextOk;if(e)a._showPrompt(g,e,"pass",true,c);else a._closePrompt(g)}}}})},_ajaxError:function(b,a){if(b.status==0&&a==null)alert("The page is not served from a server! ajax call failed");else typeof console!="undefined"&&console.log("Ajax error: "+b.status+" "+a)},_dateToString:function(a){return a.getFullYear()+"-"+(a.getMonth()+1)+"-"+a.getDate()},_parseDate:function(b){var a=b.split("-");if(a==b)a=b.split("/");return new Date(a[0],a[1]-1,a[2])},_showPrompt:function(c,d,g,f,e,h){var b=a._getPrompt(c);if(h)b=false;if(b)a._updatePrompt(c,b,d,g,f,e);else a._buildPrompt(c,d,g,f,e)},_buildPrompt:function(d,h,j,i,e){var c=b("<div>");c.addClass(a._getClassName(d.attr("id"))+"formError");d.is(":input")&&c.addClass("parentForm"+a._getClassName(d.parents("form").attr("id")));c.addClass("formError");switch(j){case"pass":c.addClass("greenPopup");break;case"load":c.addClass("blackPopup")}i&&c.addClass("ajaxed");var k=b("<div>").addClass("formErrorContent").html(h).appendTo(c);if(e.showArrow){var f=b("<div>").addClass("formErrorArrow");switch(e.promptPosition){case"bottomLeft":case"bottomRight":c.find(".formErrorContent").before(f);f.addClass("formErrorArrowBottom").html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>');break;case"topLeft":case"topRight":f.html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>');c.append(f)}}if(e.isOverflown)d.before(c);else b("body").append(c);var g=a._calculatePosition(d,c,e);c.css({top:g.callerTopPosition,left:g.callerleftPosition,marginTop:g.marginTopSize,opacity:0});return c.animate({opacity:.87})},_updatePrompt:function(h,b,e,c,g,f){if(b){if(c=="pass")b.addClass("greenPopup");else b.removeClass("greenPopup");if(c=="load")b.addClass("blackPopup");else b.removeClass("blackPopup");if(g)b.addClass("ajaxed");else b.removeClass("ajaxed");b.find(".formErrorContent").html(e);var d=a._calculatePosition(h,b,f);b.animate({top:d.callerTopPosition,marginTop:d.marginTopSize})}},_closePrompt:function(c){var b=a._getPrompt(c);b&&b.fadeTo("fast",0,function(){b.remove()})},closePrompt:function(b){return a._closePrompt(b)},_getPrompt:function(e){var d=e.attr("id").replace(":","_")+"formError",c=b("."+a._escapeExpression(d))[0];if(c)return b(c)},_escapeExpression:function(a){return a.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g,"\\$1")},_calculatePosition:function(d,j,h){var a,b,e,c=d.width(),f=j.height(),g=h.isOverflown;if(g){a=b=0;e=-f}else{var i=d.offset();a=i.top;b=i.left;e=0}switch(h.promptPosition){default:case"topRight":if(g)b+=c-30;else{b+=c-30;a+=-f-2}break;case"topLeft":a+=-f-10;break;case"centerRight":b+=c+13;break;case"bottomLeft":a=a+d.height()+15;break;case"bottomRight":b+=c-30;a+=d.height()+5}return{callerTopPosition:a+"px",callerleftPosition:b+"px",marginTopSize:e+"px"}},_saveOptions:function(e,d){if(b.validationEngineLanguage)var c=b.validationEngineLanguage.allRules;else b.error("jQuery.validationEngine rules are not loaded, plz add localization files to the page");b.validationEngine.defaults.allrules=c;var a=b.extend({},b.validationEngine.defaults,d);e.data("jqv",a);return a},_getClassName:function(a){return a.replace(":","_").replace(".","_")}};b.fn.validationEngine=function(c){var d=b(this);if(!d[0])return false;if(typeof c=="string"&&c.charAt(0)!="_"&&a[c]){c!="showPrompt"&&c!="hidePrompt"&&c!="hide"&&c!="hideAll"&&a.init.apply(d);return a[c].apply(d,Array.prototype.slice.call(arguments,1))}else if(typeof c=="object"||!c){a.init.apply(d,arguments);return a.attach.apply(d)}else b.error("Method "+c+" does not exist in jQuery.validationEngine")};b.validationEngine={defaults:{validationEventTrigger:"blur",scroll:true,promptPosition:"topRight",bindMethod:"bind",inlineAjax:false,ajaxFormValidation:false,ajaxFormValidationURL:false,onAjaxFormComplete:b.noop,onBeforeAjaxFormValidation:b.noop,onValidationComplete:false,isOverflown:false,overflownDIV:"",binded:false,showArrow:true,isError:false,ajaxValidCache:{}}}})(jQuery);
