/**
 * 
 * adjusts content container height so that it contains all content and is scrollable under header
 * shows the content when its height has been adjusted
 * 
 * @return
 */
function adjustContentHeight() {
	
	var w = window;//frames[jQuery("#TB_iframeContent").attr('name')];
	var d = jQuery(w.document.documentElement);

	var c = jQuery('#content', d);
	var ch =  jQuery('div.header',c);
	var cc =  jQuery('div.content:eq(0)',c);
	
	if(typeof(cc.css('marginTop')) == 'undefined' || cc.css('marginTop') == "auto") {
		
		var _marginTop = -8;
		
	}
	else {
		
		var _marginTop = cc.css('marginTop').split('px')[0];
		
	}
	
	var ccHeight =  d.outerHeight() - 
					ch.height() - 
				    (cc.outerHeight() - cc.height()) - 
				    _marginTop;
					
	cc.height(ccHeight);
	
	cc.show();
	
	//cc.show();
	
	
	/*cc.animate(
			
		{
		
			height : 
			    d.outerHeight() - 
			    ch.height() - 
			    (cc.outerHeight() - cc.height()) -
			    marginTop
		 
		},
		200,
		'linear',
		function() { jQuery(this).css('overflow', 'auto');}
	);*/
	
	
};


function init() {
	
	
	setTimeout(adjustContentHeight,600);
	
};

/** JQUERY READY **/

jQuery(window).load(init);