/* Miscellany
/*----------------------------------------------------------------------------------------*/
function SwapImage(largeImg, zoomImage){
	if((largeImg.length > 0)) {
		$('productImg').setAttribute('src', largeImg);
		$('productImgZoom').setAttribute('src', zoomImage);
	} 
}

 
 
/*----------------------------------------------------------------------------------------*/

document.observe('dom:loaded', function(){
	if ($('btn_add_cart')) {
		new AjaxCart('btn_add_cart');
	}
	
	if ($('btn_add_cart_items')) {
		new AjaxCart('btn_add_cart_items');
	}
	
	new Tabs($('tabs'), $$('.togglers li'), $$('.tab_content'), 0);
	
	if ($('productImg') && $('enlarge')) {
		$('productImg', 'enlarge').each(function(el) {
			new CenteredPop(el, $('zoom')); });
	}
	
	if ($('product_thumbs')) {
		new ClassToggler($$('.product_thumbs ul li'), 'active', 0);
	}
	
	// tooltips
	var featureList = $('feature_list');
	$$('.tooltip_trigger').each(function(el){
		var pop = el.down('.tooltip');
		if (el && pop)
			new PositionedToolTip(el, pop, {anchor: el.down('a'),yOffset:-17,xOffset:-7,parent:featureList});
	}); 

});

