﻿function hideSignupBtn(){
    document.getElementById("newslettersignup_newsletterbtn").style.visibility = "hidden";
}

$(function () {     

    $(".promo-2012-video-link").hover(
        function(){
            $(this).animate({"opacity" : 0}, 500);
        },
        function(){
            $(this).animate({"opacity" : 1}, 500);
        }
    );
            
    $(".menu .static").hover(function(){ 

		//Fade to an opacity of 1 at a speed of 200ms
		$(this).children("ul").css({"opacity" : 0, "visibility" : "visible"}).stop().animate({"opacity" : 1}, 500); 

		//On mouse-off
		}, function(){

		//Fade to an opacity of 0 at a speed of 100ms
		$(this).children("ul").stop().animate({"opacity" : 0}, 200, function(){$(this).css("visibility","hidden")}); 

	});

    $('#slidermenu').bxSlider({
        auto: true,
        controls: false,
        pager: true,
        pagerSelector: '#slidercontrol',
        pause: 6500,
        speed: 750,
        easing: 'swing',
        autoHover: true,
        autoStart: true,
        onBeforeSlide: function (currentSlide, totalSlides, currentSlideObj) {
                                    
            if (currentSlide == 0) {

                $("#testimonial-3").delay(100).animate({                            
                        opacity: '0',
                    }, 1000, function () {
                    $(this).css({'display' : 'none'});
                });

                $("#testimonial-2").animate({                            
                        opacity: '0',
                    }, 1000, function () {
                    $(this).css({'display' : 'none'});
                });

               
            }
            else if (currentSlide == 1) {
                $("#testimonial-1").delay(100).animate({                            
                        opacity: '0',
                    }, 1000, function () {                            
                    $(this).css({'display' : 'none'});
                });

                $("#testimonial-3").animate({                            
                        opacity: '0',
                    }, 1000, function () {                            
                    $(this).css({'display' : 'none'});
                });

            
            }
            else if (currentSlide == 2) {

                $("#testimonial-2").delay(100).animate({                            
                        opacity: '0',
                    }, 1000, function () {                            
                    $(this).css({'display' : 'none'});
                });

                $("#testimonial-1").animate({                            
                        opacity: '0',
                    }, 1000, function () {                            
                    $(this).css({'display' : 'none'});
                });

               
            }
        },
        onAfterSlide: function (currentSlide, totalSlides, currentSlideObj) {
                    
            if (currentSlide == 0) {                               

                $("#testimonial-1").css('display','block').delay(100).animate({                            
                        opacity: '1',
                    }, 1000, function () {                           
                });
            }
            else if (currentSlide == 1) {
                $("#testimonial-2").css('display','block').delay(100).animate({                            
                        opacity: '1',
                    }, 1000, function () {                            
                            
                });
            }
            else if (currentSlide == 2) {
                $("#testimonial-3").css('display','block').delay(100).animate({                            
                        opacity: '1',
                    }, 1000, function () {
                                                       
                });
            }
        }
    });
});
