/*
JavaScript for website: http:www.lifeingray.com
Author: Jesse Gray
*/
$(document).ready(function(){
	$('#nav').localScroll();
	// Populate All Hovers
	$('#site_logo a').append('<span class="hover"></span>');
	$('#navigation .home a').append('<span class="hover">Home</span>');
	$('#navigation .portfolio a').append('<span class="hover">Portfolio</span>');
	$('#navigation .tutorials a').append('<span class="hover">Tutorials</span>');
	$('#navigation .contact a').append('<span class="hover">Contact</span>');
	$(' #1_link a').append('<span class="hover">Introduction</span>');
	$(' #2_link a').append('<span class="hover">Web Development</span>');
	$(' #3_link a').append('<span class="hover">Interface Design (ui/ux)</span>');
	$(' #4_link a').append('<span class="hover">Technical Management</span>');
	$(' #5_link a').append('<span class="hover">Social / Resources</span>');
	$('#social_icons a').append('<span class="hover"></span>');
	
	
	// Add Active
	$('#nav li a').first().addClass('active');
	
    // Menu
	$('#navigation li a').hover(function() {
		// Stuff that happens when you hover on + the stop()
		$('.hover', this).stop().animate({
			'opacity': 1
			}, 700, 'easeOutSine')
	},function() {
		// Stuff that happens when you unhover + the stop()
		$('.hover', this).stop().animate({
			'opacity': 0
			}, 500, 'easeOutExpo')
	
	})
	
	// Logo
	$('#site_logo a').hover(function() {
		// Stuff that happens when you hover on + the stop()
		$('.hover', this).stop().animate({
			'opacity': 1
			}, 700, 'easeOutSine')
	},function() {
		// Stuff that happens when you unhover + the stop()
		$('.hover', this).stop().animate({
			'opacity': 0
			}, 500, 'easeOutExpo')
	
	})
	
	// Side
	$('#nav li a').hover(function() {
		// Stuff that happens when you hover on + the stop()
		$('.hover', this).stop().animate({
			'opacity': 1
			}, 700, 'easeOutSine')
	},function() {
		// Stuff that happens when you unhover + the stop()
		$('.hover', this).stop().animate({
			'opacity': 0
			}, 500, 'easeOutExpo')
	
	})	
	
	
	// Social
	$('#social_icons a').hover(function() {
		// Stuff that happens when you hover on + the stop()
		$('.hover', this).stop().animate({
			'opacity': 1
			}, 700, 'easeOutSine')
	},function() {
		// Stuff that happens when you unhover + the stop()
		$('.hover', this).stop().animate({
			'opacity': 0
			}, 500, 'easeOutExpo')
	
	})	
	
	
	$('#nav li a').click(function() {
		$('#nav li a').removeClass('active');
		$(this).addClass('active');
	})
	
	$('.contact').click(function() {
		$('#fade').fadeIn('200');
		$('#contact_form').fadeIn('200');
	})
	$('#fade').click(function() {
		$('#fade').fadeOut('200');
		$('#contact_form').fadeOut('200');
	})	
	$('#nvm').click(function() {
		$('#fade').fadeOut('200');
		$('#contact_form').fadeOut('200');
	})		
	$('.c_challenge').click(function() {
		$('.c_challenge').css('border', '1px solid #444');
	})		
	
	 /* image rotator */
	 var numRand = Math.floor(Math.random()*6);
	$('#social').css("background",'url(images/theme/5bg_' + numRand + '.jpg)');
	 
	
	
	
})
