
jq(function() {
	initContent('body');
	externalLinks();
	jq('.add-to-cart').click(function(){
		jq('#id-cart-info').load(this.href);
		jq(this).html('Added');
		return false;
	});
	jq('.tooltip').tooltip({track:true});
	
	var cart = jq('#id-cart');
	cart.hover(
		function(){
			cart.stop(true)
			cart.css('opacity', '1.0');
		},
		function(){
			cart.stop(true);
			cart.css('opacity', '0.9');
			cart.animate({nothing:0}, 5000).fadeOut();
		}
	);
});

function showCart() {
	var cart = jq('#id-cart');
	cart.stop(true);
	cart.css('opacity', '0.9');
	cart.show();
	cart.animate({nothing:0}, 5000).fadeOut();
}

function _unloadMedia() {
	// Stop playing all embedded video, audio
	jq('video, audio').each(function(){this.pause();});
	jq('.flash-video-holder object, .flash-video-holder embed').each(function() { this.sendEvent('PLAY', 'false'); });
};

window.onbeforeunload = _unloadMedia;
