// JavaScript Document

function addProductCallback(xhr)
{

	var response = JSON.decode(xhr.responseText);
	
	if(!response.ADDED) return;
	
	try{
	$('miniBasketLayer').set('load', {noCache:true} ).load('/templates/template1/content/common/miniBasket/basket.cfm', {evalScripts:false} );
	}catch(e){}
	try{
	$('miniBasketLeftColumn').set('load', {noCache:true} ).load('/templates/template1/content/common/miniBasketLeft.cfm', {evalScripts:false} );
	}catch(e){}

	try{
	if(!window.smoothScroll) window.smoothScroll = new Fx.Scroll(window, {wheelStops:true, onComplete:function(){if(window.miniBasketTransition) window.miniBasketTransition.showSubmenu();} });
	window.smoothScroll.toTop();
	}catch(e){}
	
	onAddProduct( response );	
}


function changeOption (productId, sku, smallImage, largeImage){
 if(largeImage.length > 0){
  Eset('mainImage'+productId, 'src', largeImage);
  $('mainImageLink'+productId).href = largeImage;
  Shadowbox.setup( $('mainImageLink'+productId), { handleOversize: "drag", displayNav:false } );
 }
}
