var submenu=new Array()

//Set submenu contents. Expand as needed. For each content, make sure everything exists on ONE LINE. Otherwise, there will be JS errors.
 
submenu[0]='<a href="http://www.augsburg.edu/global/mexico/index.html">Cuernavaca, Mexico</a> | <a href="http://www.augsburg.edu/global/centralamerica/index.html">Central America</a> | <a href="http://www.augsburg.edu/global/africa/index.html">Southern Africa</a>' 
 
submenu[1]='<a href="http://www.augsburg.edu/global/semesters/">Semesters Abroad</a> | <a href="http://www.augsburg.edu/global/summer/">Summer Abroad</a> |  <a href="http://www.augsburg.edu/global/internships/">Internships</a> | <a href="http://www.augsburg.edu/global/shorttermseminars/index.html">Join or Create Your Own Short-Term Travel Seminars</a> | <a href="http://www.augsburg.edu/global/professionaldev/">Professional Development</a> | <a href="http://www.augsburg.edu/global/semesters/scholarships.html">Scholarships</a>'

submenu[2]='<a href="http://www.augsburg.edu/global/about/philosophy.html">Educational Philosophy</a> | <a href="http://www.augsburg.edu/global/about/commitment.html">Commitment to Social and Environmental Responsibility</a> | <a href="http://www.augsburg.edu/global/about/diversity.html">Diversity</a> | <a href="http://www.augsburg.edu/global/about/staff.html">Minneapolis Team</a> | <a href="http://www.augsburg.edu/global/about/safety.html">Safety Information and Notices</a> | <a href="http://www.augsburg.edu/hr/" target="_blank">Jobs</a> | <a href="http://www.augsburg.edu/global/about/index.html">Contact Us</a> | <a href="http://www.augsburg.edu/global/about/stayconnected.html">Stay Connected</a>'

//Timing controls in milliseconds, delay before fade begins, time it takes for the fade to run

var fade_delay=1500;
var fade_time=400;
var delay_hide=(fade_delay + fade_time + 1);

var container = "topNavSubcategoryBackground";

var menuobj=document.getElementById? document.getElementById(container) : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""

function showit(which){
	changeOpac(100,container)
	clear_delayhide()
	thecontent=(which==-1)? "<br />" : submenu[which]  //Break tag needed to prevent vertical shifting on rollover when CSS is turned off in browser
	if (document.getElementById||document.all){
		menuobj.innerHTML=thecontent
	}
	else if (document.layers){
		menuobj.document.write(thecontent)
		menuobj.document.close()
	}
}


function resetit(e){
	if (document.all&&!menuobj.contains(e.toElement)){
		delayhide=setTimeout("showit(-1)",delay_hide)
		fadewait=setTimeout("opacity(container,100,0,fade_time)",fade_delay)
	}
	else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)){
		delayhide=setTimeout("showit(-1)",delay_hide)
		fadewait=setTimeout("opacity(container,100,0,fade_time)",fade_delay)
	}
}

function clear_delayhide(){
	if (window.delayhide||window.fadewait){
		clearTimeout(delayhide)
		clearTimeout(fadewait)
	}
}

function contains_ns6(a, b) {
	while (b.parentNode)
	if ((b = b.parentNode) == a)
	return true;
	return false;
}


function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 


//Part of the script above was taken from an example by Dynamic Drive. For full source code and more DHTML scripts, visit http://www.dynamicdrive.com.