function AbstractLogLine(_json_data)
{
	this.json_data = _json_data;
}

AbstractLogLine.prototype.getAction = function() { }
AbstractLogLine.prototype.getURL = function() { return "/Log.html" }
AbstractLogLine.prototype.getLogAction = function() { return ""; }
AbstractLogLine.prototype.getData = function()
{
    var data = "logaction="+this.getLogAction() + "&isAjax=true";

    for(key in this.json_data)
    {
	data += "&" + key + "=" + this.json_data[key];
    }

    return data;
}

AbstractLogLine.prototype.Log = function()
{
	if (!logCommerceEnabled) return;

	action = this.getAction();
	var url = this.getURL();
	var data = this.getData();
	
	$.ajax({
			   type: "GET",
			   url: url,
			   data: data,
			   success: function(msg)
			   {
				var results = eval ('(' + msg + ')');

				if(results['success'] == 'false')
				{

				}
				else
				{
				}

				return true;
			    }
			 });
}

/**
* Checkrates popups
*/
CheckRatesProviderOpen.prototype = new AbstractLogLine;

function CheckRatesProviderOpen(_data)
{
	this.inheritFrom = AbstractLogLine;
  	this.inheritFrom(_data);
}

CheckRatesProviderOpen.prototype.getLogAction = function() { return "checkratesprovideropen"; }

CheckRatesProviderOpen.prototype.setTripURL = function(_url)
{
	this.url = _url.substring('/Commerce?'.length);
}


/**
CPC
**/
CpcOpen.prototype = new AbstractLogLine;

function CpcOpen(_data)
{
	this.inheritFrom = AbstractLogLine;
  	this.inheritFrom(_data);
}

CpcOpen.prototype.getLogAction = function() { return "cpcopen"; }

/**
AIM
**/
AIMOpen.prototype = new AbstractLogLine;

function AIMOpen(_data)
{
	this.inheritFrom = AbstractLogLine;
  	this.inheritFrom(_data);
}

AIMOpen.prototype.getLogAction = function() { return "aimopen"; }

/**
Checkrates popup button
**/
CheckRatesPopupOpen.prototype = new AbstractLogLine;

function CheckRatesPopupOpen(_data)
{
	this.inheritFrom = AbstractLogLine;
  	this.inheritFrom(_data);
}

CheckRatesPopupOpen.prototype.getLogAction = function() { return "checkratespopupopen"; }

/**
Checkrates popup link in CPC window
**/
CheckRatesCPCPopupOpen.prototype = new CheckRatesPopupOpen;

function CheckRatesCPCPopupOpen(_data)
{
	this.inheritFrom = AbstractLogLine;
  	this.inheritFrom(_data);
}

CheckRatesCPCPopupOpen.prototype.getLogAction = function() { return "checkratescpcpopupopen"; }


/**
Checkrates popup from "check prices" button
**/
CheckRatesCheckPricesPopupOpen.prototype = new CheckRatesPopupOpen;

function CheckRatesCheckPricesPopupOpen(_data)
{
	this.inheritFrom = AbstractLogLine;
  	this.inheritFrom(_data);
}

CheckRatesCheckPricesPopupOpen.prototype.getLogAction = function() { return "checkratescheckpricespopupopen"; }


/**
Checkrates popup from "bookit" button
**/
CheckRatesBookItPopupOpen.prototype = new CheckRatesPopupOpen;

function CheckRatesBookItPopupOpen(_data)
{
	this.inheritFrom = AbstractLogLine;
  	this.inheritFrom(_data);
}

CheckRatesBookItPopupOpen.prototype.getLogAction = function() { return "checkratesbookitpopupopen"; }


/**
Trip Read More Reviews links
**/
TripReadMoreReviews.prototype = new AbstractLogLine;

function TripReadMoreReviews(_data)
{
	this.inheritFrom = AbstractLogLine;
  	this.inheritFrom(_data);
}

TripReadMoreReviews.prototype.getLogAction = function() { return "tripreadmorereviews"; }

/**
Checkrates action button
**/
CheckRatesActionButton.prototype = new AbstractLogLine;

function CheckRatesActionButton(_data)
{
	this.inheritFrom = AbstractLogLine;
  	this.inheritFrom(_data);
}

CheckRatesActionButton.prototype.getLogAction = function() { return "checkratesactionbutton"; }

