function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// Creates jump menu functionality
function jumpMenu(targ,selObj,restore) {
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


// For use with AJAX calls...can create the Effect on whatever element - usually a div
function revealer(element) {
	if (document.getElementById(element).style.display=='none') {
		//Effect.Appear(element);
		Effect.BlindDown(element);
	} else {
		//Effect.Fade(element);
		toggle(element);
	}
}


// Toggles visability of an object
function toggle(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}


// Disables a form field depending on the checkbox actuator's state
function disabler(actuator, obj) {
	var a = document.getElementById(actuator);
	var el = document.getElementById(obj);
	
	if (a.checked  != true) {
		el.disabled = false;
	} else {
		el.disabled = true;
		el.value='';
	}
}


// Puts the loading bar gif on screen and replaces the submit button
function processUpload() {
	document.getElementById('load').style.display='none';
	document.getElementById('loading').style.display='block';
	
	// In order for IE to show the loading bar, we have to reset the image source (it stops all animation on form submittals)
	// Thanks to http://west-wind.com/weblog/posts/1227.aspx!
	setTimeout('document.images["pbar"].src = "/images/loadingbar.gif"', 100);
}


// From a popup window, changes the location of the parent and optionally closes the popup
function parentOpen(url, close) {
	if (close == 'yes') {
		window.opener.location = url; window.close();
	} else {
		window.opener.location = url;
	}
}


function closeWindow() {
	window.close();
}

function reloadWindow() {
	window.location.reload();
}

function reloadParent() {
	window.opener.location.reload();
}
