var arrInput = new Array(0);
  var arrInputValue = new Array(0);

function addInput() {
  arrInput.push(arrInput.length);
  arrInputValue.push("");
  display();
}

function display() {
  document.getElementById('album_tracks').innerHTML="";
  for (intI=0;intI<arrInput.length;intI++) {
    document.getElementById('album_tracks').innerHTML+=createInput(arrInput[intI], arrInputValue[intI]);
  }
}

function saveValue(intId,strValue) {
  arrInputValue[intId]=strValue;
}  

function createInput(id,value) {
  return (id+1) +".<input type='text' class='inputs' style='width: 250px;' name='track_"+ (id+1) +"' id='track "+ (id+1) +"' onChange='javascript:saveValue("+ (id+1) +",this.value)'> Track length: <input class='inputs' style='width: 30px;' maxlength='2' name='track_length_minutes_"+ (id+1) +"' type='text' id='track "+ (id+1) +"' onChange='javascript:saveValue("+ (id+1) +",this.value)'>:<input class='inputs' style='width: 30px;' maxlength='2' name='track_length_seconds_"+ (id+1) +"' type='text' id='track "+ (id+1) +"' onChange='javascript:saveValue("+ (id+1) +",this.value)'> Sample starts at: <input class='inputs' style='width: 30px;' maxlength='2' name='sound_clip_minutes_"+ (id+1) +"' type='text' id='track "+ (id+1) +"' onChange='javascript:saveValue("+ (id+1) +",this.value)'>:<input class='inputs' style='width: 30px;' maxlength='2' name='sound_clip_seconds_"+ (id+1) +"' type='text' id='track "+ (id+1) +"' onChange='javascript:saveValue("+ (id+1) +",this.value)'><br>";
}

function deleteInput() {
  if (arrInput.length > 0) { 
     arrInput.pop(); 
     arrInputValue.pop();
  }
  display(); 
}