window.dcs = {
//treat the divs with class boxer like a link
bindBoxers: function() {
	$(".boxer").click(function() {
		window.location.href = $(this).find("h3 a").attr("href");
	});
},
//treat the submenu divs like a link
bindSubMenu: function() {
	$("#submenu div").click(function() {
		var id = $(this).attr("id");
		id = id.replace("submenu_","");
		var location = window.location.href.split("athletics.html")[0];
		location += "athletics/" + id + ".html";
		window.location.href = location;
	})	
},
//start everything
init: function() {
	dcs.searchFocus();		
	dcs.bindBoxers();
	dcs.bindSubMenu();
},
//check whether to restore "Search" text when the search bar is unfocused.
searchFocus: function() {
	var store = dcs.store.searchFocus = {};
	store.originalText = "Search";
	$("#tn-search form input").val(store.originalText).focus(function(e) {
		var $this = $(this);
		if($this.val() == store.originalText) {
			$this.val("");		
		} else {
			this.select();
			$this.mouseup(function() {
				return false;					   
			})
		}
	}).blur(function() {
		var $this = $(this);
		if($this.val() == "") {
			$this.val(store.originalText);		
		}
	});
},
//just some data
store: {}

};
//do everything
$(function() {
	dcs.init();
})
