<?
if(!defined("site_root")){exit();}

include("content_list_vars.php");
?>
<style>
/*New styles for the previews. It overwrites style.css file.*/
.item_list 
{ 
	width: <?=($global_settings["thumb_width"]+20)?>px;
}

.item_list_img
{
	width: <?=($global_settings["thumb_width"]+20)?>px;
	height: <?=($global_settings["thumb_width"]+20)?>px;
}

.item_list_text1,.item_list_text2,.item_list_text3,.item_list_text4
{
	width: <?=($global_settings["thumb_width"]+20)?>px;
}
</style>

<?
$search_page="<table border='0' cellpadding='0' cellspacing='0' width='100%'>
	<tr valign='top'>
		<td class='search_left'>
			{MENU}
		</td>
		<td class='search_right'>
			{RESULTS}
		</td>
	</tr>
</table>";

if(file_exists($DOCUMENT_ROOT."/".$site_template_url."catalog.tpl"))
{
	$search_page=file_get_contents($DOCUMENT_ROOT."/".$site_template_url."catalog.tpl");
}

$search_page=str_replace("{MENU}","{SEPARATOR}",$search_page);
$search_page=str_replace("{RESULTS}","{SEPARATOR}",$search_page);

$search_parts=explode("{SEPARATOR}",$search_page);

$search_header=$search_parts[0];
$search_middle=@$search_parts[1];
$search_footer=@$search_parts[2];

?>


<?=$search_header?>
<form id='listing_form' method="get" action="<?=site_root?>/index.php" style="margin:0px">
<?
//Default variables

if(isset($_REQUEST["id_parent"]))
{
	echo("<input type='hidden' name='id_parent' value='".(int)$_REQUEST["id_parent"]."'>");
}

if(isset($_REQUEST["acategory"]))
{
	echo("<input type='hidden' name='acategory' value='".(int)$_REQUEST["acategory"]."'>");
}

if(isset($_REQUEST["items"]))
{
	echo("<input type='hidden' name='items' value='".(int)$_REQUEST["items"]."'>");
}

if(isset($_REQUEST["c"]))
{
	echo("<input type='hidden' name='c' value='".result($_REQUEST["c"])."'>");
}

$vars_categories=build_variables("id_parent","acategory",true,"category");
$vars_portfolio=build_variables("user","portfolio");
$vars_author=build_variables("author","");
$vars_lightbox=build_variables("lightbox","");

//End. Default variables.
?>
	<div class="search_left_top"></div>
	<div class="search_left_body">
	<div class="search_title"><?=word_lang("search")?></div>
	<div id="search_current">
		<?
				//Keywords menu
				if(isset($_REQUEST["search"]) and $_REQUEST["search"]!="")
				{
					if(!in_array(result($_REQUEST["search"]),$kw_mass))
					{
						$kw_mass[]=result($_REQUEST["search"]);
						$_REQUEST["search"]="";
					}
				}
				
				sort ($kw_mass);
				reset ($kw_mass);
				
				if(count($kw_mass)>0)
				{
					echo("<div class='search_current_kw_title'>".word_lang("keywords")."</div>");
				}
				else
				{
					echo("<div class='search_current_kw'>".word_lang("all files")."</div>");
				}
				
				$kw_string="";
				for($i=0;$i<count($kw_mass);$i++)
				{
					if($kw_string!="")
					{
						$kw_string.="|";
					}
					$kw_string.=$kw_mass[$i];
					
					$var_prefix="";
					for($j=0;$j<count($kw_mass);$j++)
					{
						if($i!=$j)
						{
							if($var_prefix!="")
							{
								$var_prefix.="|";
							}
							$var_prefix.=$kw_mass[$j];
						}
					}
					
					echo("<div class='search_current_kw'>");
					echo("<input type='button' class='search_current_delete' onClick=\"location.href='".build_variables("kw_list","")."&kw_list=".$var_prefix."'\">");
					echo($kw_mass[$i]);
					echo("</div>");
				}
				
				echo("<input type='hidden' name='kw_list' value='".$kw_string."'>");
				//End. Keywords menu
				
				
				//Portfolio menu
				if((isset($_REQUEST["portfolio"]) and isset($_REQUEST["user"])) or (isset($_REQUEST["author"]) and $_REQUEST["author"]!=''))
				{
					echo("<div class='search_line2'></div>");
					echo("<div class='search_current_kw_title'>".word_lang("portfolio")."</div>");
					if(isset($_REQUEST["author"]) and $_REQUEST["author"]!='')
					{
						$sql2="select login from users where login='".result($_REQUEST["author"])."'";
						$dr->open($sql2);
						if(!$dr->eof)
						{
							echo("<div class='search_current_kw'>");
							echo("<input type='button' class='search_current_delete' onClick=\"location.href='".$vars_author."'\">");
							echo($dr->row["login"]);
							echo("</div>");
						}
					}
					else
					{
						if(isset($_REQUEST["portfolio"]) and isset($_REQUEST["user"]))
						{
							$sql2="select login from users where id_parent=".(int)$_REQUEST["user"];
							$dr->open($sql2);
							if(!$dr->eof)
							{
								echo("<div class='search_current_kw'>");
								echo("<input type='hidden' name='portfolio' value='1'>");
								echo("<input type='hidden' name='user' value='".(int)$_REQUEST["user"]."'>");
								echo("<input type='button' class='search_current_delete' onClick=\"location.href='".$vars_portfolio."'\">");
								echo($dr->row["login"]);
								echo("</div>");
							}
						}
					}		
				}
				//End portfolio menu
				
				
				//Lightbox menu
				if(isset($_REQUEST["lightbox"]))
				{
					echo("<div class='search_line2'></div>");
					echo("<div class='search_current_kw_title'>".word_lang("my favorite list")."</div>");
					$sql2="select title from lightboxes where id=".(int)$_REQUEST["lightbox"];
					$dr->open($sql2);
					if(!$dr->eof)
					{
						echo("<div class='search_current_kw'>");
						echo("<input type='hidden' name='lightbox' value='".(int)$_REQUEST["lightbox"]."'>");
						echo("<input type='button' class='search_current_delete' onClick=\"location.href='".$vars_lightbox."'\">");
						echo($dr->row["title"]);
						echo("</div>");
					}
				}
				//End lightbox menu
				
				
				//Category menu
				if(isset($_REQUEST["id_parent"]) or isset($_REQUEST["acategory"]) or isset($_REQUEST["category"]))
				{
					echo("<div class='search_line2'></div>");
					echo("<div class='search_current_kw_title'>".word_lang("category")."</div>");
					if(isset($_REQUEST["id_parent"]))
					{
						$category_id=(int)$_REQUEST["id_parent"];
						$sql2="select title from category where id_parent=".$category_id;
					}
					if(isset($_REQUEST["acategory"]))
					{
						$category_id=(int)$_REQUEST["acategory"];
						$sql2="select title from category where id_parent=".$category_id;
					}
					if(isset($_REQUEST["category"]))
					{
							if(!preg_match("/^[0-9]+$/",$_REQUEST["category"]))
							{
								$sql2="select title from category where title='".str_replace("-"," ",result3($_REQUEST["category"]))."'";
							}
							else
							{
								$sql2="select title from category where id_parent=".(int)$_REQUEST["category"];
							}
					}
					
					$dr->open($sql2);
					if(!$dr->eof)
					{
						echo("<div class='search_current_kw'>");
						echo("<input type='button' class='search_current_delete' onClick=\"location.href='".$vars_categories."'\">");
						echo($dr->row["title"]);
						echo("</div>");
					}
				}
				//End. Category menu
		?>
	</div>
	
	<div class="search_title"><?=word_lang("keywords")?></div>
	<div class="search_text">
		<div id="search_keywords">
			<input name="search" type="text" class="ibox3" onClick="this.value=''">
			<input type="submit" class="ibox3_submit" value="">
		</div>
	</div>
	<script languages="javascript">
	 	function listing_submit()
	 	{
	 		$('#listing_form').submit();
	 	}
	 	
	 	function show_sub(value,value2)
	 	{
	 		if(document.getElementById(value).style.display=='none')
	 		{
	 			$("#"+value).slideDown("fast");
	 			document.getElementById(value2).className='search_title4';
	 			document.cookie = "z_" + value + "=" + escape (1) + ";path=/";
	 		}
	 		else
	 		{
	 			$("#"+value).slideUp("fast");
	 			document.getElementById(value2).className='search_title3';
	 			document.cookie = "z_" + value + "=" + escape (0) + ";path=/";
	 		}
	 	}
	 	

	</script>
	<div class="search_text">
		<?
		if($site_photo)
		{
			?>
			<div class="search_checkbox"><input type="checkbox" name="sphoto" <?if($mass_types["photo"]==1){echo("checked");}?> onClick="listing_submit()"> <?=word_lang("photo")?></div>
			<?
		}
		if($site_video)
		{
			?>
			<div class="search_checkbox"><input type="checkbox" name="svideo" <?if($mass_types["video"]==1){echo("checked");}?> onClick="listing_submit()"> <?=word_lang("video")?></div>
			<?
		}
		if($site_audio)
		{
			?>
			<div class="search_checkbox"><input type="checkbox" name="saudio" <?if($mass_types["audio"]==1){echo("checked");}?> onClick="listing_submit()"> <?=word_lang("audio")?></div>
			<?
		}
		if($site_vector)
		{
			?>
			<div class="search_checkbox"><input type="checkbox" name="svector" <?if($mass_types["vector"]==1){echo("checked");}?> onClick="listing_submit()"> <?=word_lang("vector")?></div>
			<?
		}
		?>
	</div>

	
	<div class="search_line"></div>
	
	
	<div class="search_title3" id="search_title_advanced" onClick="show_sub('search_advanced_search','search_title_advanced');"><?=word_lang("advanced search")?></div>
	<div id="search_advanced_search" class="search_sub" style="display:none">
	
		<div class="search_title2"><?=word_lang("item id")?>:</div>
		<div class="search_text2">
			<input type="text" name="item_id" style="width:135px" class='ibox2'>
		</div>
	
		<div class="search_title2"><?=word_lang("author")?>:</div>
		<div class="search_text2">
			<input type="text" name="author" style="width:135px" class='ibox2' value='<?if(isset($_REQUEST["author"])){echo(result($_REQUEST["author"]));}?>'>
		</div>
		
		<?
		if($global_settings["adult_content"])
		{
		?>
		<div class="search_title2"><?=word_lang("exclude adult content")?>:</div>
		<div class="search_text2">
			<input type="checkbox" name="adult" class='ibox2' <?if(isset($_REQUEST["adult"])){echo("checked");}?>>
		</div>
		<?
		}
		?>
	</div>
	
	<?
	if($site_photo)
	{
		?>
		<div class="search_line"></div>
		<div  class="search_title3"  id="search_title_photo" onClick="show_sub('search_photo_filters','search_title_photo');"><?=word_lang("photo filters")?></div>
		<div id="search_photo_filters" class="search_sub" style="display:none">
			<div class="search_title2"><?=word_lang("license")?>:</div>
			<div class="search_text2">
				<input type="checkbox" name="creative" <?=$creative?>> <?=word_lang("creative")?><br>
				<input type="checkbox" name="editorial" <?=$editorial?>> <?=word_lang("editorial")?>
			</div>
		
			<div class="search_title2"><?=word_lang("color")?>:</div>
			<div class="search_text2">
				<?
				$default_color="";
				if(isset($_REQUEST["color"]))
				{
					$default_color=result($_REQUEST["color"]);
				}
				echo(color_set($default_color));
				?>
			</div>
		
			<div class="search_title2"><?=word_lang("orientation")?>:</div>
			<div class="search_text2">
				<?
				$default_orientation=-1;
				if(isset($_REQUEST["orientation"]))
				{
					$default_orientation=(int)$_REQUEST["orientation"];
				}
				?>
				<input type="radio" name="orientation" value="-1" <?if($default_orientation==-1){echo("checked");}?>> <?=word_lang("all")?><br>
				<input type="radio" name="orientation" value="0" <?if($default_orientation==0){echo("checked");}?>> <?=word_lang("landscape")?><br>
				<input type="radio" name="orientation" value="1" <?if($default_orientation==1){echo("checked");}?>> <?=word_lang("portrait")?>
			</div>
			</div>
		<?
	}
	?>
	<script src="<?=site_root?>/inc/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
	<?
	if($site_video)
	{
		?>
		<div class="search_line"></div>
		<div  class="search_title3"   id="search_title_video" onClick="show_sub('search_video_filters','search_title_video');"><?=word_lang("video filters")?></div>
		<div id="search_video_filters" class="search_sub" style="display:none">
			<div class="search_title2"><?=word_lang("duration")?>:</div>
			<div class="search_text2">
				<script>
					$(function() {
					$( "#slider-range" ).slider({
					range: true,
					min: 0,
					max: 7200,
					values: [<?=$duration_video1?>,<?=$duration_video2?>],
					slide: function( event, ui ) {
					$( "#duration_video" ).val(ui.values[ 0 ] + " - " + ui.values[ 1 ] );
					}
					});
					$( "#duration_video" ).val($( "#slider-range" ).slider( "values", 0 ) +
					" - " + $( "#slider-range" ).slider( "values", 1 ) );

					});
				</script>
				<div class="box_slider">
					<input type="hidden" id="duration_video" name="duration_video" value="<?=$duration_video1?> - <?=$duration_video2?>">
					<div id="slider-range"></div>
					<div class="box_slider2">0m</div>
					<div class="box_slider3">120m</div>
				</div>
			</div>
		
			<div class="search_title2"><?=word_lang("clip format")?>:</div>
			<div class="search_text2">
				<select name="format" style="width:135px"  class='ibox2'>
					<option value="">...</option>
					<?
					$sql2="select * from video_format";
					$dr->open($sql2);
					while(!$dr->eof)
					{
						$sel="";
						if(isset($_REQUEST["format"]) and $_REQUEST["format"]==$dr->row["name"])
						{
							$sel="selected";
						}
						?>
						<option value="<?=$dr->row["name"]?>" <?=$sel?>><?=$dr->row["name"]?></option>
						<?
						$dr->movenext();
					}
					?>
				</select>
			</div>
						
			<div class="search_title2"><?=word_lang("aspect ratio")?>:</div>
			<div class="search_text2">
				<select name="ratio" style="width:135px"  class='ibox2'>
				<option value="">...</option>
				<?
				$sql2="select * from video_ratio";
				$dr->open($sql2);
				while(!$dr->eof)
				{
					$sel="";
					if(isset($_REQUEST["ratio"]) and $_REQUEST["ratio"]==$dr->row["name"])
					{
						$sel="selected";
					}
					?>
					<option value="<?=$dr->row["name"]?>" <?=$sel?>><?=$dr->row["name"]?></option>
					<?
					$dr->movenext();
				}
				?>
				</select>
			</div>

			<div class="search_title2"><?=word_lang("field rendering")?>:</div>
			<div class="search_text2">
				<select name="rendering" style="width:135px"  class='ibox2'>
				<option value="">...</option>
				<?
				$sql2="select * from video_rendering";
				$dr->open($sql2);
				while(!$dr->eof)
				{
					$sel="";
					if(isset($_REQUEST["rendering"]) and $_REQUEST["rendering"]==$dr->row["name"])
					{
						$sel="selected";
					}
					?>
					<option value="<?=$dr->row["name"]?>" <?=$sel?>><?=$dr->row["name"]?></option>
					<?
					$dr->movenext();
				}
				?>
				</select>
			</div>

			<div class="search_title2"><?=word_lang("frames per second")?>:</div>
			<div class="search_text2">
				<select name="frames" style="width:135px"  class='ibox2'>
				<option value="">...</option>
				<?
				$sql2="select * from video_frames";
				$dr->open($sql2);
				while(!$dr->eof)
				{
					$sel="";
					if(isset($_REQUEST["frames"]) and $_REQUEST["frames"]==$dr->row["name"])
					{
						$sel="selected";
					}
					?>
					<option value="<?=$dr->row["name"]?>" <?=$sel?>><?=$dr->row["name"]?></option>
					<?
					$dr->movenext();
				}
				?>
				</select>
			</div>
			</div>
		<?
	}
	?>
	
	<?
	if($site_audio)
	{
		?>
		<div class="search_line"></div>
		<div  class="search_title3"  id="search_title_audio" onClick="show_sub('search_audio_filters','search_title_audio');"><?=word_lang("audio filters")?></div>
		<div id="search_audio_filters" class="search_sub" style="display:none">
		
			<div class="search_title2"><?=word_lang("duration")?>:</div>
			<div class="search_text2">
				<script>
				$(function() {
				$( "#slider-range2" ).slider({
				range: true,
				min: 0,
				max: 7200,
				values: [<?=$duration_audio1?>,<?=$duration_audio2?>],
				slide: function( event, ui ) {
				$( "#duration_audio" ).val(ui.values[ 0 ] + " - " + ui.values[ 1 ] );
				}
				});
				$( "#duration_audio" ).val($( "#slider-range2" ).slider( "values", 0 ) +
				" - " + $( "#slider-range2" ).slider( "values", 1 ) );
				});
				</script>
				<div class="box_slider">
					<input type="hidden" id="duration_audio" name="duration_audio" value="<?=$duration_audio1?> - <?=$duration_audio2?>">
					<div id="slider-range2"></div>
					<div class="box_slider2">0m</div>
					<div class="box_slider3">120m</div>
				</div>
			</div>
		
		
			<div class="search_title2"><?=word_lang("track format")?>:</div>
			<div class="search_text2">
				<select class='ibox2' name="format2" style="width:135px" onChange="mdefault('format')">
				<option value="">...</option>
				<?
				$sql2="select * from audio_format";
				$dr->open($sql2);
				while(!$dr->eof)
				{
					$sel="";
					if(isset($_REQUEST["format2"]) and $_REQUEST["format2"]==$dr->row["name"])
					{
						$sel="selected";
					}
					?>
					<option value="<?=$dr->row["name"]?>" <?=$sel?>><?=$dr->row["name"]?></option>
					<?
					$dr->movenext();
				}
				?>
				</select>
			</div>

			<div class="search_title2"><?=word_lang("track source")?>:</div>
			<div class="search_text2">
				<select class='ibox2' name="source" style="width:135px" onChange="mdefault('source')">
				<option value="">...</option>
				<?
				$sql2="select * from audio_source";
				$dr->open($sql2);
				while(!$dr->eof)
				{
					$sel="";
					if(isset($_REQUEST["source"]) and $_REQUEST["source"]==$dr->row["name"])
					{
						$sel="selected";
					}
					?>
					<option value="<?=$dr->row["name"]?>" <?=$sel?>><?=$dr->row["name"]?></option>
					<?
					$dr->movenext();
				}
				?>
				</select>
			</div>
			</div>
		<?
	}
	?>
	

	
	<div class="search_line"></div>
	
	<div  class="search_title3" id="search_title_categories"  onClick="show_sub('search_categories','search_title_categories');"><?=word_lang("categories")?></div>
	<div id="search_categories" style="display:none">
		<div class="search_text">
			<?
			echo($categorymenu);
			?>
		</div>
	</div>
	
		<script language="javascript">
		
		function show_sub_default()
		{
		 <?
	 	$mass_sub=array();
	 	$mass_sub2=array();
	 	$mass_sub[]='search_advanced_search';
	 	$mass_sub2[]='search_title_advanced';
	 	
	 	if($site_photo)
	 	{
	 		$mass_sub[]='search_photo_filters';
	 		$mass_sub2[]='search_title_photo';
	 	}
	 	
	 	if($site_video)
	 	{
	 		$mass_sub[]='search_video_filters';
	 		$mass_sub2[]='search_title_video';
	 	}
	 	
		 if($site_audio)
	 	{
	 		$mass_sub[]='search_audio_filters';
	 		$mass_sub2[]='search_title_audio';
	 	}
	 	
	 	$mass_sub[]='search_categories';
	 	$mass_sub2[]='search_title_categories';
	 	
	 	for($i=0;$i<count($mass_sub);$i++)
		{
			if(isset($_COOKIE["z_".$mass_sub[$i]]) and (int)$_COOKIE["z_".$mass_sub[$i]]==1)
			{
				?>
				document.getElementById('<?=$mass_sub[$i]?>').style.display='block';
	 			document.getElementById('<?=$mass_sub2[$i]?>').className='search_title4';
				<?
			}
	 	}
	 	?>
	 	}
	 	show_sub_default()
	 	</script>
	

	<div class="search_line"></div>
	<div class="search_text"><input type="submit" value="<?=word_lang("search")?>" class="isubmit"></div>
	</div>
	<div class="search_left_bottom"></div>
	</form>
<?=$search_middle?>
<div class="search_header_mobile visible-phone"></div>
<div id="search_header">
	<?
	$search_title=word_lang("results");
	if($id_parent!=5)
	{
		$sql2="select title from category where id_parent=".(int)$id_parent;
		$dr->open($sql2);
		if(!$dr->eof)
		{
			$search_title=$dr->row["title"];
		}
	}
	?>
	<h1><?=$search_title?> <span>(<?=$record_count?>)</span></h1>
	<div id="search_header2">
	<div id="search_sort">
		<?
		echo($sortmenu);
		?>
	</div>
	
	<div id="search_contentmenu">
		<?=$contentmenu?>
	</div>

	<div id="search_items"><?=$itemsmenu?></div>
	<?
	if($global_settings["flow"])
	{
	?>
		<div id="search_flow_menu"><input type="checkbox" name="flow" <?if($flow==1){echo("checked");}?> onClick="location.href='<?=build_variables("flow","")?>&flow=<?if($flow==1){echo(0);}else{echo(1);}?>'">&nbsp;<?=word_lang("flow")?></div>
	<?
	}
	?>
	
	<?
	if($global_settings["auto_paging"])
	{
	?>
		<div id="search_autopaging_menu"><input type="checkbox" name="autopaging" <?if($autopaging==1){echo("checked");}?> onClick="location.href='<?=build_variables("autopaging","")?>&autopaging=<?if($autopaging==1){echo(0);}else{echo(1);}?>'">&nbsp;<?=word_lang("auto")?></div>
	<?
	}
	?>
	</div>
	<?
	if($record_count>$kolvo and $autopaging==0)
	{
		?>
		<div id="search_paging"><?=$paging_text?></div>
		<?
	}
	?>
	
</div>
<div class="search_header_mobile visible-phone"></div>

<?
if($flow==1)
{
	?>
	<script src="<?=site_root?>/inc/jquery.masonry.min.js"></script>
	<script>
	$(document).ready(function(){
		$('#flow_body').masonry({
  		itemSelector: '.home_box'
		});
		
		$('.home_preview').each(function(){


     		$(this).animate({opacity:'1.0'},1);
   			$(this).mouseover(function(){
     		$(this).stop().animate({opacity:'0.6'},600);
    		});
    		$(this).mouseout(function(){
    		$(this).stop().animate({opacity:'1.0'},300);
    		});

    		
    		$(".hb_cart").mouseover(function(){
     			$(this).stop().animate({ opacity: 1}, 600);

    		});

    		$(".hb_cart").mouseout(function(){
    			$(this).stop().animate({ opacity: 0.5}, 600);
    		});
 		
    		
    		 $(".hb_lightbox").mouseover(function(){
     			$(this).stop().animate({ opacity: 1}, 600);
    		});

    		$(".hb_lightbox").mouseout(function(){
    			$(this).stop().animate({ opacity: 0.5}, 600);
    		});
    		
    		 $(".hb_free").mouseover(function(){
     			$(this).stop().animate({ opacity: 1}, 600);
    		});

    		$(".hb_free").mouseout(function(){
    			$(this).stop().animate({ opacity: 0.5}, 600);
    		});
        

		});
	});
	</script>
	<?
}


if($autopaging==1)
{
	?>
	<script>
	str=2;
	flag_auto=true;
	res=" ";
	
	function auto_paging(page)
	{

		str=page;
	
    	var req = new JsHttpRequest();
   		 // Code automatically called on load finishing.
    	req.onreadystatechange = function() {
        if (req.readyState == 4) {
 		if(page==1)
 		{
			document.getElementById('flow_body').innerHTML =req.responseText;
			res=req.responseText;
		}
		else
		{
			document.getElementById('flow_body').innerHTML = document.getElementById('flow_body').innerHTML + req.responseText;
			res=req.responseText;
			check_carts('<?=word_lang("in your cart")?>');
		}

		<?
		if($flow==1)
		{
		?>
			$('#flow_body').masonry({
  			itemSelector: '.home_box'
			});
		
			$('#flow_body').masonry('reload') ;
		<?
		}
		?>
		
		
		$('.home_preview').each(function(){


     		$(this).animate({opacity:'1.0'},1);
   			$(this).mouseover(function(){
     		$(this).stop().animate({opacity:'0.6'},600);
    		});
    		$(this).mouseout(function(){
    		$(this).stop().animate({opacity:'1.0'},300);
    		});

    		
    		$(".hb_cart").mouseover(function(){
     			$(this).stop().animate({ opacity: 1}, 600);

    		});

    		$(".hb_cart").mouseout(function(){
    			$(this).stop().animate({ opacity: 0.5}, 600);
    		});
    		
    		$(".hb_cart2").mouseover(function(){
     			$(this).stop().animate({ opacity: 1}, 600);
    		});

    		$(".hb_cart2").mouseout(function(){
    			$(this).stop().animate({ opacity: 0.5}, 600);
    		});
 		
    		
    		 $(".hb_lightbox").mouseover(function(){
     			$(this).stop().animate({ opacity: 1}, 600);
    		});

    		$(".hb_lightbox").mouseout(function(){
    			$(this).stop().animate({ opacity: 0.5}, 600);
    		});
    		
    		 $(".hb_free").mouseover(function(){
     			$(this).stop().animate({ opacity: 1}, 600);
    		});

    		$(".hb_free").mouseout(function(){
    			$(this).stop().animate({ opacity: 0.5}, 600);
    		});
        

		});


        }
    }
    req.open(null, '<?=site_root?>/members/content_list_paging.php', true);
    req.send( {<?=$flow_vars?>,str: str,id_parent:<?=$id_parent?>} );
    str++;

	}
	
	
	$(document).ready(function(){
		$(window).scroll(function(){
			if($(document).height() - $(window).height() - $(window).scrollTop() <150) 
    		{
    			if(flag_auto)
    			{
    				flag_auto=false;
    				if(res!="")
    				{
    					auto_paging(str);
    				}
    			}
    		}
    		else
    		{
    			flag_auto=true;
    		}
		});
	});
	</script>
	<?
}
?>


<div class='item_list_page' id="flow_body">
	<?
		include("content_list_items.php");
					
		//Show result
		echo($search_content);
	?>
</div>

<script>
check_carts('<?=word_lang("in your cart")?>');
</script>


<?
if($record_count>$kolvo and $autopaging==0)
{
?>
<div id="search_footer">
	<div id="search_paging2"><?=$paging_text?></div>
</div>
<?
}
?>


<?=$search_footer?>

