function highlightSelectedArtists(){
    var selectedList = document.getElementById("artists-selected[]");
    
    for(i=0; i<selectedList.length; i++){
        selectedList[i].selected=true;
    }

}

function copy_billing_address_to_shipping(checkbox_name){
    var field_names = new Array('first_name','last_name','address1','address2','city','state','zip','country','phone');

    if(checkbox_ref= document.getElementById(checkbox_name)){
        if(! checkbox_ref.checked){
           return false;
       }
    }

    for(i = 0; i < field_names.length; i++){
        if(ship_ref = document.getElementById('ship_' + field_names[i])){
            if(bill_ref = document.getElementById(field_names[i])){
                bill_ref.value = ship_ref.value;
            }
        }
    }
}

function toggle_state_visibility(country_field_name, state_field_name){
    country_ref = document.getElementById(country_field_name);
    state_ref = document.getElementById(state_field_name);
    
    if((country_ref) && (state_ref)){
        if((country_ref.value == 'US') || (country_ref.value == 'CA')){
            state_ref.style.visibility = "visible";
        }
        else{
            state_ref.value = '';
            state_ref.style.visibility = "hidden";
        }
    }
}
