function openPopup(b,c,a,d){features="toolbar=no,menubar=no,location=no,"+(d?"scrollbars=yes,":"")+"resizable=yes,width="+c+",height="+a+"";window.open(b,"",features)}function openHelpPopup(a){openPopup(a,400,500,true)}function openHelpPopupContext(a){openHelpPopup(a)}function setCardLinkState(a,b){$("a.buttonCart").each(function(c,d){if($(d).attr("id")==a){if(b){$(d).addClass("in-cart").text("In Cart")}else{$(d).removeClass("in-cart").text("Add to Cart")}}})}$(document).ready(function(){$("a.buttonCart").click(function(d){d.stopPropagation();var b=$(this).attr("id");var a=$(this).hasClass("is-read-page");var c=$(this);$.ajax({type:"POST",url:"/process-cart.php",cache:false,data:{id:b,action:"add"},dataType:"json",error:function(e,g,f){alert(g)},success:function(e,f){if(e.is_error){alert(e.error);if(e.in_cart){setCardLinkState(b,true)}}else{if(!a){$("#cart-content").html(e.content);setCardLinkState(b,true)}else{setCardLinkState(b,true)}}}})});$("a.internal-help").click(function(){var b=$(this).attr("id");var a=b.substr(10,b.length-10);if($("#"+a).is(":visible")){$("#"+a).hide()}else{$("#"+a).show()}return false})});function deleteFromCart(b){var a=$(b).attr("id");$.ajax({type:"POST",url:"/process-cart.php",cache:false,data:{item_id:a,action:"remove"},dataType:"json",error:function(c,e,d){alert(e)},success:function(c,d){if(c.is_error){alert(c.error)}else{$("#cart-content").html(c.content);setCardLinkState(c.id,false)}}})};
