/*
 *
 *	Faultless jQuery functions
 *		Stuart Swope
 */
 
/* Enable home tab interface*/
jQuery.enableHomeTabs = function () {
   jQuery('#searchBoxNav li a').click(function() {
      //parse out the name of the link that was clicked
      var clicked_link = jQuery(this).attr('id').split("-");
      
      var link_name = clicked_link[0];
      jQuery("#searchBoxNav li a").css("background-color", "#edf3f6");
      jQuery(this).css("background-color", "#d5e0e7");
      jQuery('.search-description').hide();
      jQuery('#' + link_name).show();

      return false;
   });
};
/* Show help tooltips for caster store menus. */
jQuery.showHelp = function () {
   if (window.XMLHttpRequest) { /* ie6 ignore */
      jQuery('.menuHelp').hover(function() {
         //parse out the name of the link that was clicked
         var hover_item = jQuery(this).attr('id').split("-");
         var id = hover_item[1];
         
         var position = jQuery(this).offset();
         position['left'] += 50;
         position['top'] += 0;
         jQuery('#help-' + id).fadeIn(400).css(position);
   
         return false;
      },
      function() { 
         var hover_item = jQuery(this).attr('id').split("-");
         var id = hover_item[1];
   
         jQuery('#help-' + id).fadeOut(400);
         return false;
      });
   }
};

jQuery(document).ready(function() {
   jQuery.noConflict();
   jQuery.enableHomeTabs();
   jQuery.showHelp();
});
