// JavaScript Document
var isL = 0;
var sL;
var ssBtnOp = .7; //sets button translucency level
$(document).ready(function(){
	$(".SSbtnHolder").fadeTo(1, 0);	
	$(".SSbtnHolder").mouseover(function(){
		$(".SScapHolder").stop();								 	
		$(".SScapHolder").fadeTo(1000, 0);								 
	 });
	$(".SSbtnHolder").mouseout(function(){
		$(".SScapHolder").stop();								 	
		$(".SScapHolder").fadeTo(1000, .7);								 
	 });
	$(".slideshow").mouseover(function(){
		$(".SSbtnHolder").stop();
		$(".SSbtnHolder").fadeTo(500, 1);
	 });
	$(".slideshow").mouseout(function(){
		$(".SSbtnHolder").stop();
		$(".SSbtnHolder").fadeTo(1000, 0);					 
	 });

	for(n=0; n<=22; n++){ /* Instantly fades all slideshow buttons to default opacity level (ssBtnOp) */
		if(n<10){	
		$("#SSbtn0"+n).fadeTo(1, ssBtnOp);
		}else{
		$("#SSbtn"+n).fadeTo(1, ssBtnOp);
		}
	}
	
	capQuote = Array(
		"The Lincoln Memorial from across the Potomac River.",
		"Heading down East 48th Street for the Grand Central Neighborhood Tour. 2009 JCW, New York.",
		"The nation's capital on the banks of the Potomac River.",
		"Accompanying a panel discussion and reception at the Consulate General of the Republic of Poland, the New York City Mayor's Office dedicated Jan Karski corner in honor of the legendary Holocaust-era figure and Georgetown professor. 2009 JCW, New York.",
		"Washington Harbour, Georgetown's own waterfront.", 
		"Georgetown Alumni Multicultural Reception. 2009 JCW, New York.",
		"The spectacular Great Hall in the Thomas Jefferson Building of the Library of Congress.",
		"On the flight deck of the USS Intrepid during the President's Welcome Reception. 2009 JCW, New York.",
		"The National World War II Memorial opened in the spring of 2004.",
		"President's Welcome Reception on the USS Intrepid with Gen. George Casey (F'70) and Mayor Michael Bloomberg. 2009 JCW, New York.",
		"Key Bridge extending from Georgetown over the Potomac River.",
		"View of Ground Zero during a tour and preview of the National September 11 Memorial and Museum, hosted by Tony Coscia (F'81). 2009 JCW, New York.",
		"The U.S. Capitol now features a sparkling new visitor center and grounds, opened in December of 2008.",
		"Tour of Ground Zero and preview of the National September 11 Memorial and Museum, hosted by Tony Coscia (F'81). 2009 JCW, New York.",
		"Some of the 4,000 hand-sculpted gold stars adorning the Freedom Wall at the National World War II Memorial.",
		"Private reception at the Tory Burch boutique. 2009 JCW, New York.",
		"A view down the National Mall, including the Lincoln Memorial, Washington Monument and U.S. Capitol.",
		"Behind the scenes of Broadway's The Lion King, a makeup artist paints the face of the actress playing Rafiki. 2009 JCW, New York.",
		"Cherry blossoms around the Tidal Basin usher in springtime in Washington.",
		"Georgetown's Impact on the World of Sports panel including, among others, John Thompson III, Georgetown's head men's basketball coach, and Aimee Mullins (F'98), athlete, actor and activist. 2009 JCW, New York.",					 
		"President Bill Clinton (F'68) received the Timothy S. Healy, S.J. Award at a reception honoring Fr. Healy. 2009 JCW, New York.",
		"President DeGioia speaks at the New York Public Library during a reception honoring former Georgetown president Timothy S. Healy, S.J. 2009 JCW, New York."
					 )
	
	function setQuote(){
		$(".SScapHolder p").text(capQuote[isL]); /* Sets the caption box to whichever quote is for the current slide (isL) */
	
	}
	setQuote();
	
	/* This begins the slideshow autoloop */
	slideLoop = function(i){
		if(isNaN(isL)){
			isL=0;
		}
		maxSlides = 22;
		$(".SSImgHolder").animate({
			left: (-605*isL)+"px"
		  }, 800);
		$(".SScapHolder p").text(capQuote[isL]);
		if(isL<maxSlides-1){
		isL+=1;
		}else{
		isL=0;
		}
	};
	sL = setInterval(slideLoop,8000); /* Length of time between slides */
	
	/* Individual slideshow button behavior */
	$("#SSbtn01").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*0)+"px"
		}, 1250);
		isL = 0;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
	$("#SSbtn01").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',    /* this and the line below make the thumbnails stretch upwards instead of default downward behavior. */
			marginBottom : '-=29px'
		},{queue: false, duration: 250});
		$(this).fadeTo(250, 1); //fade code
	});
	$("#SSbtn01").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });							
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn02").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*1)+"px"
		}, 1250);
		isL = 1;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn02").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',
			marginBottom : '-=29px'
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn02").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn03").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*2)+"px"
		}, 1250);
		isL = 2;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn03").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',
			marginBottom : '-=29px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn03").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn04").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*3)+"px"
		}, 1250);
		isL = 3;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn04").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',
			marginBottom : '-=29px'
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn04").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn05").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*4)+"px"
		}, 1250);
		isL = 4;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn05").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',
			marginBottom : '-=29px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn05").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn06").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*5)+"px"
		}, 1250);
		isL = 5;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn06").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',
			marginBottom : '-=29px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn06").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn07").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*6)+"px"
		}, 1250);
		isL = 6;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn07").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',
			marginBottom : '-=29px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn07").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn08").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*7)+"px"
		}, 1250);
		isL = 7;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn08").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',
			marginBottom : '-=29px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn08").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn09").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*8)+"px"
		}, 1250);
		isL = 8;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn09").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',
			marginBottom : '-=29px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn09").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn10").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*9)+"px"
		}, 1250);
		isL = 9;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn10").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',
			marginBottom : '-=29px'
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn10").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn11").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*10)+"px"
		}, 1250);
		isL = 10;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn11").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			top : '-29px',
			marginBottom : '-=29px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn11").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px",
			top : '0px',
			marginBottom: '0px'
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn12").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*11)+"px"
		}, 1250);
		isL = 11;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn12").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn12").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn13").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*12)+"px"
		}, 1250);
		isL = 12;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn13").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn13").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn14").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*13)+"px"
		}, 1250);
		isL = 13;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn14").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn14").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn15").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*14)+"px"
		}, 1250);
		isL = 14;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn15").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn15").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn16").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*15)+"px"
		}, 1250);
		isL = 15;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn16").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn16").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn17").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*16)+"px"
		}, 1250);
		isL = 16;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn17").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn17").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn18").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*17)+"px"
		}, 1250);
		isL = 17;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn18").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn18").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn19").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*18)+"px"
		}, 1250);
		isL = 18;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn19").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn19").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });	
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn20").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*19)+"px"
		}, 1250);
		isL = 19;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn20").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn20").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn21").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*20)+"px"
		}, 1250);
		isL = 20;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn21").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn21").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   $("#SSbtn22").click(function(){
		clearInterval(sL);
		$(".SSImgHolder").animate({
			left: (-605*21)+"px"
		}, 1250);
		isL = 21;
		setQuote();
		sL = setInterval(slideLoop, 8000);
	});
   $("#SSbtn22").mouseover(function(){
		$(this).stop();
		$(this).animate({
			width: "100px",
			height: "44px",
			marginBottom: "5px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, 1); //fade code
	});
   $("#SSbtn22").mouseout(function(){
		$(this).stop();
		$(this).animate({
			width: "30px",
			height: "15px"
		}, { queue: false, duration: 250 });
		$(this).fadeTo(250, ssBtnOp); //fade code
	});
   
  /* $(".lCol a img:first").mouseover(function(){
			this.src = "jcw_menu_header_b.jpg";				
							});
   $(".lCol a img:first").mouseout(function(){
			this.src = "jcw_menu_header.jpg";				
							});*/
});
