/* This File was Created By Kris Cruickshank * This file contains the list of articles * on the PARABOW web site. * * When this file "articles.js" is loaded it calls * the function LoadPageList which Fills the two * global arrays (arrayaPages & arrayDir) with * article data. * * **************************** * ** How to use this script ** * **************************** * * If you have added an article to the website go to * one of the five sections: * * 1) Research Section * 2) Planning Section * 3) Building Section * 4) Training Section * 5) Results Section * * and then you copy the following three lines and paste * them at the end of the section. arrayPages[x] = "<>"; arraySkip[x] = false; arrayDir[x++] = dir; * once you have inserted the above three lines at the end * of the relevent section change <> to the path * name of the article that you added e.g. * * "research/iceland/page_1.htm" * * - would reffer to the file whose full path would be * * "http://localhost/parabow/projects/research/iceland/page_1.htm" * * - You must remove every thing up to and including the * "projects/" directory. * * and then change the false on the second line to true if that * article loads a new sidebar. */ var arrayPages = new Array(); var arraySkip = new Array(); var arrayDir = new Array(); LoadPageList(); // This function loads the data into the arrays function LoadPageList() { // *** Set the counter to 0 var x = 0; var dir = ""; arrayPages[x] = "contents.htm"; //Do not alter this line arraySkip[x] = true; //Do not alter this line arrayDir[x++] = "blank"; //Do not alter this line // ************************ // *** Research Section *** // ************************ dir = "research"; // *** Research - Pages arrayPages[x] = "research/index.htm"; arraySkip[x] = true; arrayDir[x++] = dir; arrayPages[x] = "research/iceland/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "research/uk/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "research/mix/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "research/ireland/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "research/page_2.htm"; arraySkip[x] = false; arrayDir[x++] = dir; // This Article Requires a special side bar so skip. arrayPages[x] = "research/italy/appendix2.htm"; arraySkip[x] = true; arrayDir[x++] = dir; // ************************ // *** Planning Section *** // ************************ dir = "planning"; // *** Planning - Pages arrayPages[x] = "planning/index.htm"; arraySkip[x] = true; arrayDir[x++] = dir; arrayPages[x] = "planning/slovakia/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/iceland/page_2.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/denmark/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/uk/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/mix/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/germany/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "reference/ref_2.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "reference/ref_3.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "reference/ref_4.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "reference/ref_5.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/italy/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/uk/Parabolton.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/uk/parabolton2.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/uk/parabolton4.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/uk/heritage.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "planning/uk/jorvik.htm"; arraySkip[x] = false; arrayDir[x++] = dir; // ************************ // *** Building Section *** // ************************ dir = "building"; // *** Building - Pages arrayPages[x] = "building/index.htm"; arraySkip[x] = true; arrayDir[x++] = dir; arrayPages[x] = "building/denmark/craftsmanshouse.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "building/iceland/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "building/iceland/turfchurch.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "building/germany/saxonhouse.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "building/germany/saxonhscomp.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "building/germany/saxonhscons.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "building/germany/saxonhsorg.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "building/germany/shteampic.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "building/ireland/crannogie.htm"; arraySkip[x] = false; arrayDir[x++] = dir; // ************************ // *** Training Section *** // ************************ dir = "training"; // *** Training - Pages arrayPages[x] = "training/index.htm"; arraySkip[x] = true; arrayDir[x++] = dir; arrayPages[x] = "training/paratrain.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "training/uk/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "training/iceland/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "training/iceland/archaeotrain.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "training/finland/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; // *********************** // *** Results Section *** // *********************** dir = "completion"; // *** Results - Pages arrayPages[x] = "completion/index.htm"; arraySkip[x] = true; arrayDir[x++] = dir; arrayPages[x] = "completion/sweden/page_1.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "completion/objectives.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "completion/dissemination.htm"; arraySkip[x] = false; arrayDir[x++] = dir; arrayPages[x] = "completion/universitylinks.htm"; arraySkip[x] = false; arrayDir[x++] = dir; // ******************** // *** End of List **** // ******************** arrayPages[x] = ""; arraySkip[x] = false; arrayDir[x++] = ""; } // This function Takes in the path of one of the above articles // and returns it's index or (-1) if not found. function GetIndexOf( path ) { var c = 0; if( !EndofList(c) ) { do { if( arrayPages[c] == path ) return c; }while( !EndofList(++c) ); } return (-1); } function EndofList( index ) { return (arrayPages[index] == "" && arrayDir[index] == ""); } function StartofList( index ) { // First find start var c = 0; if( !EndofList(c) ) { do { if( !arraySkip[c] ) { return (index <= c); } }while( !EndofList(++c) ); }else { alert( "There is NO Data!" ); return true; } } // This function returns the path of the next article, if there // is no next article then (at_end_msg) is displayed. if an error // ocurrs then err_msg is displayed, if either of the two messages are // diaplayed then the function returns an empty string. function GetNext( path, at_end_msg, err_msg ) { var i = GetIndexOf( path ); if( i >= 0 ) { if( EndofList(i+1) && at_end_msg != "" ) alert( at_end_msg ); else return arrayPages[i+1]; }else if( err_msg != "" ) alert( "GetNext() - ERROR: Cannot Find specified path.\n - "+err_msg ); return ""; } // This function returns the path of the previous article, if there // is no previous article then (at_start_msg) is displayed. if an error // ocurrs then err_msg is displayed, if either of the two messages are // diaplayed then the function returns an empty string. function GetPrev( path, at_start_msg, err_msg ) { var i = GetIndexOf( path ); if( i >= 0 ) { if( StartofList(i) && at_start_msg != "" ) alert( at_start_msg ); else return arrayPages[i-1]; }else if( err_msg != "" ) alert( "GetPrev() - ERROR: Cannot Find specified path.\n - "+err_msg ); return ""; } // This Function extracts the subdirs and files from a projects windows.location. function ConvertFullPath( full_path ) { var path = full_path.toString(); var list = path.split("/"); var in_projects = false; path = ""; for( var c = 0; c < list.length; c++ ) { if( in_projects ) { path += list[c]; if( c < (list.length-1) ) path += "/"; } if( !in_projects && list[c] == "projects" ) in_projects = true; } return path; } function SkipThis( path ) { var i = GetIndexOf( path ); return arraySkip[i]; }