<%
' *****************************************************************************
'
' Copyright (C) 2001 Microsoft Corporation. All rights reserved.
'
'	This file define the set of Hook functions that can be customized to
'	override the behavior of the New Page Save Dialog
'
'	The set of Hook functions exposed are:
'
'	- Sub OnInternalAfterInitNewPageSaveDlg( ByVal pASPPageManager )
'
' *****************************************************************************


' -----------------------------------------------------------------------------
'
'	This function is called to allow site designer to override the default
'	behavior of the CNCASPPageManager_NewPageSaveDlg class for the New Page
'	Save dialog.
'
'	@pASPPageManager [in] - the CNCASPPageManager_NewPageSaveDlg class. See
'							that file for the properties and methods it exposes.
'
' -----------------------------------------------------------------------------
Sub OnInternalAfterInitNewPageSaveDlg( ByVal pASPPageManager )
	' DEFAULT IMPLEMENTATION: do nothing

	' CUSTOM SCRIPT: modify properties on pASPPageManager
	'pASPPageManager.DefaultName = "Custom DefaultName"
	'pASPPageManager.DefaultDisplayName = "Custom DefaultDisplayName"

	If Not GetGlobalFeatureManager.FeatureIsRegistered( _
									IDS_FEATURE_CONNECTOR_FRAMEWORK ) Then
		Exit Sub
	End If


	Dim pNRCSPosting
	Set pNRCSPosting = g_pNRCSSession.ThisPosting

	If pNRCSPosting.IsProductPosting Then
		Dim pProduct
		Dim strProductName

		Set pProduct = pNRCSPosting.Product

		strProductName = HTMLDecode(pProduct.GetProductProperties.Fields("Name"))

		pASPPageManager.DefaultName = strProductName
		pASPPageManager.DefaultDisplayName = strProductName				

	End If

End Sub

'--[Private]
Function HTMLDecode(strEncodedString)

	Dim strTemp, i
	strTemp = strEncodedString
	strTemp = Replace( strTemp, "&quot;", chr(34) )
	strTemp = Replace( strTemp, "&lt;"  , chr(60) )
	strTemp = Replace( strTemp, "&gt;"  , chr(62) )
	strTemp = Replace( strTemp, "&amp;" , chr(38) )
	strTemp = Replace( strTemp, "&nbsp;", chr(32) )
	For i = 1 to 255
		strTemp = Replace( strTemp, "&#" & i & ";", chr( i ) )
	Next
	HTMLDecode = strTemp

End Function

%>