// **********************************************************************************************
//  TV Ark Link Sectionaliser Bar v1.2.1 by James B Hudson - BEng(Hons) MIET 	© 2006.
//		
//  This simple script is bloody handy if a site has hundreds of pages!						
//  Only THIS PAGE requires amendment to propagate changes globally i.e. across all pages.				
//  The html pages utilise an external reference link to this javascript.			
//  Doing that means html overheads can be reduced and keep the main pages less cluttered.
//  And if another item is added to the list then it saves every page being amended manually!!	
// 												
//  REQUIRED HTML PAGE INSERT:										
//  <script type="text/javascript" src="linkbar.js"> // Import Sectionaliser </script>		
//  Above can be placed in tables to position the bar where desired.	
//  Keep "src" path wherever this script is placed.			
// **********************************************************************************************

// Create Global Array & Variables

	 var x															// Variable to use as increment parameter
	 var linkSections= new Array()
																

// Append/delete new links here as appropriate. Increment/Decrement number within "[]".
// **********************************************************************************************				// The array filled with variable linkSections				
	
	 linkSections[0]='<option SELECTED value="0">Choose a section'								// The links
	 linkSections[1]='<option value="http://www.tv-ark.org.uk">TVARK Home'
	 linkSections[2]='<option value="http://www2.tv-ark.org.uk/tvark10years/index.html">TVARK 10 Years'
	 linkSections[3]='<option value="http://www.tv-ark.org.uk/whatsnew/view.php">Whats New'
	 linkSections[4]='<option value="http://www.tv-ark.org.uk/mivana/stats.php">Top Tens'
 	 linkSections[5]='<option value="">----------------------'							// Copy and paste for spacer
	 linkSections[6]='<option value="http://www2.tv-ark.org.uk/bbc/index.html">BBC'
	 linkSections[7]='<option value="http://www2.tv-ark.org.uk/itv/index.html">ITV'
	 linkSections[8]='<option value="http://www2.tv-ark.org.uk/channel4_s4c/index.html">Channel4/S4C'
	 linkSections[9]='<option value="http://www2.tv-ark.org.uk/channel5/index.html">Five'
	 linkSections[10]='<option value="http://www2.tv-ark.org.uk/skytv/index.html">Sky Television'
	 linkSections[11]='<option value="http://www2.tv-ark.org.uk/otherchannels/index.html">Other Channels'
	 linkSections[12]='<option value="http://www2.tv-ark.org.uk/International/index.html">International TV'
 	 linkSections[13]='<option value="">----------------------'							// Copy and paste for spacer
	 linkSections[14]='<option value="http://www2.tv-ark.org.uk/adverts/index.html">Adverts'
	 linkSections[15]='<option value="http://www2.tv-ark.org.uk/chatshows">Chat Shows'
	 linkSections[16]='<option value="http://www2.tv-ark.org.uk/childrens/index.html">Childrens TV'
	 linkSections[17]='<option value="http://www2.tv-ark.org.uk/comedy/index.html">Comedy'
	 linkSections[18]='<option value="http://www2.tv-ark.org.uk/cult/index.html">Cult'
	 linkSections[19]='<option value="http://www2.tv-ark.org.uk/drama/index.html">Drama'
	 linkSections[20]='<option value="http://www2.tv-ark.org.uk/endboards/index.html">Endboards'
	 linkSections[21]='<option value="http://www2.tv-ark.org.uk/gameshows/index.html">Gameshows'
	 linkSections[22]='<option value="http://www2.tv-ark.org.uk/imports/index.html">Imports'
	 linkSections[23]='<option value="http://www2.tv-ark.org.uk/miscellaneous/index.html">Miscellaneous'
	 linkSections[24]='<option value="http://www2.tv-ark.org.uk/mistakes/index.html">Mistakes'
	 linkSections[25]='<option value="http://www2.tv-ark.org.uk/music/index.html">Music'
	 linkSections[26]='<option value="http://www2.tv-ark.org.uk/news/index.html">News'
	 linkSections[27]='<option value="http://www2.tv-ark.org.uk/presenters">Presenters'
	 linkSections[28]='<option value="http://www2.tv-ark.org.uk/pifs/index.html">Public Info Films'
	 linkSections[29]='<option value="http://www2.tv-ark.org.uk/schoolstv/index.html">Schools TV'
	 linkSections[30]='<option value="http://www2.tv-ark.org.uk/soaps/index.html">Soaps'
	 linkSections[31]='<option value="http://www2.tv-ark.org.uk/sport/index.html">Sport'
	 linkSections[32]='<option value="http://www2.tv-ark.org.uk/testcards/index.html">Testcards/Teletext'
	 linkSections[33]='<option value="http://www2.tv-ark.org.uk/weather/index.html">Weather'
	 linkSections[34]='<option value="">----------------------'
	 linkSections[35]='<option value="http://www2.tv-ark.org.uk/about_tvark/index.html">About TVARK'							
	 linkSections[36]='<option value="http://www2.tv-ark.org.uk/search">Search'
	 linkSections[37]='<option value="http://www2.tv-ark.org.uk/Links/index.html">Web Links'							


// **********************************************************************************************

// DON'T TOUCH 

function getLink(form) 
	{
         var sectionaliser=form.tvarksection.selectedIndex									// Refer to first option in form
         if (form.tvarksection.options[sectionaliser].value != "0") 								// Value "0" placed first
		{
             	location=form.tvarksection.options[sectionaliser].value;							// Then set value "0" on page load
		}
    	}

// Adjust anything AFTER the "=" to change appearance and position of the link bar
// **********************************************************************************************

	 var useBackgroundColour="#D6D6D6"
 	 var fontColour		="#000"
	 var useFont		="verdana"
	 var useFontSize	="11px"
	 var useWidth		="138px"
	 var positionLeft	=""
	 var positionTop	="125px"

// **********************************************************************************************

// DON'T TOUCH ANYTHING BELOW HERE

function setupBar(backgroundColour, colour, fontFamily, fontSize, width, left, top) 						// Setup bar adjustments
	{
         this.backgroundColour=backgroundColour
         this.colour=colour
	 this.fontFamily=fontFamily
	 this.fontSize=fontSize
	 this.width=width
	 this.left=left
	 this.top=top
    	}

	theBar=new setupBar(useBackgroundColour,fontColour,useFont,useFontSize,useWidth,positionLeft,positionTop)		// Definitions

			document.write('<form name="tvarksection"><select name="tvarksection" style= "BORDER-BOTTOM: outset; color: '+theBar.colour+'; font-size: '+theBar.fontSize+'; width: '+theBar.width+'; font-family: '+theBar.fontFamily+'; background-color: '+theBar.backgroundColour+'; position:absolute; left: '+theBar.left+'; top: '+theBar.top+';" onChange="getLink(this.form)">');	// Get links on select
for (x in linkSections)	
																// Remote write to html page
	{
		document.write(linkSections[x] + "<br />")									// Append on new line
	}
																
			document.write('</select>');										// Close form
			document.write('</form>');
