
$(function(){

	var rootPath = '';
	var activeSlide = 'realty-first';

	//get initial content (portfolio)
		$.get(rootPath + '/slides/' + activeSlide + '.html', function(data){
			$('#main-content').html(data);
		});
		
	
	//get clicked content
		$('#main-nav a').click(function(){
		
			var navID = $(this).attr('ID');
			
			if (navID != 'portfolio'){
				$.get(rootPath + '/' + navID + '.html', function(data){
					$('#main-content').html(data);
				});
			} else {
				$.get(rootPath + '/slides/' + activeSlide + '.html', function(data){
					$('#main-content').html(data);
				});
			}
			
			$(this).queue(function(){
				$('#main-nav a.current').removeClass('current');
				$(this).addClass('current');
				$(this).dequeue();
			});

			if (navID != 'portfolio'){
				$('#portfolio-nav').hide();
			} else {
				$('#portfolio-nav').show();
			}
	
			return false;
	
		});




	
	//portfolio navigation
		$('#portfolio-nav a').click(function(){
			activeSlide = $(this).attr('href').replace('#','');
			$(this).queue(function(){
				$('#portfolio-nav a.current').removeClass('current');
				$(this).addClass('current');
				$(this).dequeue();
			});
			$.get(rootPath + '/slides/' + activeSlide + '.html', function(data){
				$('#main-content').html(data);
			});
			return false;
		});
	
	//footer size

	/*
function footerSize(){
		
		var windowHeight = $(window).height();
		var headerHeight = $('header').outerHeight();
		var mcHeight = $('#main-content').outerHeight();
		var pNavHeight = $('#portfolio-nav').outerHeight();
		var footerHeight = $('footer').outerHeight();

		console.log(headerHeight)

		if (windowHeight < (headerHeight + mcHeight + pNavHeight + footerHeight)){
			alert('you\'re too short');
		}

	}
	
	footerSize();
*/



});


