/*--------------------------------------------------------*
* Copyright (C) 2008 Verthink S.r.l. - Italy
*
* File: adsgoogle.js
* Author: Aldo Armiento
* Version: 20080103.1
*---------------------------------------------------------*/

var my_google_position = "RIGHT";

function google_ad_request_done(aAds)
{
	var sRet = '';
	var i = 0;

	if (aAds.length == 0)
		return;

	if (my_google_position == 'RIGHT' || my_google_position == 'RIGHT_AGENZIA') // SKYCRAPER (DESTRA)
	{
		sRet += '<div style="margin-bottom:8px;"><a href="' + google_info.feedback_url + '" class="google_adv_title">Διαφημίσεις Google</a></div>';
		if (aAds.length == 1) // Output: Un solo ad con fonts grandi
		{
			sRet += '<div style="background-color:#FFF;margin-top:8px; margin-bottom:12px;" onmouseover="this.style.backgroundColor=\'#e3eaff\';" onmouseout="this.style.backgroundColor=\'#FFF\';"><a class="google_adv_link" onclick="javascript:window.open(\'' + aAds[i].url  +
				'\');" onmouseover="window.status=\'Πηγαίνετε στο ' + aAds[i].visible_url + '\'" onmouseout="window.status=\'\'">' +
				'<span class="google_adv_text_link" style="font-size:16px;">' + aAds[i].line1 + '<br></span>' +
				'<span class="google_adv_text" style="font-size:16">' + aAds[i].line2 + ' ' + aAds[i].line3 + '<br></span>' +
				'<span class="google_adv_url" style="font-size:14">' + aAds[i].visible_url + '</span></a></div>';
		}
		else // Output: Piu' ads con fonts piccoli
		{
			for (i = 0; i < aAds.length; i++)
			{	sRet += '<div onmouseover="this.style.backgroundColor=\'#e3eaff\';" onmouseout="this.style.backgroundColor=\'#FFF\';" style="background-color:#FFF;margin-bottom:';

				if (i == (aAds.length-1))
					sRet += '0';
				else	sRet += '16';

				sRet += 'px;"><a class="google_adv_link" onclick="javascript:window.open(\'' + aAds[i].url  +
					'\');" onmouseover="window.status=\'Πηγαίνετε στο ' + aAds[i].visible_url + '\'" onmouseout="window.status=\'\'">' +
					'<span class="google_adv_text_link">' + aAds[i].line1 + '<br></span>' +
					'<span class="google_adv_text">' + aAds[i].line2 + ' ' + aAds[i].line3 + '<br></span>' +
					'<span class="google_adv_url">' + aAds[i].visible_url + '</span></a></div>';
			}
		}
	}
	else if (my_google_position == 'BOTTOM') // QUELLI IN BASSO
	{
		sRet += '<table style="margin-top:10px" cellspacing="0" cellpadding="0" border="0" width="100%">';
		sRet += '<tr><td><div style="margin-bottom:3px; padding-left:3px;">';
		sRet += '<a class="google_adv_title" href="' + google_info.feedback_url + '">Διαφημίσεις Google</a>';
		sRet += '</div></td></tr>';
		sRet += '<tr><td>';
		if (aAds.length == 1) // Output: Un solo ad con fonts grandi
		{
			sRet += '<div style="background-color:#FFF;" onmouseover="this.style.backgroundColor=\'#e3eaff\';" onmouseout="this.style.backgroundColor=\'#FFF\';"><a class="google_adv_link" onclick="javascript:window.open(\'' + aAds[i].url  +
				'\');" onmouseover="window.status=\'Πηγαίνετε στο ' + aAds[i].visible_url + '\'" onmouseout="window.status=\'\'">' +
				'<span class="google_adv_text_link" style="font-size:16px;"><b>' + aAds[i].line1 + '</b></span>' +
				'<img src="/images/pixt.gif" width="1" height="2"><br><span class="google_adv_text" style="font-size:16px;">' + aAds[i].line2 + ' ' + aAds[i].line3 + '</span> - ' +
				'<span class="google_adv_url" style="font-size:14px;">' + aAds[i].visible_url + '</span></a></div>';
		}
		else // Output: Piu' ads con fonts piccoli
		{
			for (i = 0; i < aAds.length; i++)
			{
				sRet += '<div style="background-color:#FFF; padding:3px;" onmouseover="this.style.backgroundColor=\'#e3eaff\';" onmouseout="this.style.backgroundColor=\'#FFF\';"><a class="google_adv_link" onclick="javascript:window.open(\'' + aAds[i].url  +
					'\');" onmouseover="window.status=\'Πηγαίνετε στο ' + aAds[i].visible_url + '\'" onmouseout="window.status=\'\'">' +
					'<span class="google_adv_text_link"><b>' + aAds[i].line1 + '</b></span>' +
					'<img src="/images/pixt.gif" width="1" height="2"><br><span class="google_adv_text">' + aAds[i].line2 + ' ' + aAds[i].line3 + '</span> - ' +
					'<span class="google_adv_url">' + aAds[i].visible_url + '</span></a></div>';
			}
		}
		sRet += '</div>';
		sRet += '</td></tr></table>';
	}
	document.write(sRet);
	return;
}
