function EKUtilsObject() {

  this.Debug = Debug;
  this.ClearDebugDiv = ClearDebugDiv;
  this.zeropad = PadDigits;
  this.str_repeat = str_repeat;

  function PadDigits(n, totalDigits) 
  { 
    n = n.toString(); 
    var pd = ''; 
    if (totalDigits > n.length) 
    {
      for (i=0; i < (totalDigits-n.length); i++) 
      { 
        pd += '0'; 
      } 
    } 
    return pd + n.toString(); 
  }
  

  function str_repeat ( input, multiplier ) {
    // Returns the input string repeat mult times  
    // 
    // version: 909.322
    // discuss at: http://phpjs.org/functions/str_repeat    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // *     example 1: str_repeat('-=', 10);
    // *     returns 1: '-=-=-=-=-=-=-=-=-=-='
    return new Array(multiplier+1).join(input).toString();
  }
  
  function Debug(output_div_id,var_name,var_value) {
    var dv = document.getElementById(output_div_id);
    if ( dv ) { dv.innerHTML += "<pre>" + var_name + ":'" + var_value + "'</pre>\n"; }
  }
  
  function ClearDebugDiv(output_div_id) {
    var dv = document.getElementById(output_div_id);
    if ( dv ) { dv.innerHTML = ""; }
  }

}

var EKUtil = new EKUtilsObject();