function OnTagSearchButtonClick ( oEvent )
{
	var txtT = document.getElementById ( 'txtTagSearch' );

	if ( txtT != null )
	{
		var sTag = txtT.value;

		if ( sTag.length > 0 )
			document.location.replace ( 'MediaList.aspx?p=1&t=' + encodeURI ( sTag ) );
		else
			ShowMessage ( 'No tag to search for', 'Enter a tag to search for it.' );
	}
}

function OnTagSearchKeyPress ( oEvent )
{
	if ( !OnTextBoxKeyPress ( oEvent ) )
		return ( false );
	
	oEvent = GetEvent ( oEvent );
	
	var lCode = GetKeyCodeFromEvent ( oEvent );
	if ( lCode == 13 )
	{
		var btnB = document.getElementById ( 'btnTagSearch' );

		if ( btnB != null )
			btnB.click ();

		return ( false );
	}
}