
function toggleLayer()
{
	whichLayer = document.mp3.mp3query.value;
	if (document.getElementById)
	{
	// this is the way the standards work
		if (whichLayer == "date")
		{
			var style2 = document.getElementById('date').style;
			style2.display = "block";
			var style3 = document.getElementById('name').style;
			style3.display = "none";
		}
		else if (whichLayer == "name")
		{
			var style2 = document.getElementById('date').style;
			style2.display = "none";
			var style3 = document.getElementById('name').style;
			style3.display = "block";
		}
		
		else {
			var style2 = document.getElementById('date').style;
			style2.display = "none";
			var style3 = document.getElementById('name').style;
			style3.display = "none";
			
		}
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
}

function openNewWindow(url) {
  popupWin = window.open(url, 
    'target01_window',
    'resizable=yes,scrollbars=no, menubar=no, status=yes, toolbar=no, location = no, width=500, height=700,left=0,top=0');
}

function openPic (pic, wDim, hDim){
	wDim = wDim + 20;
	hDim = hDim + 20;
    Tone = window.open(pic,
    'target01_window',
    'resizable=no,scrollbars=no, menubar=no, status=yes, toolbar=no, location = no, width = '+ wDim +', height = '+ hDim);
	Tone.focus();
}

function getElementValue(formElement)
{
	if(formElement.length != null) var type = formElement[0].type;
	if((typeof(type) == 'undefined') || (type == 0)) var type = formElement.type;

	switch(type)
	{
		case 'undefined': return;

		case 'radio':
			for(var x=0; x < formElement.length; x++) 
				if(formElement[x].checked == true)
			return formElement[x].value;

		case 'select-multiple':
			var myArray = new Array();
			for(var x=0; x < formElement.length; x++) 
				if(formElement[x].selected == true)
					myArray[myArray.length] = formElement[x].value;
			return myArray;

		case 'checkbox': return formElement.checked;
	
		default: return formElement.value;
	}
}