
function toggleTab (clickedTab)
{
//changed ctl00 from ctl01 as thats the output we see on "view source"
	var tdSearchTab =		document.all.item('ctl00_tdSearchTab');
	var tdAdvSearchTab =	document.all.item('ctl00_tdAdvSearchTab');
	var trSearch =			document.all.item('ctl00_trSearch');
	var trAdvSearch =		document.all.item('ctl00_trAdvSearch');
	var txtCurrTab =		document.all.item('ctl00_hdnCurrTab');
	
	if (clickedTab.id == tdSearchTab.id)
	{
		// show search tab
		tdSearchTab.className = 'TabOn';
		tdAdvSearchTab.className = 'TabOff';
		trSearch.style.display = 'block';
		trAdvSearch.style.display = 'none';
		txtCurrTab.value = 'Search';
	}
	else
	{
		// show advanced search tab
		tdSearchTab.className = 'TabOff';
		tdAdvSearchTab.className = 'TabOn';
		trSearch.style.display = 'none';
		trAdvSearch.style.display = 'block';
		txtCurrTab.value = 'AdvSearch';
	}
	
}

function popUpWindow(URLStr, left, top, width, height) {
		var newwindow = '';
		if (!newwindow.closed && newwindow.location) {
		newwindow.location.href = url;
	}
	else
	{
	window.open(URLStr, 'Window', 'toolbar=yes,location=no,directories=no,status=1,menubar=yes,scrollbars=1,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	}
}
function popWindow(URLStr,Name, left, top, width, height) {		

	window.open(URLStr, Name, 'toolbar=yes,location=no,directories=no,status=1,menubar=yes,scrollbars=1,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function keyCancel ()
{
	// Called from the <body> tag.
	// Cancels the enter key for
	// all textboxes to eliminate
	// improper button clicks.
	
	if (window.event.keyCode == 13) 
	{
		event.returnValue = false;
		event.cancel = true;
	}
}

function keyPress (btnToClickId)
{
	// Called from a textbox to submit
	// a form.  The Id of the button to
	// click is passed as a parameter.
	// This function fires before
	// the "keyCancel" function above,
	// making it possible to click a btn
	// from a textbox using the enter key.
	
	if (window.event.keyCode == 13) 
	{
		var btn = document.getElementById(btnToClickId);
		btn.click();
	}
}