// ----------------------------------------------------------
// adsense_header.js
//
// Author        : Thomas E. George
// Creation Date : November 28, 2007
//
// History       : 11/28/2007 - TEG - created
//              
// ----------------------------------------------------------

(function()
{
    try
    {
		var eid0 = "http://pagead2.googlesyndication.com"; // <a> href domain if Google ad present
	
		//var sText = "";
		//var i = 0;
		//for(i = 0; i < document.all.length; ++i)
		//{
		//	sText = sText + i + ": " + document.all[i].name + "\t";
		//	//alert(i + ": " + document.all[i].id);
		//}
		//
		//alert(sText);
	
		var aTags = document.getElementsByTagName("a");
		var bGoogleAdsPresent = false;
		var sText = "";
		var i = 0;
		for(i = aTags.length-1; i >= 0; --i)
		{
			sText = aTags[i].href;
			
			if(sText.indexOf(eid0) >= 0)
			{
				bGoogleAdsPresent = true;	
				break;
			}
		}
	
		if(bGoogleAdsPresent == false)
		{
			var eid1 = "abgs"; // Ads By Google span
	
			if(document.getElementById(eid1) != null)
			{
				//alert("element yes");
				
				document.getElementById(eid1).style.visibility = "hidden";
			}
			else
			{
				//alert("element no");
			}
		}
	}
	catch(e)
	{
	    //alert("adsense_header.js::function() : ERROR - \'" + e.name + "\' Exception caught [" + e.description + "]");
	}
	finally
	{
	}
})()
