// **********************************************************************
// Javascript Library File - Catholic Campus Ministry
//
// Created By Bart T. McDonough, February 2002
// Copyright (c) 2002 Catholic Campus Ministry, Univ. of West Florida
// **********************************************************************

// ======================================
// GLOBAL (WEBSITE-WIDE) VARIABLES
// ======================================

var isNav // true = Netscape
var isIE  // true = Internet Explorer


// ======================================
// FUNCTION DEFINITIONS
// ======================================

/* Function to get user's browser */
function getBrowser()
{
	if (parseInt(navigator.appVersion) >= 4) {
		if (navigator.appName == "Netscape") {
			isNav = true; // user is using Netscape
		}
		else {
			isIE = true;  // user is using IE
		}
	}
	if (!isNav && !isIE) {
		; // add code here later to handle non-standard browsers...
	}
}

/* Function to highlight links on navigation menu when user
 * passes mouse over them. */
function switchNavStyle( ID, How )
{
	if (isIE) { // only do this for Internet Explorer
		var obj = document.all( ID );
		if ( How == "over" ) { // mouseover behavior
			obj.style.backgroundColor = "#CCCCCC";
			obj.style.borderColor = "#999999";
		}
		else { // mouseout behavior
			obj.style.backgroundColor = "#F1F1F1";
			obj.style.borderColor = "#F1F1F1";
		}
	}
}

/* This function brings up print dialog box on user's screen */
function PrintPage()
{
	if (isIE || isNav)
		window.print();
	else
		alert( 'Sorry, but your computer configuration does not support this feature.' );
	return;
}

/* This function opens up CCM's calendar for user to view */
function OpenCalendar()
{
	if (isIE) {
		window.event.cancelBubble = true;
		window.event.returnValue = null;
	}
	if (isIE || isNav) {
		calendar_window = window.open("WebDocs/Calendar.cfm","winCalendar","resizable,scrollbars,width=680,height=600");
		calendar_window.focus();
	}
	else {
		alert('Sorry, but this feature is not supported for your browser configuration.');
	}
}