//PAGE RELOAD - NN4 Fix
function MM_reloadPage(init)
{
	if(init==true) with (navigator)
	{	if ((appName=="Netscape")&&(parseInt(appVersion)==4))
		{	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }
	}
	else if(innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
	{	location.reload();	}
}
MM_reloadPage(true);
// SWAP IMAGE
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//CURRENT YEAR
function currentYear() {
	var today=new Date();
	var year=today.getYear();
	year=((year<1000)?(year+1900):year);
	document.write(year);
return 1;
}
// JUMP MENU
function jumpMenu(objSelect,varDead)
{	var selection=objSelect.options[objSelect.selectedIndex].value;
	if(selection!=varDead)
	{	document.location=selection;	}
}
function WMU_jumpMenu(objSelect,varDead)
{	var selection=objSelect.options[objSelect.selectedIndex].value;
	if(selection!=varDead)
	{	document.location=selection;	}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
////////////////////////////////////////////////////////////////////////////////
// Open Source: JavaScript Library: Safe Mail
// Author(s):   FakeTP: faker@faketp.com, http://www.faketp.com/safemail/
//              Michael Stilson Jr. - Western Michigan University
//
// Created:     20040123
// Modifications:
// +===============================================================+
//  200XXXXX   <function_name> INSERTED|DELETED|UPDATED
//  ---------------------------------------------------------------
//  <description>
// +===============================================================+
//
// The original code acquired from FakeTP:
//
// function safemail(name,domain,display) {
//     displayed=(typeof(display)=="undefined") ? name+"@"+domain : display
//     document.write('<a href=mailto:'+name+'@'+domain+'>'+displayed+'</a>');
// }
//
// Example of usage:
// 
// 1) You must include this file into HTML file. Within the head of your 
//    page, place the following line of code if you are on the WMU WWW server:
// <head>
// <script src="/javascript/os/safemail.js" type="text/javascript"></script>
// </head>
// OR, if you are on another server:
// <head>
// <script src="http://www.wmich.edu/javascript/os/safemail.js" type="text/javascript"></script>
// </head>
// 
// 2) Add links to your page in a manner similar to the following example:
// <script type="text/javascript">
//     safemail("username","domain.com","Link Text");
// </script>
//
// NOTE: Replace "username" with the part of the email address that is before 
// the at sign (@), replace "domain" with the part of the email address that is
// after the at sign and you may optionally replace "anchor" with what you want 
// the link to say. If "anchor" is not specified, then the full email address 
// will become the text written in the anchor tag.
//

// Global Variables
var gBLANK="";
var gHTML_A_CLOSE="</a>";
var gHTML_GREATER="&gt;";
var gHTML_LESSER="&lt;";
var gHTML_A_HREF0="<a href=\"mailto:";
var gHTML_A_HREF1="\">";
var gSTR_AT="@";
var gSTR_GREATER=">";
var gSTR_LESSER="<";
var gSTR_SUBJECT="?subject=";
var gSTR_SPACE=" ";
var gSTR_UNDEF="undefined";
var gTYPE_BOOLEAN="boolean";
var gTYPE_STRING="string";

////////////////////////////////////////////////////////////////////
// Function: safemail(string,string,string,string,boolean)
// Purpose:  To provide a way to have email links in web pages that 
// cannot be parsed and acquired by current (as of 01/2004) methods 
// used by "rouge" www bots.
//
// Args In:  username, domain, subject, anchor (optional) and markup (optional)
// Pre:      username: a string that defines a valid email address username. 
//           domain:   a string that defines a valid email address domain
//           anchor:   a (n optional) string that defines the anchor text
//           markup:   a (n optional) boolean that flags a markup
//
// Args Out: none
// Post:     An HTML anchor is created from the passed args and written to the 
//           document.
//
function safemail(username,domain,subject,anchor,markup) {
	if(arguments.length<3) return 0;
	// Verify the first three arguments are strings
	if(arguments.length==3) {
		for(var i=0;i<3;i++) {
			if((typeof arguments[i])!=gTYPE_STRING) return 0;
		}
	}
	var isAnchor=true;
	var isMarkup=false;
	// Determine the optional arguments passed
	if(arguments.length>3) {
		for(var i=3;i<arguments.length;i++) {
			var argType=typeof arguments[i];
			if(argType==gTYPE_BOOLEAN) {
				// This argument is "markup"
				if(i==3) {
					// There is no "anchor" argument
					anchor=null;
				}
				isMarkup=true;
			}
		}
	}
	// If "anchor" has not been defined, then set it to the "href"
	if((typeof(anchor)==gSTR_UNDEF)||(anchor==null)) {
		var anchor=username+gSTR_AT+domain;
		isAnchor=false;
	}
	// Assemble the email address pieces
	var href=username+gSTR_AT+domain;
	// Build the anchor string
	if(isAnchor) {
		// Build a link in the following format:
		// <a href="mailto:anchor <username@domain>">anchor</a>
		var safeAnchor=
		gHTML_A_HREF0+anchor+gSTR_SPACE+gSTR_LESSER+href+gSTR_GREATER+gSTR_SUBJECT+subject+gHTML_A_HREF1+anchor+gHTML_A_CLOSE;
	} else {
		// Build a link in the following format:
		// <a href="mailto:username@domain">username@domain</a>
		var safeAnchor=
		gHTML_A_HREF0+href+gSTR_SUBJECT+subject+gHTML_A_HREF1+anchor+gHTML_A_CLOSE;
	}
	// If "markup", add the standard WMU email boundaries
	// <Email Link>
	if(isMarkup) safeAnchor=gHTML_LESSER+safeAnchor+gHTML_GREATER;
	// Write the anchor string to the "document"
	document.write(safeAnchor);
return 1;
}

// 
// Copyright 2004 - Western Michigan University - All rights reserved
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
////////////////////////////////////////////////////////////////////////////////

