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_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 fileName()
{
	var strPath = location.pathname;
	var intLastSlashPosition = strPath.lastIndexOf("/") + 1;
	return strPath.substring(intLastSlashPosition,strPath.length);
}
function setCurrent(fileName)
{
	strElements = "";
	var elems = document.getElementById("nav_table").getElementsByTagName("a");
	for (i = 0; i < elems.length; i++)
	{
		var strHref = elems[i].getAttributeNode("href").nodeValue;
		var intLastSlashPosition = strHref.lastIndexOf("/") + 1;
		var strName = strHref.substring(intLastSlashPosition,strHref.length);
		if (strName == fileName)
		{
			var elemCells = document.getElementById("nav_table").getElementsByTagName("td");
			for (j = 0; j < elemCells.length; j++)
			{
				if (j == i)
				{
					elemCells[j].className = "nav_level_one_current";
				}
			}
		}
	}
	return strElements;
}
var newWindow;
function makeNewWindow(to,uri,ref)
{
	var width = 600;
	var height = 175;
	var left = (screen.availWidth - width) / 2;
	var top = (screen.availHeight - height) / 2;
	height = (navigator.userAgent.indexOf("Mac") != -1 ||
										  navigator.userAgent.indexOf("Gecko") != -1 ||
										  navigator.userAgent.indexOf("Netscape") != -1 ||
										  navigator.userAgent.indexOf("Firefox") != -1) ? height : height - 20;
	if (!newWindow || newWindow.closed)
	{
		newWindow = window.open("/content_editor.php?to=" + to + "&uri=" + uri + "&ref=" + ref,"subWindow","status,left=" + left + ",top=" + top + ",height=" + height + ",width=" + width);
	}
	else
	{
		newWindow.focus();
	}
}
function closeWindow()
{
	if(newWindow)
	{
		newWindow.close();
	}
}
var browserWindow;
function makeBrowserWindow()
{
	var width = 400;
	var height = 300;
	var left = (screen.availWidth - width) / 2;
	var top = (screen.availHeight - height) / 2;
	height = (navigator.userAgent.indexOf("Mac") != -1 ||
										  navigator.userAgent.indexOf("Gecko") != -1 ||
										  navigator.userAgent.indexOf("Netscape") != -1 ||
										  navigator.userAgent.indexOf("Firefox") != -1) ? height : height - 20;
	if (!browserWindow || browserWindow.closed)
	{
		browserWindow = window.open("/browser_notice_IE5mac.php","subBrowserWindow","status,left=" + left + ",top=" + top + ",height=" + height + ",width=" + width);
	}
	else
	{
		browserWindow.focus();
	}
}
function closeBrowserWindow()
{
	if(browserWindow)
	{
		browserWindow.close();
	}
}
var newContactWindow;
function makeContactWindow(uniqueid,uri)
{
	var width = 600;
	var height = 175;
	var left = (screen.availWidth - width) / 2;
	var top = (screen.availHeight - height) / 2;
	height = (navigator.userAgent.indexOf("Mac") != -1 ||
										  navigator.userAgent.indexOf("Gecko") != -1 ||
										  navigator.userAgent.indexOf("Netscape") != -1 ||
										  navigator.userAgent.indexOf("Firefox") != -1) ? height : height - 20;
	if (!newContactWindow || newContactWindow.closed)
	{
		newContactWindow = window.open("/contact_me.php?uniqueid=" + uniqueid + "&uri=" + uri,"subWindow","status,left=" + left + ",top=" + top + ",height=" + height + ",width=" + width);
	}
	else
	{
		newContactWindow.focus();
	}
}
function closeContactWindow()
{
	if(newContactWindow)
	{
		newContactWindow.close();
	}
}
var newEditorWindow;
function openEditor(page,role,user,secret)
{
	if(newEditorWindow)
	{
		closeEditor();
	}
	newEditorWindow = window.open("http://www.drake.edu/applications/news/selector/index.php?page=" + page + "&role=" + role + "&user=" + user + "&secret=" + secret, "subwindeditor", "status,top=25,left=25,height=560,width=628");
	newEditorWindow.focus();
}
function closeEditor()
{
	if(newEditorWindow)
	{
		newEditorWindow.close();
	}
}
function admissionSelectorFormSubmit(x)
{
        document.getElementById("submitvar").value = x;
        document.forms['form1'].submit();
}
function IncludeRapport()
{
  var rapport;
  rapport = 'https://instantrapport.com/present/?team=drakeadmission&output=deferscript&id=rapporticoncounselor';
  document.write('<script type="text/javascript" src="'
    + rapport + '"></scr' + 'ipt>'); 
}
