// JavaScript Document
/**
* -------------------------------------------------------------------------------
* Assign functions to the buttons when the DOM is ready
*/
$(document).ready(function(){
		// hover states for home page ICS images
		$("#tos,#home").hover(
			function() {
				$(this).addClass("navHover");
			},
			function() {
				$(this).removeClass("navHover");
			}
		);

		// hover states for left nav links
		$("#about_link,#patient_link").hover(
			function() {
				$(this).css("background-color", "#2d28ce");
			},
			function() {
				$(this).css("background-color", "#333092");
			}											   
		);
		$("#qualify_link").hover(
			function() {
				$(this).css("background-color", "#ffc999");
			},
			function() {
				$(this).css("background-color", "#ff7901");
			}											   
		);
		// set the left nav link location
		$("#about_link,#patient_link,#qualify_link").click(
	        function() { location = $(this).children("a").attr("href"); }
	    );
		
		// override the table width that is retrieved via JS on the Qualification page
		$(".em_navbar").each(function(i) {
			if (this.width == "600") {
				this.width = "570";
				$(".dataTable").css("width", "590px");
			}
		});	

});

/**
* -------------------------------------------------------------------------------
* opens new window on patient resource links
*/
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=600,left=200,top=50');");
}