/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings =
  'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
  win = window.open(mypage,myname,settings)
}


/* fancy check boxes */
jQuery.fn.fauxCheck = function(){
  $(this).click(function(){
    if ($(this).find('input').attr('checked')) {
      $(this).find('input').removeAttr('checked');
      $(this).removeClass('checked');
    }
    else {
      $(this).find('input').attr('checked', 'checked');
      $(this).addClass('checked');
    }
  });
};

$(document).ready(function(){
  // article links rotator
  if ($('#news').length != 0) {
    showArticle('');
  }
  
  // handle clicking and fancy checkbox
  $('.fauxCheck').fauxCheck();

  // beta code
  /*
  queryString = window.location.search.substring(1);
  if (queryString.indexOf('beta=1') != -1) {
    $('a[href*="php"], a[href="/"]').each(function(){
      if ($(this).attr('href').indexOf('disclaimer') == -1) {
        if ($(this).attr('href').indexOf('?') == -1) {
          $(this).attr('href', $(this).attr('href') + '?beta=1');
        }
        else {
          $(this).attr('href', $(this).attr('href') + '&beta=1');
        }
      }
    });
  }*/
});
