function setLastFocus()
{
		document.getElementById('LastFocus').value = document.activeElement.name;
}
function keyboardClicked()
{
			var element,i,found;
			element = document.getElementById(document.getElementById('LastFocus').value);
			if (element != null)
			{ 
				if (element.type != 'text' && element.type != 'textarea')
				{
					i = 0;
					found=0;
					while (document.forms[0].elements[i]!=null && !found)
					{
						if (document.forms[0].elements[i].type == 'text' || document.forms[0].elements[i].type == 'textarea')
						{
							element = document.forms[0].elements[i];
							element.focus();
							found = 1;
						}
						i++
					}
					window.showModelessDialog('virtualKeyboard.htm?FieldName=openchild',window,'dialogHeight=15;dialogWidth=25;status=no;dialogLeft=5;dialogTop=5');
				}
				else
				{
					element.focus();
					window.showModelessDialog('virtualKeyboard.htm?FieldName=openchild',window,'dialogHeight=15;dialogWidth=25;status=no;dialogLeft=5;dialogTop=5');
				}
			}
			else
			{
					i = 0;
					found=0;
					while (document.forms[0].elements[i]!=null && !found)
					{
						if (document.forms[0].elements[i].type == 'text' || document.forms[0].elements[i].type == 'textarea')
						{
							element = document.forms[0].elements[i];
							element.focus();
							found = 1;
						}
						i++
					}
					window.showModelessDialog('virtualKeyboard.htm?FieldName=openchild',window,'dialogHeight=15;dialogWidth=25;status=no;dialogLeft=5;dialogTop=5');
			}
}
 