// JavaScript Document

//http://www.fofronline.com/2009-03/track-outbound-links-using-google-analytics/
/*
	
var domainName = "www.uschamber.com";
		// Select all outbound links
		$$('a[href^="http"]:not(a[href*="'+domainName+'"])').each(function(outboundLink) {
        		// Add listener to each of the links
        	Event.observe(outboundLink, 'click', function() {
       			// category, action, label
        		pageTracker._trackEvent('Outbound Link', outboundLink.innerHTML.replace(/(<([^>]+)>)/ig,""), outboundLink.href);
        		}
			});

*/

Event.observe(window, 'load', function () {

	$$('div#homeUpdates a[href^="http"]').each(function(outboundlink) {
		outboundlink.target = "_blank"
		});
	});

/*

	var arrLinks = $$('div#homeUpdates a');

	for (var i=0; i<=arrLinks.length; i++) {
		
		var sGALinkID = "outbound" + i;
		arrLinks[i].id = sGALinkID;

		var sLink = arrLinks[i].href;

		
		if (sLink.search("www.uschamber.com") == -1) {		
			arrLinks[i].target = "_blank"

			if (sLink.search("https") >= 0) {
				var sGALink = sLink.substr(8);
				}
			else if (sLink.search("http") >= 0) {
				var sGALink = sLink.substr(7);
				}

			sGALink = sGALink.replace(/www\./i, "");
			sGALink = sGALink.replace(/\.com/i, "");
			//sGALink = sGALink.replace(/\.org/i, "");
			//sGALink = sGALink.replace(/\.net/i, "");

			var sGALink2 = "http://www.uschamber.com/outbound/" + sGALink;

			//arrLinks[i].href = "#";

			$(sGALinkID).observe('click', function() {
					alert(sGALinkID + " || " + sGALink2);
					return false;
				});
			//pageTracker._trackPageview(sGALink);
			} //end main if
	
		} //end for
*/

