// mcgowan 

function log(s)
{
  try {console.log(s)} catch (e) {}
  var logEl = $('#anthumLogContent');
  if (logEl.length == 0)
  {
    logEl = $('<div id="anthumLog" ontouchstart="$(this).remove()" style="border-color: #dddddd; border-style: solid; border-width: 1px 1px 0 0; padding: 2px; position: absolute; bottom: 15px; left: 0px;background: black; color: green; font-size: 11px; font-family: arial;">\
               <div style="color: #aaaaaa !important; text-align: right;font-size: 9px"><a style="color: #aaaaaa !important; " href="javascript:void(0)" onclick="$(\'#anthumLog\').remove()">clear</a></div>\
               <div id="anthumLogContent" style="padding: 5px;"></div>\
             </div>');
    $('body').append(logEl);
    logEl = $('#anthumLogContent');
  }
  logEl.append(s+'<br />');
}

function newsTab(a, id) {
  var o = $(a);
  o.parents('tr').find('a').removeClass('active');
  o.addClass('active');
  $('#newsContent').children('div').hide();
  $('#newsContent_'+id).fadeIn();
}

function homeFeature(dir) {
  var all = $('div.homeFeature');
  var active = all.filter(':visible');
  var prev = active.prev('div.homeFeature');
  var next = active.next('div.homeFeature');

  all.hide();

  if (dir=='prev') {
    if (prev.length == 0) {all.last().fadeIn();} else {prev.fadeIn();}
  } else {
    if (next.length == 0) {all.first().fadeIn();} else {next.fadeIn();}
  }
}

function initFAQ() {
  var questions = $('.faqQuestion');
  var answers = $('.faqAnswer');
  answers.hide();
  
  questions.bind('mouseover', function() {$(this).css('cursor','pointer');}).bind('click', function() {
    $(this).toggleClass('faqQuestionActive');
    $(this).next('.faqAnswer').slideToggle();
  });
}
