var GA = new(function(){})(); GA.Event = function( sCategory, sAction, sLabel, nValue ) { if ( _gaq ) _gaq.push(['_trackEvent', sCategory, sAction, sLabel || "", nValue || 0]); }; GA.Clickout = function( oLink, bNewWindow ) { GA.Event( "Clickout", oLink.href, oLink.id ); if ( bNewWindow ) { window.open( oLink.href ); return false; } return true; }; GA.InternalLink = function( oLink ) { return oLink.href.match( new RegExp( "^" + document.location.href.substr( 0, document.location.href.indexOf( "/", 9 ) ) ) ); }; GA.Capture = function( bInternal ) { var aLink = document.getElementsByTagName( "a" ); for ( var i = 0; i < aLink.length; ++i ) if ( ( bInternal || !GA.InternalLink( aLink[ i ] ) ) && typeof aLink[ i ].onclick == "undefined" ) aLink[ i ].onclick = this.__clickout; }; GA.__clickout = function( e ) { return GA.Clickout( this, !GA.InternalLink( this ) ); }; GA.Capture();