//Specify a Google namespace
var Google = Google || {};


//A master function for tracking url requests
Google.track = function( url ){
	
	if( typeof this._trackers == 'undefined' ){
		return false;
	}	
	
	//loop through the tracker collection and track each
	for( var i=0,t; t = this._trackers[i];++i ){
		if( url ){
			t._trackPageview( url );
		}else{
			t._trackPageview();
		}
	}
	
	
}

Google.addTracker = function( key ){
	
	//Ensure the tracker collection is an array
	this._trackers = this._trackers || [];
	if( this._trackers.constructor != Array ){
		this._trackers = [];
	}
	
	if(typeof _gat != 'undefined'){
	
		//setup the tracker
		var t = _gat._getTracker( key );
		
		//add this tracker to the collection
		this._trackers.push( t );

	}else{
		throw('_gat (Google Analytics) is not defined');
	}
}