
var bgcolor_margin = "#FCFCFC";
var bgcolor_cell = "#FCFCFC";
var bgcolor_hcell = "#FCFCFC";
var background_cell = "";
var background_hcell = "";
var class_name = "menu_dropdown";
var cell_spacing = 5;
var cell_padding = 0;
var height = 20;

var arMenu = 
[
// Inspiration
  [
    [
      ['Outdoor Living', 'inspiration_outdoor_living.htm'],
      ['Driveways', 'inspiration_driveways.htm'],
      ['Walkways', 'inspiration_walkways.htm'],
      ['Pool Decks', 'inspiration_pool_decks.htm'],
      ['Patios', 'inspiration_patios.htm'],
      ['Steps', 'inspiration_steps.htm'],
      ['Walls', 'inspiration_walls.htm']
    ],
	0, 145, 200 
  ],

// Ideas
  [
    [
      ['Design Basics', 'ideas_design_basics.htm'],
      ['Color', 'ideas_colors.htm'],
      ['Shape', 'ideas_shapes.htm'],
      ['Texture', 'ideas_textures.htm'],
      ['Outdoor Rooms', 'ideas_outdoor_rooms.htm'],
      ['Belgard Backyard', 'ideas_backyard.htm'],  
      ['Before & After', 'ideas_before_after.htm']
    ],
	203, 145, 200
  ],

// Collections
  [
    [
      ['Full Collection', 'collections_intro.htm'],
      ['Natural', 'javascript:;',
	    [
		  [
		    ['Arbel', 'collections.htm?section=0&ind=0'],
		    ['Mega-Arbel', 'collections.htm?section=0&ind=1'],
		    ['Urbana', 'collections.htm?section=0&ind=2'],
		    ['Mega Lafitt', 'collections.htm?section=0&ind=3'],
		    ['Old World', 'collections.htm?section=0&ind=4']
		  ],
          606, 176, 150
		]
	  ],
      ['Antiqued', 'javascript:;',
	    [
		  [
		    ['Dublin Cobble', 'collections.htm?section=1&ind=0'],
		    ['Bergerac', 'collections.htm?section=1&ind=1'],
		    ['Mega-Bergerac', 'collections.htm?section=1&ind=2']
		  ],
          606, 207, 150
		]
	  ],
      ['Classic', 'javascript:;',
	    [
		  [
		    ['Holland Stone', 'collections.htm?section=2&ind=0'],
		    ['Cambridge Cobble', 'collections.htm?section=2&ind=1']
		  ],
          606, 238, 150
		]
	  ],
      ['Walls', 'javascript:;',
	    [
		  [
		    ['BelAir&trade; Wall', 'collections.htm?section=3&ind=0'],
		    ['Celtik Wall', 'collections.htm?section=3&ind=1']
		  ],
          606, 269, 150
		]
	  ],

      ['Environmental', 'environmental-pavers.htm',
	    [
		  [
		    ['Permeable', 'environmental-pavers-permeable.htm'],
		    ['Subterra', 'environmental-pavers-subterra.htm'],
		    ['Eco Dublin', 'environmental-pavers-ecodublin.htm'],
		    ['Aqua Roc', 'environmental-pavers-aquaroc.htm']
		  ],
          606, 300, 150
		]
	  ]

    ],
	406, 145, 200
  ],

// Customer Care Center
  [
    [
      ['Order a Catalog', 'request.htm'],
      ['Dealer Locator', 'dealer.htm'],
      ['Contractor Locator', 'contractors_search.htm'],
      ['Lifestyles', 'lifestyles_collection.htm'],  
      ['Environmental', 'environmental-pavers.htm'],
      ['Technical', 'technical_resource_center.htm'],
      ['Case Studies', 'white-paper.htm'],
//      ['Colors', 'belgard_colors.htm'],  
      ['Newsletter', 'newsletter.htm']
    ],
	809, 145, 200
  ],

// Product Guide
  [
    [
      ['Full Collection', 'shapes-pavers.htm'],
      ['Natural', 'javascript:;',
	    [
		  [
		    ['Arbel', 'shapes-arbel-stone.htm'],
		    ['Mega-Arbel', 'shapes-mega-arbel.htm'],
		    ['Urbana', 'shapes-urbana-stone.htm'],
		    ['Mega Lafitt', 'megalafitt.htm'],
		    ['Old World', 'shapes-oldworld-stone.htm'],
		    ['Subterra', 'subterra_stone.htm']
		  ],
          806, 176, 150
		]
	  ],
      ['Antiqued', 'javascript:;',
	    [
		  [
		    ['Dublin Cobble', 'shapes-dublin-combo.htm'],
		    ['Dublin Cobble Modular', 'shapes-dublin-modular.htm'],
		    ['Bergerac', 'shapes-bergerac.htm'],
		    ['Mega-Bergerac', 'shapes-bergerac-mega.htm'],
		    ['Cambridge Tumbled', 'shapes-cambridge-tumbled.htm']
		  ],
          806, 207, 150
		]
	  ],
      ['Classic', 'javascript:;',
	    [
		  [
		    ['Holland Stone', 'shapes-holland.htm'],
		    ['Cambridge', 'shapes-cambridge.htm']
		  ],
          806, 238, 150
		]
	  ],
      ['Walls', 'javascript:;',
	    [
		  [
		    ['BelAir&trade; Wall', 'belairwall.htm'],
		    ['Celtik Wall', 'shapes-celtik-wall-90.htm']
		  ],
          806, 238, 150
		]
	  ]
    ],
	609, 145, 200
  ]

]

var timerMenu;

function hideMenu() {
  timerMenu=setTimeout('hideMenuItems()', 500);
}

function hideMenuItems() {
  for (var i=0; i<arMenu.length; i++)
    hideMenuItem('menu_'+i, arMenu[i]);
}

function hideMenuItem(name, arr) {
  MM_showHideLayers(name,'','hide');
  for(var i=0;i<arr[0].length;i++)
    if ((arr[0][i][2]) && (arr[0][i][2].length>0))
      hideMenuItem(name+'_'+i, arr[0][i][2]);
}

function showMenu(name) {
  MM_setPosition();
  clearTimeout(timerMenu);
  hideMenuItems();

  MM_showHideLayers(name,'','show');
  while (name.indexOf("_")!=-1) {
	name = name.substring(0, name.lastIndexOf("_"));
    MM_showHideLayers(name,'','show');
  }
}

function fWriteLayers() {
  for (var i=0; i<arMenu.length; i++) {
	writeMenu('menu_'+i, arMenu[i])
  }
}

function writeMenu(name, arr) {
  document.write("<div id='"+name+"' style='position:absolute; left:0px; top:0px; width:"
   +arr[3]+"px; z-index:1; visibility: hidden' onMouseOver=\"clearTimeout(timerMenu);\" onMouseOut=\"hideMenu();\">"); 
  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 (var j=0;j<arr[0].length;j++) {
    document.write("<tr>");
    document.write("<td align=center "+((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+")';":"")
     +(((arr[0][j][2]) && (arr[0][j][2][0].length>0))?" showMenu('"+name+"_"+j+"');":" showMenu('"+name+"');")
	 +"\""
	 +" onmouseout=\""+((bgcolor_cell!="")?" this.style.backgroundColor='"+bgcolor_cell+"';":"")
   	 +((background_cell!="")?" this.style.background='url("+background_cell+")';":"")+"\""
   	 +" onclick=\"location.href='"+arr[0][j][1]+"'\""
	 +" style='cursor: hand; height:"+height+"px;'>"
	 +"<a href='"+ arr[0][j][1]+"' class='"+class_name+"'>"+arr[0][j][0]+"</a></td>");
    document.write("</tr>");
	if (j<(arr[0].length-1))
      document.write("<tr><td align=center><img src='images/menudrop_delimiter.gif' width='145' height='1'></td></tr>");
	 else
      document.write("<tr><td align=center><img src='images/space.gif' width='1' height='10'></td></tr>");
  }
  document.write("</table>");
  document.write("</td></tr></table>");
  document.write("</div>");
  for(var j=0;j<arr[0].length;j++) {
    if ((arr[0][j][2]) && (arr[0][j][2][0].length>0)) {
	  writeMenu(name+'_'+j, arr[0][j][2]);
	}
  }
}

function MM_setPosition() {
  for (var i=0; i<arMenu.length; i++)
    setPosition('menu_'+i, arMenu[i])
}

function setPosition(name, arr) {
  if (IEx) {
    document.all(name).style.left = xy.offsetLeft+arr[1];
    document.all(name).style.top = xy.offsetTop+arr[2];
  }
  else if (NS6) {
    str = "document.getElementById('"+name+"').style.left = document.getElementById('xy').offsetLeft+arr[1]";
    eval(str);
    str = "document.getElementById('"+name+"').style.top = document.getElementById('xy').offsetTop+arr[2]";		
    eval(str);
  }	
  for(var i=0;i<arr[0].length;i++)
    if ((arr[0][i][2]) && (arr[0][i][2].length>0))
      setPosition(name+'_'+i, arr[0][i][2]);
}

//function 

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; }
}
