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 class="adsenseframe">';
			
			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) {
  							  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 {
						second_ad_unit += '<p style=\"margin: 10px 4px 2px 2px;\">'+
						'<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><br>' + 
						'<a class=\"MoreNews\"  style=\"color: black;\" onMouseOver=\"return winstat(\'go to ' + google_ads[i].visible_url +' \')\" onMouseOut=\"clearstat()\" href=\"' + google_ads[i].url + '\">' +
						google_ads[i].line2 + ' ' + google_ads[i].line3 + '</a><br>' + 
						'</p>';
					
					 }		

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

		// ad Ad by google to first and second ad if not empty				

		if (first_ad_unit != ''){
					first_ad_unit += '<p style=\"margin: 4px 4px 2px 10px;\" align="right">'; 
					first_ad_unit +='Sponsored Links&nbsp';
					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>'; 

		// close adsenseframe DIV
		first_ad_unit += '</div>';			
		}
		
		if (second_ad_unit != ''){
					 second_ad_unit += '<br>';
					 if (google_info.feedback_url) {
						  second_ad_unit += '<div align =\"center\">' +
						  '<font color=\"#000099\"><b>(' + '<a class=\"MoreNews\" 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>';
				   }
			}
	
	
 } // end google_ads.length > 0



	// add default ads from tradepub/globalspec
	
	if (first_ad_unit == ''){
		first_ad_unit +=	'<a href="http://physorg.tradepub.com/?pt=cat&page=_INTL">'+
							'<img src="banner/lifesci468x60.gif" border="0" width="468" height="60" alt=""></a>';
	}

	
	if (second_ad_unit == ''){
		second_ad_unit +=	'<A href="http://www.globalspec.com/engineering-toolbar/Install?frmtrk=affiliate&kbid=1400&img=toolbar-250x250.gif">'+
							'<img src="http://www.globalspec.com/pix/affiliate/toolbar-250x250.gif" border=0></a>' +
							'<img src="http://www.myaffiliateprogram.com/u/globalsp/showban.asp?id=1400&img=toolbar-250x250.gif" border=0>';
	}



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