// ==============================================================================================
// ==============================================================================================

//pre-load images
var newsImg0 = new Image();
newsImg0.src = 'images-rotate/GolfFund.jpg';

var newsImg1 = new Image();
newsImg1.src = 'images-rotate/GolfFund.jpg';

//var newsImg1 = new Image();
//newsImg1.src = 'images-rotate/Expo.jpg';

var newsImg2 = new Image();
newsImg2.src = 'images-rotate/SummerShootoutBanner.jpg';

var newsImg3 = new Image();
newsImg3.src = 'images-rotate/rotator_TeamEDA.png';

var newsImg4 = new Image();
newsImg4.src = 'images-rotate/SummerGKCamp.jpg';

var newsImg5 = new Image();
newsImg5.src = 'images-rotate/2010_Scholastic-All-Star-Group.jpg';

var newsImg6 = new Image();
newsImg6.src = 'images-rotate/eclipse96(1).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>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>',newsImg1).write();

newsArray[2] = new makeNews("<font size=large><b>Summer Shootout</b></font><br><br>You are invited to join us for three days of competition at the areas first tournament of the summer. Every team will play three games guaranteed with age group Finalist & Champion receiving medals.<br> ",'tournaments/SummerShootout/','<font color=#e8db00><b>...READ MORE</b></font>',newsImg2).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[3] = new makeNews("<font size=large><b>May 3,2010 - EDA 94G Sweep Boise Soccer Tournament</b></font><br><br>The newly formed El Dorado United Soccer Academy’s U17 girls’ team EDA 94G went 4-0 in the Boise Capitals Performance Cup, winning the championship in Idaho. On Sat., they decisively beat the Boise Capitals 3-1 (ranked 4th in Idaho) and 3rd ranked Montana FC Missoula Blue 6-0, putting them first in their bracket. El Dorado came out strong in the semi...<br> ",'http://www.edasoccer.com','<font color=#e8db00><b>Read more at www.edasoccer.com</b></font>',newsImg3).write();

newsArray[4] = new makeNews("<font size=large><b>El Dorado United Goalkeeper Academy is run by Chris Malenab</b></font><br><br>The El Dorado United Goalkeeper Academy will develop goalkeepers to be technically sound, tactically intelligent and above all confident in their abilities to play the role of the goalkeeper. The program is designed to be progressive based upon the age, ability and experience of the individual goalkeeper. In the end, a goalkeeper is found to be successful if they are able to consistently keep the ball from crossing the goal line.<br> ",'camps/goalkeeper/','<font color=#e8db00><b>...REGISTER TODAY</b></font>',newsImg4).write();

newsArray[5] = new makeNews("<font size=large><b>Scholastic All Stars Awards Night</b></font><br><br>March 24, 2010 - The third annual awards night for the El Dorado United Scholastic All Stars was held on Tuesday, March 23, 2010, at the Jackson Elementary School gymnasium.<br> ",'news/20100325_2010ScholasticAllstars.htm','<font color=#e8db00><b>...READ MORE</b></font>',newsImg5).write();

newsArray[6] = 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>',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()',4000);
}
function pauseNews() {
	if (timerID != null) {
		clearTimeout(timerID);
		timerID = null;
	}
}

function playNews() {
	if (timerID == null) {
		timerID = setTimeout('rotateNews()', 4000);
	}
}

