function pickandclick() {
	var selectbox = document.getElementById("select_quicklinks");
	var selection = selectbox.options[selectbox.selectedIndex].value;
	var newloc = null;
	if (selection=="home") newloc="http://www.odu.edu";
	if (selection=="news") newloc="http://www.odu.edu/news";
	if (selection=="odumag") newloc="http://www.odu.edu/ao/alumni_magazine/summer01/index.html";
	if (selection=="athletics") newloc="http://www.odusports.com/";
	if (selection=="events") newloc="http://www.odu.edu/ao/univevents/";
	if (selection=="sacs") newloc="http://www.odu.edu/al/sacs/sacshome.html";
	if (selection=="admissions") newloc="http://admissions.odu.edu";
	if (selection=="leo") newloc="http://www.leoonline.odu.edu/";
	if (selection=="library") newloc="http://www.lib.odu.edu/";
	if (selection=="acadcontinue") newloc="http://uc.odu.edu/continuance/";
	if (selection=="registrar") newloc="http://www.odu.edu/ao/registrar";
	if (selection=="catalog") newloc="http://www.odu.edu/ao/affairs/about/publications.shtml";
	if (selection=="auxservices") newloc="/ao/auxiliaryservices";
	if (selection=="bookstore") newloc="http://www.odu.bkstr.com/";
	if (selection=="dlbookstore") newloc="http://www.odudlbooks.com";
	if (selection=="finaid") newloc="http://www.odu.edu/af/finaid/";
	if (selection=="oofinance") newloc="http://www.odu.edu/af/finance/";
	if (selection=="occs") newloc="http://occs.odu.edu/index.php";
	if (selection=="techstore") newloc="http://www.odu.edu/af/techstore";
	if (selection=="purchasing") newloc="http://www.odu.edu/af/materiel/";
	if (selection=="convocation") newloc="http://www.constantcenter.com/";
	if (selection=="facmgnt") newloc="http://www.odu.edu/af/facilities";
	if (selection=="parkserv") newloc="http://www.odu.edu/parking";
	if (selection=="police") newloc="http://www.odu.edu/police";
	if (selection=="recsports") newloc="http://studentaffairs.odu.edu/recsports";
	if (selection=="hr") newloc="http://www.odu.edu/ao/humanresources";
	if (selection=="jobs") newloc="http://www.odu.edu/ao/humanresources/recruitment/empoppor.shtml";
	if (selection=="explearn") newloc="http://uc.odu.edu/elt/";
	if (selection=="intprog") newloc="http://www.odu.edu/oduhome/international.shtml";
	if (selection=="weekendcollege") newloc="http://www.odu.edu/weekendcollege";
	if (selection=="forms_dir") newloc="http://forms.odu.edu/";
	if (newloc) setTimeout("location = '" + newloc + " '", 0);
}

$(document).ready(function(){
	if (document.location.hash == "#hist_events") {
		show_tab_events();
	}
	
	if (document.location.hash == "#hist_research") {
		show_tab_research();
	}
	
	if (document.location.hash == "#hist_news") {
		show_tab_news();
	}

	$("#tab_events").click(function () {
		if ($(this).hasClass("active")) {
			return true;
		} else {
			show_tab_events();
			return false;
		}
	});
	$("#tab_research").click(function () {
		if ($(this).hasClass("active")) {
			return true;
		} else {
			show_tab_research();
			return false;
		}
	});
	$("#tab_news").click(function () {
		if ($(this).hasClass("active")) {
			return true;
		} else {
			show_tab_news();
			return false;
		}
	});
});

function show_tab_events() {
	document.location.hash = "#hist_events";
	show_tab_load();
	$.get("events.php", function(data) {
		hide_tab_load();
		
		$("#university_news").hide();
		$("#research_news").hide();
		$("#tab_news").addClass("inactive").removeClass("active");
		$("#tab_research").addClass("inactive").removeClass("active");
		$("#tab_events").addClass("active").removeClass("inactive");
		
		$("#university_events").html(data);
		$("#university_events").show();
	});
}

function show_tab_research() {
	document.location.hash = "#hist_research";
	show_tab_load();
	$.get("research.php", function(data) {
		hide_tab_load();
		
		$("#university_news").hide();
		$("#university_events").hide();
		$("#tab_news").addClass("inactive").removeClass("active");
		$("#tab_events").addClass("inactive").removeClass("active");
		$("#tab_research").addClass("active").removeClass("inactive");
		
		$("#research_news").html(data);
		$("#research_news").show();
	});
}

function show_tab_news() {
	document.location.hash = "#hist_news";
	show_tab_load();
	$.get("news.inc", function(data) {
		hide_tab_load();
		
		$("#research_news").hide();
		$("#university_events").hide();
		$("#tab_research").addClass("inactive").removeClass("active");
		$("#tab_events").addClass("inactive").removeClass("active");
		$("#tab_news").addClass("active").removeClass("inactive");
		$("#university_news").html(data);
		$("#university_news").show();
	});
}

function show_tab_load() {
	$("#news_events_tabs").addClass("loading");
}

function hide_tab_load() {
	$("#news_events_tabs").removeClass("loading");
}
