function doOnLoad()
{
	if($("homepage") != null)
	{
		new Effect.Appear('one', { duration: 1.0, from: 0.0, to: 1.0, delay: 0.6 }); 
		new Effect.Opacity('one', { queue: 'end', duration: 0.5, from: 1.0, to: 0.6, delay: 0.4 }); 
		Effect.Appear('two', { duration: 1.0, from: 0.0, to: 1.0, delay: 1.4 }); 
		new Effect.Opacity('two', { queue: 'end', duration: .5, from: 1.0, to: 0.6, delay: 0.4 }); 
		Effect.Appear('three', { duration: 1.0, from: 0.0, to: 1.0, delay: 2.2 }); 
		new Effect.Opacity('three', { queue: 'end', duration: 0.5, from: 1.0, to: 0.6, delay: 0.4 }); 
		Effect.Appear('previous', { duration: 1.0, from: 0.0, to: 1.0, delay: 0.1 }); 
		new Effect.Opacity('previous', { queue: 'end', duration: 0.5, from: 1.0, to: 0.4, delay: 0.1 }); 
		Effect.Appear('next', { duration: 1.0, from: 0.0, to: 1.0, delay: 0 }); 
		new Effect.Opacity('next', { queue: 'end', duration: 0.5, from: 1.0, to: 0.4, delay: 0 }); 
	}
	return false;
}

var openBtn2 = "newsButton_open2.gif";
var solidBtn2 = "newsButton_solid2.gif";
var intervalID2;
var showing2 = 1;
var truckArray = new Array("","truck1","truck2");
var truckbtnArray = new Array("","truckBtn1","truckBtn2");
var inProgress2 = false;

function swapTruck(next) {
    if (inProgress2) return;
    inProgress2 = true;
    
    if (next == 0) { next = showing2 + 1; } //if swapTruck isnt called from a button
    if (next == 4) { next = 1; }    // if its the last news item

    new Effect.Fade(truckArray[showing2], { duration: 0.3});

    setTimeout(function() {
        $(truckbtnArray[showing2]).src = openBtn2
        $(truckbtnArray[showing2]).style.cursor = "pointer"
        $(truckbtnArray[next]).src = solidBtn2
        $(truckbtnArray[next]).style.cursor = "default"
        new Effect.Appear(truckArray[next], { duration: 0.3})
        showing2 = next
        inProgress2 = false
    }, 300);

}
