var Utility = {
  updateDivElementHtml:function(div_element_id, html_text) {
    if (this.is_usable_string(div_element_id) && this.is_usable_string(html_text) && this.is_usable_data(self.document.getElementById)) {
      var element = self.document.getElementById(div_element_id);
      if (this.is_usable_data(element)) {
        element.innerHTML = html_text;
      }
    }
  },

  getUniqueUrlName:function(url_text) {
    if (!this.is_usable_string(url_text)) {
      url_text = self.location.href;
    }
    var unique_url_name = url_text.replace(/(\.[a-z0-9]{2,4}|\/)$/i, '');
    // var pattern = new RegExp('/' + self.location.hostname + '$/', 'i');
    // unique_url_name = pattern.test(unique_url_name) ? '' : unique_url_name.replace(/.*\/(.*)/, '$1');
    // return unique_url_name;
    return unique_url_name.replace(/.*\/(.*)/, '$1');
  },

  is_usable_data:function(postulant_data) {
    return !(postulant_data === null || typeof postulant_data == 'undefined');
  },

  is_usable_string:function(postulant_data) {
    return typeof postulant_data == 'string' && postulant_data.length > 0;
  }
};

