/* ==================================================
   dagik/js/base.js
   last update: 2009-10-19 15:39:48 daiki
   ================================================== */


   function el(e) { return document.getElementById(e); }


   function getDepth() {
       var host = window.location.hostname;
       var path = window.location.pathname;

       /* count slash in pathname from dagik root dir */
       var str = path;
       var count = -1;
       while (str.match(/(\/)/)) {
	   count++;
	   str = RegExp.rightContext;
       }
       if (host.match(/^dagik\.org$/)) return count;
       else return count - 1;
   }
