function cartHider() {
    changebutton=function(n){
        t=n.split("cart_update_");
        document.getElementById("update_button_"+t[1]).setAttribute("class", "showthis");
    }
    // turn off all the update buttons
    var myA = document.getElementsByTagName('input');
    // loop through them all
    for (var i=0;i<myA.length;i++) {
        var theid=myA[i].getAttribute("id");
        if(theid){
            var thenumber=theid.split("cart_update_");
            if(thenumber[1]!=undefined){
                targetthis=thenumber[1];
                document.getElementById("update_button_"+targetthis).setAttribute("class", "hidethis");
                document.getElementById("cart_update_"+targetthis).onchange=function(){
                    changebutton(this.id);
                }
            }
        }
    }
}

function initJumpMenus() {
    // Turns all <select> elements with the 'jumpmenu' class into jump menus
    var selectElements = document.getElementsByTagName("select");
    for( i = 0; i < selectElements.length; i++ ) {
        // Check for the class and make sure the element has an ID
        if( selectElements[i].className == "jumpmenu" && document.getElementById(selectElements[i].id) != "" ) {
            jumpmenu = document.getElementById(selectElements[i].id);
            jumpmenu.onchange = function() {
                if( this.options[this.selectedIndex].value != '' ) {
                    // Redirect
                    location.href=this.options[this.selectedIndex].value;
                }
            }
        }
    }
}

window.onload = function() {
    initJumpMenus();
    cartHider();
}