<%

' -- Sample HTML to format the Site Mode Switch link
Const IDS_SITEMODE_FONT_BEGIN = "<font face=""Verdana,Arial,sans-serif"" size=""3""><b>"
Const IDS_SITEMODE_FONT_END = "</b></font>"

' -----------------------------------------------------------------------------
'
'	[Public] Shows the "Site Mode Switch" link
'
' -----------------------------------------------------------------------------
Sub ShowSiteModeSwitch()
	Response.Write( IDS_SITEMODE_FONT_BEGIN )
	
	' To see the EditSite link, the user has to have access rigths to edit the site
	' plus she has to have logged in as someone other than the default guest
	If IsSwitchToEditSiteVisible Then
		ShowSwitchToEditSiteLink
	ElseIf IsSwitchToLiveSiteVisible Then
		ShowSwitchToLiveSiteLink
	End If
	
	Response.Write( IDS_SITEMODE_FONT_END )
End Sub

' -----------------------------------------------------------------------------
'
' 	[Private] Show the "Site Mode Switch" link in the Live Mode to switch to
'				Site Edit mode
'
' -----------------------------------------------------------------------------
Sub ShowSwitchToEditSiteLink()
%>
	<a target="_top" href="<%= IDS_FRAMEWORK_VIRTUAL_PATH & "/Internals/Main/CheckJavaScript.asp?" & URLEncodedQueryString() %>"
		><nobr><%= IDS_UI_SWITCH_TO_EDITSITE %></nobr></a>
<%
End Sub

' -----------------------------------------------------------------------------
'
' 	[Private] Show the "Site Mode Switch" link in the Site Edit mode to switch
'				to Live mode
'
' -----------------------------------------------------------------------------
Sub ShowSwitchToLiveSiteLink()
	'	Ask users to confirm if they want to switch to live site when they are editing a page.
	'	This is because any work not saved will be lost.
	'	For Netscape users only since IE users will be handled by window event onbeforeunload.
	Dim strOnClickAttribute
	If (isNetscape And _
		Request.QueryString(IDS_QPARAM_NREMIT) = IDS_EMIT_THINEDIT And _
		Request.QueryString(IDS_QPARAM_WBCPURPOSE) = IDS_WBCPURPOSE_AUTHORING) Then
		strOnClickAttribute = "onclick=""return confirm(IDS_SWITCH_TO_LIVE_CONFIRM)"""
	Else
		strOnClickAttribute = ""
	End If
%>
	<a target="_top" href="<%=GetLiveSiteURL()%>" <%= strOnClickAttribute %>
			><nobr><%= IDS_UI_SWITCH_TO_LIVESITE %></nobr></a>
<%
End Sub

%>
