function Projects() {
	
	$('#content').load('pages/' + lang + '/projects.html', onPageComplete);
	
	
	function onPageComplete() {
		var selectedId1;
		var selectedId2;
		
		var _activeMenuId = 0;
		var $activeContent = $('#contentScrollable .content[menuid='+_activeMenuId+']');
		
		$('#contentMenu li').click(function(event) {
			$('#contentMenu li').eq(_activeMenuId).attr('selected', '0');
			$activeContent.attr('selected', '0');
			_activeMenuId = $(this).attr('menuid');
			_loadContent();
			event.preventDefault();
		});
		
		$('#contentScrollable li').click(function(event) {
			selectedId1 = parseFloat($(this).parent().parent().attr('menuid'));
			selectedId2 = parseFloat($(this).attr('menuid'));
			
			_loadGallery();
		});
		
		function _loadContent() {
			$('#contentMenu li').eq(_activeMenuId).attr('selected', '1');
			$activeContent = $('#contentScrollable .content[menuid='+_activeMenuId+']')
			$activeContent.attr('selected', '1');
			
			if ($activeContent.length > 0) {
				createImages($activeContent.find('li'));
			} else {
				selectedId2 = 0;
				_loadGallery();
			}
			
			fleXenv.updateScrollBars();
			document.getElementById('contentScrollable').fleXcroll.setScrollPos(false,0);
		}
		
		fleXenv.fleXcrollMain('contentScrollable');
		_loadContent();
		resize();
		
		function _loadGallery() {
			$('#contentContainer').css('display', 'none');
			$('#content #gallery').load('pages/' + lang + '/projects/' + _activeMenuId + '/project_' + selectedId2 + '.html', onGalleryComplete);
			
			function onGalleryComplete() {
				new Gallery();
				
				$('#galleryInfo a[action="return"]').click(function(event) {
					$('#content #gallery').html('');
					$('#contentContainer').css('display', 'block');
					fleXenv.updateScrollBars();
				});
				
				$('#galleryInfo a[action="projectPager"]').click(function(event) {
					var dir = parseFloat($(this).attr('dirr'));
					selectedId2 += dir;
					if (selectedId2 < 0) selectedId2 = $activeContent.find('li').length - 1;
					if (selectedId2 >= $activeContent.find('li').length) selectedId2 = 0;
					_loadGallery();
				});
				
				if ($activeContent.length == 0) $('#galleryInfo .box').eq(1).hide();
			}
		}
	}
	
}

