function Lmenu(menuName) {
  this.objName = menuName;

  Lmenu.ie4 = document.all;
  Lmenu.ns6 = document.getElementById&&!document.all;

  document.onclick=this.hidemenu;
}


/////No further editting needed


Lmenu.getposOffset = function(what, offsettype) {
  var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
  var parentEl=what.offsetParent;
  while (parentEl!=null){
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
  }
  return totaloffset;
}


Lmenu.prototype.showhide = function(obj, e, visible, hidden, menuwidth){
  if (Lmenu.ie4||Lmenu.ns6)
    this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"

  if (menuwidth!=""){
    this.dropmenuobj.widthobj=this.dropmenuobj.style
    this.dropmenuobj.widthobj.width=menuwidth
  }
  if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
    obj.visibility=visible
  else if (e.type=="click")
    obj.visibility=hidden
}

Lmenu.iecompattest = function() {
  return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

Lmenu.prototype.clearbrowseredge = function(obj, whichedge) {
  var edgeoffset=0
  if (whichedge=="rightedge"){
    var windowedge=Lmenu.ie4 && !window.opera? Lmenu.iecompattest().scrollLeft+Lmenu.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
    this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
    if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)
      edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
  } else {
    var topedge=Lmenu.ie4 && !window.opera? Lmenu.iecompattest().scrollTop : window.pageYOffset
    var windowedge=Lmenu.ie4 && !window.opera? Lmenu.iecompattest().scrollTop+Lmenu.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
    this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
    if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
      edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
    if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
      edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
    }
  }
  return edgeoffset
}

Lmenu.prototype.populatemenu = function(what) {
  if (Lmenu.ie4||Lmenu.ns6)
    this.dropmenuobj.innerHTML=what.join("")
}


//------------------------------------------------------------------------------
// obj          - always set to the keyword:  this
// e            - always set to the keyword:  event
// menuContents - an array containing <a href></a> strings for the dropdown menu
// menuwidth    - the width in pixels (example '150px') of this drop down menu
// xoffset      - how far right to shift the menu (0 = left aligned with title)
// yoffset      - how far down  to shift the menu (0 = directly below the title)
//------------------------------------------------------------------------------
Lmenu.prototype.dropdownmenu = function(obj, e, menucontents, menuwidth, xoffset,yoffset) {
  if (window.event) event.cancelBubble=true
  else if (e.stopPropagation) e.stopPropagation()
    this.clearhidemenu()

  this.dropmenuobj=document.getElementById? document.getElementById("dropmenudiv_" + this.objName) : dropmenudiv
  this.populatemenu(menucontents)

  if (Lmenu.ie4||Lmenu.ns6){
    this.showhide(this.dropmenuobj.style, e, "visible", "hidden", menuwidth)
    this.dropmenuobj.x=Lmenu.getposOffset(obj, "left") + xoffset;
    this.dropmenuobj.y=Lmenu.getposOffset(obj, "top") + yoffset;
    this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
    this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
  }

  return Lmenu.clickreturnvalue()
}

Lmenu.clickreturnvalue = function() {
  if (Lmenu.ie4||Lmenu.ns6) return false
  else return true
}

Lmenu.contains_ns6 = function(a, b) {
  while (b.parentNode)
    if ((b = b.parentNode) == a)
      return true;

  return false;
}

Lmenu.prototype.dynamichide =  function(e){
  if (Lmenu.ie4&&!this.dropmenuobj.contains(e.toElement))
    this.delayhidemenu()
  else if (Lmenu.ns6&&e.currentTarget!= e.relatedTarget&& !Lmenu.contains_ns6(e.currentTarget, e.relatedTarget))
    this.delayhidemenu()
}

Lmenu.prototype.hidemenu = function(e){
  if (typeof this.dropmenuobj!="undefined"){
    if (Lmenu.ie4||Lmenu.ns6)
      this.dropmenuobj.style.visibility="hidden"
  }
}

Lmenu.prototype.delayhidemenu = function(){
  if (Lmenu.ie4||Lmenu.ns6)
    this.delayhide=setTimeout(this.objName + ".hidemenu()",Lmenu.disappeardelay)
}

Lmenu.prototype.clearhidemenu = function() {
  if (typeof this.delayhide!="undefined")
    clearTimeout(this.delayhide)
}
var home_myImg;

function index_domreadyInit() {
/*
  home_myImg = new Asset.image("images/frontpage.jpg",{
    id : "splash",
    opacity : 0,
    onload : function() {
      home_myImg.injectInside("imgParent");
      var myFx = new Fx.Tween("imgParent","opacity",{duration : 2000});
      myFx.start(0,1);
    }
  });
*/
};


function index_loadInit() {
  var myFx = new Fx.Tween("imgParent","opacity",{duration : 2000});
  myFx.start(0,1);
}


