// JavaScript Document

/* 
   Toggles the display of div.id="blockNotSelf" off when the patient relationship
   is set to "self"(18) and on otherwise
*/
function evalRelation() {
	theField = document.getElementById? document.getElementById("patRelation"): null;
	showBlock = document.getElementById? document.getElementById("blockNotSelf"): null;
	
	if (theField.value == "18") {
		showBlock.style.display="none";
	}
        else {
               showBlock.style.display="block";
        }
}

/* This sets the text and background of the toggling Vouchers controls */
function swapSearch() {
	var swapTextHide = "Show Search Controls";
	var swapTextShow = "Hide Search Controls";
	var swapBgHide = "url(../../images/iconBoxPlus.gif)";
	var swapBgShow = "url(../../images/iconBoxMinus.gif)";
	var swap = document.getElementById('toggleText01'); 
	var toggleBlock = document.getElementById('voucherSearchArea'); 
	
	//alert(toggleBlock.style.display);
	
	if (toggleBlock.style.display == "none") {
		swap.innerHTML = swapTextShow;
		swap.style.backgroundImage = swapBgShow;
		toggleBlock.style.display = "block";
	}
	else {
		swap.innerHTML = swapTextHide;
		swap.style.backgroundImage = swapBgHide;
		toggleBlock.style.display = "none";
	}
}
