function buildRotator(){
	d=document.getElementById("imagewrap");
	d.innerHTML="<div id='rotator1' class='rotator1'><img src='/images/banner010410a.jpg'></div><div id='rotator2' class='rotator2'><img src='/images/banner010410b.jpg'></div><div id='rotator3' class='rotator3'><img src='/images/banner010410c.jpg'></div><div id='rotator4' class='rotator4'><img src='/images/banner010410d.jpg'></div>";
	curr=1; next=2; themax=4;
	loopImages();
}

function swapImages(){
	FadeOpacity('rotator'+curr, 100, 0, 2000, 20)
	FadeOpacity('rotator'+next, 0, 100, 2000, 20)
	curr=next; next++; if(next>themax){next=1;}	
}
function loopImages(){
	swapImages();
	setTimeout('loopImages();',8000);
}

function SetOpacity(elem, opacityAsInt)
{
	var opacityAsDecimal = opacityAsInt;
	
	if (opacityAsInt > 100)
		opacityAsInt = opacityAsDecimal = 100; 
	else if (opacityAsInt < 0)
		opacityAsInt = opacityAsDecimal = 0; 
	
	opacityAsDecimal /= 100;
	if (opacityAsInt < 1)
		opacityAsInt = 1; // IE7 bug, text smoothing cuts out if 0
	
	elem.style.opacity = opacityAsDecimal;
	elem.style.filter  = "alpha(opacity=" + opacityAsInt + ")";
}

function FadeOpacity(elemId, fromOpacity, toOpacity, time, fps)
{
	var steps = Math.ceil(fps * (time / 1000));
	var delta = (toOpacity - fromOpacity) / steps;
	
	FadeOpacityStep(elemId, 0, steps, fromOpacity, delta, (time / steps));
}

function FadeOpacityStep(elemId, stepNum, steps, fromOpacity, delta, timePerStep)
{
    SetOpacity(document.getElementById(elemId), Math.round(parseInt(fromOpacity) + (delta * stepNum)));

    if (stepNum < steps)
        setTimeout("FadeOpacityStep('" + elemId + "', " + (stepNum+1) + ", " + steps + ", " + fromOpacity + ", " + delta + ", " + timePerStep + ");", timePerStep);
}

/*
FadeOpacity requires 5 parameters to define the animation:

elemId
The id attribute of the DOM object (or HTML entity) to animate.

fromOpacity
The starting opacity for the animation.

toOpacity
The ending opacity of the animation. This is the opacity the element will have when the animation ends.

time
The time the animation should take, in milliseconds. This should be divisible by the frames per second or it will be rounded to the next highest number that is divisible.

fps
The frames per second for the animation. A higher fps value means a smoother animation, but opacity changes can be processor-intensive on larger elements, so you could lower this if needed. 8 - 12 fps is a good quality setting. 
*/

