<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function valPN()
{
	var b = searchPN.areacode;
	var c = searchPN.zip
	if (isNaN(b.value) || (b.value !="" && b.value.length!=3)){
		alert ("Please enter a valid 3-digit area code");
		b.focus();
		b.value="";
		return false;
	}
	else if (isNaN(c.value) || (c.value != "" && c.value.length!=5)){
		alert ("Please enter a valid 5-digit zip code");
		c.focus();
		c.value="";
		return false;
	}
	else if (b.value=="" && c.value==""){
		alert ("Please enter an area or zip code");
		b.focus();
		return false;
	}
	else {
		return true;
	}
}

function validateNum(x)
{
	if (isNaN(x.value))
	{
		alert ("This is not an integer!");
		x.focus();
		x.value="";
		return false;
	}
	else {
		return true;
	}
}

function isZip(x)
{
	if (isNaN(x.value) || x.value.length != 5)
	{
		alert ("Please enter a valid 5-digit zip code");
		x.focus();
		x.value="";
		return false;
	}
	else {
		return true;
	}
}

function isAreaCode(x)
{
	if (isNaN(x.value) || x.value.length != 3)
	{
		alert ("Please enter a valid 3-digit area code");
		x.focus();
		x.value="";
		return false;
	}
	else {
		return true;
	}
}

function isRsc()
{
	var x = document.resource
	if (x.rscName.value=="")
	{
		alert ("Please enter a name for this resource.");
		x.rscName.focus();
		return false;
	}
	else if (x.rscUrl.value=="")
	{
		alert ("Please enter a web address for this resource.");
		x.rscUrl.focus();
		return false;
	}
	else if (x.rscUrl.value.indexOf("http:")!=-1){
		alert ("Please do not include 'http://' in the web address.");
		x.rscUrl.select();
		return false;
	}
	else {
		return true;
	}
}

function valPreventNet(x) {
	if (x.orgName.value=="")
	{
		alert ("Please enter a name for this organization.");
		x.orgName.focus();
		return false;
	}
	else if (x.address1.value=="")
	{
		alert ("Please enter an address for this organization.");
		x.address1.focus();
		return false;
	}
	else if (x.city.value=="")
	{
		alert ("Please enter a city for this organization.");
		x.city.focus();
		return false;
	}
	else if (x.zip1.value=="")
	{
		alert ("Please enter a zip code for this organization.");
		x.zip1.focus();
		return false;
	}
	else if (x.areacode.value=="")
	{
		alert ("Please enter an area code for this organization.");
		x.areacode.focus();
		return false;
	}
	else if (x.phone.value=="")
	{
		alert ("Please enter a phone number for this organization.");
		x.phone.focus();
		return false;
	}
	else if (x.url.value.indexOf("http:")!=-1){
		alert ("Please do not include 'http:' in the web address.");
		x.url.select();
		return false;
	}
	else {
		return true;
	}


}

function valCheckbox()
{
	var r = 0, s = 12;
	for (var q=6; q<27; q++)
	{
		if (q == 16)
		{
			r = 0;
			s = 13
			continue;
		}
		if (training3.elements[q].checked)
			r++;
		if (r>3)
		{
			alert ("Please select only 3 choices for Question " + s);
			return false;
		}
	}
	return true;
}

function isSearch()
{
		if (search.keyword.value=="")
		{
			alert ("Please enter a search term.");
			search.keyword.focus();
			return false;
		}
		else {
		return true;
		}
}

function isEmail() 
{
	if (!checkField(emailList.email, 'n e-mail address'))
		{
		return false;
		}
	else if (emailList.email.value.indexOf ('@',0) == -1 || emailList.email.value.indexOf ('.',0) == -1) 
	{
		alert ("Please provide a valid e-mail address.")
		emailList.email.select();
		emailList.email.focus();
		return false;
	}
	else 
	{
	alert ("Thank you for joining our mailing list.  You'll be hearing from us soon!")
	return true;
	}
}


function checkField(d, e)
{
	if (d.value=="")
			{
				alert ("Please enter a" + e + ".");
				d.select();
				return false;
			}
		else
			return true;
}

function checkList()
{
	var k = 0;
	for (var m=2; m<12; m++)
	{
		if (addList.elements[m].value!="")
		{
			k=1;
			return true;
			break;
		}
	}
	if (k==0)
	{
		alert ("You do not have any list items")
		addList.item1.select();
		return false;
	}
}

function isWrap(x, y)
{
var opt;
	if (y!=0 && x.imageAlign.options[1] && x.imageAlign.options[1].text=="center")
	{
			if (x.imageAlign.selectedIndex == 1)
			{
				x.imageAlign.selectedIndex = 0;
			}
			x.imageAlign.options.remove(1);
	}
	if (y!=0 && x.capAlign.options.length > 1)
	{
		if (y!=0 && x.imageAlign.options[1] && x.capAlign.options[1].text=="center")
		{
			if (x.capAlign.selectedIndex == 1)
				{
					x.capAlign.selectedIndex = 0;
				}
				x.capAlign.options.remove(1);
		}
		if (y!=0 && x.imageAlign.options[1] && x.capAlign.options[1].text=="right")
		{
				x.capAlign.options.remove(1);
		}
	}
	if (y==2)
	{
			//x.caption.className="formgr";
			//x.caption.readOnly=true;
			//x.capAlign.className="formgr";
			//for (var z=0; z<3; z++)
				//x.capAlign.options.remove(0)
			//opt = new Option ("---", "none");
			//x.capAlign.options.add(opt, 0);
			//x.capAlign.selectedIndex=0;
	}
	else
	{
		if (y==0 && x.imageAlign.options[1].text!="center")
		{
			opt = new Option ("center", "center");
			x.imageAlign.options.add(opt, 1)
		}
		if (y==0 && x.capAlign.options.length < 2)
		{
			opt = new Option ("center", "center");
			x.capAlign.options.add(opt, 1)
			opt = new Option ("right", "right");
			x.capAlign.options.add(opt, 2)
		}
		if (x.caption.className!="form")
		{
			x.caption.className="formch";
			x.capAlign.className="formch";
		}
		if (x.capAlign.options[0].text=="---")
		{
			x.capAlign.options.remove(0);
	 		var alignVal = new Array ("left", "center", "right");
			for (var z=0; z<3; z++)
			{
				var opt = new Option (alignVal[z], alignVal[z]);
	 			x.capAlign.options.add(opt, z);
	 		}
			x.capAlign.selectedIndex=0;
		}
	}
	
}

function changeClass(r) 
{
	if (r=="int")
	{
		addLink.extlink.readOnly=true;
		addLink.extlink.className='formgr';
		addLink.intlink.className='form';
	}
	else
	{
		addLink.extlink.readOnly=false;
		addLink.extlink.className='form';
		addLink.intlink.className='formgr';
	}
}

function resetClass(x)
{
	for (z=0; z<x.elements.length; z++)
	{
		if (x.elements[z].className=="formch")
			x.elements[z].className="form"
	}
}

function delItem (type, query, value, refer, refValue)
{
	if(confirm ("Are you sure you want to delete this " + type +	"?"))
	{
		var url="action/delete.asp?type=" + type + "&" + query + "=" + value + "&referer=" + refValue;
		location.href=url;
	}
}


function openWin(page, queryName, x, secQueryName, y, terQueryName, z)
{
	var winName = page + ".asp?" + queryName + "=" + x + "&" + secQueryName + "=" + y + "&" + terQueryName + "=" + z;
	var newWindow=window.open(winName, "newWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes");
	newWindow.focus();
	return true;
}

function openPrintPage(issueID, nlID, gID)
{
	var winName = "print.asp?i=" + issueID + "&nl=" + nlID + "&gID=" + gID;
	var newWindow=window.open(winName, "newWindow", "width=650,height=800,toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
	newWindow.focus();
	return true;
}

function openHTMLPage(issueID, nlID, gID)
{
	var winName = "html.asp?i=" + issueID + "&nl=" + nlID + "&gID=" + gID;
	var newWindow=window.open(winName, "newWindow", "width=650,height=800,toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
	newWindow.focus();
	return true;
}

function openPrintActionAlertPage(issueID, nlID, gID)
{
	var winName = "aa_print.asp?i=" + issueID + "&nl=" + nlID + "&gID=" + gID;
	var newWindow=window.open(winName, "newWindow", "width=650,height=800,toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
	newWindow.focus();
	return true;
}

function openHTMLActionAlertPage(issueID, nlID, gID, preview)
{
	var winName = "aa_html.asp?i=" + issueID + "&nl=" + nlID + "&gID=" + gID + "&p=" + preview;
	var newWindow=window.open(winName, "newWindow", "width=650,height=800,toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
	newWindow.focus();
	return true;
}

function errorCheck(x, y)
{
	switch(x)
	{
	case 1:
		y.login.select();
		break;
	case 2:
		y.password.select();
		break;
	case 3:
		window.opener.location.replace("/icvp.asp");
		window.close();
		break;
	case 4:
		y.newPass.value="";
		y.confPass.value="";
		y.password.select();
		break;
	case 5:
		y.linktext.select();
		break;
	case 6:
		window.opener.location.replace("/utilities/utilities.asp");
		window.close();
		break;
	default:
		y.login.focus()
	}
}

function confirmLogoff(q, qs, r)
{
	var newURL;
	if (r==0){
		if(confirm ("Are you sure you want to abort all changes made this session?")){
		newURL = "action/exit.asp?action=abort&referer=" + q + "&qs=" + qs;}
	}
	else {
		if(confirm ("Logoff and publish all changes?")){
		newURL = "action/exit.asp?action=logoff&referer=" + q + "&qs=" + qs}
	}
	window.location.href=newURL;
}

function setNA(x,y)
{
	if (x.selectedIndex == 3)
		y.selectedIndex = 3
}


function resetEditor(blockID) {
	var fName = "message" + blockID;
	document.frames[fName].location.href='includes/RTE/RTE_textarea.asp?QS1=' + blockID;
}

function retrieveHTML(thisForm, blockID) {
	var fName = "message" + blockID;
	thisForm.body.value = document.getElementById(fName).contentWindow.document.body.innerHTML;
}

function checkAddFile() {
	var f = document.forms['addFile'];
	if (f.name.value == "") {
		alert("Display Name is required");
		f.name.focus();
		return false;
	}
	if (f.link.value == "") {
		alert("File name is required");
		f.link.focus();
		return false;
	}
	return true;
}

function updateSectID() {
	var f = document.forms['addFile'];
	f.sectID.value = f.sectIDmenu.options[f.sectIDmenu.selectedIndex].value;
}
	
function valEditStory(entrytype) {
	var f = document.editStory;
	if (entrytype=="section") {
		if (isNaN(f.sectID.value) || f.sectID.value == "" || f.sectID.value < 1) {
			alert ("Section # must be a postive non-zero number.");
			f.sectID.select();
			return false;
		}
	}
	else {
		if (isNaN(f.entryID.value) || f.entryID.value == "" || f.entryID.value < 1) {
			alert ("The " + entrytype + " # must be a postive non-zero number.");
			f.entryID.select();
			return false;
		}
	
	}
	
	if (f.header.value == "") {
		alert ("Header is a required field.");
		f.header.select();
		return false;
	}
	return true;
}

function delStory (issueID, nlID, sectID, entryID) {
	if (nlID > 0 && issueID > 0) {
		if (entryID == 0) {
			strConfirmText = 'Are you sure you want to delete this section heading?  If there are stories associated with it, they will be deleted, too.  This cannot be undone.';
		}
		else {
			strConfirmText = 'Are you sure you want to delete this story? This cannot be undone.';
		}
		if(confirm(strConfirmText)) {
			window.location.href = 'action/nl_delStory.asp?issueID=' + issueID + '&nlID=' + nlID + '&sectID='+ sectID + '&entryID=' + entryID;
		}
	}
}

function valQua(f) {
	if (isNaN(f.qua.value) || parseInt(f.qua.value) < 1)
	{
		alert ("Quanity must be a positive number.");
		f.qua.value="1";
		f.qua.focus();
		return false;
	}
	return true;
}

function valDonation() {
	var ctl = document.forms['donation'].amt;
	if (ctl.value == "" || isNaN(ctl.value))
	{
		alert ("Please enter a whole dollar amount.");
		ctl.value = "";
		ctl.focus();
		return false;
	}
	return true;
}
	
// End -->