// JavaScript Document
//Load up jQuery
//code for Cavalier Nation by JAMES BALDYS
//Copyright (c) 2008 University of Virginia. All Rights Reserved.
$(document).ready(function() {
	preload_all_buttons();
	make_hovers();
});
function preload_all_buttons() {
	/* PRELOAD LEFT COLUMN BUTTONS */
	left_pic1= new Image(347,93); 
	left_pic1.src="http://www.virginiasports.com/fls/17800/travel/images/travelButton_air_b.jpg"; 
	left_pic2= new Image(347,93); 
	left_pic2.src="http://www.virginiasports.com/fls/17800/travel/images/travelButton_car_b.jpg"; 
	left_pic3= new Image(347,93); 
	left_pic3.src="http://www.virginiasports.com/fls/17800/travel/images/travelButton_rail_b.jpg";  
}
function make_hovers() {
	/* I chose to split the columns, rather than do a .parent() to figure out what column it was in
		 -> Needed to split the columns due to naming conventions of the images */
	/* Left Column */
	jQuery("#leftCol a img").hover(function(){
		var img_id = jQuery(this).attr("id");
		if (img_id.length > 0) {
			jQuery(this).attr("src","http://www.virginiasports.com/fls/17800/travel/images/"+img_id+"b.jpg");
		} 
	},function(){
		var img_id = jQuery(this).attr("id");
		if (img_id.length > 0) {
			jQuery(this).attr("src","http://www.virginiasports.com/fls/17800/travel/images/"+img_id+"a.jpg");
		} 
	});
}