function setFocus(thefield)
{
	var elem = document.getElementById(thefield);
	
	if(elem)
	{
		elem.focus();
	}
}

function popup(url, target, height, width)
{
	win = window.open(url,
				target,
				"height="+height+",width="+width+
				",status=yes,scrollbars=yes,toolbar=no,menubar=no,location=no");
	win.focus();
}

function userpopup(url, target, height, width)
{
	win = window.open(url + "?id=" + document.forms.userlookup.userlookupid.value,
				target,
				"height="+height+",width="+width+
				",status=yes,scrollbars=yes,toolbar=no,menubar=no,location=no");
	win.focus();
}


function OpenCalendar(idname, postBack)
{
	popUp = window.open('Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=185,height=240,left=200,top=250');
}

function jsHSH_toggle(objid)
{
	var theobj = (document.getElementById(objid));
	var theobjt = (document.getElementById(objid + '_toggle'));
	if (theobj.style.display == "")
	{
		theobj.style.display = "none";
		theobjt.value = "View";
	}
	else
	{
		theobj.style.display = "";
		theobjt.value = "Hide";
	}
}

function enable_button(ticker, objid)
{
	var theobj1 = (document.getElementById(ticker));
	var theobj2 = (document.getElementById(objid));
	if (theobj1.checked)
	{
		theobj2.disabled = false;
	}
	else
	{
		theobj2.disabled = true;
	}
}

function toggleDisplay(objid)
{
	var theobj = (document.getElementById(objid));
	if (theobj.style.display == "")
	{
		theobj.style.display = "none";
	}
	else
	{
		theobj.style.display = "";
	}
}