function winstat(w) {window.status = w; return true;}
function clearstat(){window.status='';}
  
function google_ad_request_done(google_ads) {  
	var first_ad_unit = '', second_ad_unit = '';
	if (google_ads.length > 0) {
		
 		    first_ad_unit += '<div style="border: 1px solid #DFE6EF; width:530px;"><p style=\"margin: 2px 2px 2px 2px;\">';
			first_ad_unit +='Sponsored Links&nbsp';
			for(var i = 0; i < google_ads.length; ++i) {
				// For text ads, display each ad in turn.		
				if (google_ads[i].type == 'text') {
					if (i < 2) {
  							if (i == 0) {
								if (google_info.feedback_url) {
								first_ad_unit += '<a class=\"MoreNews\" href=\"' + google_info.feedback_url + 
									'\">(Ads by Google)</a>';
								} else {
								  first_ad_unit += '<font size=\"-1\">(Ads by Google)</font></a>';
								 }
								first_ad_unit += '</p>'; 
							}

							  first_ad_unit += '<p style=\"margin: 4px 4px 2px 10px;\">' +
							  '<a class = \"directory\" style=\"font-weight: bold\" onMouseOver=\"return winstat(\'go to ' + google_ads[i].visible_url +' \')\" onMouseOut=\"clearstat()\" href=\"' +  google_ads[i].url + '\">' +
							  google_ads[i].line1 + "</a> - " +
							  '<a class = \"MoreNews\" onMouseOver=\"return winstat(\'go to ' + google_ads[i].visible_url +' \')\" onMouseOut=\"clearstat()\" href=\"' +  google_ads[i].url + '\">' +
							  '<font color=\"#008000\">' + google_ads[i].visible_url + '</font></a><br>' +
							  '<a style=\"text-decoration: none\" onMouseOver=\"return winstat(\'go to ' + google_ads[i].visible_url +' \')\" onMouseOut=\"clearstat()\" href=\"' +  google_ads[i].url + '\">' +
							  '<font color=\"#000000\" size =\"-1\" style =\"FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 10pt; \" >' +
							  google_ads[i].line2 + ' ' + google_ads[i].line3 + 
							  '</font></a>'+
							  '</p>';

					
					} else {
						if (i == 2) {
									 if (google_info.feedback_url) {
										  second_ad_unit += '<div align =\"center\" style =\"background-color: #DFE6EF\">' +
										  '<font color=\"#000099\"><b>' + '<a  href=\"' + google_info.feedback_url + '\">Ads by Google</a></b></font></div>';
									 } else {
										  second_ad_unit += '<div align =\"center\" style =\"background-color: #DFE6EF\"><font color=\"#000099\"><b>Ads By Google</b></font></div>';
									   }
						 }
						second_ad_unit += '<p style=\"margin: 10px 4px 2px 2px;\">'+
						'<a class=\"MoreNews\" onMouseOver=\"return winstat(\'go to ' + google_ads[i].visible_url +' \')\" onMouseOut=\"clearstat()\" href=\"' + google_ads[i].url + '\">' +
						'<span style=\"font-weight: bold; color: black\">' + google_ads[i].line1 + '</span><br>' + 
						google_ads[i].line2 + 
						'</span> ' + google_ads[i].line3 + 
						'</span><br><font color=\"#008000\">' + google_ads[i].visible_url + 
						'</font></a></p>';
					 }		

				} // end if 'text' ad
			} // end for

 } // end google_ads.length > 0

	first_ad_unit += '</div>';

	document.getElementById("first_ad_unit").innerHTML += first_ad_unit;
	document.getElementById("second_ad_unit").innerHTML += second_ad_unit;
	
}
