/*----------------------------------------------------------------------+
|  This function display the navigation bar and manages:				|
|  - what marker should be active										|
|  - both 'previous' and 'next' function to move from slide to slide	|
+-----------------------------------------------------------------------*/
/*==== Derive the slide number from the slide file name ====*/
var slideName = window.location.pathname;
var slideNumber = slideName.substring(slideName.lastIndexOf('/')+9,slideName.lastIndexOf('.'))

/*==== Initialize variables ====*/
var previousSlide;
var nextSlide;
var ActiveState;	//-- Set a marker as active with the .slideActive class

/*==== Determine the Previous and Next slides links ====*/
slideNumber = Number(slideNumber);	//--Convert slide number from path to a number

switch(slideNumber){
	case 1:
		previousSlide = '#';
		nextSlide = 'stfxtour'+ eval(slideNumber + 1) +'.asp';
		break;
	case 17:
		previousSlide = 'stfxtour'+ eval(slideNumber - 1) +'.asp';
		nextSlide = '#';
		break;
	default:
		previousSlide = 'stfxtour'+ eval(slideNumber - 1) +'.asp';
		nextSlide = 'stfxtour'+ eval(slideNumber + 1) +'.asp';
}

/*==== Write markers and relevant hyperlinks for proper navigation ====*/
var divider = '<img src="graphics/tour/divider.gif" height="19" width="2" alt="" />';

with (document){
	write('<a href="'+previousSlide+'?menu=MenuItem2" class="arrow"><img src="graphics/tour/slidearrowleft.gif" height="19" width="10" alt="Previous" /></a>');
	for(i=1; i<=17; i++){
		(i==slideNumber) ? ActiveState = 'class="slideActive"' : ActiveState = '';
		write(divider+'<a '+ActiveState+' href="stfxtour'+i+'.asp?menu=MenuItem2">'+i+'</a>');
	}
	write(divider+'<a href="'+nextSlide+'?menu=MenuItem2" class="arrow"><img src="graphics/tour/slidearrowright.gif" height="19" width="11" alt="Next" /></a>');
}

/*----------------------------------------------------------+
|  This function displays pictures in the picture area		|
|  > Argurment: the picture full name, extension included	|
+-----------------------------------------------------------*/

function ShowPic(PicName){
	document.getElementById('PictureFrame').innerHTML = '<img src="graphics/tour/'+PicName+'" alt="" />';
}