//Declare the varibale name outside the function so it is global.

// This js file is only used for the links at the top of the sliding panels on student_agendas/agenda.asp.
// id=link5 is assigned to the Full-Color Covers link at top (Goes to panel 1 or 'item1')
// id=link6 is assigned to the Covers in School Colors link at top (Goes to panel 2 or 'item2')
// id=link7 is assigned to the Religious Covers link at top (Goes to panel 3 or 'item3')
// id=link1 is assigned to the arrow_right in the 1st panel (Goes to panel 2 or 'item2')
// id=link2 is assigned to the arrow_left in the 2nd panel (Goes to panel 1 or 'item1')
// id=link3 is assigned to the arrow_right in the 2nd panel (Goes to panel 3 or 'item3')
// id=link4 is assigned to the arrow_left in the 3rd panel (Goes to panel 2 or 'item2')

var sp;
function InitPage()
{
	sp = new Spry.Widget.SlidingPanels("ticker");
	Spry.$$("#link1, #link4, #link6").addEventListener("click", function(){sp.showPanel('item2');return false; }, false); 
	Spry.$$("#link2, #link5").addEventListener("click", function(){sp.showPanel('item1');return false; }, false); 
	Spry.$$("#link3, #link7").addEventListener("click", function(){sp.showPanel('item3');return false; }, false); 
	// If a 4th item was needed, you could create another line here:
	// Spry.$$("#link8").addEventListener("click", function(){sp.showPanel('item4');return false; }, false); 
}
Spry.Utils.addLoadListener(InitPage);
