// JavaScript for 2006 Campus Tour

function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
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;
}

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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// javascript for movement though tour -- edit the following array when adding, moving, or deleting tour pages

var pages=new Array("index.html","gios.html","solar.html","tuv-ptl.html","algae.html","purl.html","decisiontheater.html","dcdc.html","digitalphx.html","bikecoop.html","okala.html","100cities.html","food.html","garden.html","arboretum-poly.html","plantwalk.html","istb1.html","istb2.html","istb3.html","smartlab.html","pervioslot.html","bda.html","bdb.html","abc1.html","cwp.html","fultn.html","cronk.html","nhi2.html","asupd.html","print.html","hassayampa.html","barrett.html","pac.html","zipcar.html","index.html")

var current_page=(document.location+"").substring(((document.location+"").lastIndexOf("/")+1))
var new_location;

function move(direction){

	if(direction>0){
		for(i=0; i<pages.length-1; i++){
			if(current_page==pages[i]){
				motion(direction)
			}
		}
	}
	else {
		for(i=pages.length-1; i>0; i--){
			if(current_page==pages[i]){
				motion(direction)
			}
		}
	}
	
}

function motion(direction)	{
	new_location=pages[i+direction];
	document.location.href=new_location;
	return;
}

/* IN YOUR CODE YOU WOULD PUT THIS:
(for backward)
	<a href="javascript: void move(-1)">BACK</a> (for forward)
	<a href="javascript: void move(1)">NEXT</a>
	
*/

// Window-pop script
function writeConsole(content,w,h,title) {

windowProps="'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes,width="+w+",height="+h+"'";
window_name='';

top.consoleRef=window.open('',window_name,windowProps);

 consoleContent=''
+'<html><head><TITLE>'+title+'</TITLE>'
+'<style type="text/css">'
+'<!--'
+'.close {text-decoration: none;}'
+'-->'
+'</style>'
+'</head>'
+'<BODY BGCOLOR="#edebd4" link="#000000" vlink="#000000" onload="self.focus();">'
+'<CENTER>'
+'<table border="0" width="100%">'
+'  <tr>'
+'    <td width="100%" align="center">'
+'		<br><img src="'+content+'">'
+'		<p align="center" style="font-family: sans-serif; font-size: 9pt; font-weight:bold;"><a href="javascript:void window.close()" class="close">close window</a></p>'
+'		</td>'
+'  </tr>'
+'</table>'
+'</body>'
+'</html>'

 top.consoleRef.document.writeln(consoleContent)
 top.consoleRef.document.close()
}