$( document ).ready( function () {

	
	// $('#menu').parent.parent.parent.css("position", "relative");
	// $('#menu').parent.parent.css("position", "relative");
	//$('#menu').parent().css("position", "absolute");
	//$('page').css("position", "relative");
	//$('#menu').css("clear", "both");
	//$('#menu').css("position", "relative");
	
	//$('#page').css("height", "100%");
	$('#menu').css("position", "relative");
	//$('#menu').css("height", "2000px");
	$('#menu-overview').css("position", "relative");
	//$('#masthead').css("position", "relative");
	//$('#menu').scrollFollow({ container: 'page' });
	$('#menu').scrollFollow();
	$('#menu-overview').scrollFollow();
	//$('#masthead').scrollFollow();
	
	//alert("blahh")
	
	mix_in_descriptions();
	
	top_post_video();
	
	function top_post_video() {
		videos = $('.video');
		//images = $('.j-image');
		
		title = $('h2.title');
		
		//if ((video.length >= 1) && (images.length > 0)) {
			$(videos).each(function(i){
				$(title).after(this);
			})
		//}
	}
	
	
	
	function mix_in_descriptions() {
	
	images = $('.j-image');
	//alert(images.length+" images");	
	
	descs = $('.image-description');
	//alert(descs.length+" descriptions");
	
	if ((images.length > 1) && (descs.length >= 1)) { // && (images.length >= descs.length)
	 $(images).each(function(i){
	 		//alert(this)
			if (i < descs.length) {
				$(this).after(descs[i])
				//alert("Trying to insert "+descs[i]+" after")
			}
			else {
				//alert("No more descriptions")
			}
	 	});
	}
	else {
		//alert("Do not run the mix in")
	}
	
	} // End of function mix_in_descriptions
	
});
