<?php
  $age_from		= (isset($_SESSION['agefrom'])&&$_SESSION['agefrom']<>"")	?	$_SESSION['agefrom']		:	"18";
       $age_to		= (isset($_SESSION['ageto'])&&$_SESSION['ageto']<>"")	?	$_SESSION['ageto']		:$age_from	+ 22;
       $user_gender	= (isset($_SESSION['user_gender'])&&$_SESSION['user_gender']<>"")	?	$_SESSION['user_gender']	:	"Male";
//echo $PG_TITLE;

//checking user login status

if (isset($_SESSION['userlogged']) && $_SESSION['userlogged']=="YES") 

{

	require_once ("includes/arrays.inc.php");

	require_once ("classes/misc.class.php");

	$objMPM	= new misc($objDB);

	$showLogout='&nbsp;&nbsp;&nbsp;&nbsp;(<a href="logout.php">Logout</a>)';
       
?>
<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>-->

<script type="text/javascript" src="js/ddaccordion.js"></script>

<script type="text/javascript">

ddaccordion.init({
	headerclass: "headerbar", //Shared CSS class name of headers group
	contentclass: "submenu", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc] [] denotes no content
	onemustopen: true, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})

</script>

<script language="javascript" type="text/javascript">

function Redirect()

{

	document.location.href='register.php';

}//end function


function graph()

{

	testwindow=window.open ("personality_graph.php","mywindow","menubar=0,resizable=1,width=650,height=500");

	 testwindow.moveTo(500, 200);

	return false;

}
</script>

<div class="row">
	<div class="row box11">
		 <h2 class="headings menu-hd">
			Menu   <?php if ($PG_TITLE == 'index.php') {
			echo $showLogout;
			} ?>
		</h2>
		
		<div class="row">
			<div class="body1">
				<div id="menu">
				
					<ul>
						
						<li class="headerbar"><a href="#" class="menu-hd01" style="cursor: default;">Edit Profile</a></li>
						
						<li class="submenu">
						
						<div class="row">
						
							<div class="row">
								<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
								<div class="eleven float_R">
									<?php if ($PG_TITLE == 'my_basics.php') {
									echo '<a href="#" class="body1sub active">My Basic Info</a>';
									} else {
									echo '<a href="my_basics.php" class="body1sub">My Basic Info</a>';
									} ?>
								</div>
							</div>
							
							<div class="row">
								<!--<td width="2%"><img src="images/bullet.gif" width="16" height="14"></td>
								<td width="98%"> <?php if ($PG_TITLE == 'categories.php') {
								echo '<a href="#" class="body1sub active">My Personality Profile</a>';
								} else {
								echo '<a href="categories.php" class="body1sub">My Personality Profile</a>';
								} ?>  </td>-->
							</div>				
							<?php
							//checking any one of field is active in step4
							$sql_fld = mysql_query("select * from " . TABLEPREFIX . "SignUpField Where vActive='1' and nSId IN('6','7','8','9','10','11',
							'12','13','14','15','16')") or die(mysql_error());
							if (mysql_num_rows($sql_fld) > 0) {
							?>
							
							<div class="row">
								<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
								<div class="eleven float_R">
									<?php if ($PG_TITLE == 'my_interests.php') {
									echo '<a href="#" class="body1sub active">My Interests</a>';
									} else {
									echo '<a href="my_interests.php" class="body1sub">My Interests</a>';
									} ?>
								</div>
							</div>
							<?php
								}//end if
								//checking any one of field is active in step5
								
								$sql_fld = mysql_query("select * from " . TABLEPREFIX . "SignUpField Where vActive='1' and nSId IN('17','18','19','20','21',
								
								'22','23')") or die(mysql_error());
								
								if (mysql_num_rows($sql_fld) > 0) {
							?>
							
							<div class="row">
								<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
								<div class="eleven float_R">
									<?php if ($PG_TITLE == 'my_lifestyle.php') {
									echo '<a href="#" class="body1sub active">My Lifestyle</a>';
									} else {
									echo '<a href="my_lifestyle.php" class="body1sub">My Lifestyle</a>';
									} ?>
								</div>
							</div>
							<?php
								}//end if
								//checking any one of field is active in step3
								$sql_fld = mysql_query("select * from " . TABLEPREFIX . "SignUpField Where vActive='1' and nSId IN('1','2','3','4','5')") or die(mysql_error());
								if (mysql_num_rows($sql_fld) > 0) {
							?>
							
							<div class="row">
								<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
								<div class="eleven float_R">
									<?php if ($PG_TITLE == 'my_appearence.php') {
									echo '<a href="#" class="body1sub active">My Appearance</a>';
									} else {
									echo '<a href="my_appearence.php" class="body1sub">My Appearance </a>';
									} ?>
								</div>
							</div>
							<?php
							}//end if
							?>
							
							<div class="row">
								<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
								<div class="eleven float_R">
									<?php if ($PG_TITLE == 'my_photos.php') {
									echo '<a href="#" class="body1sub active">My Photos</a>';
									} else {
									echo '<a href="my_photos.php" class="body1sub">My Photos</a>';
									} ?>
								</div>
							</div>
							
							<div class="row">
								<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
								<div class="eleven float_R">
									<?php if ($PG_TITLE == 'my_payments.php') {
									echo '<a href="#" class="body1sub active">My Payments</a>';
									} else {
									echo '<a href="my_payments.php" class="body1sub">My Payments</a>';
									} ?>
								</div>
							</div>
							
							<div class="row">
								<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
								<div class="eleven float_R">
									<?php if ($PG_TITLE == 'my_date.php') {
									echo '<a href="#"  class="body1sub active">My Partner Preference</a>';
									} else {
									echo '<a href="my_date.php" class="body1sub">My Partner Preference</a>';
									} ?>
								</div>
							</div>
							
							<div class="row">
								<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
								<div class="eleven float_R">
									<?php if ($PG_TITLE == 'my_stories.php') {
									echo '<a href="#" class="body1sub active">My Stories</a>';
									} else {
									echo '<a href="my_stories.php"  class="body1sub">My Stories</a>';
									} ?>
								</div>
							</div>
							
							<div class="row">
								<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
								<div class="eleven float_R">
									<?php if ($PG_TITLE == 'my_favourites.php') {
									echo '<a href="#"  class="body1sub active">My Favorites</a>';
									} else {
									echo '<a href="my_favourites.php" class="body1sub">My Favorites</a>';
									} ?>
								</div>
							</div>
							
							<div class="row">
								<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
								<div class="eleven float_R">
									<?php if ($PG_TITLE == 'credit_card.php') {
									echo '<a href="#" class="body1sub active">Credit Card Info</a>';
									} else {
									echo '<a href="credit_card.php" class="body1sub">Credit Card Info</a>';
									} ?>
								</div>
							</div>
						
						</div>
						
						
						
						</li>
						
						
						
						<!--<li class="headerbar"><a href="msg_recieved.php?type=%" class="menu-hd01">Message Received<span class="count-span"> (<?php echo $objMPM->get_message_count("%", $_SESSION['user_id'], true) ?>)</span></a></li>
						
						<li class="submenu"><table width="100%"  border="0" cellspacing="0" cellpadding="1" class="menu-table">
						
						<tr>
						
						<td width="2%"><img src="images/bullet.gif" width="16" height="14"></td>
						
						<td width="98%"><?php if ($PG_TITLE . '?' . $_SERVER['QUERY_STRING'] == 'msg_recieved.php?type=NN') {
						echo '<a href="#" class="body1sub active">New Mail <span class="count-span">' . $objMPM->get_message_count("NN", $_SESSION['user_id'], true) . ')</span></a>';
						} else {
						echo '<a href="msg_recieved.php?type=NN" class="body1sub">New Mail <span class="count-span">' . $objMPM->get_message_count("NN", $_SESSION['user_id'], true) . '</span></a>';
						} ?></td>
						
						</tr>
						
						<tr>
						
						<td><img src="images/bullet.gif" width="16" height="14"></td>
						
						<td><?php if ($PG_TITLE . '?' . $_SERVER['QUERY_STRING'] == 'msg_recieved.php?type=RN') {
						echo '<a href="#" class="body1sub">Read <span class="count-span">' . $objMPM->get_message_count("RN", $_SESSION['user_id'], true) . ')</span></a>';
						} else {
						echo '<a href="msg_recieved.php?type=RN" class="body1sub">Read <span class="count-span">' . $objMPM->get_message_count("RN", $_SESSION['user_id'], true) . '</span></a>';
						} ?></td>
						
						</tr>
						
						</table>
						
						</li>-->
						<!--<li class="headerbar"><a href="msg_recieved.php?type=%" class="menu-hd01">Message Received<span class="count-span"> (<?php echo $objMPM->get_message_count("NN", $_SESSION['user_id'], true) ?>)</span></a></li>-->
						
						<!--<li class="headerbar"><a href="msg_sent.php?type=%" class="menu-hd01">Message Sent <span class="count-span">(<?php echo $objMPM->get_message_count("%", $_SESSION['user_id'], false) ?>)</span></a></li>
						
						<li class="submenu"><table width="100%"  border="0" cellspacing="0" cellpadding="1" class="menu-table">
						
						<tr>
						
						<td width="2%"><img src="images/bullet.gif" width="16" height="14"></td>
						
						<td width="98%"><?php if ($PG_TITLE . '?' . $_SERVER['QUERY_STRING'] == 'msg_sent.php?type=RN') {
						echo '<a href="#" class="body1sub">Read <span class="count-span">' . $objMPM->get_message_count("RN", $_SESSION['user_id'], false) . ')</span></a>';
						} else {
						echo '<a href="msg_sent.php?type=RN" class="body1sub">Read <span class="count-span">' . $objMPM->get_message_count("RN", $_SESSION['user_id'], false) . '</span></a>';
						} ?></td>
						
						</tr>
						
						<tr>
						
						<td><img src="images/bullet.gif" width="16" height="14"></td>
						
						<td><?php if ($PG_TITLE . '?' . $_SERVER['QUERY_STRING'] == 'msg_sent.php?type=NN') {
						echo '<a href="#" class="body1sub">Unread <span class="count-span">' . $objMPM->get_message_count("NN", $_SESSION['user_id'], false) . ')</span></a>';
						} else {
						echo '<a href="msg_sent.php?type=NN" class="body1sub"> Unread <span class="count-span">' . $objMPM->get_message_count("NN", $_SESSION['user_id'], false) . '</span></a>';
						} ?></td>
						
						</tr>
						
						</table>
						
						</li>-->
						<!--<li class="headerbar"><a href="msg_sent.php?type=%" class="menu-hd01">Message Sent <span class="count-span">(<?php echo $objMPM->get_message_count("NN", $_SESSION['user_id'], false) ?>)</span></a></li>             -->
						
						<li class="headerbar"><a href="intrests_recieved.php?type=%" class="menu-hd01">Interest Received <span class="count-span"><?php echo $objMPM->get_intrest_count("%", $_SESSION['user_id'], true) ?></span></a></li>
						
						<li class="submenu">
							<div class="row menu-table">
								<div class="row">
									<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
									<div class="eleven float_R">
										<?php if ($PG_TITLE . '?' . $_SERVER['QUERY_STRING'] == 'intrests_recieved.php?type=NN') {
										echo '<a href="#" class="body1sub active">Pending <span class="count-span">' . $objMPM->get_intrest_count("NN", $_SESSION['user_id'], true) . '</span></a>';
										} else {
										echo '<a href="intrests_recieved.php?type=NN" class="body1sub">Pending <span class="count-span">' . $objMPM->get_intrest_count("NN", $_SESSION['user_id'], true) . '</span></a>';
										} ?>
									</div>
								</div>
								
								<div class="row">
									<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
									<div class="eleven float_R">
										<?php if ($PG_TITLE . '?' . $_SERVER['QUERY_STRING'] == 'intrests_recieved.php?type=AN') {
										echo '<a href="#" class="body1sub active">Accepted <span class="count-span">' . $objMPM->get_intrest_count("AN", $_SESSION['user_id'], true) . '</span></a>';
										} else {
										echo '<a href="intrests_recieved.php?type=AN" class="body1sub">Accepted <span class="count-span">' . $objMPM->get_intrest_count("AN", $_SESSION['user_id'], true) . '</span></a>';
										} ?>
									</div>
								</div>
								
								<div class="row">
									<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
									<div class="eleven float_R">
										<?php if ($PG_TITLE . '?' . $_SERVER['QUERY_STRING'] == 'intrests_recieved.php?type=DN') {
										echo '<a href="#" class="body1sub active">Declined <span class="count-span">' . $objMPM->get_intrest_count("DN", $_SESSION['user_id'], true) . '</span></a>';
										} else {
										echo '<a href="intrests_recieved.php?type=DN" class="body1sub">Declined <span class="count-span">' . $objMPM->get_intrest_count("DN", $_SESSION['user_id'], true) . '</span></a>';
										} ?>
									</div>
								</div>
								
							</div>
						</li>
						
						<li class="headerbar"><a href="intrests_sent.php?type=%">Interest Sent <span class="count-span"><?php echo $objMPM->get_intrest_count("%", $_SESSION['user_id'], false) ?></span></a></li>
						
						<li class="submenu">
							<div class="row">
								<div class="row">
									<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
									<div class="eleven float_R">
										<?php if ($PG_TITLE . '?' . $_SERVER['QUERY_STRING'] == 'intrests_sent.php?type=AN') {
										echo '<a href="#" class="body1sub active">Accepted <span class="count-span">' . $objMPM->get_intrest_count("AN", $_SESSION['user_id'], false) . '</span></a>';
										} else {
										echo '<a href="intrests_sent.php?type=AN" class="body1sub">Accepted <span class="count-span">' . $objMPM->get_intrest_count("AN", $_SESSION['user_id'], false) . '</span></a>';
										} ?>
									</div>
								</div>
								
								<div class="row">
									<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
									<div class="eleven float_R">
										<?php if ($PG_TITLE . '?' . $_SERVER['QUERY_STRING'] == 'intrests_sent.php?type=DN') {
										echo '<a href="#" class="body1sub active">Declined <span class="count-span">' . $objMPM->get_intrest_count("DN", $_SESSION['user_id'], false) . '</span></a>';
										} else {
										echo '<a href="intrests_sent.php?type=DN" class="body1sub">Declined <span class="count-span">' . $objMPM->get_intrest_count("DN", $_SESSION['user_id'], false) . '</span></a>';
										} ?>
									</div>
								</div>
								
								<div class="row">
									<div class="one float_L padding_T_13"><img src="images/bullet.gif" width="16" height="14"></div>
									<div class="eleven float_R">
										<?php if ($PG_TITLE . '?' . $_SERVER['QUERY_STRING'] == 'intrests_sent.php?type=NN') {
										echo '<a href="#" class="body1sub active">Pending <span class="count-span">' . $objMPM->get_intrest_count("NN", $_SESSION['user_id'], false) . '</span></a>';
										} else {
										echo '<a href="intrests_sent.php?type=NN" class="body1sub">Pending <span class="count-span">' . $objMPM->get_intrest_count("NN", $_SESSION['user_id'], false) . '</span></a>';
										} ?>
									</div>
								</div>
								
							</div>
						
						</li>
						
						<!--   <li><?php //if($PG_TITLE=='messageboard.php'){echo '<a href="#"><font color="#00CC99">Message Board</font></a>';}else{echo '<a href="messageboard.php">Message Board</a>';} ?></li>-->
						
						<li><?php if ($PG_TITLE == 'msg_recieved.php') {
						echo '<a href="#" class="active">Message Received <span class="count-span">'.$objMPM->get_message_count("NN", $_SESSION["user_id"], true).'</span></a>';
						} else {
						
						echo '<a href="msg_recieved.php?type=%" class="menu-hd01">Message Received <span class="count-span">'.$objMPM->get_message_count("NN", $_SESSION["user_id"], true).'</span></a>';
						} ?></li>
						
						<!--<li><?php if ($PG_TITLE == 'msg_sent.php') {
						echo '<a href="#">Message Sent <span class="count-span">'.$objMPM->get_message_count("NN", $_SESSION["user_id"], false).'</span></a>';
						} else {
						
						echo '<a href="msg_sent.php?type=%" class="menu-hd01">Message Sent <span class="count-span">'.$objMPM->get_message_count("NN", $_SESSION["user_id"], false).'</span></a>';
						} ?></li>-->
						<?php
                                                $currdate = date('Y-m-d');
         
         
        $matchexistingquery = "SELECT * FROM ".TABLEPREFIX."matching_profiles WHERE  nUser_Id = '".$_SESSION['user_id']."' AND match_date = '$currdate' ";
       // echo "SELECT * FROM ".TABLEPREFIX."matching_profiles WHERE  nUser_Id = '".$_SESSION['user_id']."' AND match_date = '$currdate' ";
        //echo $matchexistingquery;
        $matchexistingqueryres	= @mysql_query($matchexistingquery);

        $matchexistingquerycount = mysql_num_rows($matchexistingqueryres);
        ($matchexistingquerycount)?$matchexistingquerycount:0;
                                                
                                                ?>
                         <li><?php if ($PG_TITLE == 'matching_profiles.php') {
						echo '<a href="#" class="active">Matching Profiles <span class="count-span">'.$matchexistingquerycount.'</span></a>';
						} else {
						echo '<a href="matching_profiles.php" class="menu-hd01">Matching Profiles <span class="count-span">'.$matchexistingquerycount.'</span></a>';
						} ?></li>
                                                
                                                
                                                
						<li><?php if ($PG_TITLE == 'requests.php') {
						echo '<a href="requests.php" class="active">IM List/Requests</a>';
						} else {
						echo '<a href="requests.php" class="menu-hd01">IM List/Requests</a>';
						} ?></li>
						<li><?php if ($PG_TITLE == 'hots.php') {
						echo '<a href="#" class="active">Hot List</a>';
						} else {
						echo '<a href="hots.php">Hot List</a>';
						} ?></li>
						
						<li><?php if ($PG_TITLE == 'my_alerts.php') {
						echo '<a href="#" class="active">Alert Settings</a>';
						} else {
						echo '<a href="my_alerts.php">Alert Settings</a>';
						} ?></li>
						<?php if($siteSettings['regmode']!=REGISTRATION_FREE_MODE){ ?>
						<li><?php if ($PG_TITLE == 'buy_credits.php') {
						echo '<a href="#" active>Buy Credits</a>';
						} else {
						echo '<a href="buy_credits.php">Buy Credits</a>';
						} ?></li>
                                                <?php } ?>
						<!-- <li><?php if($PG_TITLE=='personality_graph.php'){echo '<a  target="_blank" ><font color="#00CC99">Personality Profile Graph</font></a>';}else{echo '<a href="personality_graph.php" target="_blank" onclick="return graph();">Personality Profile Graph</a>';} ?></li>			
						<li><?php if ($PG_TITLE == 'blogs.php') {
						echo '<a href="#"><font color="#00CC99">Blogs</font></a>';
						} else {
						echo '<a href="blogs.php?action=dashboard">Blogs</a>';
						} ?></li>   -->			
						<?php
						//checking background checking is enable or not
						if($siteSettings['bcheck']=='Yes')
						{
						?>
						<li><a href="my_backgroundcheck.php">Background Check</a></li>
						<?php
						}//end if
						?>
						<li><?php if ($PG_TITLE == 'change_password.php') {
						echo '<a href="#" class="active">Change Password</a>';
						} else {
						echo '<a href="change_password.php">Change Password</a>';
						} ?></li>
						
						<li><?php if ($PG_TITLE == 'success_stories.php') {
						echo '<a href="#" class="active">Success Story</a>';
						} else {
						echo '<a href="success_stories.php">Success Story</a>';
						} ?></li>
						<li><?php if ($PG_TITLE == 'testimonials.php') {
						echo '<a href="#" class="active">Testimonials</a>';
						} else {
						echo '<a href="testimonials.php">Testimonials</a>';
						} ?></li>
					</ul>
				
				</div>
			
			</div>
		</div>

	</div>
</div>

	
	

<div class="box-ryt">
        <div class="box-ryt-mid">
			<h5>Search Partners</h5>
			<div class="row">
				<form name="frmSearch" method="post" action="search_profiles.php">
				<div class="R_search_outer">
					<div class="R_search_inner">
						<div class="R_search_txt bx-txt-sz">I am a</div>
						<div class="R_search_feild">
							<select name="vSG" class="select-mini">
								<option value="Female" <?php echo ($_SESSION['user_gender']=="Male") ? "selected" : ""?>>Man looking for a Woman</option>
								<option value="Male" <?php echo ($_SESSION['user_gender']=="Female") ? "selected" : ""?>>Woman looking for a Man</option>
								<?php if($enable_same_sex_search == 'Y') { ?>
								<option value="Females" <?php echo ($_SESSION['gender_search']=="Females") ? "selected" : ""?>>Women looking for a Woman</option>
								<option value="Males" <?php echo ($_SESSION['gender_search']=="Males") ? "selected" : ""?>>Man looking for a Man</option>
								<?php } ?>
							</select>
						</div>
					</div>
					<div class="R_search_inner">
						<div class="R_search_txt bx-txt-sz">Who is from</div>
						<div class="R_search_feild">
							<div class="select-small_outer">
								<select name="vSAF" class="select-small">
									<?php foreach ($arrPartnerAgeFrom as $key => $value){?>
									<option value="<?php echo $value;?>" <?php echo $age_from==$value?"selected":""?>><?php echo $value;?></option>
									<?php }//end foreach ?>
								</select> 
							</div>
							<div class="select-small_txt">to</div>
							<div class="select-small_outer">
								<select name="vSAT" class="select-small">
									<?php foreach ($arrPartnerAgeFrom as $key => $value) {?>
									<option value="<?php echo $value;?>" <?php echo $age_to==$value?"selected":""?>><?php echo $value;?></option>
									<?php }//end foreach ?>
								</select>
							</div>
						</div>
					</div>
					<div class="clear"></div>
					<div class="R_search_inner">
						<div class="R_search_feild">
							<input type="checkbox" name="vSP" value="Y"> Who has a photo 
						</div>
					</div>
					<div class="R_search_inner">
						<div class="R_search_feild">
						<div class="log-btn">
							<input type="hidden" name="SearchNow" value=" Search ">
							<input name="imageField" type="submit" class="search-sml-btn"  value="Search">
							<input type="hidden" name="sex" value="<?php echo $_SESSION['user_gender']; ?>">
							<input type="hidden" name="agefrom" value="<?php echo $_SESSION['agefrom']; ?>">
							<input type="hidden" name="ageto" value="<?php echo $_SESSION['ageto']; ?>">
						</div>
						</div>
					</div>
				</div>					
			</form>
		</div>
              

</div>

</div>
<?php

}//end if

else

{

?>

<script language="javascript" type="text/javascript">
    if (typeof changeCSS == 'function')
    {
        function changeCSS(obj, type)
        {
            if (type == 'text') {

                    obj.className = 'textbox';

            } else if (type == 'textarea') {

                    obj.className = 'textbox';

            } else if (type == 'select') {

                    obj.className = 'textbox';

            } else {

                    obj.className = 'textbox';

            }
        }
    }

    if (typeof validate == 'function')
    {
        function validate()
        {

            var frm = document.frmTellsl;

            if (frm.user.value=="")
            {

                    alert("Please enter username.");

                    frm.user.className ='errorinput';

                    frm.user.focus();

                    return false;

            }//end if

            if (frm.pass.value=="")

            {

                    alert("Please enter password.");

                    frm.pass.className ='errorinput';

                    frm.pass.focus();

                    return false;

            }//end if

            return true;

        }
    }
</script>
        <div class="box-ryt">
        <div class="box-ryt-mid">
			<h5>Search Partner</h5>
			<div class="row">
            	<form name="frmSearch" method="post" action="search_profiles.php">
				<div class="R_search_outer">
					<div class="R_search_inner">
						<div class="R_search_txt">I am a</div>
						<div class="R_search_feild">
							<select name="vSG" class="select-mini" tabindex="5">
								<option value="Female" <?php echo ($_SESSION['gender_search'] == "Female") ? "selected" : "" ?>>Man looking for a Woman</option>
								<option value="Male" <?php echo ($_SESSION['gender_search'] == "Male") ? "selected" : "" ?>>Woman looking for a Man</option>
							</select>
						</div>
					</div>
					<div class="R_search_inner">
						<div class="R_search_txt">Who is from</div>
						<div class="R_search_feild">
							<div class="select-small_outer">
								<select name="vSAF" class="select-small" tabindex="6">
									<?php
									foreach ($arrPartnerAgeFrom as $key => $value) {
									?>
									<option value="<?php echo $value; ?>" <?php echo $age_from == $value ? "selected" : "" ?>><?php echo $value; ?></option>
									<?php }//end foreach  ?>
								</select>
							</div>
							<div class="select-small_txt">to</div>
							<div class="select-small_outer">
								<select name="vSAT" class="select-small" tabindex="7">
									<?php
									foreach ($arrPartnerAgeFrom as $key => $value) {
									?>
									<option value="<?php echo $value; ?>" <?php echo $age_to == $value ? "selected" : "" ?>><?php echo $value; ?></option>
									<?php }//end foreach ?>
							</select>
							</div>
						</div>
					</div>
					<div class="clear"></div>
					<div class="R_search_inner">
						<div class="R_search_feild"><input type="checkbox" name="vSP" value="Y" tabindex="8">Who has a photo </div>
					</div>
					<div class="R_search_inner">
						<div class="R_search_feild">
						<div class="log-btn">
							<input type="hidden" name="SearchNow" value="Search"><input name="imageField" type="submit" class="search-sml-btn" tabindex="9" value="Search">
						</div>
						</div>
					</div>    
				</div>                          
             </form>
                                                    
    <!--td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td class="box1"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
            <td class="maintextCopy bx-login-hd" align="center">Already a member? Login here </td>
      </tr>
      <tr><td>&nbsp;</td></tr>
    </table>
      <table width="100%"  border="0" cellspacing="0" cellpadding="3">
            <form name="frmTellsl" method="post" action="login.php" onSubmit="return validate();">
            <tr>
              <td width="49%" align="right" class="maintextCopy bx-txt-sz">Username &nbsp;</td>
              <td width="51%" align="left"><input name="user" type="text" class="textbox textbox01" onKeyDown="changeCSS(this, 'text');" tabindex="1"></td>
            </tr>
            <tr>
              <td align="right" class="maintextCopy bx-txt-sz">Password &nbsp;</td>
              <td align="left"><input name="pass" type="password" class="textbox textbox01" onKeyDown="changeCSS(this, 'text');" tabindex="2"></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td align="left"><input type="hidden" name="sex" value="<?php echo $_SESSION['gender_search']; ?>">
                    <input type="hidden" name="agefrom" value="<?php echo $_SESSION['agefrom']; ?>">
                    <input type="hidden" name="ageto" value="<?php echo $_SESSION['ageto']; ?>"><input name="LN" type="submit" class="loginbutton" value=" Login " tabindex="3">&nbsp;<a href="register.php"><input type="button" class="back-btn" value="Register" tabindex="4" onClick="location.href='register.php';"></a></td>
            </tr>
            </form>
    </table></td>

    </tr>

    </table></td>

    </tr-->

                        
			</div>
                
             </div>

</div>
    <?php
}
?>
   
<div>

<?php
//end else

//subpage banner display

if($PG_TITLE!='index.php')

{

	$sqlBanners = $objST->select_rows(TABLEPREFIX.'Banners','*,min(nCount)',"where vActive='1' and vLocation='Sub'

							GROUP BY nBId order by rand(),nPosition desc limit 0,4");

	if(mysql_num_rows($sqlBanners)>0)

	{

		while($arrBanner=mysql_fetch_array($sqlBanners))

		{

				$Newbannerwidth=($arrBanner['vWidth']!='')?$arrBanner['vWidth']:'340';

				$Newbannerheight=($arrBanner['vHeight']!='')?$arrBanner['vHeight']:'60';

			

				if($arrBanner['nType']=='OpenX')

				{

					$showBannerCode='<div style="overflow:auto; width:'.$Newbannerwidth.'px;height:'.$Newbannerheight.'px;">'.$arrBanner['vOpenxDes'].'</div>';

				}//end if

				else

				{

					if($arrBanner['vImg']!='')

					{

						$showBannerCode='<a href="'.$arrBanner['vlocUrl'].'" target="_blank"><img src="./banners/'.$arrBanner['vImg'].'" name="img1" width="'.$Newbannerwidth.'" height="'.$Newbannerheight.'" border="0" alt="'.$arrBanner['vName'].'"></a>';

					}//end if

				}//end else

			

				mysql_query("update ".TABLEPREFIX."Banners set nCount=nCount+1 where nBId='".$arrBanner['nBId']."'") or die(mysql_error());

?>
    
			<div class="clear"></div>
             <div class="row">
				 <?php echo $showBannerCode; ?>
			 </div>
                
<?php

		}//end while

	}//end if

}//end if

?>
</div>
