// Created by Ryan of KNR Designs.
// For use only on Innovative Solution.


// INSTRUCTIONS - READ BEFORE EDITING.
// This JavaScript contains the functions that causes the featured image to rotate.
// To change which pictures are displayed, edit the var fi_arr.
// It needs to have the full location of the image, relative to where this file is stored, or relative to the root if you start with a slash "/".
// Each image needs to enclosed in single quote tags " ' ". Seperate each image by an apostrophe ",".
// Here is an example of what to put between the brackets "[ ]"
// 'images/feat_img.gif' , 'images/feat_img2.gif'
// Put the images in the order you want them displayed, starting with the image you want first.



// Variables Start
	var fi_num = 1 ;	// This is the image you want to start with on the page. Leave as is.
	var fi_arr = [ 'images/parkashassociates.jpg' , 'images/trishaktiastro.jpg' ] ;	// This is the list of featured images. Make sure to have the full location of each image, relative to this file's location.
	var fi_arr_len = fi_arr . length ;	// This is how many images are to be displayed. Leave as is.
	var auto_switch = true ;	// This automatically switches the featured image after a certain interval. Set to false to disable, and true to enable.
	var interval = 5 ;	// Set in seconds how long you want before the image switches.
// Variables End




// Functions start.

function next_fi ( )	{
	
	fi_num ++ ;
	
	if ( fi_num == fi_arr_len )	{
		fi_num = 0 ;
	}
	
	var img = fi_arr [ fi_num ] ;
	
	document . getElementById ( 'fimg' ) . src = img ;
}

function prev_fi ( )	{
	
	if ( fi_num == 0 )	{
		fi_num = fi_arr_len ;
	}
	fi_num -- ;
	
	var img = fi_arr [ fi_num ] ;
	
	document . getElementById ( 'fimg' ) . src = img ;
}

if ( auto_switch )	{
	int = interval * 1000 ;
	setInterval ( next_fi , int ) ;
}