<!--
function checkBoxes() {
	count = document.list.length;
	count = count - 1;
	tally = 0;
	stack = "";
	msg = "You didn't check a row for deletion.";

	for (i = 0; i <= count; i++) {
		if (document.list.elements[i].checked == true) {
			tally += 1;
		}
	}

	if (tally == 0) {
		alert(msg);
	} else {
		document.list.submit();
	}
}

function checkBoxesSection() {
	count = document.list.length;
	count = count - 1;
	tally = 0;
	stack = "";
	msg = "You didn't check a row for deletion.";

	for (i = 0; i <= count; i++) {
		if (document.list.elements[i].checked == true) {
			tally += 1;
		}
	}  

	if (tally == 0) {
		alert(msg);
	} else {
		document.list.submit();
	}
}

function checkBoxesMM() {
	count = document.list.length;
	count = count - 1;
	tally = 0;
	stack = "";
	msg = "You didn't check a row for deletion.";

	for (i = 0; i <= count; i++) {
		if (document.list.elements[i].checked == true) {
			tally += 1;
		}
	}

	if (tally == 0) {
		alert(msg);
	} else {
		document.list.submit();
	}
}

function editItem(x, y, z, t, page) {
	document.editItems.column.value = y;
	document.editItems.key.value = z;
	document.editItems.table.value = t;
	document.editItems.z.value = page;

	answer = prompt("Change " + y + " to ", x);

	if (answer) {
		if ((y == "status") && ((answer > 2) || (answer < 0))) {
			alert("Status levels are 0, 1, or 2 only");
			editItem(x, y, z);
		} else {
			document.editItems.item.value = answer;
			document.editItems.submit();
		}
	}
}

function noblanks() {
	msg = "";

	if (document.add.firstname.value.length == 0) {
		msg = msg + "<li>Add a first name.</li>";
		document.add.firstname.focus();
	} else if (document.add.lastname.value.length == 0) {
		msg = msg + "<li>Add a last name.</li>";
		document.add.lastname.focus();
	} else if (document.add.email.value.length == 0) {
		msg = msg + "<li>Add an email address.</li>";
		document.add.email.focus();
	} else if (document.add.username.value.length == 0) {
		msg = msg + "<li>Add a username.</li>";
		document.add.username.focus();
	} else if (document.add.password.value.length == 0) {
		msg = msg + "<li>Add a password.</li>";
		document.add.password.focus();
	} else if (document.add.status.value.length == 0) {
		msg = msg + "<li>Please specify a security level.</li>";
		document.add.status.focus();
	} else if (isNaN(document.add.status.value) == true) {
		msg = msg + "<li>Please specify a security level <i>with a number</i>.</li>";
		document.add.status.focus();
	} else if (document.add.status.value > 2) {
		msg = msg + "<li>Please choose an appropriate range";
		msg = msg + "<br> for security level. (0, 1, 2)</li>";
		document.add.status.focus();
	}

	if (msg.length > 0) {
		NoticeWindow = window.open("","small","height=275,width=420,menubar=no,statusbar=no,left=300,top=50");
		message = "<head><title>List Entry Checker</title><style>a.special{text-decoration:none;color:#00008b}a:hover.special{text-decoration:underline;color:#083B6B} body{ font-family:trebuchet ms,georgia,arial; border: thin solid #990000 }</style></head><body><center><font face='palatino' size='5' color='#083B6B'><b><u>List Entry Checker</u></b></font></center><left><br><ul>" + msg + "</ul></left><br><center><i>Please adjust your form accordingly before resubmitting.</i></center>";
		message += "<br><center><a href='javascript:self.close();' class='special'>Close</a></center>";
		NoticeWindow.document.write(message);
		return false;
	} else {
		document.add.addNew.value = "yes";
		document.add.submit();
	}
}

function noblanksSection() {
	msg = "";

	if (document.getElementById("briefDescription").value.length == 0) {
		msg = msg + "<li>Add a brief description.</li>";
		document.getElementById("briefDescription").focus();
	}

	if (msg.length > 0) {
		NoticeWindow = window.open("","small","height=275,width=420,menubar=no,statusbar=no,left=300,top=50");
		message = "<head><title>List Entry Checker</title><style>a.special{text-decoration:none;color:#00008b}a:hover.special{text-decoration:underline;color:#083B6B} body{ font-family:trebuchet ms,georgia,arial; border: thin solid #990000 }</style></head><body><center><font face='palatino' size='5' color='#083B6B'><b><u>List Entry Checker</u></b></font></center><left><br><ul>" + msg + "</ul></left><br><center><i>Please adjust your form accordingly before resubmitting.</i></center>";
		message += "<br><center><a href='javascript:self.close();' class='special'>Close</a></center>";
		NoticeWindow.document.write(message);
		return false;
	} else {
		noblanksArticle();
	}
}

function noblanksArticle() {
	msg = "";

	if (document.getElementById("articlename").value.length == 0) {
		msg = msg + "<li>Add an article name.</li>";
		document.getElementById("articlename").focus();
	} else if (document.getElementById("briefDescription").value.length == 0) {
		msg = msg + "<li>Add a brief description.</li>";
		document.getElementById("briefDescription").focus();
	} /*else if (document.addarticle.file.value.length == 0) {
		msg = msg + "<li>Upload an article.</li>";
		document.getElementById("file").focus();
	}*/

	if (msg.length > 0) {
		NoticeWindow = window.open("","small","height=275,width=420,menubar=no,statusbar=no,left=300,top=50");
		message = "<head><title>List Entry Checker</title><style>a.special{text-decoration:none;color:#00008b}a:hover.special{text-decoration:underline;color:#083B6B} body{ font-family:trebuchet ms,georgia,arial; border: thin solid #990000 }</style></head><body><center><font face='palatino' size='5' color='#083B6B'><b><u>List Entry Checker</u></b></font></center><left><br><ul>" + msg + "</ul></left><br><center><i>Please adjust your form accordingly before resubmitting.</i></center>";
		message += "<br><center><a href='javascript:self.close();' class='special'>Close</a></center>";
		NoticeWindow.document.write(message);
		return false;
	} else {
		document.addarticle.submit();
	}
}

function themes(sectionid, themeid, sectionname) {
	url = 'themes.asp?sectionid=' + sectionid + '&themeid=' + themeid + '&sectionname=' + sectionname;
	wintitle = 'Themes';
	specs = 'width=300,height=300,statusbar=no,toolbar=no';
	open(url, wintitle, specs);
}

function checkDate()
{
	var dateLen = document.getElementById("articledate").value.length;
	var firstSlash = document.getElementById("articledate").value.indexOf("/");
	var secondSlash = document.getElementById("articledate").value.indexOf("/", (firstSlash + 1));
	var yearStr = document.getElementById("articledate").value.substring(secondSlash, dateLen);
	var yearLen = yearStr.length;


	if (dateLen == 0)
	{
		alert('Please enter an article date.');
		document.getElementById("articledate").focus();
		return false;
	}
	if ((firstSlash == -1) || (secondSlash == -1))
	{
		alert('Please use the proper date format. - MM/DD/YYYY');
		document.getElementById("articledate").focus();
		return false;
	}
	else
	{
			if (firstSlash < 2)
			{
				alert('Please use the proper date format. - MM/DD/YYYY');
				document.getElementById("articledate").focus();
				return false;
			}
			if (yearLen < 4)
			{
				alert('Please use the proper date format. - MM/DD/YYYY');
				document.getElementById("articledate").focus();
				return false;
			}
			else
			{
				return true;
			}
	}
}


function goTopage(pid)
{
	document.getElementById("pid").value = pid;
	document.getElementById("transport").submit();
}

function goTojspage(pid)
{
	if(pid.indexOf("&sjs=") > 0)
	{
		var thispid = pid;
		pidArray    = thispid.split("&sjs=");
		var thissjs = pidArray[1];
		document.getElementById("sjs").value = thissjs;
	}
	document.getElementById("pid").value = pidArray[0];
	document.getElementById("transport").submit();
}
-->