/* Author: The Atom Group 

*/


/* Move next button on homepage below caption box when browser width is too small */
function refreshPageWidth() {
    var windowWidth = $(window).width();
    if (windowWidth < 1350) {
        $('.bg_next').addClass('move_down');
    }
    else {
        $('.bg_next').removeClass('move_down');
    }
}
refreshPageWidth();
// Reset Heights on Resize
$(window).resize(refreshPageWidth);

/* modify pages for mobile browsers */
if(!navigator.userAgent.match(/iPhone|iPod|iPad|BlackBerry|Android|Windows Phone/i)) {
    /* Countdown for homepage video */
    jQuery(function videoCountdown() {
        var count = 10, quitCount = false, countdown;
        $('#nothanks').click(function () {
            quitCount = true;
            setVideoCookie();
            return false;
        });
        if ($.cookie('itech_video_choice') === 'no_thanks') {
            quitCount = true;
            $('.watch_video').addClass('hidden');
        }
        countdown = setInterval(function () {
            $("span.countdown").html(count);
            if (quitCount === true) {
                return;
            }
            if (count === 0) {
                window.location = 'video.aspx';
                return;
            }
            count--;
        }, 1000);
    });
}

