// JavaScript Document
    
     function google_afs_request_done(google_ads)
      {
          /*
           * Verify that there are actually ads to display.
           */
          var google_num_ads = google_ads.length;
          if (google_num_ads <= 0)
          {
              return;
          }

          var wideAds = "";   // wide ad unit html text
          var wideAds2 = "";  
          var wideAds3 = ""; 
		  
//		  var max1 = 3;
//		  var max2 = 2;
//		  var max3 = 3;
//		  
//		  if google_num_ads < 3 {
//		  var max1 = google_num_ads;
//		  var max2 = google_num_ads;
//		  var max3 = google_num_ads;
//		  }
//		  if google_num_ads < 5 {
//		  var max1 = 3;
//		  var max2 = google_num_ads;
//		  var max3 = google_num_ads;  
//		  }
//		  if google_num_ads < 8 {
//		  var max1 = 3;
//		  var max2 = 5;
//		  var max3 = google_num_ads;  
//		  }

          for(i = 0; i < google_num_ads; i++)
          {
             
                  // render a wide ad
				  if (i > 0 && i <= 4) {
					  dads1 = 1
                  wideAds+='<div style="background:#F4F9FF;">' + 
		'<table width = "100%"><tr><td height="30">' +
		'<a href="' + 
		google_ads[i].url + '" class = "link14" target="_blank" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\';return true"><span class="ad_line1">' +
		google_ads[i].line1 + '</span></a>' +
		'<br><span class="Txt11">' + google_ads[i].line2 + ' ' +
		google_ads[i].line3  + '</span>' + 
		'&nbsp;&nbsp;&nbsp;<a style="text-decoration:none;" class="Linkgs" href="' +
		google_ads[i].url + '"  target="_blank" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\';return true">' + 
		'<strong>' +
		google_ads[i].visible_url + '</span></a></td></tr></table></div>';
				  }

                  if (i > 4 && i <= 6) {
					                    dads2 = 1
					                    wideAds2+='<div style="background:#F4F9FF;">' + 
		'<table width = "100%"><tr><td height="30">' +
		'<a href="' + 
		google_ads[i].url + '" class = "link14" target="_blank" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\';return true"><span class="ad_line1">' +
		google_ads[i].line1 + '</span></a>' +
		'<br><span class="Txt11">' + google_ads[i].line2 + ' ' +
		google_ads[i].line3  + '</span>' + 
		'&nbsp;&nbsp;&nbsp;<a style="text-decoration:none;" class="Linkgs" href="' +
		google_ads[i].url + '"  target="_blank" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\';return true">' + 
		'<strong>' +
		google_ads[i].visible_url + '</span></a></td></tr></table></div>';
				  }
                 if (i > 6 && i <= 9) {
					                    dads3 = 1
					                    wideAds3+='<div style="background:#F4F9FF;">' + 
		'<table width = "100%"><tr><td height="30">' +
		'<a href="' + 
		google_ads[i].url + '" class = "link14" target="_blank" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\';return true"><span class="ad_line1">' +
		google_ads[i].line1 + '</span></a>' +
		'<br><span class="Txt11">' + google_ads[i].line2 + ' ' +
		google_ads[i].line3  + '</span>' + 
		'&nbsp;&nbsp;&nbsp;<a style="text-decoration:none;" class="Linkgs" href="' +
		google_ads[i].url + '"  target="_blank" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\';return true">' + 
		'<strong>' +
		google_ads[i].visible_url + '</span></a></td></tr></table></div>';
				  }
						  
             
          }
		        if (wideAds != "")	{	
                      wideAds = '<table width="100%" border = "0"><tr><td style="background:#FFFFFF"><a style="text-decoration:none" ' +
                        'href="http://services.google.com/feedback/online_hws_feedback"  target = "_blank">' +
                        '<span class="Txt10" style="text-align:left"><strong>Annunci Google</strong></span></a></td></tr></table>' + wideAds;
						document.getElementById("wide_ad_unit").innerHTML = wideAds;
				}
				if (wideAds2 != "")	{	
                      wideAds2 = '<table width="100%" border = "0"><tr><td style="background:#FFFFFF"><a style="text-decoration:none" ' +
                        'href="http://services.google.com/feedback/online_hws_feedback"  target = "_blank">' +
                        '<span class="Txt10" style="text-align:left"><strong>Annunci Google</strong></span></a></td></tr></table>' + wideAds2;
						document.getElementById("wide_ad_unit2").innerHTML = wideAds2;
				}
				if (wideAds3 != "")	{			
                     wideAds3 = '<table width="100%" border = "0"><tr><td style="background:#FFFFFF"><a style="text-decoration:none" ' +
                        'href="http://services.google.com/feedback/online_hws_feedback" target = "_blank">' +
                        '<span class="Txt10" style="text-align:left"><strong>Annunci Google</strong></span></a></td></tr></table>' + wideAds3;
                        document.getElementById("wide_ad_unit3").innerHTML = wideAds3;
				}
	   
          // Write HTML for wide and narrow ads to the proper <div> elements
          
          
         
          
      }


      google_afs_query = kunit1;
      google_afs_ad = 'w9'; // specify the number of ads you are requesting
      google_afs_client = 'pub-4402322498696489'; // substitute your client ID
      google_afs_channel = '8150761479'; // enter your custom channel ID
      google_afs_hl = 'it'; // enter your interface language if not English
	  google_afs_adpage = adpage;
	
