<?php $this->load->view('site/templates/header'); $segmentArr=$this->uri->segment_array();   ?>

<script type="text/javascript" src="js/site/jcarousellite_1.0.1.pack.js"></script>

<script type="text/javascript">
		$(function() {
    		$(".slider_2").jCarouselLite({   
        		btnNext: ".next_2",
        		btnPrev: ".prev_2",
				auto: false,
    			speed: 1000,
        		visible: 2
    		});
		});	

</script>        

                          <?php $c_url=current_url();  
								 if($this->uri->segment(1) != ''){
								$lnk=$this->uri->segment(1);
								}
								if($this->uri->segment(2) != ''){
								$lnk.='/'.$this->uri->segment(2);
								} 
								if($this->uri->segment(3) != ''){
								$lnk.='/'.$this->uri->segment(3);
								} 
								if($this->uri->segment(4) != ''){
								$lnk2=$lnk.'/'.$this->uri->segment(4);
								} else { $lnk2=$lnk; } 
								
								if($this->input->get('item') != ''){
								$s_key='item='.$this->input->get('item');;
								}else { $s_key ='';}
								
								if($this->input->get('gift_cards') == 'on'){
								    $s_gift='&gift_cards='.$gift;
								}else { $s_gift ='';}
								
								if($this->input->get('min_price') != ''){
								$minVal=$this->input->get('min_price');
									 $min_price='&min_price='.$this->input->get('min_price');
								} else { $minVal=''; $min_price=''; }
								
								
								if($this->input->get('max_price') != ''){
								$maxVal=$this->input->get('max_price');
									 $max_price='&max_price='.$this->input->get('max_price');
								} else { $maxVal=''; $max_price=''; }  
		                     
							 
								if($this->input->get('location') != ''){
								    $location='&location='.$this->input->get('location');
									$locVal=$this->input->get('location');
								}else { $location =''; $locVal='';}  
							   
							   
							   if($this->input->get('shipto') != ''){
								    $shipto='&shipto='.$this->input->get('shipto');
									$shipVal=$this->input->get('shipto');
								}else { $shipto =''; $shipVal='';} 
							   
							   if($this->input->get('order') != ''){
							   $order='&order='.$this->input->get('order');
							   $orderVal=$this->input->get('order');
							   } else {$order=''; $orderVal='';}
							   
							  
							   ?> 


      <?php if($product_list->num_rows() > 0) {?>
<section>
    
  		<div id="content">
        	<div class="content_wrap1">
            	<div class="content-wrap-inner1">
                	<div class="row">
                    	<div class="product-search-page" id="primary">
                        	<div id="search-header">
                            	
                                
                                
                                
                                	<ul class="search-restrictions">
                                    <?php /*if($this->uri->segment(3) != ''){ 
												if($this->uri->segment(2) == 'supplies'){
													echo '<h1 class="summary"><li>Craft Supplie</h1>'; } else {
													echo '<h1 class="summary"><li>'.$this->uri->segment(2).'</h1>';
												} 
										  }*/
									if($this->uri->segment(3) != ''){
                                        echo '<h1 class="summary"><li>'.$cat1->cat_name.'</h1>';
									}
									if($this->uri->segment(4) != ''){
                                        echo '<h1 class="summary"><li>'.$cat2->cat_name.'</h1>';
									}
										
										if($searchKey != ''){?>
                                    <h1 class="summary"><li><?php echo $searchKey;?><li></h1>
                                    <?php }?>
                                    	<li> <?php echo $countTitle;?></li>
                                        
                                    </ul>
                                    
                                    
                               
                     <div id="sort_header">
                         <div class="sort-options no-views">
                            <label><?php if($this->lang->line('seller_sortby') != '') { echo stripslashes($this->lang->line('seller_sortby')); } else echo "Sort by"; ?>:</label>
                            <ul id="menu">
                                <li><a href="javascript:void(0);" id="order">
								<?php if($this->input->get('order') == 'date_desc'){ echo 'Most Recent'; $recentAct='active';} 
								else if($this->input->get('order') == 'most_relevant' || $this->input->get('order') == '') { echo 'Relevancy'; $relevanttAct='active';} else echo 'Relevancy'; ?>
                                <img src="images/down_arrow.png"></a>
                                    <ul class="sub-menu">
                                    <span class="cursor"></span>
                                    <li><a href="<?php  echo $c_url.'?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.'&order=date_desc';?>" id="Relevancy" class="<?php echo $recentAct;?>"><?php if($this->lang->line('shopsec_recent') != '') { echo stripslashes($this->lang->line('shopsec_recent')); } else echo "Most Recent"; ?></a></li>
                                    
                                    
                                    <li><a href="<?php  echo $c_url.'?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.'&order=most_relevant';?>" id="Alphabetical" class="<?php echo $relevanttAct;?>"><?php if($this->lang->line('seller_relevancy') != '') { echo stripslashes($this->lang->line('seller_relevancy')); } else echo "Relevancy"; ?></a></li>
                                   <!-- <li><a href="<?php  echo $c_url.'?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.'&order=price_desc';?>" id="Highest">Highest Price</a></li>
                                    <li><a href="<?php  echo $c_url.'?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.'&order=price_asc';?>" id="Lowest">Lowest Price</a></li>-->
                                    </ul>
                                </li>
                             </ul>
                                
                            </div>
                        </div>
                                
   
                            
                                <ul class="shiping-list">
                                <?php if($gift != '') { ?>
                                <li><span><?php if($this->lang->line('prod_accepts') != '') { echo stripslashes($this->lang->line('prod_accepts')); } else echo "Accepts"; ?> <?php echo $this->config->item('email_title'); ?> <?php if($this->lang->line('giftcard_cards') != '') { echo stripslashes($this->lang->line('giftcard_cards')); } else echo "Gift Cards"; ?></span><a href="<?php echo $c_url.'?'.$s_key.$min_price.$max_price.$location.$shipto;?>">x</a></li>
                                <?php }?>
                                
                          			<?php 
										if($minVal != '' || $maxVal != '') {  
									  	if($maxVal == '' && $minVal != '') {  
									  	echo '<li>'
									?>
									<?php if($this->lang->line('prod_atleast') != '') { echo stripslashes($this->lang->line('prod_atleast')); } else echo "At least"; ?>
                                    <?php 
										echo $currencySymbol.$minVal.'<span class="currency-code">'.$currencyType.'</span><a href="'.$c_url.'?'.$s_key.$s_gift.$location.$shipto.$order.'">x</a></li>';
										} else if($minVal == '' && $maxVal != '') {
										echo '<li>'
									?>
                                    <?php if($this->lang->line('prod_atmost') != '') { echo stripslashes($this->lang->line('prod_atmost')); } else echo "At most"; ?>
                                    <?php 
										echo $currencySymbol.$maxVal.'<span class="currency-code">'.$currencyType.'</span><a href="'.$c_url.'?'.$s_key.$s_gift.$location.$shipto.$order.'">x</a></li>';
										} else { 
										 echo '<li> '.$currencySymbol.$minVal.'–'.$currencySymbol.''.$maxVal.'<span class="currency-code">'.$currencyType.'</span></span>
									  	<a href="'.$c_url.'?'.$s_key.$s_gift.$location.$shipto.$order.'">x</a></li>';
										} } ?>
                                
                                   	<?php 
								   		if($locVal != '') { 
                                  		echo '<li>'
									?>	
									<?php if($this->lang->line('prod_itemsin') != '') { echo stripslashes($this->lang->line('prod_itemsin')); } else echo "Items in"; ?>
                                    <?php echo '<span class="currency-code">'.$locVal.'</span>
								  	<a href="'.$c_url.'?'.$s_key.$s_gift.$min_price.$max_price.$shipto.$order.'">x</a></li>';
                                	} ?>
                                	<?php 
										if($shipVal != '') { 
										foreach($countryList as $c_list){  
										if($c_list->id == $shipVal){
									  	echo '<li>'
									?>	
                                    <?php if($this->lang->line('prod_shipsto') != '') { echo stripslashes($this->lang->line('prod_shipsto')); } else echo "Ships to"; ?>
                                    <?php '<span class="currency-code">'.$c_list->name.'</span>
									  <a href="'.$c_url.'?'.$s_key.$s_gift.$min_price.$max_price.$location.$order.'">x</a></li>';
									}
								}
                                }?>
                                   
                                </ul>
                            
                                
                            </div>
                            <ul class="product_listing" id="search_results">
                        
                        	<?php    $productsDetail=$product_list->result_array();
				
				if(!empty($productsDetail)){ $i=0;
				foreach($productsDetail as $proddetails){
                  	$imgSplit = explode(",",$proddetails['image']); 
					
			?>
            	<li>     
                    <div class="product_img">
                                <div class="product_hide">                                    
                                    <div class="product_fav">                             
										<?php if($loginCheck !=''){
                                        $favArr = $this->product_model->getUserFavoriteProductDetails(stripslashes($proddetails['id']));
                                        #print_r($favArr); die;
                                        if(empty($favArr)){ ?>
                                        <a href="javascript:void(0);" onclick="return changeProductToFavourite('<?php echo stripslashes($proddetails['id']); ?>','Fresh');">
                                            <input type="submit" value="" class="hoverfav_icon" />
                                        </a>
                                        <?php  } else { ?>                        
                                        <a href="javascript:void(0);" onclick="return changeProductToFavourite('<?php echo stripslashes($proddetails['id']); ?>','Old');">
                                            <input type="submit" value="" class="hoverfav_icon1" />
                                        </a>
                                        <?php }} else { ?>
                                        <a href="login" >
                                            <input type="submit" value="" class="hoverfav_icon" />
                                        </a>
                                        <?php  } ?> 
                                    </div>  
                                     
                                    <div class="hoverdrop_icon">
                                    	<a href="javascript:hoverView('<?php echo $i; ?>');">  </a>
                                        	<div class="hover_lists" id="hoverlist<?php echo $i; ?>">
                                               	<h2><?php if($this->lang->line('user_your_lists') != '') { echo stripslashes($this->lang->line('user_your_lists')); } else echo "Your Lists"; ?></h2>
                                                <div class="lists_check">
                                                	<?php foreach($userLists as $Lists){ 
													$haveListIn = $this->user_model->check_list_products(stripslashes($proddetails['id']),$Lists['id'])->num_rows();
													#echo $haveListIn;
													if($haveListIn>0){$chk='checked="checked"';}else{ $chk='';}
													?>
                                                    <input type="checkbox" class="check_box" onclick="return addproducttoList('<?php echo $Lists['id']; ?>','<?php echo stripslashes($proddetails['id']); ?>');" <?php echo $chk; ?> />
                                                    <label><?php echo $Lists['name']; ?></label>
                                                    <?php } ?>
                                                     <?php if(!empty($userRegistry)){ 
														$haveRegisryIn = $this->user_model->check_registry_products($proddetails['id'],$userRegistry->user_id)->num_rows();
														if($haveRegisryIn>0){$chk='checked="checked"';}else{ $chk='';}
													?>
													<input type="checkbox" class="check_box" onclick="return manageRegisrtyProduct('<?php echo $userRegistry->user_id; ?>','<?php echo $proddetails['id']; ?>');" <?php echo $chk; ?> />
													<label><span class="registry_icon"></span><?php if($this->lang->line('prod_wedding') != '') { echo stripslashes($this->lang->line('prod_wedding')); } else echo "Wedding Registry"; ?></label>
													<?php }  ?>
                                                    </div>                                                    
                                                    <div class="new_list">
                                                    <form method="post" action="site/user/add_list">
                                                        <input type="hidden" value="1" name="ddl" />
                                                        <input type="hidden" value="<?php echo $proddetails['id']; ?>" name="productId" />
                                                        <input type="text" placeholder="<?php if($this->lang->line('user_new_list') != '') { echo stripslashes($this->lang->line('user_new_list')); } else echo "New list"; ?>" class="list_scroll" name="list" id="creat_list_<?php echo $i; ?>" />
                                                        <input type="submit" value="<?php if($this->lang->line('user_add') != '') { echo stripslashes($this->lang->line('user_add')); } else echo "Add"; ?>" class="primary-button" onclick="return validate_create_list('<?php echo $i; ?>');" />
                                                    </form>
                                                </div>
                                        	</div>
                                    	
                                   	</div>  
                               </div>
                      
                        <a href="products/<?php echo $proddetails['seourl']?>">
                            <img  src="<?php if(!empty($imgSplit[0])){ ?>images/product/thumb/<?php echo stripslashes($imgSplit[0]); } else { echo "images/dummyProductImage.jpg";  }?>" 
                              alt="<?php echo stripslashes($proddetails['product_name']);?>" title="<?php echo stripslashes($proddetails['product_name']);?>" width="350px" height="400px" />
                        </a>
                    </div>
                                
                    <div class="product_title"><a href="products/<?php echo $proddetails['seourl']?>"><?php echo $proddetails['product_name']?></a></div>
                    <div class="product_maker"><a href="shop-section/<?php echo $proddetails['shop_seourl']; ?>"><?php echo $proddetails['shop_name']?></a></div>
                    <div class="product_price">
						<?php if($proddetails['price'] != 0.00) {?>
                        <span class="currency_value"><?php echo $currencySymbol; echo number_format($currencyValue*$proddetails['price'],2)?></span>
                        <span class="currency_code"><?php echo $currencyType;?></span>
                        <?php } else { ?> 
                        <span class="currency_value"><?php echo $currencySymbol; echo number_format($currencyValue*$proddetails['pricing'],2); echo '+';?></span>
                        <span class="currency_code"><?php echo $currencyType;?></span>
                        <?php }?>
                    </div>
                            
                </li> 
			<?php  
				
				$i++;	} 	}  else { echo '<h2>' ?><?php if($this->lang->line('prod_search') != '') { echo stripslashes($this->lang->line('prod_search')); } else echo "No Products Found In Your Search"; ?>.<?php '</h2>'; }
			?>
                        
                        </ul>
                        
                        </div>
                        <div id="secondary" class="standardized_filters">
                        	<div id="search-filters" class="secondary-liner">
                            	<ul class="filter marketplaces">
                                	<li class="input-group <?php if(in_array('all',$segmentArr)) { echo 'selected';}?>">
                                    <a href="<?php if(in_array('all',$segmentArr)) { echo 'javascript: void(0);';} else {?>search/all<?php echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order;  }?>"><?php if($this->lang->line('shop_allitems') != '') { echo stripslashes($this->lang->line('shop_allitems')); } else echo "All Items"; ?></a></li>
                                    <li class="input-group <?php if(in_array('handmade',$segmentArr)) { echo 'selected';}?>">
                                    <a href="<?php if(in_array('handmade',$segmentArr)) { echo 'javascript: void(0);';} else {?>search/handmade<?php echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order; }?>"><?php if($this->lang->line('shop_handmad') != '') { echo stripslashes($this->lang->line('shop_handmad')); } else echo "Handmade"; ?></a></li>
                                    <li class="input-group <?php if(in_array('vintage',$segmentArr)) { echo 'selected';}?>">
                                    <a href="<?php if(in_array('vintage',$segmentArr)) { echo 'javascript: void(0);';} else {?>search/vintage<?php echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order; }?>"><?php if($this->lang->line('shop_vint') != '') { echo stripslashes($this->lang->line('shop_vint')); } else echo "Vintage"; ?></a></li>
                                    <li class="input-group <?php if(in_array('supplies',$segmentArr)) { echo 'selected';}?>">
                                    <a href="<?php if(in_array('supplies',$segmentArr)) { echo 'javascript: void(0);';} else {?>search/supplies<?php echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order; }?>"><?php if($this->lang->line('shop_supplies') != '') { echo stripslashes($this->lang->line('shop_supplies')); } else echo "Craft Supplies"; ?></a></li>
                                </ul>
                                <ul class="filter categories">
                                
                                <?php if($cats1 == 'No') {
								  foreach ($this->data['mainCategories']->result() as $row){
							if ($row->cat_name != ''){ $commentData = $this->category_model->get_all_counts($row->id,''); if($commentData[0]['disp']>0){
                      	?>
                        <li <?php $selStatus1=explode('-',$this->uri->segment(count($segmentArr))); if($row->id == $selStatus1[0]) { echo 'class="selected"';} ?>>
                        <a href="<?php if($row->id == $selStatus1[0]){ echo 'javascript:void(0);';} else { echo $lnk.'/'; echo $row->id;?>-<?php echo $row->seourl;?><?php echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order; }?>"><?php echo $row->cat_name;?></a>
                      </li>
                      <?php 
                      	}}
                      } }  else if($cats2 == 'No') {  ?>
                      
                    <li><a href="<?php echo $this->uri->segment(1).'/'.$this->uri->segment(2).'/';  echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order;?>"><?php if($this->lang->line('prod_allcate') != '') { echo stripslashes($this->lang->line('prod_allcate')); } else echo 'All Categories'; ?></a></li>        
                    <li class="<?php if($cat1->id.'-'.$cat1->seourl == $this->uri->segment(count($segmentArr))) { echo 'selected';} ?>">
                    <a href="<?php if($cat1->id.'-'.$cat1->seourl == $this->uri->segment(count($segmentArr))) { echo 'javascript:void(0);';} else {?>search/<?php echo $this->uri->segment(2).'/'; echo $cat1->id.'-'.$cat1->seourl; echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order; }?>"><?php echo $cat1->cat_name;?></a> </li>
                          
                      <ul style="padding: 1px 0 0 10px !important" class="filter categories">    
       
                                <?php 
								  foreach ($cats1->result() as $row){
							if ($row->cat_name != ''){ $commentData = $this->category_model->get_all_counts($row->id,''); if($commentData[0]['disp']>0){
                      	?>
                        <li <?php $selStatus=explode('-',$this->uri->segment(3)); if($row->id == $selStatus[0]) { echo 'class="selected"';} ?>>
                        <a href="<?php if($row->id == $selStatus[0]){ echo 'javascript:void(0);'; } else { echo $lnk.'/'; echo $row->id;?>-<?php echo $row->seourl;?><?php echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order; }?>"><?php echo $row->cat_name;?></a>
                      </li>
                      <?php 
                      	} }
                      } }  else {  ?>
                              
                    <li><a href="<?php echo $this->uri->segment(1).'/'.$this->uri->segment(2).'/';  echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order;?>"><?php if($this->lang->line('prod_allcate') != '') { echo stripslashes($this->lang->line('prod_allcate')); } else echo 'All Categories'; ?></a> </li>        
                     <li class="<?php if($cat1->id.'-'.$cat1->seourl == $this->uri->segment(count($segmentArr))) { echo 'selected';} ?>">
                     <a href="<?php if($cat1->id.'-'.$cat1->seourl == $this->uri->segment(count($segmentArr))) { echo 'javascript:void(0);';} else {?>search/<?php echo $this->uri->segment(2).'/'; echo $cat1->id.'-'.$cat1->seourl; echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order; }?>"><?php echo $cat1->cat_name;?></a> </li>
                     
               <li class="<?php if($cat2->id.'-'.$cat2->seourl == $this->uri->segment(count($segmentArr))) { echo 'selected';} ?>" style="padding: 1px 0 0 12px !important"> 
               <a href="<?php if($cat2->id.'-'.$cat2->seourl == $this->uri->segment(count($segmentArr))) { echo 'javascript:void(0);';} else { echo $lnk.'/'; echo $cat2->id.'-'.$cat2->seourl; echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order;}?>"><?php echo $cat2->cat_name;?></a></li>
                          
                      <ul style="padding: 1px 0 0 22px !important" class="filter categories">    
                                
                                <?php 
								  foreach ($cats2->result() as $row){
							if ($row->cat_name != ''){ $commentData = $this->category_model->get_all_counts($row->id,''); if($commentData[0]['disp']>0){
                      	?>
                        <li <?php $selStatus=explode('-',$this->uri->segment(count($segmentArr))); if($row->id == $selStatus[0]) { echo 'class="selected"';} ?>>
                        <a href="<?php  if($row->id == $selStatus[0]){ echo 'javascript:void(0);';} else {  echo $lnk.'/';if($this->uri->segment(4) != ''){ echo $this->uri->segment(4).'/';} echo $row->id;?>-<?php echo $row->seourl;?><?php echo '?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order;}?>"><?php echo $row->cat_name;?></a>
                      </li>
                      <?php 
                      	}}
                      } }?>
                                	<!--<li class="heading"><span><a href="search/handmade" id="handmade">HANDMADE</a></span></li>
                                    <li><a href="#">Housewares</a></li>
                                    <li class="heading"><span><a href="search/vintage">VINTAGE</a></span></li>
                                    <li><a href="#">Housewares</a></li>
                                     <li><a href="#">Pattern</a></li>-->
                                </ul>
                                </ul>   
                                </ul>
                                <ul class="filter show-only">
                                	<li class="heading"><span><?php if($this->lang->line('prod_showonly') != '') { echo stripslashes($this->lang->line('prod_showonly')); } else echo 'Show Only'; ?></span></li>
                                    <form method="get" action="<?php echo current_url(); ?>"><li>
                                    <label><input type="checkbox" name="gift_cards"  class="checkbox" <?php if($this->input->get('gift_cards') == 'on') { echo 'checked="checked"';}?> onclick="this.form.submit()"> <?php if($searchKey != ''){ ?>
                                    <input type="hidden" name="item" value="<?php echo $searchKey;?>" /> <?php  }?>
                                    <span><?php if($this->lang->line('prod_accepts') != '') { echo stripslashes($this->lang->line('prod_accepts')); } else echo "Accepts"; ?> <?php echo $this->config->item('email_title'); ?> <?php if($this->lang->line('giftcard_cards') != '') { echo stripslashes($this->lang->line('giftcard_cards')); } else echo "Gift Cards"; ?></span></label></li>
                                    
                                  <?php  if($this->input->get('min_price') != ''){ ?>
                                    <input  type="hidden" id="min" value="<?php echo $minVal;?>" name="min_price" class="text">
                                    <?php }?>
                                     <?php  if($this->input->get('max_price') != ''){ ?>
                                    <input type="hidden" id="max" value="<?php echo $maxVal;?>" name="max_price" class="text">
                                    <?php }?>
                                     <?php if($this->input->get('location') != ''){ ?>
                                    <input type="hidden" name="location" value="<?php echo $locVal;?>" /> <?php  }?>
                                    <?php if($this->input->get('shipto') != ''){ ?>
                                    <input type="hidden" name="shipto" value="<?php echo $shipVal;?>" /> <?php  }?>
                                    
                                    <?php if($this->input->get('order') != ''){ ?>
                                    <input type="hidden" name="order" value="<?php echo $orderVal;?>" /> <?php  }?>
                                    
                                    </form>
                                     <!--<li><label><input type="checkbox" name="gift_cards" class="checkbox">
                                    <span>Customizable</span></label></li>-->
                                </ul>
                               <!--<div class="color-section">
                                	<div id="search_colors">
                                    	<div class="color_wrapper">
                                        	<a href="#"><div class="search_swatch red nonactive_color" style="opacity: 1;"></div></a>
                                        </div>
                                        <div class="color_wrapper">
                                        	<a href="#" title="Orange"><div class="search_swatch orange nonactive_color" style="opacity: 1;"></div></a>
                                        </div>
                                        <div class="color_wrapper"><a href="#" title="Yellow"><div class="search_swatch yellow nonactive_color" style="opacity: 1;"></div></a></div>
                                        <div class="color_wrapper"><a href="#" title="Green"><div class="search_swatch green nonactive_color" style="opacity: 1;"></div></a></div>
                                        <div class="color_wrapper"><a href="#" title="Blue"><div class="search_swatch blue nonactive_color" style="opacity: 1;"></div></a></div>
                                        <div class="color_wrapper"><a href="#" title="Purple"><div class="search_swatch purple nonactive_color" style="opacity: 1;"></div></a></div>
                                        <div class="color_wrapper"><a href="#" title="Black"><div class="search_swatch black nonactive_color" style="opacity: 1;"></div></a></div>
                                        <div class="color_wrapper"><a href="#" title="White"><div class="search_swatch white nonactive_color" style="opacity: 1;"></div></a></div>
                                    </div>
                                </div>-->
                                    <ul id="facet-price" class="filter first">
                                	<ul class="price-input">
                                    <form method="get" action="<?php echo current_url(); ?>">
                                    	<li class="changeable selected">
                                        <li>
                                        	<span class="label-text" id="price-editor">
                                            	<label for="_nothing">
                                                	<span class="price-input">
                                                    	<span><?php echo $currencySymbol;?></span>
                                                        <input placeholder="<?php if($this->lang->line('prod_min') != '') { echo stripslashes($this->lang->line('prod_min')); } else echo 'MIN'; ?>" type="text" id="min" value="<?php echo $minVal;?>" name="min_price" class="text">
                                                    </span>
                                                    <span> <?php if($this->lang->line('user_to') != '') { echo stripslashes($this->lang->line('user_to')); } else echo 'to'; ?> </span>
                                                    <span class="price-input">
                                                    	<span><?php echo $currencySymbol;?></span>
                                                        <input placeholder="<?php if($this->lang->line('prod_max') != '') { echo stripslashes($this->lang->line('prod_max')); } else echo 'MAX'; ?>" type="text" id="max" value="<?php echo $maxVal;?>" name="max_price" class="text">                                                        
                                                    </span>
                                                    <span class="button-small button-small-grey"><span><input style="width:30px;" type="submit" title="OK" value="►" id="priceRangeButton"></span></span>
                                                </label>
                                            </span>
                                            
                                            
                                            
                                            
                                        </li>
                                        <?php if($minVal != '' || $maxVal != ''){?>
                                  <li style="float:left" class="changeable" ><a href="<?php echo $c_url.'?'.$s_key.$location.$shipto;?>"><?php if($this->lang->line('prod_viewall') != '') { echo stripslashes($this->lang->line('prod_viewall')); } else echo 'View All Prices'; ?></a></li>
                                       <?php }?>
                                         <?php if($searchKey != ''){ ?>
                                    <input type="hidden" name="item" value="<?php echo $searchKey;?>" /> <?php  }?>
                                        <?php if($gift != ''){ ?>
                                    <input type="hidden" name="gift_cards" value="<?php echo $gift;?>" /> <?php  }?>
                                    <?php if($locVal != ''){ ?>
                                    <input type="hidden" name="location" value="<?php echo $locVal;?>" /> <?php  }?>
                                    <?php if($shipVal != ''){ ?>
                                    <input type="hidden" name="shipto" value="<?php echo $shipVal;?>" /> <?php  }?>
                                     <?php if($this->input->get('order') != ''){ ?>
                                    <input type="hidden" name="order" value="<?php echo $orderVal;?>" /> <?php  }?>
                                    
                                        </form>
                                    </ul>
                                </ul>
                               <ul class="filter shop-in">
                                	<li class="input-group <?php if($this->input->get('location') == '') { echo 'selected';}?>" id="locationbox"><a href="<?php echo $lnk2.'?'.$s_key.$s_gift.$min_price.$max_price;?>"><?php if($this->lang->line('prod_anyshop') != '') { echo stripslashes($this->lang->line('prod_anyshop')); } else echo 'Any Shop Location'; ?></a></li>
                                <?php if($locVal == '') {?>    <li class="changeable" id="shop-location-display">
                                    	<a href="<?php echo $lnk2.'?'.$s_key.$s_gift.$min_price.$max_price.$shipto;?>"><?php if($this->lang->line('prod_anyloc') != '') { echo stripslashes($this->lang->line('prod_anyloc')); } else echo 'Any Location'; ?></a> 
                                         <a href="javascript:void(0);" id="change_location" class="change-link"><?php if($this->lang->line('prod_change') != '') { echo stripslashes($this->lang->line('prod_change')); } else echo 'Change'; ?></a>
                                         <?php } else {?>
                                       <form action="<?php echo current_url();?>" method="get">
                                        <input style="width:155px" type="text" id="" value="<?php echo $locVal;?>" name="location" class="location-change">
                                        <span class="button-small button-small-grey">
                                        <span><input style="width:30px;padding: 7px 0;margin: 0;" type="submit" title="OK" value="►" id="locchangeButton">
                                        </span></span>
                                        <?php if($searchKey != ''){ ?>
                                    <input type="hidden" name="item" value="<?php echo $searchKey;?>" /> <?php  }?>
                                        <?php if($this->input->get('gift_cards') == 'on'){ ?> 
                                    <input type="hidden" name="gift_cards" value="<?php echo $gift;?>" /> <?php  }?>
                                     <?php if($minVal != ''){ ?> 
                                    <input type="hidden" name="min_price" value="<?php echo $minVal;?>" /> <?php  }?>
                                         <?php if($maxVal != ''){ ?>
                                    <input type="hidden" name="max_price" value="<?php echo $maxVal;?>" /> <?php  }?>
                                    <?php if($this->input->get('shipto') != ''){ ?>
                                    <input type="hidden" name="shipto" value="<?php echo $shipVal;?>" /> <?php  }?>
                                     <?php if($this->input->get('order') != ''){ ?>
                                    <input type="hidden" name="order" value="<?php echo $orderVal;?>" /> <?php  }?>
                                       </form>
                                    </li>   
                                  <?php }?>
                                </ul> 
                               <ul class="filter shop-in">
                               <li class="input-group <?php if($this->input->get('shipto') == '') { echo 'selected';}?>" id="shiptobox"><a href="<?php echo $lnk2.'?'.$s_key.$s_gift.$min_price.$max_price.$location;?>"><?php if($this->lang->line('prod_anywhere') != '') { echo stripslashes($this->lang->line('prod_anywhere')); } else echo 'Ships Anywhere'; ?></a></li>
                                <?php if($shipVal == '') {?>  
                                  <li class="changeable" id="ship-to-change">
                                    	<a href="<?php echo $lnk2.'?'.$s_key.$s_gift.$min_price.$max_price.$location;?>"><?php if($this->lang->line('prod_anywere') != '') { echo stripslashes($this->lang->line('prod_anywere')); } else echo 'Anywhere'; ?></a> 
                                         <a href="javascript:void(0);" id="change_shipto" class="change-link"><?php if($this->lang->line('prod_change') != '') { echo stripslashes($this->lang->line('prod_change')); } else echo 'Change'; ?></a>
                                         <?php } else {?>
                                       <form action="<?php echo current_url();?>" method="get"> 
                                       <div class="shiping-region">
                                      <select  name="shipto" onchange="this.form.submit()" id="shipto">
                                       <option value=""><?php if($this->lang->line('prod_choose') != '') { echo stripslashes($this->lang->line('prod_choose')); } else echo 'Choose country'; ?>...  </option>
                                       <optgroup label="————————">
                                       <?php foreach($countryList as $c_list) { ?>
										   
										    <option value="<?php echo $c_list->id;?>" <?php if($this->input->get('shipto') == $c_list->id){echo 'selected="selected"';}?>><?php echo $c_list->name; ?></option>
                                            <?php }?>
                                          </optgroup>
                                       </select>
                                           </div>
                                        <?php if($searchKey != ''){ ?>
                                    <input type="hidden" name="item" value="<?php echo $searchKey;?>" /> <?php  }?>
                                        <?php if($this->input->get('gift_cards') == 'on'){ ?> 
                                    <input type="hidden" name="gift_cards" value="<?php echo $gift;?>" /> <?php  }?>
                                     <?php if($minVal != ''){ ?> 
                                    <input type="hidden" name="min_price" value="<?php echo $minVal;?>" /> <?php  }?>
                                         <?php if($maxVal != ''){ ?>
                                    <input type="hidden" name="max_price" value="<?php echo $maxVal;?>" /> <?php  }?>
                                    <?php if($locVal != ''){ ?>
                                    <input type="hidden" name="location" value="<?php echo $locVal;?>" /> <?php  }?>
                                        <?php if($this->input->get('order') != ''){ ?>
                                    <input type="hidden" name="order" value="<?php echo $orderVal;?>" /> <?php  }?>
                                       
                                       </form>
                                    </li>   
                                	<?php }?>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    
    
    </section>
<?php } else { ?>
                <section style="background:#fff; border-bottom:1px solid #ccc;">
                       <div class="main">
                        <div style="margin:20px 0" class="search-error">
                        <h3 class="crumbs"> <?php if($this->lang->line('prod_crumbs') != '') { echo stripslashes($this->lang->line('prod_crumbs')); } else echo 'Oh crumbs'; ?>! </h3>
                        <p class="newline">
                        <?php if($this->lang->line('prod_results') != '') { echo stripslashes($this->lang->line('prod_results')); } else echo "We couldn't find any results for"; ?>
                        <span style="font-weight:bold"><?php echo $searchKey;?></span>
                        </p>
                            
                           </div> 
                           <?php if($this->input->get('gift_cards') == 'on' || $minVal != '' || $maxVal != '' || $locVal != '' || $shipVal != '') {?>
                           <div style="margin:20px 0" class="search-error">
                            <h3 class="crumbs"> <?php if($this->lang->line('prod_remove') != '') { echo stripslashes($this->lang->line('prod_remove')); } else echo "TRY REMOVING SOME FILTERS"; ?>! </h3>
                            <ul class="relatedlist">     
                                <?php if($this->input->get('gift_cards') == 'on') { ?>
                                <li><span><?php if($this->lang->line('prod_accepts') != '') { echo stripslashes($this->lang->line('prod_accepts')); } else echo "Accepts"; ?> <?php echo $this->config->item('email_title'); ?> <?php if($this->lang->line('giftcard_cards') != '') { echo stripslashes($this->lang->line('giftcard_cards')); } else echo "Gift Cards"; ?></span><a href="<?php echo $c_url.'?'.$s_key.$min_price.$max_price.$location.$shipto;?>">x</a></li>
                                <?php }?>
                                
                               <?php if($minVal != '' || $maxVal != '')   {  
									 if($maxVal == '' && $minVal != ''){ 
									 
								      echo '<li>'?>
                               <?php if($this->lang->line('prod_atleast') != '') { echo stripslashes($this->lang->line('prod_atleast')); } else echo "At least"; ?> 
                               <?php echo $currencySymbol.$minVal.'<span class="currency-code"> '.$currencyType.'</span></span>
									  <a href="'.$c_url.'?'.$s_key.$s_gift.$location.$shipto.$order.'">x</a></li>';
									  }  else if($minVal == '' && $maxVal != ''){
									  
									   echo '<li>' ?> 
                               <?php if($this->lang->line('prod_atmost') != '') { echo stripslashes($this->lang->line('prod_atmost')); } else echo "At most"; ?> 
                               <?php echo $currencySymbol.$maxVal.'<span class="currency-code"> '.$currencyType.'</span></span>
									  <a href="'.$c_url.'?'.$s_key.$s_gift.$location.$shipto.$order.'">x</a></li>';
								     } else {
								  
									  echo '<li> '.$currencySymbol.$minVal.'–'.$currencySymbol.''.$maxVal.'<span class="currency-code">'.$currencyType.'</span></span>
									  <a href="'.$c_url.'?'.$s_key.$s_gift.$location.$shipto.$order.'">x</a></li>';
                                }  }?>
                                
                                 <?php if($locVal != '') { 
                                  echo '<li>' ?>
                                  <?php if($this->lang->line('prod_itemsin') != '') { echo stripslashes($this->lang->line('prod_itemsin')); } else echo "Items in"; ?> 
                                  <?php '<span class="currency-code">'.$locVal.'</span>
								  <a href="'.$c_url.'?'.$s_key.$s_gift.$min_price.$max_price.$shipto.$order.'">x</a></li>';
                                }?>
                                <?php if($shipVal != '') { 
									foreach($countryList as $c_list){  
										if($c_list->id == $shipVal){
										  echo '<li>' ?>
                                			<?php if($this->lang->line('prod_shipsto') != '') { echo stripslashes($this->lang->line('prod_shipsto')); } else echo "Ships to"; ?> 
                                			<?php '<span class="currency-code">'.$c_list->name.'</span>
										  <a href="'.$c_url.'?'.$s_key.$s_gift.$min_price.$max_price.$location.$order.'">x</a></li>';
										}
									}
                                }?>
                             </ul>
                             </div>
                             <?php }?>
                       </div> 
                </section>

<?php }?>

<script>
$(document).ready(function(e) {
    $('#change_location').click(function(){
	$('#shop-location-display').html('<form action="<?php echo current_url();?>" method="get"> <input style="width:155px" type="text" id="" value="<?php echo $locVal;?>" name="location" class="location-change"><span class="button-small button-small-grey"><span><input style="width:30px;padding: 7px 0;margin: 0;" type="submit" title="OK" value="►" id="locchangeButton"></span></span><?php if($searchKey != ''){ ?><input type="hidden" name="item" value="<?php echo $searchKey;?>" /> <?php  }?><?php if($gift != ''){ ?> <input type="hidden" name="gift_cards" value="<?php echo $gift;?>" /> <?php  }?><?php if($minVal != ''){ ?><input type="hidden" name="min_price" value="<?php echo $minVal;?>" /> <?php  }?>
<?php if($maxVal != ''){ ?><input type="hidden" name="max_price" value="<?php echo $maxVal;?>" /><?php  }?><?php if($shipVal != ''){ ?><input type="hidden" name="shipto" value="<?php echo $shipVal;?>" /><?php  }?></form>');
	});
});



$(document).ready(function(e) {
    $('#change_shipto').click(function(){
	$('#ship-to-change').html('<form action="<?php echo current_url();?>" method="get"><div class="shiping-region"><select name="shipto" onchange="this.form.submit()" id="shipto"><option value="">Choose country...</option><optgroup label="————————"><?php foreach($countryList as $c_list){?><option value="<?php echo $c_list->id;?>"><?php echo $c_list->name;?></option><?php }?></optgroup></select></div><?php if($searchKey != ''){ ?><input type="hidden" name="item" value="<?php echo $searchKey;?>" /><?php }?><?php if($gift != ''){ ?><input type="hidden" name="gift_cards" value="<?php echo $gift;?>" /><?php }?><?php if($minVal != ''){ ?><input type="hidden" name="min_price" value="<?php echo $minVal;?>" /><?php  }?><?php if($maxVal != ''){ ?><input type="hidden" name="max_price" value="<?php echo $maxVal;?>" /><?php  }?><?php if($locVal != ''){ ?><input type="hidden" name="location" value="<?php echo $locVal;?>" /><?php  }?></form>');
	});
});
</script>
<script src="js/site/scrolling_javascript.js"> </script>
<script>
$(document).ready(function() {
	$('#search_results').scrollPagination({
		nop     : 3, // The number of posts per scroll to be loaded
		offset  : 3, // Initial offset, begins at 0 in this case
		error   : '', // When the user reaches the end this is the message that is
		                            // displayed. You can change this if you want.
		path   : 'site/product/ajax_search_product/<?php echo str_replace(base_url(),'',$c_url).'?'.$s_key.$s_gift.$min_price.$max_price.$location.$shipto.$order; ?>',
		delay   : 500, // When you scroll down the posts will load after a delayed amount of time.
		               // This is mainly for usability concerns. You can alter this as you see fit
		scroll  : true // The main bit, if set to false posts will not load as the user scrolls. 
		               // but will still load if the user clicks.		
	});	
});
</script>
<style>
.loading-bar {
	border: 1px solid #DDDDDD;
    border-radius: 5px;
    box-shadow: 0 -45px 30px -40px rgba(0, 0, 0, 0.05) inset;
    clear: both;
    cursor: pointer;
    display: block;
    float: none;
    font-family: "museo-sans",sans-serif;
    font-size: 2em;
    font-weight: bold;
    margin: 20px 0px 20px 0;
    padding: 10px 0px;
    position: relative;
    text-align: center;
    width: 100%;
}
.loading-bar:hover {
	box-shadow: inset 0px 45px 30px -40px rgba(0, 0, 0, 0.05);
}
</style>    
<?php $this->load->view('site/templates/footer'); ?>