
<script>
    $(document).ready(function () {
//        var fancyBoxFn = function(){
//            var addToAll = false;
//            var gallery = true;
//            var titlePosition = 'inside';
//            $(addToAll ? 'img' : 'img.fancybox').each(function () {
//                var $this = $(this);
//                var title = $this.attr('title');
//                var src = $this.attr('data-big') || $this.attr('src');
//                var a = $('<a href="#" class="fancybox"></a>').attr('href', src).attr('title', title);
//                $this.wrap(a);
//            });
//            if (gallery)
//                $('a.fancybox').attr('rel', 'fancyboxgallery');
//            $('a.fancybox').fancybox({
//                titlePosition: titlePosition,
//                showNavArrows: true
//            });
//        };
//        fancyBoxFn();

    magnificPopupFn();

    });
    
    
    
</script>

    
    
<div class="row">
     <?php
     if (count(PageContext::$response->imageDetails) > 0) { ?>
        <ul id="portfolio" class="clearfix main_gallary">
            <?php foreach (PageContext::$response->imageDetails As $images) {
                
                $srcurl = PageContext::$response->userImagePath . 'medium/member_noimg.jpg';
                if ($images->news_feed_image_name != '') {
                    $srcurl = PageContext::$response->userImagePath . 'medium/' . $images->news_feed_image_name;
                }
                ?>
                <li><a href="<?php echo PageContext::$response->userImagePath.$images->news_feed_image_name;?>" title="<?php echo $images->news_feed_comment;?>"><img src="<?php echo $srcurl;?>" alt="<?php echo $images->news_feed_comment;?>"></a></li>
                <?php
            }
            ?>
        </ul>
        <?php
    }
    else {
        ?>
        <div class="frndslisting_blk_content">
            <span class="margin_l_20">No Images Found</span>
        </div>
        <?php
    }
    ?>    
</div>
    
    







<!--
<div class="row">
--
     <?php
     /*
     if (count(PageContext::$response->imageDetails) > 0) { ?>
      <div class="main_gallary">
        <?php foreach (PageContext::$response->imageDetails As $images) {
            if ($images->news_feed_image_name != '') {?>
                <div class="col-lg-3 col-sm-4">
                      <img src="<?php echo PageContext::$response->userImagePath . $images->news_feed_image_name;?>" class="fancybox thumbnail img-responsive">
                </div>
                                 <?php
        }
        }
        ?>
          </div>
        <?php
    } else {
        ?>
        <div class="frndslisting_blk_content">
            <span class="margin_l_20">No Images Found</span>
        </div>
        <?php
    }
      * 
      */
    ?>
<!--  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 1"><img src="//placehold.it/600x350" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 2"><img src="//placehold.it/600x350/2255EE" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 3"><img src="//placehold.it/600x350/449955/FFF" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 4"><img src="//placehold.it/600x350/992233" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 5"><img src="//placehold.it/600x350/2255EE" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 6"><img src="//placehold.it/600x350/449955/FFF" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 8"><img src="//placehold.it/600x350/777" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 9"><img src="//placehold.it/600x350/992233" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 10"><img src="//placehold.it/600x350/EEE" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 11"><img src="//placehold.it/600x350/449955/FFF" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 12"><img src="//placehold.it/600x350/DDD" class="thumbnail img-responsive"></a></div>
  <div class="col-lg-3 col-sm-4 col-6"><a href="#" title="Image 13"><img src="//placehold.it/600x350/992233" class="thumbnail img-responsive"></a></div>-->
<!--
</div>
-->
<div id="myModal" class="modal fade" tabindex="-1" role="dialog">
  <div class="modal-dialog">
  <div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">×</button>
        <!--<h3 class="modal-title">Heading</h3>-->
    </div>
    <div class="modal-body">
        
    </div>
    <div class="modal-footer">
        <button class="btn btn-default" data-dismiss="modal">Close</button>
    </div>
   </div>
  </div>
</div>

<!--
<div class="row">
    <div class="tab_container">
                <div class="row">
                <div class="col-sm-8 col-md-8 col-lg-8">
                <ul id="myTab" class="nav nav-tabs nav-justified">
                    <li class="jShowProfile active"  alias="{PageContext::$response->alias}" uid="{PageContext::$response->sess_user_id}"><a href="#myprofile" data-toggle="tab">Personal</a>
                    </li>                   
                    <li class="jShowFriends jShowFriends_tab" alias="{PageContext::$response->alias}" uid="{PageContext::$response->sess_user_id}"><a href="#tab-Friends" data-toggle="tab">Business</a>
                    </li>
                </ul>
                </div>
				
                </div>
            </div>
    <div id="msg"></div>

    <div class="clearfix"></div>
    <div>
                        <input type="hidden" class=" " value="{PageContext::$response->invitation_type}" id="contact_type" name="contact_type">
                    </div>
                    <div>
                        <input type="hidden" class=" " value="{PageContext::$response->invitation_typeid}" id="contact_typeid" name="contact_typeid">
                    </div>
    <?php if (count(PageContext::$response->imageDetails) > 0) { ?>
      <br>
      <div class="clearfix"></div>
      <div class="main_gallary">
        <?php foreach (PageContext::$response->imageDetails As $images) {
            //echopre1($images);?>
            <div class="col-sm-4 col-md-4 col-lg-4">
                <div class="mediapost display_table wid100per">
                    <div class="mediapost_left display_table_cell wid30per">
                            <img src="<?php
                                if ($images->news_feed_image_name != '') {
                                    echo PageContext::$response->userImagePath . 'medium/' . $images->news_feed_image_name;
                                } else {
                                    echo PageContext::$response->userImagePath . 'medium/member_noimg.jpg';
                                }
                                    ?>">
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            <?php
        }
        ?>
          </div>
        <?php
    } else {
        ?>
        <div class="frndslisting_blk_content">
            <span class="margin_l_20">No Images Found</span>
        </div>
        <?php
    }
    ?>
</div>
<div class="clear"></div>
<script type ="text/javascript">
    $(document).ready(function() {
   // alert("jdfgj");
        var page = 1;  
//        var searchtext = $("#searchtext").val();
//        var searchtype = $("#searchtype").val();
//        var orderfield = $("#orderfield").val();
//        var orderby = $("#orderby").val();
       	var _throttleTimer = null;
	var _throttleDelay = 100;
            $(window ).scroll(function() {
              //console.log('TotalPage'+TOT_PAGE+'Page'+page);
	    clearTimeout(_throttleTimer);
	    _throttleTimer = setTimeout(function () {
	    if($(window).scrollTop() + $(window).height() > $(document).height()-100) {
	        if(page <= 1){
                   // alert(page);
                    page++;
                    $.blockUI({ message: '' }); 
                  //  var user_id      = $("#user_id").val();
                  //  var business_name    = $("#business_name").val();
                    $.ajax({
                        type    : 'Post',
                        url     : mainUrl+'user/my_gallaryajax/'+page,
                       // data    : 'user_id='+user_id,
                        cache   : false,
                        success :function(data){
                            $('.main_gallary').append(data);
//                            $('.listitem').fadeIn(3000);
//                            $('.listitem').hide();
                        }
                    }) 
    	        }
	    }
	    },_throttleDelay);
	    });
    });
//    $('#starring .rateit').bind('rated', function (e) {
//    alert("hlll");
//        var ri = $(this);
//        var rateField = $(this).attr("id");
//        var status = true;
//        var ratetype = ri.rateit('type');
//        var ratetypeid = ri.rateit('typeid');     
//        var rateflag = ri.rateit('flag');
//        //if the use pressed reset, it will get value: 0 (to be compatible with the HTML range control), we could check if e.type == 'reset', and then set the value to  null .
//        var ratevalue = ri.rateit('value');
//        // alert("hi "+ratevalue);
//        var userid = ri.rateit('id'); // if the product id was in some hidden field: ri.closest('li').find('input[name="productid"]').val()
//        if(rateflag == 1 && userid <= 0){ //alert("2");
//            status = checkLogin2(ratetype,ratetypeid,'rate',rateField);	    	
//        }	 
//        if(status != false){
//            // alert("here");
//            checkRated1(rateField);	    
//        }
//	 
//    });

</script>-->