// Add Hover Opacity for the social media icons
var selector = ".social-icons a"; // CSS Selector for element you want to apply fade to.
var hoverOver = "0.5" // Hover over opacity value (1 = opaque, 0 = transparent)
var hoverOut = "1" // Hover out opacity value (1 = opaque, 0 = transparent)
$(document).ready(function () {
    $('body').removeClass('void'); //removes default CSS :hover effect
    $(selector).hover(

    function () {
        $(this).stop().animate({
            'opacity': hoverOver
        }, 500);
    }, function () {
        $(this).stop().animate({
            'opacity': hoverOut
        }, 500);
    });
	
	// Rocket animation effect
    $('.rocket').everyTime(10, function () {
        var ranX = 10 + Math.floor(Math.random() * 2);
        var ranY = 10 + Math.floor(Math.random() * 3);
        $(".rocket").animate({
            marginTop: "+=" + ranX
        }, 1000, 'linear').animate({
            marginTop: "-=" + ranX
        }, 1000, 'linear');
    });
	
	// JavaScript countdown 
    var austDay = new Date();
    austDay = new Date(austDay.getFullYear() + 1, 10, 14); //Just change this to your own date of launching
    $('#countdown').countdown({
        until: austDay
    });
	
	// Bottom contact form JavaScript Validation
    $("#newslatter_form").validate({
        meta: "validate",
        submitHandler: function (form) {
            $('#newslatter_form').hide();
            $('#newslattersucessmessage').append("<h4 class='form_thanks'>Thanks! We'll make sure you'll be the first to hear when we are live!</h4>");
            return false;
            form.submit();
        },
        /* */
        rules: {
            emailAddress: {
                required: true,
                email: true
            },
        },
        messages: {
            emailAddress: {
                required: "*",
                email: "*"
            },
        },
    });
	//End
});
