
//  function pageMenu(currentPage,totalPages,subpagetitle){
//	  for(var t = 1; t <= totalPages; t++){
//	  var pagelink = "<a href=\""+subpagetitle+"_"+t+".html\">Page "+t+"<\/a>"
//	  var homelink = "<a href=\"index.html\">Page "+t+"<\/a>"
//		 if(t == currentPage){
//		 // Write current page number without a link
//		 document.write('<div class="topmenu"><b>Page '+t+'</b></div>')
//		 } else
//		 // Write link to next page, unless the page is the index!
//	     if(t == 1){
//			document.write('<div class="topmenu">'+homelink+'</div>')
//			} else {
//		    document.write('<div class="topmenu">'+pagelink+'</div>')
//		 } 
//
//	  }
//  }



function pageMenu(currentPage,totalPages,subpagetitle){
var nextpage = "<a href=\""+subpagetitle+"_"+(currentPage+1)+".html\">Next &raquo;<\/a>"
var prevpage = "<a href=\""+subpagetitle+"_"+(currentPage-1)+".html\">&laquo; Prev<\/a>"
var prevhome = "<a href=\"index.html\">&laquo; Prev<\/a>"

document.write('<div id="gmenu">\n')
document.write('\n<ul class="mnav">\n')

   if(currentPage == 1){
   document.write('<li class="prevtxt"><b>&laquo; Prev</b></li>\n')
   } else if(currentPage == 2){
   document.write('<li class="prevlink"><b>'+prevhome+'</b></li>\n')
   } else {
   document.write('<li class="prevlink"><b>'+prevpage+'</b></li>\n')
   }
   
   for(var t = 1; t <= totalPages; t++){
   var nolink = "<b>Page "+t+"</b>"
   var pagelink = "<a href=\""+subpagetitle+"_"+t+".html\">Page "+t+"<\/a>"
   var homelink = "<a href=\"index.html\">Page "+t+"<\/a>"


      if(t == currentPage){
      document.write('<li class="topmenu">'+nolink+'</li>')
      } else if(t == 1){
      document.write('<li class="topmenu">'+homelink+'</li>')
	  } else {
      document.write('<li class="topmenu">'+pagelink+'</li>')  
	  }
	  	  
	  if(t < totalPages){
      document.write('<li class="topsep">|</li>\n')
	  }
	  
   }

   if(currentPage != totalPages){
   document.write('<li class="nextlink"><b>'+nextpage+'</b></li>\n')
   } else {
   document.write('<li class="nexttxt"><b>Next &raquo;</b></li>\n')
   }
   
   document.write('</ul>\n')
   document.write('<div class="clear"></div>')
   document.write('</div>\n')
}