function domenu(which)
{
  switch(which)
  {
    default:
      initimages(".")
      document.writeln(menu())
      break
    case "benefits":
      initimages(".")
      document.writeln(menu(menubenefits()))
      break
    case "projects":
      initimages("..")
      document.writeln(menu2(menuprojects()))
      break
    case "newsletters":
      initimages("..")
      document.writeln(menu3(menunewsletters()))
      break
  }
}

function initimages(path)
{
  if(path.length>0 && path.substr(path.length-1,1)!='/') { path+='/images/' }
  HOME_0    =new Image(); HOME_0.src    =path+"home0.gif"
  HOME_1    =new Image(); HOME_1.src    =path+"home1.gif"
  ABOUT_0   =new Image(); ABOUT_0.src   =path+"about0.gif"
  ABOUT_1   =new Image(); ABOUT_1.src   =path+"about1.gif"
  PLAN_0    =new Image(); PLAN_0.src    =path+"plan0.gif"
  PLAN_1    =new Image(); PLAN_1.src    =path+"plan1.gif"
  SUPPORT_0 =new Image(); SUPPORT_0.src =path+"support0.gif"
  SUPPORT_1 =new Image(); SUPPORT_1.src =path+"support1.gif"
  ETEC_0    =new Image(); ETEC_0.src    =path+"etec0.gif"
  ETEC_1    =new Image(); ETEC_1.src    =path+"etec1.gif"

  BUSINESS_0    =new Image(); BUSINESS_0.src    =path+"bus0.gif"
  BUSINESS_1    =new Image(); BUSINESS_1.src    =path+"bus1.gif"
  COMMUNITY_0   =new Image(); COMMUNITY_0.src   =path+"comm0.gif"
  COMMUNITY_1   =new Image(); COMMUNITY_1.src   =path+"comm1.gif"
  CONTACT_0     =new Image(); CONTACT_0.src     =path+"contact0.gif"
  CONTACT_1     =new Image(); CONTACT_1.src     =path+"contact1.gif"
  EDUCATION_0   =new Image(); EDUCATION_0.src   =path+"educ0.gif"
  EDUCATION_1   =new Image(); EDUCATION_1.src   =path+"educ1.gif"
  JOIN_0        =new Image(); JOIN_0.src        =path+"join0.gif"
  JOIN_1        =new Image(); JOIN_1.src        =path+"join1.gif"
  LINKS_0       =new Image(); LINKS_0.src       =path+"links0.gif"
  LINKS_1       =new Image(); LINKS_1.src       =path+"links1.gif"
  NEWS_0        =new Image(); NEWS_0.src        =path+"news0.gif"
  NEWS_1        =new Image(); NEWS_1.src        =path+"news1.gif"
  PROJECTS_0    =new Image(); PROJECTS_0.src    =path+"proj0.gif"
  PROJECTS_1    =new Image(); PROJECTS_1.src    =path+"proj1.gif"
  PUBLICATIONS_0=new Image(); PUBLICATIONS_0.src=path+"pubs0.gif"
  PUBLICATIONS_1=new Image(); PUBLICATIONS_1.src=path+"pubs1.gif"
  TOURISM_0     =new Image(); TOURISM_0.src     =path+"tourism0.gif"
  TOURISM_1     =new Image(); TOURISM_1.src     =path+"tourism1.gif"
  EVENTS_0     	=new Image(); EVENTS_0.src     =path+"events0.gif"
  EVENTS_1     	=new Image(); EVENTS_1.src     =path+"events1.gif"
}

function menu(dynmenu)
{
  var s=''
  s+=menutop()
  s+=menuitem("","index.html",HOME_0.src,"HOME","Home",135,37)
  s+=menuitem("","about.htm",ABOUT_0.src,"ABOUT","About Futureworld",135,37)
  s+=menuitem("","map.htm",PLAN_0.src,"PLAN","Floor Plan",135,37)
  s+=menuitem("","support.htm",SUPPORT_0.src,"SUPPORT","Supporters",135,37)
  s+=menuitem("","projects/etec.htm",ETEC_0.src,"ETEC","ETEC",135,37)
  s+=menuitem("","education1.htm",EDUCATION_0.src,"EDUCATION","Education",135,37)
  s+=menuitem("","events.htm",EVENTS_0.src,"EVENTS","Events",135,37)
  s+=menuitem("","pubs.htm",PUBLICATIONS_0.src,"PUBLICATIONS","Publications",135,37)
  s+=menuitem("","projects.htm",PROJECTS_0.src,"PROJECTS","Projects",135,37)
  s+=menuitem("","join.htm",JOIN_0.src,"JOIN","Join Us",135,37)
  s+=menuitem("","links.htm",LINKS_0.src,"LINKS","Links",135,37)
  s+=menuitem("","contact.htm",CONTACT_0.src,"CONTACT","Contact Us",135,37)
  if(dynmenu) s+=dynmenu
  s+=menubottom()
  return s
}

function menu2(dynmenu)
{
  var s=''
  s+=menutop()
  s+=menuitem("","../index.php",HOME_0.src,"HOME","Home",135,37)
  s+=menuitem("","../about.htm",ABOUT_0.src,"ABOUT","About Futureworld",135,37)
  s+=menuitem("","../map.htm",PLAN_0.src,"PLAN","Floor Plan",135,37)
  s+=menuitem("","../support.htm",SUPPORT_0.src,"SUPPORT","Supporters",135,37)
  s+=menuitem("","etec.htm",ETEC_0.src,"ETEC","ETEC",135,37)
  s+=menuitem("","../news.htm",NEWS_0.src,"NEWS","News",135,37)
   s+=menuitem("","../events.htm",EVENTS_0.src,"EVENTS","Events",135,37)
  s+=menuitem("","../pubs.htm",PUBLICATIONS_0.src,"PUBLICATIONS","Publications",135,37)
  s+=menuitem("","../projects.htm",PROJECTS_0.src,"PROJECTS","Projects",135,37)
  s+=menuitem("","../join.htm",JOIN_0.src,"JOIN","Join Us",135,37)
  s+=menuitem("","../links.htm",LINKS_0.src,"LINKS","Links",135,37)
  s+=menuitem("","../contact.htm",CONTACT_0.src,"CONTACT","Contact Us",135,37)
  if(dynmenu) s+=dynmenu;
  s+=menubottom2()
  return s;
}

function menu3(dynmenu)
{
  var s=''
  s+=menutop()
  s+=menuitem("","../index.php",HOME_0.src,"HOME","Home",135,37)
  s+=menuitem("","../about.htm",ABOUT_0.src,"ABOUT","About Futureworld",135,37)
  s+=menuitem("","../map.htm",PLAN_0.src,"PLAN","Floor Plan",135,37)
  s+=menuitem("","../support.htm",SUPPORT_0.src,"SUPPORT","Supporters",135,37)
  s+=menuitem("","../projects/etec.htm",ETEC_0.src,"ETEC","ETEC",135,37)
  s+=menuitem("","../news.htm",NEWS_0.src,"NEWS","News",135,37)
  s+=menuitem("","../events.htm",EVENTS_0.src,"EVENTS","Events",135,37)
  s+=menuitem("","../pubs.htm",PUBLICATIONS_0.src,"PUBLICATIONS","Publications",135,37)
  s+=menuitem("","../projects.htm",PROJECTS_0.src,"PROJECTS","Projects",135,37)
  s+=menuitem("","../join.htm",JOIN_0.src,"JOIN","Join Us",135,37)
  s+=menuitem("","../links.htm",LINKS_0.src,"LINKS","Links",135,37)
  s+=menuitem("","../contact.htm",CONTACT_0.src,"CONTACT","Contact Us",135,37)
  if(dynmenu) s+=dynmenu;
  s+=menubottom2()
  return s;
}

function menubenefits()
{
  var s='';
  s+=menuitem("Benefits");
  s+=menuitem("Business","business.htm");
  s+=menuitem("Education","education.htm");
  s+=menuitem("Tourism","tourism.htm");
  s+=menuitem("Community","community.htm");
  return s;
}

function menuprojects()
{
  var s='';
  s+=menuitem("Projects");
  s+=menuitem("ETEC","etec.htm");
  s+=menuitem("Energy Tower","fire.htm");
  s+=menuitem("ATEK -1","atek1.htm");
  s+=menuitem("ATEK -2","atek2.htm");
  s+=menuitem("ECO Home","eco2020.htm");
  s+=menuitem("Cleaner Production","cleaner.htm");
  s+=menuitem("Wind Turbine","windturb.htm");
  s+=menuitem("Catchment Model","catchment.htm");
  s+=menuitem("Futureworld site","cringila.htm");
  return s;
}

function menunewsletters()
{
  var s='';
  s+=menuitem("Newsletters");
  s+=menuitem("May 01","may01.htm");
  s+=menuitem("August 00","aug00.htm");
  s+=menuitem("February 00","feb00.htm");
  s+=menuitem("February 99","feb99.htm");
  s+=menuitem("September 98","sep98.htm");
  s+=menuitem("March 98","mar98.htm");
  s+=menuitem("December 97","dec97.htm");
  s+=menuitem("Annual Report 97","annrep97.htm");
  return s;
}

function menuitem(text,url,image,id,alt,width,height)
{
  if(image)
  {
    var s1='\n<TR><TD><table class="menuitem" cellspacing=0 cellpadding=0 border=0><tr><td><A class="menuitem" HREF="';
    var s2='" onmouseover="img_1(\'';
    var s3='\')" onmouseout ="img_0(\'';
    var s4='\')"><img name="';
    var s5='" src="';
    var s6='" alt="';
    var s7='" border="0" width=';
    var s8=' height=';
    var s9='></A></td></tr></table></TD></TR>';
    var ss=s1+url+s2+id+s3+id+s4+id+s5+image+s6+alt+s7+width+s8+height+s9;
  }
  else if(url)
  {
    var s1='\n<TR><TD><table class="menuitem" cellspacing=0 cellpadding=0 border=0><tr><td><A class="menuitem" HREF="';
    var s2='" >&nbsp;&nbsp;';
    var s3='</A></td></tr></table></TD></TR>';
    var ss=s1+url+s2+text+s3;
  }
  else
  {
    var s1='\n<TR><TD><table class="menuitem" cellspacing=0 cellpadding=0 border=0><tr><td class="menuitem"><BR>&nbsp;&nbsp;';
    var s3='</td></tr></table></TD></TR>';
    var ss=s1+text+s3;
  }
  return ss;
}

function menutop()
{
  var s=''
  s+='\n<TABLE bgcolor="#3D88D5" cellspacing=0 cellpadding=0 border=0>'
  s+='\n<TR><td>&nbsp;</td></TR>'
  return s
}

function menubottom()
{
  var s=''
  s+='\n</TR>'
  s+='\n<TR><td><img src="images/tableend.gif" width=135 height=150></td></TR>'
  s+='\n</TABLE>'
  return s;
}

function menubottom2()
{
  var s=''
  s+='\n</TR>'
  s+='\n<TR><td><img src="../images/tableend.gif" width=135 height=150></td></TR>'
  s+='\n</TABLE>'
  return s;
}

function img_0(img_name) { document.images[img_name].src=eval(img_name+'_0.src'); }
function img_1(img_name) { document.images[img_name].src=eval(img_name+'_1.src'); }
