// Name: 	nav_buttons.js
// Author: 	Daniel Ellis, Nola Computer Services
// Language: 	Javascript
// Notes:	This script navigates between a series
//		of sequentially numbered/named pages.

//Creates new string Object.
next_page = new String
prefix = new String
filetype = new String

//Change these values to match your series of pages
//-------------------------------------------------------------------------------------------------------------

prefix = "ISSM"
filetype = ".htm"
min = 1
max = 11

//--------------------------------------------------------------------------------------------------------------


// Function receives page identifier number and max, compares, then
// navigates to the next page if one exists.

function nextpage(current_page) {

	if (current_page != max) {
		current_page++
        	next_page = prefix + current_page + filetype
		window.top.location = next_page 
		
		}
}

// Function receives page identifier number and min, compares, then
// navigates to the previous page if one exists.

function backpage(current_page) {
	
	if (current_page != min) {
		current_page--
		next_page = prefix + current_page + filetype
		window.top.location = next_page
		}
}
//home button calls backpage function and tricks it into thinking it's always on page 2 in the series!
document.write('<center><button type="button" name="Restart Video" onClick="backpage(2)"><b>|<-RESTART VIDEO </b></button>')
 
 if (this_page != min) {
 	document.write('<button type="button" name="back" onClick="backpage(this_page)"><b> <<-BACK </b></button>') 
 	<!--- document.write('<button type="button" name="back" onClick="http://localhost/ASPNetPortal/Portal.aspx?tabindex=2&tabid=38"><b> <<-BACK </b></button>')--->
 	}
 
 if (this_page != max) {
 	document.write('<button type="button" name="next" onClick="nextpage(this_page)"><b> NEXT->> </b></button>')
 	}
 

 document.write('</center>')
