/* TinyMCE Handling 
 */
$('textarea').each (function () {
  if (!$(this).attr ('class')) {
    $(this).addClass ('advanced');
  }
});
  
tinyMCE.init ({
  mode : 'specific_textareas',
  editor_selector : 'minimal',
  theme: 'advanced',
  theme_advanced_buttons1: 'bold,italic,underline,separator,undo,redo,link,unlink',
  theme_advanced_buttons2: '',
  theme_advanced_buttons3: '',
  theme_advanced_toolbar_location : 'top',
  theme_advanced_toolbar_align : 'left',
  theme_advanced_statusbar_location : 'bottom',
});

tinyMCE.init ({
  mode : 'specific_textareas',
  editor_selector : 'advanced',
  theme: 'advanced',
  theme_advanced_buttons1: 'bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,image',
  theme_advanced_buttons2: '',
  theme_advanced_buttons3: '',
  theme_advanced_toolbar_location : 'top',
  theme_advanced_toolbar_align : 'left',
  theme_advanced_statusbar_location : 'bottom',
});

/* Common JS
 */
$(function () {

  var $navItems = $('ul#mainNav > li');
  
  var navConfig = {
    sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
    interval: 100, // number = milliseconds for onMouseOver polling interval    
    over: navOver, // function = onMouseOver callback (REQUIRED)    
    timeout: 200, // number = milliseconds delay before onMouseOut    
    out: navOut // function = onMouseOut callback (REQUIRED)    
  };
  
  $navItems.hoverIntent (navConfig);
  
});

function navOver () {
  $(this).addClass ('hover');
  $('a:first', this).css ({ 'color': '#3A1906' });
}

function navOut () {
  $(this).removeClass ('hover');
  $('a:first', this).removeAttr ('style');
}