
var bgcolor_margin = "#E8D4AC";
var bgcolor_cell = "#075651";
var bgcolor_hcell = "";
var background_cell = "";
var background_hcell = "";
var class_name = "menu_dropdown";
var cell_spacing = 1;
var cell_padding = 5;
var height = 15;

var arMenu = new Array(
  new Array(
    new Array(
      new Array('Sign-up for Newsletter', 'newsletter.htm'),
      new Array('Tech Support', 'support.htm'),
      new Array('Chaux Finisher Newsletter', 'chaux_newsletters.htm'),
      new Array('Find an Artisan Applicator', 'find_applicator2.htm'),
      new Array('Trade Links', 'trade.htm'),
	  new Array('Distributors', 'distrib.htm')
    ),
	80, 42, 102
  ),

  new Array(
    new Array(
      new Array('About Us', 'about.htm'),
	  new Array('Instructors', 'bio.htm'),
      new Array('Brochure', 'brochure.htm'),
      new Array('History of Lime', 'history_lime.htm'),
      new Array('Cycle of Lime', 'FullCalc.pdf'),
	  new Array('News Articles', 'news_articles.htm'),  
	  new Array('On the Road', 'road.htm')
    ),
	180, 42, 94 // x, y, width
  ),
  
  new Array(
    new Array(
      new Array('Interior & Exterior Photos', 'photos.htm'),
      new Array('Sample Finishes', 'finishes.htm'),
      new Array('Work In Progress', 'work_progress.htm')
    ),
	272, 42, 86
  ),
  
  new Array(
    new Array(
      new Array('Lime Primer', 'lime_primers.htm'),
      new Array('Decorative Lime Paints', 'lime_paints.htm'),
      new Array('Lime Plasters', 'lime_plasters.htm'),
      new Array('Pigments', 'pigments.htm'),
      new Array('Topcoats', 'topcoats.htm'),
      new Array('Tools', 'tools.htm'),
      new Array('Pearlescent Powders', 'pigments.htm'),
	  new Array('LEED Points', 'LeedPts.htm'),
	  new Array('Download Order Form', 'faxorder.pdf')
    ),
	357, 42, 86
  ),

  new Array(
    new Array(
      new Array('Tadelakt', 'taddelakt.htm'),
      new Array('Flexi Coat', 'flexi_coat.htm'),
      new Array('Tile Coat', 'tile_coat.htm')
    ),
	443, 42, 120
  ),

  new Array(
    new Array(
      new Array('Photos of Workshops', 'workshops.htm'),
      new Array('Schedules', 'schedules.htm'),
      new Array('Request Info / Sign-Up for Workshops', 'request.htm'),
      new Array('Specialty Classes: Tadelakt', 'specialty_classes.htm'),
      new Array('Sample Boards: First Level', 'boardsFL.htm'),
      new Array('Sample Boards: Advanced', 'boardsAL.htm')
    ),
	562, 42, 105
  ),

  new Array(
    new Array(
      new Array('Leed Points', 'LeedPts.htm'),
      new Array('Green Building Rating Document', 'images/docs1095.pdf'),
	  new Array('Low-Emitting Materials Page', 'images/docs71.pdf')
    ),
	667, 42, 79
  )
  
);

var timerMenu;

function hideMenu() {
  timerMenu=setTimeout('hideMenuItems()', 500);
}

function hideMenuItems() {
  for (var i=0; i<arMenu.length; i++) {
    MM_showHideLayers('menu'+i,'','hide');
  }
}

function showMenu(index) {
  clearTimeout(timerMenu);
  for (var i=0; i<arMenu.length; i++) {
    MM_showHideLayers('menu'+i,'','hide');
  }
  MM_showHideLayers('menu'+index,'','show');
}

function fWriteLayers() {
  for (var i=0; i<arMenu.length; i++) {
    document.write("<div id='menu"+i+"' style='position:absolute; left:0px; top:0px; width:"
	 +arMenu[i][3]+"px; z-index:1; visibility: hidden' onMouseOver=\"clearTimeout(timerMenu); MM_showHideLayers('menu"
	 +i+"','','show')\" onMouseOut=\"timerMenu=setTimeout('hideMenu()', 500);\">"); 
    document.write("<table width='100%' border=0 cellspacing=0 cellpadding=0"
	 +((bgcolor_margin!="")?" bgcolor='"+bgcolor_margin+"'":"")+"><tr><td>"); 
    document.write("<table width='100%' border=0 cellspacing="+cell_spacing+" cellpadding="+cell_padding+">");
    for(j=0;j<arMenu[i][0].length;j++) {
  	  document.write("<tr>");
   	  document.write("<td"+((bgcolor_cell!="")?" bgcolor='"+bgcolor_cell+"'":"")
       +((background_cell!="")?" background='"+background_cell+"'":"")
	   +" onmouseover=\""+((bgcolor_hcell!="")?" this.style.backgroundColor='"+bgcolor_hcell+"';":"")
       +((background_hcell!="")?" this.style.background='url("+background_hcell+")';":"")+"\""
	   +" onmouseout=\""+((bgcolor_cell!="")?" this.style.backgroundColor='"+bgcolor_cell+"';":"")
   	   +((background_cell!="")?" this.style.background='url("+background_cell+")';":"")+"\""
   	   +" onclick=\"location.href='"+arMenu[i][0][j][1]+"'\" style='cursor: hand; height:"+height
	 +"px;'>"
	   +"<a href='"+ arMenu[i][0][j][1]+"' class='"+class_name+"'>"+arMenu[i][0][j][0]+"</a></td>");
   	  document.write("</tr>");
    }
    document.write("</table>");
    document.write("</td></tr></table>");
    document.write("</div>");
  }
}

function MM_setPosition() {
  for (var i=0; i<arMenu.length; i++) {
    if(IEx) {
      document.all("menu"+i).style.left = xy.offsetLeft+arMenu[i][1];
      document.all("menu"+i).style.top = xy.offsetTop+arMenu[i][2];
  	} 
	else if(NS6) {
	  str = "document.getElementById('menu"+i+"').style.left = document.getElementById('xy').offsetLeft + arMenu["+i+"][1]";
   	  eval(str);
   	  str = "document.getElementById('menu"+i+"').style.top = document.getElementById('xy').offsetTop+arMenu["+i+"][2]";		
   	  eval(str);
  	}	
  }
}

var IEx = (document.all)?1:0;
var NS4 = (document.layers)?1:0
var NS6 = (document.getElementById)?1:0

function MM_findObj(n, d) { //v4.0
  var p,i,x;  
  if(!d) d=document; 
  if((p=n.indexOf("?"))>0&&parent.frames.length) 
  {
 	d=parent.frames[n.substring(p+1)].document; 
	n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
