// Banner Ads etc. code from August 2009

// 'cachebuster'

function getBannerAdCacheBuster()
{
	if(typeof(window.ba_cachebuster) == "undefined")
	{
		window.ba_cachebuster = Math.floor(Math.random()*10000000000);
	}
	
	return window.ba_cachebuster;
}

// 'tile'

function getBannerAdTile()
{
	if(typeof(window.ba_tile) == "undefined")
	{
		window.ba_tile = 1;
	}
	else
	{
		window.ba_tile++;
	}
	
	return window.ba_tile;
}

// Ads

function writeSkyScraperBannerAd(ba_name, ba_location, ba_searchtype)
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/results;exp=no;ovl=no;pop=no;IASH=STAND;classification=' + ba_name + ';location=' + ba_location + ';tile=' + getBannerAdTile() + ';sz=120x600;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeSearchFooterLeaderboardBannerAd(ba_name, ba_location, ba_searchtype)
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/home;exp=no;ovl=no;pop=no;IASH=STAND;classification=' + ba_name + ';location=' + ba_location + ';tile=' + getBannerAdTile() + ';sz=468x60,728x90;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeSearchFooterBannerAd(ba_name, ba_location, ba_searchtype)
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/home;exp=no;ovl=no;pop=no;IASH=STAND;classification=' + ba_name + ';location=' + ba_location + ';tile=' + getBannerAdTile() + ';sz=468x60;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeHorizontalBannerAd(ba_name, ba_location, ba_searchtype)
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/results;exp=no;ovl=no;pop=no;IASH=STAND;classification=' + ba_name + ';location=' + ba_location + ';tile=' + getBannerAdTile() + ';sz=468x60;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeLeaderboardBannerAd(ba_name, ba_location, ba_searchtype)
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/results;exp=no;ovl=no;pop=no;IASH=STAND;classification=' + ba_name + ';location=' + ba_location + ';tile=' + getBannerAdTile() + ';sz=468x60,728x90;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeSearchErrorBannerAd(ba_name, ba_location, ba_searchtype)
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/results;exp=no;ovl=no;pop=no;IASH=STAND;classification=' + ba_name + ';location=' + ba_location + ';tile=' + getBannerAdTile() + ';sz=300x250;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeInternationalSearchBannerAd()
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/intcodesearch;exp=no;ovl=no;pop=no;IASH=STAND;tile=' + getBannerAdTile() + ';sz=728x90;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeInternationalDisamBannerAd()
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/intcodedisam;exp=no;ovl=no;pop=no;IASH=STAND;tile=' + getBannerAdTile() + ';sz=728x90;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeInternationalResultBannerAd()
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/intcoderesult;exp=no;ovl=no;pop=no;IASH=STAND;tile=' + getBannerAdTile() + ';sz=728x90;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeUkCodesSearchBannerAd()
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/ukcodesearch;exp=no;ovl=no;pop=no;IASH=STAND;tile=' + getBannerAdTile() + ';sz=728x90;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeUkCodesDisamBannerAd()
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/ukcodedisam;exp=no;ovl=no;pop=no;IASH=STAND;tile=' + getBannerAdTile() + ';sz=728x90;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}

function writeUkCodesResultBannerAd()
{
	document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/btphonebook.etype/ukcoderesult;exp=no;ovl=no;pop=no;IASH=STAND;tile=' + getBannerAdTile() + ';sz=300x250;ord=' + getBannerAdCacheBuster() + '?"></scr'+'ipt>');
}