// Sof of home page slider (http://www.slidedeck.com/) + Low Variables


// The most basic implementation using the default options
$('.skin-xml dl.slidedeck').slidedeck({
    scroll: 'stop'
});

$(".blipmap div.pulse").hover(function() {$(this).siblings().addClass("active");}, function() {$(this).siblings().removeClass("active");});


$('#mycarousel').jcarousel({
    wrap: 'circular',
    scroll: 1,
    auto: 3
});


$(document).ready(function() {
  
    setInterval( function() {preloadTestimonial();}, 8000 );
    
    
    $.testimonials = null;
    
    
  
});


$('#next-testimonial').live('click', function() {preloadTestimonial();});


function preloadTestimonial(){
    $.get("/_includes/ajax_testimonial_item", function(data) {
      $.testimonials = data;
      
      var cacheImage = document.createElement('div');
      cacheImage.innerHTML = data;
      
        setTimeout( function() {loadTestimonial();}, 2000 );
    });
    
    
    
}


function loadTestimonial(){
    
    //var current_testimonial = parseInt($('#current_testimonial').val()) + 1;
    
    $('.testimonial-inner').fadeOut('slow', function() {
        
        
        $(".testimonial-inner").html($.testimonials).fadeIn();
        
//        $(".testimonial-inner").load("/_includes/ajax_testimonial_item" ,
//            function(){
//                $('.testimonial-inner').fadeIn('slow');
//            }
//        );


 
    });
  
}

