// SELECTED MENU ITEMS IN TOP STRAP
	function toplevel_menu(menuon) {
		document.getElementById(menuon).style.color='#fff202';
		document.getElementById(menuon).style.background='transparent';
		document.getElementById(menuon).removeAttribute('href');
	}



// IMAGE ROLLOVERS
	function on(dir,imageon,type){
		document.images[imageon].src = dir + imageon + "_on." + type;
	}

	function off(dir,imageoff,type){
		document.images[imageoff].src = dir + imageoff + "_off." + type;
	}



// WRITE FLASH SPLASH BANNER
	function writeSplash(swfLocation) {
		var flashvars = false;
		var params = { base:'.' };
		var attributes = false;
		swfobject.embedSWF(swfLocation, 'uod_splash_swf', '100%', '200', '7', '/_lib/tools/swfobject/swfobject-2.1/expressInstall.swf', flashvars, params, attributes);
	}

// WRITE COOKIES
	function writeCookie(cookie_name,cookie_value,cookie_expires){
		cookie_expires += ' 00:00:00';
		var cookie_expires_date = new Date(cookie_expires);
		cookie_expires_UTC = cookie_expires_date.toUTCString();
		var the_cookie = cookie_name + '=' + escape(cookie_value) + ';expires=' + cookie_expires_UTC + ';path=/;domain=dundee.ac.uk';
		document.cookie = the_cookie;
	}	

// READ COOKIES
	function readCookie(name) {
		// if a cookie exists
		if (document.cookie != '') {
			var firstChar, lastChar;
			var theBigCookie = document.cookie;
			// find the start of 'name'
			firstChar = theBigCookie.indexOf(name);
			// if you found the cookie
			if(firstChar != -1)  {
				// skip 'name' and '='
				firstChar += name.length + 1;
				// Find the end of the value string (i.e. the ';')
				lastChar = theBigCookie.indexOf(';', firstChar);
				if(lastChar == -1) lastChar = theBigCookie.length;
			return unescape(theBigCookie.substring(firstChar, lastChar));
			} else {
				// If there was no cookie of that name, return false.
				return false;
			}
		}
	}

// SHOW OR HIDE SPLASH ON LOAD
	function splashHide(splashDiv) {
		if (splashDiv == undefined) { splashDiv = 'uod_splash'; }
		if (readCookie('uod_splash') == 'false') { 
			if (document.getElementById(splashDiv)) { document.getElementById(splashDiv).style.display = 'none'; }
			if (document.getElementById('uod_banner_off')) { document.getElementById('uod_banner_off').style.display = 'none'; }
			if (document.getElementById('uod_banner_on')) { document.getElementById('uod_banner_on').style.display = 'block'; }
		} else {
			if (document.getElementById('uod_banner_on')) { document.getElementById('uod_banner_on').style.display = 'none'; }
			if (document.getElementById('uod_banner_off')) { document.getElementById('uod_banner_off').style.display = 'block'; }
		}
	}

// SHOW SPLASH
	function splashOn(splashDiv) {
		if (splashDiv == '') { splashDiv = 'uod_splash'; }
		if (document.getElementById(splashDiv)) { document.getElementById(splashDiv).style.display = 'block'; }
		if (document.getElementById('uod_banner_on')) { document.getElementById('uod_banner_on').style.display = 'none'; }
		if (document.getElementById('uod_banner_off')) { document.getElementById('uod_banner_off').style.display = 'block'; }
		writeCookie('uod_splash','true','January 01, 2020');
	}

// HIDE SPLASH
	function splashOff(splashDiv) {
		if (splashDiv == '') { splashDiv = 'uod_splash'; }
		if (document.getElementById(splashDiv)) { document.getElementById(splashDiv).style.display = 'none'; }
		if (document.getElementById('uod_banner_off')) { document.getElementById('uod_banner_off').style.display = 'none'; }
		if (document.getElementById('uod_banner_on')) { document.getElementById('uod_banner_on').style.display = 'block'; }
		writeCookie('uod_splash','false','January 01, 2020');
	}