var emailBo = '<A HREF="mailto:bo@fatfisherman.com" STYLE="text-decoration:none">bo@fatfisherman.com</A>';

var geoHREF = '/links_geo/';
var linksHREF = '/links/';
var mainHREF = '/';

//var ns6 = document.getElementById && !document.all;
//isIE = (document.all ? true : false);
//isDOM = (document.getElementById ? true : false);

// overly simplistic test for IE
isIE = (document.all ? true : false);
// both IE5 and NS6 are DOM-compliant (well, sort of...)
isDOM = (document.getElementById ? true : false);

function toggleVisible(divname) {
 divstyle = getDivStyle(divname);
 if (divstyle.visibility == 'visible' || divstyle.visibility == 'show') {
   divstyle.visibility = 'hidden';
 } else {
   divstyle.visibility = 'visible';
 }
}

function getDivStyle(divname) {
 var style;
 if (isDOM) { style = document.getElementById(divname).style; }
 else { style = isIE ? document.all[divname].style
                     : document.layers[divname]; } // NS4
 return style;
}

var x = new Array(new Array(	new Array('mnu_world','#',235,181),
				new Array(	new Array('Africa',geoHREF+'africa/',''),
						new Array('Antartica',geoHREF+'antartica/',''),
						new Array('Asia',geoHREF+'asia/',''),
						new Array('Australasia',geoHREF+'australasia/',''),
						new Array('Europe',geoHREF+'europe/',''),
						new Array('Middle East',geoHREF+'middle_east/',''),
						new Array('North America',geoHREF+'america_north/',''),
						new Array('Central America',geoHREF+'america_central/',''),
						new Array('South America',geoHREF+'america_south/',''))),
		  new Array(	new Array('mnu_uk','#',235,181),
				new Array(	new Array('England',geoHREF+'europe/england.html',''),
						new Array('Northern Ireland',geoHREF+'europe/northern_ireland.html',''),
						new Array('Scotland',geoHREF+'europe/scotland.html',''),
						new Array('Wales',geoHREF+'europe/wales.html',''),
						new Array('Isle of Man',geoHREF+'europe/england_isle_of_man.html',''),
						new Array('Channel Islands',geoHREF+'europe/england_channel_islands.html',''))),
		  new Array(	new Array('mnu_tacklebox','#',235,181),
				new Array(
						new Array('Apparel',linksHREF+'equipment_and_supplies/angling_apparel.html',''),
						new Array('Bait Makers',linksHREF+'equipment_and_supplies/bait_and_attractors_companies.html',''),
						new Array('Boxes Etc',linksHREF+'equipment_and_supplies/bivvy_kit_plus.html',''),
						new Array('Rod Building & Repair',linksHREF+'equipment_and_supplies/rod_building_and_repair.html',''),
						new Array('Tackle Makers',linksHREF+'equipment_and_supplies/tackle_manufacturers.html',''))),
		  new Array(	new Array('mnu_library','#',235,181),
				new Array(	new Array('Artwork',linksHREF+'library/angling_artwork.html',''),
						new Array('Book Stores',linksHREF+'library/fishing_book_stores.html',''),
						new Array('Fishing Fiction',linksHREF+'library/fishing_fiction.html',''),
						new Array('Magazines',linksHREF+'library/fishing_magazines.html',''),
						new Array('Memoires',linksHREF+'library/fishing_biographies_and_reminiscences.html',''),
						new Array('Publishers',linksHREF+'library/angling_publishers.html',''),
						new Array('Television',linksHREF+'library/angling_television.html',''),
						new Array('DVDs & Videos',linksHREF+'library/fishing_dvds_and_videos.html',''))),
		  new Array(	new Array('mnu_facts','#',235,181),
				new Array(	new Array('Collective Terms',linksHREF+'fun/collective_terms.html',''),
						new Array('Conservation',linksHREF+'angling/angling_and_conservation.html',''),
						new Array('Facts & Figures',linksHREF+'fun/facts.html',''),
						new Array('Fisheries Management',linksHREF+'angling/fisheries_management.html',''),
						new Array('Software',linksHREF+'library/fishing_software.html',''),
						new Array('Study',linksHREF+'library/study.html',''),
						new Array('Weather & Tides',linksHREF+'angling/angling_and_weather.html',''))),
		  new Array(	new Array('mnu_fun','#',235,181),
				new Array(	new Array('Collectibles',linksHREF+'library/angling_antiques_and_collectibles.html',''),
						new Array('Fatfisherman Webring','#',''),
						new Array('Fishing Top 1000','#',''),
						new Array('Jokes & Urban Myths',linksHREF+'fun/fishing_humour.html',''),
						new Array('Miscellany',linksHREF+'fun/miscellany.html',''),
						new Array('Stamps',linksHREF+'library/fishing_on_stamps.html',''),
						new Array('Webrings','#',''))),
		  new Array(	new Array('mnu_howtofishfor','#',235,181),
				new Array(	new Array('Fish Species Index',linksHREF+'angling_tips/how_to_fish_for....html',''),
						new Array('Hints & Tips',linksHREF+'fun/fishing_hints_and_tips.html',''),
						new Array('Starting Out',linksHREF+'fishing_types_and_methods/getting_started.html',''))),
		  new Array(	new Array('mnu_methodsangles','#',235,181),
				new Array(	
						new Array('Fishing Methods Index',linksHREF+'fishing_types_and_methods/fishing_methods.html',''),
						new Array('Disabled Angling',linksHREF+'angling/angling_and_disability.html',''))))						


function showMenu(object) {
  if (document.getElementById && document.getElementById(object) != null)
    node = document.getElementById(object).style.visibility='visible';
  else if (document.layers && document.layers[object] != null)
    document.layers[object].visibility = 'visible';
  else if (document.all)
    document.all[object].style.visibility = 'visible';
}


function hideMenu(object) {
  if (document.getElementById && document.getElementById(object) != null)
    node = document.getElementById(object).style.visibility='hidden';
  else if (document.layers && document.layers[object] != null)
    document.layers[object].visibility = 'hidden';
  else if (document.all)
    document.all[object].style.visibility = 'hidden';
}


function hideAll(){
  var a
  var v = (document.layers) ? ".visibility" : ".style.visibility";
  var arr = (document.layers) ? document.layers : (document.all) ? document.all.tags("DIV") : document.getElementsByTagName("DIV");
  for(var i=0;i<arr.length;i++){
    
    a=arr[i].id;
    if (a.substring(0,4) == "mnu_") {
    
    	eval("arr["+i+"]"+v+"='hidden'");
    }
  }
  if (document.layers != null) {
    document.layers['advert'].visibility = 'visible';
  }
  else if (document.all) {
    document.all['advert'].style.visibility = 'visible';
  }
}


function showJustMe(object) {
  if (document.layers && document.layers[object]) {
    hideAll();
    showMenu(object);
  }
  else if (document.all) {
    hideAll();
    showMenu(object);
  }
}


function WriteDIVs() {
  for (idx=0; idx<x.length; idx++) {
    generateDIVs(x[idx][0][0],idx,x[idx][0][2],x[idx][0][3]);
    if (idx > 0) {
    }
  }
}


function generateDIVs(jsLayerName,jsLayerNumber,jsExtWidth,jsIntWidth){
  // height of right vertical spacer = (number of items x 16 px) + 19 px
  LayerHeight = ((x[idx][1].length)*16)+19;
  document.writeln('<DIV ID="'+ jsLayerName +'">');
  document.writeln('<table border="0" cellspacing="0" cellpadding="0">');
  document.writeln('  <tr>');
  document.writeln('    <td colspan="5" onMouseOver="hideAll()"><img src="/images/gen_spacer.gif" width="' + jsExtWidth + '" height="20"></td>');
  document.writeln('  </tr>');
  document.writeln('  <tr>');
  document.writeln('    <td><img src="/images/gen_spacer.gif" width="20" height="7"></td>');
  document.writeln('    <td><img src="/images/gen_popup_top_left.gif" width="7" height="7"></td>');
  document.writeln('    <td background="/images/gen_popup_top.gif"><img src="/images/gen_spacer.gif" width="1" height="7"></td>');
  document.writeln('    <td><img src="/images/gen_popup_top_right.gif" width="7" height="7"></td>');
  document.writeln('    <td rowspan="3" onMouseOver="hideAll()"><img src="/images/gen_spacer.gif" width="20" height="' + LayerHeight +'"></td>');
  document.writeln('  </tr>');
  document.writeln('  <tr>');
  document.writeln('    <td width="20" valign="top" onMouseOver="showJustMe(\''+ jsLayerName +'\')"><img src="/images/gen_popup_arrow.gif" width="20" height="20"><br><img src="/images/gen_spacer.gif" width="20" height="' + (LayerHeight-34) +'"></td>');
  document.writeln('    <td width="7" background="/images/gen_popup_left.gif"><img src="/images/gen_spacer.gif" width="7" height="1"></td>');
  document.writeln('    <td bgcolor="#607EA5" width="' + jsIntWidth +'" valign="top">');

    for (i=0; i<x[idx][1].length; i++) {
      document.writeln('<a href="'+ x[jsLayerNumber][1][i][1] +'" onMouseOver="');
      a = x[jsLayerNumber][1][i][0];
      for (i2=0; i2<x[idx][1].length; i2++) {
        b = x[jsLayerNumber][1][i2][0];
        c = x[jsLayerNumber][1][i2][2];
        if (b != a && c != '') {
          document.writeln('hideMenu(\''+ c +'\'),');
        }
        else if (c != '') {
          document.writeln('showMenu(\''+ c +'\'),');
        }
      }
    document.writeln('hideMenu(\'dummy\')" class="navigation">'+ x[jsLayerNumber][1][i][0] + '</a><br>');
    }

  document.writeln('    <td width="7" background="/images/gen_popup_right.gif" bgcolor="#317B84">&nbsp;</td>');
  document.writeln('  </tr>');
  document.writeln('  <tr>');
  document.writeln('    <td height="7" width="20"><img src="/images/gen_spacer.gif" width="20" height="7"></td>');
  document.writeln('    <td height="7" width="7"><img src="/images/gen_popup_bottom_left.gif" width="7" height="7"></td>');
  document.writeln('    <td height="7" background="/images/gen_popup_bottom.gif"><img src="/images/gen_spacer.gif" width="' + jsIntWidth +'" height="7"></td>');
  document.writeln('    <td><img src="/images/gen_popup_bottom_right.gif" width="7" height="7"></td>');
  document.writeln('  </tr>');
  document.writeln('  <tr>');
  document.writeln('    <td colspan="5" onMouseOver="hideAll()"><img src="/images/gen_spacer.gif" width="' + jsExtWidth + '" height="20"></td>');
  document.writeln('  </tr>');
  document.writeln('</table>');
  document.writeln('</DIV>');;
}

function openWindow(url) {
  popupWin = window.open(url, 'openWin', "width=400, height=250, scrollbars=yes, resizable=yes"); 
}
