// -------------------------------------------------------------------- function add_vo( vo_type, player_no ) { // get the vehicles/ordnance already added var $sortable2 = $( "#ob_" + vo_type + "-sortable_" + player_no ) ; var vo_present = []; $sortable2.children("li").each( function() { var vo_entry = $(this).data( "sortable2-data" ).vo_entry ; vo_present.push( vo_entry.id ) ; } ) ; // load the available vehicles/ordnance var nat = $( "select[name='PLAYER_" + player_no + "']" ).val() ; var entries = gVehicleOrdnanceListings[vo_type][nat] ; if ( entries === undefined ) { showErrorMsg( "There are no " + get_nationality_display_name(nat) + " " + vo_type + " listings." ) ; return ; } var buf = [] ; for ( var i=0 ; i < entries.length ; ++i ) { if ( vo_present.indexOf( entries[i].id ) !== -1 ) continue ; buf.push( "" ) ; } function format_vo_entry( opt ) { if ( ! opt.id ) return opt.text ; var vo_entry = entries[opt.id] ; var div_class = "vo-entry" ; if ( is_small_vasl_piece( vo_entry ) ) div_class += " small-piece" ; var buf2 = [ "