// JavaScript Document
function initMenu() 
{
	$('#menu ul').hide();
	$('#menu > li a').click(
	function() {
		$(this).addClass("selected");
		var checkElement = $(this).next();
		if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
			return false;
		}
		if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
			$('#menu ul:visible').slideUp('normal');
			checkElement.slideDown('normal');
			return false;
		}
	});
	$('#menu li a.top').click(
		function() {
			$('#menu li a.top').removeClass("selected");
			$(this).addClass("selected");
	});
	$('#menu li ul li a').click(
		function() {
			$('#menu li ul li a').removeClass("selected");
			$(this).addClass("selected");
	});
}
$(document).ready(function() 
{
	$('#content').css({'overflow' : 'hidden'});
	
	initMenu();
	
	$('#menu li a:first').addClass("selected");
	$('#menu ul:first').slideDown('normal');
	$('#menu li ul li a:first').addClass("selected");

   $('#portfolio-nav').localScroll(
	{
		target:'#content',
		axis: 'xy',
		queue: 'true',
		duration: 900
	});
	
	$('.subnav').localScroll(
	{
		target:'#content',
		axis: 'yx',
		queue: 'true',
		duration: 900
	});
	
	$("a[rel^='prettyPhoto']").prettyPhoto(
	{
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.35, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: true, /* true/false */
		theme: 'dark_rounded' /* light_rounded / dark_rounded / light_square / dark_square */
	
	});
});
