function addEvent() {
  var ni = document.getElementById('myDiv');
  var numi = document.getElementById('theValue');
  var num = (document.getElementById("theValue").value -1)+ 2;
  numi.value = num;
  var divIdName = "my"+num+"Div";
  var newdiv = document.createElement('div');
  
  // variables for the new form fields, each individual for sake of readability
  var divL = "<div class='l'>";
  var divR = "<div class='r'>";
  var closeDiv = "</div>";
  
  var newLabel = "<p><label class='required'>";
  var nonLabel = "<p><label>";
  
  var closeLabel = "</label></p>";
  
  var newTitle = "<input type='text' name='title[]' />";
  
  var newLocation = "<input type='text' name='location[]' />";
  
  var newAddress = "<input type='text' name='address[]' />";
  
  var newStartTime = "<input type='text' name='s_time[]' />";
  
  var newEndTime = "<input type='text' name='e_time[]' />";
  
  var newStartDate = "<input type='text' name='s_date[]' />";
  
  var newEndDate = "<input type='text' name='e_date[]' />";
  
  var newWebLink = "<input type='text' name='web[]' />";
  
  var newContact = "<input type='text' name='contact[]' />";
  
  var newBreak = "<div class='space'></div>";
  
  var newNotes = "<textarea name='notes[]' id='notes' cols='45' rows='5'></textarea>";
  
  var newType = "<select name='type[]'><option value='Art/Culture'>Art/Culture</option><option value='Dance'>Dance</option><option value='Education'>Education</option><option value='Festival/Fair'>Festival/Fair</option><option value='Food'>Food</option><option value='General'>General</option><option value='Government/Politics'>Government/Politics</option><option value='Kids'>Kids</option><option value='Meetings/Conventions'>Meetings/Conventions</option><option value='Music/Concerts'>Music/Concerts</option><option value='Recreation'>Recreation</option><option value='Religion'>Religion</option><option value='Shopping'>Shopping</option><option value='Special Event'>Special Event</option><option value='Sports'>Sports</option><option value='Theater/Film'>Theater/Film</option></select>";
  
  // string all this crap together now
  var newFields = divL+newLabel+"Event Title<br />"+newTitle+closeLabel+newLabel+"Event Location<br />"+newLocation+closeLabel+newLabel+"Event Location Address<br />"+newAddress+closeLabel+newLabel+"Start Date (MM/DD/YYYY)<br />"+newStartDate+closeLabel+newLabel+"End Date (MM/DD/YYYY)<br />"+newEndDate+closeLabel+closeDiv+divR+newLabel+"Start Time<br />"+newStartTime+closeLabel+newLabel+"End Time<br />"+newEndTime+closeLabel+nonLabel+"Web Link<br />"+newWebLink+closeLabel+newLabel+"Contact e-mail or phone<br />"+newContact+closeLabel+newLabel+"Choose your event type<br />"+newType+closeLabel+closeDiv+newBreak+newLabel+"Additional Notes<br />"+newNotes;
  // end form variables
  
  newdiv.setAttribute("id",divIdName);
  newdiv.innerHTML = newFields+"<p class='add'><a href='javascript:;' onclick='addEvent()'>Add another event.</a></p><p class='remove'><a href=\"javascript:;\" onclick=\"removeElement(\'"+divIdName+"\')\">Remove Previous Entry</a></p><div class='lineBreak'></div>";
  ni.appendChild(newdiv);
}
 
function removeElement(divNum) {
  var d = document.getElementById('myDiv');
  var olddiv = document.getElementById(divNum);
  d.removeChild(olddiv);
}