$(document).ready(function() {
  if($("#home-banner").length > 0) {
  $('#home-banner').cycle({ 
      fx:    'fade', 
      speed:  2500 
   });
 }
 
  if($("#process-slides").length > 0) {

   $('#slides').cycle({ 
       fx:     'scrollHorz', 
       prev:   '#prev', 
       next:   '#next',
       after:   onAfter, 
       timeout: 15000,
       speed: 500 
   });
   
   $('#next, #prev').click(function() { 
       $('#slides').cycle('pause'); 
   });
   
  
   
 $("#slides").touchwipe({
         wipeLeft: function() {
             $("#slides").cycle("next");
         },
         wipeRight: function() {
             $("#slides").cycle("prev");
         }
     });
  }
  
  

   function onAfter(curr, next, opts) {
       var index = opts.currSlide;
       $('#prev')[index == 0 ? 'hide' : 'show']();
       $('#next')[index == opts.slideCount - 1 ? 'hide' : 'show']();
   }
  
  
  if($("#content.team").length > 0) {
  var showText='More...';
  var hideText='More...';
  var is_visible = false;
  $('.indent').prev().append(' (<a href="#" class="toggleLink">'+showText+'</a>)');
  $('.indent').hide();
  $('a.toggleLink').click(function() {
  is_visible = !is_visible;
  $(this).html( (!is_visible) ? showText : hideText);
  $(this).parent().next('.indent').slideToggle();
  return false;
  });
  }
  
  
  
 // Add print header to top of page
 	$("body").prepend("<h5 class=\"print\">oil sands<span class=\"bottom\">imaging</span></h5>");
 
 
 
 
});
