<!--#include file="owFunctions/I_GeneralFunctions.asp"-->
<!--#include file="./owTemplates/Template.asp"-->
<%
	'************************************************************************************
	'*																					*
	'*	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/											*
	'*																					*
	'************************************************************************************



	'************************************************************************************
	'*																					*
	'*																					*
	'*																					*
	'************************************************************************************
	Sub ActionSubroutine()
		%>
		<center>
		<table cellpadding=0 cellspacing=0 border=0>
			<tr>
				<td style='border: 0px;' valign=top>
					<table cellpadding=20 cellspacing=0 border=0 width=100%>
						<tr>
							<td style='border: 0px;' valign=top>
								<table cellpadding=0 cellspacing=0 border=0 width=100%>
									<tr>
										<td style='border: 0px;' valign=top><font face="Times New Roman" size=+2 color="black">
											<center><b><%=LANG_DT( "CONTACT_US_HEAD", "Contact Us" )%></b><br></center></font>
										</td>
									</tr>
									<tr>
										<td style='border: 0px;' width=100%>
											<%
											Dim sEmailResponse, sFullLetter, sAction, sError, sSuccess
											Dim sEmail, sDescription, sName, sType
											
											sAction			= Trim(Request("sAction"))
											sError			= ""
											sEmail			= Trim(Request("sEmail"))
											sDescription	= Trim(Request("sDescription"))
											sName			= Trim(Request("sName"))
											sType			= Trim(Request("sType"))
											
											If ( sAction = "Contact" ) Then
												If ( sDescription = "" ) Then
													sError = LANG_DT( "CONTACT_US_ENTERCOMMENT", "Please Write a Comment or a Question" )
												Else
													If ( Len(sEmail) = 0 ) Then
														sEmail = LANG_DT( "CONTACT_US_ENTEREMAIL", "Please enter your email address." )
													End If
													If ( InStr(sEmail, "@") < InStrRev(sEmail, ".") ) And ( InStr(sEmail, "@") > 0 ) Then
														sFullLetter = LANG_DT( "CONTACT_US_NEWREQUEST1", "New Customer Support Request." ) & VbCrlf
														sFullLetter = sFullLetter & VbCrlf
														sFullLetter = sFullLetter & LANG_DT( "CONTACT_US_NEWREQUEST2", "Email: " ) & sEmail
														sFullLetter = sFullLetter & VbCrlf & VbCrlf
														sFullLetter = sFullLetter & LANG_DT( "CONTACT_US_NEWREQUEST3", "Inquiry type: " ) & sType & VbCrlf & VbCrlf
														sFullLetter = sFullLetter & LANG_DT( "CONTACT_US_NEWREQUEST4", "Comment or Question: " ) & VbCrlf
														sFullLetter = sFullLetter & sDescription
														sEmailResponse = sendMail(sOWCompany, sOWEmailSender, sOWEmailAdmin, "Support Inquiry", sFullLetter)
														if ( sEmailResponse = TRUE ) then
															sSuccess = LANG_DT( "CONTACT_US_SENTSUCCESSFULLY", "Your Message Has Been Sent to Support. You Should anticipate a Reply Within the Next 24 to 48 Hours." )
														else
															sError = LANG_DT( "CONTACT_US_ERRORSENDING", "Unable to send message to Support!<br>Please contact the administrator as soon as possible." ) & "<BR>Error: " & sEmailResponse
														end if
													Else
														sError = LANG_DT( "CONTACT_US_INVALIDEMAIL", "Unrecognizable email address. Please enter another email address before submitting your request." ) & "<br><i><font color=black>" & sEmail & "</font></i> - " & LANG_DT( "CONTACT_US_INVALIDEMAIL2", "is Not a Valid Email Address." )
													End If
												End If
											End If
											
											If ( sError <> "" ) And ( sAction <> "" ) Then
												Call owMessage(sError, C_ERROR)
												Call WriteForm()
											End If
											If ( sSuccess <> "" ) Then
												Call owMessage(sSuccess, C_SUCCESS)
											End If
											If ( sAction = "" ) Then
												Call WriteForm()
											End If
											%>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	<%
	End Sub
	'************************************************************************************


	'************************************************************************************
	'*																					*
	'*	This is the function to write out the form.										*
	'*																					*
	'************************************************************************************
	Sub WriteForm()
	
		sOWCompany				= owCONFIG_ReturnConfigValue("sOWCompany")
		sOWCompanyAddress		= owCONFIG_ReturnConfigValue("sOWCompanyAddress")
		sOWCompanyStateCode		= owCONFIG_ReturnConfigValue("sOWCompanyStateCode")
		sOWCompanyCity			= owCONFIG_ReturnConfigValue("sOWCompanyCity")
		sOWCompanyZip			= owCONFIG_ReturnConfigValue("sOWCompanyZip")
		sOWCompanyCountryCode	= owCONFIG_ReturnConfigValue("sOWCompanyCountryCode")
		sOWCompanyPhone			= owCONFIG_ReturnConfigValue("sOWCompanyPhone")

		%>
		<%=sOWCompany%>
		<br><br><%=sOWCompanyAddress%> 
		<br><%=sOWCompanyStateCode%> - <%=sOWCompanyCity%> (<%=sOWCompanyZip%>)
		<br><%=sOWCompanyCountryCode%>
		<br><%=LANG_DT( "CONTACT_US_PHNUM", "Phone Number" )%>: &nbsp; <%=sOWCompanyPhone%>
		<br><%=LANG_DT( "CONTACT_US_EMAIL", "Email Address" )%>: <a href="mailto:<%=sOWEmailAdmin%>"><%=sOWEmailAdmin%></a>
		<br><br>
		<form name='ContactSupport' action='owContactUs.asp' method='post'>
			<input type='hidden' name='sAction' value='Contact'>
			<table cellpadding=10 cellspacing=0 style='border: 1px solid black'>
				<tr>
					<td valign=top><%=LANG_DT( "CONTACT_US_YOURNAME", "Your Name" )%>: </td></font>
					<td><input type='text' size=20 name='sName' value="<%=Server.HTMLEncode(sName)%>"></td>
				</tr>
				<tr>
					<td valign=top>*<%=LANG_DT( "CONTACT_US_YOUREMAIL", "Your Email" )%>: </td>
					<td><input type='text' size=30 name='sEmail' value="<%=Server.HTMLEncode(sEmail)%>"></td>
				</tr>
				<tr>
					<td valign=top><%=LANG_DT( "CONTACT_US_INQUIRY", "Inquiry Type" )%>: </td>
					<td>
						<select name='sType'>
							<option value = "<%=Server.HTMLEncode(LANG_DT( "CONTACT_US_NONESPEC", "None Specified" ))%>"><%=LANG_DT( "CONTACT_US_SELECT", "Please Select" )%></option>
							<option value = "<%=Server.HTMLEncode(LANG_DT( "CONTACT_US_CART", "Cart" ))%>"><%=LANG_DT( "CONTACT_US_CART", "Cart" )%></option>
							<option value = "<%=Server.HTMLEncode(LANG_DT( "CONTACT_US_PRODS", "Products" ))%>"><%=LANG_DT( "CONTACT_US_PRODS", "Products" )%></option>
							<option value = "<%=Server.HTMLEncode(LANG_DT( "CONTACT_US_WEBSITE", "Website" ))%>"><%=LANG_DT( "CONTACT_US_WEBSITE", "Website" )%></option>
							<option value = "<%=Server.HTMLEncode(LANG_DT( "CONTACT_US_OTHER", "Other" ))%>"><%=LANG_DT( "CONTACT_US_OTHER", "Other" )%></option>
						</select>
					</td>
				</tr>
				<tr>
					<td valign=top>*<%=LANG_DT( "CONTACT_US_YOURCOMMENTS", "Comment or Question" )%>: </td>
					<td><textarea name='sDescription' rows=10 cols=60><%=Server.HTMLEncode(sDescription)%></textarea></td>
				</tr>
				<tr>
					<td colspan=2 align=right>
						<input type='submit' value=' <%=LANG_DT( "CONTACT_US_SENDMSG", "Send Message" )%> '>
					</td>
				</tr>
				<tr>
					<td colspan=2>
						* <%=LANG_DT( "CONTACT_US_REQUIRED", "Required fields" )%>
					</td>
				</tr>
			</table>
		</form>
		<%
	End Sub
	'************************************************************************************
%>