var google_adnum = 0; /* only insert this line for your first ad unit */
function google_ad_request_done(google_ads) {

/*
* This function is required and is used to display
* the ads that are returned from the JavaScript
* request. You should modify the document.write
* commands so that the HTML they write out fits
* with your desired ad layout.
*/

var s = '';
var i;

/*
* Verify that there are actually ads to display.
*/

if (google_ads.length == 0) {
	return;
}

/* Se definen los tipos de anuncio */
if ( anuncio_adtype == 1 ) { color1='#FFECB3'; color2='#FFE188' ;}; 
if ( anuncio_adtype == 2 ) { color1='#DDFFFF'; color2='#AEE3E3' ;};
if ( anuncio_adtype == 3 ) { color1='#FFFFFF'; color2='#DEDEDE' ;};
/*
* If an image, flash or html ad is returned, display that ad.
* Otherwise, build a string containing all of the ads and
* then use a document.write() command to print that string.
*/

if (google_ads[0].type == "flash") {
	s += '<a href=\"' +
	google_info.feedback_url + '\" style="color:#000000">Anuncios Google</a><br>' +
	'<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="' +
	google_ad.image_width + '" HEIGHT="' +
	google_ad.image_height + '"> <PARAM NAME="movie" VALUE="' +
	google_ad.image_url + '">' +
	'<PARAM NAME="quality" VALUE="high">' +
	'<PARAM NAME="AllowScriptAccess" VALUE="never">' +
	'<EMBED src="' +
	google_ad.image_url + '" WIDTH="' +
	google_ad.image_width + '" HEIGHT="' +
	google_ad.image_height +
	'" TYPE="application/x-shockwave-flash"' +
	' AllowScriptAccess="never" ' +
	' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';

} else if (google_ads[0].type == "image") {

	s += '<a href=\"' +
	google_info.feedback_url + '\" style="color:#000000">Anuncios Google</a><br> <a href="' +
	google_ads[0].url + '" target="_top" title="go to ' +
	google_ads[0].visible_url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
	google_ads[0].visible_url + '\';return true"><img border="0" src="' +
	google_ads[0].image_url + '"width="' +
	google_ads[0].image_width + '"height="' +
	google_ads[0].image_height + '"></a>';

} else if (google_ads[0].type == "html") {

	s += '<a href=\"' +
	google_info.feedback_url + '\" style="color:000000">Anuncios Google</a><br>' +
	google_ads[0].snippet;

} else {

	if (google_ads.length == 1) {

		if ( anuncio_adtype == 160 ) { /* Anuncio de 160px */
			s += '<a href=\"' + google_info.feedback_url + '\" style="color:#444444;text-decoration:none; display:block; width: 200px; margin: 0px auto 0px auto; text-align:left;">Anuncios Google</a><br>'		
			s += '<div style="background-color: #F0F3F7; width: 200px; text-align:left; margin: 10px auto 0px auto; padding: 0px 0px 10px 0px; border-bottom:1px solid #BDC1DD;">'+
			'<a style="text-decoration:underline; font-size:14px; font-weight: bold;font-family:verdana;" href="' +
			google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[i].visible_url + '\';return true">' +
			google_ads[i].line1 + '</a>' 
				+'<br /><p style="color:#000000;text-decoration:none;font-size:11px;font-family:verdana; margin: 8px 0px 3px 0px; padding:0px;">' +
			google_ads[i].line2 + ' ' +
			google_ads[i].line3 + '</p>'
				+ '<a style="text-decoration:none; font-size:11px" href="' +
			google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[i].visible_url + '\';return true">' +
			google_ads[i].visible_url + '</a></div>';
		
		} else {
			/*
			* Partners should adjust text sizes
			* so ads occupy the majority of ad space.
			*/
			s += '<a href=\"' + google_info.feedback_url + '\" style="color:#444444;text-decoration:none">Anuncios Google</a>' + 
				'<div style="background-color:'+color1+'; border-left: 4px '+color2+' solid; padding: 14px 4px 14px 115px; margin: 4px 0px 10px 0px;">'+
				'<a style="text-decoration:underline; font-size:16px; font-weight: bold;font-family:verdana;" href="' +
			google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[0].visible_url + '\';return true">' +
			google_ads[0].line1 + '</a> <a style="text-decoration:none; font-size:12px" href="' +
			google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[0].visible_url + '\';return true">' +
			google_ads[0].visible_url + '</a><br /><p style="color:#000000;text-decoration:none;font-size:14px;font-family:verdana; margin: 8px 0px 0px 0px">' +
			google_ads[0].line2 + ' ' +
			google_ads[0].line3 + '</p></div>';
		}

	} else if (google_ads.length > 1) {
		if ( anuncio_adtype == 160 ) { /* Anuncio de 160px */
			s += '<a href=\"' + google_info.feedback_url + '\" style="color:#444444;text-decoration:none; display:block; width: 200px; margin: 0px auto 0px auto; text-align:left;">Anuncios Google</a><br>'		
		} else {
			s += '<a href=\"' + google_info.feedback_url + '\" style="color:#444444;text-decoration:none;">Anuncios Google</a><br>'
		}
		/*
		* For text ads, append each ad to the string.
		*/
		for(i = 0; i < google_ads.length; ++i) {
			if ( anuncio_adtype == 160 ) { /* Anuncio de 160px */
				s += '<div style="background-color: #F0F3F7; width: 200px; text-align:left; margin: 10px auto 0px auto; padding: 0px 0px 10px 0px; border-bottom:1px solid #BDC1DD;">'+
				'<a style="text-decoration:underline; font-size:14px; font-weight: bold;font-family:verdana;" href="' +
				google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
				google_ads[i].visible_url + '\';return true">' +
				google_ads[i].line1 + '</a>' 
					+'<br /><p style="color:#000000;text-decoration:none;font-size:11px;font-family:verdana; margin: 8px 0px 3px 0px; padding:0px;">' +
				google_ads[i].line2 + ' ' +
				google_ads[i].line3 + '</p>'
					+ '<a style="text-decoration:none; font-size:11px" href="' +
				google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
				google_ads[i].visible_url + '\';return true">' +
				google_ads[i].visible_url + '</a></div>';
			} else {
				if ( anuncio_adtype < 10 ) { /* Anuncios con fondo y borde */
					s += '<div style="background-color: '+color1+'; border-left: 4px '+color2+' solid; padding: 14px 4px 14px 115px; margin: 4px 0px 10px 0px;">'+
					'<a style="text-decoration:underline; font-size:14px; font-weight: bold;font-family:verdana;" href="' +
					google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
					google_ads[i].visible_url + '\';return true">' +
					google_ads[i].line1 + '</a> <a style="text-decoration:none; font-size:12px" href="' +
					google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
					google_ads[i].visible_url + '\';return true">' +
					google_ads[i].visible_url + '</a><br /><p style="color:#000000;text-decoration:none;font-size:14px;font-family:verdana; margin: 8px 0px 0px 0px">' +
					google_ads[i].line2 + ' ' +
					google_ads[i].line3 + '</p></div>';
				} else {
					/* Anuncios blancos */
					if ( anuncio_adtype == 11 ) { /* distribucion 1 */
						s += '<div style="background-color: #FFFFFF; padding: 14px 4px 8px 0px; margin: 4px 0px 10px 0px;">'+
						'<a style="text-decoration:underline; font-size:14px; font-weight: bold;font-family:verdana;" href="' +
						google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
						google_ads[i].visible_url + '\';return true">' +
						google_ads[i].line1 + '</a><br /><p style="color:#000000;text-decoration:none;font-size:13px;font-family:verdana; margin: 8px 0px 0px 0px">' +
						google_ads[i].line2 + ' ' +
						google_ads[i].line3 + ' <a style="text-decoration:none; font-size:11px" href="' +
						google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
						google_ads[i].visible_url + '\';return true">' +
						google_ads[i].visible_url + '</a></p></div>';
					}
					if ( anuncio_adtype == 12 ) { /* distribucion 2 */
						s += '<div style="background-color: #FFFFFF; padding: 14px 4px 8px 0px; margin: 4px 0px 10px 0px;">'+
						'<a style="text-decoration:underline; font-size:14px; font-weight: bold;font-family:verdana;" href="' +
						google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
						google_ads[i].visible_url + '\';return true">' +
						google_ads[i].line1 + '</a>	<a style="text-decoration:none; font-size:11px" href="' +
						google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
						google_ads[i].visible_url + '\';return true">' +
						google_ads[i].visible_url + '</a> '+
							'<br /><p style="color:#000000;text-decoration:none;font-size:13px;font-family:verdana; margin: 8px 0px 0px 0px">' +
						google_ads[i].line2 + ' ' +
						google_ads[i].line3 + '</p></div>';
					}
				}
			}
		}
	}
}

if (google_ads[0].bidtype == "CPC") { /* insert this snippet for each ad call */
	google_adnum = google_adnum + google_ads.length;
}

    document.write(s);
    return;
  }


