var dimensions = {}; var openedSection = -1; // none opened so far var sliderState = -1; // None set, so feed on slider.getAttribute("state"); var heightFix = 0; var shareWindow = ''; var VP_currentPage = 1; reloadDimensions(); function reloadDimensions() { if(window.screenLeft) { //IE dimensions.getWindowX = window.screenLeft; dimensions.getWindowY = window.screenTop; heightFix = 0; } else if(window.screenX) { //Firefox dimensions.getWindowX = window.screenX; dimensions.getWindowY = window.screenY; heightFix = 4; } if(window.innerWidth) { //!IE dimensions.getViewportWidth = window.innerWidth; dimensions.getViewportHeight = window.innerHeight; dimensions.getHorizontalScroll = window.pageXOffset; dimensions.getVerticalScroll = window.pageYOffset; } else if (document.documentElement && document.documentElement.clientWidth) { //IE 6 with DOCTYPE dimensions.getViewportWidth = document.documentElement.clientWidth; dimensions.getViewportHeight = document.documentElement.clientHeight; dimensions.getHorizontalScroll = document.documentElement.scrollLeft; dimensions.getVerticalScroll = document.documentElement.scrollTop; } else if (document.documentElement && document.documentElement.clientWidth) { //IE 6 sans DOCTYPE dimensions.getViewportWidth = document.body.clientWidth; dimensions.getViewportHeight = document.body.clientHeight; dimensions.getHorizontalScroll = document.body.scrollLeft; dimensions.getVerticalScroll = document.body.scrollTop; } if(document.documentElement && document.documentElement.scrollWidth) { dimensions.getDocumentWidth = document.documentElement.scrollWidth; dimensions.getDocumentHeight = document.documentElement.scrollHeight; } else if (document.body.scrollWidth) { dimensions.getDocumentWidth = document.body.scrollWidth; dimensions.getDocumentHeight = document.body.scrollHeight; } } function openFull(p,n) { var r = null; r = window.open(p,n,'width='+screen.width+',height='+screen.height+',top='+0+',left='+0+','+'scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no'); if(r!=null && window.focus) r.window.focus(); } function openSlider(forceSection, keepOpen) { var slider = document.getElementById('extra_window'); var orientation = slider.getAttribute("orientation"); var opening = false; if (forceSection != undefined && forceSection != openedSection) keepOpen= true; var newSize= '21px'; if (sliderState == "close" || keepOpen != undefined) { newSize= slider.getAttribute('maxwidth') + 'px'; opening = true; } if (orientation == "left" || orientation == "right") { slider.style.width = newSize; } else if (orientation == "bottom") { slider.style.height = newSize; } if (opening) {// lets show one section; sliderState = "open"; showSliderSection(forceSection); } else { // It's closing sliderState = "close"; showSliderSection(openedSection, true); } document.getElementById('close_slider').style.visibility = sliderState == 'close' ? 'hidden' : 'visible'; } function showSliderSection(forceSection, hideAll) { var index = 0; if (forceSection == undefined) { if (openedSection == -1) openedSection = 0; } else openedSection = forceSection; var slider = document.getElementById('slider_' + index); var extraframe= document.getElementById('extra_window'); extraframe.setAttribute("state", sliderState); while (slider != undefined) { if (hideAll == true || index != openedSection) slider.style.display = "none"; else { slider.style.display = 'block'; var newSize= (extraframe.getAttribute('maxwidth') - 21) + 'px'; if (extraframe.getAttribute('orientation') == 'left' || extraframe.getAttribute('orientation') == 'right') slider.style.width= newSize; else slider.style.height= newSize; } index++; var slider = document.getElementById('slider_' + index); } } function resizeContainer() { reloadDimensions(); var height = dimensions.getViewportHeight; var width = dimensions.getViewportWidth; var container = document.getElementById("core"); var left = document.getElementById("left_panel"); var right = document.getElementById("right_panel"); var bottom = document.getElementById("bottom_panel"); var top = document.getElementById("top_panel"); if (top != undefined) { top.style.height= top.getAttribute("maxwidth") + "px"; height = height - parseInt(top.getAttribute("maxwidth")); } if (bottom != undefined) { bottom.style.height= bottom.getAttribute("maxwidth") + "px"; height = height - parseInt(bottom.getAttribute("maxwidth")); } if (left != undefined) { left.style.width= left.getAttribute("maxwidth") + "px"; width = width - parseInt(left.getAttribute("maxwidth")); } if (right != undefined) { right.style.width= right.getAttribute("maxwidth") + "px"; width = width - parseInt(right.getAttribute("maxwidth")); } container.style.width= width + 'px'; container.style.height= height + 'px'; } function resizePanel() { reloadDimensions(); hideScrollbar(); var height = dimensions.getViewportHeight; var width = dimensions.getViewportWidth; var content = document.getElementById("content_td"); var left = document.getElementById("left_panel"); var right = document.getElementById("right_panel"); var bottom = document.getElementById("bottom_panel"); var top = document.getElementById("top_panel"); var panelsHeight= height; if (bottom != undefined) { bottom.style.height= bottom.getAttribute("maxwidth") + "px"; height = height - parseInt(bottom.getAttribute("maxwidth")); bottom.style.overflow= "hidden"; } if (top != undefined) { var topHeight = parseInt(top.getAttribute("maxwidth")); top.style.height= topHeight + "px"; height = height - topHeight; top.style.overflow= "hidden"; } if (document.getElementById("internal").value == "1") { panelsHeight= height; } if (left != undefined) { left.style.height = panelsHeight + "px"; width= width - parseInt(left.getAttribute("maxwidth")); document.getElementById("left_td").style.verticalAlign="top"; document.getElementById("left_td").removeAttribute('height'); left.style.overflow = "hidden"; } if (right != undefined) { right.style.height = panelsHeight + "px"; width= width - parseInt(right.getAttribute("maxwidth")); document.getElementById("right_td").style.verticalAlign="top"; document.getElementById("right_td").removeAttribute('height'); right.style.overflow = "hidden"; } content.style.height= height + 'px'; content.style.width= width + 'px'; if(document.getElementById("shopping") != undefined) document.getElementById("shopping").scrolling = "no"; } function resizeSlider() { if (document.getElementById("extra_window")) { reloadDimensions(); var height = dimensions.getViewportHeight - 40; var width = dimensions.getViewportWidth; var slider = document.getElementById('extra_window'); var orientation = slider.getAttribute("orientation"); if (orientation == "left" || orientation == "right") slider.style.height = height + 'px'; if (slider.getAttribute("state") == "open") openSlider(undefined, true); //slider.style.display = ""; } } /*function resizeSlider() { reloadDimensions(); hideScrollbar(); var height = dimensions.getViewportHeight - 40; var width = dimensions.getViewportWidth; var slider = document.getElementById('extra_window'); var orientation = slider.getAttribute("orientation"); slider.style.display = "none"; if (orientation == "left" || orientation == "right") { slider.style.height = height + 'px'; } else { slider.style.height = "21px"; slider.style.width = width + "px"; } if (orientation == "right") { //alert(dimensions.getViewportWidth); slider.style.left = (dimensions.getDocumentWidth - 21) + "px"; } else if (orientation== "bottom") { slider.style.top = (dimensions.getDocumentHeight - 21) + "px"; } if (slider.getAttribute("state") == "open") openSlider(undefined, true); slider.style.display = ""; }*/ function update(myPage, displayNb) { //if (_gat) { // var gaPage = myPage || 1; // var trackers= _gat._getTrackers(); // for (var i=0, tracker; tracker = trackers[i]; i++) { //tracker._setCustomVar(); //tracker._trackEvent('Page view', gaPage.toString()); // } //_gaq.push(['_trackEvent', 'Page view', gaPage.toString()]); // _gaq.push(['_trackPageview', '/doc/aksgcksadkas/jahsdksasd/6.html']); //} VP_currentPage = myPage; // exception pour forcer page 0 à un display 1 if (displayNb == undefined || myPage == 0) displayNb = 1; if(typeof mvpInterstitial == 'object') { pages = [ myPage ]; for (i = 2; i <= displayNb; i++) pages.push(myPage + (displayNb - 1)); mvpInterstitial.update(pages); } var reference = ""; var lang = ""; var sections= { top : {}, left : {}, right : {}, bottom : {} }; for (var section in sections) { if (sections.hasOwnProperty(section)) { var element= document.getElementById(section + "_panel"); sections[section].element= element; sections[section].done= false; if (element != undefined) { if (element.innerHTML == "" || element.getAttribute("static") == "0") { reference += section + "|" + element.getAttribute("reference") + "@@@"; lang= element.getAttribute("lang"); } else if (element.getAttribute("static") == "1") { sections[section].done= true; } } } } if (reference != "") { var xmlHttp = getAjaxObj(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { if(xmlHttp.responseText) { ajaxText = xmlHttp.responseText.replace(/\r|\n/g, ""); var divs = ajaxText.split("@@@"); for(var i = 0; i < divs.length; i++) { var info= divs[i].split("|"); info.push(info.splice(1, Number.MAX_VALUE).join("|") ); if (info[0] != "" && info.length == 2) { if(typeof postscribe == 'function') { sections[info[0]].element.innerHTML= ""; postscribe("#"+info[0]+"_panel", info[1]); } else { sections[info[0]].element.innerHTML= info[1]; } sections[info[0]].done= true; } } for (var section in sections) { if (sections.hasOwnProperty(section)) { if (!sections[section].done && sections[section].element != undefined) sections[section].element.innerHTML= ""; } } } if (typeof MVP_onPageUpdate == 'function') { MVP_onPageUpdate(myPage); } } } xmlHttp.open("POST","/script/hybrid/hybrid.loader.php"); xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlHttp.send("reference=" + reference + "&mypage=" + myPage + "&lang=" + lang); } else { if (typeof MVP_onPageUpdate == 'function') { MVP_onPageUpdate(myPage); } } } if(!window.Node) { var Node = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_FRAGMENT_NODE: 11 }; } function registerOnLoadFunction(f) { var currentOnLoad = window.onload; if (typeof window.onload != "function") { window.onload = f; } else { window.onload = function() { currentOnLoad(); f(); } } } function getElementsByClassName(classname, node, tagname){ if(!node) node = document; else if (typeof node == "string") node = document.getElementById(node); if(!tagname) tagname = "*"; var loopNodes = node.getElementsByTagName(tagname); var foundNodes = []; for(var i = 0; i < loopNodes.length; i++) { var currentNodeClassesString = loopNodes[i].className; if(!currentNodeClassesString) continue; if(currentNodeClassesString == classname) { foundNodes.push(loopNodes[i]); continue; } var whiteSpaceRegex = /\s+/; if(!whiteSpaceRegex.test(currentNodeClassesString)) continue; var currentNodeClassesArray = currentNodeClassesString.split(whiteSpaceRegex); for(var i = 0; i < currentNodeClassesArray.length; i++) { if(currentNodeClassesArray[i] == classname) foundNodes.push(loopNodes[i]); } } return foundNodes; } function openPopup(url, popupWidth, popupHeight, popupAlign, popupVAlign, popupScrollbars, popupResizable) { var r = null; var width, height, scrollbars, resizable, top, left; popupWidth= String(popupWidth); popupHeight= String(popupHeight); width = (popupWidth.substr(popupWidth.length-1, 1) == "%") ? parseInt(popupWidth.substr(0, popupWidth.length - 1)) * screen.width / 100 : parseInt(popupWidth); height = (popupHeight.substr(popupHeight.length-1, 1) == "%") ? parseInt(popupHeight.substr(0, popupHeight.length - 1)) * screen.height / 100 : parseInt(popupHeight); switch(popupAlign) { case "left": left = 0; break; case "center": left = (screen.width - width) / 2 break; case "right": left = screen.width - width; break; default: left = 0; } switch(popupVAlign) { case "top": top = 0; break; case "middle": top = (screen.height - height) / 2 break; case "bottom": top = screen.height - height; break; default: top = 0; } scrollbars = (popupScrollbars == "yes") ? 1 : 0; resizable = (popupResizable == "yes") ? 1 : 0; r = window.open(url, "virtualpaper", "width="+width+",height="+height+",top="+top+",left="+left+","+"scrollbars="+scrollbars+",toolbar=no,location=no,status=no,menubar=no,resizable="+resizable+",dependent=no"); if(r!=null && window.focus) r.window.focus(); } function VP_openModal(url, width, height) { if (window.jQuery && jQuery().fancybox) { jQuery.fancybox.open( { href : url, type: 'iframe', width: width, height: height, autoSize: false, padding: 0, helpers: { overlay : { locked : false } } }); } else { openPopup(url, width, height, "center", "middle", "yes", "yes"); } } function VP_runJS($jsCode) { (new Function($jsCode))(); } function gotoPage(page) { document.getElementById('core').flashGotoPage(page); } function VP_getCurrentPage() { return VP_currentPage; } //Bookmark function urlReWrite(nbPage){ window.location.replace("#" + nbPage); } function utf8_encode (argString) { // http://kevin.vanzonneveld.net // + original by: Webtoolkit.info (http://www.webtoolkit.info/) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: sowberry // + tweaked by: Jack // + bugfixed by: Onno Marsman // + improved by: Yves Sucaet // + bugfixed by: Onno Marsman // + bugfixed by: Ulrich // + bugfixed by: Rafal Kukawski // * example 1: utf8_encode('Kevin van Zonneveld'); // * returns 1: 'Kevin van Zonneveld' if (argString === null || typeof argString === "undefined") { return ""; } var string = (argString + ''); // .replace(/\r\n/g, "\n").replace(/\r/g, "\n"); var utftext = "", start, end, stringl = 0; start = end = 0; stringl = string.length; for (var n = 0; n < stringl; n++) { var c1 = string.charCodeAt(n); var enc = null; if (c1 < 128) { end++; } else if (c1 > 127 && c1 < 2048) { enc = String.fromCharCode((c1 >> 6) | 192) + String.fromCharCode((c1 & 63) | 128); } else { enc = String.fromCharCode((c1 >> 12) | 224) + String.fromCharCode(((c1 >> 6) & 63) | 128) + String.fromCharCode((c1 & 63) | 128); } if (enc !== null) { if (end > start) { utftext += string.slice(start, end); } utftext += enc; start = end = n + 1; } } if (end > start) { utftext += string.slice(start, stringl); } return utftext; } function base64_encode (data) { var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc = "", tmp_arr = []; if (!data) { return data; } data = this.utf8_encode(data + ''); do { // pack three octets into four hexets o1 = data.charCodeAt(i++); o2 = data.charCodeAt(i++); o3 = data.charCodeAt(i++); bits = o1 << 16 | o2 << 8 | o3; h1 = bits >> 18 & 0x3f; h2 = bits >> 12 & 0x3f; h3 = bits >> 6 & 0x3f; h4 = bits & 0x3f; // use hexets to index into b64, and append result to encoded string tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); } while (i < data.length); enc = tmp_arr.join(''); switch (data.length % 3) { case 1: enc = enc.slice(0, -2) + '=='; break; case 2: enc = enc.slice(0, -1) + '='; break; } return enc; } //Subscription function openSubscription(url,clientID){ var r = null; var width, height, top, left, cIDEncode; width = 300; height = 200; left = (screen.width - width) / 2 top = (screen.height - height) / 2 cIDEncode = base64_encode(clientID); //alert(cIDEncode); r = window.open(url+"?c="+encodeURIComponent(cIDEncode), "Subscription", "width="+width+",height="+height+",top="+top+",left="+left+",scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no"); if(r!=null && window.focus) r.window.focus(); } //SHARING function getPubURL(page) { var u, h = location.hash; // si on recoit une page et qu'elle est valide, on ecrase la valeur du hash if(!isNaN(page) && parseInt(page) > 0) h = "#" + page; if(h) { h = h.substring(1); if(!isNaN(h) && parseInt(h) > 0) { var locationSearch = location.search; locationSearch = locationSearch.replace(/\bpage=\d+/, ''); var pathname = location.pathname; var lastChars = pathname.substring(location.pathname.length - 5); if(lastChars.toLowerCase() != ".html") { var lastChar = pathname.substring(pathname.length - 1); var addSlash = (lastChar == "/") ? false : true; u = location.protocol + "//" + location.host + pathname + ((addSlash) ? "/" : "") + h + ".html" + locationSearch; } else { pathname = pathname.substring(0, pathname.lastIndexOf("/")); u = location.protocol + "//" + location.host + pathname + "/" + h + ".html" + locationSearch; } } } if(u == null) u = location.href; return u; } function sharePub(site, page, width, height) { var uid = vars.publicationUID; var xmlHttp = getAjaxObj(); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { if(xmlHttp.responseText) { if (typeof width == 'undefined') width = 600; if (typeof height == 'undefined') height = 400; if (shareWindow) shareWindow.close(); shareWindow = window.open(xmlHttp.responseText, 'sharer'+site, 'toolbar=0,status=0,scrollbars=1,width='+width+',height='+height); if (shareWindow == null) { window.alert('We are unable to open the share popup. To share this publication, please disable the popup blocker.'); return; } else if (window.focus) shareWindow.focus(); } } } xmlHttp.open("GET", "/script/share.php?i=" + uid + "&s=" + site + "&p=" + page + "&q=" + encodeURIComponent(window.location.search.slice(1)) + "&b=1"); xmlHttp.send(); } function digg(page){ sharePub("digg", page, 725, 350); } function facebook(page) { sharePub("facebook", page, 600, 350); } function twitthis(page) { twitter(page); } function twitter(page) { sharePub("twitter", page, 600, 260); } function googleplus(page) { sharePub("googleplus", page, 500, 500); } function linkedin(page) { sharePub("linkedin", page, 600, 500); } function pinterest(page) { sharePub("pinterest", page, 600, 300); } function hideScrollbar() { document.body.style.overflow = "hidden"; } function prepareSession(minigw, core, divId, width, height, version, express) { vars.remote_addr = (ip == undefined) ? "" : ip; var over = ""; try { if (overRef != undefined) if (overRef != "") over = overRef; } catch(e) { } vars.http_referer = over == "" ? escape(document.referrer) : over; // vars.http_referer = document.referrer; if(strpos (vars.http_referer, "&mode=fembed")) vars.http_referer = "http://static.ak.facebook.com/common/referer_frame.php"; //alert(document.referrer); if (window.location.hash.indexOf("#") > -1) { var page = parseInt(window.location.hash.replace("#", "")); if (page != NaN) { if (page > 0) vars.gotopage = page; } } //alert(vars.http_referer + " - " + vars.remote_addr); swfobject.embedSWF(core, divId, width, height, version, express, vars, params, attributes ); setTimeout(function() { var coreEl = document.getElementById('core'); if(!coreEl) { VP_openModal('/install-flash.php?lang='+vars.lang, 662, 362); } }, 1000); /* Code for Mac mouse wheel. */ if (navigator.appName != 'Microsoft Internet Explorer' || parseInt(navigator.appVersion.match(/MSIE ([\d.]+)/)[1]) >= 9) { if((/Firefox/i.test(navigator.userAgent)) || (navigator.appVersion.indexOf("Mac")!=-1)) { var mousewheelevt=(/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel"; /* Hack until SWFObject 2.2 is used. */ setTimeout(function() { var coreEl = document.getElementById('core'); if(coreEl) { coreEl.addEventListener(mousewheelevt, handleWheel, false); } }, 1000); } } } function getAjaxObj() { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } return(xmlHttp); } function strpos (haystack, needle, offset) { var i = (haystack + '').indexOf(needle, (offset || 0)); return i === -1 ? false : i; } function getSearchQuery() { return location.search; } /* if (navigator.appName != 'Microsoft Internet Explorer' || parseInt(navigator.appVersion.match(/MSIE ([\d.]+)/)[1]) >= 9) document.addEventListener('DOMContentLoaded', mouseWheelLoader, false); function mouseWheelLoader() { if((/Firefox/i.test(navigator.userAgent)) || (navigator.appVersion.indexOf("Mac")!=-1)) { var mousewheelevt=(/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel"; window.addEventListener(mousewheelevt, handleWheel, false); } } */ function handleWheel(event) { var o = { x: event.screenX, y: event.screenY, delta: deltaFilter(event), ctrlKey: event.ctrlKey, altKey: event.altKey, shiftKey: event.shiftKey }; document.getElementById('core').handleWheel(o); } var deltaFilter = function(event) { var delta = 0; if (event.wheelDelta) { delta = -event.wheelDelta/120; //if (window.opera) delta = -delta; } else if (event.detail) { delta = event.detail; } if (event.preventDefault) event.preventDefault(); return delta; } var VP = { Menu : {}}; VP.Menu = function(options) { var API = {interne : {}, externe: {}}; var defaultsConf = {}; var configuration = {}; API.interne = { init : function(options) { configuration = $.extend(options, defaultsConf); $("a[class^='title']").next().css('display', 'none'); API.interne.addHandlers(); }, removeActiveOnLinks : function() { $('.active').removeClass('active'); }, resetCategoriePanel : function(className, contModule) { $.each(contModule.find(">li"), function() { if (this.className != className && $(this).is(':hidden')) { $(this).siblings().children().next().slideUp(); } }); }, addHandlers : function() { $("a[class^='title']").on('click', function (evt) { var contModule = $(this).parents('.section_tabs'); var contCategorie = $(this).parents('li[class]'); var retrigger = false; if ($(this).parents('ul').is('.level2,level3,.level4')) { var currentContext = $(this).parents('ul').first().find('ul'); currentContext.slideUp(); } // Showing depth if ($(this).next().is('.level2,.level3,.level4') && $(this).next().is(':hidden')) { API.interne.resetCategoriePanel(contCategorie[0].className, contModule); retrigger = true; } if ( $(this).next()) { API.interne.removeActiveOnLinks(); // Changing category if ($($(this).parents('li')[0]).hasClass(configuration['topCategories'])) { $('ul[class^=level]').slideUp(); } // Add active state + toggle if (retrigger) { $(this).addClass('active').next().slideToggle(); } else { // Only hiding it. $(this).removeClass('active').next().slideUp(); } } evt.preventDefault(); }); } }; // Instanciation & returning external API API.interne.init(options); return API.externe; };