
$(document).ready(function() {
	// Animate Body for smooth loading
	$('body').animate({
			opacity: 1
		}, 1000, function() {
	});
	
	// NAVIGATION
	$('#nav').hover(function() {
		$('#sign').stop().animate({opacity: 0.99}, 200);
		$('#arrow').stop().animate({rotate: '180deg', scale: '1'}, 300);
		$('#menu').stop().animate({
			height: 100
		  }, { easing: 'easeOutExpo' }, 300, function() {
			  // complete
		});
		
		$('#nav ul#mainmenu').stop().animate({
			height: 70
		  }, { easing: 'easeOutExpo' }, 300, function() {
			  // complete
		});
		if($('#nav ul.list').css('display')=="block") {
			$('#nav ul.list').stop().animate({
				height: 70
			  }, { easing: 'easeOutExpo' }, 300, function() {
				  // complete
			});
		}
	}, function() {
		$('#sign').stop().animate({opacity: 0.6}, 200);
		$('#arrow').stop().animate({rotate: '0deg', scale: '1'}, 300);
		$('#menu').stop().animate({
			height: 40,
			easing: 'easeOutExpo'
		  }, { easing: 'easeOutExpo' }, 300, function() {
			  // complete
		});
		$('#nav ul#mainmenu').stop().animate({
			height: 20,
			easing: 'easeOutExpo'
		  }, { easing: 'easeOutExpo' }, 300, function() {
			  // complete
		});
		if($('#nav ul.list').css('display')=="block") {
		$('#nav ul.list').stop().animate({
			height: 20,
			easing: 'easeOutExpo'
		  }, { easing: 'easeOutExpo' }, 300, function() {
			  // complete
		});
		}
	});
	
	$('#portfolio').click(function() {
			$('ul.list').css({display:'block'});
			return false;
	});
	
	$('div.color').each(function() {
		$(this).click(function() {
			$('body').css({background: $(this).css('background-color')});
		});
	});
	
	$('img.load').click(function() {
    		$('.gallery').cycle('pause');
	});
	
	$('span.controls').click(function() {
			$('.gallery').cycle('resume');
	});
	
	$('.gallery').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 5000, 
    next:   '#next2', 
    prev:   '#prev2',
	pager: '#counter',
	pagerAnchorBuilder: function(idx, slide) { 
        return '1'; 
    },
	updateActivePagerLink: function(pager, activeIndex) { 
        $(pager).text(activeIndex+1);
    }
	});
	
	$('div.gallery img').each(function() {
    }); 
});
