<!--#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()
	
		Dim sEmail, sZip, sCountryCode, sShipToState
		Dim bWhichForm, sError, sSuccess, bDisplayForm

			%>
			<script type="text/javascript" src="../owManager/Script/fValConfig.js"></script>
			<script type="text/javascript" src="../owManager/Script/fValidate.js"></script>
			
			<script language='JavaScript1.2' type='text/javascript'>
		
				function SubmitForm(objForm, sAction){
				
					if ( validateForm( objForm, false, false, false, true, 17 ) )
					{
						objForm.sAction.value = sAction;
						objForm.submit();
					}else{
						return false;
					}
				}
				
			</script>
			
			<center>
			<table width=<%=sOWStoreTableWidth%> border=0 style='border: 1px solid #000000;' cellspacing=0 cellpadding=5>
				<form action="owRegisterExec.asp" METHOD="POST" name="orderform" onSubmit='return SubmitForm(this, "PerformRegistration");'>
				<input type='hidden' name='sAction' value='PerformRegistration'>
				<tr bgcolor="#eeeeee"><td COLSPAN=2 style='border-bottom: 1px solid #000000;'><b><%=LANG_DT( "CHECKOUT_REG", "Please Register" )%></b></td></tr>
				<TR><TD COLSPAN=2><b><%=LANG_DT( "CHECKOUT_CUSTOMER", "Customer" )%></b></TD></TR>    
				<TR> 
					<TD>*<%=LANG_DT( "CHECKOUT_FNAME", "First Name" )%></TD>
					<TD><%VALIDATE_textbox "name", sName, 30, "textbox", "blank"%></TD>
				</TR>
				<TR> 
					<TD>*<%=LANG_DT( "CHECKOUT_LNAME", "Last Name" )%></TD>
					<TD><%VALIDATE_textbox "lastName", sLastName, 30, "textbox", "blank"%></TD>
				</TR>   
				<TR> 
					<TD><%=LANG_DT( "CHECKOUT_COMPANY", "Company Name" )%></TD>
					<TD><%VALIDATE_textbox "customerCompany", sCustomerCompany, 30, "textbox", ""%></TD>
				</TR>   
				<TR> 
					<TD>*<%=LANG_DT( "CHECKOUT_PNUM", "Phone Number" )%></TD>
					<TD><%VALIDATE_textbox "phone", sPhone, 30, "textbox", "blank"%></TD>
				</TR>
				<TR> 
					<TD>*<%=LANG_DT( "CHECKOUT_EMAILMSG", "Email (use this to log in)" )%></TD>
					<TD>
						<%VALIDATE_textbox "email", "", 40, "textbox", "blank"%>
					</TD>
				</TR>
				<tr>
					<td><%=LANG_DT( "CHECKOUT_PW", "Password" )%></td>
					<td><%VALIDATE_textbox "sPassword", sPassword, 30, "password", "blank"%></td>
				</tr>
				<tr>
					<td><%=LANG_DT( "CHECKOUT_PW2", "Re-Enter Password" )%></td>
					<td><%VALIDATE_textbox "sPassword2", sPassword2, 30, "password", "blank"%></td>
				</tr>
				<TR><TD colspan="2"><br><b><%=LANG_DT( "CHECKOUT_BILLINGADD", "Billing address" )%></b></TD></TR>
				<tr>
					<TD>*<%=LANG_DT( "CHECKOUT_ADDRESS", "Address" )%></TD>
					<TD><%VALIDATE_textbox "address", sAddress, 30, "textbox", "blank"%></TD>
				</TR>
				<TR> 
					<td>*<%=LANG_DT( "CHECKOUT_CITY", "City" )%></TD>
					<td><%VALIDATE_textbox "city", sCity, 30, "textbox", "blank"%></TD>
				</TR>
				<TR> 
					<TD>*<%=LANG_DT( "CHECKOUT_STATE", "State/Provence" )%></TD>
					<TD>
						<%
						sSQLText = "SELECT S.StateCode, S.StateName FROM StateCodes S, CountryCodes C WHERE S.Active = 'Y' AND S.CountryCode = C.CountryCode AND C.Active = 'Y' ORDER BY S.StateName"
						Call DB_getFromDatabase(sSQLText, rsStoreData2, "")      
						%>
						<SELECT name=stateCode size=1>
							<%
							While ( NOT rsStoreData2.EOF )
								sStateCode2 = rsStoreData2("stateCode")
								%>
								<option value="<%=sStateCode2%>" <%if (request("StateCode") = "" and sStateCode2 = sStateCode) Or (request("StateCode") = sStateCode2) then response.write "selected" End If%>><%=rsStoreData2("stateName")%></OPTION>
								<%
								rsStoreData2.MoveNext
							Wend
							Call DB_closeRecordset(rsStoreData2)
							%>
						</SELECT>
					</TD>
				</TR>
				<TR>  
					<TD><%=LANG_DT( "CHECKOUT_ANOTHERSTATE", "Another State/Provence" )%></TD>
					<TD><%VALIDATE_textbox "state", sState, 30, "textbox", ""%></TD>
				</TR>
				
				<TR> 
					<TD>*<%=LANG_DT( "CHECKOUT_ZIP", "Zip/Postal Code" )%></TD>
					<TD><%VALIDATE_textbox "zip", sZip, 30, "textbox", "blank"%></TD>
				</TR>
				<TR> 
					<TD>*<%=LANG_DT( "CHECKOUT_COUNTRY", "Country" )%></TD>
					<TD>  
						<%
						sSQLText = "SELECT countryCode, countryName FROM countryCodes WHERE Active = 'Y' ORDER BY Position"
						Call DB_getFromDatabase(sSQLText, rsStoreData2, "")
						%>
						<SELECT name="countryCode">
							<%
							While ( NOT rsStoreData2.EOF )
								sCountryCode2 = rsStoreData2("countryCode")
								%>
								<option value="<%=sCountryCode2%>" <%if (request("countryCode")="" and sCountryCode=sCountryCode2) Or (request("countryCode")=sCountryCode2) then response.write "selected" End If%>><%=rsStoreData2("countryName")%></OPTION>
								<%
								rsStoreData2.MoveNext
							Wend
							Call DB_closeRecordset(rsStoreData2)
							%>
						</SELECT>
					</TD>
				</TR>    
				<%if bOWAllowShippingAddress then%>
				<tr><td colspan="2"><br><b><%=LANG_DT( "CHECKOUT_SHIPPINGADDRESS", "Shipping address (optional)" )%></b></td></tr>
				<TR> 
					<TD><%=LANG_DT( "CHECKOUT_FNAME", "First Name" )%></TD>
					<TD><%VALIDATE_textbox "sShippingName", sShippingName, 30, "textbox", ""%></TD>
				</TR>
				<TR> 
					<TD><%=LANG_DT( "CHECKOUT_LNAME", "Last Name" )%></TD>
					<TD><%VALIDATE_textbox "sShippingLastName", sShippingLastName, 30, "textbox", ""%></TD>
				</TR>
				<tr>
					<td><%=LANG_DT( "CHECKOUT_ADDRESS", "Address" )%></td>
					<td><%VALIDATE_textbox "shippingAddress", sShippingAddress, 50, "textbox", ""%></td>
				</tr>
				<tr> 
					<td><%=LANG_DT( "CHECKOUT_CITY", "City" )%></td>
					<td><%VALIDATE_textbox "shippingCity", sShippingCity, 50, "textbox", ""%></td>
				</tr>
				<tr> 
					<td><%=LANG_DT( "CHECKOUT_STATE", "State/Provence" )%></td>
					<td>
						<%
						sSQLText = "SELECT S.StateCode, S.StateName FROM StateCodes S, CountryCodes C WHERE S.Active = 'Y' AND S.CountryCode = C.CountryCode AND C.Active = 'Y' ORDER BY S.StateName"
						Call DB_getFromDatabase(sSQLText, rsStoreData2, "") 
						%>
						<SELECT name="shippingStateCode" size=1>
							<%
							While ( NOT rsStoreData2.EOF )
								sStateCode2 = rsStoreData2("stateCode")
								%>
								<option value="<%=sStateCode2%>" <%if sStateCode2=sShippingStateCode then response.write "selected" End If%>><%=rsStoreData2("stateName")%></OPTION>
								<%
								rsStoreData2.movenext
							Wend
							Call DB_closeRecordset(rsStoreData2)
							%>							
						</SELECT>
					</td>
				</tr>
			
				<tr> 
					<td><%=LANG_DT( "CHECKOUT_ANOTHERSTATE", "Another State/Provence" )%></td>
					<td><%VALIDATE_textbox "shippingState", sShippingCity, 30, "textbox", ""%></td>
				</tr>
				
				<tr> 
					<td><%=LANG_DT( "CHECKOUT_ZIP", "Zip/Postal Code" )%></td>
					<td><%VALIDATE_textbox "shippingZip", sShippingZip, 10, "textbox", ""%></td>
				</tr>
				<tr> 
					<td><%=LANG_DT( "CHECKOUT_COUNTRY", "Country" )%></td>
					<td>                 
						<%
						sSQLText = "SELECT countryCode, countryName FROM countryCodes WHERE Active = 'Y' ORDER BY Position"
						Call DB_getFromDatabase(sSQLText, rsStoreData2, "") 
						%>
						<SELECT name="shippingCountryCode" size=1>
							<%
							While ( NOT rsStoreData2.EOF )
								sShippingCountryCode2 = rsStoreData2("countryCode")
								%>
								<option value="<%=sShippingCountryCode2%>" <%if sShippingCountryCode2=sShippingCountryCode then response.write "selected" End If%>><%=rsStoreData2("countryName")%></OPTION>
								<%
								rsStoreData2.movenext
							Wend
							Call DB_closeRecordset(rsStoreData2)
							%>
						</SELECT>
					</td>
				</tr>
				<%End If%>
				<TR> 
					<td style='border-top: 1px solid #000000;'>
						* <%=LANG_DT( "CHECKOUT_REQUIRED", "required field" )%>
					</td>
					<td align=right style='border-top: 1px solid #000000;'>
						<input type="submit" name="save" value=" <%=LANG_DT( "CHECKOUT_REGFINALIZE", "Finalize Registration &gt;" )%> ">
					</td>
				</TR>
				</form>
			</table>
			<%

	End Sub
	'************************************************************************************
	%>