<%
	'************************************************************************************
	'*																					*
	'*	MODIFICATION TO THIS SCRIPT OR ANY FILES INCLUDED WITH 							*
	'*		ONEWORLDSTORE IS DONE AT YOUR OWN RISK!										*
	'*	Product  : OneWorldStore														*
	'*	Version  : 9.0000																*
	'*	Modified : June 2004															*
	'*	Copyright:	Copyright (C) 2004 OneWorldStore.Com								*
	'*				Registration Number: 1024507										*
	'*				http://strategis.ic.gc.ca/											*
	'*																					*
	'************************************************************************************


	'************************************************************************************
	'*																					*
	'*																					*
	'*																					*
	'************************************************************************************
	Function owCONFIG_ReturnConfigValue( sConfVar )
		
		Dim rsStoreData

		If ( Application(sConfVar) = "" ) Then
			set rsStoreData = CreateObject("ADODB.Recordset")
			sSQLText = "SELECT * FROM settings WHERE settingKey = '" & SQLEncode(sConfVar) & "'"
			call DB_getFromDatabase (sSQLText, rsStoreData, "")
			If ( NOT rsStoreData.EOF ) Then
				owCONFIG_ReturnConfigValue = Trim(rsStoreData("settingValue"))
				Application.Lock
				Application(sConfVar) = owCONFIG_ReturnConfigValue
				Application.Unlock
			Else
				owCONFIG_ReturnConfigValue = ""
			End If
			Call DB_closeRecordset(rsObject)
			Set rsStoreData = Nothing
		Else
			owCONFIG_ReturnConfigValue = Application(sConfVar)
		End If
		
	End Function
	'************************************************************************************
	
	
	
	'************************************************************************************
	'*																					*
	'*																					*
	'*																					*
	'************************************************************************************
	Sub owCONFIG_WriteConfigValue( sConfVar, sValue )

		Dim rsStoreData

		Application.Lock
		Application(sConfVar) = CStr(sValue)
		Application.Unlock

		If ( Trim(sValue) = "" ) Then
			sValue = " "
		End If
		set rsStoreData = CreateObject("ADODB.Recordset")
		sSQLText = "SELECT * FROM settings WHERE settingKey = '" & SQLEncode(sConfVar) & "'"
		call DB_getFromDatabase (sSQLText, rsStoreData, "")
		If ( rsStoreData.EOF ) Then
			dbStoreConnection.Execute "INSERT INTO Settings (settingKey, settingValue, comments, idSettingGroup) VALUES ('" & SQLEncode(sConfVar) & "', '" & SQLEncode(CStr(sValue)) & "', '" & SQLEncode(sConfVar) & "', 3)"
		Else
			dbStoreConnection.Execute "UPDATE settings SET settingValue = '" & SQLEncode(CStr(sValue)) & "' WHERE settingKey = '" & SQLEncode(sConfVar) & "'"
		End If
		rsStoreData.Close
		set rsStoreData = Nothing
		
	End Sub
	'************************************************************************************
%>