// Put all your lovely jQuery / Javascript goodies right down here.

$(function()
{

	
	var storedPortfolioContainerHeight;
	var storedPortfolioContainerWidth;
	
	
		/*
		$(window).resize(function()
	{
		var h = $('.portfolio_container').height() + 140;
		var w = $(window).width();
			$('.textoutput').text('The portfolio_container height is ' + h + ' px.');
			
			storedPortfolioContainerHeight = h;
	});
		*/
	
	
	/*
	
	$('#one').ContentSlider({
					width : '90px',
					height : '40px',
					speed : 800,
					easing : 'easeInOutBack'
				});	
		
		$('.portfolio_container img').click(function()
	{
		var htmlpage = 'pages/' + $(this).attr('id') + '.html' + '  .contentslider > *';
		var h = $('.portfolio_container').height() + 130 + 400;
		var w = 1000;
			
			storedPortfolioContainerHeight = h;
			storedPortfolioContainerWidth = w;
			
		console.log(htmlpage);
		$('.textoutput').text('The portfolio_container height is ' + h + ' px.');
			
			$('.portfolio_container').fadeTo(500, .001, function()
		{
			$('.portfolio_container').css('z-index', 1);
			$('.portfolio_container').hide();
			$('.feature').css('height', storedPortfolioContainerHeight);
			$('.feature').css('width', storedPortfolioContainerWidth);
			$('.feature').css('z-index', 2);
			$('.feature').load(htmlpage);
			$('.feature').fadeTo(500, 1);
			return false;
		});
		})
	
	$('.feature #back_link').click(function()
	{
		$('.feature').fadeTo(500, .001, function()
			{
				$('.feature').html('');
				$('.feature').css('height', '0px');
				$('.feature').css('z-index', 1);
				$('.portfolio_container').css('z-index', 2);
				$('.portfolio_container').fadeTo(500, 1);
			});
	});
	
	*/
	
	    		
	$('#contact_form').submit(function(e){
		e.preventDefault();
		var form = $(this);
		var post_url = form.attr('action');
		var post_data = form.serialize();
		$('#loader', form).html('<img src="loader.gif" /> Please Wait...');
		$.ajax({
			type: 'POST',
			url: post_url, 
			data: post_data,
			success: function(msg) {
				$(form).fadeOut(500, function(){
					$(form).fadeIn();
				});
			}
		});
	});	
});

