// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully
// modified 2009: AEC Communications, Inc. www.aeccommunications.com

var slideShowSpeed = 4000;

var link = new Array();

    link[0] = 'http://www.aeccommunications.com/?p=29';
    link[1] = 'http://www.aeccommunications.com/?p=38';
    link[2] = 'http://www.aeccommunications.com/?page_id=15';
    link[3] = 'http://www.aeccommunications.com/?p=24';
    link[4] = 'http://www.aeccommunications.com/?p=80';
    link[5] = 'http://www.aeccommunications.com/?page_id=15';
    link[6] = 'http://www.aeccommunications.com/?page_id=15';
    link[7] = 'http://www.aeccommunications.com/?p=46';
    link[8] = 'http://www.aeccommunications.com/?p=46';
    link[9] = 'http://www.aeccommunications.com/?page_id=15';

var Pic = new Array()

    Pic[0] = '/aecteaser/AECTEASER01.jpg';
    Pic[1] = '/aecteaser/AECTEASER02.jpg';
    Pic[2] = '/aecteaser/AECTEASER03.jpg';
    Pic[3] = '/aecteaser/AECTEASER04.jpg';
    Pic[4] = '/aecteaser/AECTEASER05.jpg';
    Pic[5] = '/aecteaser/AECTEASER06.jpg';
    Pic[6] = '/aecteaser/AECTEASER07.jpg';
    Pic[7] = '/aecteaser/AECTEASER08.jpg';
    Pic[8] = '/aecteaser/AECTEASER09.jpg';
    Pic[9] = '/aecteaser/AECTEASER10.jpg';

var t;
var j = 0;
var k = 1;
var p = Pic.length;
var opacityAECteaser = 100;

var preLoad = new Array()
    for (i = 0; i < p; i++){
       preLoad[i] = new Image();
       preLoad[i].src = Pic[i];
    }

function runAECteaser(){
   document.getElementById('divAECteaser').style.backgroundImage = "url(" + Pic[k] + ")";
   document.getElementById('linkAECteaser').href = link[j];
   document.images.imgAECteaser.src = preLoad[j].src;
   setalphaAECteaser(opacityAECteaser);
   setTimeout(xfadeAECteaser,4000);
}

function xfadeAECteaser(){
   opacityAECteaser = opacityAECteaser - 5;
   setalphaAECteaser(opacityAECteaser);
	if(opacityAECteaser<=0)
	{
                j = j + 1;
                if (j > (p-1)) j=0;
                k = j + 1;
                if (k > (p-1)) k=0;
                opacityAECteaser = 100;
                document.images.imgAECteaser.src = preLoad[j].src;
                document.getElementById('divAECteaser').style.backgroundImage = "url(" + Pic[k] + ")";
                document.getElementById('linkAECteaser').href = link[j];
                setalphaAECteaser(opacityAECteaser);
		setTimeout(xfadeAECteaser,4000);
	}
	else
	{
		setTimeout(xfadeAECteaser,50);
	}
}

function setalphaAECteaser(alphaPerc){
   document.images.imgAECteaser.style.opacity = alphaPerc * 0.01;
   document.images.imgAECteaser.style.MozOpacity = alphaPerc * 0.01;
   document.images.imgAECteaser.style.filter = 'alpha(opacity=' + (alphaPerc) + ')'
}

function changeAECteaser(imgnoAECteaser){
   document.images.imgAECteaser.src = preLoad[imgnoAECteaser].src;
   document.getElementById('linkAECteaser').href = link[imgnoAECteaser];
   document.getElementById('divAECteaser').style.backgroundImage = "url(" + Pic[imgnoAECteaser] + ")";
   j = imgnoAECteaser - 1;
}
