/*
Theme Name: NaviTheme 2011
Theme URI: http://www.navltd.com/
Description: Navigator Ltd.'s Corporate Website Theme. Widgetized. Templated. Beautiful. Designed and developed by Mike Kormendy.
Version: v2.0
Author: Navigator Ltd.
Author URI: http://www.navltd.com/

This file is part of the Navigator Ltd. Blog Theme for WordPress
Copyright (c) 2011 Navigator Ltd. All rights reserved.
*/

/* logo animation */

function animate_logo() {
	// when the logo runs its animation, catch and clear any previous timers about to play
	// clearTimeout(lt);
	// create a new timer
	// var lt = setTimeout(logo_replay,45000);
	
	// deactivate any logo animation triggers
	// $('#logo').unbind('mouseenter');
	
	// from default position (in case browser isn't supporting js
	// animate word mark right to left
	$('.wordmark').animate({left: '-=60px',opacity:0}, 1000, 'easeInCubic', function() {
		// after animating to fade out quickly, reset position far right
		$(this).css({left:763});
		// animate in from right to default position
		$(this).animate({left: '-=60px',opacity:1}, 4000, 'easeOutQuint', function() {
			// reactivate logo animation triggers
			/*
			$('#logo').mouseenter(function() {
				animate_logo();
			});
			*/
		});
	});
	// 
	// animate glint left to right fade in to burst-point
	$('.glint').css({'display':'inline'});
	$('.glint').animate({left: '+=150px',opacity:1}, 1000, 'easeInExpo', function() {
		// when burst point reached animate left to right fade out
		$(this).animate({left: '+=75px',opacity:0}, 3000, 'easeOutExpo', function() {
			// when faded out reset location and hide
			$(this).css({left:650,'display':'none'});
		});
		// when burst point reached reveal burst
		$('.burst').css({'display':'inline'});
		// .. and animate right to left fade out
		$('.burst').animate({left: '-=14px',opacity:0}, 1600, 'linear', function() {
			// when faded out reset location and hide
			$(this).css({left:571,'display':'none',opacity:1});
		});
	});
	// animate flare right to left fade in to burst-point
	$('.flare').css({'display':'inline'});
	$('.flare').animate({left: '-=100px',opacity:1}, 1000, 'easeInExpo', function() {
		// when burst point reached animate right to left fade out
		$(this).animate({left: '-=150px',opacity:0}, 3000, 'easeOutExpo', function() {
			// when faded out reset location and hide
			$(this).css({left:913,'display':'none'});
		});
	});
}

/* dom ready trigger */

$(document).ready(function() {
	setTimeout(animate_logo,2000);
});
