var selectedTab = 0; function animateFade() { var fade = document.getElementById("fade"); var opacity = document.getElementById("opacity"); var animationtimeoutid = document.getElementById("animationtimeoutid"); var proceed = true; var newopacity = opacity.value; if (fade.value == 'in') { proceed = !(newopacity == 0); newopacity--; } else { proceed = !(newopacity == 6); newopacity++; } if (proceed) { opacity.value = newopacity; var overlay = document.getElementById("overlay"); animationtimeoutid.value = setTimeout("setPromoOpacity('overlay'," + newopacity + ")", 25); } else { fade.value = 'finished-' + fade.value; switchNewDeluxePromo(document.getElementById("newdeluxepromoindex").value); } } function setPromoOpacity(id, value) { var object = document.getElementById(id); object.style.opacity = parseInt(value) / 10; object.style.filter = 'alpha(opacity=' + value * 10 + ')'; var animationtimeoutid = document.getElementById("animationtimeoutid"); clearTimeout(parseInt(animationtimeoutid.value)); animateFade(); } function switchNewDeluxePromol() { var i = window.document.getElementById("newdeluxepromoindex").value; i = (parseInt(i) + 1) % 6; switchNewDeluxePromo(i); var timeoutid = setTimeout("switchNewDeluxePromol()", 8000); window.document.getElementById("timeoutID").value = timeoutid; logPageVisit(i+1); } function switchNewDeluxePromo(index) { selectedTab = index; document.getElementById("newdeluxepromoindex").value = index; var fade = document.getElementById("fade"); if (fade.value == 'idle') { // fadeout box document.getElementById("overlay").style.display = 'inline'; fade.value = 'out'; animateFade(); } else if (fade.value == 'finished-out') { //alert(fade.value); for (var i = 0; i < 6; i++) { var linkClassName = (i == index? 'spotlightitem activeitemorange' : 'spotlightitem'); var promoDisplay = (i == index? '' : 'none'); var linkindex = "link" + i; document.getElementById(linkindex).className = linkClassName; var promoDisplayIndex = "promo" + i; document.getElementById(promoDisplayIndex).style.display = promoDisplay; } fade.value = 'in'; animateFade(); } else if (fade.value == 'finished-in') { //alert(fade.value); fade.value = 'idle'; document.getElementById("overlay").style.display = 'none'; } } function clearTimer() { if(document.getElementById("timeoutID")!=null) { var timeoutid = document.getElementById("timeoutID").value; clearTimeout(timeoutid); timeoutid = setTimeout("switchNewDeluxePromol()", 8000); window.document.getElementById("timeoutID").value = timeoutid; } } function stopSpotlightBox() { var timeoutid = document.getElementById("timeoutID").value; clearTimeout(timeoutid); } function setColorOfCustomBox(from, to) { var featuredbox = document.getElementById("featuredbox"); } function mouseOverTab(tab, index) { if(selectedTab != index) { tab.className='spotlightitemhover'; } } function mouseOutTab(tab, index) { if(selectedTab != index) { tab.className='spotlightitem'; } }