var redrawn = false;
var counter = 10;

var checkRedrawPage = function()
{	
	if($('div.ad').length && ($('div.ad iframe').length || $('div.ad object').length || $('div.ad embed').length) && redrawn == false)
	{
		var height = parseInt($('div.ad iframe').attr('height') || $('div.ad object').attr('height') || $('div.ad embed').attr('height'));
		
		if(height == 600)
		{
			$('div.gilearn').css({minHeight: parseInt($('#sidebar').height()) - 225});	
			redrawn = true;		
		}		
	}
	else
	{
		if(counter < 10 && redrawn == false)
		{
			counter++;
			setTimeout(checkRedrawPage, 250);
		}		
	}	
}

$(function(){
	checkRedrawPage();	
});