// original source: 
// http://mikeomatic.net/techtips/css-crossfader/
// modified a bit by yaz

// the starting index in the divs_to_fade array.  It should be set to the value of the div which doesn't have the CSS Display property set to "none"
var content_rotator_index = 0;

// function that performs the fade
function swapFade() {
	
	// this array consists of the id attributes of the divs we wish to alternate between
	var divs_to_fade = $(content_rotator_div).immediateDescendants();
	var divs_total = divs_to_fade.length;
	
	Effect.Fade(divs_to_fade[content_rotator_index], { 
		duration:1, from:1.0, to:0.0 }
	);
	
	// increase rotator
	content_rotator_index++;
	
	// reset if you reach the limit
	if (content_rotator_index == divs_total) content_rotator_index = 0;
	
	Effect.Appear(divs_to_fade[content_rotator_index], { 
		duration:1, from:0.0, to:1.0 }
	);
}


