/*
 *
 *
 * Implementation of the DR Tracking API
 *
 * @author mediaman technology GmbH
 * @since 2009-11-11
 * @version 1.0
 *
 *
 */
 
(function(){

TrackingManager = function()
{
	this.accountId = "";
	this.pageName = "";
	this.data = {};
	this.initialized = false;
}
// default values for the page tracking
TrackingManager.prototype = {
	defaultValues: { "et_pagename": "", "et_areas": "", "et_ilevel": 0, "et_url": "", "et_tag": "", "et_target": "", "et_tval": "0", "et_tonr": "", "et_tsale": 0, "et_cust": 0, "et_basket": "", "et_lpage": "0", "et_trig": "", "et_se": "0" },
	
	init: function(accountId, pageName){
		if(!this.inititalized)
		{
			if (accountId && accountId != "")
			{
				this.accountId = accountId;
			}
			
			if (pageName && pageName != "")
			{
				this.pageName = pageName;
			}
			
			this.data = {};
			this.initialized = true;
		}
	},
	
	isInitialized: function(){
		return this.initialized;
	},
	
	callAction: function(action, name, tags) {
		try
		{
			if(('' === name) || (null === name))
			{
				return false;
			}

			if(null === tags)
			{
				tags = '';
			}

			if('function' == typeof ET_Event[action])
			{
				ET_Event[action](name, tags);
			}
		} catch(e) {}
		
		return false;
	}

};

})();

var drTrackingManager = new TrackingManager();