if(!Array.prototype.push){Array.prototype.push=function(){var l=this.length;for(var i=0;i<arguments.length;++i){this[l+i]=arguments[i];}return this.length;};}if(!Array.prototype.pop){Array.prototype.pop=function(){if(this.length===0){return null;}var t=this[this.length-1];--this.length;return t;};}
if(!Function.prototype.apply){ Function.prototype.apply=function(o,p){if(!o){o=window;}if(!p){p=[];}var a=[];for(var i=0;i<p.length;++i){a[i]='p['+i+']';}o.__apply__=this;var r=eval('o.__apply__('+a.join(',')+')');o.__apply__=null;return r;};}if(!Function.prototype.call){ Function.prototype.call=function(s){var a=[];for(var i=1;i<arguments.length;++i){a[i-1]=arguments[i];}return this.apply(s,a);};}Function.prototype.bind=function(o){var m=this;var a=arguments;return function(){var p=[];for(var i=0;i<arguments.length;++i){p.push(arguments[i]);}for(var j=1;j<a.length;++j){p.push(a[j]);}m.apply(o,p);};};Function.prototype.bindAsEventListener=function(o){var m=this;return function(e){m.call(o,e||window.event);};};Function.EMPTY=function(){};
if(typeof EventListener=="undefined"){ var EventListener={};}EventListener.patch=function(o){if(!o||o.addEventListener){ return;}var e=EventListener._;if(o.prototype){if(o.prototype.addEventListener){ return;}o.prototype.__refObj=o;o.prototype.addEventListener=e.A;o.prototype.removeEventListener=e.R;o.prototype.dispatchEvent=e.D;}else{if(o.addEventListener){ return;}o.__refObj=o;o.addEventListener=e.A;o.removeEventListener=e.R;o.dispatchEvent=e.D;}};EventListener._={ D:function(e,ev){if(!this._events){ return;}var es=this._events[e];if(!es){return true;}for(var i=0,l=es.length;i<l;++i){  var f=es[i];if(typeof(f)=="function"&&f.call(this,ev)===false){return false;}}return true;}, A:function(e,f,p){if(!f){return;}if(!this._events){this._events=[];}if(!this._events[e]){this._events[e]=[];var fo=this.__refObj["on"+e];if(fo){this._events[e].push(fo);}this.__refObj["on"+e]=new Function("ev","if(!ev){ev = event;}return this.dispatchEvent(\x27"+e+"\x27,ev);");}this._events[e].push(f);}, R:function(e,f,p){if(!f||!this._events[e]){return;}var fs=this._events[e];for(var i=0;i<fs.length;++i){if(fs[i]===f){fs[i]=null;}}}};EventListener.patch(window);EventListener.patch(document);
var ArrayUtil={ addAll:function( a, s){if(!a){return;}for(var i=0,l=s.length;i<l;++i){a.push(s[i]);}}, forEach:function( a, f, c){if(!a){return;}c=c||window;for(var i=0,l=a.length;i<l;++i){f.call(c,a[i],i,a);}}, indexOf:function( a, v, i){if(!a){return;}for(i=i||0;i<a.length;++i){if(a[i]===v){return i;}}return-1;}};
var XPathUtil={  RE1:/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/,RE2:/\s+/,getElementsBySelector:function( s, d){if(!d){d=document;} var v0=s.split(',');var founds=[];for(var i0=0;i0<v0.length;++i0){var tokens=v0[i0].split(' ');var currentContext=[d];for(var i=0;i<tokens.length;++i){var bits,tagName,found,elements;token=tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');if(token.indexOf('#')>-1){ bits=token.split('#');tagName=bits[0];var id=bits[1];var element=document.getElementById(id);if(!element||tagName&&element.nodeName.toLowerCase()!=tagName){ currentContext=[];break;} currentContext=[element];continue;}if(token.indexOf('.')>-1){ bits=token.split('.');tagName=bits[0];var className=bits[1];if(!tagName){tagName='*';} found=[];for(var h=0;h<currentContext.length;h++){if(tagName=='*'){elements=XPathUtil.getAllChildren(currentContext[h]);}else{elements=currentContext[h].getElementsByTagName(tagName);}ArrayUtil.addAll(found,elements);}currentContext=[];for(var k=0;k<found.length;k++){if(found[k].className&&found[k].className.match(new RegExp('\x5Cb'+className+'\x5Cb'))){currentContext.push(found[k]);}}continue;} if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)){tagName=RegExp.$1;var attrName=RegExp.$2;var attrOperator=RegExp.$3;var attrValue=RegExp.$4;if(!tagName){tagName='*';} found=[];for(var h0=0;h0<currentContext.length;++h0){if(tagName=='*'){elements=XPathUtil.getAllChildren(currentContext[h0]);}else{elements=currentContext[h0].getElementsByTagName(tagName);}ArrayUtil.addAll(found,elements);}currentContext=[];var checkFunction; switch(attrOperator){case '=': checkFunction=function(e){return(e.getAttribute(attrName)==attrValue);};break;case '~': checkFunction=function(e){return(e.getAttribute(attrName).match(new RegExp('\x5Cb'+attrValue+'\x5Cb')));};break;case '|': checkFunction=function(e){return(e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?')));};break;case '^': checkFunction=function(e){return(e.getAttribute(attrName).indexOf(attrValue)===0);};break;case '$': checkFunction=function(e){return(e.getAttribute(attrName).lastIndexOf(attrValue)==e.getAttribute(attrName).length-attrValue.length);};break;case '*': checkFunction=function(e){return(e.getAttribute(attrName).indexOf(attrValue)>-1);};break;default: checkFunction=function(e){return e.getAttribute(attrName);};}currentContext=[];for(var k1=0;k1<found.length;++k1){if(checkFunction(found[k1])){currentContext.push(found[k1]);}} continue;}if(!currentContext[0]){currentContext=[];break;} tagName=token;found=[];for(var h2=0;h2<currentContext.length;++h2){elements=currentContext[h2].getElementsByTagName(tagName);ArrayUtil.addAll(found,elements);}currentContext=found;}ArrayUtil.addAll(founds,currentContext);}return founds;},getParentByNodeName:function(o,t){t=t.toLowerCase();var r=o;while(r&&r.nodeName&&r.nodeName.toLowerCase()!=t){r=r.parentNode;}return r;},getNextSiblingByNodeName:function(o,t){t=t.toLowerCase();var r=o;while(r&&r.nodeName&&r.nodeName.toLowerCase()!=t){r=r.nextSibling;}return r;},getFirstChildByNodeName:function(o,t){t=t.toLowerCase();var c=o.childNodes;for(var i=0,l=c.length;i<l;++i){if(c[i]&&c[i].nodeName&&c[i].nodeName.toLowerCase()==t){return c[i];}}return null;},getChildrenByNodeName:function(o,t){if(!o){return[];} var elementParts=t.split("@");t=elementParts[0].toLowerCase();var attributs=[];for(var k=1;k<elementParts.length;++k){var a=elementParts[k].split("=");attributs.push([a[0].toLowerCase(),a[1]]);}var result=[];var childNodes=o.childNodes;for(var i=0;i<childNodes.length;++i){if(childNodes[i]&&childNodes[i].nodeName&&childNodes[i].nodeName.toLowerCase()==t){ var ok=true;for(var j=0;j<attributs.length;++j){var attributeValue=null;if(childNodes[i].getAttributeNode){if(childNodes[i].getAttributeNode(attributs[j][0])){attributeValue=childNodes[i].getAttributeNode(attributs[j][0]).value;}}else if(childNodes[i].getAttribute){attributeValue=childNodes[i].getAttribute(attributs[j][0]);}ok=false;if(attributeValue!==null&&typeof(attributeValue)!="undefined"&&attributeValue==attributs[j][1]){ok=true;}else{ok=false;break;}}if(ok){result[result.length]=childNodes[i];}}}return result;},getChildren:function(o){var childNodes=o.childNodes;var result=[];for(var i=0;i<childNodes.length;++i){if(childNodes[i].nodeType==1){result.push(childNodes[i]);}}return result;},getElementsByXPath:function(xPath,root){var result=[];if(typeof(root)=="undefined"){root=document.getElementsByNodeName("body")[0];}var indexSlash=xPath.indexOf("/");if(indexSlash===0){xPath=xPath.substring(1,xPath.length);indexSlash=xPath.indexOf("/");}var element="";var otherElements="";if(indexSlash!=-1){element=xPath.substring(0,indexSlash);otherElements=xPath.substring(indexSlash+1,xPath.length);}else{element=xPath.substring(0,xPath.length);} elements=XPathUtil.getChildrenByNodeName(root,element);if(otherElements!==""){for(var i=0;i<elements.length;++i){result.addAll(XPathUtil.getElementsByXPath(otherElements,elements[i]));}}else{for(var j=0;j<elements.length;++j){result.push(elements[j]);}}return result;},getIndex:function(o){var c=XPathUtil.getChildren(o.parentNode);for(var i=0,l=c.length;i<l;++i){if(c[i]==o){return i;}}return-1;},getAllChildren:function(e){ return e.all?e.all:e.getElementsByTagName('*');}};
function I18N(b){this.setBundleRessource(b);}I18N.prototype={ get:function(k){var m=this.br[k];if(typeof(m)=="undefined"||m===null){ return "";}if(typeof(m)!="string"){return m;}for(var i=1,l=arguments.length;i<l;++i){m=m.replace(new RegExp("\x5C{"+(i-1)+"\x5C}","g"),arguments[i]);} m=m.replace(I18N.R[0],"");return m;},     setBundleRessource:function( b, e){if(!b){b=[];}if(e&&this.brDef){ for(var l in this.brDef){if(typeof(l)!="string"||typeof(this.brDef[l])!="object"||!b[l]){continue;}for(var r in this.brDef[l]){if(typeof(r)!="string"||typeof(this.brDef[l][r])!="string"||typeof(b[l][r])!="undefined"){continue;}b[l][r]=this.brDef[l][r];}}} this.brDef=b; this.br=b[I18N.getLang()];if(!this.br){  this.br=b[I18N.defLang];}if(!this.br){  for(var i in b){this.br=b[i];break;}}if(!this.br){  this.br=[];}}}; I18N.defLang="fr_FR"; I18N.lang=null;I18N.getLang=function(){var s=I18N,l=I18N.lang;if(!l){ l=document.getElementsByTagName("html")[0].lang;if(!l){ l=navigator.language;} if(!l){l=navigator.browserLanguage;}I18N.lang=l=l.replace(I18N.R[1],"_").split("_")[0];}return l;}; I18N.R=[(/{\d+}/g),(/\W/g)]; I18N.setup=function( o, f, e){if(!o){return;}if(!o.i18nDef){o.i18nDef={};}if(o.i18n&&!f){ return;}if(!o.i18n||e){o.i18n=new I18N(o.i18nDef);}else{o.i18n.setBundleRessource(o.i18nDef,e);}if(o.i18nSetup){o.i18nSetup(f);}};
var HtmlUtil={ getAbsolutePos:function( o){var r={x:0,y:0};while(o){r.x+=o.offsetLeft;r.y+=o.offsetTop;o=o.offsetParent;}return r;}, favoris:function( title, url){if(window.sidebar&&window.sidebar.addPanel){ window.sidebar.addPanel(title,url,'');}else if(window.external&&typeof window.external.AddFavorite!="undefined"){ window.external.AddFavorite(url,title);}}};
if(typeof HTMLElement=="undefined"){  HTMLElement=function(){}; HTMLElement.patch=function(o){if(!o){return;}if(o._HTMLElement_patch){ return o;}o._HTMLElement_patch=true;for(var i in HTMLElement.prototype){o[i]=HTMLElement.prototype[i];}return o;};}else{HTMLElement.patch=function(o){return o;};} HTMLElement.prototype.getAbsolutePos=function(){HtmlUtil.getAbsolutePos(this);}; HTMLElement.prototype.getAbsoluteLeftPos=function(){return HtmlUtil.getAbsolutePos(this).x;}; HTMLElement.prototype.getAbsoluteTopPos=function(){return HtmlUtil.getAbsolutePos(this).y;};
var CUi={ _:function(className,obj){return(function( o, opt){if(!o||o["_x"+className]){return;}var c=window[className];this.constructor=c; I18N.setup(c);  EventListener.patch(o); EventListener.patch(this);HTMLElement.patch(o);this.el=o;this.el.className+=" CUi_"+className;this.el["_"+className]=this;this.opt=opt?opt:{};if(this._){ this._();}});},create:function(n,d){var o=CUi._(n);for(var p in d){o[p]=d[p];}o=window[n]=o;o.className=n; o.i18nDef={}; if(o.init){o.init();}return o;}};
var ObjectUtil={ forEach:function( o, f, c){if(!o){return;}c=c||o;for(var p in o){f.call(c,o[p],p,o);}},extend:function(s,d){for(var p in s){d[p]=s[p];}return s;}};
var UiBuilder=CUi.create("UiBuilder",{prototype:{ _:function(){this.list={_d:[]};this.timer={};}, register:function( o){if(!o){return;}if(o.push){for(var i=0;i<o.length;++i){this.register(o[i]);}return;}else if(!o.selectors){return;}if(o.isValid&&o.isValid()===false){return;}var v=o.selectors,s=o.starter,l=this.list,d=o.delay,e=this;if(!d){d=20;}if(!s){s="_d";}else if(!l[s]){l[s]=[];}ObjectUtil.forEach(v,function(def,sel){l[s][sel]=def;},this);if(s!="_d"){this.timer[s]=setInterval(function(){e.runStarter(s);},d);}}, runStarter:function( s, f){if(this.timer[s]!==null&&(document.getElementById(s)||f)){clearInterval(this.timer[s]);this.timer[s]=null;this.build(s);}}, runStarters:function(f){ObjectUtil.forEach(this.timer,function(o,l){this.runStarter(l,f);},this);}, build:function( s){var o=this.list[s||'_d'];for(var e in o){var l=XPathUtil.getElementsBySelector(e,this.el);if(!l){continue;}for(var i=0;i<l.length;++i){if(!l[i]){continue;}if(o[e](l[i],l)===false){break;}}}},getPagePath:function(){var e=this.el;if(!e._pagePath){ var M=e.getElementsByTagName("meta");for(var i=0,m;(m=M[i]);++i){if(m.httpEquiv=="Page-Path"||m.name=="Page-Path"){e._pagePath=m.content;break;}}}return e._pagePath;},getSite:function(){var e=this.el;if(!e._site){ var M=e.getElementsByTagName("meta");for(var i=0,m;(m=M[i]);++i){if(m.httpEquiv=="Page-Site"||m.name=="Page-Site"){e._site=m.content;break;}}}return e._site;},getCountry:function(){var e=this.el;if(!e._country){ var M=e.getElementsByTagName("meta");for(var i=0,m;(m=M[i]);++i){if(m.httpEquiv=="country"||m.name=="country"){e._country=m.content;break;}}}return e._country;},getAgency:function(){var e=this.el;if(!e._agency){ var M=e.getElementsByTagName("meta");for(var i=0,m;(m=M[i]);++i){if(m.httpEquiv=="agency"||m.name=="agency"){e._agency=m.content;break;}}}return e._agency;}}});if(typeof uiBuilder=="undefined"){ uiBuilder=new UiBuilder(document);window.addEventListener("load",function(){uiBuilder.runStarters(true);uiBuilder.build();},false);}
if(!window.getComputedStyle){ function ComputedStyle(obj){this.obj=obj;this.getPropertyValue=function(cssProperty){var props=cssProperty.split("-");for(var i=1;i<props.length;++i){props[i]=props[i].substring(0,1).toUpperCase()+props[i].substring(1);}var val=this.obj.currentStyle[props.join("")];return val;};}window.getComputedStyle=function(obj,imp){return new ComputedStyle(obj);};} window.stopEvent=function(e){if(typeof(e)=="undefined"){e=window.event;}if(typeof(e)=="undefined"){return;}e.cancelBubble=true;e.returnValue=false;if(e.stopPropagation){e.stopPropagation();}if(e.preventDefault){e.preventDefault();}return false;};if(typeof(window.pageYOffset)=="undefined"){window.getPageYOffset=function(){var s=parseInt(document.documentElement.scrollTop,10);if(s===0){s=parseInt(document.body.scrollTop,10);}return s;};}else{window.getPageYOffset=function(){return parseInt(window.pageYOffset,10);};}if(typeof(window.pageXOffset)=="undefined"){window.getPageXOffset=function(){var s=parseInt(document.documentElement.scrollLeft,10);if(s===0){s=parseInt(document.body.scrollLeft,10);}return s;};}else{window.getPageXOffset=function(){return parseInt(window.pageXOffset,10);};}if(typeof(window.innerHeight)=="undefined"){window.getInnerHeight=function(){var s=parseInt(document.documentElement.clientHeight,10);if(s===0){s=parseInt(document.body.clientHeight,10);}return s;};}else{window.getInnerHeight=function(){return parseInt(window.innerHeight,10);};}if(typeof(window.innerWidth)=="undefined"){window.getInnerWidth=function(){var s=parseInt(document.documentElement.clientWidth,10);if(s===0){s=parseInt(document.body.clientWidth,10);}return s;};}else{window.getInnerWidth=function(){return parseInt(window.innerWidth,10);};}
if(typeof Event=="undefined"){ var Event={};}Event._={P:function(){this.cancelBubble=true;},D:function(){this.returnValue=false;},patch:function(o){if(!o){o=event;}if(o){if(!o.stopPropagation){o.stopPropagation=Event._.P;}if(!o.preventDefault){o.preventDefault=Event._.D;}}return o;}};
var ClassNameUtil={ add:function(o, c){if(!o){return;}if(!ClassNameUtil.contains(o,c)){o.className+=" "+c;}}, remove:function(o, c){if(!o||!o.className){return;}o.className=o.className.replace(new RegExp("(^|\x5Cs)"+c+"($|\x5Cs)")," ");}, toogle:function(o, c, r){if(!c){c="";}if(!r){r="";}if(c!==""&&ClassNameUtil.contains(o,c)){ClassNameUtil.remove(o,c);ClassNameUtil.add(o,r);}else if(r!==""&&ClassNameUtil.contains(o,r)){ClassNameUtil.remove(o,r);ClassNameUtil.add(o,c);}else{ClassNameUtil.add(o,c);}return o;}, contains:function( o, c){return new RegExp("(^|\x5Cs)"+c+"($|\x5Cs)").test(o.className);}};
function ToolTip(e){this.el=e;if(!e){return;}var s=this;s.window=window;ClassNameUtil.add(e,"ToolTip");e._ToolTip=this;s.iframe=null;EventListener.patch(e);function Sf(){s.show();}function Hf(){s.hide();}e.addEventListener("click",function(ev){Sf();ev=Event._.patch(ev);ev.stopPropagation();ev.preventDefault();},false);document.addEventListener("click",Hf,false);function S(ev){clearTimeout(s.timer);s.timer=setTimeout(Sf,ToolTip._.TIME_OVER);ev=Event._.patch(ev);ev.stopPropagation();ev.preventDefault();}function H(ev){clearTimeout(s.timer);s.timer=setTimeout(Hf,ToolTip._.TIME_OUT);Event._.patch(ev);ev.stopPropagation();ev.preventDefault();}e.addEventListener("mouseover",S,false);e.addEventListener("focus",S,false);e.addEventListener("mouseout",H,false);e.addEventListener("blur",H,false);e.title="";}ToolTip.prototype={getIframe:function(){var url=this.getHref();if(!this.iframe){var o=document.createElement("iframe");o.setAttribute("id",this.el.id+"_ToolTip");o.setAttribute("frameborder",0);o.src=url;o.className="ToolTip_iframe";o.style.position="absolute";this.window.document.body.appendChild(o);HTMLElement.patch(o);o._ToolTip=this;o.onmouseover=ToolTip._.ONFRAMEOVER;o.onmouseout=ToolTip._.ONMOUSEOUT;this.iframe=o;}if(this.iframe.src!=url||this.el.rel&&this.el.href==url&&ToolTip.current!=this){   this.iframe.src=url;}return this.iframe;}, getHref:function(){var url=this.el.href;if(this.el.rel){var s=document.getElementById(this.el.rel),v=null;if(s){if(s.getValue){v=s.getValue();}else if(s.options){v=s.options[s.selectedIndex].value;}}if(v&&v!="default"){url=url.replace(/(.+\/select_)(.+)(\.[\w\d]+$)/,"$1$2/$2_"+v+"$3");}}return url;}, show:function(){if(ToolTip.current!=this){if(ToolTip.current){ToolTip.current.hide();}}var i=this.getIframe();ToolTip.current=this;i.style.display="block";i.onload=function(){this.style.height=(this.contentDocument.height+1)+"px";};this.move();}, hide:function(){if(this.iframe){ this.iframe.style.display="none";}ToolTip.current=null;}, move:function(){var w=this.window,t=this.iframe,o=this.el,p=HtmlUtil.getAbsolutePos(o);var s=t.style,x=p.x+o.offsetWidth,y=p.y+o.offsetHeight;var sx=x+t.offsetWidth-w.getInnerWidth()-w.getPageXOffset()+20,sy=y+t.offsetHeight-w.getInnerHeight()-w.getPageYOffset()+20;if(sx>0){s.left=(x-sx)+"px";}else{s.left=x+"px";}if(sy>0){s.top=(y-sy)+"px";}else{s.top=y+"px";}}}; ToolTip.resizeContainer=function(w){var o=w.frameElement;if(!o||!o._ToolTip){return;}o.style.width=document.body.offsetWidth+"px";o.style.height=(document.body.offsetHeight+1)+"px";o._ToolTip.move();}; ToolTip._={ONMOUSEOUT:function(){clearTimeout(this._ToolTip.timer);function F(o){return function(){o.hide();};}this._ToolTip.timer=setTimeout(F(this._ToolTip),ToolTip._.TIME_OUT);}, ONFRAMEOVER:function(){clearTimeout(this._ToolTip.timer);this._ToolTip.el.onmouseout=function(){return true;};this._ToolTip.show();}, TIME_OUT:100, TIME_OVER:300};window.addEventListener("resize",function(){if(ToolTip.current){ToolTip.current.move();}},false);
uiBuilder.register({selectors:{"a.ToolTip":function(o){new ToolTip(o);}}});
var NodeUtil={cloneAttributes:function(s,t){var a=s.attributes;for(var i=0,l=a.length;i<l;++i){ var o=a[i];if(o.nodeName.toLowerCase()=="class"){ t.className=o.nodeValue;}else{t.setAttribute(o.nodeName,o.nodeValue);}}}, clone: function( s){if(!s){return null;}var c=null;   if(s.nodeType===1){ c=document.createElement(s.nodeName);NodeUtil.cloneAttributes(s,c);NodeUtil.cloneChildNodes(s,c); if(c.nodeName=="INPUT"){if(c.type=="text"||c.type=="file"||c.type=="password"){c.defaultValue=c.value;}else if(c.type=="radio"||c.type=="checkbox"){c.defaultChecked=c.checked;}}}else if(s.nodeType==3){ c=document.createTextNode(s.data);}s=s.nextSibling;return c;},cloneChildNodes:function( s, t){var c=s.childNodes;for(var i=0,l=c.length;i<l;++i){t.appendChild(NodeUtil.clone(c.item(i)));}}, insertAfter:function( n, r){if(n&&r){var p=r.parentNode;if(r.nextSibling){r.parentNode.insertBefore(n,r.nextSibling);}else{r.parentNode.appendChild(n);}}}, insertFirst:function( p, n){if(p.firstChild){p.insertBefore(n,p.firstChild);}else{p.appendChild(n);}},replace:function( target, x, id){if(!x){return;}if(id){if(!x.getElementById){var t=x;x={getElementById:function(id){var o=t.getElementsByTagName("*");for(var i=0,l=o.length;i<l;++i){if(o[i].getAttribute("id")==id){return o[i];}}return null;}};}x=x.getElementById(id);if(!x){return;}}try{x=x.cloneNode(true);x=NodeUtil.clone(x);var p=target.parentNode;p.replaceChild(x,target);}catch(e){window.status=e.message;}return x;},remove:function( o){if(o&&o.parentNode){o.parentNode.removeChild(o);}}};
var Footnote=CUi.create("Footnote",{prototype:{_:function(){var e=this.el,s=this;s.def=Footnote.getDef(e.innerHTML);if(!s.def){return;}EventListener.patch(e);e.addEventListener("mouseover",function(){s.show();},false);e.addEventListener("mouseout",function(){s.hide();},false);},show:function(){this.get().style.display="";},hide:function(){this.get().style.display="none";}, get:function(){if(!this.defDiv){var d=document.createElement("span");d.className="footnote_detail";d.innerHTML=this.def;NodeUtil.insertAfter(d,this.el.parentNode);this.defDiv=d;}return this.defDiv;}}, getDef:function(n){if(!Footnote.def){var a=document.getElementById("d_footnotes");if(!a){return "";}a=a.getElementsByTagName("dt");var r={};for(var i=0;i<a.length;++i){var k=a[i];if(!k){continue;}var d=a[i].nextSibling;while(d&&d.nodeType!=1&&d.tagName!="DD"){ d=d.nextSibling;}if(!d){continue;}r[k.innerHTML]=d.innerHTML;}Footnote.def=r;}return Footnote.def[n];}});
uiBuilder.register({selectors:{"sup.footnote a":function(o){new Footnote(o);}}});
function Is(){var n=navigator; var a=n.userAgent.toLowerCase(),t=this;function c(v){return a.indexOf(v)!=-1;}  t.major=parseInt(n.appVersion,10);t.minor=parseFloat(n.appVersion);t.gecko=c('gecko');t.mac=c("mac");if(c("msie")&&!c("opera")){t.ie=true;t.ie3=t.major<4;t.ie4=t.major==4&&c("msie 4");t.ie4up=t.major>=4;t.ie5=t.major==4&&c("msie 5.0");t.ie5_5=t.major==4&&c("msie 5.5");t.ie5up=!t.ie3&&!t.ie4;t.ie5_5up=!t.ie3&&!t.ie4&&!t.ie5;t.ie6=t.major==4&&c("msie 6.");t.ie6up=!t.ie3&&!t.ie4&&!t.ie5&&!t.ie5_5;t.ie7=t.ie6up&&c("msie 7.");t.ie8=t.ie6up&&c("msie 8.");}else if(c("opera")){t.opera=true;t.opera2=c("opera 2")||c("opera/2");t.opera3=c("opera 3")||c("opera/3");t.opera4=c("opera 4")||c("opera/4");t.opera5=c("opera 5")||c("opera/5");t.opera5up=!t.opera2&&!t.opera3&&!t.opera4;}else if(c("mozilla")){if(navigator.userAgent.toLowerCase().indexOf("firefox/2")>-1){t.ff2=true;}}else{ if(/chrome/i.test(a)){t.chrome=/chrome/i.test(a);}else{t.safari=/safari/i.test(a); t.khtml=/konqueror|safari|khtml/i.test(a);}}  if(c('mozilla')&&!c('spoofer')&&!c('compatible')&&!c('opera')&&!c('webtv')&&!c('hotjava')){t.nav=true;t.nav2=t.major==2;t.nav3=t.major==3;t.nav4=t.major==4;t.nav4up=t.major>=4;t.navonly=c(";nav")||c("; nav");t.nav6=t.major==5;t.nav7=t.major>=5&&t.major<8;t.nav8=t.major>=8;}t.webtv=c("webtv");t.TVNavigator=c("navio")||c("navio_aoltv");t.AOLTV=t.TVNavigator;   if(c("aol")){t.aol=true;t.aol3=t.ie3;t.aol4=t.ie4;t.aol5=c("aol 5");t.aol6=c("aol 6");}if(c("hotjava")){t.hotjava=true;t.hotjava3=t.major==3;t.hotjava3up=t.major>=3;} if(t.nav2||t.ie3){t.js=1.0;}else if(t.nav3){t.js=1.1;}else if(t.opera5up){t.js=1.3;}else if(t.opera){t.js=1.1;}else if((t.nav4&&t.minor<=4.05)||t.ie4){t.js=1.2;}else if((t.nav4&&t.minor>4.05)||t.ie5){t.js=1.3;}else if(t.hotjava3up){t.js=1.4;}else if(t.nav6||t.gecko){t.js=1.5;}     else if(t.nav6up){t.js=1.5;} else if(t.ie5up){t.js=1.3;} else{t.js=0.0;} t.win=c("win")||c("16bit");  t.win95=c("win95")||c("windows 95"); t.win16=c("win16")||c("16bit")||c("windows 3.1")||c("windows 16-bit");t.win31=c("windows 3.1")||c("win16")||c("windows 16-bit");    t.win98=c("win98")||c("windows 98");t.winnt=c("winnt")||c("windows nt");t.win32=t.win95||t.winnt||t.win98||t.major>=4&&n.platform=="Win32"||c("win32")||c("32bit");t.winme=c("win 9x 4.90");t.win2k=c("windows nt 5.0");t.winXP=c("windows nt 5.1");t.os2=c("os/2")||n.appVersion.indexOf("OS/2")!=-1||c("ibm-webexplorer"); if(t.mac&&t.ie5up){t.js=1.4;}if(t.mac){t.mac68k=c("68k")||c("68000");t.macppc=c("ppc")||c("powerpc");t.macosx=c("os x");}t.sun=c("sunos");t.risc=c("risc");t.beos=c("beos");t.sun4=c("sunos 4");t.sun5=c("sunos 5");t.suni86=t.sun&&c("i86");t.irix=c("irix"); t.irix5=c("irix 5");t.irix6=c("irix 6")||c("irix6");t.hpux=c("hp-ux");t.hpux9=t.hpux&&c("09.");t.hpux10=t.hpux&&c("10.");t.aix=c("aix"); t.aix1=c("aix 1");t.aix2=c("aix 2");t.aix3=c("aix 3");t.aix4=c("aix 4");t.linux=c("inux");t.sco=c("sco")||c("unix_sv");t.unixware=c("unix_system_v");t.mpras=c("ncr");t.reliant=c("reliantunix");t.dec=c("dec")||c("osf1")||c("dec_alpha")||c("alphaserver")||c("ultrix")||c("alphastation");t.sinix=c("sinix");t.freebsd=c("freebsd");t.netbsd=c("netbsd");t.bsd=c("bsd");t.unix=c("x11")||t.sun||t.irix||t.hpux||t.sco||t.unixware||t.mpras||t.reliant||t.dec||t.sinix||t.aix||t.linux||t.bsd||t.freebsd;t.vms=c("vax")||c("openvms");t.java=n.javaEnabled();t.supported=true;} var is=new Is();window.is=is;
var gFramework={};try{if(typeof(uiInit)!='undefined')gFramework=uiInit;else if(typeof(uiBuilder)!='undefined')gFramework=uiBuilder;}catch(_ex){alert('No framework initialized');}
var StylesheetPatcher={patch:function(p){if(!p){p=[];var o=document.getElementsByTagName("link");for(var j=0;j<o.length;++j){if(o[j].rel!="stylesheet"){continue;}p.push(o[j].href);}}if(!p.push){p=[p];}var s=null,t=null,R=/\.css|.aspx/i,a="";if(is.opera&&is.mac){s="_operaMac";t=s;}else if(is.opera){s="_opera";t=s;}else if(is.chrome){s="_chrome";t=s;}else if(is.safari){s="_safari";t=s;}else if(is.ie7){s="_ie7";t=s;}else if(is.ie8){s="_ie7";t=s;}else if(is.ie6){s="_ie6";t=s;}else if(is.gecko&&is.mac){s="_geckoMac";t=s;}else if(is.ff2){s="_firefox2";t=s;}for(var i=0;i<p.length;++i){var e=p[i];var reg=new RegExp("_script","g");if(StylesheetPatcher.patched[e]||is.ie&&StylesheetPatcher.R.exec(e)){ continue;}if(!reg.test(e)){if(this.isSupportAdvancedUi()){a+='\x3Clink href=\x22'+e.replace(R,"_script.css")+'\x22 rel=\x22stylesheet\x22 type=\x22text/css\x22 /\x3E';}  if(s&&!is.ie&&!is.chrome&&!is.ff2&&!is.opera&&!(is.opera&&is.mac)){a+='\x3Clink href=\x22'+p[i].replace(R,s+".css")+'\x22 rel=\x22stylesheet\x22 type=\x22text/css\x22 /\x3E';}if(t&&this.isSupportAdvancedUi()&&!is.chrome&&!is.ff2&&!is.opera&&!(is.opera&&is.mac)){a+='\x3Clink href=\x22'+p[i].replace(R,"_script"+t+".css")+'\x22 rel=\x22stylesheet\x22 type=\x22text/css\x22 /\x3E';}}}document.write(a); var p_styleSheetPatcher={uiDef:{"body":function(o){if(s!==null){ClassNameUtil.add(o,"vsc_"+s.substr(1));}}}};gFramework.register(p_styleSheetPatcher.uiDef);},patchAll:function(){ var l=document.getElementsByTagName("link");var p=[];for(var i=0;i<l.length;++i){p.push(l.href);}StylesheetPatcher.patch(p);},isSupportAdvancedUi:function(){return!is.ie||!is.mac;},patched:[], R:/_ie\d+\.css/};
var PopupOpener=(function(){function FC(e){this._PopupOpener.open();   e=Event._.patch(e);if(e){e.preventDefault();}return false;} function _(l,p){var self=this;this.domObj=l;this.properties=p?p:{};if(typeof this.properties.resizable=="undefined"){this.properties.resizable=true;}if(typeof this.properties.scrollbars=="undefined"){this.properties.scrollbars=true;}if(!l){return;} this.domObj._PopupOpener=this; this.domObj.onclick=FC;} return _;})(); PopupOpener.prototype={ getPropertiesString:function(){var p=[],a=this.properties;for(var i in a){if(typeof(i)=="string"&&a[i]!==false){p.push(i+(a[i]===true?"":"="+a[i]));}}return p.join(",");}, open:function(){if(this.popup){this.popup.close();}this.popup=window.open(this.domObj.href,this.domObj.target,this.getPropertiesString());this.center();this.popup.focus();}, center:function(){if(this.popup){try{this.popup.moveTo(Math.round((screen.width-this.properties.width)/2),Math.round((screen.height-this.properties.height)/2));}catch(e){}}}};
StylesheetPatcher.patch(document.getElementsByTagName('link')[0].href);var leisure={uiDef:{starter:"l_foot",selectors:{ "a[target=pp_charte]":function(o){new PopupOpener(o,{width:780,height:613,resizable:true,scrollbars:true});},".linkFare":function(o){new PopupOpener(o,{width:575,height:510,resizable:false,scrollbars:true});}}}};uiBuilder.register(leisure.uiDef);
;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150,searchAlgorithm:{ "":function(q,data,options){ if(!options.url&&options.matchContains){return fct_matchContains(q,data,options);}else  if(data[q]){return data[q];}else if(options.matchSubset){return fct_matchFirst(q,data,options);}}}},options); options.highlight=options.highlight||function(value){return value;}; options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8}; var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit; $.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}}); $input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){ lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break; case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.RETURN:if(selectCurrent()){ event.preventDefault();blockSubmit=true;return false;}break;   case KEY.TAB:case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){  hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){ if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){ var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toUpperCase()==q.toUpperCase()){result=data[i];break;}}}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]); if("data" in arguments[1])cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v;}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)return;previousValue=currentValue; currentValue=lastWord(currentValue);   if(currentValue.length>=options.minChars){if(!options.matchCase) currentValue=formatText(currentValue);$input.addClass(options.loadingClass);request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value){return[""];}var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value))result[i]=$.trim(value);});return result;}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);return words[words.length-1];}   function autoFill(q,sValue){  if(options.autoFill&&(lastWord($input.val()).toUpperCase()==q.toUpperCase())&&lastKeyPressCode!=KEY.BACKSPACE){ $input.val($input.val()+sValue.substring(lastWord(previousValue).length)); $.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){ $input.search(function(result){ if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else $input.val("");}});}if(wasVisible) $.Autocompleter.Selection(input,input.value.length,input.value.length);};function receiveData(q,data){if(data&&hasFocus){stopLoading();select.display(data,q);for(var t in data){autoFill(q,data[t][0].value);break;}select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toUpperCase();var data=cache.load(term); if(data){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({ mode:"abort", port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{ select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^\x26;]+;)(?!\x3C[^\x3C\x3E]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\x5C$1")+")(?![^\x3C\x3E]*\x3E)(?![^\x26;]+;)","gi"),"\x3Cstrong\x3E$1\x3C/strong\x3E");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub,options){if(!options.matchCase){s=s.toUpperCase();for(var i=0,r;(r=REG_SUBST[i]);++i){ s=s.replace(r[0],r[1]);}}var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};function fct_matchContains(q,data,options){ var csub=[]; for(var k in data){  if(k.length>0){var c=data[k];$.each(c,function(i,x){ if(matchSubset(x.value,q,options)){csub.push(x);}});}}return csub;}function fct_matchFirst(q,data,options){for(var i=q.length;i>=options.minChars;i--){var c=data[q.substr(0,1)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q,options)){csub[csub.length]=x;}});return csub;}}return[];}$.autocompleteFct={matchSubset:matchSubset,matchContains:fct_matchContains,matchFirst:fct_matchFirst}; function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false; var stMatchSets={},nullData=0; if(!options.url)options.cacheLength=1; stMatchSets[""]=[]; for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i]; rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)continue;var firstChar=value.charAt(0).toUpperCase(); if(!stMatchSets[firstChar])stMatchSets[firstChar]=[]; var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value}; stMatchSets[firstChar].push(row); if(nullData++<options.max){stMatchSets[""].push(row);}}; $.each(stMatchSets,function(i,value){ options.cacheLength++; add(i,value);});} setTimeout(populate,25);function flush(){data={};length=0;}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length||q.length<options.minChars){return null;}var result=null;for(var fctTitle in options.searchAlgorithm){var r=options.searchAlgorithm[fctTitle](q,data,options);if(r.length>0){if(result===null){result={};}result[fctTitle]=r;}}return result;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"}; var listItems,active=-1,data,term="",needsInit=true,element,notList,list; function init(){if(!needsInit)return;element=$("\x3Cdiv/\x3E").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("\x3Cul/\x3E").appendTo(element);if(options.width>0)element.css("width",options.width);needsInit=false;}function initEvt(o){o.mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select(); input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode; if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}function fillList(){list.empty();for(var t in datas){var data=datas[t];var max=limitNumberOfItems(data.length); var subList=$("\x3Cul/\x3E").appendTo(list); initEvt(subList);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("\x3Cli/\x3E").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(subList)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("ul li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;} if($.fn.bgiframe)list.bgiframe();} for(var i=0;i<max;i++){var j=i+1;if(!data[j]){ var node=$(subList[0]).parents("ul"); if(!notList){notList=$(node).after("\x3Cem\x3E"+options.notList+"\x3C/em\x3E");}else{return;}}}}return{display:function(d,q){init();datas=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1; if($.browser.msie&&jQuery.browser.version=='6.0'){$('#OUTWARD_TIME, #INWARD_TIME, #outward_time, #inward_time, #nbPassenger, #nbPassengersForTravel, #DISTRIBUTED_COUNTRY, #NB_TYPO_ADULT').show();}},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({  minWidth:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();  if($.browser.msie&&jQuery.browser.version=='6.0'){$('#OUTWARD_TIME, #INWARD_TIME, #outward_time, #inward_time, #nbPassenger, #nbPassengersForTravel, #DISTRIBUTED_COUNTRY, #NB_TYPO_ADULT').hide();} },selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}};})(jQuery);
var ajaxReady=0; function autoComplete(aElem){var _Elems=new Array(); $(aElem).each(function(index,domObj){_Elems[index]=domObj;});  var country=uiInit.getCountry().toUpperCase();filePath="/completion/VSC/"+country+"/"+I18N.getLang()+"/cityList.js";  if(!$(document).data('autoComplete')&&ajaxReady==0){$.ajax({type:"GET",url:filePath, dataType:"script",cache:"true", beforeSend:function(xhr){ajaxReady=1;},success:function(xhr){ $.data(document,'autoComplete',document["JSON_LOCALITY"].CITIES);eval(xhr); $.each(_Elems,function(){new autoCompleteInit(this);});}});} else{$.each(_Elems,function(){new autoCompleteInit(this);});}};autoComplete.i18nDef={}; function autoCompleteInit(aElem){ var cityList=$(document).data('autoComplete');I18N.setup(autoComplete);$(aElem).autocomplete(cityList,{matchContains:false,minChars:2,max:7,formatResult:function(resultRow){return resultRow[0];},formatMatch:function(row){return formatText(row[0]);},  notList:autoComplete.i18n.get("notList"), searchAlgorithm:{"Commençant par":function(q,data,options){if(q.length===0){return[];}options.matchContains=false;return $.autocompleteFct.matchFirst(q,data,options);},"Contenant":function(q,data,options){if(q.length===0){return[];}options.matchContains=true;return $.autocompleteFct.matchContains(' '+q,data,options);},"like-first":function(q,data,options){if(q.length===0){return[];}var prevQ=q;for(var i=0,r;(r=REG_SUBST[i]);++i){ q=q.replace(r[0],r[1]);}if(prevQ==q){return[];}return $.autocompleteFct.matchFirst(q,data,$.extend(options,{matchContains:false}));},"like-contains":function(q,data,options){if(q.length===0){return[];}var prevQ=q;for(var i=0,r;(r=REG_SUBST[i]);++i){ q=q.replace(r[0],r[1]);}if(prevQ==q){return[];}return $.autocompleteFct.matchContains(' '+q,data,$.extend(options,{matchContains:true}));}}});}; function formatText(text){ text=text.toUpperCase();for(var i=0,r;(r=REG_NORMALIZE[i]);++i){ text=text.replace(r[0],r[1]);}return text;}  var REG_NORMALIZE=[[(/[\u00E1\u00E0\u00E2\u00E4\u00E3\u00E5\u0101\u0103\u0105]/gi),"A"],[(/[\u00E9\u00E8\u00EA\u00EB\u00C9]/gi),"E"],[(/[\u00ED\u00EC\u00EE\u00EF\u012B\u012D\u012Fi]/gi),"I"],[(/[\u00E7]/gi),"C"],[(/[\u0135]/gi),"J"],[(/[\u00F2\u00F3\u00F4\u00F5\u00F6\u00F8]/gi),"O"],[(/[\u00F9\u00FA\u00FB\u00FC\u016F\u016D]/gi),"U"],[(/[\u00F1]/gi),"N"],[(/[\u00FD\u00FF]/gi),"Y"],[(/\u0153/gi),"OE"],[(/\u00E6/gi),"AE"],[(/\u0133/gi),"IJ"],[(/[\W_\s]+/gi)," "],[(/^\s*(.+?)\s*$/gi),"$1"]];var REG_SUBST=[[(/(^|\s)MT(\s|$)/gi),"$1MONT$2"],[(/(^|\s)CDG(\s|$)/gi),"$1CHARLES DE GAULLE$2"],[(/(^|\s)ST(\s|$)/gi),"$1SAINT$2"],[(/(^|\s)STE(\s|$)/gi),"$1SAINTE$2"]];
function I18N(b){this.setBundleRessource(b);}I18N.prototype={ get:function(k){var m=this.br[k];if(typeof(m)=="undefined"||m===null){ return "";}if(typeof(m)!="string"){return m;}for(var i=1,l=arguments.length;i<l;++i){m=m.replace(new RegExp("\x5C{"+(i-1)+"\x5C}","g"),arguments[i]);} m=m.replace(I18N.R[0],"");return m;},     setBundleRessource:function( b, e){if(!b){b=[];}if(e&&this.brDef){ for(var l in this.brDef){if(typeof(l)!="string"||typeof(this.brDef[l])!="object"||!b[l]){continue;}for(var r in this.brDef[l]){if(typeof(r)!="string"||typeof(this.brDef[l][r])!="string"||typeof(b[l][r])!="undefined"){continue;}b[l][r]=this.brDef[l][r];}}} this.brDef=b; this.br=b[I18N.getLang()];if(!this.br){  this.br=b[I18N.defLang];}if(!this.br){  for(var i in b){this.br=b[i];break;}}if(!this.br){  this.br=[];}}}; I18N.defLang="fr_FR"; I18N.lang=null;I18N.getLang=function(){var s=I18N,l=I18N.lang;if(!l){ l=document.getElementsByTagName("html")[0].lang;if(!l){ l=navigator.language;} if(!l){l=navigator.browserLanguage;}I18N.lang=l=l.replace(I18N.R[1],"_").split("_")[0];}return l;}; I18N.R=[(/{\d+}/g),(/\W/g)]; I18N.setup=function( o, f, e){if(!o){return;}if(!o.i18nDef){o.i18nDef={};}if(o.i18n&&!f){ return;}if(!o.i18n||e){o.i18n=new I18N(o.i18nDef);}else{o.i18n.setBundleRessource(o.i18nDef,e);}if(o.i18nSetup){o.i18nSetup(f);}};
if(!Array.prototype.push){Array.prototype.push=function(){var l=this.length;for(var i=0;i<arguments.length;++i){this[l+i]=arguments[i];}return this.length;};}if(!Array.prototype.pop){Array.prototype.pop=function(){if(this.length===0){return null;}var t=this[this.length-1];--this.length;return t;};}
var ArrayUtil={ addAll:function( a, s){if(!a){return;}for(var i=0,l=s.length;i<l;++i){a.push(s[i]);}}, forEach:function( a, f, c){if(!a){return;}c=c||window;for(var i=0,l=a.length;i<l;++i){f.call(c,a[i],i,a);}}, indexOf:function( a, v, i){if(!a){return;}for(i=i||0;i<a.length;++i){if(a[i]===v){return i;}}return-1;}};
var XPathUtil={  RE1:/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/,RE2:/\s+/,getElementsBySelector:function( s, d){if(!d){d=document;} var v0=s.split(',');var founds=[];for(var i0=0;i0<v0.length;++i0){var tokens=v0[i0].split(' ');var currentContext=[d];for(var i=0;i<tokens.length;++i){var bits,tagName,found,elements;token=tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');if(token.indexOf('#')>-1){ bits=token.split('#');tagName=bits[0];var id=bits[1];var element=document.getElementById(id);if(!element||tagName&&element.nodeName.toLowerCase()!=tagName){ currentContext=[];break;} currentContext=[element];continue;}if(token.indexOf('.')>-1){ bits=token.split('.');tagName=bits[0];var className=bits[1];if(!tagName){tagName='*';} found=[];for(var h=0;h<currentContext.length;h++){if(tagName=='*'){elements=XPathUtil.getAllChildren(currentContext[h]);}else{elements=currentContext[h].getElementsByTagName(tagName);}ArrayUtil.addAll(found,elements);}currentContext=[];for(var k=0;k<found.length;k++){if(found[k].className&&found[k].className.match(new RegExp('\x5Cb'+className+'\x5Cb'))){currentContext.push(found[k]);}}continue;} if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)){tagName=RegExp.$1;var attrName=RegExp.$2;var attrOperator=RegExp.$3;var attrValue=RegExp.$4;if(!tagName){tagName='*';} found=[];for(var h0=0;h0<currentContext.length;++h0){if(tagName=='*'){elements=XPathUtil.getAllChildren(currentContext[h0]);}else{elements=currentContext[h0].getElementsByTagName(tagName);}ArrayUtil.addAll(found,elements);}currentContext=[];var checkFunction; switch(attrOperator){case '=': checkFunction=function(e){return(e.getAttribute(attrName)==attrValue);};break;case '~': checkFunction=function(e){return(e.getAttribute(attrName).match(new RegExp('\x5Cb'+attrValue+'\x5Cb')));};break;case '|': checkFunction=function(e){return(e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?')));};break;case '^': checkFunction=function(e){return(e.getAttribute(attrName).indexOf(attrValue)===0);};break;case '$': checkFunction=function(e){return(e.getAttribute(attrName).lastIndexOf(attrValue)==e.getAttribute(attrName).length-attrValue.length);};break;case '*': checkFunction=function(e){return(e.getAttribute(attrName).indexOf(attrValue)>-1);};break;default: checkFunction=function(e){return e.getAttribute(attrName);};}currentContext=[];for(var k1=0;k1<found.length;++k1){if(checkFunction(found[k1])){currentContext.push(found[k1]);}} continue;}if(!currentContext[0]){currentContext=[];break;} tagName=token;found=[];for(var h2=0;h2<currentContext.length;++h2){elements=currentContext[h2].getElementsByTagName(tagName);ArrayUtil.addAll(found,elements);}currentContext=found;}ArrayUtil.addAll(founds,currentContext);}return founds;},getParentByNodeName:function(o,t){t=t.toLowerCase();var r=o;while(r&&r.nodeName&&r.nodeName.toLowerCase()!=t){r=r.parentNode;}return r;},getNextSiblingByNodeName:function(o,t){t=t.toLowerCase();var r=o;while(r&&r.nodeName&&r.nodeName.toLowerCase()!=t){r=r.nextSibling;}return r;},getFirstChildByNodeName:function(o,t){t=t.toLowerCase();var c=o.childNodes;for(var i=0,l=c.length;i<l;++i){if(c[i]&&c[i].nodeName&&c[i].nodeName.toLowerCase()==t){return c[i];}}return null;},getChildrenByNodeName:function(o,t){if(!o){return[];} var elementParts=t.split("@");t=elementParts[0].toLowerCase();var attributs=[];for(var k=1;k<elementParts.length;++k){var a=elementParts[k].split("=");attributs.push([a[0].toLowerCase(),a[1]]);}var result=[];var childNodes=o.childNodes;for(var i=0;i<childNodes.length;++i){if(childNodes[i]&&childNodes[i].nodeName&&childNodes[i].nodeName.toLowerCase()==t){ var ok=true;for(var j=0;j<attributs.length;++j){var attributeValue=null;if(childNodes[i].getAttributeNode){if(childNodes[i].getAttributeNode(attributs[j][0])){attributeValue=childNodes[i].getAttributeNode(attributs[j][0]).value;}}else if(childNodes[i].getAttribute){attributeValue=childNodes[i].getAttribute(attributs[j][0]);}ok=false;if(attributeValue!==null&&typeof(attributeValue)!="undefined"&&attributeValue==attributs[j][1]){ok=true;}else{ok=false;break;}}if(ok){result[result.length]=childNodes[i];}}}return result;},getChildren:function(o){var childNodes=o.childNodes;var result=[];for(var i=0;i<childNodes.length;++i){if(childNodes[i].nodeType==1){result.push(childNodes[i]);}}return result;},getElementsByXPath:function(xPath,root){var result=[];if(typeof(root)=="undefined"){root=document.getElementsByNodeName("body")[0];}var indexSlash=xPath.indexOf("/");if(indexSlash===0){xPath=xPath.substring(1,xPath.length);indexSlash=xPath.indexOf("/");}var element="";var otherElements="";if(indexSlash!=-1){element=xPath.substring(0,indexSlash);otherElements=xPath.substring(indexSlash+1,xPath.length);}else{element=xPath.substring(0,xPath.length);} elements=XPathUtil.getChildrenByNodeName(root,element);if(otherElements!==""){for(var i=0;i<elements.length;++i){result.addAll(XPathUtil.getElementsByXPath(otherElements,elements[i]));}}else{for(var j=0;j<elements.length;++j){result.push(elements[j]);}}return result;},getIndex:function(o){var c=XPathUtil.getChildren(o.parentNode);for(var i=0,l=c.length;i<l;++i){if(c[i]==o){return i;}}return-1;},getAllChildren:function(e){ return e.all?e.all:e.getElementsByTagName('*');}};
if(!Function.prototype.apply){ Function.prototype.apply=function(o,p){if(!o){o=window;}if(!p){p=[];}var a=[];for(var i=0;i<p.length;++i){a[i]='p['+i+']';}o.__apply__=this;var r=eval('o.__apply__('+a.join(',')+')');o.__apply__=null;return r;};}if(!Function.prototype.call){ Function.prototype.call=function(s){var a=[];for(var i=1;i<arguments.length;++i){a[i-1]=arguments[i];}return this.apply(s,a);};}Function.prototype.bind=function(o){var m=this;var a=arguments;return function(){var p=[];for(var i=0;i<arguments.length;++i){p.push(arguments[i]);}for(var j=1;j<a.length;++j){p.push(a[j]);}m.apply(o,p);};};Function.prototype.bindAsEventListener=function(o){var m=this;return function(e){m.call(o,e||window.event);};};Function.EMPTY=function(){};
function Request(o){var u='',s=this,e,p;s.values=[];if(typeof o=="string"){u=o;}else if(o.href){u=o.href;p="href";e=o;}else if(o.action){u=o.action;p="action";e=o;}else if(o.src){u=o.src;p="src";e=o;}  s.el=e; s.urlProp=p;if(u.indexOf("?")==-1){return;}var c=u.substring(u.indexOf("?")+1).split("\x26");if(u.indexOf("?")==-1){s.url=u;}else{s.url=u.substring(0,u.indexOf("?"));}for(var i=0;i<c.length;++i){var v=c[i].split("=");s.values[v[0]]=v[1];}}Request.prototype={getParameter:function(n){return this.values[n];},setParameter:function(k,v){this.values[k]=v;if(this.el){ this.el[this.urlProp]=this.toString();}},getParameterNames:function(){var n=[];for(var i in this.values){n[n.length]=i;}return n;},getParameterValues:function(n){return this.values[n].split(",");},toString:function(){var p=[];for(var i in this.values){p.push(i+"="+this.values[i]);}return this.url+"?"+p.join("\x26");}};var request=new Request(location);
function UiInit( context){this.context=context;this.uiDef={};}UiInit.prototype={ register:function( uiDef){$.extend(this.uiDef,uiDef);}, run:function( context,aUiInit){if(!context){context=this.context||document;}var s=this;if(aUiInit){s.uiDef=aUiInit;} for(var selector in s.uiDef){var _Elem=$(selector,context);if(!_Elem.get(0))continue;for(var i=0;i<_Elem.length;i++){if(!_Elem[i])continue;if(s.uiDef[selector](_Elem[i],_Elem)===false)break;}}s.uiDef=null;}, getUrl:function(){return window.location.href.split('//')[1].split('/')[0];},getPagePath:function(){ var e=document;if(!e._pagePath){ var M=e.getElementsByTagName("meta");for(var i=0,m;(m=M[i]);++i){if(m.httpEquiv=="Page-Path"||m.name=="Page-Path"){e._pagePath=m.content;break;}}}return e._pagePath;},getSite:function(){ var e=document;if(!e._site){ var M=e.getElementsByTagName("meta");for(var i=0,m;(m=M[i]);++i){if(m.httpEquiv=="Page-Site"||m.name=="Page-Site"){e._site=m.content;break;}}}return e._site;},getCountry:function(){ var e=document;if(!e._country){ var M=e.getElementsByTagName("meta");for(var i=0,m;(m=M[i]);++i){if(m.httpEquiv=="country"||m.name=="country"){e._country=m.content;break;}}if(typeof(e._country)=='undefined'){M=e.getElementsByTagName("html")[0];if(M.getAttribute("lang")){e._country=M.getAttribute("lang");}}}return e._country;},getAgency:function(){ var e=document;if(!e._agency){ var M=e.getElementsByTagName("meta");for(var i=0,m;(m=M[i]);++i){if(m.httpEquiv=="agency"||m.name=="agency"){e._agency=m.content;break;}}}return e._agency;}, detectIE:function(){var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf('msie')!=-1){return true;}}};var uiInit=new UiInit(document);$(function(){uiInit.run();});
Date.NB_DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31];  Date.SECOND=1000 ;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY; Date.prototype.clone=function(){return new Date(this.getTime());}; Date.prototype.getNbDaysInMonth=function(m){var y=this.getFullYear();if(typeof m=="undefined"){m=this.getMonth();}if(m==1&&((0===(y%4))&&((0!==(y%100))||(0===(y%400))))){return 29;}return Date.NB_DAYS_IN_MONTH[m];}; Date.NOW=new Date(); Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);}; Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3); var ms=d.valueOf(); d.setMonth(0);d.setDate(4); return Math.round((ms-d.valueOf())/(7*864e5))+1;}; Date.prototype.equalsTo=function(d){return this.getFullYear()==d.getFullYear()&&this.getMonth()==d.getMonth()&&this.getDate()==d.getDate()&&this.getHours()==d.getHours()&&this.getMinutes()==d.getMinutes();};
function DateFormat( p){I18N.setup(DateFormat);if(!p){p=DateFormat.i18n.br.timeFormatShort;}this.pattern=p;}DateFormat._RE1=/\W+/;DateFormat._RE2=/%./g;DateFormat._RE3=/%./g;DateFormat.prototype={parse:function(str){var today=new Date(),y=0,m=-1,d=0,a=str.split(DateFormat._RE1),b=this.pattern.match(DateFormat._RE2),i=0,j=0,hr=0,min=0;for(i=0;i<a.length;++i){if(!a[i]){continue;}switch(b[i]){case "%d":case "%e":d=parseInt(a[i],10);break;case "%M":m=parseInt(a[i],10)-1;break;case "%Y":case "%y":y=parseInt(a[i],10);if(y<100){y+=y>29?1900:2000;}break;case "%b":case "%B":for(j=0;j<12;++j){if(DateFormat.i18n.br.MONTH[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case "%H":case "%I":case "%k":case "%l":hr=parseInt(a[i],10);break;case "%P":case "%p":if(/pm/i.test(a[i])&&hr<12){hr+=12;}else if(/am/i.test(a[i])&&hr>=12){hr-=12;}break;case "%m":min=parseInt(a[i],10);break;}}if(isNaN(y)){y=today.getFullYear();}if(isNaN(m)){m=today.getMonth();}if(isNaN(d)){d=today.getDate();}if(isNaN(hr)){hr=today.getHours();}if(isNaN(min)){min=today.getMinutes();}if(y!==0&&m!=-1&&d!==0){return new Date(y,m,d,hr,min,0);}y=0;m=-1;d=0;for(i=0;i<a.length;++i){if(a[i].search(/[a-zA-Z]+/)!=-1){var t=-1;for(j=0;j<12;++j){if(DateFormat.i18n.br.MONTH[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){t=j;break;}}if(t!=-1){if(m!=-1){d=m+1;}m=t;}}else if(parseInt(a[i],10)<=12&&m==-1){m=a[i]-1;}else if(parseInt(a[i],10)>31&&y===0){y=parseInt(a[i],10);if(y<100){y+=y>29?1900:2000;}}else if(d===0){d=a[i];}}if(y===0){y=today.getFullYear();}if(m!=-1&&d!==0){return new Date(y,m,d,hr,min,0);}return today;}, format:function(d){var m=d.getMonth(),D=d.getDate(),y=d.getFullYear(),wn=d.getWeekNumber(),w=d.getDay(),hr=d.getHours(),dy=d.getDayOfYear(),min=d.getMinutes(),sec=d.getSeconds();var pm=(hr>=12);var ir=pm?(hr-12):hr;if(ir===0){ir=12;}var t=wn<10?("0"+wn):wn;var s={"%a":DateFormat.i18n.br.DAY_AB[w], "%A":DateFormat.i18n.br.DAY[w], "%b":DateFormat.i18n.br.MONTH_AB[m], "%B":DateFormat.i18n.br.MONTH[m],  "%C":1+Math.floor(y/100), "%d":D<10?("0"+D):D, "%e":D,   "%H":hr<10?("0"+hr):hr, "%I":ir<10?("0"+ir):ir, "%j":dy<100?(dy<10?("00"+dy):("0"+dy)):dy, "%k":hr, "%l":ir, "%M":m<9?("0"+(1+m)):(1+m), "%m":min<10?("0"+min):min, "%n":"\n", "%p":pm?"PM":"AM","%P":pm?"pm":"am",  "%S":Math.floor(d.getTime()/1000),"%s":sec<10?("0"+sec):sec, "%t":"\t",  "%U":t,"%W":t,"%V":t,"%u":w+1, "%w":w,   "%y":(''+y).substr(2,2), "%Y":y, "%%":"%" };return DateFormat.REPLACE(this.pattern,s);}};if(typeof(is)!="undefined"&&!is.ie5&&!(is.ie&&is.mac)&&!is.khtml){DateFormat.REPLACE=function(x,s){return x.replace(DateFormat._RE3,function(p){return s[p]||p;});};}else{DateFormat.REPLACE=function(x,s){var a=x.match(DateFormat._RE3);if(!a){return x;}for(var i=0;i<a.length;++i){var t=s[a[i]];if(typeof(t)=="undefined"){continue;}var r=new RegExp(a[i],'g');x=x.replace(r,t);}return x;};} DateFormat.i18nDef={};
DateFormat.i18nDef.fr={ DAY_AB:["dim","lun","mar","mer","jeu","ven","sam"], DAY_FL:["d","l","m","m","j","v","s"], DAY:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"], MONTH_AB:["jan","f\xE9v","mar","avr","mai","juin","juil","ao\xFBt","sep","oct","nov","d\xE9c"], MONTH:["janvier","f\xE9vrier","mars","avril","mai","juin","juillet","ao\xFBt","septembre","octobre","novembre","d\xE9cembre"], firstDayWeek:1, dayFormatLong:"%A %e %B", dayFormatShort:"%d/%M/%Y", timeFormatLong:"%A %e %B %Hh %Mm %ss", timeFormatShort:"%d/%M/%Y %H:%m:%s"};
function ShortcutManager( d, o){if(!o){o={};}this.fct={N:[],CTRL_:[],ALT_:[],SHIFT_:[]};document.addEventListener("keydown",this.run.bind(this),false);if(d){this.register(d);}var s=this;if(o.listenerOn){var l=o.listenerOn;EventListener.patch(l);if(o.enableOn){l.addEventListener(o.enableOn,function(){s.enable();},false);}if(o.disableOn){l.addEventListener(o.disableOn,function(){s.disable();},false);}}this.enabled=o.enabled?true:false;}ShortcutManager.getCode=function(e){if(e.keyCode!==0){return e.keyCode;}return e.charCode;};ShortcutManager.prototype={run:function(e){if(!this.enabled){return;}if(!e){e=event;}var c=ShortcutManager.getCode(e)+"";var f;if(e.ctrlKey){f=this.fct.CTRL_[c];}if(e.altKey){f=this.fct.ALT_[c];}if(e.shiftKey){f=this.fct.SHIFT_[c];}if(this.runFcts(f,e)===false){return false;}if(f&&f.length>0){Event._.patch(e);e.stopPropagation();return;}if(this.runFcts(this.fct.N[c],e)===false){return false;}},runFcts:function( f, e){for(var i=0;f&&i<f.length;++i){if(f[i]&&f[i](e)!==true){Event._.patch(e).stopPropagation();e.preventDefault();return false;}}},enabled:false,disable:function(){this.enabled=false;},enable:function(){this.enabled=true;}, register:function(k,m){for(var c in k){if(ShortcutManager.CODE[c]){this.add(ShortcutManager.CODE[c],k[c],m);}else if(ShortcutManager.MODIFIER[c]){this.register(k[c],c);}}}, add:function( c, f, m){c=c+"";var a=this.fct[m];if(!a){a=this.fct.N;}if(!a[c]){a[c]=[];}a[c].push(f);},remove:function(c,f,m){var a=this.fct[m];if(!a){a=this.fct.N;}if(!a[c]){return;}for(var i=a[c].length-1;i>=0;--i){if(a[c][i]==f){a[c][i]=null;}}}};ShortcutManager.CODE={ENTER:13,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,STOPSCROLL:145,PAUSE:19,SWIFT:16,CRTL:17,ALT:18,WIN:91, WINRIGHT:92,CONTEXT:93,MAJ:20,TAB:9, BSPACE:8,DELETE:46,SPACE:32, LOCKN:144,ESC:27,UP:38,DOWN:40,LEFT:37,RIGHT:39,PUP:33,PDOWN:34,HOME:36,END:35};ShortcutManager.MODIFIER={ALT_:"altKey",CTRL_:"ctrlKey",SHIFT_:"shiftKey "};
var DatePicker=CUi.create("DatePicker",{prototype:{ _:function(){ var s=this,e=this.el,o=this.opt; e.setAttribute("autocomplete","off"); if(!o.format){I18N.setup(DateFormat); o.format=DateFormat.i18n.get("dayFormatShort");}s.df=new DateFormat(o.format);ClassNameUtil.add(e,"DatePicker_trigger");EventListener.patch(e);function F( ev){s.show();  } e.addEventListener("click",F,false); e.addEventListener("focus",F,false);var t1=DatePicker.i18n.get('shrctTrigger'),t2=DatePicker.i18n.get('shrctTriggerFocus');e.title=t1; s.inputShortcutManager=new ShortcutManager({CTRL_:{SPACE:function(){s.show();}}},{listenerOn:e,enableOn:"focus",disableOn:"blur"}); s.shortcutManager=new ShortcutManager({UP:function(){s.goToPrevWeek();},DOWN:function(){s.goToNextWeek();},LEFT:function(){s.goToPrevDay();},RIGHT:function(){s.goToNextDay();},PUP:function(){s.goToPrevMonth();},PDOWN:function(){s.goToNextMonth();},ENTER:function(e){s.selectDate();},ESC:function(){s.hide();},HOME:function(){s.goToday();},CTRL_:{ENTER:function(e){s.goToday();s.selectDate();}}});e.addEventListener("focus",function(){e.title=t2;},false);e.addEventListener("blur",function(){e.title=t1;if(DatePicker.closeTimer){return;}DatePicker.closeTimer=setTimeout(function(){DatePicker.closeTimer=clearTimeout(DatePicker.closeTimer);s.hide();},50);},false);s.current=new Date();if(o.showDay){ s.day=document.createElement("span");s.day.className="DatePicker_day";e.parentNode.insertBefore(s.day,e);var v=e.value;if(v){ v=s.df.parse(v); if(!s.isEnable(v)){ e.value="";}else{ s.updateDay(v);}}}},goToday:function( e){this.showMonth(new Date(),e);return false;},goToNextDay:function( e){var d=this.current.clone();d.setDate(d.getDate()+1);this.showMonth(d,e);},goToPrevDay:function( e){var d=this.current.clone();d.setDate(d.getDate()-1);this.showMonth(d,e);},goToNextWeek:function( e){var d=this.current.clone();d.setDate(d.getDate()+7);this.showMonth(d,e);},goToPrevWeek:function( e){var d=this.current.clone();d.setDate(d.getDate()-7);this.showMonth(d,e);}, changeMonth:function( e, i){var d=this.current.clone();  d.setDate(1);   var wMonth=d.getMonth()+i;if(wMonth==-1){ d.setFullYear(d.getFullYear()-1);d.setMonth(11);}else{d.setMonth(wMonth);} if(this.current.getDate()>d.getNbDaysInMonth()){ d.setDate(d.getNbDaysInMonth());}else{ d.setDate(this.current.getDate());}this.showMonth(d,e);},goToNextMonth:function( e){this.changeMonth(e,1);},goToPrevMonth:function( e){this.changeMonth(e,-1);},show:function(){DatePicker.showCal(this);},hide:function(){DatePicker.hideCal(this);},isEnable:function(d){return d.getTime()>=DatePicker.NOW;},showDate:function(d){if(!d){d=new Date();}d.setHours(23);d.setMinutes(0);d.setSeconds(0);this.showMonth(d);}, showMonth:function( ref, e){window.stopEvent(e);if(!ref){ref=this.current;}var d=ref.clone();if(!this.isEnable(ref)){ for(var k=1;k<32;++k){d.setDate(k);if(this.isEnable(d)){ref=d.clone();break;}}if(!this.isEnable(d)){window.stopEvent(e);return false;}}d.setDate(1);var r=ref.clone();var caption=DateFormat.i18n.br.MONTH[ref.getMonth()]+" "+ref.getFullYear();try{this.cal.caption.innerHTML=caption;}catch(e){this.cal.month.innerHTML=""; this.cal.caption.appendChild(document.createTextNode(caption));} while(d.getDay()!=DateFormat.i18n.br.firstDayWeek){d.setDate(d.getDate()-1);}this.cal.table.style.display="none";var j=this.cal.days,i18n_dayChoice=DatePicker.i18n.br.dayChoice,fdBr=DateFormat.i18n.br;var l=j.length;for(var i=0;i<l;++i){var o=j[i],cn="";if(d.getTime()==r.getTime()){cn="current";}else{cn=(d.getMonth()<r.getMonth()?"prev":d.getMonth()>r.getMonth()?"next":"");}if(!this.isEnable(d)){cn+=" disabled";o._disabled=true;o.title=DatePicker.i18n.get('dayNotChoice');}else{o._disabled=false;o.title=i18n_dayChoice+' '+fdBr.DAY[d.getDay()]+' '+d.getDate()+' '+fdBr.MONTH[d.getMonth()]+' '+d.getFullYear();}try{o.innerHTML=d.getDate();}catch(e){o.innerHTML=""; o.appendChild(document.createTextNode(d.getDate()));}o._d=d.getTime();o.parentNode.className=cn;d.setDate(d.getDate()+1);this.current=ref;}this.cal.table.style.display="block";return false;},selectDate:function( l, e){var d;if(l&&l._d){l._d=parseInt(l._d,10); d=new Date(l._d);if(!this.isEnable(d)){window.stopEvent(e);l.blur();return false;}}else{d=this.current.clone();if(!this.isEnable(d)){try{window.stopEvent(l);}catch(e){}return;}}  this.current.setDate(1);this.current.setFullYear(d.getFullYear());this.current.setMonth(d.getMonth());this.current.setDate(d.getDate());d=this.current;var oldValue=this.el.value;this.el.value=this.df.format(d); this.updateDay(d);var of=this.el.onfocus;this.el.onfocus=Function.EMPTY;this.el.focus();this.el.select();DatePicker.hideCal();function F(o,f){return(function(){o.onfocus=f;});}if(this.el.value!=oldValue){this.dispatchEvent("change");}setTimeout(F(this.el,of),100);return false;}, updateDay:function( d){if(!this.day){ return;} if(this.day.firstChild){this.day.removeChild(this.day.firstChild);}this.day.appendChild(document.createTextNode(DateFormat.i18n.br.DAY[d.getDay()]));}}, CAL:null, currentPicker:null, BUTTON:document.createElement("a"), getCal:function( o){ var D=DatePicker;var br=D.i18n.br,fdBr=DateFormat.i18n.br,C=D.CAL,s=o.opt.shortcut;if(!C){var b=['\x3Cp id=\x22DatePicker_caption\x22\x3E\x3Cstrong\x3E\x3C/strong\x3E \x3Ca href=\x22javascript:void(0)\x22 title=\x22',br.goToPrevMonthTitle,(s?br.shrctShowCalPrevMonth:''),'\x22 id=\x22DatePicker_c_mPrev\x22\x3E',br.goToPrevMonth,'\x3C/a\x3E \x3Ca href=\x22javascript:void(0)\x22 title=\x22',br.goToNextMonthTitle,(s?br.shrctShowCalNextMonth:''),'\x22 id=\x22DatePicker_c_mNext\x22\x3E',br.goToNextMonth,'\x3C/a\x3E\x3C/p\x3E\x3Ctable',(s?' title=\x22'+br.shrct+'\x22':''),'\x3E\x3Cthead\x3E\x3Ctr\x3E'];var c=fdBr.firstDayWeek;for(var i=0;i<7;++i){b.push('\x3Cth id=\x22j'+i+'\x22\x3E');b.push('\x3Cabbr title=\x22'+fdBr.DAY[c]+'\x22\x3E');b.push(fdBr.DAY_FL[c]);if(++c>6){c=0;}b.push('\x3C/th\x3E');}b.push('\x3C/tr\x3E\x3C/thead\x3E\x3Ctbody\x3E');for(var w=0;w<6;++w){b.push("\x3Ctr\x3E");for(var j=0;j<7;++j){b.push('\x3Ctd headers=\x22j'+j+'\x22\x3E\x3Ca href=\x22javascript:void(0)\x22 onclick=\x22DatePicker.currentPicker.selectDate(this,event);return false;\x22\x3E\x3C/a\x3E\x3C/td\x3E');}b.push("\x3C/tr\x3E");}var N=Date.NOW;var ajdh=new Date(N.getFullYear(),N.getMonth(),N.getDate(),23,59,59,999);b.push('\x3C/tbody\x3E\x3C/table\x3E\x3Cp\x3E\x3Ca href=\x22javascript:void(0)\x22 title=\x22',br.todayTitle,(s?br.shrctToday:''),'\x22 onclick=\x22this._d=\x27',ajdh.getTime(),'\x27;return DatePicker.currentPicker.selectDate(this,event);\x22 id=\x22DatePicker_c_today\x22\x3E',br.today,'\x3C/a\x3E\x3C/p\x3E');var t=document.createElement("div");t.id="DatePicker";t.innerHTML=b.join('');document.body.appendChild(t);C=D.CAL={div:t,caption:t.firstChild.firstChild,table:t.firstChild.nextSibling,days:t.firstChild.nextSibling.tBodies[0].getElementsByTagName("a")};var lf=t.firstChild.getElementsByTagName("a");lf[0].onclick=function(e){D.currentPicker.goToPrevMonth(e);return false;};lf[1].onclick=function(e){D.currentPicker.goToNextMonth(e);return false;};EventListener.patch(t);t.addEventListener("mousedown",function(e){e=Event._.patch(e);e.stopPropagation();DatePicker.closeTimer2=setTimeout(function(){DatePicker.closeTimer=clearTimeout(DatePicker.closeTimer);DatePicker.closeTimer2=clearTimeout(DatePicker.closeTimer2);},10);},true);}var p=HtmlUtil.getAbsolutePos(o.el);C.div.style.left=p.x+"px";C.div.style.top=p.y+"px";C.table._DatePicker=o;  C.div.className=C.div.className.replace(/(^|\s+)targetInput_\S+/,"$1"); C.div.className+=" targetInput_"+o.el.id;D.currentPicker=o;return C;}, hideCal:function(){document.removeEventListener("mousedown",DatePicker.EVT_MOUSEDOWN,false);var o=DatePicker.currentPicker;if(!o){return;}if(o.cal){if(o.shortcutManager){o.shortcutManager.disable();}o.cal.div.style.display="none";o.cal=null;}}, showCal:function( o){if(DatePicker.currentPicker!=o){DatePicker.hideCal();}o.cal=DatePicker.getCal(o);  var d=o.df.parse(o.el.value); if(!o.isEnable(d)){ o.el.value="";d=new Date();}o.dateToShow=d;o.dispatchEvent("beforeshow"); o.cal.div.style.display="block";o.showDate(o.dateToShow);setTimeout(function(){document.addEventListener("mousedown",DatePicker.EVT_MOUSEDOWN,false);},50);if(o.shortcutManager){o.shortcutManager.enable();}}, init:function(){EventListener.patch(document);var D=DatePicker,d=new Date();d.setHours(0);d.setMinutes(0);d.setSeconds(0);d.setMilliseconds(0);D.NOW=d.getTime();D.BUTTON.href="javascript:void(0)";D.BUTTON.className="DatePicker_button";},EVT_MOUSEDOWN:function(e){if(DatePicker.closeTimer){return;}DatePicker.closeTimer=setTimeout(function(){DatePicker.closeTimer=clearTimeout(DatePicker.closeTimer);DatePicker.hideCal();},80);}});
DatePicker.i18nDef.fr={button:"Afficher le calendrier",goToPrevMonth:"mois préc.",goToPrevMonthTitle:"Voir le mois précédent",goToNextMonth:"mois suiv.",goToNextMonthTitle:"Voir le mois suivant",today:"Aujourd\x27hui",todayTitle:"Prendre la date d\x27aujourd\x27hui",shrctTrigger:"cliquez ici pour afficher le calendrier",shrctTriggerFocus:"cliquez ici (ou CTRL+espace) pour afficher le calendrier",shrctShowCalNextMonth:" (raccourcis : Page-Sup.)",shrctShowCalPrevMonth:" (raccourcis : Page-Inf.)",shrct:"Vous pouvez utiliser les flèches de votre clavier pour naviguer dans le calendrier",shrctToday:" (raccourcis : CTRL+Entrée)",dayChoice:"Choisir la date : ",dayNotChoice:"Date désactivée"};
function Request(o){var u='',s=this,e,p;s.values=[];if(typeof o=="string"){u=o;}else if(o.href){u=o.href;p="href";e=o;}else if(o.action){u=o.action;p="action";e=o;}else if(o.src){u=o.src;p="src";e=o;}  s.el=e; s.urlProp=p;if(u.indexOf("?")==-1){return;}var c=u.substring(u.indexOf("?")+1).split("\x26");if(u.indexOf("?")==-1){s.url=u;}else{s.url=u.substring(0,u.indexOf("?"));}for(var i=0;i<c.length;++i){var v=c[i].split("=");s.values[v[0]]=v[1];}}Request.prototype={getParameter:function(n){return this.values[n];},setParameter:function(k,v){this.values[k]=v;if(this.el){ this.el[this.urlProp]=this.toString();}},getParameterNames:function(){var n=[];for(var i in this.values){n[n.length]=i;}return n;},getParameterValues:function(n){return this.values[n].split(",");},toString:function(){var p=[];for(var i in this.values){p.push(i+"="+this.values[i]);}return this.url+"?"+p.join("\x26");}};var request=new Request(location);
var FormUtil={ getQueryData: function(f,o){if(!o){o={};}var m=FormUtil.getMap(f),e=o.excludeParam,a=o.addParams;var q=[];function add(k,v){ if(typeof v=="string"){q.push(escape(k)+"="+escape(v));}else{ for(var i=0;i<v.length;++i){q.push(escape(k)+"="+escape(v[i]));}}}if(!e){for(var k in m){add(k,m[k]);}}else{for(var n in m){if(e.exec(n)){continue;}add(n,m[n]);}}if(a){for(var p in a){add(p,a[p]);}}return q.join("\x26");}, getMap:function(f){var q=[],r=new Request(f); var p=r.getParameterNames();for(var j=0;j<p.length;++j){q[p[j]]=r.getParameter(p[j]);} for(var i=0,el;(el=f.elements[i]);++i){if(typeof el!="object"){continue;}var v=FormUtil.getValue(el);  if(v===null||v===""){continue;}q[el.name]=v;}return q;}, getAction: function( e){if(!e){return null;}var i=e.action.indexOf("?"),u=e.action;if(i!=-1){return u.substring(0,i);}return u;}, getValue: function( e){if(!e){return null;}if(e.getValue){return e.getValue();}if(e.type=="checkbox"||e.type=="radio"){e.getValue=function(){var a=this.form.elements[this.name];if(typeof(a.length)=="undefined"){a=[a];}var v=[];for(var i=0;i<a.length;++i){if(a[i].checked){v.push(a[i].value);}}return(v.length===0?"":v.length==1?v[0]:v);};}else if(e.type=="select-multiple"){e.getValue=function(){var v=[];for(var i=0,o;(o=this.options[i]);++i){if(o.selected&&o.value.length>0){v.push(o.value);}}return(v.length===0?"":v.length==1?v[0]:v);};}else if(e.type=="select-one"){e.getValue=function(){if(this.selectedIndex==-1){return "";}var o=this.options[this.selectedIndex];if(!o){ return null;}return o.value;};}else if(typeof(e.value)!="undefined"){e.getValue=function(){return this.value;};}else{return null;}return e.getValue();}, setValue: function( e, v){if(!e){return;}if(e.item&&e.item(0)&&(e.item(0).type=="checkbox"||e.item(0).type=="radio")){ e=e.item(0);}if(e.setValue){return e.setValue(v);}if(e.type=="checkbox"||e.type=="radio"){var a=e.form.elements[e.name];if(typeof(a.length)=="undefined"){a=[e];}for(var i=0;i<a.length;++i){a[i].checked=(a[i].value===v);}return;}if(e.type=="select-multiple"){for(var j=0,l=e.options.length;j<l;++j){e.options[j].selected=(e.options[j].value===v);}return;}if(e.type=="select-one"){e.selectedIndex=-1;for(var k=0,m=e.options.length;k<m;++k){if(e.options[k].value===v){e.selectedIndex=k;return;}}return;}if(typeof(e.value)!="undefined"){e.value=v;}}};
function SelectManager(e,o){if(!o){o={};}this.el=e;this.opt=o;if(!o.prefixValue){o.prefixValue=this.el.name;}if(!o.container){o.container=this.el.parentNode;}var s=this,c=this.opt.container;this.el._SelectManager=this;this.prefixRegExp=new RegExp("("+o.prefixValue+"_)([\x5Cw\x5Cd_\x5C-.:]*)");if(c.className.indexOf(o.prefixValue+"_")==-1){c.className+=" "+o.prefixValue+"_";}EventListener.patch(e);function F(){s.update();}e.addEventListener("change",F,false);e.addEventListener("click",F,false);this.update();}SelectManager.prototype={update:function(){var s=this.el,c=this.opt.container;var cl=c.className.replace(this.prefixRegExp,"$1"+FormUtil.getValue(s));if(cl!=c.className){c.className=cl;}}};
function PassengerManager(e,o){this.el=e;if(!o){o={};}this.opt=o;if(!e){return;}I18N.setup(PassengerManager);if(!o.fieldName){o.fieldName="nbPassengersForTravel";}if(!o.className){o.className="nbPassengers";}var s=this;var f=e.getElementsByTagName("fieldset");var p=document.createElement("p");p.className="select1 required";p.id="fs1_"+o.fieldName;var a=['\x3Clabel for=\x22'+o.fieldName+'\x22\x3E'];this.classRegExp=new RegExp(o.className+"_(\x5Cd+)");var nb=this.classRegExp.exec(e.className);if(!nb||nb.length!=2){e.className=o.className+"_1";nb=1;}else{nb=nb[1];}a.push(PassengerManager.i18n.get("filedLabel"));a.push('\x3C/label\x3E \x3Cselect id=\x22'+o.fieldName+'\x22 name=\x22'+o.fieldName+'\x22\x3E');for(var i=1;i<=f.length;++i){a.push('\x3Coption value=\x22'+i+'\x22'+(i+''==nb?' selected=\x22selected\x22':'')+'\x3E'+i+'\x3C/option\x3E');}a.push('\x3C/select\x3E');p.innerHTML=a.join('');e.insertBefore(p,e.firstChild);this.select=p.getElementsByTagName("select")[0];EventListener.patch(this.select);this.select.onchange=function(){s.update();};this.typologySelects=[];if(this.opt.typologyNameRegExp){var selects=e.getElementsByTagName("select"); for(var j=0;j<selects.length;++j){if(this.opt.typologyNameRegExp.exec(selects[j].name)){this.typologySelects.push(selects[j]);}}} this.update();} PassengerManager.prototype.update=function(){var s=this.select,t=this.typologySelects; var nb=parseInt(s.options[s.selectedIndex].value,10); this.el.className=this.el.className.replace(this.classRegExp,this.opt.className+"_"+nb); for(var i=0,iO;i<nb&&(iO=t[i]);++i){PassengerManager.setTypology(iO);} for(var j=nb,jO;(jO=t[j]);++j){PassengerManager.resetTypology(jO);}}; PassengerManager.setTypology=function( o){ if(!FormUtil.getValue(o)||FormUtil.getValue(o)=="default"||FormUtil.getValue(o)=="-1"){  FormUtil.setValue(o,"ADULT");}  for(var i=0,opt;(opt=o[i]);++i){if(opt.value=="-1"||opt.value=="default"){ o[i]=null;break;}}   var selectCard=document.getElementById(o.id+"_CARD");if(selectCard&&selectCard._CardManager){selectCard._CardManager.update();}  var selectResa=document.getElementById(o.id+"_FID_PROG");if(selectResa&&selectResa._CardManager){selectResa._CardManager.update();}}; PassengerManager.resetTypology=function( o){var defaultOptionIndex=-1; for(var i=0,opt;(opt=o[i]);++i){if(opt.value=="-1"||opt.value=="default"){defaultOptionIndex=i;break;}} if(defaultOptionIndex==-1){defaultOptionIndex=o.options.length; o.options[defaultOptionIndex]=new Option("-----------","-1");} o.selectedIndex=defaultOptionIndex;}; PassengerManager.i18nDef={};
PassengerManager.i18nDef.fr={filedLabel:"Nombre de passagers"};
function FidelityCardNumberManager(e,o){this.el=e;this.opt=o;var s=this;if(!o.referenceList||!o.defList){  return;}o.referenceList._FidelityCardNumberManager=this; this.prefix=document.createElement("span");this.prefix.className="prefix";this.el.parentNode.insertBefore(this.prefix,this.el); $.data(this.el,'_FidelityCardNumberManager',this); $(o.referenceList).bind("change",function(){s.update();});this.update();}FidelityCardNumberManager.prototype.update=function(){var s=this.opt.referenceList;var v=s.selectedIndex<0?"":this.opt.defList[s.options[s.selectedIndex].value];if(!v){ v="";}this.prefix.innerHTML=v;};
String.prototype.trim=function(){return this.replace(String._RE,"");};String.prototype.compareTo=function(v){if(this==v){return 0;}if(this>v){return 1;}return-1;};String._RE=/(^\s*)|(\s*$)/g;
function CardManager(e,o){this.el=e;this.opt=o;var s=this;if(!o.referenceList||!o.defList){  return;}this.el._CardManager=this; this.defaultOptions=[];this.texts=[];for(var j=0;j<e.options.length;++j){this.texts[e.options[j].value]=e.options[j].text;this.defaultOptions.push(e.options[j].value);} EventListener.patch(o.referenceList);o.referenceList.addEventListener("change",function(){s.update();s.updateDefaultFid();},false);EventListener.patch(this.el); this.update();}CardManager.prototype.update=function(){var l=this.opt.referenceList,s=this.el,defaultValue=l.options[l.selectedIndex].value;var v=this.opt.defList[defaultValue];var defaultNumberCard=null;if(!v){ v=this.defaultOptions;}var selectedValue=FormUtil.getValue(s); s.selectedIndex=-1; s.options.length=0; for(var i=0;i<v.length;++i){s.options[i]=new Option(this.texts[v[i]]||v[i],v[i]); if(v[i]==selectedValue){s.selectedIndex=i;}}if(s.options.length===0){ s.parentNode.style.visibility="hidden";}else{s.parentNode.style.visibility="visible";}    if(s._SelectManager){s._SelectManager.update();} };CardManager.prototype.updateDefaultFid=function(){ var l=this.opt.referenceList,s=this.el,defaultValue=l.options[l.selectedIndex].value;var defaultNumberCard=''; if(this.opt.defaultCardList){ var defaultCardValue=this.opt.defaultCardList[defaultValue];} if(this.opt.defaultCardNumberList){ defaultNumberCard=this.opt.defaultCardNumberList[defaultValue];} if(defaultCardValue){ for(var j=0;j<s.options.length;j++){if(s.options[j].value==defaultCardValue){s.selectedIndex=j;}}}if((defaultNumberCard)&&(defaultNumberCard!='default')){ s.parentNode.parentNode.getElementsByTagName("input")[0].value=defaultNumberCard;}  if(s._SelectManager){s._SelectManager.update();}};
function DefaultCardManager(e,o){this.el=e;this.opt=o;var s=this;if(!o.referenceList||!o.defList||!o.cardNumberInput){  return;} EventListener.patch(o.referenceList);o.referenceList.addEventListener("change",function(){s.update();},false);EventListener.patch(this.el); if(o.referenceList){this.update();}}DefaultCardManager.prototype.update=function(){ var refListe=this.opt.referenceList;var currentValue=refListe.options[refListe.selectedIndex].value; var defaultValue=0; var defListe=this.opt.defList;var currentIndex;  for(var j=0;j<this.el.length;j++){if(this.el[j].value==defListe[currentValue]){currentIndex=j;}} if(defListe[currentValue]){ if(this.el.selectedIndex===0){if(currentIndex){this.el.selectedIndex=currentIndex;}}}else{   if(this.el.selectedIndex>-1&&this.el[this.el.selectedIndex]&&this.el[this.el.selectedIndex].value=="4"&&this.opt.cardNumberInput.value===""){ this.el.selectedIndex=defaultValue;}}  var s=this.el;if(s._SelectManager){ s._SelectManager.update();}if(s._FidelityCardNumberManager){s._FidelityCardNumberManager.update();}};
function SmilesPartnerCardManager(o){o.onclick=function( e){e=Event._.patch(e); e.stopPropagation();var w=window.open(o.href,'Cofinoga','width=300,height=475,resizable=1,status=yes');try{w.focus();}catch(e){}return false;};}
function CityChoicePopupOpener(e,o){if(!o){o={};}this.el=e;this.opt=o;var t=o.target,s=this;if(!t){ return;}t._CityChoicePopupOpener=s;if(!o.container){o.container=e.parentNode;} if(typeof o.minlength!="number"){o.minlength=3;}EventListener.patch(e);e.addEventListener("click",function(evt){evt=Event._.patch(evt);evt.preventDefault();evt.stopPropagation();s.openPopup(e);return false;},false);function F(){s.update();}EventListener.patch(t);t.addEventListener("keyup",F,false);t.addEventListener("change",F,false);this.update();}CityChoicePopupOpener.prototype={openPopup:function(e){ if(!this.update()){ return;}var u=e,t=this.opt.target,x={width:600,height:400};if(!u){return;} var url=u+"\x26NOM_VILLE="+escape(t.value)+"\x26CIBLE="+t.name+"\x26NOM_FORM="+t.form.name;var args='width='+x.width+',height='+x.height+',resizable,scrollbars';var w=window.open(url,'Choix_de_la_ville',args);try{if(w){w.moveTo(Math.round((screen.width-x.width)/2),Math.round((screen.height-x.height)/2));w.focus();}else{ this.el.focus();}}catch(e){}},update:function(){var l=this.opt.target.value.length;if(l<this.opt.minlength){ClassNameUtil.add(this.el,"disabled");ClassNameUtil.remove(this.el,"enable");this.el.disabled=true;}else{ClassNameUtil.add(this.el,"enable");ClassNameUtil.remove(this.el,"disabled");this.el.disabled=false;}if(l===0){ ClassNameUtil.add(this.opt.container,"empty");ClassNameUtil.remove(this.opt.container,"notEmpty");}else{ClassNameUtil.add(this.opt.container,"notEmpty");ClassNameUtil.remove(this.opt.container,"empty");}return!this.el.disabled;}};
function ViaCityChoicePopupOpener(e,o){if(!o){o={};}this.el=e;this.opt=o;if(!o.target){return;}o.target._ViaCityChoicePopupOpener=this;var s=this;function F(){s.openPopup();}if(o.container){EventListener.patch(this.opt.container);o.container.addEventListener("click",function(evt){evt=Event._.patch(evt);evt.preventDefault();evt.stopPropagation();F();},false);}this.opt.target.readOnly=true;EventListener.patch(e);e.addEventListener("click",function(evt){evt=Event._.patch(evt);evt.preventDefault();evt.stopPropagation();F();},false);s.update();}ViaCityChoicePopupOpener.prototype={openPopup:function(){var u=document.getElementById('CM_D_viaCityChoicePopup').href;if(!u){return;}var w=window.open(u+"\x26NOM_VILLE="+this.opt.target.value+"\x26CIBLE="+this.opt.target.name+"\x26NOM_FORM="+this.opt.target.form.name+'\x26VIA=true','Choix_via','width=500,height=470,resizable');w.focus();}, update:function(){if(!this.opt.container){return;}if(this.opt.target.value.length===0){ClassNameUtil.add(this.opt.container,"empty");}else{ClassNameUtil.remove(this.opt.container,"empty");}}};
DisplayMaximilesMessage={update:function(){var o=DisplayMaximilesMessage.opt;var t=o.targetClassName,c=o.className;if(DisplayMaximilesMessage.check()){ClassNameUtil.add(t,c);}else{ClassNameUtil.remove(t,c);}},check:function(){var opt=DisplayMaximilesMessage.opt; var v=[],o;for(var i=0;(o=DisplayMaximilesMessage.list[i]);++i){v.push(FormUtil.getValue(o));} if(ArrayUtil.indexOf(v,opt.maximilesValue)!=-1){ for(var j=0;(o=opt.cardValues[j]);++j){if(ArrayUtil.indexOf(v,o)!=-1){return true;}}}return false;}, init:function(a,o){if(!o){ o={};}if(!a||!o.message||typeof o.maximilesValue!="string"||!o.cardValues||!o.targetClassName||!o.className){ return;}DisplayMaximilesMessage.opt=o;var e,l=[],r=o.cardNameRegexp;for(var i=0;(e=a[i]);++i){EventListener.patch(e);e.addEventListener("change",function(){DisplayMaximilesMessage.update();},false);if(!r||r.exec(e.id)){l.push(e);}} DisplayMaximilesMessage.list=l; DisplayMaximilesMessage.update();}};
function CityCompleter(el,o){if(!o.baseUrl||!o.saisieMin){ return;}if(el._CityCompleter){ return;}this.el=el;this.opt=o;this.el._CityCompleter=this;this.active=-1;this.url=o.baseUrl;this.input=$(el);this.ListId="divListe_"+$(el).attr("id");this.el.setAttribute("autocomplete","off");var s=this;$(el).keydown(function(e){switch(e.keyCode){case 38: e.preventDefault();s.moveSelect(-1);break;case 40: e.preventDefault();s.moveSelect(1);break;case 8: s.saisie=$(this).val().toUpperCase().substring(0,($(this).val().length-1));if($.trim(s.saisie).length>=o.saisieMin){s.getDatas();}else{s.hideList();}break;case 9: var value=$(this.divListe).find("li.over a").html();if(value){$(this).val(value);}s.hideList();break;case 27: s.hideList();break;case 13: if(s.active>=0){ $(this).val($(this.divListe).find("li.over a").html());s.hideList();s.keepControl(e);}break;default: var touche=String.fromCharCode(e.keyCode); ExprTest=/^[ A-Za-z]+$/; s.saisie=$(this).val().toUpperCase()+touche; if($.trim(s.saisie).length>=o.saisieMin&&ExprTest.exec(touche)){s.getDatas();}else{ s.hideList();}break;}});}CityCompleter.prototype.getDatas=function(){var s=this;s.datas="";$.ajax({url:s.makeUrl(),success:function(content){s.datas=content;s.showList();},error:function(req){s.hideList();}});};CityCompleter.prototype.hideList=function(){$("#"+this.ListId).css({display:"none"});$("#"+this.ListId).empty();this.showSelect();};CityCompleter.prototype.makeUrl=function(){var filePath="";var last=0;var separateur="/";var letter="";for(var i=0;i<this.saisie.length;i++){letter=this.saisie.substr(i,1);filePath+=letter+separateur;}var base="";if(this.opt.dynPathFromField){base=this.url+this.opt.dynPathFromField.value.toUpperCase()+"/";}else{base=this.url;}var str=base+filePath+letter+"_1.htm";str=str.replace(/ /g,"_"); return str;};CityCompleter.prototype.showList=function(){var s=this;if(!s.divListe){ s.createDiv();} $("#"+s.ListId).css({display:"block"}); s.divListe.innerHTML=this.formatDatas(this.datas); var links=$("a",s.divListe);links.click(function(a){s.input.val($(this).html());s.hideList();return false;}); s.active=-1; this.hideSelect();};CityCompleter.prototype.createDiv=function(fnCallBack){var s=this;var results=document.createElement("div");results.id=s.ListId;results.className="autocomplete";$("body").append(results);s.divListe=results;myInput=document.getElementById(s.input.attr("id"));var pos=this.getAbsolutePos(myInput);$(results).css({position:"absolute",top:(pos.y+myInput.offsetHeight)+"px",left:pos.x+"px",width:(myInput.offsetWidth-2)+"px"});};CityCompleter.prototype.getAbsolutePos=function(o){var curleft=o.offsetLeft||0;var curtop=o.offsetTop||0;while((o=o.offsetParent)){curleft+=o.offsetLeft;curtop+=o.offsetTop;}return{x:curleft,y:curtop};};CityCompleter.prototype.formatDatas=function(data){if(!data){return null;}var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){parsed[parsed.length]=row;}}var ul='\x3Cul class=\x22completeProposals\x22\x3E';var num=parsed.length;for(var j=0;j<num;j++){var ligne=parsed[j];if(!ligne){continue;}ul=ul+'\x3Cli\x3E\x3Ca href=\x22#\x22\x3E'+ligne+'\x3C/a\x3E\x3C/li\x3E';}return ul+"\x3C/ul\x3E";};CityCompleter.prototype.keepControl=function(e){e.preventDefault();e.stopPropagation();};CityCompleter.prototype.moveSelect=function(step){var lis=$("li",this.divListe);if(!lis){return;}this.active+=step;var active=this.active;if(active<0){active=0;}else if(active>=lis.size()){active=lis.size()-1;}lis.removeClass("over");$(lis[active]).addClass("over");};CityCompleter.prototype.hideSelect=function(step){ if($.browser.msie&&($.browser.version<7)){$("select").each(function(){$(this).addClass("hideie6");});}};CityCompleter.prototype.showSelect=function(step){ if($.browser.msie&&($.browser.version<7)){$("select").each(function(){$(this).removeClass("hideie6");});}};
function CityCompleter(el,o){if(!o.baseUrl||!o.saisieMin){ return;}if(el._CityCompleter){ return;}this.el=el;this.opt=o;this.active=-1;this.url=o.baseUrl;this.input=$(el);this.ListId="divListe_"+$(el).attr("id");this.el.setAttribute("autocomplete","off");$.data(this.el,'_CityCompleter',this);var s=this;$(el).keydown(function(e){switch(e.keyCode){case 38: e.preventDefault();s.moveSelect(-1);break;case 40: e.preventDefault();s.moveSelect(1);break;case 8: s.saisie=$(this).val().toUpperCase().substring(0,($(this).val().length-1));if($.trim(s.saisie).length>=o.saisieMin){s.getDatas();}else{s.hideList();}break;case 9: var value=$(this.divListe).find("li.over a").html();if(value){$(this).val(value);}s.hideList();break;case 27: s.hideList();break;case 13: if(s.active>=0){ $(this).val($(this.divListe).find("li.over a").html());s.hideList();s.keepControl(e);}break;default: var touche=String.fromCharCode(e.keyCode); ExprTest=/^[ A-Za-z]+$/; s.saisie=$(this).val().toUpperCase()+touche; if($.trim(s.saisie).length>=o.saisieMin&&ExprTest.exec(touche)){s.getDatas();}else{ s.hideList();}break;}});}CityCompleter.prototype.getDatas=function(){var s=this;s.datas="";$.ajax({url:s.makeUrl(),success:function(content){s.datas=content;s.showList();},error:function(req){s.hideList();}});};CityCompleter.prototype.hideList=function(){$("#"+this.ListId).css({display:"none"});$("#"+this.ListId).empty();this.showSelect();};CityCompleter.prototype.makeUrl=function(){var filePath="";var last=0;var separateur="/";var letter="";for(var i=0;i<this.saisie.length;i++){letter=this.saisie.substr(i,1);filePath+=letter+separateur;}var base="";if(this.opt.dynPathFromField){base=this.url+this.opt.dynPathFromField.value.toUpperCase()+"/";}else{base=this.url;}var str=base+filePath+letter+"_1.htm";str=str.replace(/ /g,"_"); return str;};CityCompleter.prototype.showList=function(){var s=this;if(!s.divListe){ s.createDiv();} $("#"+s.ListId).css({display:"block"}); s.divListe.innerHTML=this.formatDatas(this.datas); var links=$("a",s.divListe);links.click(function(a){s.input.val($(this).html());s.hideList();return false;}); s.active=-1; this.hideSelect();};CityCompleter.prototype.createDiv=function(fnCallBack){var s=this;var results=document.createElement("div");results.id=s.ListId;results.className="autocomplete";$("body").append(results);s.divListe=results;myInput=document.getElementById(s.input.attr("id"));var pos=this.getAbsolutePos(myInput);$(results).css({position:"absolute",top:(pos.y+myInput.offsetHeight)+"px",left:pos.x+"px",width:(myInput.offsetWidth-2)+"px"});};CityCompleter.prototype.getAbsolutePos=function(o){var curleft=o.offsetLeft||0;var curtop=o.offsetTop||0;while((o=o.offsetParent)){curleft+=o.offsetLeft;curtop+=o.offsetTop;}return{x:curleft,y:curtop};};CityCompleter.prototype.formatDatas=function(data){if(!data){return null;}var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){parsed[parsed.length]=row;}}var ul='\x3Cul class=\x22completeProposals\x22\x3E';var num=parsed.length;for(var j=0;j<num;j++){var ligne=parsed[j];if(!ligne){continue;}ul=ul+'\x3Cli\x3E\x3Ca href=\x22#\x22\x3E'+ligne+'\x3C/a\x3E\x3C/li\x3E';}return ul+"\x3C/ul\x3E";};CityCompleter.prototype.keepControl=function(e){e.preventDefault();e.stopPropagation();};CityCompleter.prototype.moveSelect=function(step){var lis=$("li",this.divListe);if(!lis){return;}this.active+=step;var active=this.active;if(active<0){active=0;}else if(active>=lis.size()){active=lis.size()-1;}lis.removeClass("over");$(lis[active]).addClass("over");};CityCompleter.prototype.hideSelect=function(step){ if($.browser.msie&&($.browser.version<7)){$("select").each(function(){$(this).addClass("hideie6");});}};CityCompleter.prototype.showSelect=function(step){ if($.browser.msie&&($.browser.version<7)){$("select").each(function(){$(this).removeClass("hideie6");});}};
var p_journeyQuotation={STATIC:{ getPassengerFieldset:function(o){var p=o.parentNode;while(p&&p.tagName.toLowerCase()!="fieldset"){p=p.parentNode;}return p;}, getCardDef:function(D){var d={};for(var typo in D){var v=[],a=D[typo];if(a){for(var i=0;i<a.length;++i){v.push(a[i].id);}}d[typo]=v;}return d;}, getDefaultCardDef:function(T){var d={},D=document.companionsInit;for(var typo in D){var v=[],a=D[typo][T];if(a){for(var i=0;i<a.length;++i){v.push(a[i]);}}d[typo]=v;}return d;}, getDefaultFidelityMap:function(D){return{"ESCA":"4","YOUNG":"4","SENIO":"4","CHILD":"4"};}},uiDef:{starter:"l_foot",selectors:{ "#d_wayType":function(o){ var DIRECT_TRAVEL_YES=document.getElementById("DIRECT_TRAVEL_YES");var saisie=document.getElementById("saisie");var via_city_rr_code_hidden=document.getElementById("VIA_CITY_RR_CODE");var via_city=document.getElementById("VIA_CITY");   $("input#DIRECT_TRAVEL_YES").bind('click',function(aEvent){if($("input#DIRECT_TRAVEL_YES").attr("checked")){$("form#saisie").addClass("wayType_direct");via_city_rr_code_hidden.value=""; via_city.value="";}else{$("form#saisie").removeClass("wayType_direct");}      });}, "#d_passengers":function(o){new PassengerManager(o,{typologyNameRegExp:/^PASSENGER_\d+$/});},"#d_passengers p.d_typology select":function(o){new SelectManager(o,{prefixValue:"typology"});}, "#d_passengers p.d_commercialAdvantageCard select":function(o){   new SelectManager(o,{prefixValue:"commercialAdvantageCard",container:p_journeyQuotation.STATIC.getPassengerFieldset(o)});  new CardManager(o,{referenceList:o.parentNode.parentNode.parentNode.getElementsByTagName("select")[0],defList:p_journeyQuotation.STATIC.getCardDef(document.JSON_commercialCardMapByTypology),defaultCardList:p_journeyQuotation.STATIC.getDefaultCardDef('ADVANTAGE')});},   "#d_passengers p.d_fidelityAdvantageCardNumber input":function(o){new FidelityCardNumberManager(o,{referenceList:o.parentNode.parentNode.parentNode.getElementsByTagName("select")[2],defList:document.JSON_fidelityPrefixMap});}, "#d_passengers p.d_fidelityAdvantageCard select":function(o){   new SelectManager(o,{prefixValue:"fidelityAdvantageCard",container:p_journeyQuotation.STATIC.getPassengerFieldset(o)});new CardManager(o,{referenceList:o.parentNode.parentNode.parentNode.getElementsByTagName("select")[0],defList:p_journeyQuotation.STATIC.getCardDef(document.JSON_fidelitiesCardMapByTypology),defaultCardList:p_journeyQuotation.STATIC.getDefaultCardDef('FIDELITY'),defaultCardNumberList:p_journeyQuotation.STATIC.getDefaultCardDef('FIDELITY_NUMBER')});new DefaultCardManager(o,{referenceList:o.parentNode.parentNode.parentNode.getElementsByTagName("select")[1],defList:p_journeyQuotation.STATIC.getDefaultFidelityMap(document.JSON_advantageToFidelityMap),cardNumberInput:o.parentNode.parentNode.getElementsByTagName("input")[0]});},"#d_passengers div.d_smilesPartenaire a":function(o){new SmilesPartnerCardManager(o);},"#OUTWARD_DATE":function(o){p_journeyQuotation.STATIC.outwardDate=o;p_journeyQuotation.STATIC.outwardDatePicker=new DatePicker(o,{showDay:true});}, "#INWARD_DATE":function(o){EventListener.patch(o);var d=new DatePicker(o,{showDay:true});d.addEventListener("beforeshow",function(){var S=p_journeyQuotation.STATIC;if(!S.outwardDate||!S.outwardDatePicker){return;} var date=S.outwardDatePicker.df.parse(S.outwardDate.value);this.dateToShow=date;},false);o.addEventListener("blur",function(){var trajet=document.forms.saisie.elements.TRAVEL_TYPE;if(o.value!==""){ FormUtil.setValue(trajet,"AR");}else{ FormUtil.setValue(trajet,"AS");}},true);},"#TRAVEL_TYPE_AS, #TRAVEL_TYPE_AR":function(o){  o.onclick=o.onchange=o.onfocus=function(){if(o.value==="AS"){var dateRetour=document.getElementById("INWARD_DATE");dateRetour.value="";}};}, "#ORIGIN_CITY, #DESTINATION_CITY, #VIA_CITY":function(o){o.onchange=function(){var rr_code_hidden=document.getElementById(o.id+"_RR_CODE");rr_code_hidden.value="";};}, "#ORIGIN_CITY, #DESTINATION_CITY, #VIA_CITY":function(o){if(!$("body").hasClass("agency_RATH")&&!$("body").hasClass("agency_RATH2")){new autoComplete("#ORIGIN_CITY, #DESTINATION_CITY, #VIA_CITY");}   }, "#CM_D_originCityChoicePopup,#ORIGIN_CITY":function(o,a){new CityChoicePopupOpener(a[0],{target:a[1]});return false;}, "#CM_D_destinationCityChoicePopup,#DESTINATION_CITY":function(o,a){new CityChoicePopupOpener(a[0],{target:a[1]});return false;}, "#CM_D_viaCityChoicePopup,#VIA_CITY":function(o,a){new ViaCityChoicePopupOpener(a[0],{target:a[1],container:a[0].parentNode.parentNode});return false;},"#d_passengers fieldset select":function(o,a){DisplayMaximilesMessage.init(a,{message:document.getElementById("Msg_ProgFidelite_SmilesvsMaximiles"),maximilesValue:'0',cardNameRegexp:/^PASSENGER_\d+(_CARD)|(_FID_PROG)/,cardValues:['YOUNG','CHILD','SENIO','ESCA','3','4','5'],targetClassName:o.form,className:'displayMaximilesMessage'});return false;},"#fm_userAccount":function(o){ o._mode="full";}, "#FCE_RADIO_true":function(o){ document.getElementById("FCE_NUM").setAttribute("disabled","disabled");ClassNameUtil.add(document.getElementById("fi_FCE_NUM"),"disabled");o.onclick=function(){for(var i=0;i<document.getElementsByTagName("fieldset").length;i++){ClassNameUtil.add(document.getElementsByTagName("fieldset")[i],"commercialAdvantageCard_FCE");} document.getElementById("FCE_NUM").removeAttribute("disabled");ClassNameUtil.remove(document.getElementById("fi_FCE_NUM"),"disabled");};if(o.checked===true){o.click();}  if(document.getElementById("FCE_NUM").value!==""){ o.click(); var passFields=document.getElementById('d_passengers').getElementsByTagName('fieldset');var arrayNodes=new Array(); for(i=0;i<document.getElementById('nbPassengersForTravel').value;i++){var pBalise=passFields[i].getElementsByTagName('p'); for(j=0;j<pBalise.length;j++){if(ClassNameUtil.contains(pBalise[j],'d_fcePassentBEName')){for(k=0;k<pBalise[j].childNodes.length;k++){if(pBalise[j].childNodes[k].nodeName==="LABEL"||pBalise[j].childNodes[k].nodeName==="INPUT"){arrayNodes.push(pBalise[j].childNodes[k]);}}}}}for(l=0;l<arrayNodes.length;l+=2){if(arrayNodes[l+1].value==='')ClassNameUtil.add(arrayNodes[l],'alert');}}},"#FCE_RADIO_false":function(o){o.onclick=function(){for(i=0;i<document.getElementsByTagName("fieldset").length;i++){ClassNameUtil.remove(document.getElementsByTagName("fieldset")[i],"commercialAdvantageCard_FCE");} document.getElementById("FCE_NUM").setAttribute("disabled","disabled");ClassNameUtil.add(document.getElementById("fi_FCE_NUM"),"disabled");for(i=0;i<6;i++){var carte=document.getElementById("PASSENGER_"+(i+1)+"_FID_PROG");carte.onchange();}};},"#d_passengers fieldset .d_fidelityAdvantage select":function(o,a){o.onchange=function(){var numPax=o.id.substring(10,11)-1;if(o.value==5){if(document.getElementsByTagName("fieldset").length>numPax){ClassNameUtil.add(document.getElementsByTagName("fieldset")[numPax],"commercialAdvantageCard_FCE");}}else{if(document.getElementsByTagName("fieldset").length>numPax&&document.getElementById("FCE_NUM").disabled){ClassNameUtil.remove(document.getElementsByTagName("fieldset")[numPax],"commercialAdvantageCard_FCE");}}};o.onchange();}}}};uiBuilder.register(p_journeyQuotation.uiDef);

