/* 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 scr_w = screen.availWidth;
var browseWidth;
var s;

if (document.layers){
   browseWidth=window.outerWidth;
}
if (document.all){
   browseWidth=document.body.clientWidth;
}

s = (browseWidth - 770) / 5;

var menu = new Array();
var url_base = ""
// Default colours passed to most menu constructors (just passed to functions, not
// a global variable - makes things easier to change later).
var defOver = '#9AABC6', defBack = '#FFFFFF', defBorder = '#000000';
// Default height of menu items - the spacing to the next item, actually.
var defHeight = 18;
var subHeight = 16;
// 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, 90, 0, '', '', defBorder);
// Notice how the targets are all set to nonzero values...
menu[0][1] = new Item('menu_products', 'products_recyclers', defHeight, 1);
menu[0][2] = new Item('menu_safety', 'safety.asp', defHeight, 2);
menu[0][3] = new Item('menu_case', 'studies.asp', defHeight, 3);
menu[0][4] = new Item('menu_faqs', 'faq.asp', defHeight, 4);
menu[0][5] = new Item('menu_contact', 'contact.asp', defHeight, 5);


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('menu_products', 10, 23, 220, defOver, defBack, defBorder);
menu[1][1] = new Item('<b>RECYCLERS &amp; CONCENTRATORS:</b>', 'products_recyclers.asp', defHeight, 0);
menu[1][2] = new Item('&nbsp; |&nbsp; Cost Savings Analysis', 'savings.asp', defHeight, 0);
menu[1][3] = new Item('&nbsp; |&nbsp; Benefits of Recycling', 'products_recyclers.asp', defHeight, 0);
menu[1][4] = new Item('&nbsp; |&nbsp; Distillation-Fractional & Simple', 'distillation.asp', defHeight, 0);
menu[1][5] = new Item('&nbsp; |&nbsp; Commonly Recycled Solvents', 'commonlist.asp', defHeight, 0);
menu[1][6] = new Item('&nbsp; |&nbsp; <b>Equipment Overview:</b>', 'products_equipment.asp', defHeight, 0);
menu[1][7] = new Item('&nbsp; &nbsp; &nbsp; |&nbsp; TechnoCleanŽ S-600', 'products_s600.asp', defHeight, 0);
menu[1][8] = new Item('&nbsp; &nbsp; &nbsp; |&nbsp; TechnoCleanŽ F-800', 'products_portable.asp', defHeight, 0);
menu[1][9] = new Item('&nbsp; &nbsp; &nbsp; |&nbsp; TechnoCleanŽ S/F 2500', 'products_stationary.asp', defHeight, 0);
menu[1][10] = new Item('&nbsp; &nbsp; &nbsp; |&nbsp; TechnoCleanŽ S-6000T', 'products_s6000t.asp', defHeight, 0);
menu[1][11] = new Item('&nbsp; &nbsp; &nbsp; |&nbsp; Laboratory', 'laboratory.asp', defHeight, 0);
//menu[1][11] = new Item('&nbsp; |&nbsp; Formula 83 Clearing Solvent', 'products_solvents.asp', defHeight, 0);
// Non-zero target means this will trigger a popup.

menu[2] = new Array();
menu[2][0] = new Menu('menu_safety', 10, 23, 128, defOver, defBack, defBorder);
menu[2][1] = new Item('Equipment Customization,<br>Safety Plus, and<br>Quality Construction', 'safety.asp', 80, 0);

menu[3] = new Array();
menu[3][0] = new Menu('menu_case', 10, 23, 140, defOver, defBack, defBorder);
menu[3][1] = new Item('Learn How Clients Have Benefited From CBG Custom Solutions.', 'studies.asp', 80, 0);
//menu[3][1] = new Item('Customization', 'safety.asp#customization', defHeight, 0);
//menu[3][2] = new Item('Safety Plus', 'safety.asp#safety_plus', defHeight, 0);
//menu[3][3] = new Item('Construction', 'safety.asp#construction', defHeight, 0);


menu[4] = new Array();
menu[4][0] = new Menu('menu_faqs', 10, 23, 180, defOver, defBack, defBorder);
menu[4][1] = new Item('Frequently Asked Questions', 'faq.asp', defHeight, 0);

menu[5] = new Array();
menu[5][0] = new Menu('menu_contact', 10, 23, 230, defOver, defBack, defBorder);
menu[5][1] = new Item('Contact Us by Phone, Fax, or E-mail', 'contact.asp', defHeight, 0);
menu[5][2] = new Item('Free Cost Savings Analysis', 'savings.asp', defHeight, 0);

menu[6] = new Array();
menu[6][0] = new Menu('menu_none', 10, 23, 140, defOver, defBack, defBorder);
menu[6][1] = new Item('Contact Us', 'contact.asp', defHeight, 0);

menu[7] = new Array();
// This is across but not down... a horizontal popout (with crazy colours :)...
menu[7][0] = new Menu('sub_products', 190, 0, 170, defOver, '#EEEEEE', defBorder);
menu[7][1] = new Item('Why Recycle, or Concentrate?','products_recyclers.asp#why_recycle',subHeight,0);
menu[7][2] = new Item('Principles of Operation','products_recyclers.asp#principles_of_operation',subHeight,0);
menu[7][3] = new Item('General Features','products_equipment.asp#general_features',subHeight,0);
menu[7][4] = new Item('Purities & Recoveries','products_recyclers.asp#purities_and_recoveries',subHeight,0);
menu[7][5] = new Item('Solvents That Can Be Recycled','products_recyclers.asp#solvents',subHeight,0);
menu[7][6] = new Item('Contaminants That Are Removed','products_recyclers.asp#Example_of_Contaminants',subHeight,0);
menu[7][7] = new Item('<b>Equipment</b>','products_equipment.asp',subHeight,9);
menu[7][8] = new Item('Bench Top Models','products_benchtop.asp',subHeight,0);
menu[7][9] = new Item('Portable (Cart-Mounted) Models','products_portable.asp',subHeight,0);
menu[7][10] = new Item('Stationary Models','products_stationary.asp',subHeight,0);

menu[8] = new Array();
// This is across but not down... a horizontal popout (with crazy colours :)...
menu[8][0] = new Menu('sub_solvent', 190, 0, 140, defOver, '#EEEEEE', defBorder);
menu[8][1] = new Item('Advantages/Samples','products_solvents.asp',subHeight,0);
menu[8][2] = new Item('MSDS Sheets','products_solvents.asp',subHeight,0);


menu[9] = new Array();
// This is across but not down... a horizontal popout (with crazy colours :)...
menu[9][0] = new Menu('sub_equipment', 170, 0, 140, defOver, '#EEEEEE', defBorder);
menu[9][1] = new Item('Equipment Overview','products_equipment.asp#equipment_overview',subHeight,0);
menu[9][2] = new Item('General Features','products_equipment.asp#general_features',subHeight,0);
menu[9][3] = new Item('Applications & Equipment','products_equipment.asp#types',subHeight,0);
menu[9][4] = new Item('Standard Model Specifications','products_equipment.asp#specifications',subHeight,0);
menu[9][5] = new Item('Examples of Standard Models','products_equipment.asp#specifications',subHeight,0);
menu[9][6] = new Item('Bench Top Models','products_benchtop.asp',subHeight,0);
menu[9][7] = new Item('Portable (Cart-Mounted)','products_portable.asp',subHeight,0);
menu[9][8] = new Item('Stationary Models','products_stationary.asp',subHeight,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, 54, '100%', 36, 'hidden', '', null, 100, '');
//newRoot += startDL('rootMenu1', 0, 54, 98, 17, 'inherit', '', null, 100, mouseProps(0, 1));
//newRoot += '<span class="Item"><a href="'+url_base+'services_main.asp" onmouseover="chg_button(\'services\',\'on\');" onmouseout="chg_button(\'services\',\'off\');"><img name="services" border="0" src="images/button_services_off.gif" width="98" height="23"></a></span>' + endDL;
//newRoot += startDL('rootMenu2', 98, 54, 146, 36, 'inherit', '', null, 100, mouseProps(0, 2));
//newRoot += '<span class="Item"><a href="'+url_base+'company_ourcompany.asp" onmouseover="chg_button(\'company\',\'on\');" onmouseout="chg_button(\'company\',\'off\');"><img name="company" border="0" src="images/button_company_off.gif" width="146" height="23"></a></span>' + endDL;
//newRoot += startDL('rootMenu3', 244, 54, 164, 36, 'inherit', '', null, 100, mouseProps(0, 3));
//newRoot += '<span class="Item"><a href="'+url_base+'schedule_depo.asp" onmouseover="chg_button(\'schedule\',\'on\');" onmouseout="chg_button(\'schedule\',\'off\');"><img name="schedule" border="0" src="images/button_schedule_off.gif" width="164" height="23"></a></span>' + endDL;
//newRoot += startDL('rootMenu4', 408, 54, 120, 36, 'inherit', '', null, 100, mouseProps(0, 4));
//newRoot += '<span class="Item"><a href="'+url_base+'contact.asp" onmouseover="chg_button(\'contact\',\'on\');" onmouseout="chg_button(\'contact\',\'off\');"><img name="contact" border="0" src="images/button_contact_off.gif" width="120" height="23"></a></span>' + endDL;
//newRoot += startDL('rootMenu5', 528, 54, 102, 36, 'inherit', '', null, 100, mouseProps(0, 5));
//newRoot += '<span class="Item"><a href="'+url_base+'whatis_main.asp" onmouseover="chg_button(\'whatis\',\'on\');" onmouseout="chg_button(\'whatis\',\'off\');"><img name="whatis" border="0" src="images/button_whatis_off.gif" width="102" height="23"></a></span>' + endDL;
//newRoot += startDL('rootMenu6', 630, 54, 120, 36, 'inherit', '', null, 100, mouseProps(0, 6));
//newRoot += '<span class="Item"><a href="'+url_base+'howdoi_tips.asp" onmouseover="chg_button(\'howdoi\',\'on\');" onmouseout="chg_button(\'howdoi\',\'off\');"><img name="howdoi" border="0" src="images/button_howdoi_off.gif" width="120" height="23"></a></span>' + endDL;
//newRoot += endDL;



newRoot = '<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%"><tr><td width="66">';
newRoot += startDL('rootMenu',0, 0, '100%', 36, 'hidden', '', null, 100, '');
newRoot += startDL('rootMenu1', 0, 101, 142, 17, 'inherit', '', null, 100, mouseProps(0, 1));
newRoot += '<span class="Item"><a href="products_recyclers.asp" onmouseover="chg_button(\'products\',\'on\');" onmouseout="chg_button(\'products\',\'off\');"><img name="products" border="0" src="images/button_products_off.gif" width="142" height="32"></a></span>' + endDL + '</td><td width=' + s + '>&nbsp;</td><td width="85">';
newRoot += startDL('rootMenu2', 142+s, 101, 128, 17, 'inherit', '', null, 100, mouseProps(0, 2));
newRoot += '<span class="Item"><a href="safety.asp" onmouseover="chg_button(\'safety\',\'on\');" onmouseout="chg_button(\'safety\',\'off\');"><img name="safety" border="0" src="images/button_safety_off.gif" width="128" height="32"></a></span>' + endDL + '</td><td width=' + s + '>&nbsp;</td><td width="80">';
newRoot += startDL('rootMenu3', 270+2*s, 101, 80, 17, 'inherit', '', null, 100, mouseProps(0, 3));
newRoot += '<span class="Item"><a href="studies.asp" onmouseover="chg_button(\'case\',\'on\');" onmouseout="chg_button(\'case\',\'off\');"><img name="case" border="0" src="images/button_case_off.gif" width="80" height="32"></a></span>' + endDL + '</td><td width=' + s + '>&nbsp;</td><td width="44">';
newRoot += startDL('rootMenu4', 350+3*s, 101, 44, 17, 'inherit', '', null, 100, mouseProps(0, 4));
newRoot += '<span class="Item"><a href="faq.asp" onmouseover="chg_button(\'faqs\',\'on\');" onmouseout="chg_button(\'faqs\',\'off\');"><img name="faqs" border="0" src="images/button_faqs_off.gif" width="44" height="32"></a></span>' + endDL + '</td><td width=' + s + '>&nbsp;</td><td width="59">';
newRoot += startDL('rootMenu5', 394+4*s, 101, 59, 17, 'inherit', '', null, 100, mouseProps(0, 5));
newRoot += '<span class="Item"><a href="contact.asp" onmouseover="chg_button(\'contact\',\'on\');" onmouseout="chg_button(\'contact\',\'off\');"><img name="contact" border="0" src="images/button_contact_off.gif" width="59" height="32"></a></span>' + endDL + '</td></tr></table>';



// 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, '<font color="#000000">&gt;&gt;</font>');
// 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;
}
