var Header = {

  // add or remove menu options here, according to the pattern (below) -- menu option display text on the left of a colon and a target URL on the right
  // obs: all text should be wrapped in matching quotaion marks, and all but the last line in this grouping should have a trailing comma
  menu_options:{
    'Home':'http://www.balancedcanines.com/index.html',
    'Videos':'http://www.balancedcanines.com/dogtrainingvideos.php',
    'About Us':'http://www.balancedcanines.com/about.html',    
    'Contact Us':'http://www.balancedcanines.com/contact.php',
    'Client Area':'http://www.balancedcaninesdogtraining.com/index.php'    
  },

  // specify the URL for a logo[type] image here, and an optional link URL (leave quotation marks empty to prevent hyperlink behavior)
  // obs: labels left of the colon are predetermined -- customized URL values are expected on the right
  // obs: all text should be wrapped in matching quotaion marks, and all but the last line in this grouping should have a trailing comma
  branding:{
    'image_url':'http://www.balancedcanines.com/images/logo.png',
    'hyperlink_url':'http://www.balancedcanines.com/'
  },

  // specify pages (in a comma-delimited list) that can assert selection of the menu option that corresponds to the list
  // obs: all text should be wrapped in matching quotaion marks, and all but the last line in this grouping should have a trailing comma
  // obs: lists need to be wrapped in square brackets
  // obs: the default menu option to select, in the absence of specified pages, is 'Home'
  menu_option_assertions:{
    'Home':['testimonials.html'],
    'Services':['freeevaluation.php', 'inhomedbc.html', 'inhometraining.html', 'bootcamp.html', 'groupclasses.html', 'puppytraining.html', 'packobedience.html', 'etouchtraining.html', 'balancedboarding.html', 'dogtrainingguarantee.html', 'dogtrainingpaymentplan.html', 'dogtraininghousebreaking.html', 'dogtrainingaggression.html', 'dogtrainingrestlessspirit.html', 'dogtrainingcommands.html', 'dogtrainingdestructive.html', 'dogtrainingrecommendations.html'],
    'Videos':[],
    'About Us':[],
    'Contact Us':[]
  },

  update:function(div_element_id) {
    Utility.updateDivElementHtml(div_element_id,  this.getBrandingHtml() + this.getMenuHtml());
  },

  include:function() {
    self.document.writeln('\n\n<!-- ******** BEGIN::Header Mark-up ******** -->\n\n    <div id="top">\n' + this.getBrandingHtml() + this.getMenuHtml() + '    </div>\n\n<!-- ******** END::Header Mark-up ******** -->\n');
  },

  getMenuHtml:function() {
    var menu_css_class_name = 'menu_items';
    var selected_option_css_class_name = 'current';
    var unique_url_name = Utility.getUniqueUrlName();
    var html_text = '        <div id="menu"><ul id="lavalamp" class="' + menu_css_class_name + '">';
    var hash_key = '';
    for (hash_key in this.menu_options) {
      if (Utility.is_usable_string(hash_key) && Utility.is_usable_string(this.menu_options[hash_key])) {
        html_text += '<li' + (unique_url_name == Utility.getUniqueUrlName(this.menu_options[hash_key]) || this.should_assert_selection(hash_key, unique_url_name) ? ' class="current"' : '') + '><a href="' + this.menu_options[hash_key] + '" title="' + hash_key + '">' + hash_key + '</a></li>';
      }
    }
    return html_text + '</ul></div>\n';
  },

  should_assert_selection:function(hash_key, unique_url_name) {
    var should_assert_selection = false;
    if (Utility.is_usable_string(hash_key) &&  Utility.is_usable_data(this.menu_option_assertions[hash_key]) && Utility.is_usable_string(unique_url_name)) {
      var pages = '|' + this.menu_option_assertions[hash_key].join('|') + '|';
      if (pages.indexOf(unique_url_name) > 0) {
        should_assert_selection = true;
      }
    }
    return should_assert_selection;
  },

  getBrandingHtml:function() {
    var alternate_text = 'Balanced Canines';
    var image_css_class_name = 'logo';
    var html_text = '<img src="' + this.branding.image_url + '" alt="' + alternate_text + '" class="' + image_css_class_name + '" />';
    if (Utility.is_usable_string(this.branding.hyperlink_url)) {
      html_text = '<a href="' + this.branding.hyperlink_url + '" title="' + alternate_text + '">' + html_text + '</a>';
    }
    return '        ' + html_text + '\n';
  }

};

