
// Displays a previously hidden div and hides the currently visible one
function ShowGlossary(div) {
	ShowAllGlossary("hideAll")
	if (document.layers)
	{
		if (typeof current != 'undefined') { document.layers[current].display = 'none'; }
		if (typeof GlossarySearchResults != 'undefined') { document.layers["GlossarySearchResults"].display = 'none'; }
		document.layers[div].display = 'block';
	}
	else if (document.all)
	{
		if (typeof current != 'undefined') { document.all[current].style.display = 'none'; }
		if (typeof GlossarySearchResults != 'undefined') { document.all["GlossarySearchResults"].style.display = 'none'; }
		document.all[div].style.display = 'block';
	}
	else if (document.getElementById)
	{
		if (typeof current != 'undefined') { document.getElementById(current).style.display = 'none'; }
		if (typeof GlossarySearchResults != 'undefined') { document.getElementById("GlossarySearchResults").style.display = 'none'; }
		document.getElementById(div).style.display = 'block';
	}
	current = div;
}


// Displays a previously hidden div and hides the currently visible one

function ShowAllGlossary(hide) {
	
	for(i=0; i<abc.length; i++) { 
		if (document.layers)
		{
			var div = abc[i];
			if (typeof GlossarySearchResults != 'undefined') { document.layers["GlossarySearchResults"].display = 'none'; }
			if(hide!="hideAll") {
				document.layers[div].display = 'block';
			} else {
				document.layers[div].display = 'none';
			}
		}
		else if (document.all)
		{
			var div = abc[i];
			if (typeof GlossarySearchResults != 'undefined') { document.all["GlossarySearchResults"].style.display = 'none'; }
			if(hide!="hideAll") {
				document.all[div].style.display = 'block';
			} else {
				document.all[div].style.display = 'none';
			}
		}
		else if (document.getElementById)
		{
			var div = abc[i];
			if (typeof GlossarySearchResults != 'undefined') { document.getElementById("GlossarySearchResults").style.display = 'none'; }
			if(hide!="hideAll") {
				document.getElementById(div).style.display = 'block';
			} else {
				document.getElementById(div).style.display = 'none';
			}

		}

	}
}


// opens pop up window
function PopUp(url, section) {
	if (section == "Newsletter") {
		Newsletter= window.open(url, "Newsletter", "location=no, scrollbars=yes, resizable=yes, toolbar=no, menubar=no, width=650, height=600" ); 
			if (window.focus) {Newsletter.focus()}  
	} else if (section == "Tearsheet") {
		Tearsheet= window.open(url, "Tearsheet", "location=no, scrollbars=yes, resizable=yes, toolbar=no, menubar=no, width=607, height=700" ); 
			if (window.focus) {Tearsheet.focus()}  
	} else if (section == "EmailFriend") {
		EmailFriend= window.open(url, "EmailFriend", "location=no, scrollbars=yes, resizable=yes, toolbar=no, menubar=no, width=375, height=580" ); 
			if (window.focus) {EmailFriend.focus()}  
	}
	
}


// show and hide text input hint over password inputs
function HidePassHint(x){
x.style.display='none';
document.getElementById('ppass').style.display='block' ;
document.getElementById('ppass').focus();
};

function ShowPassHint(x){
	if (x.value == "") {
		x.style.display='none';
		document.getElementById('phint').style.display='block' ;
	}
//x.style.display='none';
//document.getElementById('phint').style.display='block' ;
//document.getElementById('phint').value=(x.value) ?'thanks' :'password';
};


// redirect user to given page after x ammount of second
function Redirect(page){
	setTimeout('DelayedRedirect("'+page+'")', 2000);
}
function DelayedRedirect(page) {
	window.location = page;
}


//close collapsible panel that was open and store the one that's open now
