// POPUP WINDOW OBJECT
function popup(URL, w, h, scr, name, adj) {
	var adj = (adj) ? adj : '0';
	
	if(adj != '0'){
		var w = screen.width - 100;
		var h = screen.height - 100;
	}
	else{
		var w = (w) ? w : '620';
		var h = (h) ? h : '500';
	}
	var tmp = (scr) ? (scr == 0) ? 'no' : 'yes' : 'yes';
	var name = (name) ? name : 'winObj';

	winProps = 'height=' + h + ',width=' + w + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + 
tmp + ',resizable=yes';
	winObj = window.open(URL,name,winProps);
	winObj.focus();
}
// end POPUP WINDOW OBJECT

// Display a confirmation prompt; if the user responds positively, redirect to newURL
function questionPrompt (newURL, promptString){
	
	var confirmation = confirm(promptString);

	if (confirmation){
		window.location.href = newURL;
	} else {
		return false;
	}
}

// Toggle project editing visibility for group editing page
function toggleProjectEdit() {

	var sort = document.getElementById("project-sort");
	var list = document.getElementById("project-list");
	
	// If sort section not visible, show it and hide list section; otherwise, the opposite
	if (sort.style.display == "none"){
		list.style.display = "none";
		sort.style.display = "block";
	} else {
		sort.style.display = "none";
		list.style.display = "block";	
	}

	return false;
}