//Functions included at the top of Info pages
	function btn_changeview(intVW,npid)
	{
    var curLoc = document.location.href;
		document.location.href = '/information/default.asp?NavPageID=' + npid + '&View=' + intVW;
		return false;
	}

	function btn_admin_onclick(strReq,iid,npid)
	{
		if (strReq == 'edit_noe' || strReq == 'delete_noe')
		{
			alert('This item has already been edited, but has not yet been approved.  Requests for further edits (or delete) will not be accepted until the last edit is approved or rejected.');
			return false;
		}
		else if (strReq == 'edit')
		{
			document.location.href = '/myadmin/info/item/item.asp?NavPageID=' + npid + '&ItemID=' + iid + '&NeedsApproval=0';
			return false;
		}
		else if (strReq == 'edit_a')
		{
			document.location.href = '/myadmin/info/item/item.asp?NavPageID=' + npid + '&ItemID=' + iid + '&NeedsApproval=1';
			return false;			
		}
		else if (strReq == 'delete_nod' || strReq == 'edit_nod')
		{
			alert('The item has been staged for delete.  Requests for edits or deletes are not accepted until the delete is approved or rejected.');
			return false;
		}
		else if (strReq == 'delete')
		{
			if (confirm('ATTENTION! You have selected to remove this Item.  Deleting this item will permenantly remove it and all associated data.  To permenantly remove this item, click OK, otherwise click cancel.'))
			{
				document.location.href = '/myadmin/info/item/item_delete.asp?NavPageID=' + npid + '&ItemID=' + iid + '&ReturnURL=%2Finformation%2Fdefault%2Easp%3FNavPageID%3D1482';
				return false;
			}
			return false;
		}
		else if (strReq == 'delete_a')
		{
			if (confirm('ATTENTION! You have selected to delete this Item.  Deleting this item will permenantly remove it and all associated data from the system.  You do NOT have permission to immediately delete this item, so it will be staged for approval of the delete.  The item will remain on the page until the approval of the delete has been processed. To mark this item for permanant removal, click OK, otherwise click CANCEL.'))
			{
				document.location.href = '/myadmin/info/item/item_stage.asp?Type=1&NavPageID=' + npid + '&ItemID=' + iid + '&ReturnURL=%2Finformation%2Fdefault%2Easp%3FNavPageID%3D1482';
				return false;
			}
			return false;
		}
	}			

	function toggleLayer( whichLayer )
{	
	DisappearDivsByClass('ItemText');
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function DisappearDivsByClass(classToDisappear)
{
	//alert(classToDisappear);

	var divs = document.getElementsByTagName('div')
	for (var i=0; i<divs.length; i++) {
		//alert(divs[i].className);
		//alert(divs[i].id);
		if (divs[i].id != 'StayVisible_' + classToDisappear)
		{
			if (divs[i].className == classToDisappear) {
				divs[i].style.display = 'none';
			}
		}
	}
}
