$(document).ready(function(){

$("img").attr('alt', '');// The Goat hates alt tooltips so I had to secretly hide them, dont tell him!
$("img").attr('title', '');// The Goat hates alt tooltips so I had to secretly hide them, dont tell him!


// - NEWS ACCORDIAN ------------------------------------------/

//create toggle icon holder
	$('<span class="panel-state"></span>').appendTo('.news-content');
		
	$('.news-content').css({height: '16px'});
	$('.news-content:first').css({height: 'auto'}).addClass('active').find('.panel-state').css({"backgroundPosition" : "0px -50px"});	
			
	$('.news-content span.panel-state').toggle(function(){
			$('.news-content.active')
				.css({height: '16px'})
				.removeClass('active')
				.find('.panel-state')
				.css({"backgroundPosition" : "0px 10px"});
				
			$(this)
				.css({"backgroundPosition" : "0px -50px"})
    			.parent()
				.css({height: 'auto'})
				.addClass('active');
    		},
 
			function() 
			{
			$(this)
				.css({"backgroundPosition" : "0px 10px"})
    		$(this)
				.parent()
				.css({height: '16px'})
				.removeClass('active');
    })




		
 //- BUBBLY NAVIGATION -----------------------------------/
//	$('.ie9 nav a').hover(function(){
//		$(this).animate({
//				left: '+=10px'
//			}, 300);
//		},
//		function(){	
//		$(this).animate({
//				left: '-=10px'
//			}, 500);
//	})

		
// - FEATURED GALLERY ------------------------------------/		
	
$("#pikame").PikaChoose({carousel:true,carouselOptions:{wrap:'circular'}});
				
			
})


// - TWITTER FADER ------------------------------------------/

jQuery(function($) {
  var tweets = {
    el: '.twitterTicker .twitter-stream',
    items: new Array(),
    count: 0,
    total: -1,
    delay: 8000,
    animate: true
  };
  $(tweets.el+' p').each(function(i) {
    tweets.items[i] = $(this).html();
    tweets.total++;
  }).hide();
  runTweeter();
  function runTweeter() {
    if(tweets.animate == true) {
      if($(tweets.el+' p').length > 0) {
        $(tweets.el).children('p').fadeOut(500, function() {
          $(this).parent(0).empty().append('<p style="display: none;">'+tweets.items[tweets.count]+'</p>').children('p').fadeIn(500);
        });
      } else {
        $(tweets.el).empty().append('<p style="display: none;">'+tweets.items[tweets.count]+'</p>').children('p').fadeIn(750);
      }
    } else {
      $(tweets.el).empty().append('<p>'+tweets.items[tweets.count]+'</p>');
    }
    setTimeout(function() {
      if(tweets.count == tweets.total) {
        tweets.count = 0;
      } else {
        tweets.count++;
      }
      runTweeter();
    }, tweets.delay);
  }
});



