document.write('
Wefoliotheque
'); /** * Integration de la wefoliotheque * * Pour ouvrir la wefoliotheque, appeler la fonction openWefoliotheque() * Pour la fermer, closeWefoliotheque() */ /** * Initialisation */ var vitesseFade = 10; // 1 < x < 0 var vitesseResize = 20; //px var loop = 20; //Ms var code = "d1389df59ad40a84"; var urlCvtheque = "http://www.weavlink.com/cvtheque.php?home&cvt=" + code; var lightBoxFill = false; var lightBoxWMax = 98; //% var lightBoxHMax = 96; //% var lightBoxActivate = true; //Iframe if (!lightBoxActivate) document.write(''); var cache = document.getElementById('wefoliothequeCache'); var lightBox = document.getElementById('wefoliothequeLightBox'); var cacheOpacity = 0; var lightBoxOpacity = 0; /** * Check IE */ function isIEWefoliotheque() { return navigator.userAgent.toLowerCase().indexOf('msie') != -1; } /** * Ouverture de la wefoliotheque */ function openWefoliotheque() { //Cache cache.style.display = 'block'; cacheOpacity = 0; setOpacityWefoliotheque(cache, cacheOpacity); fadeStartWefoliotheque(cache.id, cacheOpacity, 0.7, false); //Lightbox lightBox.style.display = 'block'; lightBoxOpacity = 0; setOpacityWefoliotheque(lightBox, lightBoxOpacity); fadeStartWefoliotheque(lightBox.id, lightBoxOpacity, 1, false); //Remplissage de la lightbox if (!lightBoxFill) { lightBoxFill = true; if (lightBoxActivate) lightBox.innerHTML += ''; } resizeStartWefoliotheque(lightBox.id, parseInt(lightBox.style.width), parseInt(lightBox.style.height), lightBoxWMax, lightBoxHMax ); } /** * Fermeture de la wefoliotheque */ function closeWefoliotheque() { //Cache cache.style.display = 'block'; cacheOpacity = 0.7; fadeStartWefoliotheque(cache.id, cacheOpacity, 0, true); //Lightbox lightBox.style.display = 'block'; lightBoxOpacity = 1; fadeStartWefoliotheque(lightBox.id, lightBoxOpacity, 0, true); resizeStartWefoliotheque(lightBox.id, parseInt(lightBox.style.width), parseInt(lightBox.style.height), lightBoxWMax, 1 ); } /** * Fade */ function setOpacityWefoliotheque(object, value) { if (isIEWefoliotheque() && ( object == undefined || object.filters == undefined || object.filters.alpha == undefined || object.filters.alpha.opacity == undefined )) { //return false; } else { if (isIEWefoliotheque()) object.filters.alpha.opacity = value*100; else object.style.opacity = value; } } function fadeStartWefoliotheque(objectId, start, end, display) { fadeWefoliotheque(objectId, start, end, start, 0, display); } function fadeWefoliotheque(objectId, start, end, current, cpt, display) { var object = document.getElementById(objectId); var aAdd = Number((end-current)/vitesseFade); aAdd = aAdd>0 ? Math.ceil(aAdd*100)/100 : Math.floor(aAdd*100)/100; current = Number(current+aAdd); if (start > end && current < end || start < end && current > end) current = end; setOpacityWefoliotheque(object, current); if (current != end) window.setTimeout("fadeWefoliotheque('" + objectId + "'," + start + "," + end + "," + current + "," + Number(cpt+1) + "," + display + ");", loop); else if (display) object.style.display = 'none'; } /** * Redimensionne */ function resizeStartWefoliotheque(objectId, wS, hS, wE, hE) { resizeWefoliotheque(objectId, wS, hS, wE, hE, wS, hS, 0); } function resizeWefoliotheque(objectId, wS, hS, wE, hE, wC, hC, cpt) { var object = document.getElementById(objectId); //Width var wAdd = Number((wE-wC)/vitesseResize); wAdd = wAdd>0 ? Math.ceil(wAdd) : Math.floor(wAdd); wC = Number(wC+wAdd); if (wS > wE && wC < wE || wS < wE && wC > wE) wC = wE; object.style.width = wC + '%'; //Height var hAdd = Number((hE-hC)/vitesseResize); hAdd = hAdd>0 ? Math.ceil(hAdd) : Math.floor(hAdd); hC = Number(hC+hAdd); if (hS > hE && hC < hE || hS < hE && hC > hE) hC = hE; object.style.height = hC + '%'; if (wC != wE || hC != hE) window.setTimeout("resizeWefoliotheque('" + objectId + "'," + wS + "," + hS + "," + wE + "," + hE + "," + wC + "," + hC + "," + Number(cpt+1) + ");", loop); }