//save a single shopLevel visit in session
function saveShopVisit (shopLevelId) {
	$.get('/'+language+'/ajax/doSaveShopVisit.php', 'shopLevelId='+shopLevelId);

	// fewlhack to log moonacre-shopvisit to ox @author Holger
	if (1362 == shopLevelId) {
		$.getJSON('http://ox.stardoll.com/www/delivery/ck.php?bannerid=2836&fewlhack=?');
	}
}

function saveShopItemInteraction (itemId) {
	$.get('/'+language+'/ajax/doSaveShopItemInteraction.php', 'itemId='+itemId);
}

function saveShopMenuStat (shopId, type) {
	$.get('/'+language+'/ajax/doSaveShopMenuStat.php', 'shopId='+shopId+'&type='+type);
}

function saveShopLevelVideoInteraction (shopLevelId, shopId, type) {
	$.get('/'+language+'/ajax/doSaveShopLevelVideoStat.php', 'shopLevelId='+shopLevelId+'&shopId='+shopId+'&type='+type);
}

//when leaving the starPlaza-page, save all shop stats (temp stored in session) in db
window.onunload = function() {
	$.get('/'+language+'/ajax/doSaveAllShopVisits.php');
};


function showGalleriaBackground (shopId, isEntrance) {
	var id = 'sp_shop';
	if (isEntrance) {
		id = 'sp_front';
	} else if (21 == shopId) {
		id = 'sp_accessories';
	} else if (22 == shopId) {
		id = 'sp_sephora_makeup';
	} else if (23 == shopId) {
		id = 'sp_hair_makeup';
	} else if (26 == shopId) {
		id = 'sp_heidi';
	} else if (59 == shopId) {
		id = 'sp_dot';
	} else {
		id = 'sp_shop';
	}
	$('body').attr('id', id);
}