

if(BBC.adverts.checkWrite(bbc_adsense_slot) && typeof BBC.adverts.getZoneData().keyValues[bbc_adsense_slot] != 'undefined'  ) {

	

	 function google_ad_request_done(google_ads) {
		var s = '';
		var i;
	  
		if (google_ads.length == 0)
		  return;
		
	

		if (google_ads[0].type == "text") {
			
			s += '<div class="adsensetitle">Ads by Google</div>';

			if (google_ads.length == 1) {
			         
				s += '<div class="adsensead"><span class="adsenselabel"><a href="' + google_ads[0].url + '" ' +
			         'onmouseout="window.status=\'\'" ' + 'onmouseover="window.status=\'go to ' +
			           google_ads[0].visible_url + '\';return true;" target="_blank">' +
			           '<b>' + google_ads[0].line1 + '</b><br></a></span>' + '<span>' +
			           google_ads[0].line2 + ' ' +'</span><span class="adsenseurl"><a href="' + google_ads[0].url + '" ' +'onmouseout="window.status=\'\'" ' +
			           'onmouseover="window.status=\'go to ' +google_ads[0].visible_url + '\';return true;" target="_blank">' +google_ads[0].line3 + '<br></span>' +
			           google_ads[0].visible_url + '</a><br></div>';
			} else if (google_ads.length > 1) {
				
				for(i=0; i < google_ads.length; ++i) {
				    s += '<div class="adsensead"><span class="adsenselabel"><a href="' + google_ads[i].url + '" ' +
				        'onmouseout="window.status=\'\'" ' + 'onmouseover="window.status=\'go to ' +
				        google_ads[i].visible_url + '\';return true;" target="_blank">' +
				        '<b>' + google_ads[i].line1 + '</b><br></a></span>' +
				        '<span>' +google_ads[i].line2;
					s+=' ';
					s+= google_ads[i].line3 + '<br></span><span class="adsenseurl"><a href="' + google_ads[i].url + '" ' +
				        'onmouseout="window.status=\'\'" ' + 'onmouseover="window.status=\'go to ' +
				        google_ads[i].visible_url + '\';return true;" target="_blank">' + google_ads[i].visible_url + '</a></span></div>';
				}
			}
	    }
		
		if(BBC.adverts.getZoneData().keyValues[bbc_adsense_slot].indexOf("weather") != -1){
			document.write('<div class="'+BBC.adverts.getZoneData().keyValues[bbc_adsense_slot]+'_top"></div><div class="'+BBC.adverts.getZoneData().keyValues[bbc_adsense_slot]+'">'+s+'</div><div class="'+BBC.adverts.getZoneData().keyValues[bbc_adsense_slot]+'_bottom"></div>');
		}else{
			document.write('<div class="'+BBC.adverts.getZoneData().keyValues[bbc_adsense_slot]+'">'+s+'</div>');
		}
		
	    return;
}

google_ad_client = 'ca-bbccom';
google_ad_channel = bbc_adsense_country+"_"+BBC.adverts.getZoneData().zone;
google_ad_output = 'js';
google_max_num_ads = '3';
google_ad_type = 'text'; // type of ads to display
google_language = 'en';

<!-- Start: AdSense for Content A/B Test Code -->
// % of impressions to serve with the test option B instead of control option A
var test_percent = 20;
// randomly determine whether to serve a test impression
isTestImpression=(Math.random()>=(test_percent/100)?true:false);
// Static ad request values - move into if-block below if desired
if (isTestImpression) {
  // Test option B parameters
  google_ad_channel = bbc_adsense_country+"_"+BBC.adverts.getZoneData().zone+" channel_b";
  // Modifies styling for option_B(otherwise defaults to option_A).
  if (document.getElementById('bbccom_adsense_middle_inner')) {
	document.getElementById('bbccom_adsense_middle_inner').className='adsense_optionB';
  }
  if (document.getElementById('bbccom_adsense_mpu_inner')) {
	document.getElementById('bbccom_adsense_mpu_inner').className='adsense_optionB';
  }
} else {
  // Control option A parameters
  google_ad_channel = bbc_adsense_country+"_"+BBC.adverts.getZoneData().zone+" channel_a";
}
<!-- End: AdSense for Content A/B Test Code -->


//news homepage specific params
if(BBC.adverts.getZoneData().zone == "news_homepage_int"){
var bbc_adsense_ran = Math.ceil(Math.random() * 3);
bbc_adsense_ran == 1 ? google_page_url = "http://news.bbc.co.uk/2/hi/business/default.stm" :
bbc_adsense_ran == 2 ? google_page_url = "http://news.bbc.co.uk/2/hi/entertainment/default.stm" :
google_page_url = "http://news.bbc.co.uk/2/hi/technology/default.stm";
}


document.write('<script language="JavaScript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></scr'+'ipt>');
}
				
