/* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/* Begin navigation menu script */
var currentVisible;
var currentTarget;
var rate;
function trackEvent(event){
	if(currentTarget!=undefined){
		currentTarget.className='menutitle';

	}
	currentTarget = event.target;
	currentTarget.className='activemenu';
	if(currentVisible!=currentTarget.rel){
		$(".submenu").stop();
		$(".submenu").css('display','none');
		$(".submenu").each(function(){
			$(this).attr('style','');
			$("#middlecenter").append(this);
		});
		$(".ui-effects-wrapper").remove();
	}
	onMouseEnter();
}
function clearEvent(event){
	event.target.className='menutitle';
	if(currentVisible!=currentTarget.rel){
		$(".submenu").stop();
		$(".ui-effects-wrapper").stop();
		$(".submenu").css('display','none');
		currentVisible=undefined;
	}
}
function onMouseEnter(){
			if(currentVisible!=undefined){
				functionTarget=currentTarget.rel;
				functionVisible=currentVisible;
				currentVisible=functionTarget;
				if(functionVisible!=functionTarget){
					$("#"+functionVisible).hide("slide", { direction: "left" }, rate, function() {
							$("#"+functionTarget).show("slide", { direction: "left" }, rate);
					});
				}
			}
			else{				
				functionTarget=currentTarget.rel;
				currentVisible=functionTarget;
				$("#"+functionTarget).show("slide", { direction: "left" }, rate);
			}
}

$(document).ready(function(){
	rate = 260;
	$("a.menutoggle").bind('mouseenter',trackEvent);
//	$("a.menutoggle").bind('mouseleave',clearEvent);
});

/* End navigation menu script */
function beginTrans(){
transRate = 1200;

lh = document.createElement('div');
ch = document.createElement('div');
rh = document.createElement('div');
con = document.createElement('div');

lh.id = 'leftheader';
ch.id = 'centerheader';
rh.id = 'rightheader';
con.id = 'holder'
con.className="clearfix";

con.appendChild(lh);
con.appendChild(ch);
con.appendChild(rh);

con.setAttribute('style','display:none;');

divContainer = document.getElementById('maincontainer');
beforeThis = document.getElementById('top2');
divContainer.insertBefore(con, beforeThis);

$('#top1').hide("slide", { direction: "right" }, transRate);
//$('#holder').show("slide", { direction: "left" }, transRate);


}
/* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/* Begin random top photo script */
/* Edit the randomtopphotos in lines 6-9 to change images, additional images can be added by following the format */
var randomtopphoto = new Array(4) 

randomtopphoto[0] = '/sr/images/home/topphoto1.jpg'
randomtopphoto[1] = '/sr/images/home/topphoto2.jpg'
randomtopphoto[2] = '/sr/images/home/topphoto3.jpg'
randomtopphoto[3] = '/sr/images/home/topphoto4.jpg'

var cc = 0
var dd = randomtopphoto.length;

var preBuffer = new Array()
for (i = 0; i < dd; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = randomtopphoto[i]
}

var whichrandomtopphoto = Math.round(Math.random()*(dd-1));
function showrandomtopphoto(){
document.write('<img src="'+randomtopphoto[whichrandomtopphoto]+'" />');
}
/* End random top photo script */
/* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */


/* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/* Begin random quote script */
/* Edit the randomquotes in lines 32-35 to change quotes, additional quotes can be added by following the format */
var randomquote = new Array
randomquote[0] = "&#8220;I have my choice of times, days, and locations.  UMUC is focused on me.&#8221;"
randomquote[1] = "&#8220;Taking classes online wasn't an issue once I saw all the support services at UMUC.&#8221;"
randomquote[2] = "&#8220;UMUC's flexible programs keep me ahead of change.&#8221;"
randomquote[3] = "&#8220;A graduate degree at UMUC fits right into my schedule.&#8221;"

var phraseCnt = randomquote.length;

function pickquote() {
randomNum = Math.floor ((Math.random() * phraseCnt))
selectquote = randomquote[randomNum]
document.write ("<h1>" + selectquote + "</h1>")
}
/* End random quote script */
/* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */


/* Begin spotlight links mouseover image functions */
/* New functions can be added and most of these can be deleted */
/* DO NOT DELETE function change_back() or the mouseovers will break */

function abc_img() {
    document.images.rotating.src = "/sr/images/home/ABC_mouseover.jpg";  	
}

function inauguration_img()
{
document.images.rotating.src = "/sr/images/home/inauguration.jpg";
}

function advising_img()
{
document.images.rotating.src = "/sr/images/home/advising.jpg";
}

function goarmy_img()
{
document.images.rotating.src = "/sr/images/home/goarmyed.jpg";
}

function statesidede_img()
{
document.images.rotating.src = "/sr/images/home/de_rates.jpg";
}
function merchandise_img()
{
document.images.rotating.src = "/sr/images/home/merchandise.jpg";
}

function homeland_security_img()
{
document.images.rotating.src = "/sr/images/home/hsm.jpg";
}
function prior_img()
{
document.images.rotating.src = "/sr/images/home/prior_learning.jpg";
}

function portal_img()
{
document.images.rotating.src = "/sr/images/home/portal.jpg";
}

function grad_img()
{
document.images.rotating.src = "/sr/images/home/graduate.jpg";
}

function commencement_img()
{
document.images.rotating.src = "/sr/images/home/commencement.jpg";
}

function unit_img()
{
document.images.rotating.src = "/sr/images/home/unit_mouseover.jpg";
}

function learn_img() {
  document.images.rotating.src = "/sr/images/home/learn_mouseover.jpg";
}

function my_umuc_img() { 
  document.images.rotating.src = "/sr/images/home/MyUMUC_mouseover.jpg";
}

function change_back()
{
document.images.rotating.src = "/sr/images/home/rotating.gif";
}
/* End spotlight links mouseover image functions */






