<%
' ************************************************************************
' File:		/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/ResourceBrowser/Common/ResoureBrowserCommon.inc
' Author:	Microsoft Corporation.
' Purpose:	Provide functions used by both Resource Authoring and Resource Management.
'
' ************************************************************************

' ---- [Public] Show the mime type selection droplist UI
Sub ShowMimeTypeSel( strRestype )
%>
	<select name="NC_Mime">
		<option>Select File Type
		<option>- - - - - 
<%	If (strResType = IDS_RESTYPE_ATTACHMENT) Then %>
		<option value="application/msword">&nbsp;&nbsp;MS Word Document
		<option value="application/vnd.ms-excel">&nbsp;&nbsp;MS Excel Document
		<option value="application/pdf">&nbsp;&nbsp;PDF	Document
<%
	End If
	If (strResType = IDS_RESTYPE_ATTACHMENT) Or (strResType = IDS_RESTYPE_IMAGE) Then
%>
		<option value="image/gif">&nbsp;&nbsp;GIF Image
		<option value="image/jpeg">&nbsp;&nbsp;JPEG Image
		<option value="image/png">&nbsp;&nbsp;PNG Image
<%
	End If
	If (strResType = IDS_RESTYPE_ATTACHMENT) Or (strResType = IDS_RESTYPE_VIDEO) Then
%>
		<option value="video/mpeg">&nbsp;&nbsp;MPEG Movie
		<option value="video/quicktime">&nbsp;&nbsp;QuickTime Movie
		<option value="video/msvideo">&nbsp;&nbsp;AVI Movie
		<option value="video/x-ms-asf">&nbsp;&nbsp;ASF Movie
<%	End If %>
	</select>
<%
End Sub


' ---- [Public] Round up a number
Function RoundUp(strNumber)

	Dim strNumberInt
	
	strNumberInt = Fix(strNumber)
	If strNumber = strNumberInt Then
		RoundUp = strNumber
	Else
		RoundUp = strNumberInt + 1
	End If

End Function

' ---- [Public] Show the mime type selection 
Function GetMimeType( strRestype )

	If (strResType = IDS_RESTYPE_IMAGE) Then
		GetMimeType = "image"
	ElseIf (strResType = IDS_RESTYPE_VIDEO) Then
		GetMimeType = "video"
	Else
		' unknown type
		GetMimeType = ""
	End If
	
End Function

' ---- [Public] Get the upload directory from the SCAPI so upload files
'				can be stored in there
Function GetSCAUpLoadDirectory()
	On Error Resume Next
	
	GetSCAUpLoadDirectory = ""
	
	GetSCAUpLoadDirectory = AutoSession.TemporaryUploadFolder

End Function

%>
