// UDScript.js
// DHTML and JavaScript functions for University of Dayton
// Author:  P. Duffin 01/09/01
// Copyright:  2001 LiquidMatrix Corporation

//Browser control vars.  Determines which browser the client is using.  Does NOT detect NS6.0 properly.
var isNav = (document.layers) ? true:false
var isIE = (document.all) ? true:false
var isOther = (!isNav&&!isIE) ? true:false

//Other global Vars

//Creates image objects for preloding.  Objects are NOT referenced directly.
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
//Swaps images in an HTML Page.  Take 1st arg, replace it's current src with 2nd arg.  Do this until all arg pairs are completed.
function changeImages() {
        if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function jumpto(form, name) {
	var myindex= eval('form.'+ name + '.selectedIndex');
    var myval=eval('form.' + name + '.options[myindex].value');
    if (myval != "") {
	location.href=myval;
    }
}

// VISIBILITY FUNCTIONS.  Show or Hide layers on the page.  Does NOT affect the display property...els still take up space allotted them


//Highlight function.  Change the specified object's class to the specified class name.  Class must be in main CSS file or in page itself.
function changelight(row, stylename) {
    if (isIE) { eval('document.all.' + row + '.className = "' + stylename + '"'); }
}

function popup(url, name, wwidth, wheight, wresize, wscrolls){
    eval("window.open('" + url + "','" + name + "','toolbar=no,menubar=no,address=no,status=no,dependent=no,resizable=" + wresize + ",scrollbars=" + wscrolls + ",height=" + wheight + ",width=" + wwidth + "')");
}

function external(url){
    eval("window.open('/external.asp?URL=" + escape(url) + "','daytonEXT','toolbar=yes,menubar=yes,address=yes,status=yes,dependent=no,resizable=1,height=540,width=760')");
}
