(function($) {
$(document).ready(function() {
$("#autorenewsubesub").click(function() {
    // this function will get executed every time the #autorenew element is clicked (or tab-spacebar changed)
    if($(this).is(":checked")) // "this" refers to the element that fired the event
    {
	var arenew = '_auto_renew?destination=cart';
	$('.subesub a.cartlink').attr('href', function(index, attr) {
	return attr.split('?', 1)[0] + arenew; //with the original link, grab everything before the ?
	}); 
    }
    else
    {
	var aorig = '?destination=cart';
        $('.subesub a.cartlink').attr('href', function(index, attr) {
        return attr.split('_auto', 1)[0] + aorig; //with the modified link, grab everything before _auto 
        });
    }
});
});
}(jQuery));
(function($) {
$(document).ready(function() {
$("#autorenewsubcombo").click(function() {
    // this function will get executed every time the #autorenew element is clicked (or tab-spacebar changed)
    if($(this).is(":checked")) // "this" refers to the element that fired the event
    {
        var arenew = '_auto_renew?destination=cart';
        $('.subcombo a.cartlink').attr('href', function(index, attr) {
        return attr.split('?', 1)[0] + arenew; //with the original link, grab everything before the ?
        });
    }
    else
    {
        var aorig = '?destination=cart';
        $('.subcombo a.cartlink').attr('href', function(index, attr) {
        return attr.split('_auto', 1)[0] + aorig; //with the modified link, grab everything before _auto
        });
    }
});
});
}(jQuery));
(function($) {
$(document).ready(function() {
$("#autorenewsubmail").click(function() {
    // this function will get executed every time the #autorenew element is clicked (or tab-spacebar changed)
    if($(this).is(":checked")) // "this" refers to the element that fired the event
    {
        var arenew = '_auto_renew?destination=cart';
        $('.submail a.cartlink').attr('href', function(index, attr) {
        return attr.split('?', 1)[0] + arenew; //with the original link, grab everything before the ?
        });
    }
    else
    {
        var aorig = '?destination=cart';
        $('.submail a.cartlink').attr('href', function(index, attr) {
        return attr.split('_auto', 1)[0] + aorig; //with the modified link, grab everything before _auto 
        });
    }
});
});
}(jQuery));

;

