// JavaScript Document

startList = function() {
  if (document.all&&document.getElementById) {
    navRoot = document.getElementById("products");
    menuRoot = document.getElementById("menu");

    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI") {
        node.onmouseover=function() {
          this.className+=" over";
        }
        node.onmouseout=function() {
          this.className=this.className.replace(" over", "");
        }
      }
    }


    for (i=0; i<menuRoot.childNodes.length; i++) {
      node = menuRoot.childNodes[i];
      if (node.nodeName=="LI") {
        node.onmouseover=function() {
          this.className+=" over";
        }
        node.onmouseout=function() {
          this.className=this.className.replace(" over", "");
        }
      }
    }
  }
}

window.onload=startList;


// adds a drop shadow to a given element

Effect.ThinShadow = function(element){
	element = $(element);
  var wrapped = new Element('div', { 'class': 'border_r' });
  $A(element.childNodes).each(function(e){ wrapped.appendChild(e); });
  element.addClassName('border_b');
  element.appendChild(wrapped);
}


Effect.DropShadow = function(element){
	element = $(element);
  // console.log(1);
  // var i1 = new Element('div', { 'class': 'i1' });
  // var i2 = new Element('div', { 'class': 'i2' });
  // var i3 = new Element('div', { 'class': 'i3 cf' });
  // console.log(2);
  // 
  // i2.appendChild(i3);
  // i1.appendChild(i2);
  // console.log(3);
  // 
  // $A(element.childNodes).each(function(e){ i3.appendChild(e); });
  // console.log(4);
	
	var bfunc = function(className){
		var e = new Element('div', { 'class': className });
		e.appendChild(new Element('div'));
		return e;
	};		
	
	element.addClassName('cp');
  //   // element.appendChild(bfunc('bt'));
  // element.appendChild(i1);
	element.appendChild(bfunc('bb'));		
	console.log(5);

};

