//**************************************************************** 
// FloatMenu Script 2.0, By Rodrigo López, erigo@tpg.com.au
// (c) Copyright Rodrigo López, April 2004
// (Replacement to Version 1.0 By Rodrigo Lopez, January 2002.)
//**************************************************************** 

self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);

function StartMyMenu() {
 AddRootMenu("100", "126", "navy");
  AddTopLink("Home", "index.htm");
  AddTopLink("About Us", "about.asp");
  AddTopMenu("Flags", "");
  AddTopMenu("Flag Poles and Accessories", "");
  AddTopLink("Bunting and Banners", "banners.asp");
  AddTopLink("Souvenirs", "souvenirs.asp");
  AddTopMenu("Flag History & Info", "");
 EndRootMenu();

 AddSubMenu("2", "#6b86d6");
  AddMenuItem("Fully Sewn Flags", "sewnflags.asp", "blank.gif");
  AddMenuItem("Screen Printed Flags", "screenflags.asp", "blank.gif");
  AddMenuItem("Deskflags and Hand Waivers", "deskflags.asp", "blank.gif");
 EndSubMenu();

 AddSubMenu("3", "#6b86d6");
  AddMenuItem("Flag Poles", "poles.asp", "blank.gif");
  AddMenuItem("Flag Poles Bases", "polebases.asp", "blank.gif");
  AddMenuItem("Flag Pole Accessories", "accessories.asp", "blank.gif");
  AddMenuItem("Flag Poles for Hire", "polehire.asp", "blank.gif");
 EndSubMenu();

 AddSubMenu("6", "#6b86d6");
  AddMenuItem("Flag History", "history.asp", "blank.gif");
  AddMenuItem("Australian State Flags", "stateflags.asp", "blank.gif");
  AddMenuItem("Dates to Fly the Flag", "flagdates.asp", "blank.gif");
  AddMenuItem("Flag Etiquette", "flagetiquette.asp", "blank.gif");
  AddMenuItem("Flag Poem", "flagpoem.asp", "blank.gif");
 EndSubMenu();

}

// ### Do not modify here down ###

var ShowImages = 0;
var imgFld = "images/"
var imgBlank = "blank.gif"
var imgTopSlash = "topslash.gif";
var imgTopLeft = "topleft.gif";
var imgTopRight = "topright.gif";

var CopyRight = unescape("FloatMenu%202.0%20by%20Rod%20L%F3pez%2C%202004.%20rod.lopez@archery-it.net.au");
var i = 0;
var t = 0; //Numbers the top menus
var s = 0; //Numbers the sub menus
aSub = new Array(); //Array of submenu numbers
var timerMove; // Timer to move the floating menu
var timerCopy; // Timer to display Copyright notice
var tmpColour; // Colour of the current Submenu - used in building it
var HLColour; // Text Highlight Colour (same as Top Menu Colour)
var NS4Offset; // Left placement of floating menu on Netscape 4 (brwVersion == 2) 
var brwVersion; // For Browser detection

if (document.getElementById) { brwVersion = 3; } //DOM2 Compliant - eg: IE5+, Netscape 6, Mozilla, etc
else if (document.all) { brwVersion = 1; } //IE4+ - eg: Internet Explorer 4
else if (document.layers) { brwVersion = 2; } //NS4+ - eg: Netscape 4.79
else { brwVersion = 0; } //other (Non Dynamic Content)

// Build Menu Functions

// Build Menu Functions

 function AddDashSpace() { document.writeln("<td valign=top><img src='" + imgFld + imgTopSlash + "' height='15'></td>"); }

 function AddRootMenu(aLeft, aTop, aColour) {
  HLColour = aColour;
  if (brwVersion == 0) { document.writeln("<table border='0'><tr><td align='center' bgcolor='#ffff80'><font color='#ff0000'><b>Your Browser does not support Dynamic content!<br>We recommend using Microsoft Internet Explorer 5 minimum.</b></font></td></tr><tr><td align='center'>"); }
  else if (brwVersion == 2) { document.writeln("<layer id='MyMenu' class='NS4RootMenu'>"); NS4Offset = aLeft; }
  else { document.writeln("<div id='MyMenu' style='position: absolute; top: " + aTop + "px; left: " + aLeft + "px; margin-top: 0px;'>"); }
  document.writeln("<table border='0' cellpadding='0' cellspacing='0' bgcolor='" + aColour + "'><tr>");
  //document.writeln("<td valign='bottom'><img src='" + imgFld + imgTopLeft + "' height='15'></td>");
 }

 function EndRootMenu() {
  //original: document.writeln("<td valign='bottom'><img src='" + imgFld + imgTopRight + "' height='15'></td><td bgcolor='#ffffff' style='font: normal 10px Arial; color: #d5d5d5;'> &nbsp; " + brwVersion + "</td></tr>");
  document.writeln("</tr>");
  document.writeln("</table>");
  if (brwVersion == 0) { document.writeln("</td></tr><tr><td align='center'><table border='0'><tr>"); }
 }

 function AddTopLink(Desc, Link) {
  if (t != 0) { AddDashSpace(); } // Add Dash Spacer
  if (brwVersion == 0) { document.writeln("<td class='TopMenu' nowrap><a class='Menu' href='" + Link + "'>" + Desc + "</a></td>"); }
  else if (brwVersion == 2) { document.writeln("<td class='TopMenu' nowrap><ilayer id='mnu" + t + "'><a class='Menu' href='" + Link + "'>" + Desc + "</a></ilayer></td>"); }
  else { document.writeln("<td class='TopMenu' nowrap><span id='mnu" + t + "'><a class='Menu' href='" + Link + "'>" + Desc + "</a></span></td>"); }
  t = t + 1;
 }

 function AddTopMenu(Desc, Link) {
  if (t != 0) { AddDashSpace(); } // Add Dash Spacer
  if (Link == "") { //do not use hyperlinks
   if (brwVersion == 0) { document.writeln("<td class='TopMenu' nowrap>" + Desc + "</td>"); }
   else if (brwVersion == 2) { document.writeln("<td class='TopMenu' nowrap><ilayer id='mnu" + t + "' onMouseOver='ShowMenu(\"submnu" + t + "\");' onMouseOut='HideMenu(\"submnu" + t + "\");'>" + Desc + "</ilayer></td>"); }
   else { document.writeln("<td class='TopMenu' nowrap><span id='mnu" + t + "' onMouseOver='ShowMenu(\"submnu" + t + "\");' onMouseOut='HideMenu(\"submnu" + t + "\");'>" + Desc + "</span></td>"); }
  } else { //use hyperlinks
   if (brwVersion == 0) { document.writeln("<td class='TopMenu' nowrap><a class='Menu' href='" + Link + "'>" + Desc + "</a></td>"); }
   else if (brwVersion == 2) { document.writeln("<td class='TopMenu' nowrap><ilayer id='mnu" + t + "'><a class='Menu' href='" + Link + "' onMouseOver='ShowMenu(\"submnu" + t + "\");' onMouseOut='HideMenu(\"submnu" + t + "\");'>" + Desc + "</a></ilayer></td>"); }
   else { document.writeln("<td class='TopMenu' nowrap><span id='mnu" + t + "'><a class='Menu' href='" + Link + "' onMouseOver='ShowMenu(\"submnu" + t + "\");' onMouseOut='HideMenu(\"submnu" + t + "\");'>" + Desc + "</a></span></td>"); }
  }
  t = t + 1;
 }

 function AddSubMenu(aNum, aColour) {
  if (brwVersion == 2) { var aLeft = parseInt(NS4Offset); }
  else { var aLeft = 0; } // Left image = 30px wide
  if (brwVersion == 0) { document.writeln("<td valign='top'>"); }
  else if (brwVersion == 2) {
    for(var i = 0; i < aNum; i++) {
      aLeft = aLeft + parseInt(eval("document.layers[\"MyMenu\"].layers[\"mnu" + i + "\"].clip.width") + 17); // spacers = 17px wide
      aTop = parseInt(eval("document.layers[\"MyMenu\"].layers[\"mnu" + i + "\"].clip.height")); }
    document.writeln("<layer bgColor='" + aColour + "' id='submnu" + aNum + "' onMouseOver='ShowMenu(\"submnu" + aNum + "\");' onMouseOut='HideMenu(\"submnu" + aNum + "\");' left='" + aLeft + "' top='" + aTop + "' visibility='hide'>"); }
  else if (brwVersion == 1) {
   for(var i = 0; i < aNum; i++) { aLeft = aLeft + parseInt(eval("mnu" + i + ".offsetWidth") + 17); } // spacers = 17px wide
   document.writeln("<div id='submnu" + aNum + "' onMouseOver='ShowMenu(\"submnu" + aNum + "\");' onMouseOut='HideMenu(\"submnu" + aNum + "\");' style='position: absolute; top: 13px; left: " + aLeft + "px; visibility: hidden;'><span id='smnu" + aNum + "'>"); }
  else { // Browser == 3
   if (document.all && navigator.userAgent.indexOf("Opera") == -1) { aTop = parseInt(document.getElementById("MyMenu").offsetHeight - (document.getElementById("MyMenu").offsetHeight - document.getElementById("mnu" + aNum).offsetHeight)/2); } // Internet Explorer
   else if (navigator.userAgent.indexOf("Opera") != -1) { aTop = parseInt(document.getElementById("MyMenu").offsetHeight * 4/5 - 1); }
   else { aTop = parseInt(document.getElementById("mnu" + aNum).offsetHeight); } //Mozilla compliant
   for(var i = 0; i < aNum; i++) { aLeft = aLeft + parseInt(document.getElementById("mnu" + i).offsetWidth) + 17; } // spacers = 17px wide
   document.writeln("<div id='submnu" + aNum + "' onMouseOver='ShowMenu(\"submnu" + aNum + "\");' onMouseOut='HideMenu(\"submnu" + aNum + "\");' style='position: absolute; top: " + aTop + "px; left: " + aLeft + "px; visibility: hidden;'><span id='smnu" + aNum + "'>"); }
  document.writeln("<table border='0' cellpadding='0' cellspacing='0' bgcolor='" + aColour + "' style='padding-top: 0px; border: solid 1px white;'>"); //original: no border
  document.writeln("<tr class='SubMenu'><td colspan='3' height='5'>&nbsp;</td></tr>");
  tmpColour = aColour;
  aSub[s] = aNum;
  s = s + 1;
 }

 function AddMenuSpace() {
  document.writeln("<tr class='SubMenu'><td>&nbsp;</td><td><table width='100%' border='0' cellpadding='0' cellspaccing='0'><tr><td bgcolor='#ffffff'><img src='" + imgFld + imgBlank + "' height='1'></td></tr></table></td><td>&nbsp;</td></tr>");
 }

 function AddMenuItem(Desc, Link, Img) {
  var myImg = "<img src='" + imgFld + imgBlank + "' border=0 align=middle width='1' height='22'>";
  if (ShowImages == 1) {
   if (Img != "") { myImg = "<img src='" + imgFld + Img + "' border=0 align=middle width='24' height='22'>"; }
   else { myImg = "<img src='" + imgFld + imgBlank + "' border=0 align=middle width='24' height='22'>"; }}
  if (brwVersion == 2 || brwVersion == 0) { document.writeln("<tr class='SubMenu'><td>&nbsp;</td><td nowrap><a class='Menu' href='" + Link + "'>" + myImg + Desc + "</a></td><td>&nbsp;</td></tr>"); }
  else { document.writeln("<tr class='SubMenu'><td>&nbsp;</td><td nowrap onMouseOver='HlOnMenu(this, \"" + Link + "\");' onMouseOut='HlOffMenu(this, \"" + tmpColour + "\");' onClick='document.location=\"" + Link + "\";'>" + myImg + Desc + "</td><td>&nbsp;</td></tr>"); }
 }

 function AddMenuListItem(Desc, Link, Img) {
  var myImg = "<img src='" + imgFld + imgBlank + "' border=0 align=middle width='1' height='22'>";
  if (brwVersion == 2 || brwVersion == 0) { document.writeln("<tr class='SubMenu'><td>&nbsp;</td><td nowrap><a class='Menu' href='" + Link + "'><li>" + myImg + Desc + "</li></a></td><td>&nbsp;</td></tr>"); }
  else { document.writeln("<tr class='SubMenu'><td>&nbsp;</td><td nowrap onMouseOver='HlOnMenu(this, \"" + Link + "\");' onMouseOut='HlOffMenu(this, \"" + tmpColour + "\");' onClick='document.location=\"" + Link + "\";'><li style='text-indent: 15px;'>" + myImg + Desc + "</li></td><td>&nbsp;</td></tr>"); }
 }

 function EndSubMenu() {
  document.writeln("<tr class='SubMenu'><td colspan='3'>&nbsp;</td></tr>");
  document.writeln("</table>");
  if (brwVersion == 0) { document.writeln("</td>"); }
  else if (brwVersion == 2) { document.writeln("</layer>"); }
  else { document.writeln("</span></div>"); }
 }

 function EndAllMenus() {
  if (brwVersion != 3) { document.writeln("<div class='warning'>Warning: Your Browser is out of date.  Please update it.</div>"); }
  if (brwVersion == 0) { document.writeln("</tr></table></td></tr></table>"); }
  else if (brwVersion == 2) { document.writeln("</layer>"); }
  else { document.writeln("</div>"); }
 }

// Activate Menu Functions

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

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

 function HlOnMenu(Mnu, Link) { // Highlight On the menu - used by browserVersion = 1
  Mnu.style.backgroundColor = '#ffffff';
  Mnu.style.color = HLColour;
  self.status = Link;
  return; }

 function HlOffMenu(Mnu, aColour) { // Highlight Off the menu - used by browserVersion = 1
  Mnu.style.backgroundColor = aColour;
  Mnu.style.color = '#ffffff';
  self.status = "Done";
  return; }

 function showCopy() {
  self.status = CopyRight;
  clearTimeout(timerCopy);
  timerCopy=setTimeout("self.status = 'Done'",3000);
 }

 function moveMyMenu() {
  if (brwVersion == 3) { if (parseInt(document.getElementById('MyMenu').style.top) != parseInt(document.body.scrollTop)) { document.getElementById('MyMenu').style.top = document.body.scrollTop; showCopy(); }}
  if (brwVersion == 1) { if (parseInt(document.all.MyMenu.style.top) != parseInt(document.body.scrollTop)) { document.all.MyMenu.style.top = document.body.scrollTop; showCopy(); }}
  if (brwVersion == 2) { if (parseInt(document.layers["MyMenu"].top) != parseInt(document.layers["MyMenu"].window.pageYOffset)) { document.layers["MyMenu"].top = document.layers["MyMenu"].window.pageYOffset; showCopy(); }}
  clearTimeout(timerMove);
  timerMove=setTimeout(moveMyMenu, 1000); // Keep calling itself
 }

 function GetModified() { // Get Last Modified Date for this document
  var arrMonthNames = new Array(12);
  arrMonthNames[0] = "January";
  arrMonthNames[1] = "February";
  arrMonthNames[2] = "March";
  arrMonthNames[3] = "April";
  arrMonthNames[4] = "May";
  arrMonthNames[5] = "June";
  arrMonthNames[6] = "July";
  arrMonthNames[7] = "August";
  arrMonthNames[8] = "September";
  arrMonthNames[9] = "October";
  arrMonthNames[10] = "November";
  arrMonthNames[11] = "December";
  var lastM = new Date(document.lastModified);
  var MyMonth = arrMonthNames[lastM.getMonth()];
  document.write("<p style='font: normal 8pt Arial; text-align: center;'>This page was last modified on "+lastM.getDate()+" "+MyMonth+" "+lastM.getYear()+"<br>&copy; YWCA of Canberra "+lastM.getYear()+"</p>");
 }

StartMyMenu(); //Build the menus
EndAllMenus(); // Finish off the menu code...
// if (brwVersion != 0 ) { moveMyMenu(); }


//document.write ("<p>&nbsp;</p><p>" + navigator.userAgent + "</p>"); //### Debug ###

