var opacity;
var numImages;
var currentImage = 1;
var currentContainer = 1;
var currentProduct;
var arrayImages = new Array();
function initImage() {
Warning: Invalid argument supplied for foreach() in /home/www/sites-available/www/htdocs/includes/script.js.php on line 116
numImages = 0;
changeImage(1);
}
function setOpacity(obj, opacity) {
opacity = (opacity == 100)?99.999:opacity;
// IE/Win
obj.style.filter = "alpha(opacity:"+opacity+")";
// Safari<1.2, Konqueror
obj.style.KHTMLOpacity = opacity/100;
// Older Mozilla and Firefox
obj.style.MozOpacity = opacity/100;
// Safari 1.2, newer Firefox and Mozilla, CSS3
obj.style.opacity = opacity/100;
}
function fadeIn(numImage, opacity) {
if (opacity <= 100) {
setOpacity(document.getElementById('imageBackground'+numImage), opacity);
opacity += 2;
window.setTimeout("fadeIn('"+numImage+"',"+opacity+")", 50);
}
}
function fadeOut(numImage, opacity) {
if (opacity >= 0) {
setOpacity(document.getElementById('imageBackground'+numImage), opacity);
opacity -= 2;
window.setTimeout("fadeOut('"+numImage+"',"+opacity+")", 50);
}
else {
document.getElementById('imageBackground' + currentContainer).src = 'images/homepage-backgrounds//' + arrayImages[currentImage];
}
}
function changeImage(init) {
document.getElementById('imageBackground' + currentContainer).src = 'images/homepage-backgrounds//' + arrayImages[currentImage];
fadeIn(currentContainer, 0);
if (currentImage < numImages) currentImage++;
else currentImage = 1;
if (currentContainer == 1) currentContainer++;
else currentContainer = 1;
if(init != 1) fadeOut(currentContainer, 100);
window.setTimeout("changeImage(0)", 10000);
}
function productRollOut(product) {
if(product != currentProduct) setOpacity(product, 60);
}
/*
function productClick(product, numProduct) {
currentProduct = product;
productRollOut(document.getElementById('product1'));
productRollOut(document.getElementById('product2'));
productRollOut(document.getElementById('product3'));
productRollOut(document.getElementById('product4'));
productRollOut(document.getElementById('product5'));
showInfo('divProductInfo' + numProduct);
document.getElementById('divProductHeader').style.display = 'block';
document.getElementById('divProductHeader').innerHTML = document.getElementById('divProductHeader' + numProduct).innerHTML;
document.getElementById('divProductLinks').style.display = 'block';
document.getElementById('divProductLinks').innerHTML = document.getElementById('divProductLinks' + numProduct).innerHTML;
}
*/
function showInfo(divProduct) {
document.getElementById('divProductInfoText').innerHTML = document.getElementById(divProduct).innerHTML;
}