function writeBrowserSpecificCSS(path) {
	var browser = navigator.appName;
	var appVer = parseInt(navigator.appVersion);
	var ie = "Microsoft Internet Explorer";
	var ns = "Netscape";
	
	if (navigator.appVersion.indexOf("Macintosh") != -1) {
		isMac = true;
	} else {
		isMac = false;
	}
	
	if (browser == ns && isMac == false) {
		if (appVer > 3) {
			document.write('<link rel="stylesheet" type="text/css" href="' + path + '/ss_nn.css" title="master">');
		}
	} else if (browser == ie && isMac == false) {
		document.write('<link rel="stylesheet" type="text/css" href="' + path + '/ss_ie.css" title="master">');
	} else if (browser == ns && isMac == true) {
		document.write('<link rel="stylesheet" type="text/css" href="' + path + '/ss_nn_mac.css" title="master">');
	} else if (browser == ie && isMac == true) {
		document.write('<link rel="stylesheet" type="text/css" href="' + path + '/ss_ie_mac.css" title="master">');
	}
}

// added November 7, 2001 to open programs in a kiosk
function programQuickView(pid) {
	var windowBars = "directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no";
	var windowOptions = "scrollbars=yes,width=550,height=580,resizeable=yes";
	var windowFeatures = windowBars + ',' + windowOptions;
	var windowURL = "summary.cfm?pid=" + pid;

	var quickViewWin = open(windowURL, 'programQuickView', windowFeatures);

	quickViewWin.document.close();
	quickViewWin.focus();
}


function ShowPopup(url, name, width, height ) {
	popURL = (typeof(url) == "string" && url.length) ? url : "''";
	MyWindowName = (name.length) ? name : "MyPopupWindow";
	MyWidth = (width > 0) ? width : 300;
	MyHeight = (height > 0) ? height : 300;

    if (document.all)
         xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
             xMax = window.outerWidth, yMax = window.outerHeight;
        else
             xMax = 800, yMax=400;
     xOffset = (xMax - MyWidth)/2, yOffset = (yMax - MyHeight)/2;
a = window.open(popURL,MyWindowName,'scrollbars=1,width='+MyWidth+',height='+MyHeight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
}

// added November 5, 2001 to trap user input greater then 2000 chars long
function validateLength(value, limit, formName, elementName) {
	if (value.length > limit) {
		alert("ERROR! You have specified " + value.length + " characters!  You can only specify " + limit + " characters for this field.  Please modify your input.");
		eval("document." + formName + "." + elementName + ".focus();");
		eval("document." + formName + "." + elementName + ".select();");
	} else {
		// do nothing
	}
}

function validateEmailAddress(emailAddress, formField, formName) {
	var regexp  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	if (regexp.test(emailAddress)) {
		return true;
	} else {
		eval("document." + formName + "." + formField + ".focus();");
		eval("document." + formName + "." + formField + ".select();");
		alert("Sorry, you entered an invalid email address.  Please correct the email address.");
		return false;
	}
}

/**
 * Strips hyphens out of phone number and verifies that the phone number is valid.
 *
 * Any phone number in the format:
 *	xxxxxxxxxx, xxx-xxx-xxxx, or (xxx) xxx-xxxx will be valid
 */
 function validatePhoneNumber(phoneNumber, formField, formName) {
 	var regexp = /^(\d{10}|\d{3}-\d{3}-\d{4}|\(\d{3}\) \d{3}-\d{4})$/;
	
	if (regexp.test(phoneNumber) || phoneNumber.length == 0) {
		return true;
	} else {
		eval("document." + formName + "." + formField + ".focus();");
		eval("document." + formName + "." + formField + ".select();");
		alert("Sorry, you entered an invalid phone number: " + phoneNumber + "\r\rPlease use one of the following formats:\r\n\t1. xxxxxxxxxx\r\n\t2. xxx-xxx-xxxx\r\n\t3. (xxx) xxx-xxxx");
		return false;
	}
 }