var gObjToAct;
function registerActionObject( objToAct ) {	 
	 if(navigator.userAgent.indexOf("IE")==-1) { window.captureEvents(Event.KEYDOWN); }
   gObjToAct=objToAct;	
}
function tryAction(evt) {
	if(navigator.userAgent.indexOf("IE")!=-1) {
		if(event.keyCode==13) { try { gObjToAct.focus(); gObjToAct.onclick(); } catch (ex) {} }
	} else {
		if(evt.keyCode==13) { try { gObjToAct.focus(); gObjToAct.onclick(); } catch (ex) {} }
	}
}
document.onkeydown=tryAction;

function FocusTo(obj1,content,obj2)
{	
	if ( content.length == obj1.maxLength )
	{				
		obj2.focus();
	}			
}	

function FormatDate(obj1,content,obj2)
{	
	if ( content.length == 2 )
	{				
		obj1.value = obj1.value + "/";
	}			
	else if ( content.length == 5 )
	{
		obj1.value = obj1.value + "/";
	}
	else if ( content.length == obj1.maxLength )
	{
		obj2.focus();
	}
}	