function addLoadEvent(func) {
   var oldonload = window.onload;
   if (typeof window.onload != 'function') {
     window.onload = func;
   } else {
     window.onload = function() {
       if (oldonload) {
         oldonload();
       }
       func();
     }
   }
 }
 
addLoadEvent(assignEvents);
addLoadEvent(hideAll);
function openEvent() {
  if ($(this.id + 'D')) {
    if ($(this.id + 'D').style.display == "none") {
        closeAll(); 
        new Effect.BlindDown(this.id + 'D', {duration: .5})
    } else {
        closeAll();
    }
  }
}
function assignEvents() {
  var oUl = document.getElementById('prdlinklst');
  var oLi = oUl.getElementsByTagName("li") ;
  for (var i=0; i<oLi.length; i++) {
    oLi[i].onclick = openEvent;
  }
}
function getElementsByClassName(class_name)
{
  var all_obj,ret_obj=new Array(),j=0,teststr;
  if(document.all)all_obj=document.all;
  else if(document.getElementsByTagName && !document.all)all_obj=document.getElementsByTagName("*");
  for(i=0;i<all_obj.length;i++)
  {
    if(all_obj[i].className.indexOf(class_name)!=-1)
    {
      teststr=","+all_obj[i].className.split(" ").join(",")+",";
      if(teststr.indexOf(","+class_name+",")!=-1)
      {
        ret_obj[j]=all_obj[i];
        j++;
      }
    }
  }
  return ret_obj;
}
function closeAll() {
  oDivs = getElementsByClassName('klappDiv');
  for (i=0; i < oDivs.length; i++) {
    if (oDivs[i].style.display != 'none') {
      Effect.BlindUp(oDivs[i], {duration: .5});
    }
  }
}
function hideAll() {
  oDivs = getElementsByClassName('klappDiv');
  for (i=0; i < oDivs.length; i++) {
    if (oDivs[i].style.display != 'none') {
      oDivs[i].style.display = "none";
    }
  }
}
