/*























































*/
window.intPrevious = setInterval(function(){
	if(typeof MSPL_QC != 'undefined' && document.body){
		if(typeof mspl_cartDivClass == 'undefined'){
			 mspl_cartDivClass =
				MSPL_QC.theme == 'blank' ?
					'.block-cart' :
					'.mini-cart';

			if(!$$(mspl_cartDivClass).length || !$$(mspl_cartDivClass)[0].tagName){
				 mspl_cartDivClass =  '.block-cart'
			}
		}
		if(typeof mspl_topLinkCartClass == 'undefined'){
			 mspl_topLinkCartClass = '.top-link-cart';
		}
		if(typeof mspl_addToCartButtonClass == 'undefined'){
			 mspl_addToCartButtonClass = '.form-button';
		}
		if(typeof mspl_bigCartClass == 'undefined'){
			 mspl_bigCartClass =
				MSPL_QC.theme == 'modern' ?
					'.layout-1column':
					'.col-main';
		}
        if(typeof mspl_wishlistClass == 'undefined'){
			 mspl_wishlistClass = '.my-wishlist';
		}

        if(typeof mspl_topWishlistLinkCartClass == 'undefined'){
            mspl_topWishlistLinkCartClass = '.top-link-wishlist';
        }

		if (window.location.toString().search('/product_compare/') != -1){
			win = window.opener;
		}
		else{
			win = window;
		}
		clearInterval(intPrevious)
	}
}, 500);

function quickcartdelete(url){
	showProgressAnimation();
	url = getCommonUrl(url)


    new Ajax.Request(url, {
          onSuccess: function(resp){
				try{
					if (typeof(resp.responseText) == 'string') eval('resp = ' + resp.responseText);
				}catch(e){

					return;
				}
				hideProgressAnimation();
                __onQCRender()
                updateCartView(resp, '');
			}
        });


}

function updateCartView(resp){
	if (MSPL_QC.isCartPage) return updateBigCartView(resp);

	var __cartObj = $$(mspl_cartDivClass)[0];

	if(!__cartObj) return false;


	if (typeof(__cartObj.length) == 'number') __cartObj = __cartObj[0];
	var oldHeight = __cartObj.offsetHeight;

	var tmpDiv = win.document.createElement('div');
	tmpDiv.innerHTML = resp.cart;

	var tmpParent = __cartObj.parentNode;
	tmpParent.replaceChild(tmpDiv.firstChild, __cartObj);


	var __cartObj = $$(mspl_cartDivClass)[0];
	var newHeight = __cartObj.offsetHeight;

    addEffectQC(__cartObj, mspl_quickcart_cartanim);
	updateDeleteLinks();
	updateTopLinks(resp);
}

function updateWishlist(resp)
{
	var wishlistObj = $$(mspl_wishlistClass)[0];

    if(wishlistObj){
        var tmpDiv = win.document.createElement('div');
        tmpDiv.innerHTML = resp.wishlist;

        var tmpParent = wishlistObj.parentNode;
        tmpParent.replaceChild(tmpDiv.firstChild, wishlistObj);
    }
}


