	var i = 0;
	var current = 0;
	var toID = 0;
	var done = true;

	// Set the order of the  rotation after the first image
	var imgList = new Array();
	imgList[0] = "limestone-fireplace.gif";
	imgList[1] = "limestone-door-window-surrounds.gif";
	imgList[2] = "limestone-address-blocks.gif";
	imgList[3] = "limestone-custom-front-entry.gif";
	imgList[4] = "limestone-columns.gif";
	imgList[5] = "limestone-balustrades-balusters.gif";

	var lnkList = new Array();
	lnkList[0] = "PRODUCTS_fireplaces.htm";
	lnkList[1] = "PRODUCTS_custom_surrounds_sills.htm";
	lnkList[2] = "PRODUCTS_address_blocks.htm";
	lnkList[3] = "PRODUCTS_custom_front_entry.htm";
	lnkList[4] = "PRODUCTS_tapered_columns.htm";
	lnkList[5] = "PRODUCTS_balustrades.htm";

	var imgAlt = new Array();
	imgAlt[0] = "Fireplaces - Transform the focal point of your room with the grace and beauty of a limestone fireplace. View our regal, powerful, and distictive designs.";
	imgAlt[1] = "Limestone Window &amp; Door Surrounds - Add a touch of elegance and grace to your windows and doors with surrounds made by Architectural Limestone Inc.";
	imgAlt[2] = "Limestone Address Blocks - Put your house number on a limestone address block. Let the experts at Architectural Limestone create a one-of-a-kind address block for you.";
	imgAlt[3] = "Custom Limestone Front Entry - Your custom front entry can be designed and crafted by the experts at Architectural Limestone, Inc. All it takes is one simple phone call. We'll do the rest...";
	imgAlt[4] = "Tapered Columns - These majestic columns will turn your home into a grand palace. And if your neighbors start becoming jealous, do the right thing. Smile.";
	imgAlt[5] = "Limestone Balustrades - Turn your home into an architectural masterpiece by including our balustrades into your design.";

	var randNum = Math.round(Math.random()*5);
	var randLink = Math.round(Math.random()*5/5);

	// Set speed of fade and interval between fades
	var dissolvespeed=3000;
	var interval=8000;

function showImage(){
	document.write('<div class="box2" style="background:url(_images/home/'+imgList[randNum]+') 0 0 no-repeat; height:126px; width:570px" id="promopic" onclick="window.location.href=(lnkList[randNum])" title="'+imgAlt[randNum]+'" style="cursor:pointer"></div>');
}

function setCrossfade() {
	setTimeout("blendimage('promobanner','promopic',randNum," + dissolvespeed + ")",interval);
}

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";

    if (opacity<99) {
		done=false;
	} else {
		done=true;
	}
}

function nextFade() {
	//if (done==true) {
	//	clearTimeout(toID);
		//blendimage('promobanner', 'promopic', current, dissolvespeed);
		window.location.href = (lnkList[randLink]);
	//}
}

function blendimage(divid, imageid, imagefile, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //set the current image as background
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";

    //make image transparent
    changeOpac(0, imageid);

    //make new image
    document.getElementById(imageid).src = "_images/home/" + imgList[randNum];

    //fade in image
    for(i = 0; i <= 99; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }

    //setTimeout('document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"',(timer*speed));
    if (imagefile == imgList.length-1) {
    	imagefile=-1;
    }

    toID=setTimeout("blendimage('promobanner','promopic'," + ++imagefile + "," + dissolvespeed + ")",interval);
    current=imagefile;
}
