function GaIsSent() {
    if (typeof(GOOGLE_ANALYTICS_ISSENT) == "undefined") {
        return false;
    } else {
        return GOOGLE_ANALYTICS_ISSENT;
    }
}

function GaSetIsSent(value) {
    if (typeof(GOOGLE_ANALYTICS_ISSENT) == "undefined") {
        return false;
    } else {
        GOOGLE_ANALYTICS_ISSENT = value;
    }
}

function GaActive() {
	if (typeof(GOOGLE_ANALYTICS_ACTIVE) == "undefined") {
		return false;
	} else {
		return GOOGLE_ANALYTICS_ACTIVE;
	}
}

function GeActive() {
	if (typeof(GOOGLE_ECOMMERCE_ACTIVE) == "undefined") {
		return false;
	} else {
		return GOOGLE_ECOMMERCE_ACTIVE;
	}
}

function GaTrack(GaSection) {
	if (!GaActive())
		return;
	if (GaIsSent())
	    return;
	else
	   GaSetIsSent(true);
	try {
		if (GaSection > '')
			_gaq.push(['_trackPageview', GaSection]);
		else
			_gaq.push(['_trackPageview']);
	} catch(err) { 
		
	}
	return;
};

function GaTransStart(orderData) {
	if (!GeActive())
		return;
	try {
		_gaq.push(['_addTrans',
			orderData.orderNr,	// order ID - required
			orderData.storeName,// affiliation or store name
			orderData.total,	// total - required
			orderData.tax,		// tax
			orderData.shipping,	// shipping
			orderData.city,		// city
			orderData.state,	// state or province
			orderData.country	// country
		]);
//	total including tax
//	tax amount
//	shipping costs
	} catch(err) { 
		
	}
	return;
}

function GaTransItem(itemData) {
	if (!GeActive())
		return;
	try {
	  _gaq.push(['_addItem',
	    itemData.orderNr,	// order ID - required
	    itemData.sku,		// SKU/code - required
	    itemData.name,		// product name
	    itemData.category,	// category or variation
	    itemData.price,		// unit price - required
	    itemData.qty		// quantity - required
	  ]);
	} catch(err) { 
		
	}
	return;
}

function GaTransCommit() {
	if (!GeActive())
		return;
	try {
		_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
	} catch(err) { 
		
	}
	return;
}

