//**********************************************************************************
//*
//*  show
//*  Shows the element by id
//*  Inputs:  var id - the id of the element
//*  Output:  None
//*
//***********************************************************************************
function show(id)
{
	document.getElementById(id).style.display = "block";
}

//**********************************************************************************
//*
//*  hide
//*  Hides the element by id
//*  Inputs:  var id - the id of the element
//*  Output:  None
//*
//***********************************************************************************
function hide(id)
{
	document.getElementById(id).style.display = "none";
}

//***********************************************************************************
//*
//*  openPopupWindow
//*  Opens a popup window using the specified url, and defining the width and height
//*  of the window
//*  Inputs:  var url - the url to open
//*           var width - the width of the window in pixels
//*           var height - the height of the window in pixels
//*  Output:  None
//*
//************************************************************************************
function openPopupWindow(url, width, height)
{
	window.open(url, "", "width=" + width + ",height=" + height + ",location=no,menubar=no,toolbar=no,scrollbars=no,resizable=no");
}

//***********************************************************************************
//*
//*  openScrollablePopupWindow
//*  Opens a popup window using the specified url, and defining the width and height
//*  of the window
//*  Inputs:  var url - the url to open
//*           var width - the width of the window in pixels
//*           var height - the height of the window in pixels
//*  Output:  None
//*
//************************************************************************************
function openScrollablePopupWindow(url, width, height)
{
	window.open(url, "", "width=" + width + ",height=" + height + ",location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=no");
}



///Used expand div class
function ToggleTerms() {
	var moreText = "(More...)";
	var hideText = "(Hide...)";
	var height = "70px";
	if(MoreDescription.innerText == moreText) {
		divTerms.style.overflow = "";
		divTerms.style.height = "";
		MoreDescription.innerText = hideText;
	}
	else {
		divTerms.style.overflow = "auto";
		divTerms.style.height = height;
		MoreDescription.innerText = moreText;
	}
}

function HideSubmitButton() {
	var isValid = true;
	if (typeof(Page_ClientValidate) == 'function') {
		isValid = Page_ClientValidate();
	}
	if(isValid) {
		submitDiv.style.display= "none";
		pleaseWaitDiv.style.display = "inline";
	}
}

///Populate drop-down list from two JavaScript arrays:
function populateDropDown(dp, values, texts, SelectedValue){
	if(dp.length <= 1){
		var x=0;
		for (x=0; x<values.length; x++) {
			var isSelected = (values[x] == SelectedValue);
			dp.options[x] = new Option(texts[x], values[x]);
			if(values[x] == SelectedValue) {
				dp.options[x].selected = true;
			}
		}
	}
}
