function AD(_placementID, _sizeID)
{
    this.networkID = 665; //Morningstar
    this.placementID = _placementID;
    this.sizeID = _sizeID;
}

var ADDictionary = new Dictionary();

//intro page Ad - not yet defined
ADDictionary.add( 'IntroPageAD', new AD('1250089', '170') );//temporary setted to Homepage MPU

ADDictionary.add( 'HomepageSkyescraper', new AD('1491321', '154') );//Homepage Skyescraper 160x600
ADDictionary.add( 'HomepageTop', new AD('1250088', '225') );//Homepage Top 728x60
ADDictionary.add( 'HomepageMPU', new AD('1250089', '170') );//Homepage MPU 300x250
ADDictionary.add( 'HomepageOverlay', new AD('1250080', '16') );//Homepage Overlay 1x1
ADDictionary.add( 'HomepageSpecialOffer1', new AD('2082997', '999') );//Homepage Special Offer left 250x140
ADDictionary.add( 'HomepageSpecialOffer2', new AD('2082996', '999') );//Homepage Special Offer right 250x140
ADDictionary.add( 'MembershipHomeTop', new AD('1250103', '225') );//Membership Home Top 728x60
ADDictionary.add( 'MembershipLoginTop', new AD('1257234', '225') );//Membership Login Top 728x90
ADDictionary.add( 'MembershipNewUserRegTop', new AD('1250054', '225') );//Membership New User Registration 728x60
ADDictionary.add( 'MembershipLogOutLeaderboard', new AD('1250113', '225') );//Membership Log Out Leaderboard 728x60
ADDictionary.add( 'MembershipMyProfileTop', new AD('1257241', '225') );//Membership My Profile Top 728x90
ADDictionary.add( 'MembershipMyProfileRight', new AD('2146402', '154') );//Membership My Profile Rightsnapshot 160x600
ADDictionary.add( 'OeicsHomeTop', new AD('1250085', '225') );//Oeics Home Top 728x90
ADDictionary.add( 'OeicsHomeMPU', new AD('1250053', '170') );//Oeics Home MPU 300x250
ADDictionary.add( 'OeicsHomeSquare', new AD('1402895', '6') );//Oeics Home Square 125x125

ADDictionary.add( 'ETFsHomeTop', new AD('2367366', '225') );//ETFs Home Top 728x90
ADDictionary.add( 'ETFsHomeMPU', new AD('2367368', '170') );//ETFs Home MPU 300x250
ADDictionary.add( 'ETFsHomeSquare', new AD('2367363', '6') );//ETFs Home Square 125x125

ADDictionary.add( 'ETFSolutionsTop', new AD('2367374', '225') );//ETFs Solution Top 728x90
ADDictionary.add( 'ETFSolutionsMPU', new AD('2367382', '170') );//ETFs Solution MPU
ADDictionary.add( 'ETFSolutionsBottom', new AD('2367373', '1748') );//ETFs solution Bottom leaderboard

ADDictionary.add( 'ETFsConferenceTop', new AD('2367369', '225') );//ETFs Conference Top 
ADDictionary.add( 'ETFConferenceMPU', new AD('2367371', '170') );//ETFs Conference MPU 300x250
ADDictionary.add( 'ETFConferenceCallBottom', new AD('2367364', '1748') );//ETFs Bottom Leaderboard

ADDictionary.add( 'ETFsNewsLetterTop', new AD('2367377', '225') );//ETFs Newsletter Top leaderboard
ADDictionary.add( 'ETFsNewsLetterMPU', new AD('2367379', '170') );//ETFs Newsletter MPU 300x250
ADDictionary.add( 'ETFsNewsLetterBottom', new AD('2367365', '1748') );//ETFs Newsletter Bottom ETFLeaderboard 728x110

ADDictionary.add( 'ETFsSurveyTop', new AD('2367380', '225') );//ETFs Newsletter MPU 300x250
ADDictionary.add( 'ETFSurveyMPU', new AD('2367375', '170') );//ETFs Survey MPU 300x250
ADDictionary.add( 'ETFSurveyBottom', new AD('2367381', '1748') );//ETFs Survey MPU 300x250

ADDictionary.add( 'ETFArticleTop', new AD('1257316', '225') );//Oeics Morningstar Articles Top 728x90
ADDictionary.add( 'ETFArticleRight', new AD('2421707', '154') );//Oeics Morningstar Articles Right 160x600
ADDictionary.add( 'ETFArticleMPU', new AD('2367368', '170') );//Oeics Morningstar Article MPU 300x250

ADDictionary.add( 'ETFQuickrankTop', new AD('2367366', '225') );//Tools Fund Quickrank Top 728x90
ADDictionary.add( 'ETFQuickrankRight', new AD('2421707', '154') );//Tools Fund Quickrank Right 160x600
ADDictionary.add( 'ETFQuickRankBottomLeftMPU', new AD('2367368', '170') );//Bottom MPU Left

ADDictionary.add( 'ETFArchiveTop', new AD('1496633', '225') );//Archive Top 728x90
ADDictionary.add( 'ETFArchiveRight', new AD('2421707', '154') );//Archive Right 160x600

ADDictionary.add( 'ETFScreenerTop', new AD('1257291', '225') );//Tools Fund Screener Top 728x90
ADDictionary.add( 'ETFScreenerRight', new AD('1257290', '154') );//Tools Fund Screener Right 160x600

ADDictionary.add( 'ISAHomeTop', new AD('1496711', '225') );//ISA Home Top 728x90
ADDictionary.add( 'ISAHomeMPU', new AD('1496709', '170') );//ISA Home MPU 300x250
ADDictionary.add( 'ISAHomeSquare', new AD('1496710', '6') );//ISA Home Square 125x125
ADDictionary.add( 'ISAQuickRankTop', new AD('1250097', '225') );//ISA Quick Rank Top 728x90
ADDictionary.add( 'ISAQuickRankRight', new AD('1250076', '154') );//ISA Quick Rank Right 160x600
ADDictionary.add( 'LnPQuickRankTop', new AD('1250102', '225') );//Life and Pension Quick Rank Top 728x90
ADDictionary.add( 'LnPQuickRankRight', new AD('1250063', '154') );//Life and Pension Quick Rank Right 160x600
ADDictionary.add( 'ITHomeTop', new AD('2146403', '225') );//Investment Trust Home Top 728x90
ADDictionary.add( 'ITHomeMPU', new AD('2146404', '170') );//Investment Trust Home MPU 300x250
ADDictionary.add( 'ITHomeSquare', new AD('1496710', '6') );//Investment Trust Home Square 125x125
ADDictionary.add( 'ITQuickTakeSquare', new AD('1721114', '6') );//Investment Trust Home Square 125x125

ADDictionary.add( 'LnPQuickRankBottomLeft', new AD('1617207', '170') );//Life & Pensions Quick Rank Bottom Left 300x250
ADDictionary.add( 'LnPQuickRankBottomRightTop', new AD('2146406', '186') );//Life & Pensions Quick Rank Bottom right top 150
ADDictionary.add( 'LnPQuickRankBottomRightBottom', new AD('2146405', '186') );//Life & Pensions Quick Rank Bottom right bottom 150
ADDictionary.add( 'QuickRankBottomLeft', new AD('1617207', '170') );//Quick Rank Bottom Left 300x250
ADDictionary.add( 'QuickRankBottomRightTop', new AD('1709875', '186') );//Quick Rank Bottom right top 150
ADDictionary.add( 'QuickRankBottomRightBottom', new AD('1709874', '186') );//Quick Rank Bottom right bottom 150

ADDictionary.add( 'ToolsHomeTop', new AD('1250100', '225') );//Tools Home Top 728x90
ADDictionary.add( 'ToolsHomeRight', new AD('1250075', '154') );//Tools Home Right 160x600
ADDictionary.add( 'ToolsHomeSquare', new AD('1402894', '6') );//Tools Home Square 125x125
ADDictionary.add( 'AdvisorTop', new AD('1250101', '225') );//Advisor Top 728x90
ADDictionary.add( 'AdvisorRight', new AD('1250124', '154') );//Advisor Right 160x600
ADDictionary.add( 'AdvisorSquare', new AD('1402893', '6') );//Advisor Square 125x125

ADDictionary.add( 'EquitiesTop', new AD('1496636', '225') );//Equities Top 728x90
ADDictionary.add( 'EquitiesRight', new AD('1496637', '154') );//Equities Right 160x600
ADDictionary.add( 'EquitiesSquare', new AD('1496639', '6') );//Equities Square 125x125
ADDictionary.add( 'EquitiesMPU', new AD('1496638', '170') );//Equities Square 125x125
ADDictionary.add( 'EquitiesButton', new AD('2150989', '12') );//Equities Button 120 x 60 - Targetted

ADDictionary.add( 'StockQuickrankTop', new AD('1496636', '225') );//Equities Top 728x90
ADDictionary.add( 'StockQuicktakeRight', new AD('1496637', '154') );//Equities Right 160x600

ADDictionary.add( 'MarketsTop', new AD('1843814', '225') );//Equities Top 728x90
ADDictionary.add( 'MarketsRight', new AD('1843815', '154') );//Equities Right 160x600
ADDictionary.add( 'MarketsSquare', new AD('1843817', '6') );//Equities Square 125x125
ADDictionary.add( 'MarketsMPU', new AD('1843816', '170') );//Equities Square 125x125

ADDictionary.add( 'HelpTop', new AD('1250081', '225') );//Help Top 728x90
ADDictionary.add( 'HelpRight', new AD('1250056', '154') );//Help Right 160x600
ADDictionary.add( 'GlossaryTop', new AD('1250090', '225') );//Morningstar Glossary Top 728x90
ADDictionary.add( 'GlossaryRight', new AD('1250055', '154') );//Morningstar Glossary Right 160x600
ADDictionary.add( 'RSSTop', new AD('1257274', '225') );//RSS Top 728x90
ADDictionary.add( 'RSSRight', new AD('1257275', '154') );//RSS Right 160x600

ADDictionary.add( 'FundArchiveTop', new AD('1257316', '225') );//Archive Top 728x90
ADDictionary.add( 'FundArchiveRight', new AD('1257315', '154') );//Archive Right 160x600

ADDictionary.add( 'FundArticleTop', new AD('1257316', '225') );//Oeics Morningstar Articles Top 728x90
ADDictionary.add( 'FundArticleRight', new AD('1257315', '154') );//Oeics Morningstar Articles Right 160x600
ADDictionary.add( 'FundArticleMPU', new AD('1257314', '170') );//Oeics Morningstar Article MPU 300x250

ADDictionary.add( 'PortfolioLeaderboard', new AD('1250092', '225') );//Portfolio Leaderboard 728x60
ADDictionary.add( 'PortfolioSky', new AD('1250117', '154') );//Portfolio Sky 160x600
ADDictionary.add( 'PortfolioMPU', new AD('1398503', '170') );//Portfolio MPU
ADDictionary.add( 'PortfolioBottomLeft', new AD('1617207', '170') );//  NOT USED Portfolio Bottom Left 300x250
ADDictionary.add( 'PortfolioBottomRight', new AD('2146408', '186') );//Portfolio Bottom right 150
ADDictionary.add( 'PortfolioBottomRight2', new AD('2146409', '186') );//Portfolio Bottom right 150

ADDictionary.add( 'InstantXRayTop', new AD('1257284', '225') );//Tools Instant X Ray Top 728x90
ADDictionary.add( 'InstantXRayRight', new AD('1257283', '154') );//Tools Instant X Ray Right 160x600
ADDictionary.add( 'FundCompareTop', new AD('1257288', '225') );//Tools Fund Compare Top 728x90
ADDictionary.add( 'FundCompareRight', new AD('1257289', '154') );//Tools Fund Compare Right 160x600

ADDictionary.add( 'FundScreenerTop', new AD('1257291', '225') );//Tools Fund Screener Top 728x90
ADDictionary.add( 'FundScreenerRight', new AD('1257290', '154') );//Tools Fund Screener Right 160x600

ADDictionary.add( 'FundQuickrankTop', new AD('1257302', '225') );//Tools Fund Quickrank Top 728x90
ADDictionary.add( 'FundQuickrankRight', new AD('1257303', '154') );//Tools Fund Quickrank Right 160x600


// for stock quicktake
ADDictionary.add('ToolsStockQuicktakeOverviewTop', new AD('1257300', '225')); //Tools Fund Overview Top 728x90
ADDictionary.add('ToolsStockQuicktakeRight', new AD('1257299', '154'));


ADDictionary.add( 'ToolsFundOverviewTop', new AD('1257300', '225') );//Tools Fund Overview Top 728x90
ADDictionary.add( 'ToolsFundOverviewRight', new AD('1257299', '154') );//Tools Fund Overview Right 160x600
ADDictionary.add( 'ToolsFundOverviewMPU', new AD('1257301', '170') );//Tools Fund Overview MPU 300x250

ADDictionary.add( 'ToolsFundGraphTop', new AD('1577314', '225') );//Tools Fund Graph Top 728x90
ADDictionary.add( 'ToolsFundGraphRight', new AD('1577312', '154') );//Tools Fund Graph Right 160x600
ADDictionary.add( 'ToolsFundGraphMPU', new AD('1577313', '170') );//Tools Fund Graph MPU 300x250

ADDictionary.add( 'topADSmallDefault', new AD('1523548', '1653') );//Additional banner next to leaderboard 195x90

ADDictionary.add( 'BottomLeaderboard', new AD('1576470', '1748') );//Bottom Leaderboard 728x110
ADDictionary.add( 'ETFBottomLeaderboard', new AD('2367365', '1748') );//Bottom ETFLeaderboard 728x110

ADDictionary.add( 'NavText', new AD('1614546', '1013') );//Text

ADDictionary.add( 'UniverseSearchRightTop', new AD('1250075', '154') );//UniverseSearch Right Top 160x600

// Lyxor/ishares Custom Signup
ADDictionary.add( 'ETFCustomSignup', new AD('2367370', '16') );


function WebAdsWriteTag(width, height, placementID)
{
    var currentAD;
    currentAD = ADDictionary.getVal(placementID);    
    
    if(!currentAD)
    {
        return;
    }
    
    if (window.adgroupid == undefined)
    {
	    window.adgroupid = Math.round(Math.random() * 1000);
    }   
    
    document.write('<scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn|3.0|'+currentAD.networkID+'|'+currentAD.placementID+'|0|'+currentAD.sizeID+'|ADTECH;loc=100;target=_blank;key=key1+key2+key3+key4;grp='+window.adgroupid+';misc='+new Date().getTime()+'"></scri'+'pt>');
}
function WebAdsWriteTagSponsor(width, height, placementID, key1, key2)
{
    var currentAD;
    currentAD = ADDictionary.getVal(placementID);    
    
    if(!currentAD)
    {
        return;
    }
    
    if (window.adgroupid == undefined)
    {
	    window.adgroupid = Math.round(Math.random() * 1000);
    }   
    
    document.write('<scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn|3.0|'+currentAD.networkID+'|'+currentAD.placementID+'|0|'+currentAD.sizeID+'|ADTECH;loc=100;target=_blank;key='+key1+'+'+key2+'+key3+key4;grp='+window.adgroupid+';misc='+new Date().getTime()+'"></scri'+'pt>');
}

function WebQTSponsorTag(fundId, companyId)
{
    document.write('<scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn|3.0|665|1643265|0|12|ADTECH;loc=100;target=_blank;key='+fundId+'+'+companyId+'+key3+key4;grp=[group];misc='+new Date().getTime()+'"></scri'+'pt>');
}

function WebQTROSSponsor(fundId, companyId)
{   
    document.write('<scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn|3.0|665|2066812|0|6|ADTECH;loc=100;target=_blank;key='+fundId+'+'+companyId+'+key3+key4;grp=[group];misc='+new Date().getTime()+'"></scri'+'pt>');
}

function WebAdsBottomTag()
{
	// for ETF section only
	var strEtf = location.href;
			
	// ETF Newsletter page
	if (strEtf.match("ETFNewsLetterSignup")){ 
		WebAdsWriteTag('728', '110', 'ETFsNewsLetterBottom');
		return;
	}
	// ETF Survey page
	else if (strEtf.match("ETFSurvey")){ 
		WebAdsWriteTag('728', '110', 'ETFSurveyBottom');
		return;
	}

	// ETF Conference call pages
	else if (strEtf.match("ETFConferenceCall")){ 
		WebAdsWriteTag('728', '110', 'ETFConferenceCallBottom');
		return;
	}
	
	// ETF Solutions call pages
	else if (strEtf.match("ETFSolutions")){ 
		WebAdsWriteTag('728', '110', 'ETFSolutionsBottom');
		return;
	}

	else if (strEtf.match("etf"))
		WebAdsWriteTag('728', '90', 'ETFBottomLeaderboard');

	else
		WebAdsWriteTag('728', '90', 'BottomLeaderboard');
}

function WebAdsBottomTagSponsor(key1, key2)
{

	// for ETF section only
	var strEtf = location.href;

	// ETF Newsletter page
	if (strEtf.match("ETFNewsLetterSignup")){ 
		WebAdsWriteTag('728', '110', 'ETFsNewsLetterBottom');
		return;
	}
	
	// ETF Survey page
	else if (strEtf.match("ETFSurvey")){ 
		WebAdsWriteTag('728', '110', 'ETFSurveyBottom');
		return;
	}

	// ETF Conference call pages
	else if (strEtf.match("ETFConferenceCall")){ 
		WebAdsWriteTag('728', '110', 'ETFConferenceCallBottom');
		return;
	}

	// ETF Solutions call pages
	else if (strEtf.match("ETFSolutions")){ 
		WebAdsWriteTag('728', '110', 'ETFSolutionsBottom');
		return;
	}

	else if (strEtf.match("etf"))
		WebAdsWriteTag('728', '90', 'ETFBottomLeaderboard');
	else
		WebAdsWriteTagSponsor('728', '90', 'BottomLeaderboard', key1, key2);
		
}