// JavaScript Document
//All you have to do is to add files to this list below:

//First get your list of files in the order you want them:

database=new Array(
"tesco_cars_html_newsletter_internet_advertising.html",
"shadow_project_management_logo_branding_design.html",
"fizzart_website_logo_design.html",
"fb_bootcamp_website_flyer_poster_design.html",
"windscout_branding_logo_design_website_businesscards.html",
"queenofspades_stationery_branding_website_design.html",
"swiss_magazine_layout_design_production.html",
"harley_davidson_flash_animation_web_build.html",
"amber_branding_guidelines_stationery_design.html",
"goactive_outdoors_magazine_design_layout_production.html",
"ultimate_ski_press_pack_print_design.html",
"sirius_safety_brand_refresh_SEO_website_stationery.html",
"grumittwade_web_design_SEO_online_marketing.html",
"samsung_otable_interactive_installation.html",
"solarscout_branding_logo_design_website_businesscards.html",
"lark_media_worpress_website_design.html",
"completely_carpets_website_flyer_design.html",
"farsite_webdesign_branding_logo_design.html",
"nha_print_design_booklet_layout.html",
"snow_snowboarding_ski_magazine_design.html"

);


//The above is all you need to change!

//We want to automatically discover the number of files

NumberOfFiles=database.length;

//Next find out which page, this one is//

//We use the location.href property and extract the filename

//from this string using lastIndexOf:

StringA=location.href;

LengthA=StringA.length

A=StringA.lastIndexOf("/")+1;

ThisFilename=StringA.substring(A,LengthA);

 

//Now we find the current page nunmber (in the list)

//Remember that Arrays start at 0 and end at number of

//elements less one. So the last element is:

n=NumberOfFiles-1;

//Now we look through to list to find our file, and

//therefore, its number in the list:

for (var i = 0; i <= n; i++)

{

if (database[i]==ThisFilename)

{

ThisPageNumber=i;

}

}

//determine the numbers of the previous and the next pages//

function goBack(){

 

if (ThisPageNumber-1<0)

//We don't want to go into negative numbers or numbers

//bigger than the number of files! So if the file number less

//one is less than zero, there is nowhere left to go!

{

// go to last page in loop

{top.location=database[n]}
}

//Otherwise we just take one of the current file number

//and get the number for the previous file:

else

{top.location=database[ThisPageNumber-1]}}

function goForward(){

 

if (ThisPageNumber+1>n){

// go to the first page in loop

{top.location=database[0]}

//If the user is clicking on the last file, he or she

//cannot go forward. Otherwise, the next file is the current

//file number plus one:

}

else

{top.location=database[ThisPageNumber+1]}}

 

//and so that's our code. All we have to do is to change files

//in the Array database! Nice and lazy!
