window.onload = initLinks;

var myPhoto = new Array(
"Gala2009/Picture055-OwensRothstein.jpg",
"Gala2009/Picture046-ChrisWaryn.jpg",
"Gala2009/Picture052-Feinberg.jpg",
"Gala2009/Picture012-SilentAuction.jpg",
"Gala2009/Picture053-Roth.jpg",
"Gala2009/Picture054-MarkKlemow.jpg",
"Gala2009/Picture024-SilentAuction.jpg",
"Gala2009/Picture017-OwensBaker.jpg",
"Gala2009/Picture060-SockwellNashGree.jpg",
"Gala2009/Picture030-SilentAuction.jpg",
"Gala2009/Picture062-KlemowGruberCamp.jpg",
"Gala2009/Picture063-Swingle.jpg",
"Gala2009/Picture066-SochaColish.jpg",
"Gala2009/Picture026-SilentAuctionBox.jpg",
"Gala2009/Picture068-OwensDispenza.jpg",
"Gala2009/Picture073-FrischStockwellK.jpg",
"Gala2009/Picture075-BarerFamily.jpg",
"Gala2009/Picture077-OlivaMBarer.jpg",
"Gala2009/Picture034-Auction-Tickets.jpg",
"Gala2009/Picture078-FeldmanMulvaney.jpg",
"Gala2009/Picture070-MulvaneyOwens.jpg",
"Gala2009/Picture072-PallanteGreenYut.jpg",
"Gala2009/Picture079-GreenMcKnight.jpg",
"Gala2009/Picture083-KevoeMulvaney.jpg",
"Gala2009/Picture097-KresselSperlingB.jpg",
"Gala2009/Picture091-FrischFeldmanSto.jpg",
"Gala2009/Picture086-BuchanansKlemow.jpg",
"Gala2009/Picture095-RothsteinGreen.jpg",
"Gala2009/Picture096-ConneratGreen.jpg",
"Gala2009/Picture100-McKnightMakar.jpg",
"Gala2009/Picture103-ReichLesterClark.jpg",
"Gala2009/Picture104-McCarthys.jpg",
"Gala2009/Picture105-KlemowThomas.jpg",
"Gala2009/Picture107-GreenKlemow.jpg",
"Gala2009/DSC2284-Stockwells.jpg",
"Gala2009/DSC2312-GlasserOwens.jpg",
"Gala2009/DSC2362-Thompson.jpg",
"Gala2009/DSC2393-Stewarts.jpg",
"Gala2009/DSC2394-Szegedis.jpg",
"Gala2009/DSC2421-FeingoldEtAl.jpg",
"Gala2009/DSC2429-BarersEtAl.jpg",
"Gala2009/DSC2447-MaddenEtAl.jpg",
"Gala2009/DSC2461-Barers.jpg",
"Gala2009/DSC2465-GreenYutsus.jpg",
"Gala2009/DSC2464-Thompson.jpg",
"Gala2009/DSC2470-Prizes.jpg");

var myText = new Array(
"CONTACT We Care&rsquo;s Executive Director David Owens and<br />Clinical Director Wendi Rothstein",
"Chris Waryn entertains during the cocktail hour.",
"CONTACT Listener Laurie Feinberg",
"Our amazing Gala Silent Auction",
"Diann Gropp-Roth and Paul Roth",
"Mark Klemow",
"More Silent Auction Items",
"David Owens and James Baker",
"CONTACT We Care Board of Trustee members:<br />Sharon Stockwell and Leesa Nash with Board President Amy Green",
"More Silent Auction Items",
"CONTACT We Care Development Director Arlene Klemow with<br />volunteers Steve Gruber and Ann Campbell",
"CONTACT Listener Carrie Swingle",
"CONTACT Listener Swava Socha (right) and friend Maria Colish",
"More Silent Auction Items",
"CWC Executive Director David Owens and<br />Gala Committee member Jill Dispenza",
"CWC Board of Trustee members Howard Frisch,<br />Sharon Stockwell and Maureen Kehoe",
"Gala Honoree Dr. Sol Barer, center, with family members<br />Ido Zairi, Jennifer Zairi and Josh Barer",
"Gala honoree Mrs. Meri Barer (right) with Ann Oliva",
"More Silent Auction Items",
"Linda Feldman and Kathy Mulvaney",
"Kathy and Frank Mulvaney along with<br />CWC Executive Director David Owens",
"Janet Pallante, CWC President Amy Green and<br />Board of Trustee member Karen Yutsus",
"CWC Board President Amy Green and Vice President Jim McKnight",
"Sherry Kevoe and Frank Mulvaney",
"Roberta and Ken Kressel with Susan Sperling and Martin Birnbaum",
"CWC Board members Howard Frisch and Jeffrey Feldman,<br />along with David Stockwell",
"CONTACT Listener Kathy, with husband Jim Buchanan and Devlopment Director Arlene Klemow",
"CWC Clinical Director Wendi Rothstein and President Amy Green",
"CONTACT Listener Jeanne Connerat (right) with husband George and Board President Amy Green",
"Jim McKnight, board vice president, and Arthur Makar",
"Joanne Reich with CONTACT Listeners<br />Melanie Lester and Debra Clark",
"Geoff and Leslie McCarthy",
"Arlene Klemow and Sue Thomas",
"Amy Green and Arlene Klemow",
"David and Sharon Stockwell",
"Mr. and Mrs. Gerald Glasser and David Owens",
"WNBC TV&rsquo;s Brian Thompson served as Master of Ceremonies",
"Mr. and Mrs. James Stewart",
"Dr. and Mrs. Armin Szegedi",
"Honoree Dr. Katherine Feingold, surrounded by Jim McKnight,<br />Brian Thompson and David Owens",
"Honorees Dr. Sol Barer and Mrs. Meri Barer<br />surrounded by Jim McKnight, Brian Thompson and David Owens",
"Rowena Madden, executive director of the NJ Governor&rsquo;s Office of Volunteerism, accepting the honor on behalf of Secretary of State Nina Mitchell Wells. Pictured with her are David Owens, Jim McKnight, and Brian Thompson.",
"Dr. Sol Barer and Mrs. Meri Barer",
"Board Members Amy Green and Karen Yutsus",
"MC Brian Thompson",
"Leaving with some great auction prizes!");

var thisPhoto = 0;

function initLinks() {
	document.getElementById("previous").onclick = processPrevious;
	document.getElementById("next").onclick = processNext;
}

function processPrevious() {
	changeOpac(0)
	if (thisPhoto == 0) {
		thisPhoto = myPhoto.length;
	}
	thisPhoto--;
	document.getElementById("myPicture").src = myPhoto[thisPhoto];
	//if (document.getElementById("myPicture").src.indexOf("v") != -1)
//	{
//		document.getElementById("myPicture").style.marginTop = 10 + "px";
//	}
//	else {
//		document.getElementById("myPicture").style.marginTop = 50 + "px";
//	}
	document.getElementById('pictureText').innerHTML = myText[thisPhoto];
	opacityShow()
	return false;
}

function processNext() {
	changeOpac(0)
	thisPhoto++;
	if (thisPhoto == myPhoto.length) {
		thisPhoto = 0;
	}
	document.getElementById("myPicture").src = myPhoto[thisPhoto];
//	if (document.getElementById("myPicture").src.indexOf("v") != -1)
//	{
//		document.getElementById("myPicture").style.marginTop = 10 + "px";
//	}
//	else {
//		document.getElementById("myPicture").style.marginTop = 50 + "px";
//	}
	document.getElementById('pictureText').innerHTML = myText[thisPhoto];
	opacityShow()
	return false;
}


function opacityFade() {
	timer = 900;
	for(i = 100; i >= 0; i--) {
		setTimeout("changeOpac(" + i + ")",(timer));
		timer=timer+2;
	}
}
function opacityShow() {
	timer = 900;
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ")",(timer));
	timer=timer+2;
	}
}

function changeOpac(opacity) {
	var object = document.getElementById('myPicture').style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}
