  // Cufon text replacememnt, add more elements to replace text with cufon generated text.
  Cufon.replace('ul.sf-menu li a, h3, h1, a.btn, .cufon, .content h1, .content h2, .content h3, .content h4, .content h5, .content h6, #footer h4',{hover: true});
  
  //Anything with the class .image_load that hols and image will use the ajax loader.
  $(function () {
    $('.image_load img').hide();//hide all the images on the page
  });

  var i = 0;//initialize
  var int=0;//Internet Explorer Fix
  $(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
    var int = setInterval("doThis(i)",500);//500 is the fade in speed in milliseconds
  });

  function doThis() {
    var images = $('.image_load img').length;//count the number of images on the page
    if (i >= images) {// Loop the images
      clearInterval(int);//When it reaches the last image the loop ends
    }
    $('.image_load img:hidden').eq(0).fadeIn(500);//fades in the hidden images one by one
    i++;//add 1 to the count
  }
  
$(document).ready(function() { 
    
    //Main navigation dropdowns
        $('ul.sf-menu').superfish({ 
            delay:       600,                            // one second delay on mouseout 
            animation:   {height:'show'},  // fade-in and slide-down animation 
            speed:       'fast',                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: false                            // disable drop shadows 
        });  
  // textbox watermarks
  $("#name").waterMark();
  $("#email").waterMark();
  
  //Open external links in new window
  $('a.external').click( function() {
    window.open(this.href);
    return false;
  });
  
    $('#slider').cycle({ 
      fx:      'fade', 
      speed:    500, 
      timeout:  5000 
    });
  
      //Frontpage event cycle   
    $('#EventList').cycle({
        fx: 'scrollHorz',
        cleartypeNoBg: true,
        timeout: 0,
        easing: 'easeOutQuad',
        next: '#EventListNext',
        prev: '#EventListPrev',
        after: onAfter1 
    }); 
  
  function onAfter1(curr,next,opts) {
  var caption1 = (opts.currSlide + 1) + '/' + opts.slideCount;
  $('#EventListPagenumber').html(caption1);
}

}); 





