$(document).ready( function() {
  $j("#content p").each( function(i,e){if( $j(e).html() == "&nbsp;" ){ $j(e).hide();} } );
  
  
  //The dynamic content doesn't register fully in the area until after this script is called.
  //Therefore, these couple pages with dynamic content do not align at the bottom after page load.
  //Temp fix for the captcha on Contact Us page that doesn't load until late
  //var contact = $j("#content_left h1").text();
  //Temp fix for Search Results
  var contact = $j("#content_left_wide h1").text();
  var ext2 = 0;
  
  if(contact == "Search Results") {
  	//For Contact Us: ext2 = 45;
	  ext2 = 6;
  }
  
  var sidenav = $j("#side_nav").height();
  
  var footer = $j("#footer_side_nav").height();
  var header = $j("#header_side_nav").height();
    var header_int = $j("#header_side_nav_int").height();
  var matchHeight = $j("#content").height();
  
  if(sidenav >= matchHeight) {

  	$j("#content").height(sidenav + 5);
  } else {
  	var ht = 0;
  	var ext = 0;
  	if(header != null) {
  		//ht = header;
		ht = header;
		ext = 27;
  	} else {
  		ht = header_int;
		ext = 49;
  	}
  	//alert("header " + ht + " footer " + footer + " Match " + matchHeight);
  	
  	$j("#links").height(matchHeight - footer - ht - ext + ext2);
  	
  }
  
/*  
  //This was 492
  if( matchHeight > 500 ) {
  //This was 35
    $j("#links").height( matchHeight - ( footer + header + 75 ) );
  }
  
 
  if( $j.browser.msie && $j.browser.version == "6.0")
  {
  	//This was 492
	  if( $j("#content").height() < 500 )
	  {
	    $j("#content").height( 500 );
	  }
  }
  */
  
});

