site_path = "http://www.pima.edu"

if(document.images) {

//Top Navigation
nav_enEspanol = new Image()
nav_enEspanol.src = site_path + "/images/nav_enEspanol.gif"
nav_enEspanol_o = new Image()
nav_enEspanol_o.src = site_path + "/images/nav_enEspanol_o.gif"

nav_eventCalendar = new Image()
nav_eventCalendar.src = site_path + "/images/nav_eventCalendar.gif"
nav_eventCalendar_o = new Image()
nav_eventCalendar_o.src = site_path + "/images/nav_eventCalendar_o.gif"

nav_directory = new Image()
nav_directory.src = site_path +"/images/nav_directory.gif"
nav_directory_o = new Image()
nav_directory_o.src = site_path +"/images/nav_directory_o.gif"

nav_mapsDirections = new Image()
nav_mapsDirections.src = site_path + "/images/nav_mapsDirections.gif"
nav_mapsDirections_o = new Image()
nav_mapsDirections_o.src = site_path + "/images/nav_mapsDirections_o.gif"

//Main Navigation 
nav_gettingStarted = new Image()
nav_gettingStarted.src = site_path + "/images/nav_gettingStarted.gif"
nav_gettingStarted_o = new Image()
nav_gettingStarted_o.src = site_path + "/images/nav_gettingStarted_o.gif"

nav_coursesDegrees = new Image()
nav_coursesDegrees.src = site_path + "/images/nav_coursesDegrees.gif"
nav_coursesDegrees_o = new Image()
nav_coursesDegrees_o.src = site_path + "/images/nav_coursesDegrees_o.gif"

nav_campusesCenters = new Image()
nav_campusesCenters.src = site_path + "/images/nav_campusesCenters.gif"
nav_campusesCenters_o = new Image()
nav_campusesCenters_o.src = site_path + "/images/nav_campusesCenters_o.gif"

nav_aboutPima = new Image()
nav_aboutPima.src = site_path + "/images/nav_aboutPima.gif"
nav_aboutPima_o = new Image()
nav_aboutPima_o.src = site_path + "/images/nav_aboutPima_o.gif"

nav_studentResources = new Image()
nav_studentResources.src = site_path + "/images/nav_studentResources.gif"
nav_studentResources_o = new Image()
nav_studentResources_o.src = site_path + "/images/nav_studentResources_o.gif"

nav_communityResources = new Image()
nav_communityResources.src = site_path + "/images/nav_communityResources.gif"
nav_communityResources_o = new Image()
nav_communityResources_o.src = site_path + "/images/nav_communityResources_o.gif"

nav_business = new Image()
nav_business.src = site_path + "/images/nav_business.gif"
nav_business_o = new Image()
nav_business_o.src = site_path + "/images/nav_business_o.gif"

nav_alumniFriends = new Image()
nav_alumniFriends.src = site_path + "/images/nav_alumniFriends.gif"
nav_alumniFriends_o = new Image()
nav_alumniFriends_o.src = site_path + "/images/nav_alumniFriends_o.gif"

//Footer Navigation 
nav_sitemap = new Image()
nav_sitemap.src = site_path + "/images/nav_sitemap.gif"
nav_sitemap_o = new Image()
nav_sitemap_o.src = site_path + "/images/nav_sitemap_o.gif"

nav_glossary = new Image()
nav_glossary.src = site_path + "/images/nav_glossary.gif"
nav_glossary_o = new Image()
nav_glossary_o.src = site_path + "/images/nav_glossary_o.gif"

nav_requestInfo = new Image()
nav_requestInfo.src = site_path + "/images/nav_requestInfo.gif"
nav_requestInfo_o = new Image()
nav_requestInfo_o.src = site_path + "/images/nav_requestInfo_o.gif"

nav_pressroom = new Image()
nav_pressroom.src = site_path + "/images/nav_pressroom.gif"
nav_pressroom_o = new Image()
nav_pressroom_o.src = site_path + "/images/nav_pressroom_o.gif"

nav_legal = new Image()
nav_legal.src = site_path + "/images/nav_legal.gif"
nav_legal_o = new Image()
nav_legal_o.src = site_path + "/images/nav_legal_o.gif"

nav_contactUs = new Image()
nav_contactUs.src = site_path + "/images/nav_contactUs.gif"
nav_contactUs_o = new Image()
nav_contactUs_o.src = site_path + "/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);
            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";

// -----------------------------------------------------------------
// -----------------------------------------------------------------
