var haLinkArray = ['/mobiles/mobileDetails.do?workMobileId=1045', '/mobiles/mobileDetails.do?workMobileId=1169', '/mobiles/mobileDetails.do?workMobileId=1246', '/mobiles/mobileDetails.do?workMobileId=1027']; var haAltArray = ['Vente Flash : LG KU990 Viewty', 'Vente Flash : HTC P3470 Pharos', 'Samsung SGH-U900 Soul', 'Nokia N95 8GB'] var haImageUrlArray = ['/products-inc/images/homepage/haHot1.gif', '/products-inc/images/homepage/haHot2.gif', '/products-inc/images/homepage/haHot3.gif', '/products-inc/images/homepage/haHot4.gif']; var haImageArray = new Array(); var haImageId = 'haImage'; var haLinkId = 'haLink'; var haDivId = 'haDiv'; var haActivClassName = 'haActiv'; var haCurrentIndex = 1; var delayIndex; var haNextLink; var haNextImageIndex; var displayHaImageTimer; var hideHaImageTimer; var displayHaImageDelayTimer; var displayHaImageDelay = 200; var alphaStep = 5; var alphaDisplayDelay = 1; // Variable pour VF var cptRebourAnnee = 2008; var cptRebourMois = 4; //attention, Janvier = 0, Fév = 1 etc... [année,mois,jour,heure,minutes,secondes] var cptRebourJour = 13; var cptRebourHeure = 12; var cptRebourMinute = 30; var cptRebourSeconde = 0; function loadAnimationImages() { compteRebour(); for (var i = 0 ; i < haLinkArray.length ; i++) { haImageArray[i] = document.createElement("img"); haImageArray[i].src = haImageUrlArray[i]; haImageArray[i].alt = haAltArray[i]; haImageArray[i].id = haImageId; } TournePave(); } function delayChangeAnimationImage(index) { if (index != haCurrentIndex) { window.clearTimeout(displayHaImageDelayTimer); delayIndex = index; displayHaImageDelayTimer = window.setTimeout('changeAnimationImage()', displayHaImageDelay); } stopTournePave(); numpave = index; } function cancelDelayChangeAnimationImage() { window.clearTimeout(displayHaImageDelayTimer); startTournePave(); } function forceChangeAnimationImage(index) { window.clearTimeout(displayHaImageDelayTimer); if (index != haCurrentIndex) { haNextLink = haLinkArray[index - 1]; haNextImageIndex = index - 1; haNextAlt = haAltArray[index - 1]; window.clearTimeout(displayHaImageDelayTimer); changeAnimationImage(); } } function changeAnimationImage() { if (delayIndex != haCurrentIndex) { for (var i = 1 ; i <= haImageUrlArray.length ; i++) { var className = ''; if (i == delayIndex) { className = haActivClassName; } document.getElementById('ha'+i).className = className; } haNextLink = haLinkArray[delayIndex - 1]; haNextImageIndex = delayIndex - 1; haNextAlt = haAltArray[delayIndex - 1]; window.clearTimeout(displayHaImageTimer); window.clearTimeout(hideHaImageTimer); hideAnimation(); haCurrentIndex = delayIndex; } } function setAlphaFilter(element, base100Value) { if (element.filters) { element.filters.alpha.opacity = base100Value; } else { element.style.setProperty('-moz-opacity', base100Value/100, ''); } } function getCurrentBase100AlphaFilter(element) { if (element.filters) { return element.filters.alpha.opacity; } else { return element.style.getPropertyValue('-moz-opacity') * 100; } } function displayAnimation() { alphaBase100 = getCurrentBase100AlphaFilter(document.getElementById(haDivId)); if (alphaBase100 >= 100) { } else { alphaBase100 = alphaBase100 + alphaStep; setAlphaFilter(document.getElementById(haDivId), alphaBase100); displayHaImageTimer = window.setTimeout('displayAnimation()', alphaDisplayDelay); } } function hideAnimation() { alphaBase100 = getCurrentBase100AlphaFilter(document.getElementById(haDivId)); if (alphaBase100 > 0) { alphaBase100 = alphaBase100 - alphaStep; setAlphaFilter(document.getElementById(haDivId), alphaBase100); displayHaImageTimer = window.setTimeout('hideAnimation()', alphaDisplayDelay); } else { document.getElementById(haLinkId).href = haNextLink; document.getElementById(haLinkId).title = haNextAlt; document.getElementById(haLinkId).replaceChild(haImageArray[haNextImageIndex], document.getElementById(haLinkId).firstChild); displayAnimation(); } } var numpave = 0; var paveTourneDelay = 5000; var paveTourneDelayTimer ; function TournePave() { if(numpave == (haImageUrlArray.length)){ numpave = 1; } else{ numpave++; } delayIndex = numpave ; forceChangeAnimationImage(delayIndex); paveTourneDelayTimer = setTimeout("TournePave()",paveTourneDelay); } function stopTournePave() { clearTimeout(paveTourneDelayTimer); } function startTournePave() { paveTourneDelayTimer = setTimeout('TournePave()', paveTourneDelay); } function compteRebour() { //CompteRebour pour Vente Flash (VF) maintenant = new Date(); rebours = new Date (cptRebourAnnee,cptRebourMois,cptRebourJour,cptRebourHeure,cptRebourMinute,cptRebourSeconde); //attention, Janvier = 0, Fév = 1 etc... [année,mois,jour,heure,minutes,secondes] secondes = (rebours - maintenant) / 1000; secondesRound = Math.round (secondes); minutes = secondes / 60; minutesRound = Math.round (minutes); heures = minutes / 60; heuresRound = Math.round (heures); jour = heures/ 24; jour = Math.floor (jour); realheures = heures - 24*jour ; realHeuresRound = Math.floor (realheures); realminutes = minutes - realHeuresRound*60 - 24*jour*60; realMinutesRound = Math.floor (realminutes); realsecondes = secondes - realMinutesRound*60 - realHeuresRound*60*60 - 24*jour*60*60; realSecondesRound = Math.floor (realsecondes); if (jour == 0){ reste = realHeuresRound + " h " + realMinutesRound + " min "+ realSecondesRound + " s"; } else if (jour == 1){ reste = jour + " jour " +realHeuresRound + " h " + realMinutesRound + " min "+ realSecondesRound + " s"; } else { reste = jour + " jours " +realHeuresRound + " h " + realMinutesRound + " min "+ realSecondesRound + " s"; } document.getElementsByName("compteRebours").item(0).dateRebours.value=reste; if(secondes >= 1){ setTimeout('compteRebour()', 1000); } }