<?
header('location:expesearch.php');
include "inc/header.php";
include("../include/common.inc");
include("./phphoo.php3");
$thispagebookmark = "expesearch";
$trailArr  =start_browse($viewCat,"BreadCrumb");
$trail=$trailArr[0];
$trailCount=$trailArr[1];
?>
<?php
	$thispagebookmark = "newexpedition";
?>
<script language="JavaScript">
function openWin( windowURL) 
{ 
	window.open( windowURL,'wndHelp','width=550,height=500,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
}
</script>
<tr>
	<td>
		<table width="100%" height="563" cellspacing="0" cellpadding="0" border="0" id="Table_01">

			<tr>
				
				 <td style="vertical-align:top">
				 
					<div class="register-select">
					<div class="contentHeading contentHeadingDark1">Search Directory</div><br/>

						<font face="Verdana, Arial, Helvetica, sans-serif" size="1">EXPESEARCH 
						    is a directory of non-profit organizations and commercial 
						    companies which offer products and services to expeditions, 
						    ExpeditionQuest members, and the general public. Special 
						    Discount Codes are available only to members of Expedition 
						    Quest. Organizations which offer discounts to EQ members 
						    are listed at the top of their category. For more 
						    information on registering your organization or company 
						    please go <a href="http://www.expeditionquest.com/register/register_info.php?type=organization" target="_blank">here</a></font>
							<br><br>
							<font class="homeText">Enter 
						    keywords to search the Expesearch Directory :</font><br><br>
						     <form action="<?php echo $PHP_SELF ?>" method="POST">
					<table>
						<tr valign="top"> 
							<td colspan="3" height="30" valign=top>
								&nbsp;<input type="hidden" name="Search" value="Search">
								<input type="text" name="keywords" size="30" value="<?php echo urldecode($keywords); ?>">
							</td>
							<td>
								<input class="exp_search_submit" type="submit" border="0" name="imageField" value="Search">
							</td>
						</tr>
					</table>
					</form>

					<!--<table width="100%" cellspacing="0" cellpadding="0" border="0" style="padding: 10px 10px 10px 0px;">
						<tr>
							<td class="contentHeading">
								Sub Categories
							</td>
						</tr>
						<tr> 
							<td>
								<table width="100%" cellspacing="0" cellpadding="0" border="0" style="padding:15px 15px 15px 0px;">
									<tr>
										<td width="48%" valign="top" height="25">
											<table width="100%" cellspacing="0" cellpadding="0" border="0">
												<tr>
													<td width="3%" valign="baseline" height="22">
														<img src="/images/arrow_bullet.gif"></td><td width="47%" valign="baseline" class="expLinks"><a href="ec_list.phtml?action=List&amp;view=Category&amp;expcatid=1">Anthropology/Archaeology</a>
													</td>
												</tr>
												<tr>
													<td width="3%" valign="baseline" height="22">
														<img src="/images/arrow_bullet.gif"></td><td width="47%" valign="baseline" class="expLinks"><a href="ec_list.phtml?action=List&amp;view=Category&amp;expcatid=35">Atmospheric Science/Weather</a>
													</td>
												</tr>
											</table>
										</td>
										<td width="50%" valign="top" height="20">
											<table width="100%" cellspacing="0" cellpadding="0" border="0">
												<tr>
													<td width="3%" valign="baseline" height="22">
														<img src="/images/arrow_bullet.gif"></td><td width="47%" valign="baseline" class="expLinks"><a href="ec_list.phtml?action=List&amp;view=Category&amp;expcatid=9">Mountaineering</a>
													</td>
												</tr>
												<tr>
													<td width="3%" valign="baseline" height="22">
														<img src="/images/arrow_bullet.gif"></td><td width="47%" valign="baseline" class="expLinks"><a href="ec_list.phtml?action=List&amp;view=Category&amp;expcatid=10">Ocean Sailing/ Rowing</a>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							 </td>
							      </tr>
							      <tr> 
								<td valign="top" height="20"><img width="1" height="1" src="images/shim.gif"></td>
							      </tr>
							      
						    </tbody></table>-->
						    <table width="90%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td height="18" width="53%" colspan=3><font face="Arial, Helvetica, sans-serif" size="2"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><font color="#0000CC"> 
                        <?php
						  if(!$Search)
						  {
							echo $trail;
						  }
						  else
						  {
							echo "<font color=#666666>Search Results </font>";
						  }
					   ?> </font></font></font></td>
                    </tr>
                    <?php
				  if(!$Search)
				  {
				  ?> 
                    <tr> 
                      <td height="15" width="53%" colspan=3 bgcolor="#99CCFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF"><b><font color="#000000">&nbsp;Sub 
                        Categories</font></b></font></td>
                    </tr>
		    <?php if($trailCount<2) { ?>
                    <tr valign="top"> 
                      <td colspan="3"> <font face="Arial, Helvetica, sans-serif" size="2"> 
                        <?php $current_cat = start_browse($viewCat,"Cat_List"); ?> 
                        </font></td>
                    </tr>
		    <?php } ?>
                    <tr> 
                      <td colspan="3">&nbsp;</td>
                    </tr>
                    <?php 
				  if($viewCat)
				  {
				  ?> 
                    <tr> 
                      <td height="18" colspan="3"> 
                        <div align="center"><font face="verdana, Helvetica, sans-serif" size="1"> 
                          <a href="javascript:openWin('./suggest.ell?add=<?php echo $viewCat; ?>')">Suggest 
                          an URL</a></font></div>
                      </td>
                    </tr>
                    <?php
				  }
				  ?> 
                    <tr> 
                      <td height="2" colspan="3">&nbsp;</td>
                    </tr>
                    <tr> 
                      <td height="14" width="53%" bgcolor="#99CCFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000"><b>&nbsp;Top 
                        Sites in Category</b></font></td>
                      <td height="14" width="47%" colspan=2 bgcolor="#99CCFF"> 
                        <!--<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000">&lt;&lt; 
                          &nbsp;<b>Page 1 </b>2 3 &gt;&gt;&nbsp;</font></div>-->
                      </td>
                    </tr>
                    <tr> 
                      <td colspan="3" height="10"><img src="/images/dot.GIF" width="1" height="1"></td>
                    </tr>
                    <tr> 
                      <td colspan="3"> <font face="Arial, Helvetica, sans-serif" size="2"><?php $current_cat=start_browse($viewCat,"URL_List"); ?> 
                        </font> </td>
                    </tr>
                    <?php
				  }
				  else
				  {
					echo "<tr><td colspan=\"3\" height=\"20\">";
					echo "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\">";
					$hits = $db->search($keywords);
					if( (!$hits) or (empty($hits)) )
					{
						$junk = "";
						$title = "Search Results";
						$msg =  "No Matches";
					} 
					else 
					{
						$total = count($hits);
						$title = "Search Results";
						$junk = "";
						$i=0;							
						while ( list ($key,$hit) = each ($hits))
						{
							if(!empty($hit))
							{
								$flag=1;
								/*$flag=0;
								for($j=0;$j<count($arr);$j++)
								{
								  if ($hit["username"]==$arr[$j]["Username"])
								  {
									$flag=$j+1;
									break;
								  }
								}
								if($flag!=0)
								{
									$CatID = $hit["CatID"];
									$arr[$i]["CatName"] .= ", <A HREF=\"$PHP_SELF?viewCat=$CatID\">".stripslashes($db->get_CatNames($CatID))."</a>";
								}
								else
								{*/
									$arr[$i]["Username"]=stripslashes($hit["username"]);
									$arr[$i]["LinkID"] = stripslashes($hit["LinkID"]);
									$arr[$i]["Url"]= stripslashes($hit["Url"]);
									$arr[$i]["LinkName"]= stripslashes($hit["LinkName"]);
									$arr[$i]["Desc"]= stripslashes($hit["Description"]);
									$arr[$i]["Discount"]= stripslashes($hit["max_discount"]);
									$CatID = $hit["CatID"];
									$arr[$i]["CatName"] = "<A HREF=\"$PHP_SELF?viewCat=$CatID\">".stripslashes($db->get_CatNames($CatID))."</a>";
								//}
									$i++;
							}
						}
						echo $msg = "<br>The search returned ".count($arr)." match(s)"."<br><br>";
						for($i=0;$i<count($arr);$i++)
						{
							print "<LI>";
							print "<A HREF=\"http://".str_replace("http://","",$arr[$i]["Url"])."\" TARGET=\"_BLANK\"><font color=#0000FF><B>".$arr[$i]["LinkName"]."</B></font></A>";
							$LinkID=$arr[$i]["LinkID"];
							if($Discount >0)
							  print " - <font size=1 color='#cc0000'>*<a href=\"javascript:openWin('./link_details.ell?LinkID=$LinkID');\"><font size=1 color='#cc0000'>EQ Member Discounts Available</font></a>*</font>";
							echo "<br>".$arr[$i]["Desc"]."<BR>\n";
							echo "<B>Found In:</B>&nbsp;".$arr[$i]["CatName"]."<Br><br>\n";
							echo "</Li>";
						}
				  }
				  
						echo "</font></td></tr>";
				 }
				?> 
                  </table>
							 
                   	
					</div>
                </td>
				 <td style="vertical-align:top">
					<div class="newsContent-1-2 content-border" style="height: 500px; width: 245px;">
<!--					<?include 'inc/index/highlights_features.php';?>-->
					</div>
                </td>
			</tr>
		</table>
		
	</td>
	
</tr>
<?php include "../inc/footer.php"; ?>