


//Generic alert to be used with links to delete things.  Simply a confirmation of intent to delete.
function deleteCheck(objName) {
	return confirm("This will permanently delete this " + objName + ".  Are you sure you want to do this?");
}

//Variable pop-up window
function newWindow(filename,widthVal,heightVal,resizeVal) {
	if ((resizeVal != "yes") || (resizeVal != "no")) {
		resizeVal = "yes";
	}
	argVar = "width=" + widthVal + ",height=" + heightVal + ",scrollbars=yes,resizable="+ resizeVal;
	reportWindow = window.open(filename,"ExpertNetPopUp",argVar);
}

// Feedback popup to indicate that a poll has been submitted.
function pollFeedback() {
	return alert("Thank you for submitting a response to this poll.  We appreciate your responses.");
}

// Alert regarding starting a poll
function startPollConfirm() {
	return confirm("Starting this poll will prevent further edits and make it available to the public.  Please confirm that you are ready to start this poll.");
}

// Alert regarding stopping a poll
function stopPollConfirm() {
	return confirm("Stopping this poll will prevent further responses to the poll.  Please confirm that you want to stop this poll.");
}

// Check for null in search box
function searchCheck(formObj) {
	if (emptyField(formObj.searchTerm)) {
		alert("Please enter a search term.");
		document.frm_search.searchTerm.focus();
	}
	else return true;
	
	return false;
}

// Check to see if field is empty
function emptyField(textObj) {
	if (textObj.value.length == 0) {
		return true;
	}
	for (var i=0; i < textObj.value.length; ++i) {
		var ch = textObj.value.charAt(i);
		if (ch != ' ' && ch != '\t') {
			return false
		}
	}
	return true;
}