var press_loaded = false;
var industry_loaded = false;

function resizeBoxes(){	
var press = jQuery('#home_news .press');
	if(press.length){
		var press_height = press[0].offsetHeight;
		
	}
	
	var industry = jQuery('#home_news .industry');
	if(industry.length){
		var industry_height = industry[0].offsetHeight;
	}
	
	var content = jQuery('#home_copy');
	if(content.length){
		var content_height = content[0].offsetHeight;
	}
	
	if(content_height && press_height && industry_height)
	{
		var combined = press_height + industry_height;
		if(content_height > combined){
			var delta = content_height - combined;
			var new_height = (delta + industry_height) - 32;
			jQuery('#home_news .industry').height(new_height);
		}
		if(content_height < combined)
		{
			var delta = combined - content_height;
			var new_height = (delta + content_height) -12;
			jQuery('#home_copy').height(new_height);
		}
	}
}

function loadPress(){
	jQuery('#press_embed').html('');	
jQuery('#press_embed').load("/blog/press-releases-embed/", function(){
     press_loaded = true;
     if(press_loaded && industry_loaded){
          resizeBoxes();
     }
});	
}

function loadIndustry(){
	jQuery('#industry_embed').html('');	
jQuery('#industry_embed').load("/blog/industry-news-embed/", function(){
     industry_loaded = true;
     if(press_loaded && industry_loaded){
          resizeBoxes();
     }
});	

}
