try{if(typeof($)=='undefined'&&window.parent!=null&&typeof(window.parent.$)!='undefined'){$=window.parent.$;}if(typeof(gFramework)=='undefined'){var gFramework={};if(typeof(uiInit)!='undefined'){gFramework=uiInit;}else if(opener!=null&&typeof(opener)!='undefined'){$=opener.$;gFramework=opener.uiInit||opener.uiBuilder;}else if(typeof(uiBuilder)!='undefined'){gFramework=uiBuilder;}}}catch(_ex){alert('No framework initialized');}
var StringUtil={R:[34,38,60,62],stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'');},escapeHTML:function(v){for(var i=0;i<StringUtil.R.length;++i){var r=StringUtil.R[i];v=v.replace(String.fromCharCode(r),"\x26#"+r+";");}return vv;},trimString:function(string){if(string&&typeof(string)=='string'||typeof(string)=='Number'){return jQuery.trim(string);}else{return string;}}};
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;
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 Session=(function(){ function _(d){if(!d){d=document;}this.el=d;this.el._Session=this;}return _;})();Session.prototype={ getAttribute:function(k,d){var c=this.el.cookie;if(!c){return d;}c=c.split(";");k=escape(k);for(var i=0;i<c.length;++i){var p=c[i].split("=");if(p.length>1&&k==p[0].trim()){return unescape(p[1].trim());}}return d;}, setAttribute:function(k,v,o){var a=[];if(v===null||typeof(v)=="undefined"){v="";}a.push(escape(k)+"="+escape(v+""));  var e,p,d;if(o){e=o.expires;p=o.path;d=o.domain;if(o.persist){e=Session.PERSIST;}if(o.secure){a.push("secure");}}if(e){if(typeof(e)!="Date"){e=new Date(e);}a.push("expires="+e.toGMTString());}if(p){a.push("path="+p);}else{a.push("path=/");}if(d){a.push("domain="+d);}this.el.cookie=a.join("; ");},removeAttribute:function(k,o){if(!o){o=[];}o.expires=Session.EXPIRE;this.setAttribute(k,null,o);}, getAttributeNames:function(){var t=this.el.cookie.split(";"),r=[];for(var i=0;i<t.length;++i){var v=t[i].split("=");r.push(unescape(v[0].trim()));}return r;},check:function(){this.setAttribute(Session.CHECKKEY,"test");if(this.getAttribute(Session.CHECKKEY)!="test"){return false;}this.removeAttribute(Session.CHECKKEY);return true;}};Session.CHECKKEY="__js_Session_test_cookie";Session.EXPIRE=new Date(1);Session.PERSIST=new Date(2105,1,1,1,1,1);var session=new Session(document);
document.site=gFramework.getSite();switch(document.site){case "leisure":document.write('\x3Cscript type=\x22text/javascript\x22 src=\x22/design/commons/js/lib/market/s_code.js\x22\x3E\x3C/script\x3E');break;case "europe":document.write('\x3Cscript type=\x22text/javascript\x22 src=\x22/design/europe/js/page/commons/s_code.js\x22\x3E\x3C/script\x3E');break;default:document.write('\x3Cscript type=\x22text/javascript\x22 src=\x22/design/commons/js/lib/market/s_code.js\x22\x3E\x3C/script\x3E');break;}function Omniture( e, o){if(!o||!o.taggingDef){return;}this.el=e;this.omnitureTag=s;this.taggingDef=o.taggingDef;var _Option={elem:this.el,omnitureTag:this.omnitureTag,taggingDef:this.taggingDef};var _Omniture=new $.Omniture(_Option);_Omniture.fillTag();};$.Omniture=function(aOptions){this.el=aOptions.elem;this.omnitureTag=aOptions.omnitureTag;this.taggingDef=aOptions.taggingDef;};$.Omniture.prototype={fillTag:function(){var currentPage=this.taggingDef,s=this.omnitureTag; var site=uiInit.getSite(); var agency="VSC";if(site=="europe"){currentPage.espace=uiInit.getCountry();agency="VSCE";} s.prop19=I18N.getLang();s.currencyCode="EUR";s.account=s_account;s.server=window.location.hostName;s.pageName=currentPage.pageName;s.channel=currentPage.espace;s.linkInternalFilters="javascript:,voyages-sncf.com,voyage-sncf.com,media.expedia.com,sncf.expediacustomer.com,voyages.sncf.fr,voyages-sncf.fr,tgv-europe,voyages-sncf-et-vous.com";s.prop1=currentPage.departement;s.prop2=currentPage.rubrique;s.prop3=currentPage.typePage;s.prop4=s.prop1+":"+s.prop3;if(currentPage.espace==="Pro"){s.prop5="Pro:Train";}else{s.prop5="Train";}s.prop6=s.prop5+":"+s.prop3; if(document.location.href.indexOf("promos")>0===true){s.prop7="Ope:"+s.pageName;} s.hier1=[agency,s.channel,s.prop1,s.prop2,s.pageName].join(","); if(currentPage.beforeinit){currentPage.beforeinit(this);} var refId=s.getQueryParam("rfrr");if(!refId&&session.getAttribute("rfrr",false)){refId=session.getAttribute("rfrr","");s.prop8=s.eVar3=s.pageName+":"+refId;session.removeAttribute("rfrr");}if(refId!==""){s.prop8=s.eVar3=s.pageName+":"+refId;}else{s.prop8=s.eVar3=s.pageName+":novalue";}  s.eVar1=s.getQueryParam("autp"); s.eVar2=s.getQueryParam("crse"); s.campaign=s.getQueryParam("prex"); s.eVar4=s.prop20=session.getAttribute("userProfilCampagne","");  if(currentPage.init){currentPage.init(this);} try{ var s_code=s.t();if(s_code){ var d=document.createElement("div");d.innerHTML=s_code;document.body.appendCHild(d);}}catch(e){};}};$.Omniture.getProperties=function(){ var pagePath=uiInit.getPagePath(),def=null;if(pagePath){pagePath=uiInit.getPagePath().split("/");pagePath.push(""); while(!def&&pagePath.length>0){pagePath.pop();def=$.data(document,'taggingPagesProperties')[pagePath.join("/")];}pagePath=pagePath.join("/");}else if(document.getElementsByTagName("body")[0].id){ def=$.data(document,'taggingPagesProperties')[document.getElementsByTagName("body")[0].id];}else if(typeof(OAS_sitepage)!="undefined"){ pagePath=OAS_sitepage;def=$.data(document,'taggingPagesProperties')[pagePath];}if(typeof(def)!='undefined'&&typeof(def.taggingDef)!='undefined'){return def;} return false;}; Omniture.Interface={STATIC:{getRfrr:function(o){var F=Omniture.Interface.STATIC;var rfrr=s.pageName+"_"+F.getLinkPosition(o)+"_"+F.getLinkContent(o);return encodeURIComponent(rfrr);},pageBlocks:{  defaut:"body",l_head:"header",l_foot:"footer",l_body:"body",l_menu:"ColonneA",l_menucontext:"ColonneC"},getLinkPosition:function(o){  var positions=Omniture.Interface.STATIC.pageBlocks;var position=positions.defaut;var e=o;while(e.parentNode){if(e.parentNode.id){for(var id in positions){if(e.parentNode.id==id){position=positions[id];return(position);}}}e=e.parentNode;}return(position);},getLinkContent:function(o){var content=o.innerHTML;content=StringUtil.trimString(content);if(o.childNodes[0].nodeType==1){switch(o.childNodes[0].tagName){case "IMG":content=o.childNodes[0].alt;break;default:content=o.childNodes[0].innerHTML;content=StringUtil.trimString(content);break;}}return content;},addCookieOmniture:function(){ var lien=new Request(window.location.href);if(lien.getParameter("rfrr")){var expiration=new Date();var uneHeure=expiration.getTime()+(3*60*60*1000);expiration.setTime(uneHeure);session.setAttribute("rfrr",lien.getParameter("rfrr"),{expires:expiration.toGMTString()});}},addToCartOmniture:function(){AjoutPanier(this,s.prop9,s.prop9+":"+s.prop10+":"+s.prop12);}},uiDef:{"a":function(o){if(o.href.toLowerCase().indexOf("javascript")==-1&&o.href.indexOf("rfrr")==-1&&o.href.indexOf("#")==-1&&o.className.indexOf("ToolTip")==-1){if((typeof(s.pageName)!=="undefined")&&o.innerHTML){var saveInner=o.innerHTML; o.href=o.href+((o.href.indexOf('?')>0)?"\x26":"?")+"rfrr="+Omniture.Interface.STATIC.getRfrr(o);o.innerHTML=saveInner;$(o).bind("click",function(aEvent){Omniture.Interface.STATIC.addCookieOmniture(aEvent);});}}},"#p_outwardProposals p.travelToChoose input,#p_inwardProposals p.travelToChoose input":function(o){$(o).bind("click",function(){Omniture.Interface.STATIC.addToCartOmniture();});},"#d_crossSell a, #p_confirmation a.lktxtplus":function(o){var lien=new Request(o.href);if(lien.getParameter("_CMD")){var cmd=lien.getParameter("_CMD");var crse="";if(cmd=="cmdXSellHotelAdv"||cmd=="cmdXSellHotel"){crse="Hotel,"+s.pageName;}if(cmd=="cmdXSellCar"){crse="Car,"+s.pageName;}o.href=o.href+"\x26crse="+crse;}}}};uiInit.register(Omniture.Interface.uiDef); function applyParam(obj,param1,param2){var urlLink=obj;var urlCurrent=window.location.href;if(urlLink.indexOf('?',0)==-1){urlLink+="?rfrr=";if(urlCurrent.indexOf('/leisure/fr/launch/home/',0)!=-1){urlLink+=param1;}else{urlLink+=param2;}}else{var urlParam=urlLink.slice(urlLink.indexOf('?',0)+1,urlLink.length);urlLink=urlLink.slice(0,urlLink.indexOf('?',0)+1);var paramToSplit=new Array();paramToSplit=urlParam.split("\x26");for(n=0;n<paramToSplit.length;n++){if(paramToSplit[n].slice(0,4)=='rfrr'){urlLink+="rfrr=";if(urlCurrent.indexOf('/leisure/fr/launch/home/',0)!=-1){urlLink+=param1;}else{urlLink+=param2;}}else{urlLink+=paramToSplit[n];}if((n+1)<paramToSplit.length){urlLink+="\x26";}}}window.location.href=urlLink;}

