var googleAnalytics = function(pageCode, domain){
	this.pageCode = pageCode;
	this.domain = domain;
	this.resId = "";
	this.commission = "";
	this.finalPrice = "";
	this.hotelName = "";
	this.country = "";
	this.person = "";

	this.init = function () {
		this.pageTracker = _gat._getTracker(this.pageCode);
		this.pageTracker._setDomainName(this.domain);
		this.pageTracker._initData();
	}

	this.setStep = function (step){
		this.pageTracker._trackPageview(step);
	}

	this.getTransParam = function(){
		if(document.getElementById('seoResId')){
			this.resId = document.getElementById('seoResId').value;
		}
		if(document.getElementById('seoCommission')){
			this.commission = document.getElementById('seoCommission').value;
		}
		if(document.getElementById('seoFinalPrice')){
			this.finalPrice = document.getElementById('seoFinalPrice').value;
		}
		if(document.getElementById('seoOfferCode')){
			this.offerCode = document.getElementById('seoOfferCode').value;
		}
		if(document.getElementById('seoHotelName')){
			this.hotelName = document.getElementById('seoHotelName').value;
		}
		if(document.getElementById('seoCountry')){
			this.country = document.getElementById('seoCountry').value;
		}
		if(document.getElementById('seoPerson')){
			this.person = document.getElementById('seoPerson').value;
		}
	}

	this.setTransaction = function(){
		this.getTransParam();
		this.pageTracker._addTrans (
			    this.resId,
			   	"",
			    this.commission,
			    this.finalPrice,
			    "",
			    "",
			    "",
			    ""
		);
		this.pageTracker._addItem(
			    this.resId,
			    this.offerCode,
				this.hotelName,
				this.country,
				this.commission,
				this.person
		);
		this.pageTracker._trackTrans();
	}
	this.init();
}