﻿$(function() {
    $('.PopContent').hide();
    StartRotator(0);
    
    $('#WhyBuyShadow').hide().removeClass("hide").hover(
        function() { $('#Rotator').cycle('pause'); }, 
        function() { }
    );
    
    $('.whyBuyPopOpen').click(function(e){
        e.preventDefault();
        var offset = $(this).offset();
        $('#WhyBuyPopContent').html($(this).siblings('div.PopContent').html());
        $('#WhyBuyShadow').fadeIn(400).css({ "left": offset.left - 160, "top": offset.top - 130 });
    });
    
    $('.whyBuyPopClose').click(function(e){
        e.preventDefault();
        $('#WhyBuyShadow').fadeOut(200);
        $('#Rotator').cycle('resume');
    });
    
    $('.whyBuyPopClose img').css("opacity", 0.6).hover(function(){ $(this).css("opacity", 1.0)}, function(){ $(this).css("opacity", 0.6)});
});﻿

function StartRotator(StartingFrame) {
    $('#Rotator').removeClass('hide').cycle({ 
        fx:         'scrollUp',        
        timeout:    12000,
        speed:      600,
        pager:      '#slides',
        pagerEvent: 'click',
        startingSlide: StartingFrame,
        pause:      1 
    });
};