
strSelectedPage = String('story');

var strSelectedStoryPage = String('overview');
var iStoryPage = Number(1);

nav_story_overview_off = CreateImage('images/nav_story_overview_off.gif');
nav_story_overview_over = CreateImage('images/nav_story_overview_over.gif');
nav_story_overview_on = CreateImage('images/nav_story_overview_on.gif');	

nav_story_models_off = CreateImage('images/nav_story_models_off.gif');
nav_story_models_over = CreateImage('images/nav_story_models_over.gif');
nav_story_models_on = CreateImage('images/nav_story_models_on.gif');		

nav_story_custom_off = CreateImage('images/nav_story_custom_off.gif');
nav_story_custom_over = CreateImage('images/nav_story_custom_over.gif');
nav_story_custom_on = CreateImage('images/nav_story_custom_on.gif');		

nav_story_pricing_off = CreateImage('images/nav_story_pricing_off.gif');
nav_story_pricing_over = CreateImage('images/nav_story_pricing_over.gif');
nav_story_pricing_on = CreateImage('images/nav_story_pricing_on.gif');		

arrow_down_off = CreateImage('images/arrow_down_off.gif');
arrow_down_on = CreateImage('images/arrow_down_on.gif');
arrow_up_off = CreateImage('images/arrow_up_off.gif');
arrow_up_on = CreateImage('images/arrow_up_on.gif');	

function StoryNavClick(strPage) 
{
	if (bLoaded)
	{
		if (strPage != strSelectedStoryPage) 
		{					
			// Unhighlight the previous navigation
			ChangeImage('nav_story_' +strSelectedStoryPage, 'nav_story_' +strSelectedStoryPage +'_off');
			
			// Highlight the new navigation
			ChangeImage('nav_story_' +strPage, 'nav_story_' +strPage +'_on');
			
			// Display the correct contents
			DocumentObject('story_overview_1', true).display = (strPage == "overview" ? 'inline' : 'none');
			DocumentObject('story_overview_2', true).display = 'none';
			DocumentObject('story_overview_3', true).display = 'none';

			DocumentObject('story_models_1', true).display = (strPage == "models" ? 'inline' : 'none');
			DocumentObject('story_models_2', true).display = 'none';
			DocumentObject('story_models_3', true).display = 'none';
			
			DocumentObject('story_custom_1', true).display = (strPage == "custom" ? 'inline' : 'none');
			DocumentObject('story_custom_2', true).display = 'none';
			DocumentObject('story_custom_3', true).display = 'none';
			
			iStoryPage = 1;
			
			// Store the selected section
			strSelectedStoryPage = strPage;
		}
	}	
}

function StoryNavOver(strPage) 
{
	if (bLoaded)
	{
		ChangeImage('nav_story_' +strPage, 'nav_story_' +strPage +(strPage == strSelectedStoryPage ? '_on' : '_over'));
	}
}

function StoryNavOut(strPage) 
{
	if (bLoaded)
	{
		ChangeImage('nav_story_' +strPage, 'nav_story_' +strPage +(strPage == strSelectedStoryPage ? '_on' : '_off'));
	}
}

function StoryNavUp() 
{
	if (bLoaded)
	{
		if (iStoryPage > 1)
		{
			
			// Hide the old page
			DocumentObject('story_' +strSelectedStoryPage +'_' +String(iStoryPage), true).display = 'none';
			
			// Decrease the page counter
			iStoryPage = iStoryPage - 1;
			
			// Show the new page
			DocumentObject('story_' +strSelectedStoryPage +'_' +String(iStoryPage), true).display = 'inline';
		}
	}
}

function StoryNavDown() 
{
	if (bLoaded)
	{
		if (iStoryPage < 3)
		{
			// Hide the old page
			DocumentObject('story_' +strSelectedStoryPage +'_' +String(iStoryPage), true).display = 'none';
			
			// Decrease the page counter
			iStoryPage = iStoryPage + 1;
			
			// Show the new page
			DocumentObject('story_' +strSelectedStoryPage +'_' +String(iStoryPage), true).display = 'inline';
		}
	}
}