/**
 * Mini cart.
 */
var miniCart = new function() {
	this.id = 'MiniCart';
	this.timeout = null;

	this.show = function(){
		var obj = document.getElementById(this.id);

		if(obj.style.display == 'none') {
			obj.style.display = 'block';
		} else {
			obj.style.display = 'none';
		}

		if(this.timeout) {
			clearTimeout(this.timeout);
		}
	}

	this.hide = function() {
		var obj = document.getElementById(this.id);
		obj.style.display = 'none';

		if(this.timeout) {
			clearTimeout(this.timeout);
		}
	}

	this.close = function(delay) {
		this.timeout = setTimeout(function() {
			miniCart.hide();
		}, delay);
	}
};