function arrival_update(){

	var arrive = document.getElementById('arrive');
	arrive.options.length = 0;
	arrive.options[arrive.options.length] = new Option('Please Select','');

	// get month length from selected month list
	// get duration from selected list
	
	var selected_month = document.getElementById('month').options[document.getElementById('month').selectedIndex].value;
	var duration = document.getElementById('duration').options[document.getElementById('duration').selectedIndex].value;
	
	var cur_year = selected_month.substring(0,4);
	var cur_month = selected_month.substring(5,7);
	
	if (cur_month.substring(0,1)==0) cur_month=cur_month.substring(1,2);
	
	var months = new Array();
	var month_lengths = new Array();
	
	months[1] = "Jan";
	months[2] = "Feb";
	months[3] = "Mar";
	months[4] = "Apr";
	months[5] = "May";
	months[6] = "Jun";
	months[7] = "Jul";
	months[8] = "Aug";
	months[9] = "Sep";
	months[10] = "Oct";
	months[11] = "Nov";
	months[12] = "Dec";

	month_lengths[1] = 31;
	month_lengths[2] = 28;
	month_lengths[3] = 31;
	month_lengths[4] = 30;
	month_lengths[5] = 31;
	month_lengths[6] = 30;
	month_lengths[7] = 31;
	month_lengths[8] = 31;
	month_lengths[9] = 30;
	month_lengths[10] = 31;
	month_lengths[11] = 30;
	month_lengths[12] = 31;
	
	if (((cur_year % 4 == 0) && (cur_year % 100 != 0)) || (cur_year % 400 == 0)) month_lengths[2] = 29;
	
	var days_in_month = month_lengths[cur_month];
	today = new Date;
	for (i=1;i<=days_in_month; i++){
		day = new Date
		day.setMonth(cur_month-1);
		day.setFullYear(cur_year);
		day.setDate(i);
		
		if (i==1 || i==21 || i==31){
			suffix = "st";
		} else if(i==2 || i==22){
			suffix = "nd";
		} else if(i==3 || i==23){
			suffix = "rd";
		} else{
			suffix = "th";
		}
		
		if (day>today && day.getDay()==1 && (duration==7 || duration==4)){
			// mon
			value = "Mon "+i+suffix+" "+months[cur_month]+" "+cur_year.substring(2,4);
			key = cur_year+"-"+cur_month+"-"+i;
			arrive.options[arrive.options.length] = new Option(value,key);
		}
		
		if (day>today && day.getDay()==5 && (duration==7 || duration==3)){
			// mon
			value = "Fri "+i+suffix+" "+months[cur_month]+" "+cur_year.substring(2,4);
			key = cur_year+"-"+cur_month+"-"+i;
			arrive.options[arrive.options.length] = new Option(value,key);
		}		
	}


	//	var obj = document.getElementById('dhtmlgoodies_model');
	//	arrive.options[arrive.options.length] = new Option('Select Above','');

}

