var _gat = null;//so IE doesn't get confused
var GoogleAnalytics = new Class({
	Implements:[Events,Options],
	
	options:{
		log:false
	},
	
	initialize: function(id,options){
		this.id = id;
		this.setOptions(options);
		var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
		new Asset.javascript(gaJsHost + 'google-analytics.com/ga.js',{
		    onload: function() {
		        this.loaded();
		    }.bindWithEvent(this)
		});
		
	},
	
	loaded: function(){
		if(this.options.log)
			console.log('loaded google analytics');
		this.tracker = _gat._getTracker(this.id); // your id here
        this.tracker._initData();
        this.tracker._trackPageview();
		this.fireEvent('loaded',this.event);
	},
	
	trackPageView: function(page){
		if(this.options.log)
			console.log('Tracking page view: '+page);
		this.tracker._trackPageview(page);
	},
	
	event: new Class({
		
	})
});