monthDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31)

function populateDays(monthChosen){		//creates new variable called monthChosen from result from the month drop down list?
	monthStr = monthChosen.options[monthChosen.selectedIndex].value //month STRING = the value of the selected index ex: 4 for May
	if (monthStr !="") { 				// if something was actually chosen then...
		theMonth=parseInt(monthStr)		//The choice again -> but makes sure it's keeping just the number, not a string
		
		document.add_affiliate.days.options.length = 0	//clears the options menu
		for (i=0;i<monthDays[theMonth];i++){	// Monthdays is the array holding the max days in the month
			document.add_affiliate.days.options[i] = new Option(i+1) //new Option() must be a system function that adds another option with what's in ()... I imaging you could use strings ("day"+i) for example
			}
		}
	}

function fill_address()
{
  if (document.add_affiliate.use_physical.checked === true )
  {
   document.add_affiliate.address1.value = document.add_affiliate.address_physical.value;
   document.add_affiliate.address2.value = document.add_affiliate.physical_city.value;
   
   for(x=0;x<document.add_affiliate.address3.length;x++)
   {
	if(document.add_affiliate.address3.options[x].value==document.add_affiliate.physical_state.value){
		   document.add_affiliate.address3.options[x].selected = true;
		   break;
	}
   }
   
   document.add_affiliate.postcode.value = document.add_affiliate.physical_zip.value; 
  }
  else
  { 
   document.add_affiliate.address1.value = ""; 
   document.add_affiliate.address2.value = "";
   document.add_affiliate.address3.options[0] = new Option("");  
   document.add_affiliate.address3.options[0].value = "";
   document.add_affiliate.address3.options[0].selected = true; 
   document.add_affiliate.postcode.value = "";  
  } 
}

/*
function fill_address()
{
  if (document.add_affiliate.use_physical.checked === true )
  {
   document.add_affiliate.address1.value = document.add_affiliate.address_physical.value;
   document.add_affiliate.address2.value = document.add_affiliate.physical_city.value;
   document.add_affiliate.address3.options[0]=new Option(document.add_affiliate.physical_state.value);
   document.add_affiliate.address3.options[0].value = document.add_affiliate.physical_state.value;
   document.add_affiliate.address3.options[0].selected = true;
   document.add_affiliate.postcode.value = document.add_affiliate.physical_zip.value; 
  }
  else
  { 
   document.add_affiliate.address1.value = ""; 
   document.add_affiliate.address2.value = "";
   document.add_affiliate.address3.options[0] = new Option("");  
   document.add_affiliate.address3.options[0].value = "";
   document.add_affiliate.address3.options[0].selected = true; 
   document.add_affiliate.postcode.value = "";  
  } 
}
*/