/////////////////////////////////   MMI - WWW.MMIWEB.COM    ////      --------------       ////         Contains          //// almost all the javascript ////    used for this site     /////////////////////////////////function stylesheetchooser(){  if(navigator.userAgent.indexOf('Mac') == 1)  { 	document.write ('<link rel="stylesheet" href="stylesheets/macnet.css">')  }  else if(navigator.userAgent.indexOf('Mac') != 1)  { 	if (navigator.appName == "Netscape")	{		document.write ('<link rel="stylesheet" href="stylesheets/macnet.css">')	}		else	{		document.write ('<link rel="stylesheet" href="stylesheets/ontak_style.css">')	}  }}function re(){	popwins('rewin.htm',516,400,'re')}function p(currentimage){mystring =("./structure/" +currentimage+ ".htm")popwins(mystring,539,400,"execpage")}function updatecookie(pageentered){	var cookie1 = ""	cookie1 = getCookie("version") 	setCookie("lastpage",cookie1) 	setCookie("page",pageentered) }function return_to_menu(){var cookie1 = ""cookie1 = getCookie("version") 	if (cookie1 == 'flash')	{				document.location.href = "http://www.gcal.ac.uk/home.html";	}		else	{				document.location.href = "http://www.gcal.ac.uk/home_dhtml.html";	}}function return_to_menu_nested(){var cookie1 = ""cookie1 = getCookie("version") 	if (cookie1 == 'flash')	{				document.location.href = "http://www.gcal.ac.uk/home.html";	}		else	{				document.location.href = "http://www.gcal.ac.uk/home_dhtml.html";	}}function popwin(page,wid,hght,winname){	w=window.open(page, winname, "width="+wid+",height="+hght+",scrollbars=no");	w.focus();}function popwins(page,wid,hght,winname){	w=window.open(page, winname, "width="+wid+",height="+hght+",scrollbars=yes");	w.focus();}  function getCookie(name) {    name += "="; // append '=' to name string    var i = 0; // index of first name=value pair    while (i < document.cookie.length) 	{      		var offset = i + name.length;      		if (document.cookie.substring(i, offset) == name) 		{ 		        		var endstr = document.cookie.indexOf(";", offset);        		if (endstr == -1) endstr = document.cookie.length;          		return unescape(document.cookie.substring(offset, endstr));         	}        i = document.cookie.indexOf(" ", i) + 1; // move i to next name=value pair        if (i == 0) break; // no more values in cookie string      }    return null;}function setCookie(name, value) {var today = new Date();var expiry = new Date(today.getTime() + 28 * 24 * 60 * 60 * 1000);    	if (value != null && value != "")      document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString();    document.cookie = document.cookie; }//------------------------------------------------------------------------------------------------------------------------------------------------------------------------ MOVE CODEtextnow = 1layerRef = ""styleRef = ""currentstep = 0alreadygoing = "stopped"needout = "nope"overvtour = 1moremoves = 0nextmove = ""oktoshow = 0function browsertype(){}if (navigator.appName == "Netscape"){	layerRef = ".layers"	styleRef = ""}	else{	layerRef = ".all"	styleRef = ".style"}function calc(end_left,end_top,step,layerNames,speed)																	{	if (alreadygoing == "moving")	{ 			return		if (needout == "yip")			{				return			}					}		else	{	alreadygoing = "moving"	start_top = eval("document" + layerRef + "['" + layerNames + "']" + styleRef + ".top")	start_left = eval("document" + layerRef + "['" + layerNames + "']" + styleRef + ".left")	start_left = parseInt(start_left)	start_top = parseInt(start_top)if (start_left > end_left){																		// we are moving the layer < /\	end_left =  end_left -  start_left	end_top =  end_top -  start_top }else{																		// we are moving the layer > \/	end_left =   start_left -  end_left	end_left = 0 - end_left	end_top =   start_top - end_top 	end_top= 0 - end_top}	step_size_left = end_left / step	step_size_top = end_top / step	move (layerNames,step_size_left,step_size_top,start_left,start_top,step,speed)	}}function move(layerNames,step_size_left,step_size_top,start_left,start_top,step,speed)  																{				start_left = start_left + step_size_left			start_top = start_top + step_size_top		temp_left = Math.round(start_left)		temp_top = Math.round(start_top)		eval ("document" + layerRef + "['" + layerNames + "']" + styleRef + ".top = " + temp_top)		eval ("document" + layerRef + "['" + layerNames + "']" + styleRef + ".left = " + temp_left)		currentstep ++	if (currentstep < step)  	{			jim =  ("move ('" + layerNames+ "'," + step_size_left + "," + step_size_top +  "," + start_left + "," + start_top + "," + step + ","  + speed + ")")			setTimeout(jim,speed)	}		else	{		currentstep = 0		alreadygoing = "stopped"		if (moremoves == 1)		{			moremoves = 0			movesmade = 0			eval(nextmove)		}		else		{			moremoves = 0			return		}	}}//------------------------------------------------------------------------------------------------------------------------------------------------------------------------ END  MOVE CODEfunction MM_findObj(n, d) { //v3.0  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;}/* Functions that swaps images. */function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}/* Functions that handle preload. */function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_showHideLayers() { //v3.0  var i,p,v,obj,args=MM_showHideLayers.arguments;  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }    obj.visibility=v; }}//--------------------------------------------------------------------------------------------------------------------------------------------------------------------- other home made functionsfunction button1_over()      //-----------------------------------   layer 1{needout = "nope"MM_showHideLayers('b1text','','show')MM_showHideLayers('b1roll','','show')moremoves = 1nextmove = "calc(240,68,10,'b1text',1)"calc(380,68,5,'b1text',1)}function button1_out(){calc(-120,68,1,'b1text',1)MM_showHideLayers('b1text','','hide')MM_showHideLayers('b1roll','','hide')MM_swapImgRestore()moremoves = 0needout = "yip"}function button2_over()      //-----------------------------------   layer 2{needout = "nope"MM_showHideLayers('b2roll','','show')MM_showHideLayers('b2text','','show')moremoves = 1nextmove = "calc(240,68,10,'b2text',1)"calc(380,68,5,'b2text',1)}function button2_out(){calc(-120,68,1,'b2text',1)MM_showHideLayers('b2text','','hide')MM_showHideLayers('b2roll','','hide')MM_swapImgRestore()moremoves = 0needout = "yip"}function button3_over()      //-----------------------------------   layer 3{needout = "nope"MM_showHideLayers('b3text','','show')MM_showHideLayers('b1roll','','show')MM_swapImgRestore()moremoves = 1nextmove = "calc(240,68,10,'b3text',1)"calc(380,68,5,'b3text',1)}function button3_out(){calc(-120,68,1,'b3text',1)MM_showHideLayers('b3text','','hide')MM_showHideLayers('b1roll','','hide')MM_swapImgRestore()moremoves = 0needout = "yip"}function button4_over()      //-----------------------------------   layer 4{needout = "nope"MM_showHideLayers('b2roll','','show')MM_showHideLayers('b4text','','show')moremoves = 1nextmove = "calc(240,68,10,'b4text',1)"calc(380,68,5,'b4text',1)}function button4_out(){calc(-120,68,1,'b4text',1)MM_showHideLayers('b4text','','hide')MM_showHideLayers('b2roll','','hide')MM_swapImgRestore()moremoves = 0needout = "yip"}function hidden(){if (oktoshow == 1)	{		oktoshow = 5	}		else	{		oktoshow = 6	}}function message(){	alert ("Click this logo at any time to return to this page")	if (oktoshow == 2)	{		oktoshow = 1	}	else	{		oktoshow = 6	}}function abouttab_over()      //-----------------------------------  About tab{needout = "nope"MM_swapImage('n1st_r09_c011','','images/1st_r09_c01_f2.gif',1);}function abouttab_out(){MM_swapImgRestore()needout = "yip"}function newstab_over()      //-----------------------------------  News tab{needout = "nope"MM_swapImage('n1st_r09_c031','','images/1st_r09_c03_f2.gif',1);}function newstab_out(){MM_swapImgRestore()needout = "yip"}function vtour_over()			//-----------------------------------  V tour tab{MM_showHideLayers('vtour','','show')MM_swapImage('n1st_r07_c152','','images/1st_r07_c152_f2.gif',1);eye()overvtour = 1}function vtour_out(){MM_swapImgRestore();overvtour = 0setTimeout('checkmouse()',10)MM_showHideLayers('eye','','hide')}function eye(){	if (oktoshow == 5)	{		MM_showHideLayers('eye','','show')	}}function vtourpop_over(){overvtour = 1}function vtourpop_out(){overvtour = 0setTimeout('checkmouse()',10)}function checkmouse(){if  (overvtour == 0)	{		MM_showHideLayers('vtour','','hide')	}}function swaptext(direction)      //-----------------------------------  text swapping function{	MM_showHideLayers('text1','','hide') 	MM_showHideLayers('text2','','hide')		MM_showHideLayers('text3','','hide') 	MM_showHideLayers('text4','','hide')		if (direction == "next")		{			oktoshow = 2			textnow = textnow + 1			if (textnow == 5)				{					textnow = 1				}		}			else		{			oktoshow = 6			textnow = textnow - 1			if (textnow == 0)				{					textnow = 4				}		}jim = "MM_showHideLayers('text"+ textnow+"','','show')"eval(jim)}function MM_displayStatusMsg(msgStr) { //v1.0  status=msgStr;  document.MM_returnValue = true;}function MM_callJS(jsStr) { //v2.0  return eval(jsStr)}function MM_callJS(jsStr) { //v2.0  return eval(jsStr)}