function changeView(a,b){oldClass=a.className;a.removeClassName(oldClass);a.addClassName(b)}function emptyCart(){var a=document.getElementsByClassName("inCart");var b="";if(ballonhtml.length>0)var b=" and all available benefits";if(a.length>0&&confirm("Are you sure you want to remove all the items from the basket"+b+"?")){if(hb1){$("cartCredits").hide();hb1.hide()}ballonhtml=null;showmeonce=false;loadCart("removeAll=true",refreshCart)}}function checkout(){window.location=storeLocation+"cart.php?act=cart"}function loadCart(a,b){new Ajax.Request(storeLocation+"axyzCart.php?hideTooltip=y",{method:"get",parameters:a,onSuccess:b,onFailure:function(){alert("Something went wrong...")}})}function updateCreditos(a){if(a!=null){ballonhtml=a.responseText}if(ballonhtml.length>0){$("cartCredits").show();if(showmeonce!=true){hb1.show();showmeonce=true}}else{$("cartCredits").hide();hb1.hide()}}function refreshCart(a){var b=null;if(a!=null){b=a.responseText}if(b!=null){$("cartContainer").update(b)}var c=document.getElementsByClassName("inCart");ballonhtml="";new Ajax.Request(storeLocation+"showBenefits.php",{method:"get",onSuccess:updateCreditos,onFailure:function(){alert("Something went wrong...")}});updateInCartModels(c.length);updateTotalPrice()}function updateTotalPrice(){new Ajax.Updater("totalPrice",storeLocation+"axyzTotalPrice.php",{method:"get"})}function updateInCartModels(a){$("modelsInCart").innerHTML="Items: "+a}function addProduct(a){var b="hideTooltip=y&add[]="+a;var c=$("productLicense");if(c!=null){b=b+"&productOptions[]="+Form.Element.getValue(c)}new Ajax.Request(storeLocation+"axyzCart.php",{method:"get",parameters:b,onSuccess:refreshCart,onFailure:function(){alert("Something went wrong...")}})}function initCart(){updateTotalPrice();loadCart(null,refreshCart);hb1=new HelpBalloon({title:"AVAILABLE BENEFITS:",dataURL:storeLocation+"showBenefits.php",cacheRemoteContent:false,icon:$("cartCredits"),fixedPosition:HelpBalloon.POS_TOP_RIGHT,useEvent:["mouseover"]})}var storeLocation=window.location.protocol+"//"+window.location.hostname+"/cart/";var selectedProducts=new Array;var products=null;var ballonhtml=null;var showmeonce=false;var hb1=null
