
function visualizeBasketAdd(articleTitle) {
	var navCC = $('basketNav').getCoordinates();

		var pane = new Element('div', {id: 'basketAdd', html: '"' + articleTitle + basketText});
		var hider = new Element('div', {'class': 'hideDiv'});
		hider.setStyles({
			left: (navCC.left - 2) + 'px',
			top: (navCC.bottom - 4) + 'px'
		});
		
		pane.inject(hider);
		hider.inject('bodyBg');
		
		var paneCC = pane.getCoordinates();	
		pane.setStyle('top', '-' + paneCC.height + 'px');			
		hider.setStyles({
			width: paneCC.width + 'px',
			height: paneCC.height + 'px'
		});
		
		pane.tween('top', 0);
	
	
		var flash = new Element('span', {'class': 'flash', html: $('basketNav').get('html')});
		flash.setStyles({
			position: 'absolute',
			left: '0px',
			top: '15px',
			'background-color': '#ffebb0',
			'border-color': 'transparent'
		});
		flash.inject('basketNav');
		flash.fade('hide');
		flash.set('tween', {duration: 200});
		flash.fade('in');
		
		var fader = function(dur) {
			this.set('tween', {duration: dur});
			this.fade();
		};
		fader.delay(250, flash, [500]);
		fader.delay(800, flash, [200]);
		fader.delay(1050, flash, [500]);		
		
		var cleanup = function() {
			hider.destroy();
			flash.destroy();
		}.bind({flash: flash, hider: hider});
		cleanup.delay(5000);
}

window.addEvent('load', centerPreviewImages);

function centerPreviewImages() {
	$('bodyBg').getElements('.previewBox img, .previewBoxSmall img, .previewBoxBig img').each(function(img) {
		var top = img.getParent().getCoordinates().height - img.getCoordinates().height;
		var left = img.getParent().getCoordinates().width - img.getCoordinates().width;
		if(top > 0) top = top / 2;
		else top = 0;
		if(left > 0) left = left / 2;
		else left = 0;
		img.setStyles({
																	'position': 'absolute',
																	'left': left,
																	'top': top
																});
													});
}
