    $(document).ready(function() {

      // Add mouseover and click event to navigation list items.

      $('ul.main-navigation>li').each(function(i, item)
      {
        
        if($("ul", this).length)
        {
          $(this).click(function()
          {
            if($(this).hasClass('selected'))
            {
              $("ul", this).hide("slide", {direction: "up"}, 400);
              $(this).removeClass('selected');
            }
            else
            {
              $(this).addClass('selected');
              $("ul", this).show("slide", {direction: "down"}, 400);
            }
            
            
          });
        }
      });
      // End add mouseover and click event to navigation list items
      
      // Start replace select box with a nice one
      // The select element to be replaced:
//       var select = $('select.makeMeFancy');
// 
//       var selectBoxContainer = $('<div>',{
//           width       : select.outerWidth(),
//           className   : 'tzSelect',
//           html        : '<div class="selectBox"></div>'
//       });
// 
//       var dropDown = $('<ul>',{className:'dropDown'});
//       var selectBox = selectBoxContainer.find('.selectBox');
// 
//       // Looping though the options of the original select element
// 
//       select.find('option').each(function(i){
//           var option = $(this);
// 
//           if(i==select.attr('selectedIndex')){
//               selectBox.html(option.text());
//           }
// 
//           // As of jQuery 1.4.3 we can access HTML5
//           // data attributes with the data() method.
// 
//           if(option.data('skip')){
//               return true;
//           }
// 
//           // Creating a dropdown item according to the
//           // data-icon and data-html-text HTML5 attributes:
// 
//           var li = $('<li>',{
//               html:   '<span>'+
//                       option.html()+'</span>'
//           });
// 
//           li.click(function(){
// 
//               selectBox.html(option.text());
//               dropDown.trigger('hide');
// 
//               // When a click occurs, we are also reflecting
//               // the change on the original select element:
//               select.val(option.val());
// 
//               return false;
//           });
// 
//           dropDown.append(li);
//       });
// 
//       selectBoxContainer.append(dropDown.hide());
//       select.hide().after(selectBoxContainer);
// 
//       // Binding custom show and hide events on the dropDown:
// 
//       dropDown.bind('show',function(){
// 
//           if(dropDown.is(':animated')){
//               return false;
//           }
// 
//           selectBox.addClass('expanded');
//           dropDown.slideDown();
// 
//       }).bind('hide',function(){
// 
//           if(dropDown.is(':animated')){
//               return false;
//           }
// 
//           selectBox.removeClass('expanded');
//           dropDown.slideUp();
// 
//       }).bind('toggle',function(){
//           if(selectBox.hasClass('expanded')){
//               dropDown.trigger('hide');
//           }
//           else dropDown.trigger('show');
//       });
// 
//       selectBox.click(function(){
//           dropDown.trigger('toggle');
//           return false;
//       });
// 
//       // If we click anywhere on the page, while the
//       // dropdown is shown, it is going to be hidden:
// 
//       $(document).click(function(){
//           dropDown.trigger('hide');
//       });   
//       // End replace select box with a nice one
      
      // Start remove text on focus
      $('.removeDefault').each(function(i, item)
      {
        $(this).click(function()
        {
          $(this).val('');
        });
      });
      // end remove text on focus
      
      // Start mouseover for small promos
      $('.small-promo').each(function(i, item)
      {
        $(this).mouseover(function(){
          $(this).addClass('small-promo-selected');
          $(this).removeClass('small-promo');
        });
        
        $(this).mouseout(function(){
          $(this).addClass('small-promo');
          $(this).removeClass('small-promo-selected');
        });
      });
      // end mouseover for small promos
      
      // Add the glossary function
      $('.glossary_term').each(function(i, item)
      {
        $(this).click(function()
        {
          changeGlossaryDescription($(this).attr('id'));
        });
      });
      // End add glossary function
      
      // Start Hiden divs
      $('.drop-down-content').hide();
      $('.drop-down-link').each(function(i, item)
      {
        
        $(this).click(function()
        {
          $('#drop-down-content-' + $(this).attr('id')).toggle();
        });
      });
      // end hidden divs
      
      // Site search
      $('#btnSearchSite').click(function(e)
      {
        e.preventDefault();
        strTerms = $('#strSearchTerm').val();
        window.location.href="/search/" + strTerms;
      });
      // End Site Searcg
    }); 
