var AdCenterRenderer_News_NewsPage = function(adcenter, zoneId)
{
	this.adcenter = adcenter;	
	this.zoneId = zoneId;
	this.ads = adcenter.getZoneAds(zoneId);
}

AdCenterRenderer_News_NewsPage.prototype.RenderBeforeAds = function ()
{
	/*Verify that there are actually ads to display.*/
	if (this.ads.length == 0) return;
	
	document.write('<div class="chSpaceBottom"></div><div class="adCenterAds1">');
}

AdCenterRenderer_News_NewsPage.prototype.RenderAfterAds = function ()
{
	/*Verify that there are actually ads to display.*/
	if (this.ads.length == 0) return;
	
	document.write('</div>');
}

AdCenterRenderer_News_NewsPage.prototype.RenderAds = function ()
{
	var html = '';
	var i;

	/*Verify that there are actually ads to display.*/
	if (this.ads.length == 0) return;
	
	if (this.ads[0].type == "flash")
	{
		html +=
			'<a class="ad_informationUrl" href="' + this.adcenter.informationUrl + '">PCFreunde Anzeigen</a><div class="ad_lineSpace"></div>' +
			'<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' + this.ads[0].width + '" HEIGHT="' + this.ads[0].height + '">' +
			'<PARAM NAME="movie" VALUE="' + this.ads[0].flashUrl + '">' +
			'<PARAM NAME="quality" VALUE="high">' +
			'<PARAM NAME="AllowScriptAccess" VALUE="never">' +
			'<EMBED src="' + this.ads[0].flashUrl + '" WIDTH="' + this.ads[0].width + '" HEIGHT="' + this.ads[0].height + '" TYPE="application/x-shockwave-flash" AllowScriptAccess="never" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>' +
			'</OBJECT>';
	}
	else if (this.ads[0].type == "image")
	{
		html += 
			'<a class="ad_informationUrl" href="' + this.adcenter.informationUrl + '">PCFreunde Anzeigen</a><div class="ad_lineSpace"></div>' +
			'<a href="' + this.ads[0].targetUrl + '"><img border="0" src="' + this.ads[0].imageUrl + '" width="' + this.ads[0].width + '" height="' + this.ads[0].height + '" /></a>';
	}
	else if (this.ads[0].type == "html")
	{
		html += this.ads[0].html;
	}
	else if (this.ads[0].type == "text")
	{
		html += '<a class="ad_informationUrl" href="' + this.adcenter.informationUrl + '">PCFreunde Anzeigen</a>';

		for (i = 0; i < this.ads.length; i++)
		{
			html +=
				'<div class="ad_lineSpace"></div>' +
				'<a class="ad_title" href="' + this.ads[i].targetUrl + '">' + this.ads[i].title + '</a><br/>' +
				'<span class="ad_text">' + this.ads[i].text1 + '</span><br/><span class="ad_text">' + this.ads[i].text2 + '</span><br/>' +
				'<a class="ad_url" href="' + this.ads[i].targetUrl + '">' + this.ads[i].displayUrl + '</a>';
		}
	}
	
	document.write(html);
}
