// -------------------------------------------------------
// Menu System
// michaelwood
//
// Modified for 600 Finance by
// Darren Phillips at SYS Group
// -------------------------------------------------------

function writeSubMenu(section,whichSubPage){
// -------------------------------------------------------
// Naming Conventions
// Single word: First three letters of first word in lower case
// Exception new is NEWS 
// Two plus words: First three letters of first word in lower case, Cap of second word, second in lower 
// Add new menus to Array statements below and Menu items to set up
// -------------------------------------------------------

    hom = new Array() ;
      homHref = new Array() ;
    busOv = new Array() ;
      busOvHref = new Array() ;
    corIn = new Array() ;
      corInHref = new Array() ;
    news = new Array() ;
      newsHref = new Array() ;
    lin = new Array() ;
      linHref = new Array() ;
    opeCo = new Array() ;
      opeCoHref = new Array() ;
    con = new Array() ;
      conHref = new Array() ;
    conA = new Array() ;
      conAHref = new Array() ;
    conB = new Array() ;
      conBHref = new Array() ;
    conC = new Array() ;
       conCHref = new Array() ;
    conD = new Array() ;
       conDHref = new Array() ;
    sea = new Array() ;
      seaHref = new Array() ;
    sitMa = new Array() ;
      sitMaHref = new Array() ;
    copIn = new Array() ;
      copInHref = new Array() ;
    fin = new Array() ;
      finHref = new Array;
    app = new Array();
      appHref = new Array;
    cta = new Array();
      ctaHref = new Array;
    SpOff = new Array();
      SpOffHref = new Array;
	  
// -------------------------------------------------------
// Set up menus
// -------------------------------------------------------
	hom[0] = '' 
	  homHref[0] = '' 
	
	SpOff[0] = ''
	  SpOffHref[0] = ''

	busOv[0] = '' 
	  busOvHref[0] = '' 

	cta[0] = 'Main'
	  ctaHref[0] = 'contact.htm'
	cta[1] = 'Andrew Garaway'
	  ctaHref[1] = 'andrewg.htm'
	cta[2] = 'Chris Smith'
	  ctaHref[2] = 'chrissmi.htm'
	cta[3] = 'Jeff Rimmer'
	  ctaHref[3] = 'jeffrim.htm'
	cta[4] = 'Other'
	  ctaHref[4] = 'othercont.htm'


	fin[0] = 'Introduction' 
	  finHref[0] = 'finance.htm' 
	fin[1] = '<img src="images/3waysm.gif" align="middle" border="0"> Way Agreement' 
	  finHref[1] = 'rvo.htm' 
	fin[2] = 'Hire Purchase' 
	  finHref[2] = 'hp.htm' 
	fin[3] = 'Finance Lease' 
	  finHref[3] = 'flease.htm' 
	fin[4] = 'Operating Lease' 
	  finHref[4] = 'olease.htm'
	fin[5] = 'Equity Release' 
	  finHref[5] = 'equit.htm'
	fin[6] = 'Sale and Leaseback' 
	  finHref[6] = 'slease.htm'
	fin[7] = 'Structured Agreement' 
	  finHref[7] = 'sagree.htm'
	fin[8] = 'Protection Packages' 
	  finHref[8] = 'mdb.htm'

	app[0] = 'Step 1 of 5' 
	  appHref[0] = 'approve1.asp' 
	app[1] = 'Step 2 of 5' 
	  appHref[1] = 'calculator.asp' 
	app[2] = 'Step 3 of 5' 
	  appHref[2] = 'approve.asp' 
	app[3] = 'Step 4 of 5' 
	  appHref[3] = 'stage4-2.asp' 
	app[4] = 'Step 5 of 5' 
	  appHref[4] = 'submit.asp'
	
	corIn[0] = 'Introduction'
	  corInHref[0] = 'six02.html'
	corIn[1] = 'Chairman\'s Statement'
	  corInHref[1] = 'six02-1.html'
	corIn[2] = 'Chief Executive\'s Review'
	  corInHref[2] = 'six02-2.html'
	corIn[3] = 'Directors'
	  corInHref[3] = 'six02-3.html'
	corIn[4] = 'Corporate Details'
	  corInHref[4] = 'six02-4.html'
	corIn[5] = 'Policy Statement'
	  corInHref[5] = 'six02-5.html'
	corIn[6] = 'Annual Report'
	  corInHref[6] = 'six02-6.html'
	corIn[7] = 'Full Financial Details'
	  corInHref[7] = 'six02-7.html'


	news[0] = 'Introduction'
	  newsHref[0] = 'six03a.html'
	news[1] = 'Press Releases'
	  newsHref[1] = 'six03-1.asp'
	news[2] = 'Group Exhibitions'
	  newsHref[2] = 'six03-2.asp'
	news[3] = 'News Archive'
	  newsHref[3] = 'six03-3.asp'


	opeCo[0] = 'Introduction'
	  opeCoHref[0] = 'six05.html'
	opeCo[1] = 'Manufacturing Operations'
	  opeCoHref[1] = 'six05a.asp'
	opeCo[2] = 'Distribution Operations'
	  opeCoHref[2] = 'six06.asp'
	opeCo[3] = 'Support Operations'
	  opeCoHref[3] = 'six06a.asp'

	con[0] = ''
	  conHref[0] = ''

	sitMa[0] = ''
	  sitMaHref[0] = ''

	conA[0] = 'Contact Us'
	  conAHref[0] = 'six07.html'
	conA[1] = 'Local Map'
	  conAHref[1] = 'six07-2loc1a.html'
	conA[2] = 'Regional Map'
	  conAHref[2] = 'six07-2loc1b.html'

	conB[0] = 'Contact Us'
	  conBHref[0] = 'six07.html'
	conB[1] = 'Local Map'
	  conBHref[1] = 'six07-2loc2a.html'
	conB[2] = 'Regional Map'
	  conBHref[2] = 'six07-2loc2b.html'

	conC[0] = 'How To Find Us'
	  conCHref[0] = 'six07-2loc1.html'
	conC[1] = 'Local Map'
	  conCHref[1] = 'six07-2loc1a.html'
	conC[2] = 'Regional Map'
	  conCHref[2] = 'six07-2loc1b.html'

	conD[0] = 'How to Find Us'
	  conDHref[0] = 'six07-2loc2.html'
	conD[1] = 'Local Map'
	  conDHref[1] = 'six07-2loc2a.html'
	conD[2] = 'Regional Map'
	  conDHref[2] = 'six07-2loc2b.html'

	sea[0] = ''
	  seaHref[0] = ''

	copIn[0] = 'Copyright Information'
	  copInHref[0] = 'copy.htm'
	copIn[1] = 'Legal Information'
	  copInHref[1] = 'legal.htm'
	copIn[2] = 'Privacy Policy'
	  copInHref[2] = 'dpa.htm'


	  
// -------------------------------------------------------
//  Create the titles
// -------------------------------------------------------

	if (section=='hom'){writeSection='Welcome To 600 Finance'}
	if (section=='busOv'){writeSection='Business Overview'}
	if (section=='corIn'){writeSection='Corporate Information'}
	if (section=='news'){writeSection='News'}
	if (section=='lin'){writeSection='Links'}
	if (section=='opeCo'){writeSection='Operating Companies'}
	if (section=='con'){writeSection='Contact'}
	if (section=='conA'){writeSection='Contact'}
	if (section=='conB'){writeSection='Contact'}
	if (section=='conC'){writeSection='Contact'}
	if (section=='conD'){writeSection='Contact'}
	if (section=='sea'){writeSection='Search'}
	if (section=='sitMa'){writeSection='Site Map'}
	if (section=='copIn'){writeSection='600 Finance'}
	if (section=='fin'){writeSection='Finance Options'}
	if (section=='app'){writeSection='On-Line Approval'}
	if (section=='SpOff'){writeSection='Special Offers'}
	if (section=='cta'){writeSection='Contact'}

	if (whichSubPage==''){writeSubPage=' '}
//	else if (whichSubPage==undefined){writeSubPage=' '}
	else {writeSubPage = whichSubPage}
	
// -------------------------------------------------------
// Write the menus
// -------------------------------------------------------

	if (section=='hom'){max = eval(hom.length-1);}
	if (section=='SpOff'){max = eval(SpOff.length-1);}
	if (section=='busOv'){max = eval(busOv.length-1);}
	if (section=='corIn'){max = eval(corIn.length-1);}
	if (section=='news'){max = eval(news.length-1);}
	if (section=='lin'){max = eval(lin.length-1);}
	if (section=='opeCo'){max = eval(opeCo.length-1);}
	if (section=='con'){max = eval(con.length-1);}
	if (section=='conA'){max = eval(conA.length-1);}
	if (section=='conB'){max = eval(conB.length-1);}
	if (section=='conC'){max = eval(conC.length-1);}
	if (section=='conD'){max = eval(conD.length-1);}
	if (section=='sea'){max = eval(sea.length-1);}
	if (section=='copIn'){max = eval(copIn.length-1);}
	if (section=='fin'){max = eval(fin.length-1);}
	if (section=='app'){max = eval(app.length-1);}
	if (section=='cta'){max = eval(cta.length-1);}

// -------------------------------------------------------
// Write html
// -------------------------------------------------------

	location.reload()

	document.write('<html>')
	document.write('<head>')
	document.write('<link rel=stylesheet href=css/main.css type=text/css></link>')
	document.write('<script src=jscript/submenu.js type=text/javascript></script>')
	document.write('</head>')
	document.write('<body bgcolor=#ffffff>')

	document.write('<table width=604 cellpadding=0 cellspacing=0 border=0 align=center style=\"margin-right: 18px;\">')
	document.write('<tr>')
	document.write('<td valign=top align=left class=col1>')

	if (section=='hom') {
	  document.write('<h2 class=\"title\">'+writeSection+'</h2>')
	  document.write('<p class=\"submenu\"><font color=\"cc3333\">Making it easier to buy the world\'s best machine tools</p>')
	  }
	else{	
	  document.write('<h3 class=\"title\">') ;
	  if (whichSubPage==''){colon=''}
	  else {colon=': '}
	  document.write(writeSection + colon + writeSubPage) ;
	  document.write('</h3>') ;
	  }
	document.write('<p class=\"submenu\">') ;

	if (section=='busOv'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (busOv[ticker].value == "" && busOv[0].value =="0" ){busOv[ticker].value = "Error"}
  	      document.write('<a href=' + busOvHref[ticker] + ' target=submain>' + busOv[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='SpOff'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (SpOff[ticker].value == "" && SpOff[0].value =="0" ){SpOff[ticker].value = "Error"}
  	      document.write('<a href=' + SpOffHref[ticker] + ' target=submain>' + SpOff[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }
	if (section=='corIn'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (corIn[ticker].value == "" && corIn[0].value =="0" ){corIn[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + corInHref[ticker] + ' target=submain>' + corIn[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='news'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (news[ticker].value == "" && news[0].value =="0" ){news[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + newsHref[ticker] + ' target=submain>' + news[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='lin'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (lin[ticker].value == "" && lin[0].value =="0" ){lin[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + linHref[ticker] + ' target=submain>' + lin[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }
	  
	if (section=='opeCo'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (opeCo[ticker].value == "" && opeCo[0].value =="0" ){opeCo[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + opeCoHref[ticker] + ' target=submain>' + opeCo[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='disOp'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (disOp[ticker].value == "" && disOp[0].value =="0" ){disOp[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + disOpHref[ticker] + ' target=submain>' + disOp[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='con'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (con[ticker].value == "" && con[0].value =="0" ){con[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + conHref[ticker] + ' target=submain>' + con[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }
  
	if (section=='conA'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (conA[ticker].value == "" && conA[0].value =="0" ){conA[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + conAHref[ticker] + ' target=submain>' + conA[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='conB'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (conB[ticker].value == "" && conB[0].value =="0" ){conB[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + conBHref[ticker] + ' target=submain>' + conB[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='conC'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (conC[ticker].value == "" && conC[0].value =="0" ){conC[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + conCHref[ticker] + ' target=submain>' + conC[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='conD'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (conD[ticker].value == "" && conD[0].value =="0" ){conD[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + conDHref[ticker] + ' target=submain>' + conD[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='sea'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (sea[ticker].value == "" && sea[0].value =="0" ){sea[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + seaHref[ticker] + ' target=submain>' + sea[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }
	  
	if (section=='sitMa'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (sitMa[ticker].value == "" && sitMa[0].value =="0" ){sitMa[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + sitMaHref[ticker] + ' target=submain>' + sitMa[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='copIn'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (copIn[ticker].value == "" && copIn[0].value =="0" ){copIn[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + copInHref[ticker] + ' target=submain>' + copIn[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }


	if (section=='fin'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (fin[ticker].value == "" && fin[0].value =="0" ){fin[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + finHref[ticker] + ' target=submain>' + fin[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='app'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (app[ticker].value == "" && app[0].value =="0" ){app[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + appHref[ticker] + ' target=submain>' + app[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	if (section=='cta'){
	    for (ticker = 0; ticker <= max; ticker++){
	      if (cta[ticker].value == "" && cta[0].value =="0" ){cta[ticker].value = "Parent Element not selected"}
	      document.write('<a href=' + ctaHref[ticker] + ' target=submain>' + cta[ticker] + '</a>')
	      if (ticker != eval(max)){document.write('&nbsp;| ')}
	      }
	  }

	document.write('</p>')

	document.write('</script>')
	document.write('</td>')
	document.write('</tr>')
	document.write('</table>')
	document.write('</body>')
	document.write('</html>')
  }
