function autoSelect(id)
{
	if ( document.getElementById )
	{
		var e = document.getElementById(id);
		if ( e.select )
		{
			e.select();
		}
		if ( e.focus )
		{
			e.focus();
		}
	}
}

function keepAlive()
{
	divKeepAlive.style.visibility = "visible";
	beep();
}

function pageTimeout()
{
	document.location = document.location;
}

function popupHelp(url)
{
	try 
	{
		if ( window.showModalDialog )
		{
			window.showModalDialog(url, window, 
				"dialogHeight:400px; dialogWidth:300px; resizable:no; status:no;");
		}
		else
		{
			var win = window.open(url,"winPopUp",
				"height=400,width=300,scrollbars=yes");
			win.focus();
		}
	}
	catch (e) 
	{
		alert("Unable to display help. Please disable any\n"
			+ "popup blocking software and try again.");			
	}
}

function popupSessionUploader(sender,e)
{
	try 
	{
		var id = new Date();
		var win = window.open("sessionUploader.aspx@id=" + id,"winPopUp",
			"height=225,width=300,scrollbars=true");
		win.focus();
		sender.form.SessionUploaderId.value = id;
	}
	catch (e) 
	{
		alert("Unable to display upload tool. Please disable any\n"
			+ "popup blocking software and try again.");			
	}
}

function setFooterPosition( pgId, ftrId )
{
	return; // disabled for review
	var availHeight = new Number(0);
	var ftr = document.getElementById(ftrId);
	var pg = document.getElementById(pgId);
	
	if ( typeof( window.innerWidth ) == 'number' ) 
	{
		//Non-IE
		availHeight = window.innerHeight;
	} 
	else if ( document.documentElement 
		&& ( document.documentElement.clientWidth 
			|| document.documentElement.clientHeight ) ) 
	{
		//IE 6+ in 'standards compliant mode'
		availHeight = document.documentElement.clientHeight;
	} 
	else if ( document.body 
		&& ( document.body.clientWidth 
			|| document.body.clientHeight )) 
	{
		//IE 4 compatible
		availHeight = document.body.clientHeight;
	}
	
	// determine page container height
	pgHeight = pg.offsetHeight;
	if ( ftr.style.position == "absolute" || ftr.style.visibility == "" )
	{
		// footer is floating, so add it's height
		pgHeight += ftr.offsetHeight;
	}

	// check needed height against available space
	if ( pgHeight < availHeight )
	{
		// the page container is smaller than the available space
		// so force the footer to the bottom of the window
		ftr.style.position = "absolute";
		ftr.style.top = ( availHeight - ftr.offsetHeight ) + "px";
	}
	else
	{
		// the page container is larger than the available space
		// so force footer to flow with the page content
		ftr.style.position = "relative";
		ftr.style.top = "";
	}
	
	// footer is hidden by default
	// prevents weird flashing should it move on page load
	ftr.style.visibility = "visible"
}			
