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="/admissions/day/">Admissions</a> | <a href="/admissions/international/">International Admissions</a> | <a href="/admissions/transfer/">Transfer Admissions</a> | <a href="/homemade">Homemade</a>'

submenu[1]='<a href="/admissions/weekend/">Weekend and Evening Admissions</a> | <a href="/admissions/rochester">Rochester Admissions</a>'

submenu[2]='<a href="/admissions/mae/">Master of Arts in Education</a> | <a href="/admissions/mal/">Master of Arts in Leadership</a> | <a href="/admissions/ma_nursing/">Master of Arts in Nursing</a> | <a href="/admissions/mba/">Master of Business Adminstration</a> | <a href="/admissions/pa/">Master of Science in Physician Assistant Studies</a> | <a href="/admissions/msw/">Master of Social Work</a> | <a href="/admissions/rochester/">Rochester Campus</a>'

submenu[3]='<a href="/academics/majors.html">Majors and Programs</a> | <a href="/academics/curriculum.html">Core Curriculum</a> | <a href="/catalog/">Course Catalogs</a> | <a href="/library/">Lindell Library</a> | <a href="/academics/research.html">Research and Grants</a> | <a href="/academics/accreditation.html">Accreditation</a> | <a href="/enroll">Enrollment Center</a>'

submenu[4]='<a href="http://athletics.augsburg.edu">Auggie Athletics Home</a> | <a href="http://athletics.augsburg.edu">Athletics News</a> | <a href="http://athletics.augsburg.edu/staff.aspx?tab=staffdirectory">Athletics Directory</a> | <a href="http://athletics.augsburg.edu/sports/2009/3/12/gen031209.aspx?tab=a-club">Alumni A-Club</a> | <a href="http://athletics.augsburg.edu/calendar.aspx">Schedule Calendar</a> | <a href="http://athletics.augsburg.edu/sports/2009/3/15/recruiting.aspx?tab=recruitinginformation">Become an Auggie</a> | <a href="http://athletics.augsburg.edu/sports/2009/3/17/webcasts.aspx?id=76">Live Stats and Webcasts</a>'


submenu[5]='<a href="/finearts/">Fine Arts</a> | <a href="/oip/">International Programs</a> | <a href="/cswl/">Center for Service, Work, and Learning</a> | <a href="/campusactivities/">Campus Activities</a> | <a href="/reslife/">Residence Life</a> | <a href="/organizations/">Student Organizations</a> | <a href="/spiritual/">Faith at Augsburg</a>'

submenu[6]='<a href="http://smaug.augsburg.edu/NetCommunity/Page.aspx?pid=411">Alumni Calendar</a> | <a href="/alumni/getinvolved.html">Get Involved</a> | <a href="/homecoming/">Homecoming 2009</a> | <a href="/alumni/benefits.html">Alumni Benefits</a> | <a href="https://smaug.augsburg.edu/NetCommunity/SSLPage.aspx?pid=426">Update Your Info</a> | <a href="/alumni/board.html">Alumni Board</a> | <a href="/parents/">Parent Relations</a>'

submenu[7]='<a href="https://smaug.augsburg.edu/NetCommunity/SSLPage.aspx?&pid=184">Give Now</a> | <a href="/augsburgfund">Annual Giving</a> | <a href="http://www.plan.gs/stelterweb/Home.do?orgId=5038">Planned Giving</a>  | <a href="/giving/types.html">Types of Giving</a> | <a href="/giving/howto.html">How to Give</a>'

submenu[8]='<a href="/about/mission.html">College Mission and Vision</a> | <a href="/about/history.html"> History of Augsburg</a> | <a href="/about/leadership.html">College Leadership</a> | <a href="/about/distinctions.html">Augsburg Distinctions</a> | <a href="/about/facts.html">Fast Facts</a> | <a href="/hr/">Employment</a> | <a href="/about/map.html">Directions and Parking</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.
