var fadeArray = new Array();
function init(){
	fadeArray[0] = document.getElementById('fade').innerHTML;
	fadeArray[1] = '<blockquote>Competitive - Efficient - Reliable, are the key words we use to describe Forecourt Fuels and their system of operation. The cost of fuel is one of the major overheads our company carries, Forecourt Fuels remain constantly competitive, advising us in advance the weekly cost of fuel, easing our budget control. Their electronic invoicing system is quick and efficient - any queries dealt with immediately by friendly interested staff, quite a welcome shock in this day and age. Their coverage of the UK road system is excellent combined with the security systems operated with the fuel cards the reliability has been second to none. From years past and hopefully for years in the future may our association continue.</blockquote><span>David Sanderson - Managing Director, Solent Express Limited</span>';
	fadeArray[2] = '<blockquote>I would have no hesitation in recommending Forecourt Fuels for their Fuel Card services. We not only use Forecourt Fuels for our own fleet, but have been so impressed with the service that we have incorporated the Forecourt Fuels service offering into our fleet solutions package. This has been extremely successful so far and with our clients, whose collective fleets number several hundred vehicles, all of whom have been extremely satisfied with the level of service received along with the achieved reduction in their fuel costs.</blockquote><span>Mick James - Director, Fleet Efficiency Ltd</span>';
	startFade();
}

function startFade(){
	var fadethis = 'fade';
	setTimeout('fadeOut(\''+fadethis+'\', 10)', 5000);
}

function fadeIn(element, opacity){
	if(opacity < 10){
		opacity++;
		setOpacity(element, opacity);
		fadein = setTimeout('fadeIn(\''+element+'\', \''+opacity+'\')', 100);
	} else{
		clearTimeout(fadein);
		setTimeout('startFade()', 3000);
	}
}

function fadeOut(element, opacity){
	if(opacity > 0){
		opacity--;
		setOpacity(element, opacity);
		fadeout = setTimeout('fadeOut(\''+element+'\', \''+opacity+'\')', 100);
	} else{
		clearTimeout(fadeout);
		setTimeout('swapText(\''+element+'\')', 200);
	}
}

function swapText(element){
	for(var i = 0; i < fadeArray.length; i++){
		//alert('fadeArray = '+fadeArray[i]);
		//alert('innerHTML = '+document.getElementById(element).innerHTML);
		if(document.getElementById(element).innerHTML.toLowerCase() == fadeArray[i].toLowerCase()){
			if(i == 2){
				document.getElementById(element).innerHTML = fadeArray[0];
			}else{
				document.getElementById(element).innerHTML = fadeArray[i+1];
			}
			break;
		}
	}
	fadeIn(element, 0);
}

function setOpacity(element, value) {
	document.getElementById(element).style.opacity = value/10;
	document.getElementById(element).style.filter = 'alpha(opacity=' + value*10 + ')';
}
window.onload = init;