// Cascading Popup Menus v5.2 - Single Frame Menu example script.


// If you're upgrading from v5.1, you can paste your existing menu data in, and if you're
// upgrading from v5.0 you need to add 'cursor' settings to your ItemStyles.
//
// And before going ANY further, you must have READ and AGREE TO the script license!
// It can be found on my site, in the syntax helpfile, or in the demo script document.


// 'horizontal Bar' style: menu items that use this ItemStyle are 40px wide, have 10px gaps
// between them, no popout indicator (the ">" in some menus) or popout indicator position,
// 0px padding of the text within items, #336699 background colour, a hover colour of #6699CC,
// 'highText' is the stylesheet class used for the menu text both normally and when highlighted,
// no border styles, 'null' means fully opaque items (set them to numbers between 0 and 100 to
// enable semitranslucency), and the 'hand'/'default' cursors are used for linked/submenu items.

var hBar = new ItemStyle(100, 0, '', -50, 1, '', '', 'highText', 'highText2', '0', '',
null, null, 'hand', 'default');


var hBar1 = new ItemStyle(100, 0, '', -50, 1, '', '', 'highText', 'highText2', '0', '',
null, null, 'hand', 'default');

var hBar2 = new ItemStyle(100, 0, '', -50, 1, '', '', 'highText', 'highText2', '0', '',
null, null, 'hand', 'default');

// The 'sub Menu' items: these have popout indicators of "Greater Than" signs ">" 15px from their
// right edge, and CSS borders. Text class also changes on mouseover.


var subM = new ItemStyle(22, 0, '', -15, 0, '#fff', '#fff', 'highText2', 'lowText',
 '', 'itemBorder', 65, 90, 'hand', 'default');

var subMbreit = new ItemStyle(42, 0, '', -15, 0, '#fff', '#fff', 'highText2', 'lowText',
 '', 'itemBorder', 65, 90, 'hand', 'default');


var subMbreit1 = new ItemStyle(35, 0, '', -15, 0, '#fff', '#fff', 'highText2', 'lowText',
 '', 'itemBorder', 65, 90, 'hand', 'default');

var subMbreit2 = new ItemStyle(22, 0, '', -15, 0, '', '', 'highText2', 'lowText',
 '', 'itemBorder', 65, 90, 'hand', 'default');

// Create a PopupMenu() object, and pass its own name so it can reference itself later on.
// We also use a 'with' block to work with its properties and functions below.

var pMenu = new PopupMenu('pMenu');
with (pMenu)
{

// Here's what the values in the next startMenu() command mean, in order:
//  'root': the name of this menu.
//   false: orientated as a horizontal menu (true creates a vertical menu).
//      10: the 'left' offset of this menu in pixels.
//       0: the 'top' offset of this menu in pixels.
//      17: the height of this menu (for vertical menus, this becomes the menu width).
//    hBar: the ItemStyle used to give this menu colours and layout/formatting.
//      '': this menu does not display within a frame (see the Frameset Example Script to do that).
//   false: this menu shows submenus on mouseover. 'true' means show on click.
//
// Most of the items are 'sm:' items popping out submenus, except the last 'js:' JavaScript command
// to pop open a new window. I've also given each item a length in pixels, overriding the ItemStyle.

//&nbsp;|
//<br />&nbsp;
// |m

startMenu('root', false, 80, 0, 25, hBar, '', false);
addItem('&nbsp;HOME&nbsp;', 'http://www.hohenraetien.ch', '', null, 100);
addItem('&nbsp;BURGANLAGE&nbsp;', 'Burganlage', 'sm:', null, 140);
addItem('&nbsp;BESUCHER&nbsp;', 'Besucher', 'sm:', null, 140);
addItem('ANGEBOTE &nbsp;', 'Angebote', 'sm:', null, 120);
addItem('&nbsp;KONTAKT & LINKS&nbsp', 'Kontakt und Links', 'sm:', null, 180);
addItem('&nbsp;SITEMAP / INHALT', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/0-Sitemap.html', '', null, 200);




// This is a vertical menu positioned 0px across and 22px down from its trigger, and is 80px wide.
// The URLs are set to # here, be sure to replace them with your path/file names or JS functions!
// Also note how the types are '', indicating these links open in the current frame/window.
// The last item here changes its text on mouseover (^ separates the two strings), links to my site,
// and has a custom ItemStyle and length specified so it's longer than the rest.

startMenu('Burganlage', true, 0, 22, 200, subM, '', false);
addItem('&nbsp;Burganlage im &Uuml;berblick', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/g-HR-UeberblickPlan-02.html', '');
addItem('&nbsp;die &auml;ussere Burg &nbsp>', 'Aussen', 'sm:');
addItem('&nbsp;die innere Burg&nbsp>', 'Innen', 'sm:');
addItem('&nbsp;Geschichte der Burg&nbsp>', 'Geschichte', 'sm:');
addItem('&nbsp;Bilder der Burganlage', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/P-BilderEinleitung.html', '');
addItem('&nbsp;Sagen und Legenden&nbsp>', 'Sagen', 'sm:');


startMenu('Geschichte', true, 200, 0, 150, subM, '', false);
addItem('&nbsp;Fr&uuml;hzeit<br />&nbsp;Pr&auml;historie', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/0A-Geschichte-01.html', '', subMbreit1);
addItem('&nbsp;Sp&auml;tantike<br />&nbsp;Fr&uuml;hmittelalter', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/0A-Geschichte-02.html', '', subMbreit1);
addItem('&nbsp;Hochhmittelalter', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/0A-Geschichte-03.html', '');
addItem('&nbsp;Neuzeit', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/0A-Geschichte-04.html', '');

startMenu('Besucher', true, 0, 22, 200, subM, '', false);
addItem('&nbsp;Eintritt&nbsp;/&nbsp;&Ouml;ffnungszeiten<br>&nbsp;und&nbsp;weitere&nbsp;Infos', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/g-HR-Ueberblick-01.html', '', subMbreit1);
addItem('&nbsp;Wo liegt Hohen R&auml;tien?', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/D-KartenWoLiegtHR.html', '');
addItem('&nbsp;Wie gelangt man hin?', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/D-KartenWegbeschriebAutobahn.html', '');
addItem('&nbsp;F&uuml;hrungen', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/G-FuehrungenMarend.html', '');



startMenu('Kontakt und Links', true, 0, 22, 200, subM, '', false);
addItem('&nbsp;F&ouml;rderverein Hohen R&auml;tien', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/VereinHR.html', '');
addItem('&nbsp;Tr&auml;gerschaften Adressen', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/E-TraegerschaftAdressen.html', '');
addItem('&nbsp;Links', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/H-Links-01.html', '');
addItem('&nbsp;G&auml;stebuch', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/Gaestebuch.html', '');
addItem('&nbsp;Download-Seite', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/M-Downloads.html', '');
addItem('&nbsp;Interne Seiten', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/Friends1/w-WeiterIntern.html', '');


startMenu('Angebote', true, 0, 22, 180, subM, '', false);
addItem('&nbsp;rent a castle<br />&nbsp;Vermietungen', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/F-Vermietungen.html', '', subMbreit1);
addItem('&nbsp;F&uuml;hrungen & Kulinarik', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/G-FuehrungenMarend.html', '');
addItem('&nbsp;Touristische Angebote &nbsp>', 'Tourismus', 'sm:');
addItem('&nbsp;Open-Air 2009<br />&nbsp;Burgfest Hohen R&auml;tien ', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/O-OpenAir09.html', '',subMbreit1);


startMenu('Aussen', true, 200, 0, 150, subM, '', false);
addItem('&nbsp;Kirche St. Johann', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/b-KircheStJohann-01.html', '');
addItem('&nbsp;Baptisterium', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/a-Baptisterium-01.html', '');
addItem('&nbsp;Nordturm (Pfaffenturm)', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/c-Pfaffenturm-01.html', '');
addItem('&nbsp;S&uuml;dturm (Wehrturm)', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/h-Wehrturm-01.html', '');

startMenu('Tourismus', true, 200, 0, 150, subM, '', false);
addItem('&nbsp;Felszeichnungen<br/> &nbsp;Carschenna', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/2C-Carschenna-01.html', '', subMbreit1);
addItem('&nbsp;Stiegen zum Himmel', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/2C-Stairways-01.html', '');
addItem('&nbsp;Stairways to Heaven', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/2C-StairwaysEngl-02.html', '');



startMenu('Innen', true, 200, 0, 150, subM, '', false);
addItem('&nbsp;Hoch Rialt', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/f-HochRialt-01.html', '');
addItem('&nbsp;&Ouml;konomiegeb&auml;ude', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/e-InnereBurg-01.html',  '');



startMenu('Sagen', true, 200, 0, 150, subM, '', false);
addItem('&nbsp;Ritter Cuno', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/B-01SagenCuno.html', '');
addItem('&nbsp;Nihil habeo - <br/>&nbsp;nihil gibeo', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/B-02Sagen2.html', '', subMbreit);
addItem('&nbsp;die goldenen <br/>&nbsp;Nussschalen', 'http://www.hohenraetien.ch/HR-Web-2008/web-content/pages/B-02Sagen2.html', '', subMbreit);

startMenu('mEdit', true, 0, 22, 80, subM, '', false);
addItem('Cut', '#', '');
addItem('Copy', '#', '');
addItem('Paste', '#', '');
addItem('Convert', 'mConvert', 'sm:');


// This 'mHelp' menu is aligned slightly left of its trigger (-10px).
// Instead of using spaces to indent, consider 'text-indent' in the stylesheet class perhaps?
// The last item is an example of adding extra optional parameters to the addItem() command.
// It uses the subM ItemSyle (regardless of what the rest of this menu uses), is 22px long,
// has 0px spacing after it, and a lesser-than-sign popout indicator positioned 3px from the left
// edge of this item. Note that the parameters after the ItemStyle name are in the same order as
// the ItemStyle command itself, and you can have as many as you want (e.g. background colours).

startMenu('mHelp', true, -10, 22, 80, subM, '', false);
addItem('&nbsp; &nbsp; Contents', '#', '');
addItem('&nbsp; &nbsp; Search', '#', '');
addItem('&nbsp; &nbsp; About', 'mAbout', 'sm:', subM, 22, 0, '&lt;', 3);


// This is 85px across and 0px down... a horizontal popout.
// Again these items have their own ItemStyles, and unique lengths / spacings between specified.


startMenu('mReopen', true, 85, 0, 120, button, '', false);
addItem('Recent Doc 1:<br />Schedule', '#', '', button, 35);
addItem('Recent Doc 2:<br />Cunning Plan', '#', '', button, 35, 5);
addItem('Etc. etc...', '#', '', subM);

// Leftwards popout with a negative x and y relative to its trigger. The item has a custom height.

startMenu('mAbout', true, -85, -18, 80, subM, '', false);
addItem('Leftwards!<br>And up!', '#', '', subM, 40);


// HIDE OR SHOW DELAYS (in milliseconds) can be customised. Defaults are:
showDelay = 0;
hideDelay = 500;
// Specify hideDelay as zero if you want to disable autohiding, and showDelay as a couple of
// hundred if you don't want the menus showing instantaneously when moused over.

// HIDE MENUS ON DOCUMENT CLICK: Try uncommenting this, and perhaps set hideDelay to zero:
//hideDocClick = true;

// You can assign 'oncreate' events to specific menus. By default, the script has only one for
// the root menu that shows it when it is created. You may wish to change it to something like the
// following, which uses the animation function to show the menu, or delay its show altogether.
//menu.root[0].oncreate = function() { pMenu.doVis('root', true) }

// End of 'with (pMenu)' block. That's one menu object created!

}





// CREATE ANOTHER MENU OBJECT here if you want multiple menus on a page, or you can just
// duplicate this entire file and rename 'pMenu' to something else.
// Every menu object MUST have a menu named 'root' in it, as that's always visible.

//var anotherMenu = new PopupMenu('anotherMenu');
//with (anotherMenu)
//{
// startMenu('root', .....);
// ... make menus here ...
//}




// ******************** MENU EFFECTS ********************
//
// Now you've created a basic menu object, you can add optional effects like borders and
// shadows to specific menus. You can remove this section entirely if you want, the
// functions called are found at the bottom of this file.



// BORDER: Added to all menus in a named object using a specified ItemStyle. The syntax is:
//  addMenuBorder(menuObject, ItemStyle,
//   opacity of border, 'border colour', border width, 'padding colour', padding width);
// Opacity is a number from 0 to 100, or null for solid colour (just like the ItemStyles).

addMenuBorder(pMenu, window.subBlank,
 null, '#666666', 1, '#CCCCDD', 2);



// DROPSHADOW: added to specific ItemStyles again. The syntax is similar, but later on you
// pass arrays [...] for each layer of the shadow you want. I've used two grey layers
// here, but you can use as many or as few as you want. The syntax for the layers is:
//  [opacity, 'layer colour', X offset, Y offset, Width Difference, Height difference]
// Opacity is from 0 to 100 (or null to make it solid), and the X/Y offsets are the
// distance in pixels from the menu's top left corner to that shadow layer's corner.
// The width/height differences are added or subtracted to the current menu size, for
// instance the first layer of this shadow is 4px narrower and shorter than the menu
// it is shadowing.

addDropShadow(pMenu, window.subM,
 [40,"#333333",6,6,-4,-4], [40,"#666666",4,4,0,0]);
addDropShadow(pMenu, window.subBlank,
 [40,"#333333",6,6,-4,-4], [40,"#666666",4,4,0,0]);



// ANIMATION SETTING: We add this to the 'pMenu' menu object for supported browsers.
// IE4/Mac and Opera 5/6 don't support clipping, and Mozilla versions prior to 1.x (such as
// Netscape 6) are too slow to support it, so I'm doing some browser sniffing.
// If you don't want animation, delete this entirely, and the menus will act normally.
// Change the speed if you want... it's the last number, between -100 and 100, and is
// defined as the percentage the animation moves each frame (defaults are 10 and 15).

if ((navigator.userAgent.indexOf('rv:0.')==-1) &&
    !(isOp&&!document.documentElement) && !(isIE4&&!window.external))
{
 pMenu.showMenu = new Function('mN','menuAnim(this, mN, 10)');
 pMenu.hideMenu = new Function('mN','menuAnim(this, mN, -15)');

 // Add animation to other menu objects like this...
 //anotherMenu.showMenu = new Function('mN','menuAnim(this, mN, 10)');
 //anotherMenu.hideMenu = new Function('mN','menuAnim(this, mN, -15)');
}







