<?php
include("includes/site_info.php");
include('session_handler.inc');
include_once __INCLUDE_CLASS_PATH."/class.Picture.php";
	
$type = $_REQUEST["type"];

	switch ($type) {
	case "member"; 
		Search_member($type);
		break;
	case "gallery";
		Search_gallery($type);
		break;
	case "blog"; 
		Search_blog($type);
		break;
	case "note"; 
		Search_note($type);
		break;
	default; 
		echo "";
		break;
	}

function Search_member($type) {
global $SITE_MAIN_WWW_ROOT, $CONST_LINK_ROOT;
$picture = new Picture();

$WUserID = $_SESSION['Sess_UserId'];
$WUserType = $_SESSION['Sess_UserType'];
$WUserName = $_SESSION['Sess_UserName'];

if(!empty($_REQUEST['q']) || ($_REQUEST['q']!= ' ')){
$q = $_REQUEST['q'];
} else {
$q = '';
die ("<strong>Please enter a name!</strong>");
}
		$i = 2;
		$j = 0;

	if(isset($_REQUEST['start'])) {
		$start=($_REQUEST['start']-1)*10; 
		$i = $_REQUEST['start']+1;
		$j = $_REQUEST['start']-1;
	} else {	
		$start=0;
	}
	
$all_hahaper_query=mysql_query("SELECT mem_userid, mem_username, mem_fullname FROM adverts LEFT JOIN members ON (adv_userid=mem_userid) WHERE (mem_username like '%$q%' or mem_fullname like '%$q%') and adv_approved='1' order by mem_username") or die(mysql_error());
$all_hahaper_TOTAL = mysql_num_rows($all_hahaper_query);
$page = ceil($all_hahaper_TOTAL/10);

$myhahaper_query=mysql_query("SELECT mem_userid, mem_username, mem_fullname FROM adverts LEFT JOIN members ON (adv_userid=mem_userid) WHERE (mem_username like '%$q%' or mem_fullname like '%$q%') and adv_approved='1' order by mem_username limit $start, 10") or die(mysql_error());
$myhahaper_TOTAL = mysql_num_rows($myhahaper_query);

if ($myhahaper_TOTAL >0) {
?>

<div class="result_box">
  <?php 
  if ($j>0) {
  	if (($page >= $i) && ($i!=2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$j.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">PREVIOUS<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	if ($page < $i) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$j.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">PREVIOUS<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	}

while ($ret_pic2 = mysql_fetch_object($myhahaper_query)) {
if ($WUserID==$ret_pic2->mem_userid) {
$photo_query=mysql_query("SELECT * FROM pictures WHERE pic_userid = '$ret_pic2->mem_userid' and pic_default='Y'") or die(mysql_error()); 
} else {
$photo_query=mysql_query("SELECT * FROM pictures WHERE pic_userid = '$ret_pic2->mem_userid' and pic_default='Y' and pic_private='N'") or die(mysql_error()); 
}
$pics_count = mysql_num_rows($photo_query);
$aPicture = mysql_fetch_object($photo_query);
if ($pics_count > 0) {
	$medium = $aPicture->pic_picture."_ps.".$aPicture->ext;
	$male1_picture1 = "$SITE_MAIN_WWW_ROOT/members/$ret_pic2->mem_username/picture/$medium";
             }else{
$male1_picture1=$CONST_LINK_ROOT."/".$picture->GetProfilePicture($ret_pic2->mem_userid);
}

$fullname = $ret_pic2->mem_username;

$time=time();
$timeout = time()-900;
$query="SELECT COUNT(userid) FROM active_users where timestamp > $timeout AND userid=$ret_pic2->mem_userid";
$reton=mysql_query($query) or die(mysql_error());
$totalon=mysql_result($reton,0,0);

if($totalon>0)
{$status="<span style=\"color:green\">Online!</span>";}
else{$status="Offline!";}

	if($ret_pic2->mem_userid==$WUserID) {
	$request=0;
	} else {
	$retval=mysql_query("SELECT * FROM my_friends WHERE (uid='$WUserID' AND friend_uid='$ret_pic2->mem_userid') or (uid='$ret_pic2->mem_userid' AND friend_uid='$WUserID')");
	$sql_array = mysql_fetch_object($retval);
	$result=mysql_num_rows($retval);

	if ($result == 0) {
	$request=1;
	} elseif ($sql_array->approved == 0) {
	$request=2;
	$retval=mysql_query("SELECT * FROM my_friends WHERE uid='$ret_pic2->mem_userid' AND friend_uid='$WUserID'");
	$sql_array = mysql_fetch_object($retval);
	$result=mysql_num_rows($retval);
	if ($result == 0) {
	$request=2;
	} elseif ($sql_array->approved == 0) {
	$request=4;
	}else {
	$request=2;
	}
	} else {
	$request=0;
	}
	}

?>
  <div class="content">
    <div class="image"><a href="javascript:;" onclick="javascript: callprofileInfo(<?=$ret_pic2->mem_userid?>);"><span class="img_b_p3 left"><img src="<?=$male1_picture1?>" border="0" title="Name:&nbsp;<?=ucwords($fullname);?>"/></span></a></div>
    <div class="name"><a href="javascript:;" onclick="javascript: callprofileInfo(<?=$ret_pic2->mem_userid?>);"><span class="blue_12">
      <?=ucwords($fullname);?>
      </span> </a><br />
      <?=$status?>
    </div>
    <div class="rightContent">
      <?php if ($request==1 || $request==3) { ?>
      <span id="send_request_<?=$ret_pic2->mem_userid?>" class=""> <a href="javascript:void(null);" title="Request to Connect" onclick="javascript: jQuery.facebox({ajax:'<?=$CONST_LINK_ROOT?>/label-me.php?RUserID=<?=$ret_pic2->mem_userid?>&amp;RUserName=<?=$ret_pic2->mem_username?>&amp;mode=request&amp;backmode=connectAll&amp;FUserID=<?=$RUserID?>'}, this.title, 'popLabel'); return false;" class="button" rel="facebox"><img src="images/icon-label.gif" width="18" height="15" border="0" align="absbottom"/> Request to Connect</a></span>
		<span id="confirm_request_<?=$ret_pic2->mem_userid?>" class="none"> <img src="images/icon-label.gif" width="18" height="15" border="0" align="absbottom"/> Pending Confirmation</span>
		<span id="accept_request_<?=$ret_pic2->mem_userid?>" class="none"> <a href="javascript:void(null);" title="Respond to Request" onclick="javascript: jQuery.facebox({ajax:'<?=$CONST_LINK_ROOT?>/label-me.php?AUserID=<?=$ret_pic2->mem_userid?>&amp;AUserName=<?=$ret_pic2->mem_username?>&amp;mode=respond&amp;backmode=connectAll&amp;FUserID=<?=$RUserID?>'}, this.title, 'popLabel'); return false;" class="button" rel="facebox"><img src="images/icon-label.gif" width="18" height="15" border="0" align="absbottom"/> Accept Request</a></span>
      <?php } ?>
      <?php if ($request==2) { ?>
      <img src="images/icon-label.gif" width="18" height="15" border="0" align="absbottom"/> Pending Confirmation
      <?php } ?>
      <?php if ($request==4) { ?>
      <span id="accept_request_<?=$ret_pic2->mem_userid?>" class=""> <a href="javascript:void(null);" title="Respond to Request" onclick="javascript: jQuery.facebox({ajax:'<?=$CONST_LINK_ROOT?>/label-me.php?AUserID=<?=$ret_pic2->mem_userid?>&amp;AUserName=<?=$ret_pic2->mem_username?>&amp;mode=respond&amp;backmode=connectAll&amp;FUserID=<?=$RUserID?>'}, this.title, 'popLabel'); return false;" class="button" rel="facebox"><img src="images/icon-label.gif" width="18" height="15" border="0" align="absbottom"/> Respond to Request</a></span>
		<span id="send_request_<?=$ret_pic2->mem_userid?>" class="none"> <a href="javascript:void(null);" title="Request to Connect" onclick="javascript: jQuery.facebox({ajax:'<?=$CONST_LINK_ROOT?>/label-me.php?RUserID=<?=$ret_pic2->mem_userid?>&amp;RUserName=<?=$ret_pic2->mem_username?>&amp;mode=request&amp;backmode=connectAll&amp;FUserID=<?=$RUserID?>'}, this.title, 'popLabel'); return false;" class="button" rel="facebox"><img src="images/icon-label.gif" width="18" height="15" border="0" align="absbottom"/> Request to Connect</a></span>
      <?php } ?>
    </div>
    <div class="clear"><img src="images/spacer.gif" /></div>
  </div>
  <?php
				} 
	if (($page >= $i) && ($i!=2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$i.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">NEXT<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	if (($page >= $i) && ($i==2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$i.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">NEXT<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	?>
</div>
<?php
} else {
die ("<strong>No results found for your query!</strong><br>Check your spelling or try another term.");
}

}


function Search_gallery ($type) {
global $SITE_MAIN_WWW_ROOT, $CONST_LINK_ROOT, $SITE_WWW_ROOT;

if(!empty($_REQUEST['q']) || ($_REQUEST['q']!= ' ')){
$q = $_REQUEST['q'];
} else {
$q = '';
die ("<strong>Please enter a query!</strong>");
}
		$i = 2;
		$j = 0;

	if(isset($_REQUEST['start'])) {
		$start=($_REQUEST['start']-1)*10; 
		$i = $_REQUEST['start']+1;
		$j = $_REQUEST['start']-1;
	} else {	
		$start=0;
	}
	
  $all_galleries_query=mysql_query("SELECT DATE_FORMAT(modified_date, '%M %d, %Y') as mod_date, DATE_FORMAT(gallery_date, '%M %d, %Y') as create_date, Gallery_ID, Name, Description, cover, mem_userid, mem_username FROM gallery LEFT JOIN members ON (mem_id=mem_userid) WHERE (Name like '%$q%' or Description like '%$q%') and Level='Public' and cover !=0 order by Name asc") or die(mysql_error());
$all_galleries_TOTAL = mysql_num_rows($all_galleries_query);
$page = ceil($all_galleries_TOTAL/10);

$galleries_query=mysql_query("SELECT DATE_FORMAT(modified_date, '%M %d, %Y') as mod_date, DATE_FORMAT(gallery_date, '%M %d, %Y') as create_date, Gallery_ID, Name, Description, cover, mem_userid, mem_username FROM gallery LEFT JOIN members ON (mem_id=mem_userid) WHERE (Name like '%$q%' or Description like '%$q%') and Level='Public' and cover !=0 order by Name asc limit $start, 10") or die(mysql_error());
$galleries_TOTAL = mysql_num_rows($galleries_query);

if ($galleries_TOTAL >0) {
?>

<div class="result_box">
  <?php 
  if ($j>0) {
  	if (($page >= $i) && ($i!=2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$j.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">PREVIOUS<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	if ($page < $i) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$j.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">PREVIOUS<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	}

		while ($gallery = mysql_fetch_object($galleries_query) ) {
$galleryitem_query=mysql_query("SELECT * FROM galleryitem WHERE Gallery_ID = '$gallery->Gallery_ID'") or die(mysql_error());
$galleryitem_TOTAL = mysql_num_rows($galleryitem_query);
if ($gallery->cover!=0){
$cover_query=mysql_query("SELECT * FROM galleryitem WHERE Gallery_ID = '$gallery->Gallery_ID' and GalleryItem_ID='$gallery->cover' limit 1") or die(mysql_error());
$cover= mysql_fetch_object($cover_query);
$url = $SITE_MAIN_WWW_ROOT."/members/".$gallery->mem_username."/gallery/".md5($gallery->cover)."_medium.".$cover->ext;
} else {
$url = $SITE_WWW_ROOT."/images/spacer.gif";
}
?>
  <div class="content">
							<div class="image_w100h100"><div class="clippedImage" style="background-image: 
url(&quot;<?=$url?>&quot;);"><a href="#mgallery?tab=media&gid=<?=$gallery->Gallery_ID?>&uID=<?=$gallery->mem_userid?>" onclick="javascript: callpage(this.href);" rel="subpage_link">&nbsp;</a></div></div>
							
    <div class="name"><b> <a href="#mgallery?tab=media&gid=<?=$gallery->Gallery_ID?>&uID=<?=$gallery->mem_userid?>" onclick="javascript: callpage(this.href);" rel="subpage_link">
                      <?=$gallery->Name?>
                      </a> </b> <br />
                      <span class="line_height20">
                      <?=$galleryitem_TOTAL?>
                      <?php if ($galleryitem_TOTAL > 1) echo "photos"; else echo "photo"; ?>
                      <br />
                      </span> <span class="lightgrey_10">
							By
							<?=ucwords($gallery->mem_username)?> <br />
							 Updated
                      <?= $gallery->mod_date?>
                      <br />
                      Created
							<?= $gallery->create_date?>
                      <br />
                      </span>
    </div>
    <div class="clear"><img src="images/spacer.gif" /></div>
							</div>
  <?php
	}
	if (($page >= $i) && ($i!=2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$i.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">NEXT<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	if (($page >= $i) && ($i==2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$i.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">NEXT<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	?>
</div>
<?php
} else {
die ("<strong>No results found for your query!</strong><br>Check your spelling or try another term.");
}

}


function Search_blog ($type) {
global $SITE_MAIN_WWW_ROOT, $CONST_LINK_ROOT, $SITE_WWW_ROOT, $SITE_MAIN_ROOT;

if(!empty($_REQUEST['q']) || ($_REQUEST['q']!= ' ')){
$q = $_REQUEST['q'];
} else {
$q = '';
die ("<strong>Please enter a query!</strong>");
}
		$i = 2;
		$j = 0;

	if(isset($_REQUEST['start'])) {
		$start=($_REQUEST['start']-1)*10; 
		$i = $_REQUEST['start']+1;
		$j = $_REQUEST['start']-1;
	} else {	
		$start=0;
	}

  $all_blogs_query=mysql_query("SELECT UNIX_TIMESTAMP(blg_datetime) as blgdate, blg_id, blg_mood, blg_title, blg_message, blg_tags, blg_picture, blg_ext, mem_userid, mem_username FROM blogs LEFT JOIN members ON (blg_userid=mem_userid) WHERE (blg_title like '%$q%' or blg_message like '%$q%' or blg_tags like '%$q%') and blg_approved='Y' and blg_private='N' order by blg_title asc") or die(mysql_error());
$all_blogs_TOTAL = mysql_num_rows($all_blogs_query);
$page = ceil($all_blogs_TOTAL/10);

$blogs_query=mysql_query("SELECT UNIX_TIMESTAMP(blg_datetime) as blgdate, blg_id, blg_mood, blg_title, blg_message, blg_tags, blg_picture, blg_ext, mem_userid, mem_username FROM blogs LEFT JOIN members ON (blg_userid=mem_userid) WHERE (blg_title like '%$q%' or blg_message like '%$q%' or blg_tags like '%$q%') and blg_approved='Y' and blg_private='N' order by blg_title asc limit $start, 10") or die(mysql_error());
$blogs_TOTAL = mysql_num_rows($blogs_query);

if ($blogs_TOTAL >0) {

  if ($j>0) {
  	if (($page >= $i) && ($i!=2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$j.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">PREVIOUS<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	if ($page < $i) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$j.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">PREVIOUS<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	}

	while ($blog = mysql_fetch_object($blogs_query) ) {
if(file_exists($SITE_MAIN_ROOT."/members/".$blog->mem_username."/blog/".$blog->blg_picture."_small.".$blog->blg_ext)){ $image=$SITE_MAIN_WWW_ROOT."/members/".$blog->mem_username."/blog/".$blog->blg_picture."_small.".$blog->blg_ext ;}  else {$image="$CONST_LINK_ROOT/images/icon-post.gif";}
?>
							<div class="content">
								<div class="image"><a href='#mshowblog?tab=thought&bid=<?=$blog->blg_id?>&uID=<?=$blog->mem_userid?>' onclick="javascript: callpage(this.href);" rel="subpage_link"><span class="img_b_p3 left"><img src='<?=$image?>' title='<?=$blog->blg_title?>' border="0"/></span></a></div>
								<div class="name_w100"><a href='#mshowblog?tab=thought&bid=<?=$blog->blg_id?>&uID=<?=$blog->mem_userid?>' onclick="javascript: callpage(this.href);" rel="subpage_link"><b>
									<?=$blog->blg_title?>
									</b></a><br>
									<span class="lightgrey_10">
									<nobr><?php if ($blog->blg_mood) echo "Mood: ".$blog->blg_mood."</nobr><br />";?>
									By <?=ucwords($blog->mem_username)?>
									<br />
									<nobr><?=date("d M'y h:ia",$blog->blgdate)?></nobr>
									</span> </div>
								<div class="rightContent2">
									<?php 
				$short_msg_text=strip_tags(stripslashes(substr($blog->blg_message,0,450)));
				if (strlen (strip_tags($blog->blg_message))>450) $short_msg_text.="...";
				echo $short_msg_text;
				?>
								</div>
								<div class="clear"><img src="images/spacer.gif" /></div>
							</div>
							<?php
	}
	if (($page >= $i) && ($i!=2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$i.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">NEXT<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	if (($page >= $i) && ($i==2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$i.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">NEXT<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
} else {
die ("<strong>No results found for your query!</strong><br>Check your spelling or try another term.");
}
}


function Search_note ($type) {
global $SITE_MAIN_WWW_ROOT, $CONST_LINK_ROOT, $SITE_WWW_ROOT, $SITE_MAIN_ROOT;

if(!empty($_REQUEST['q']) || ($_REQUEST['q']!= ' ')){
$q = $_REQUEST['q'];
} else {
$q = '';
die ("<strong>Please enter a query!</strong>");
}
		$i = 2;
		$j = 0;

	if(isset($_REQUEST['start'])) {
		$start=($_REQUEST['start']-1)*10; 
		$i = $_REQUEST['start']+1;
		$j = $_REQUEST['start']-1;
	} else {	
		$start=0;
	}

$all_articles_query=mysql_query("SELECT UNIX_TIMESTAMP(art_datetime) as artdate, art_id, art_title, art_message, art_tags, art_picture, art_ext, mem_userid, mem_username FROM articles LEFT JOIN members ON (art_userid=mem_userid) WHERE (art_title like '%$q%' or art_message like '%$q%' or art_tags like '%$q%') and art_approved='Y' and art_private='N' order by art_title asc") or die(mysql_error());
$all_articles_TOTAL = mysql_num_rows($all_articles_query);
$page = ceil($all_articles_TOTAL/10);

$articles_query=mysql_query("SELECT UNIX_TIMESTAMP(art_datetime) as artdate, art_id, art_title, art_message, art_tags, art_picture, art_ext, mem_userid, mem_username FROM articles LEFT JOIN members ON (art_userid=mem_userid) WHERE (art_title like '%$q%' or art_message like '%$q%' or art_tags like '%$q%') and art_approved='Y' and art_private='N' order by art_title asc limit $start, 10") or die(mysql_error());
$articles_TOTAL = mysql_num_rows($articles_query);

if ($articles_TOTAL >0) {

  if ($j>0) {
  	if (($page >= $i) && ($i!=2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$j.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">PREVIOUS<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	if ($page < $i) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$j.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">PREVIOUS<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	}

	while ($article = mysql_fetch_object($articles_query) ) {
if(file_exists($SITE_MAIN_ROOT."/members/".$article->mem_username."/article/".$article->art_picture."_small.".$article->art_ext)){ $image=$SITE_MAIN_WWW_ROOT."/members/".$article->mem_username."/article/".$article->art_picture."_small.".$article->art_ext ;}  else {$image="$CONST_LINK_ROOT/images/icon-post.gif";}
?>
							<div class="content">
								<div class="image"><a href='#mshownote?tab=thought&aid=<?=$article->art_id?>&uID=<?=$article->mem_userid?>' onclick="javascript: callpage(this.href);" rel="subpage_link"><span class="img_b_p3 left"><img src='<?=$image?>' title='<?=$article->art_title?>' border="0"/></span></a></div>
								<div class="name_w100"><a href='#mshownote?tab=thought&aid=<?=$article->art_id?>&uID=<?=$article->mem_userid?>' onclick="javascript: callpage(this.href);" rel="subpage_link"><b>
									<?=$article->art_title?>
									</b></a><br>
									<span class="lightgrey_10">
									By <?=ucwords($article->mem_username)?>
									<br />
									<nobr><?=date("d M'y h:ia",$article->artdate)?></nobr>
									</span> </div>
								<div class="rightContent2">
									<?php 
				$short_msg_text=strip_tags(stripslashes(substr($article->art_message,0,450)));
				if (strlen (strip_tags($article->art_message))>450) $short_msg_text.="...";
				echo $short_msg_text;
				?>
								</div>
								<div class="clear"><img src="images/spacer.gif" /></div>
							</div>
							<?php
	}
	if (($page >= $i) && ($i!=2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$i.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">NEXT<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
	if (($page >= $i) && ($i==2)) {
	echo "<a href=\"javascript: void(null)\" onclick=\"paginate('".$type."',".$i.", '".$q."'); return false;\" ><div class=\"paging\" align=\"center\">NEXT<div id=\"paginate_loading\"><img src=\"images/spacer.gif\"></div></div></a>";
	}
} else {
die ("<strong>No results found for your query!</strong><br>Check your spelling or try another term.");
}
}


?>