function print_r(theObj){
  if(theObj.constructor == Array ||
     theObj.constructor == Object){
    document.write("<ul>")
    for(var p in theObj){
      if(theObj[p].constructor == Array||
         theObj[p].constructor == Object){
document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
        document.write("<ul>")
        print_r(theObj[p]);
        document.write("</ul>")
      } else {
document.write("<li>["+p+"] => "+theObj[p]+"</li>");
      }
    }
    document.write("</ul>")
  }
}

jQuery().ready(function() {
    $('#digitus-slider').each(function() {
        var _d = $('#digitus-slider').hasClass('dark');
        $(this).data('href', $(this).find('a:first').attr('href'));
        $(this).slider({
            min: 0,
            max: 28,
            value: _d ? 28 : 0,
            animate: true,
            stop: function(e,ui) {
                if ((!_d && ui.value > ($(this).slider("option", "max") - 2)) ||
                    (_d && ui.value <= 2)) {
                    window.location = $(this).data('href');
                } else {
                    $(this).slider("value", (_d ? 28 : 0));
                }
            }
        });
    });
});
