$(function(){

	//Add js class if js is enabled
	$('#wrap').addClass('js');

	//Functions for specific pages, more details below.
	hideInfo();

});

//Used to toggle more info  :  about us - people
function hideInfo(){

	$('.people .companyinfo span.readmore:last').toggle(
		function(){
			$('.companyinfo img.dev').fadeOut(1000).queue(function(){
				$('.companyinfo img.dev-large').fadeIn(1500);
				$('.companyinfo img.dev').dequeue();
			});
		},
		function(){
			$('.companyinfo img.dev-large').fadeOut(1000).queue(function(){
				$('.companyinfo img.dev').fadeIn(1500);
				$('.companyinfo img.dev-large').dequeue();
			});
		}
	);


	//On click function
	$('.people .companyinfo span.readmore').click(function(){

		//Store previous div
		prevDiv = $(this).prev('div');

		//Slide all divs with class readmore except for the previous div (prevDiv)
		$('div.readmore').not(prevDiv).slideUp();

		//Change text to read more except for this
		$('.people .companyinfo span.readmore').not(this).text('Read More.');

		//Toggle previous div
		prevDiv.slideToggle('slow');

		//Store current text
		thisText = $(this).text();

		//Ternary for changing text
		text = (thisText == 'Close.' ? 'Read More.' : 'Close.');

		//Update text
		$(this).text(text);

	});
}