﻿/***********************************************
* Functionality for expanding menu
***********************************************/

function navExp(obj) {
var CurrentSign = obj.innerHTML
// Uncomment the line below to enable '+' , '-' switching, but it must also be enabled in menuadapter.cs
// obj.innerHTML = CurrentSign == "+" ? "-" : "+";
if (obj.nextSibling.nextSibling.className == "AMSHW") 
{
	obj.nextSibling.nextSibling.className = "AMHID";
	// If the expand arrow isn't selected (ie classname does not include AMS), change the background
	if (obj.className == "AMEXPDOWN") obj.className="AMEXP";
	}
	else {
	obj.nextSibling.nextSibling.className = "AMSHW";
	if (obj.className == "AMEXP") obj.className="AMEXPDOWN";
} 
}

/***********************************************
* Functionality for a popup window
***********************************************/

function newWindow(orders)
{
  var detailsWindow;
  var locX, locY;
  locX = (screen.width > 500) ? (screen.width - 500) / 2 : 0;
  locY = (screen.height > 600) ? (screen.height - 600) / 2 : 0;
  detailsWindow = window.open(orders, "details", "width=500,height=600,scrollbars=1,left=" + locX + ",top=" + locY);
}

/***************************************************
* Functionality for showing / hiding elements by id
***************************************************/

function ToggleDisplay(IDName)
{
var id = document.getElementById(IDName);
if (id.style.display == "none")
	{
		id.style.display = "";
	}
	else
	{
		id.style.display = "none";
	}
}

/***************************************************
* Functionality for changing the text of a button
***************************************************/

function ToggleButtonText(Button, Text1, Text2)
{
if (Button.value == Text1)
	{
		Button.value = Text2;
	}
	else
	{
		Button.value = Text1;
	}
}




