// ==============================================================================================
// ==============================================================================================

//pre-load images
var newsImg0 = new Image();
newsImg0.src = 'images-rotate/GolfFund.jpg';

var newsImg1 = new Image();
newsImg1.src = 'images-rotate/Expo.jpg';

var newsImg2 = new Image();
newsImg2.src = 'images-rotate/eclipse96(1).jpg';

var newsImg3 = new Image();
newsImg3.src = 'images-rotate/07.jpg';

var newsImg4 = new Image();
newsImg4.src = 'images-rotate/09.jpg';

var newsImg5 = new Image();
newsImg5.src = 'images-rotate/10.jpg';

var newsImg6 = new Image();
newsImg6.src = 'images-rotate/11.jpg';

var newsImg7 = new Image();
newsImg7.src = 'images-rotate/cherryall.jpg';

var newsImg8 = new Image();
newsImg8.src = 'images-rotate/rotator-image-2.jpg';

var newsImg9 = new Image();
newsImg9.src = 'images-rotate/rotator-image-5.jpg';

var newsImg10 = new Image();
newsImg10.src = 'images-rotate/coleair.jpg';

var newsImg11 = new Image();
newsImg11.src = 'images-rotate/alex.jpg';

var newsImg12 = new Image();
newsImg12.src = 'images-rotate/collage.jpg';


// ==============================================================================================
// ==============================================================================================

//add link, title & description
var newsArray = new Array();

newsArray[0] = new makeNews("<font size=large><b>Foundation Cup</b></font><br><br>Come join the Coaches, Parents and Supporters of the Club for a fun filled day of golf, followed by an exciting night out including a fantastic dinner, music and live/silent auction!<br>",'http://www.eldoradosoccer.com/FUNDRAISERS/FoundationCup/','<font color=#e8db00><b>...READ MORE</b></font>',newsImg0).write();

newsArray[1] = new makeNews("<font size=large><b>Why Come to Soccer Expo 2010?</b></font><br><br>Soccer Expo is where coaches, players and fans can experience the world of soccer. From player clinics to the cutting edge in gear and consumer goods, Soccer Expo has something for everyone!<br><br>",'http://www.eldoradosoccer.com/FUNDRAISERS/SoccerExpo.asp','<font color=#e8db00><b>...READ MORE</b></font>',newsImg1).write();

newsArray[2] = new makeNews("<font size=large><b>Eclipse ’96 Wins The Northern California Spring Showcase Soccer Tournament!</b></font><br><br>Hayward, March 6-7, 2010 - The El Dorado United Competitive Club U14 girls’ soccer team, Eclipse ’96, won the championship at the Northern California Spring Showcase Soccer Tournament!  The tournament is hosted by the Juventas Sports Club and features teams from Canada, several surrounding states and Northern and Central California.<br>",'news/20100306_eclipse96.htm','<font color=#e8db00><b>...READ MORE</b></font>',newsImg2).write();

newsArray[3] = new makeNews("<font size=large><b>Crew 99 Calcio - NorCal State Cup Champions</b></font><br><br>December 19, 2009 - The boys of Crew 99 Calcio got their first tournament victory of the season and it just happened to earn them a State Cup Championship trophy.<br><br>After cruising through the quarter-finals with a 5-0 win over Mill Valley Fusion White they earned a solid 4-1 victory in the semi-final match against Central Marin United.<br>",'news/20091219_Crew99.htm','<font color=#e8db00><b>...READ MORE</b></font>',newsImg3).write();

newsArray[4] = new makeNews("<font size=large><b>El Dorado United Players Named to Cal North ODP Teams</b></font><br><br>December 17, 2009 - Congratulations to Brandon Wallace (94 State Team), Josh Holbrook (95 State Team) and Connor Hountalas (97 State Team) for being chosen to play on this year`s ODP teams for their respective age groups. The boys initially tried out in May/June of 2009 and went through various trainings, tryouts and cuts to finally make the final teams chosen...<br>",'news/','<font color=#e8db00><b>...READ MORE</b></font>',newsImg4).write();

newsArray[5] = new makeNews("<font size=large><b>CONGRATULATIONS to Eclipse 97 - Juventus Coppa D’Oro Tournament Champs!</b></font><br><br>December 14, 2009 - The Eclipse faced off with Novato United to pull off a 2-1 win. Then headed to a 1-0 win against San Carlos Sapphire. They took a nice tie with Milpitus MXG. FCA High Voltage gave them a good run, but they pulled it off with a 2-0 win and held on to the Championship title. <br>",'news/','<font color=#e8db00><b>...READ MORE</b></font>',newsImg5).write();

newsArray[6] = new makeNews("<font size=large><b>CONGRATULATIONS to Crew 01 for winning the NorCal State Cup Premier Division!</b></font><br><br>It was a tough match two weekends in a row, but our U9 boys pulled it off with a championship win. The boys worked very hard. They came out of the quarter finals with a 3-0 win against Livermore. Then had a great win, 2-1, against the Santa Clara Sporting in the semi-finals. In the finals, the boys played an outstanding game with a win of 5-2 against Athletico.<br>",'news/','<font color=#e8db00><b>...READ MORE</b></font>',newsImg6).write();

newsArray[7] = new makeNews("<font size=large><b>CLUB BENEFITS</b></font><br><br>Players receive the opportunity to compete at the highest possible level against other similar youth teams and can maximize their talents and skills.<br><br>The level of training and coaching is more advanced which supplements, directs and guides the development of these talented players effectively...<br>",'policies/','<font color=#e8db00><b>...READ MORE</b></font>',newsImg7).write();

newsArray[8] = new makeNews("<font size=large><b>CLUB GOALS</b></font><br><br>Create a positive soccer environment for players&sbquo; coaches&sbquo; and parents. While enforcing the Zero Tolerance Policy.<br><br>Develop soccer skills and knowledge of the game.<br><br>Develop teamwork both on and off the field.<br><br>Create an environment in which players and team can rise to their full potential...<br>",'policies/','<font color=#e8db00><b>...READ MORE</b></font>',newsImg8).write();

newsArray[9] = new makeNews("<font size=large><b>CLUB TRAINING</b></font><br><br>Competitive is more intense and there are higher expectations for time commitment, by the players and their families.<br><br>Our club professional training program will be led by the Board of Directors and a qualified staff of trainers. A critical part of this program includes...<br>",'policies/','<font color=#e8db00><b>...READ MORE</b></font>',newsImg9).write();

newsArray[10] = new makeNews("<font size=large><b>2010-11 Season Beginning</b></font><br><br>Register and attend this season tryouts.<br>",'','',newsImg10).write();

newsArray[11] = new makeNews("<font size=large><b>Come and Check Out...</b></font><br><br>all the different El Dorado United Soccer Academy camps.<br>",'','',newsImg11).write();

newsArray[12] = new makeNews("<font size=large><b>U11B team in action</b></font><br><br><br>",'','',newsImg12).write();

// ==============================================================================================
// ==============================================================================================


// c = copy
// l = link
// f = follow
// i = image

function makeNews(c,l,f,i){
	this.copy = c;
	this.link = l;
	this.follow = f;
	this.img = i;
	this.write = writeNews;
}


function writeNews(){
	var str = '';
	str += '<table><tr><td><a href="' + this.link + '">';
	str += '<img border="0" src="' + this.img.src + '" height="300"></a></td><td width="243px" valign="top"><font color="#ffffff">';
	str += this.copy + '</font><br>';
        str +=  '<a href="' + this.link + '">' + this.follow + '</a></td></tr></table>';
	return str;
}


var nIndex = 0;
var timerID = null;
function rotateNews(){
	var len = newsArray.length;
	if(nIndex >= len)
		nIndex = 0;
	document.getElementById('stories').innerHTML = newsArray[nIndex];
	nIndex++;
	timerID = setTimeout('rotateNews()',3000);
}
function pauseNews() {
	if (timerID != null) {
		clearTimeout(timerID);
		timerID = null;
	}
}

function playNews() {
	if (timerID == null) {
		timerID = setTimeout('rotateNews()', 1000);
	}
}
