// JavaScript Document

//a global variable for all database queries.

// first lets make a slide show viewer for the front page...

						   
						   
var slideShow = {
	data:null
	,
	curSlide:0
	,
	
	rootURL:"/img/content/slides/"
	,
	
	screenIMG: null
	,
	
	screenCaption: null
	,
	
	loadSlide: function(){
		this.screenIMG.attr("src",this.rootURL + this.data[this.curSlide].src);
		this.screenCaption.html("");
		this.screenIMG.load(function() {
			slideShow.newSlide();
		});
		
	}
	,

	newSlide: function(){
		this.screenCaption.html(this.data[this.curSlide].caption);
		this.screenIMG.fadeIn(600);
		this.screenCaption.fadeIn(600);
	}
	
	, 
	
	showSlide: function(p_index) {
			if( (p_index >= 0) && (p_index < this.data.length)) {
				this.curSlide = p_index;
			}// silent death.
			this.screenCaption.fadeOut(600);
			this.screenIMG.fadeOut(600, function(){
				slideShow.loadSlide();
			});

		}
}

/*
/* add this to any page you want a slide show... 
/* set the screenIMG to the image to change
/* set the screenCaption to the text div to show thecaption
/* set the data in the format below and assign the index reference to your buttons
/*
/*
$(document).ready(function(){
	// set the slideShow
	slideShow.screenIMG = $("#slideIMG");
	slideShow.screenCaption = $("#slideCaption");
	slideShow.data = [ {src:"slide_01.jpg",caption:"Playing games together increases the learning opportunity.", uiBtn: $("#uiBtn_01")},
		   {src:"slide_02.jpg",caption:"Make decisions around buying cars and using credit cards.", uiBtn: $("#uiBtn_02")},
		   {src:"slide_03.jpg",caption:"The choice is yours to start a business or go to school.", uiBtn: $("#uiBtn_03")},
		   {src:"slide_04.jpg",caption:"\"Money is a life skill - and as parents, grandparents, interested adults - it's up to us to make sure our children are prepared for the financial world they are going to face.\" <br />Sharon Lechter<br /> - Author<br /> - Founder of Pay Your Family First, LLC<br /> - Member of the President's Advisory Council on Financial Literacy", uiBtn: $("#uiBtn_04")}
		   ];
});

*/
