var EXANIMO=EXANIMO||{};(function(){EXANIMO.managers=EXANIMO.managers||{};var _1=false;var _2;var _3;var _4;var _5;var _6=false;var _7="EXANIMO-managers-StateManager-iFrame";var _e;function _self(){return EXANIMO.managers.StateManager;}var _9=navigator.appName.indexOf("Microsoft Internet")!=-1?"IFRAME":navigator.userAgent.indexOf("Safari")!=-1?"LINK":"HASH";function _getStateID(){return document.location.href.split("#")[1]||_self().defaultStateID;}function _getSWF(){var _a=["object","embed"];for(var i=0;i<_a.length;i++){var a=document.getElementsByTagName(_a[i]);for(var j=0;j<a.length;j++){if(a[j].dispatchStateChangeEvents){return a[j];}}}}function _dispatchEvent(_e,_f){_e=_e||_self().defaultStateID;if(!_4){_e={id:_e};var f;if(f=_self().onstatechange){_e.type="stateChange";f(_e);}if(_f){if(f=_self().onstateset){_e.type="stateSet";f(_e);}}else{if(f=_self().onstaterevisit){_e.type="stateRevisit";f(_e);}}_e=null;}else{if(!_f){_4.dispatchStateChangeEvents(_e);}}}var _11=(function(){switch(_9){case "HASH":return function(_12){document.location.hash=_12==_self().defaultStateID?"#":_12;_5=_12;};case "IFRAME":return function(_13){_6=true;var _14=document.getElementById(_7);frames[_7].document.open();frames[_7].document.write("<script>parent.document.location.hash = \""+(_13==_self().defaultStateID?"#":_13)+"\"; /* Wait for IE to impose its title before setting ours. */ setTimeout( function(){ parent.EXANIMO.managers.StateManager._updateIFrame(\""+_13+"\"); }, 0);</script>");frames[_7].document.close();};case "LINK":return function(_15){_6=true;var a=document.createElement("a");a.setAttribute("href",_15==_self().defaultStateID?"#":"#"+_15);var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);a.dispatchEvent(evt);document.location.EXANIMO.managers.StateManager.stateList.push(_15);};}})();EXANIMO.managers.StateManager={CHECK_RATE:100,onstatechange:null,onstateset:null,onstaterevisit:null,DEFAULT_STATE:"accueil",defaultStateID:"accueil",initialize:function(swf){if(_1){return;}_1=true;_4=swf==true?_getSWF():swf;switch(_9){case "HASH":_5=_getStateID()==_self().defaultStateID?_self().defaultStateID:null;var _19=function(){var _1a=_getStateID();if(_1a!=_5){_5=_1a;_dispatchEvent(_1a);}};_2=setInterval(_19,_self().CHECK_RATE);break;case "IFRAME":_6=true;var _1b=document.createElement("iframe");_1b.setAttribute("src","about:blank");_1b.setAttribute("name",_7);_1b.setAttribute("id",_7);_1b.style.visibility="hidden";_1b.style.width="0";_1b.style.height="0";_1b.style.position="absolute";_1b.style.overflow="hidden";document.body.appendChild(_1b);var _1c=_getStateID();if(_1c!=_self().defaultStateID){setTimeout(function(){_dispatchEvent(_1c);},0);}frames[_7].document.open();if(_1c){frames[_7].document.write("<script>parent.document.location.hash = \""+(_1c==_self().defaultStateID?"":_1c)+"\"; parent.EXANIMO.managers.StateManager._updateIFrame(\""+_1c+"\");</script>");}else{frames[_7].document.write("<script>parent.document.location.hash = \"\"; parent.EXANIMO.managers.StateManager._updateIFrame();</script>");}frames[_7].document.close();break;case "LINK":document.location.EXANIMO=document.location.EXANIMO||{};document.location.EXANIMO.managers=document.location.EXANIMO.managers||{};document.location.EXANIMO.managers.StateManager=document.location.EXANIMO.managers.StateManager||{};var loc=document.location.EXANIMO.managers.StateManager;window.onunload=function(){loc.oldHistoryLength=-1;};if(loc.deepLink&&loc.deepLink!=_self().defaultStateID){loc.oldHistoryLength=-1;loc.deepLink=null;}if(typeof loc.stateList=="undefined"){loc.stateList=[_getStateID()||_self().defaultStateID];loc.deepLink=loc.stateList[0];loc.offset=history.length-1;while(loc.offset){loc.stateList.unshift(null);loc.offset--;}delete loc.offset;loc.oldHistoryLength=document.location.hash?-1:history.length;}var _1e=function(){var loc=document.location.EXANIMO.managers.StateManager;if(_6){_6=false;loc.oldHistoryLength=history.length;return;}if(history.length!=loc.oldHistoryLength){var _20=loc.stateList[history.length-1];_dispatchEvent(_20);loc.oldHistoryLength=history.length;}};_2=setInterval(_1e,_self().CHECK_RATE);break;}},setState:function(_21,_22){if(_22){_self().setTitle(_22);}if(_e){return;}_11(_21);_dispatchEvent(_21,true);},setTitle:function(_23){window.document.title=_23||" ";},_updateIFrame:function(_24){if(!_6){_dispatchEvent(_24);}_6=false;}};})();