jQuery(function($) {
	
function isIE6() {
	return ($.browser.msie && $.browser.version <= 6.0);
}

// bind to show/hide custom event
$(document).bind('awcShowContent', function(e, div) {
	// get #Header720 if it is a parent of this div
	var header720_jq = div.parents('#Header720');
	if (!header720_jq.is('*')) { return; }

	if (isIE6()) {
	} else {
		// get size before expanding
		//  remove height, get computed height
		//  then reset height
		var saved_height = header720_jq.height();
		header720_jq.css('height', 'auto');
		var new_height = header720_jq.height();
		header720_jq.css('height', saved_height+'px');
	}


	// push MainContent486 down the amount
	var height_delta = new_height - saved_height;
	if (height_delta > 0) {
		$('#MainContent486').css('margin-top', height_delta+'px');
	}

	if (isIE6()) {
		// add a negative margin for the Sidebar
		var ie6_shift_height = (header720_jq.height() - 225);
		$('#Sidebar').css('margin-top', '-'+ie6_shift_height+'px');
	}

});

$(document).bind('awcHideContent', function(e, div) {
	// get #Header720 if it is a parent of this div
	var header720_jq = div.parents('#Header720');
	if (!header720_jq.is('*')) { return; }

	// remove margin-top from MainContent486
	$('#MainContent486').css('margin-top', '');

	if (isIE6()) {
		// remove thenegative margin for the Sidebar
		$('#Sidebar').css('margin-top', '0px');
	}
});


});
