$(function(){
	// external links
	$("a[rel*=external]").click(function(){
		window.open($(this).attr("href"));
		return false;
	});
	
	// hidden elements
	$(".hidden").hide();
	
	// autopopulate inputs
	$("input.search").populate();
	
	// subnav
	$("#nav li").hover(function(){
		$(this).children("ul").css("left", "0")
	}, function(){
		$(this).children("ul").css("left", "-9999em");
	});
	
	// calendar date pickers
	$('#from,#from2').datepicker({
		dateFormat: 'mm/dd/yy',
		showOn: 'button', 
		buttonImage: '/wp-content/themes/info_2009/images/icon_calendar.png', 
		buttonImageOnly: true
	});
	$('#to,#to2').datepicker({
		dateFormat: 'mm/dd/yy',
		showOn: 'button', 
		buttonImage: '/wp-content/themes/info_2009/images/icon_calendar.png', 
		buttonImageOnly: true
	});
	var today = new Date();
	var today_str = '';
	if ( today.getMonth() + 1 < 10 ) today_str += '0';
	today_str += (today.getMonth() + 1) + '/';
	if ( today.getDate() < 10 ) today_str += '0';
	// date must be updated each year; was returning 108 from getYear()
	today_str += today.getDate() + '/2009';
	$('#datefrom').val(today_str);
	
});