<!--

	// VsDynMenu.js
	// Dynamic menu - this is based on an array of
	// "Link" objects that contain the URL of the page and a 
	// description that can be used as the anchor text.
	//
	// Written - 24,26 & 28.12.1999, & 30.01.2000 Paul Phillips. 	
	// www.versus-ny.co.uk
	
	var aPageList = new Array(); //Array to hold page info...
	var i = 0;	  				 //Loop counter...
	var sLevel = "../";			 //Level prefix...
	

	// This function defines an object called 'Link'.
	function Link(href,text,status,level) 
			 {     
			 	   this.href = href;   		  // URL
				   this.text = text;   	  	  // Visible description
				   this.status = status;  	  // Window.status property
				   this.level = level;		  // 0 or above. 0=root level.
			 }

    // This function creates a new instance of a 'Link' object
	// and places it in the aPageList array. 
	function setLink(href,text,status) 
			 {     
			 	   aPageList[i] = new Link(href,text,status);
     			   i++;
		     }

    // Construct and return an onMouseOver string...
	function showStatus(nId)
			 {
			  	   var sStatus;
			       sStatus = "window.status = '"+aPageList[nId].status+"';return true";
				   return sStatus;
			 }

    // Construct and return an onMouseOut string...
	function clearStatus()
			 {
			  	   var sStatus;
				   sStatus = "window.status = '';return true"
				   return sStatus;
			 }			 

	// Test which page we are in using the objPage object.
	// Uses the search method of the string object, which returns
	// -1 if a string value is not found in the string object. 
	function thisPage(href)
			 {
			  	   var shref;
				   var sPage = document.location.href;
				   var sUpperPage;
				   var iPos;
				   var iLastPos;
				   				   
				   // Note - enforce to uppercase.
				   sUpperPage = sPage.toUpperCase();
				   shref = href.toUpperCase();
				   
				   // Create string objects for the page file name ("*.htm")
				   // and the reference passed in.
				   var objPage = new String(sUpperPage);
				   var objHref = new String(shref);
				   
				   // Strip out any "/" characters...
				   iPos=0; iLastPos=1;
				   iPos= objHref.indexOf("/");
				   while (iPos != -1)
				   		 {
						  	   iLastPos = iPos;
							   iPos= objHref.indexOf("/",(iPos+1));
					     }
				   shref = shref.substring(iLastPos,shref.length);						 
						 
				   // can we find one within the other ?
			  	   return (objPage.indexOf(shref) == -1);

		     }			 			 

    // Are we in a "root" page, or a lower level page ?
    function inRootLevelPage()
			 {
             var sPage = document.location.href;
			 var sUpperPage;
			 var sReference1 = "MUSIC";
			 var sReference2 = "ARCHIVE";
			 
			 sUpperPage = sPage.toUpperCase();
			 var objPage = new String(sUpperPage);			 

			 // Is this a low level page ?
			 return ((objPage.indexOf(sReference1) == -1) && (objPage.indexOf(sReference2) == -1))
			 }
			 

	
    // Main body of script... 
    // Now populate the array 'aPageList' with 'Link' objects
	// setLink("index.htm","Home","Versus-ny.co.uk Homepage");
	setLink("VsNews.htm","News","Latest band news");
	setLink("vsdiscog.htm","Discography","All the hits !");
	setLink("VsGallery.htm","Galleries","Pictures");
	setLink("VsTourDates.htm","Tour Dates","Current and past tour dates");
	// setLink("vsothers.htm","Spin Offs","Projects outside Versus");
	setLink("VsLinks.htm","Links","Links to other great Versus sites");
	setLink("vscontacts.htm","Contacts","Mail");

	// Do we need to prefix locations with direcory info ?
    if (inRootLevelPage())
		 {
		 sLevel = ""; 
		 }  
	else
	  	 {
		 sLevel = "../";
		 }
		 
	// Output the menu details...
	for (i=0; i< (aPageList.length); i++)				
		{
			document.writeln('<td width="10%" align="center">');

		 	if (thisPage(aPageList[i].href))
			{
  	    	 	 document.writeln('<a class="Menu-small" href="'+sLevel+aPageList[i].href+'" target="_top" onMouseOver="'+showStatus(i)+'" onMouseOut="'+clearStatus(i)+'">'+aPageList[i].text+'</a>');
			}  
			else
			{
			 	 document.writeln('<div class="RedBanner1">');
				 document.writeln(''+aPageList[i].text+'');			
			 	 document.writeln('</div>');
			}
		 	document.writeln('</td>');		
		}

// -->

