$(document).ready(function(){
	setInterval(function(){
		$('#rays').animate({ rotate: '+=15deg' }, 5000, 'linear');
	}, 0);
    $('#menu').addClass('inAnimation').animate({"left": "450px", "width": "300px"},{queue:false,duration:300,complete:function(){$(this).removeClass('inAnimation')}});
	$('#cloud').jparallax({
				mouseActiveOutside: false,
				triggerExposesEdges: true,
				frameDuration: 20}, {xtravel: .7, ytravel: .1}, {xtravel: .9, ytravel: 0}, {xtravel: .10, ytravel: 0}, {xtravel: .10, ytravel: 0}
			);
});

$(function(){
    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 1000);
                return false;
            }
        }
    });
});

