//sets default variable values

targeturl	= "http://arestravel.com/";
aresid 		= "513";
city		= "";
section		= "";
subsection	= "";

function write_hotdeals(){
	
	document.write("Hot Deals".link(targeturl+aresid+"/-/hotdeals/"));
	
}

function write_action(theform){
	
	theform.action=targeturl+aresid+'/-/date/simple/city='+city+'/section='+section+'/subsection='+subsection;
		
}

function write_date(){

	todays_date = new Date();
	
	
		
	new_day = todays_date.getDate() + 3;
	todays_date.setDate(new_day);
	
	months = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');

	//sets options in the day drop down
	
	for(i=0;i<31;i++){
	
		j = i + 1;
		option_selected = 0;
		if( todays_date.getDate() == j ){
			option_selected = 1;
		}
		document.hotelquery.elements[1].options[i] = new Option(j,j,"",option_selected);
		
	}
	
	for(i=0;i<12;i++){
	
		new_date = todays_date;
		
		month_num = new String((new_date.getMonth() + 1));
		if(month_num.length == 1){
			month_num = "0" + month_num;
		}
		
		year = String(new_date.getYear());
		if(year.length == 3){
			year = "20" + year.substring(1, 3);
		}
		
		
		
		option_value = year + "-" + month_num;
		option_text = months[new_date.getMonth()] + " " + year;
		document.hotelquery.elements[2].options[i] = new Option(option_text,option_value);
		
		new_month = new_date.getMonth() + 1;
		new_date.setMonth(new_month);
	}
	
	
	//sets options in the number of nights drop down
	
	for(i=0;i<40;i++){
	
		j = i + 1;
		selected_nights = 0;
		if( j == 3 ){
			selected_nights = 1;
		}
		document.hotelquery.elements[3].options[i] = new Option(j,j,"",selected_nights);
		
	}
	
	
	
}

window.onload = write_date