<%
'Virtual Images Directory
If Image_Dir = "" Then
	Image_Dir = "/dimages/"
End If


Function Get_Image_Height_Width_By_Lodging_Item(Item_ID, Image_Type_ID)

	Dim Image_File, Image_Alt

	Dim SQLImage, RSImage
	SQLImage = "Get_Image_By_Lodging_Item @Item_ID='" & Item_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Session("Image_Height") = RSImage("Image_Height") 
		Session("Image_Width") = RSImage("Image_Width") 
	Else
		Session("Image_Width") = "300"
		Session("Image_Height") = "200"
	End If

	Get_Image_Height_Width_By_Lodging_Item = ""

End Function


Function Get_Image_By_Lodging_Item(Item_ID, Image_Type_ID, No_Str)

	Dim Image_File, Image_Alt

	Dim SQLImage, RSImage
	SQLImage = "Get_Image_By_Lodging_Item @Item_ID='" & Item_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
		Image_Alt = RSImage("Image_Alt")
	Else
		Image_File = "blank.gif"
		Image_Alt = ""
	End If

	If No_Str = True Then
		Get_Image_By_Lodging_Item = ""
	Else
		Get_Image_By_Lodging_Item = "<img src=""" & Image_Dir & Image_File & """ alt=""" & Image_Alt & """>"
	End If

End Function


Function Get_Image_By_Group(Group_ID, Image_Type_ID, No_Str)

	Dim Image_File, Image_Alt


	Dim SQLImage, RSImage
	SQLImage = "Get_Image_By_Group @Group_ID='" & Group_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
		Image_Alt = RSImage("Image_Alt")
		Get_Image_By_Group = "<img src=""" & Image_Dir & Image_File & """ alt=""" & Image_Alt & """>"
	Else
		If No_Str = True Then
			Get_Image_By_Group = ""
		Else
			Image_File = "blank.gif"
			Image_Alt = ""
			Get_Image_By_Group = "<img src=""" & Image_Dir & Image_File & """ alt=""" & Image_Alt & """>"
		End If
	End If

End Function


Function Get_Image_By_Entity(Entity_ID, Image_Type_ID, No_Str)

	Dim Image_File, Image_Alt


	Dim SQLImage, RSImage
	SQLImage = "Get_Image_By_Entity @Entity_ID='" & Entity_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
		Image_Alt = RSImage("Image_Alt")
		Get_Image_By_Entity = "<img src=""" & Image_Dir & Image_File & """ alt=""" & Image_Alt & """>"
	Else
		If No_Str = True Then
			Get_Image_By_Entity = ""
		Else
			Image_File = "blank.gif"
			Image_Alt = ""
			Get_Image_By_Entity = "<img src=""" & Image_Dir & Image_File & """ alt=""" & Image_Alt & """>"
		End If			
	End If

End Function


Function Get_Image_By_Entity_Or_Brand (Entity_ID, Image_Type_ID, No_Str)

	Dim Image_File, Image_Alt


	Dim SQLImage, RSImage
	SQLImage = "Get_Image_By_Entity @Entity_ID='" & Entity_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
		Image_Alt = RSImage("Image_Alt")
		Get_Image_By_Entity_Or_Brand = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """ align=""center"">"
	Else
		SQLImage = "Get_Image_Brand_By_Entity @Entity_ID='" & Entity_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
		Set RSImage = Conn.Execute(SQLImage)
	
		If Not RSImage.EOF Then
			Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
			Image_Alt = RSImage("Image_Alt")
		Else
			Image_File = "blank.gif"
			Image_Alt = ""
		End If
	
		If No_Str = True Then
			Get_Image_By_Entity_Or_Brand = ""
		Else
			Get_Image_By_Entity_Or_Brand = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
		End If
	End If

End Function


Function Get_Image_By_Group_Or_Brand (Group_ID, Image_Type_ID, No_Str)

	Dim Image_File, Image_Alt


	Dim SQLImage, RSImage
	SQLImage = "Get_Image_By_Group @Group_ID='" & Group_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
		Image_Alt = RSImage("Image_Alt")
		Get_Image_By_Group_Or_Brand = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
	Else
		SQLImage = "Get_Image_Brand_By_Group @Group_ID='" & Group_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
		Set RSImage = Conn.Execute(SQLImage)
	
		If Not RSImage.EOF Then
			Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
			Image_Alt = RSImage("Image_Alt")
		Else
			Image_File = "blank.gif"
			Image_Alt = ""
		End If
	
		If No_Str = True Then
			Get_Image_By_Group_Or_Brand = ""
		Else
			Get_Image_By_Group_Or_Brand = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
		End If
		
	End If


End Function



Function Get_Image_Brand_By_Group(Group_ID, Image_Type_ID, No_Str)

	Dim Image_File, Image_Alt


	Dim SQLImage, RSImage
	SQLImage = "Get_Image_Brand_By_Group @Group_ID='" & Group_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
		Image_Alt = RSImage("Image_Alt")
		Get_Image_Brand_By_Group = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
	Else
		SQLImage = "Get_Image_By_Group @Group_ID='" & Group_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
		Set RSImage = Conn.Execute(SQLImage)
	
		If Not RSImage.EOF Then
			Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
			Image_Alt = RSImage("Image_Alt")

			If No_Str = True Then
				Get_Image_Brand_By_Group = Image_Dir & Image_File
			Else
				Get_Image_Brand_By_Group = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
			End If

		Else
			Image_File = "blank.gif"
			Image_Alt = ""
			
			If No_Str = True Then
				Get_Image_Brand_By_Group = ""
			Else
				Get_Image_Brand_By_Group = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
			End If
		End If

	End If

End Function


Function Get_Image_Brand_By_Entity(Entity_ID, Image_Type_ID, No_Str)

	Dim Image_File, Image_Alt


	Dim SQLImage, RSImage
	SQLImage = "Get_Image_Brand_By_Entity @Entity_ID='" & Entity_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
		Image_Alt = RSImage("Image_Alt")
		Get_Image_Brand_By_Entity = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
	Else
		SQLImage = "Get_Image_By_Entity @Entity_ID='" & Entity_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
		Set RSImage = Conn.Execute(SQLImage)
	
		If Not RSImage.EOF Then
			Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
			Image_Alt = RSImage("Image_Alt")

			If No_Str = True Then
				Get_Image_Brand_By_Entity = Image_Dir & Image_File
			Else
				Get_Image_Brand_By_Entity = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
			End If

		Else
			Image_File = "blank.gif"
			Image_Alt = ""
			
			If No_Str = True Then
				Get_Image_Brand_By_Entity = ""
			Else
				Get_Image_Brand_By_Entity = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
			End If
		End If
		
	End If

End Function


Function Get_Image_By_Event(Event_ID, Image_Type_ID, No_Str)

	Dim Image_File, Image_Alt


	Dim SQLImage, RSImage
	SQLImage = "Get_Image_By_Event @Event_ID='" & Event_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
		Image_Alt = RSImage("Image_Alt")
	Else
		Image_File = "blank.gif"
		Image_Alt = ""
	End If

	If No_Str = True Then
		Get_Image_By_Event = ""
	Else
		Get_Image_By_Event = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
	End If

End Function


Function Get_Image_Sponsor_By_Event(Event_ID, Image_Type_ID, No_Str)

	Dim Image_File, Image_Alt


	Dim SQLImage, RSImage
	SQLImage = "Get_Image_Sponsor_By_Event @Event_ID='" & Event_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
		Image_Alt = RSImage("Image_Alt")
	Else
		Image_File = "blank.gif"
		Image_Alt = ""
	End If

	If No_Str = True Then
		Get_Image_Sponsor_By_Event = ""
	Else
		Get_Image_Sponsor_By_Event = "<img src=""" & Image_Dir & Image_File &	""" alt=""" & Image_Alt & """>"
	End If

End Function


Function Get_Destination_Image(Dest_ID, Image_Type_ID, No_Str)

	Dim Image_File, Image_Alt

	Dim SQLImage, RSImage
	SQLImage = "Get_Destination_Image @Dest_ID='" & Dest_ID & "', @Image_Type_ID='" & Image_Type_ID & "'"
	Set RSImage = Conn.Execute(SQLImage)

	If Not RSImage.EOF Then
		Image_File = RSImage("Image_ID") & "." & RSImage("Image_Ext")
		Image_Alt = RSImage("Image_Alt")
		If No_Str = True Then
			Get_Destination_Image = Image_Dir & Image_File
		Else
			Get_Destination_Image = "<img src=""" & Image_Dir & Image_File & """ alt=""" & Image_Alt & """>"
		End If
	Else
		If No_Str = True Then
			Get_Destination_Image = ""
		Else
			Image_File = "blank.gif"
			Image_Alt = ""
			Get_Destination_Image = "<img src=""" & Image_Dir & Image_File & """ alt=""" & Image_Alt & """>"
		End If
	End If
End Function


%>