// jQuery
jQuery(function(){ 
	// in-page MPU
	var p_counter = 1; 
	jQuery('#content .storytext .section_column1>p, #content .storytext>p').each(function(index){ 
		if (jQuery(this).attr('class').length == 0){ 
			if (p_counter == 3){ 
				jQuery('<div class="inline_ad" id="mpu_box"><div class="inline_ad_sleeve"><div id="advert-0-placeholder" style="margin-bottom: 8px;" align="center"></div></div></div>').insertAfter(this); 
				//alert(this);
				return false; 
			} 
			p_counter++; 
		} 
	});
	
	// in-page BANNER
	if (jQuery('#comments').length>0) {
		jQuery('<div id="advert-1-placeholder" style="margin:20px 0; text-align:center;"></div>').insertBefore('#comments');
	} else {
		jQuery('<div id="advert-1-placeholder" style="margin:20px 0; text-align:center;"></div>').insertBefore('#comments_form');
	}

	moveAdverts();
});

// Lending Strategy mast
jQuery(function(){ 
	var section = jQuery('meta[name=section]').attr("content");
	if (section == 'Lending Strategy') {
		if (jQuery('#ctl00_MainPlaceholderOne_RightColAdsTop_GenericAdControl1').length > 0) {
			jQuery('<div style="margin:10px 0; text-align:center;"><a href="/channels/lending-strategy/"><img src="/Pictures/Web/y/c/h/MS_lending_strategy_logo.gif" alt="Lending Strategy" width="300" height="55" /></a></div>').insertBefore('#ctl00_MainPlaceholderOne_RightColAdsTop_GenericAdControl1');
		}
	}
});
