/**********************************************
 Blackbaud Design Custom JavaScript
***********************************************
 Site:		SSP Science News for Kids	
 Author: 	Chris Wolf
 Created:	12/07/10	
 WordPress Ver.	3.0.x
 
*********** CHANGE LOG ************************



**********************************************/

/************* global definitions ************/
var isEditView = window.location.href.match('edit=');

/************* run page load functions ************/
jQuery(document).ready(function($){
  bbGlobal();
  siteGlobal();
});





/********** define plugins and functions **********/

// core design global functions
function bbGlobal()
{

 // replace copyright with current year
 function currentYear()
 {
  $("#currentYear").text((new Date).getFullYear());
 };
	
 function fixPositioning()
 {
  $('div[id$=_panelPopup]').appendTo('body');
  $('div[id$=_panelPopup_DropShadow]').appendTo('body');
 };
	
 function menuClasses(menuClass)
 {
  var thisMenu = $(this);
  $(menuClass).each(function(){
   $('li:first',this).each(function(){
    $(this).addClass('first');
   });
   $('li:last',this).each(function(){
    $(this).addClass('last');
   });
   $('.categories a').each(function(){
    var thisText = $(this).text();
    $('.widget_categories li:contains("'+thisText+'")').addClass('current-cat');
   });
  });
 };	
 
 // execute functions
 // remove or comment out unused functions
 fixPositioning();
 currentYear();
 menuClasses('.menu');
 menuClasses('.widget_pages ul');

};


// site specific global functions
function siteGlobal()
{

$('.slide').SlideSet({
 display: 'album',
 tabs: 'text',         // 'thumb' uses image; 'tab' uses text; 'browse' uses left and right arrows; 'none' does not build tabs;
 prev: '<',       // text/html for 'previous' button
 next: '>',       // text/html for 'next' button
 tabParams: {           // parameters from tabs plugin
  effect: "fade",
  fadeOutSpeed: "slow",
  rotate: true
 },
 slideshowParams: {     // parameters from slideshow plugin
  autoplay: true,
  interval: 8000,
  clickable: false
 },
 tabNavPos: 'none',     // 'top' puts nav above slider; 'bottom' puts nav below slider; 'none' removes nav;
 tabQty: 5              // 'auto' sets width with CSS; integers set qty and width of container;
});
$('.slideNav').each(function(){
 $(this).css('margin-left',$(this).width()/2-$(this).width());
});
$('.home .oneThird .tag-post-item').SlideSet({
 display: 'slider',
 prev: '<',       // text/html for 'previous' button
 next: '>',       // text/html for 'next' button
 tabNavPos: 'none',     // 'top' puts nav above slider; 'bottom' puts nav below slider; 'none' removes nav;
 tabQty: 'auto',              // 'auto' sets width with CSS; integers set qty and width of container;
 scrollParams: {
  circular: false,
  vertical: false
 },
 autoscroll: {
  autoplay: false
 }
});
/*$('.subcat-posts').SlideSet({
 display: 'slider',
 prev: '<',       // text/html for 'previous' button
 next: '>',       // text/html for 'next' button
 tabNavPos: 'bottom',     // 'top' puts nav above slider; 'bottom' puts nav below slider; 'none' removes nav;
 scrollParams: {
  vertical: false,
  circular: true
 },
 autoscroll: {
  autoplay: true,
  interval: 15000
 },
 tabQty: '3'
});*/

};


// page specific functions



// embedded plugins (paste plugin code here or link to separately in layout)

