<!--#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/											*
	'*																					*
	'************************************************************************************
	

	'************************************************************************************
	'*																					*
	'*																					*
	'*																					*
	'************************************************************************************
	Sub ActionSubroutine()

		sShipMethod 	= Trim(Request("sShipMethod"))	' just do this to store in the session var the data from the previous page

		If ( bHasAccount ) Then			' they should not be on this page unless they have already logged in (this might also occur when their session times out)
			%>
			<center>
			<table cellspacing=0 cellpadding=5 width=<%=sOWStoreTableWidth%> style='border: 1px solid #000000;'>
			<form METHOD='POST' name='selectPayment' action='owOrderVerify.asp'>
				<%Call DisplayPaymentMethods()%>
				<%if bOWUseVatNumber then%>
				<TR> 
					<TD style='border-top: 1px solid #000000;'><%=LANG_DT( "SELECTPAYMENT_VAT", "VAT" )%></TD>
					<TD style='border-top: 1px solid #000000;' colspan=2>
						<INPUT TYPE="TEXT" NAME="sVATNumber" SIZE="30" value="" maxlength="30">
					</TD>
				</TR>
				<%End If%>
				<%if sOWOrderFieldName1 <> "" then%>
				<tr> 
					<td style='border-top: 1px solid #000000;'><%=sOWOrderFieldName1%></td>
					<td style='border-top: 1px solid #000000;' colspan=2>         
						<%VALIDATE_textbox "user1", sCustomField1, 30, "textbox", ""%>
					</td>
				</tr>
				<%End If%>
				
				<%if sOWOrderFieldName2 <> "" then%>
				<tr> 
					<td> <%=sOWOrderFieldName2%> </td>
					<td colspan=2>         
						<%VALIDATE_textbox "user2", sCustomField2, 30, "textbox", ""%>
					</td>
				</tr>
				<%End If%>
		    
				<%if sOWOrderFieldName3 <> "" then%>
				<tr> 
					<td> <%=sOWOrderFieldName3%> </td>
					<td colspan=2>         
						<%VALIDATE_textbox "user3", sCustomField3, 30, "textbox", ""%>
					</td>
				</tr>
				<%End If%>
				<TR> 
					<TD style='border-top: 1px solid #000000;' valign=top><%=LANG_DT( "SELECTPAYMENT_GENERALCOMMENTS", "General Comments" )%></TD>
					<TD style='border-top: 1px solid #000000;' colspan=2>
						<textarea name="sComments" cols="75" rows=4></textarea>
					</TD>
				</TR>
				<TR>
					<TD colspan=3 align=right style='border-top: 1px solid #000000;'>
						<input type="SUBMIT" name="Submit" value=" <%=LANG_DT( "SELECTPAYMENT_CONTINUE", "Continue" )%> &gt;">
					</TD>
				</TR>
			</form>
			</table>
			<%
		Else
			Call owMessage(LANG_DT( "SELECTPAYMENT_LOGGEDOUT", "The maximum idle time has been reached. You have been logged out for security reasons. Please <a href='owCustomerAuthenticate.asp'>log in again</a>." ), C_ERROR)
		End If
		
		Call SF_ClosePage()
	
	End Sub
	'************************************************************************************
	
	
	'************************************************************************************
	'*																					*
	'*																					*
	'*																					*
	'************************************************************************************
	Sub DisplayPaymentMethods()
	
		Dim bPaymentActive, sPaymentDescription, sPaymentPriceToAdd, sPaymentPercentageToAdd
		Dim aPmtTypes(20)
		
		If ( sOWCurrencyCode <> "" ) Then
			sTempCurrencyCode = "(" & sOWCurrencyCode & ")"
		End If

		%>
		<tr>
			<td bgcolor=EEEEEE style='border-bottom: 1px solid #000000; border-right: 1px solid #000000;'><b><%=LANG_DT( "SELECTPAYMENT_PMYMETHOD", "Payment Method" )%></b></td>
			<td bgcolor=EEEEEE style='border-bottom: 1px solid #000000; border-right: 1px solid #000000;' align=center><b><%=LANG_DT( "SELECTPAYMENT_SERVICEFEE", "Service Fee" )%></b>&nbsp;<%=sTempCurrencyCode%></td>
			<td bgcolor=EEEEEE style='border-bottom: 1px solid #000000;' align=center><b><%=LANG_DT( "SELECTPAYMENT_SELECT", "Select?" )%></td>
		</tr>
		<%
		aPmtTypes(0) = C_PM_MAILIN
		aPmtTypes(1) = C_PM_FAXIN
		aPmtTypes(2) = C_PM_PHONEIN
		For iX = 0 To 3
			Call CART_PaymentMethodInfo(aPmtTypes(iX), bPaymentActive, sPaymentDescription, sPaymentPriceToAdd, sPaymentPercentageToAdd)
			If ( bPaymentActive ) Then
				Call DisplayIndividualMethod(aPmtTypes(iX), sPaymentDescription, sPaymentPriceToAdd, sPaymentPercentageToAdd)
			End If
		Next

	End Sub
	'************************************************************************************
	
	
	'************************************************************************************
	'*																					*
	'*																					*
	'*																					*
	'************************************************************************************
	Sub DisplayIndividualMethod(iPaymentID, sPaymentDescription, sPaymentPriceToAdd, sPaymentPercentageToAdd)
		%>
		<tr>
			<td style='border-right: 1px solid #000000;'><%=sPaymentDescription%></td>
			<td align=center style='border-right: 1px solid #000000;'>
				<%
				If ( ( sPaymentPriceToAdd > 0 ) And ( sPaymentPercentageToAdd > 0 ) ) Then
					Response.Write CONVERSION_Currency(sPaymentPriceToAdd) & " " & LANG_DT( "AND", "and" ) & " " & sPaymentPercentageToAdd & "%"
				ElseIf ( sPaymentPriceToAdd > 0 ) Then
					Response.Write CONVERSION_Currency(sPaymentPriceToAdd)
				ElseIf ( sPaymentPercentageToAdd > 0 ) Then
					Response.Write sPaymentPercentageToAdd & "%"
				Else
					Response.Write CONVERSION_Currency("0")
				End If
				%>
			</td>
			<td align=center><input type='radio' name='sPaymentMethod' value='<%=iPaymentID%>' <%If ( iPaymentID = C_PM_MAILIN ) Then Response.Write "checked" End If%>></td>
		</tr>
		<%
	End Sub
	'************************************************************************************
	%>