<?
session_start();
include('_db.connection.php');
include('check.access.php');
include('_public.setup.php');
?>

	<table cellpadding="0" cellspacing="0" width="780" border="0">
		<?php include("i.header.php"); ?>
		<tr>
			<td>
				<table cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td valign="top">
							<!--
							**************************
							**** BEGIN BODY TABLE ****
							**************************
							-->
							<table cellpadding="0" cellspacing="0">
								<tr>
									<td><img src="./images/HeaderPreferences.gif"></td>
								</tr>
								<tr>
									<td align="center">
										<!--
										**************************
										*** BEGIN BODY CONTENT ***
										**************************
										-->
										<script language="javascript">
										function update_email() {
											if (document.up_email.new_email.value != "") {
												var agree=confirm("Are you sure you want to change your email addresss?");
												if (agree) {
													document.up_email.action = "actions.php?pmode=update_email";
													document.up_email.submit();
												}
												else {
													false;
												}												
											}
											else {
												alert("The email field is blank.");
											}
										}
										
										function update_password() {
											if (document.up_password.new_pass.value != "") {											
												if (document.up_password.new_pass.value != document.up_password.verify_pass.value) {
													alert("The new password and verify new password fields do not match");
												}
												else {
													document.up_password.action = "actions.php?pmode=update_password";
													document.up_password.submit();
												}
											}
											else {
												alert("One of the New Password fields is blank.");
											}
										}
										
										function unsubscribe() {
											var agree=confirm("Are you sure you want to unsubscribe?");
											if (agree) {
												document.unsub.action = "actions.php?pmode=unsubscribe";
												document.unsub.submit();
											}
											else {
												false;
											}
										}
										function demo_mode(){
											alert("Sorry. You can not use this feature while in the DEMO ACCOUNT.")
											return;
										}
										</script>
										<?
											$member_result = mysql_query("SELECT * FROM members WHERE member_id = '$mid'", $db);						
											$member = mysql_fetch_object($member_result);
										?>
										<table width="506" border="0">
											<tr>
												<td height="5"></td>
											</tr>
											<!--
											<tr>
												<td style="border: 1px solid #083C58; padding: 10px" bgcolor="#F8F8F8">
													<table width="100%">
														<tr>
															<td>Info<br><br></td>
														</tr>
													</table>
												</td>
											</tr>
											-->
											<tr>
												<td style="border: 1px solid #083C58; padding: 10px" bgcolor="#F8F8F8">
													<table width="100%">
														<form name="up_email" method="post">
														<tr>
															<td><? if($mes == "email"){ echo "<font color=\"#ff0000\"><b>Your email address has been updated.</b></font><br>"; } ?>
															<font color="#000000">If you would like to change your email address use this form.<br><br>
															<input type="textbox" name="new_email" value="<?php echo $member->email; ?>" style="width: 200"><br>
															<p align="right"><input type="button" value="Update Email" onclick="<? if($mid == 20){ ?>demo_mode();<? } else { ?>update_email();<? } ?>"></a>
															</td>
														</tr>
														</form>
													</table>
												</td>
											</tr>
											<tr>
												<td style="border: 1px solid #083C58; padding: 10px" bgcolor="#F8F8F8">
													<table width="100%">
														<form name="up_password" method="post">	
														<tr>
															<td>
															<? if($mes == "pass"){ echo "<font color=\"#ff0000\"><b>Your password has been updated.</b></font><br>"; } ?>															
															<? if($mes == "pass_error"){ echo "<font color=\"#ff0000\"><b>The password that you entered as your current password is not correct. Please try again.</b></font><br>"; } ?>	
															If you would like to change your password please use this form.<br><br>
															<font color="#333333">
															<b>Current Password</b><br>
															<input type="password" name="old_pass" style="width: 200"><br>
															<b>New Password</b><br>
															<input type="password" name="new_pass" style="width: 200"><br>
															<b>Verify New Password</b><br>
															<input type="password" name="verify_pass" style="width: 200"><br>
															<p align="right"><input type="button" value="Change Password" onclick="<? if($mid == 20){ ?>demo_mode();<? } else { ?>update_password();<? } ?>"></a>
															</td>
														</tr>
														</form>
													</table>
												</td>
											</tr>
											<tr>
												<td style="border: 1px solid #083C58; padding: 10px" bgcolor="#F8F8F8">
													<table width="100%">
														<tr>
															<td valign="top">Don't want to visit the website every time you need to host a new image? Download the new ImageManager 1.0 software.<br><br><a href="./downloads/ImageManager.zip">Download Now</a></td>
															<td><a href="./downloads/ImageManager.zip"><img src="./images/im_app.gif" border="0"></a></td>
														</tr>
													</table>
												</td>
											</tr>
											<tr>
												<td style="border: 1px solid #083C58; padding: 10px" bgcolor="#F8F8F8">
													<table width="100%">
														<form name="unsub" method="post">
														<tr>
															<td>If you would like to unsubscribe and close your account click the unsubscribe button below. As soon as you click the unsubscribe button your account will be closed and you will be redirected to paypal where you will have to cancel your subsription with us. <br><br><font color="#ff0000"><b>*Warning: clicking the unsubscribe button will set your account inactivate and your images will no longer be hosted with us.<p align="right">
															<p align="right"><input type="button" value="Unsubscribe" onclick="<? if($mid == 20){ ?>demo_mode();<? } else { ?>unsubscribe();<? } ?>"></a>
															</td>
														</tr>
														</form>
													</table>
												</td>
											</tr>
											<tr>
												<td>&nbsp;</td>
											</tr>
										</table>
										<!--
										**************************
										**** END BODY CONTENT ****
										**************************
										-->
									</td>
								</tr>
							</table>
							<!--
							**************************
							***** END BODY TABLE *****
							**************************
							-->
						</td>
						<td valign="top"bgcolor="#295670"><img src="./images/IndexDropShadow.gif"></td>
						<td valign="top" bgcolor="#155F8D">
							<?php include("i.member.rn.php"); ?>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td background="./images/Footer.gif"><img src="./images/Footer.gif" border="0"></td>
		</tr>
		<tr>
			<td>
				<?php include("i.footer.php"); ?>
			</td>
		</tr>
	</table>

<?
mysql_close($db);
print($close);
?>