if(document.images) {

//Top Navigation
nav_enEspanol = new Image()
nav_enEspanol.src = "/images/nav_enEspanol.gif"
nav_enEspanol_o = new Image()
nav_enEspanol_o.src = "/images/nav_enEspanol_o.gif"

nav_eventCalendar = new Image()
nav_eventCalendar.src = "/images/nav_eventCalendar.gif"
nav_eventCalendar_o = new Image()
nav_eventCalendar_o.src = "/images/nav_eventCalendar_o.gif"

nav_directory = new Image()
nav_directory.src = "/images/nav_directory.gif"
nav_directory_o = new Image()
nav_directory_o.src = "/images/nav_directory_o.gif"

nav_mapsDirections = new Image()
nav_mapsDirections.src = "/images/nav_mapsDirections.gif"
nav_mapsDirections_o = new Image()
nav_mapsDirections_o.src = "/images/nav_mapsDirections_o.gif"

//New Top Navigation (2009-01-28)
topnav_espanol = new Image()
topnav_espanol.src = "/images/topnav/espanol.gif"
topnav_espanol_o = new Image()
topnav_espanol_o.src = "/images/topnav/espanol_o.gif"

topnav_calendars = new Image()
topnav_calendars.src = "/images/topnav/calendars.gif"
topnav_calendars_o = new Image()
topnav_calendars_o.src = "/images/topnav/calendars_o.gif"

topnav_directory = new Image()
topnav_directory.src = "/images/topnav/directory.gif"
topnav_directory_o = new Image()
topnav_directory_o.src = "/images/topnav/directory_o.gif"

topnav_maps = new Image()
topnav_maps.src = "/images/topnav/maps.gif"
topnav_maps_o = new Image()
topnav_maps_o.src = "/images/topnav/maps_o.gif"

topnav_requestInfo = new Image()
topnav_requestInfo.src = "/images/topnav/requestInfo.gif"
topnav_requestInfo_o = new Image()
topnav_requestInfo_o.src = "/images/topnav/requestInfo_o.gif"

topnav_contactUs = new Image()
topnav_contactUs.src = "/images/topnav/contactUs.gif"
topnav_contactUs_o = new Image()
topnav_contactUs_o.src = "/images/topnav/contactUs_o.gif"

//Main Navigation 
nav_gettingStarted = new Image()
nav_gettingStarted.src = "/images/nav_gettingStarted.gif"
nav_gettingStarted_o = new Image()
nav_gettingStarted_o.src = "/images/nav_gettingStarted_o.gif"

nav_coursesDegrees = new Image()
nav_coursesDegrees.src = "/images/nav_coursesDegrees.gif"
nav_coursesDegrees_o = new Image()
nav_coursesDegrees_o.src = "/images/nav_coursesDegrees_o.gif"

nav_campusesCenters = new Image()
nav_campusesCenters.src = "/images/nav_campusesCenters.gif"
nav_campusesCenters_o = new Image()
nav_campusesCenters_o.src = "/images/nav_campusesCenters_o.gif"

nav_aboutPima = new Image()
nav_aboutPima.src = "/images/nav_aboutPima.gif"
nav_aboutPima_o = new Image()
nav_aboutPima_o.src = "/images/nav_aboutPima_o.gif"

nav_studentResources = new Image()
nav_studentResources.src = "/images/nav_studentResources.gif"
nav_studentResources_o = new Image()
nav_studentResources_o.src = "/images/nav_studentResources_o.gif"

nav_communityServices = new Image()
nav_communityServices.src = "/images/leftnav/nav_communityServices.gif"
nav_communityServices_o = new Image()
nav_communityServices_o.src = "/images/leftnav/nav_communityServices_o.gif"

nav_business = new Image()
nav_business.src = "/images/nav_business.gif"
nav_business_o = new Image()
nav_business_o.src = "/images/nav_business_o.gif"

nav_alumniFriends = new Image()
nav_alumniFriends.src = "/images/nav_alumniFriends.gif"
nav_alumniFriends_o = new Image()
nav_alumniFriends_o.src = "/images/nav_alumniFriends_o.gif"

//Footer Navigation 
nav_sitemap = new Image()
nav_sitemap.src = "/images/nav_sitemap.gif"
nav_sitemap_o = new Image()
nav_sitemap_o.src = "/images/nav_sitemap_o.gif"

nav_glossary = new Image()
nav_glossary.src = "/images/nav_glossary.gif"
nav_glossary_o = new Image()
nav_glossary_o.src = "/images/nav_glossary_o.gif"

nav_requestInfo = new Image()
nav_requestInfo.src = "/images/nav_requestInfo.gif"
nav_requestInfo_o = new Image()
nav_requestInfo_o.src = "/images/nav_requestInfo_o.gif"

nav_pressroom = new Image()
nav_pressroom.src = "/images/nav_pressroom.gif"
nav_pressroom_o = new Image()
nav_pressroom_o.src = "/images/nav_pressroom_o.gif"

nav_legal = new Image()
nav_legal.src = "/images/nav_legal.gif"
nav_legal_o = new Image()
nav_legal_o.src = "/images/nav_legal_o.gif"

nav_contactUs = new Image()
nav_contactUs.src = "/images/nav_contactUs.gif"
nav_contactUs_o = new Image()
nav_contactUs_o.src = "/images/nav_contactUs_o.gif"
}

//Rollover function for navigation:
function rollOver(img1,ref1) {
    if (document.images) {
        document.images[img1].src = eval(ref1 + ".src")
    }
}

// -------------------------------------------------------
// popCourse('ACC', '100');	
// pop course information window for selected course
// discipline codes should be CAPITALIZED
// does not validate that you picked a real course, it just opens the window

function popCourse(disc, num) 
{
	var w = window.open('http://bannerweb.pima.edu/pls/pima/az_tw_subcrse_popup.p_info_window?p_subject_code='+disc+'&p_course_number='+num,'window_course_info','toolbar=no,status=no,scrollbars=yes,menubar=no,resizable=yes,directories=no,location=no,width=800,height=450,top=100,left=300');
	w.focus();
}

// ------------------------------------------------------------
// return validEmail(myForm.emailfield.value)
// returns true if the input looks like a valid email address
// if not, prompts the user to fix it and returns false 

function validEmail(email)
{
	if(email.match(/\S+\@\S+\.\S+/))
	{
		return true;
	}
	else
	{
		alert("The email address you entered is not valid.  Please enter an address in the form:  yourname@example.com");
		return false;
	}	
}

// --------------------------------------------------------------
// <a href="javascript:makemailto(97,64,101,120,97,109,112,108,101,46,99,111,109)">Send mail to us!</a>
// assembles a mailto URL, and sends the user there.
// the numbers are the chr codes for the chars in the email address
// chr code helper at:
//	 http://zephyr.dco.pima.edu/webmaster/chrcode_helper.html

function makemailto()
{
	// use magic 'arguments' var
	var dest = "mailto:";
	for (var i = 0; i < arguments.length; i++)
	{
		dest = dest + String.fromCharCode(arguments[i]);
	} 
	document.location.href=dest;
}

// -------------------------------------------------------------

//flash detection
// looks for version 6 or above

var flashinstalled = 0;
var flashversion = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length)
{
    x = navigator.plugins["Shockwave Flash"];
    if (x)
    {
        flashinstalled = 2;
        if (x.description)
        {
            y = x.description;
            //flashversion = y.charAt(y.indexOf('.')-1);
            //The flash version could be two characters?
	    result = y.match(/lash (\d+)\./);
	    flashversion = result[1];
            if(flashversion < 6)
            { // Set desired flash version here
                flashinstalled = 1;
            }
        }
    }
    else
        flashinstalled = 1;
    if (navigator.plugins["Shockwave Flash 6.0"])
    {
        flashinstalled = 2;
        flashversion = 2;
    }
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
    x = navigator.mimeTypes['application/x-shockwave-flash'];
    if (x && x.enabledPlugin)
        flashinstalled = 2;
    else
        flashinstalled = 1;
}
else
    MSDetect = "true";

// -----------------------------------------------------------------
// -----------------------------------------------------------------

//--------------------------------------
// openMe()
// Creates a popup window based on URL specification 
// passed as parameter "link"
// ASSUMPTION: Requires a full path
// This is being used on the courses/lists page to make 
// a popup window for ITCAP courses
// Note that the dimensions for the window are fixed -- flexible later??

function openMe(link) {
    	// window.open(link,null,"height=400,width=400,resize,scrollbars=vertical,focus")
		window.open(link,null,"height=400,width=400,resize,scrollbars=yes")
}

//---------------------
// These functions help support the online tutoring calendar searches
// ------------------
function getEvents(calendar,keyword) {
	now = new Date();
	year = now.getFullYear();
	month = now.getMonth() + 1;
	if (month < 10) {
		month = "0" + month;
	}	
	day = now.getDate();
	if (day < 10) {
		day = "0" + day;
	}
	location = "http://events.pima.edu/cgi-bin/we4.0/webevent.cgi?cmd=search&keyword=" + keyword + "&startd" + day + "&startm=" + month + "&starty=" + year + "&lastd=31&lastm=12&lasty=2008&ncmd=listmonth&cal=" + calendar + "&token=&sb=0&cf=list&lc=search&swe=1&set=1&sa=0&sort=e,m,t&ws=0&sib=1&de=1&tf=0"; 
}

function jumpMenu(targ,selObj,restore)
{ 
        eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) 
		selObj.selectedIndex=0;
}

function neogovConfirm(path,page) 
{
	var answer = confirm(page  + ' are only available for current Pima Community College employees. If you are an agency employee, please click "OK" to continue, otherwise click "Cancel".');
	if (answer){
		window.location = "http://agency.governmentjobs.com/pcc/default.cfm?" + path;
	}
	else{return false;}
}


// External document.write to avoid Internet Explorer "Click to Activate" bug
function dvaeWrite(text) {
    document.write(text)
}
