//----- Begin
/* Syntaxes:
 *
 * menu[menuNumber][0] = new Menu('menu ID', left, top, width, 'mouseover colour',
 *'background colour', 'border colour');
 * Left and Top are measured on-the-fly relative to the top-left corner of its trigger.
 *
 * menu[menuNumber][itemNumber] = new Item('Text', 'URL', vertical spacing to next item, 
 *target menu number);
 * If no target menu (popout) is desired, set it to 0. All menus must trace back their
 * targets to the root menu! That is, every menu must be targeted by one item somewhere.
 * Even if you're not writing the root menu, you must still specify its settings here.
 */
var menu = new Array();
// Default colours passed to most menu constructors (just passed to functions, not
// a global variable - makes things easier to change later).
var defOver = '#666699', defBack = '#ffc0cb', defBorder = '#5f9ea0';
// Default height of menu items - the spacing to the next item, actually.
var defHeight = 30;
// Menu 0 is the special, 'root' menu from which everything else arises.
menu[0] = new Array();
// Pass a few different colours, as an example.
menu[0][0] = new Menu('rootMenu', 0, 0, 100, '#ffc0cb', '#ffc0cb', defBorder);
// Notice how the targets are all set to nonzero values...
menu[0][1] = new Item('Association', '#', defHeight, 1);
menu[0][2] = new Item('Pdvt', '#', defHeight, 2);
menu[0][3] = new Item('Loisirs', '#', defHeight, 3);
//menu[0][4] = new Item('Tourisme', '#', defHeight, 4);

menu[1] = new Array();
// The File menu is positioned 0px across and 22 down from its trigger, and is 80 wide.
menu[1][0] = new Menu('associationMenu', 0, 22, 130, defOver, defBack, defBorder);
menu[1][1] = new Item('Gasikara&copy;', 'http://www.gasikara.net/Menu.htm', defHeight, 0);
menu[1][2] = new Item('Ylang.net&copy;', 'http://www.ylang.net/Mitadyindex.php',defHeight, 0);
menu[1][3] = new Item('Site-invité', 'http://www.gasikara.net/Citejour.htm', defHeight, 0);

menu[2] = new Array();
menu[2][0] = new Menu('pdtvMenu', 0, 22, 110, defOver, defBack, defBorder);
menu[2][1] = new Item('Dmd', 'http://www.dmd.mg/', defHeight, 0);
menu[2][2] = new Item('Lequotidien', 'http://www.lequotidien.mg/', defHeight, 0);
menu[2][3] = new Item('Hebdomada', 'http://www.hebdomada.com/', defHeight, 0);
menu[2][4] = new Item('Taratra', 'http://www.taratramada.com/', defHeight, 0);

menu[3] = new Array();
menu[3][0] = new Menu('loisirsMenu', 0, 22, 110, defOver, defBack, defBorder);
menu[3][1] = new Item('Mozika', 'http://mosikahatsikana.free.fr/', defHeight, 0);
menu[3][2] = new Item('Rdj','http://www.rdeejay.net/', defHeight, 0);
menu[3][3] = new Item('Mahaleo', 'http://www.mahaleoalolympia.com/', defHeight, 0);
// Non-zero target means this will trigger a popup.
menu[3][4] = new Item('Miss Manja', 'http://www.tabataba.com/', defHeight, 6);

menu[4] = new Array();
menu[4][0] = new Menu('tourismeMenu', 0, 22, 110, defOver, defBack, defBorder);
menu[4][1] = new Item('Tourisme', 'http://www.hsm.mg/', defHeight, 0);
menu[4][2] = new Item('Mbs-tv', 'http://www.mbs.mg/html/', defHeight, 0);
menu[4][3] = new Item('Vatomandry', 'http://www.vatotiako.com/', defHeight, 0);
menu[4][4] = new Item('Jce-Tana', 'http://www.jce-tana.org/', defHeight, 0);

menu[4][5] = new Item('Université','http://www.univ-antananarivo.mg/', defHeight, 5);



menu[5] = new Array();
// This is across but not down... a horizontal popout (with crazy colours :)...
menu[5][0] = new Menu('reopenMenu', 85, 0, 105, '#ff1493', '#666699', '#663399');
menu[5][1] = new Item('Madatsara', 'http://www.madatsara.com/', 36, 0);
menu[5][2] = new Item('Radio-Gasy', 'http://www.radiogasy.net/', 40, 0);
menu[5][3] = new Item('Gasykamanja', 'http://www.gasykamanja.com/', defHeight, 0);

menu[6] = new Array();
// Leftwards popout with a negative x relative to its trigger.
menu[6][0] = new Menu('aboutMenu', -85, -15, 80, 'deeppink', '#666699', defBorder);
menu[6][1] = new Item('Parcs<br>Nationaux', 'http://www.parcs-madagascar.com/', 30, 0);

// Now, this next bit of script will write our own custom root menu -- a horizontal
// one, as the defaults are all vertical with borders. Even if you are writing your
// own root menu, you must still specify the names, colours and targets above -- the
// positions are calculated on the fly and hence are ignored.
// Basically, you must duplicate the output of the writeMenus() function. Just work
// from this example.
// Syntax: startDL('id', x, y, width, height, 'visibility', '#background colour or null
//for transparent', '#border colour or null for no border', 'additional properties');
// It returns a string of HTML text comprising the opening tag of a div or layer.
// mouseProps(menu, item) returns the 'onMouseEvent' properties for a specific menu item,
// passed as 'additional properties' to startDL. Just cut and paste below, or allow the
// script to write its own root menu.
// endDL is a variable containing either '</div>' or '</layer>', so add it afterwards.
newRoot = startDL('rootMenu', 0, 0, '100%', 25, 'hidden', '#ffc0cb', null, 100, '');
newRoot += startDL('rootMenu1', 10, 0, 150, 17, 'inherit', '#ffc0cb', null, 100, mouseProps(0, 1));
newRoot += '<span class="Item">  Mada-news.net&copy;</span>' + endDL;
newRoot += startDL('rootMenu2', 160, 0, 150, 17, 'inherit', '#ffc0cb', null, 100, mouseProps(0, 2));
newRoot += '<span class="Item">  Points de Vue</span>' + endDL;
newRoot += startDL('rootMenu3', 290, 0, 150, 17, 'inherit', '#ffc0cb', null, 100, mouseProps(0, 3));
newRoot += '<span class="Item">  Loisirs</span>' + endDL;
newRoot += startDL('rootMenu4', 450, 0, 150, 17, 'inherit', '#ffc0cb', null, 100, mouseProps(0, 4));
newRoot += '<span class="Item"></span>' + endDL;

newRoot += endDL;
// Pass this two strings - the first is HTML to write a custom root menu, or null to
// generate one normally. The second is the popout indicator HTML - try an image...?
// Try writeMenus(null, '<img src="...">'); in your own script.
writeMenus(newRoot, '>');
// This is a quick snippet that captures all clicks on the document and hides the menus
// every time you click. Use if you want.
if (isNS4) document.captureEvents(Event.CLICK);
document.onclick = clickHandle;
function clickHandle(evt) {
if (isNS4) document.routeEvent(evt);
hideAllBut(0);
}
// Show root menu command - place in an onLoad="..." type function if you want.
eval(docObj + menu[0][0].id + styObj + '.visibility = "visible"');
// This is just the moving command for the example.
function moveRoot() {
rM = eval(docObj + menu[0][0].id + styObj);
if (parseInt(rM.top) < 40) rM.top = 40;
else rM.top = 0;
}
//  End -->
