function var_dump(obj) {
   if(typeof obj == "object") {
      return "Type: "+typeof(obj)+((obj.constructor) ? "\nConstructor: "+obj.constructor : "")+"\nValue: " + obj;
   } else {
      return "Type: "+typeof(obj)+"\nValue: "+obj;
   }
}//end function var_dump



function toogleTree(linkElement) {
  ulElement = $(linkElement).next().next();//.find('ul');//.css('display', 'block');
//    console.log(ulElement);
  if (ulElement.css('display') != 'none') {
    ulElement.css('display', 'none');
  } else {
    $(".side-menu .categories ul li > ul").css('display', 'none');
    ulElement.parentsUntil('.level0', 'ul').css('display', 'block');
    ulElement.css('display', 'block');
  }
  
}


function showProducts(linkElement) {
  $(linkElement).parent().parent().parent().find('div.products-wrapper').css('display', 'none');
  $(linkElement).parent().parent().parent().find('h3 a').removeClass('current');
  $(linkElement).addClass('current');
  $(linkElement).parent().next().css('display', 'block');
}
