$(document).ready(function() {
   // toggles the more_info box on clicking the More Info &darr; link 
   $('.toggle').click(function(){
     if ($(this).next('blockquote').length > 0) {
        $(this).next('blockquote').toggle(400);
        $(this).toggleClass("up").toggleClass("down");
     } else if ($(this).next('.toggle_content').length > 0) {
        $(this).next('.toggle_content').toggle(400);
        $(this).toggleClass("up").toggleClass("down");
     }
     return false;
   }).toggleClass("down");

   //hide the div's to begin with
   $('.toggle').next().hide().addClass("toggle_content");
   $('.toggle:first').toggleClass("up").toggleClass("down").next().show();
   
   //home header rotation script
   if ($("#home #hdrImg #container").length > 0)
   {
      $('#container .items').cycle({
          fx: 'fade'
         ,timeout: 6500
         ,delay:  -1000
         ,pager: "#container .navi"
         //,after: onAfter
         //,sync: 1
         ,pause: 1
         ,pauseOnPagerHover: 1
         ,cleartype: true
         ,cleartypeNoBg: true
      });
      
      //append a pause/resume function to the navigation
       $("#container .navi").append("<a id='cycle_prev' class='cycle_nav' href='javascript:paginate_cycle({move: \"prev\"});'>Prev</a>");
       $("#container .navi").append("<a id='cycle_next' class='cycle_nav' href='javascript:paginate_cycle({move: \"next\"});'>Next</a>");

      
   }
});

//----------------------
function paginate_cycle(params){
   switch(params.move){
      case "prev":
         $('#container .items').cycle('prev');
      break;
      case "next":
         $('#container .items').cycle('next');
      break;
   }
}

