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

	Dim sCountryCode

	'************************************************************************************
	'*																					*
	'*																					*
	'*																					*
	'************************************************************************************
	Sub ActionSubroutine()
	
		sCountryCode = Trim(Request("sCountryCode"))

		if sIDCart = 0 then 
			Call owMessage(LANG_DT( "SHIPCOSTQUERY_LOGGEDOUT", "You have been logged out of the store due to inactivity. This is to protect your information. Please return to the home page to begin again." ), C_ERROR)
		Else
			If ( sCountryCode <> "" ) Then
				Call DisplayZipForm()
			Else
				Call DisplayCountryForm()
			End If
		End If
		
	End Sub
	'************************************************************************************
	
	
	
	'************************************************************************************
	'*																					*
	'*																					*
	'*																					*
	'************************************************************************************
	Sub DisplayCountryForm()
		%>
		<table width=<%=sOWStoreTableWidth%> border=0 style='border: 1px solid #000000;' cellspacing=0 cellpadding=5>
		<form method="post" name="SCQuery" action="owShippingCostQuery.asp">
			<tr bgcolor="#eeeeee"><td style='border-bottom: 1px solid #000000;'><b><%=LANG_DT( "SHIPCOSTQUERY_SELECTCOUNTRY", "Please Select Your Country" )%></b></td></tr>
			<tr>
				<td>
					<table>
						<tr>
							<td><%=LANG_DT( "SHIPCOSTQUERY_COUNTRY", "Country" )%></td>
							<td>
								<SELECT name="sCountryCode">
								<OPTION value=""><%=LANG_DT( "SHIPCOSTQUERY_SELECTCOUNTRY2", "Select Country" )%></OPTION>
									<%
									sSQLText = "SELECT countryCode, countryName FROM countryCodes WHERE Active = 'Y' ORDER BY Position"
									Call DB_getFromDatabase(sSQLText, rsStoreData, "orderForm")
									While ( NOT rsStoreData.EOF )
										%><option value="<%=rsStoreData("countryCode")%>"><%=rsStoreData("countryName")%></OPTION><%
										rsStoreData.MoveNext
									Wend
									Call DB_closeRecordset(rsStoreData)
									%>
								</SELECT>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td align=right style='border-top: 1px solid #000000;'>
					<input type="submit" name="Submit" value=" <%=LANG_DT( "SHIPCOSTQUERY_CONTINUE", "Continue" )%> &gt; ">
				</td>
			</tr>
		</form>
		</table>
		<%
	End Sub
	'************************************************************************************
	
	
	'************************************************************************************
	'*																					*
	'*																					*
	'*																					*
	'************************************************************************************
	Sub DisplayZipForm()
		%>
		<script type="text/javascript" src="../owManager/Script/fValConfig.js"></script>
		<script type="text/javascript" src="../owManager/Script/fValidate.js"></script>

		<table width=<%=sOWStoreTableWidth%> border=0 style='border: 1px solid #000000;' cellspacing=0 cellpadding=5>
		<form method="post" name="SCQuery2" action="owShippingCostQueryExec.asp">
			<input type='hidden' name='sAction' value='ZipOnly'>
			<input type='hidden' name='sCountryCode' value='<%=sCountryCode%>'>
			<tr bgcolor="#eeeeee"><td style='border-bottom: 1px solid #000000;'><b><%=LANG_DT( "SHIPCOSTQUERY_SELECTSTATE", "Please Select Your " )%><%=STRUCTURE_PostalCodeLabel(sCountryCode)%></b></td></tr>
			<tr>
				<td>
					<table>
						<tr>
							<td><%=STRUCTURE_PostalCodeLabel(sCountryCode)%></td>
							<td><%VALIDATE_textbox "sZip", "", 10, "textbox", "blank"%></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td align=right style='border-top: 1px solid #000000;'>
					<input type="button" name="Submit" value=" <%=LANG_DT( "SHIPCOSTQUERY_VIEWEST", "View Shipping Estimate" )%> &gt; " onclick="if ( validateForm( SCQuery2, false, false, false, true, 17 ) ) SCQuery2.submit();" >
				</td>
			</tr>
		</form>
		</table>
		<%
	End Sub
	'************************************************************************************
%>