<commit_before><!DOCTYPE html>
<!--[if IEMobile 7 ]>    <html class="no-js iem7"> <![endif]-->
<!--[if (gt IEMobile 7)|!(IEMobile)]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <title></title>
        <meta name="description" content="">
        <meta name="HandheldFriendly" content="True">
        <meta name="MobileOptimized" content="320">
        <meta name="viewport" content="width-device-width, user-scalable=no">
        <meta http-equiv="cleartype" content="on">

        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/touch/apple-touch-icon-144x144-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/touch/apple-touch-icon-114x114-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/touch/apple-touch-icon-72x72-precomposed.png">
        <link rel="apple-touch-icon-precomposed" href="img/touch/apple-touch-icon-57x57-precomposed.png">
        <link rel="shortcut icon" href="img/touch/apple-touch-icon.png">

        <!-- For iOS web apps. Delete if not needed. https://github.com/h5bp/mobile-boilerplate/issues/94 -->
        <!--
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        -->
        
        <!-- This script prevents links from opening in Mobile Safari. https://gist.github.com/1042026 -->
        <!--
        <script>(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone")</script>
        -->

        <link rel="stylesheet" href="normalize.css">
        <link rel="stylesheet" href="main.css">
                
        <!--<script src="js/vendor/modernizr-2.6.1.min.js"></script>-->
        <script src="js/helper.js"></script>
        
        <script type="text/javascript" src="js/vendor/jquery-1.7.2.min.js"></script>
        
        <!-- Add fancyBox -->
        <link rel="stylesheet" href="js/fancybox/jquery.fancybox.css?v=2.1.1" type="text/css" media="screen" />
        <script type="text/javascript" src="js/fancybox/jquery.fancybox.pack.js?v=2.1.1"></script>
        
        <!-- Helpers - button, thumbnail and/or media -->
        <link rel="stylesheet" href="js/fancybox/helpers/jquery.fancybox-buttons.css?v=1.0.4" type="text/css" media="screen" />
        <script type="text/javascript" src="js/fancybox/helpers/jquery.fancybox-buttons.js?v=1.0.4"></script>
        <script type="text/javascript" src="js/fancybox/helpers/jquery.fancybox-media.js?v=1.0.4"></script>
        
        <link rel="stylesheet" href="js/fancybox/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
        <script type="text/javascript" src="js/fancybox/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
        
		<script>
            // Wait for window load
            $(window).load(function() {
                // Animate loader off screen
                $("#loader").fadeOut("slow");				
            });
        </script>

        <script>
            
            postsArray = [];
            indexes = [];
			
			// Class for template divs
            templateClass = "template";
			// Unique ID for the templates on the page
            unique = 0;
			// Template height
            chunkHeight = 0;
			// Template width
            chunkWidth = 0;
			// Total number of templates to choose from
            numberTemplates = 4;
			
			// Store  images to preload
			toPreLoad = [];
			
			// Run data retrieval and page construction
			parseJson();
			
			offset = 200;
			
			function createAddImage(source, width, height, container, id){
					var linkImg = $('<img/>') // create img
                        .attr({ // set attributes
                            //src: "img/grey.jpg",
							//class: "lazy",
							src: source
                        })
                        .css({
                            width: width,
                            height: height
                        });
                    
                    linkImg.attr("id", id);
                    $(container).html(linkImg); // append to td
				}
            <!-- Parse Json to get all posts and images -->
            function parseJson(){
				// Server IP
                var ipAddress = "172.18.171.148";
                $.get("http://"+ipAddress+":8080/PortFolio/wordpress/?json=get_recent_posts&dev=1&custom_fields=shown", function(json){
                    var deJson = jQuery.parseJSON(json);
                    var posts = deJson.posts;
                    var count = deJson.count;
                    
                    $.each(posts, function( intIndex, post ){
                        var images = post.attachments[0].images;
						var toShow = post.custom_fields.shown;
						if(toShow == "true"){
							var postVal = {
											title       : post.title, 
											fullimg     : images.large.url.replace("localhost", ipAddress),
											smallthumb  : images.smallthumb.url.replace("localhost", ipAddress),
											bigthumb    : images.bigthumb.url.replace("localhost", ipAddress),
											widethumb   : images.widethumb.url.replace("localhost", ipAddress),
											highthumb   : images.highthumb.url.replace("localhost", ipAddress)
										};
							postsArray.push(postVal);
							indexes.push({intIndex : 0});
							toPreLoad.push(postVal.fullimg);
						}
                    });					                   
					
					//$("img.lazy").lazyload({ threshold : 200 });
					
					// Images preloading					
					//pix = new PreLoader();

					// Fill each of the cells in the page grid with a new template
                    $("#thumbs-container td").each(function(index, element) {
                        newTemplate(element.getAttribute("id"));
                    });
					
                    var rows = $(".masterrow");

					// Duplicate the top row(s)
					var numbRowsDup = Math.ceil(($(window).height() + offset) / chunkHeight);
					for(var i = 0; i < numbRowsDup ; i++) {
						var toDup = $(".masterrow").eq(i).clone();
						toDup.insertAfter($(".masterrow:last"));
					}
															
					// Duplicate the left column(s)
                    var rows = $(".masterrow");
                    var cols;

                    rows.each(function() {
                        cols = jQuery(this).children('th, td');
                        cols.eq(0).clone().insertAfter(cols.eq(1));
                    });

					/*// Place b-i logo somewhere random
					var minSmall = 1;
					var maxSmall = $('.tdsmall').length;
					var indexLogo = Math.floor(Math.random() * (maxSmall - minSmall + 1)) + minSmall;
					
					var source = "img/blue.jpg";
					var scale = 0.2;
					if (typeof( window.innerHeight ) == 'number' ) {
                        var vpHeight = window.innerHeight;
                        var vpWidth = window.innerWidth;
                    }
					var imgWidth = vpWidth*scale;  
					var imgHeight = imgWidth;
					
					createAddImage(source, imgWidth, imgHeight, $('.tdsmall').eq(indexLogo), "blue");

					scrollLeft = $(window).scrollLeft();
					scrollTop = $(window).scrollTop();
					docWidth = $(document).width();
					docHeight = $(document).height();
					
					if(scrollLeft > (docWidth - vpWidth) || scrollTop > (docHeight - vpHeight) || scrollLeft == 0 || scrollTop == 0){
						var viewportWidth = jQuery(window).width(),
						viewportHeight = jQuery(window).height(),
						$foo = jQuery('#blue'),
						elWidth = $foo.width(),
						elHeight = $foo.height(),
						elOffset = $foo.offset();
						jQuery(window).scrollLeft(elOffset.left  - (elWidth/2));
						jQuery(window).scrollTop(elOffset.top - elHeight/2);
					}*/
						jQuery(window).scrollLeft(1000);
						jQuery(window).scrollTop(1000);

                });
            }
			
			function PreLoader(){
				this.images=[];  
								
				for(var i=0, len=toPreLoad.length; i<len; i++){
					this.images[i]=new Image();
					this.images[i].src=toPreLoad[i];
				}
			}
            
            <!--Load a random template and fill it with images-->            
            function newTemplate(tdID) {
                unique++;
                var templateID = "template"+unique;
                var min = 1;
                var max = numberTemplates;
                var tID = Math.floor(Math.random() * (max - min + 1)) + min;

                var toLoad = "templates/template"+tID+".html";
                var currentposition = $(window).scrollTop();
                var docHeight = $(document).height();
                $.ajax({
                    url: toLoad,
                    type: "GET",
                    async: false,
					dataType: "text",
                    success: function (response) {
                        if(postsArray.length == 0){
                            alert("No content to display");
                        } else {
                            var newdiv = document.createElement('div');
                            newdiv.className = templateClass;
                            newdiv.setAttribute("id", templateID);
                            newdiv.innerHTML = response;
                            $("#"+tdID).html(newdiv);
                            fillTemplate(templateID);
                        }
                    }
                });
            }
            
            <!--Fill template with images-->
            function fillTemplate(container){
                var count = postsArray.length;
                
                var min = 0;
                var toChoose = [];
                
                for(i = 0; i<count; i++){
                    toChoose.push(i);
                }

                var classT = "#"+container;
                
                $(classT).find("td").each(function(index) { //get all cells in table
                    var source = null;

                    var max = toChoose.length - 1;
                    var index = Math.floor(Math.random() * (max - min + 1)) + min;
                    
                    if(toChoose.length == 0){
                        for(i = 0; i<count; i++){
                            toChoose.push(i);
                        }
                    }
                    var random = toChoose[index];
                    toChoose.splice(index,1);
                       
                    <!--Set image sizes according to viewport-->
                    if (typeof( window.innerHeight ) == 'number' ) {
                        var vpHeight = window.innerHeight;
                        var vpWidth = window.innerWidth;
                    }
                    
                    var scale = 0.20;
                    
                    var imgHeight = 0;
                    var imgWidth = 0;
                    
                    switch($(this).attr('class')) {
                        case 'tdsmall':
                            source = postsArray[random].smallthumb;
                            imgWidth = vpWidth*scale;  
                            imgHeight = imgWidth;
                        break;
                        case 'tdbig':
                            source = postsArray[random].bigthumb;
                            imgWidth = vpWidth*scale*2;  
                            imgHeight = imgWidth;
                        break;
                        case 'tdhigh':
                            source = postsArray[random].highthumb;
                            imgHeight = vpWidth*scale*2;
                            imgWidth = imgHeight /2;  
                        break;
                        case 'tdwide':
                            source = postsArray[random].widethumb;
                            imgWidth = vpWidth*scale*2;  
                            imgHeight = imgWidth /2;
                        break;
                    }
					
					createAddImage(source, Math.ceil(imgWidth), Math.ceil(imgHeight), $(this), "");
					
					
                    <!--Add link to the current image for popup-->
                    $(this).find('img').each( function() {
                        var $img = $(this),
                        href = $img.attr('src');
                        
                        $img.wrap('<a class="fancybox" href="' + postsArray[random].fullimg + '"></a>');
                    });

                });
                
                <!--Save template size for scroll positionning-->
                chunkHeight = $(classT).height();
                chunkWidth = $(classT).width();			
            }
        </script>

        <script type="text/javascript">
            $(document).ready(function() {
                $(".fancybox").fancybox({
					openEffect	: 'elastic',
					closeEffect	: 'elastic',
                    padding : 0,
					helpers:  {
						overlay : {
							showEarly : true,
							speedOut   : 2
						}
					}

                  });
            });
        </script>

        <!--Make the page cyclic. Use a 3x3 grid, and move the scroll indicator around to implement pretend cyclicity-->
        <script type="text/javascript">
            offset = 200;
			//offset = Math.round(Math.min($(window).height(), $(window).width()) / 4);
			//offset = Math.min(offset, Math.min());
			window.onscroll = whenScroll;
			window.addEventListener('touchend', whenScroll, false);
			window.addEventListener('touchstart', whenScroll, false);
			window.addEventListener('touchmove', whenScroll, false);

			function whenScroll() {
                // When scroll to the bottom
                if ($(window).scrollTop() + $(window).height() >= $(document).height() - offset) {
					var whatsLeft = $(document).height() - $(window).scrollTop() - $(window).height();
					var numbChunks = Math.ceil($(window).height() / chunkHeight);
					$(window).scrollTop((numbChunks*(chunkHeight) + 2) - $(window).height() - whatsLeft);
                }
                
                // When scroll to the top
                if ( $(window).scrollTop() <= offset ) {
					var whatsLeft = $(window).scrollTop();
					var numbChunks = Math.ceil($(window).height() / chunkHeight);
					$(window).scrollTop($(document).height() - numbChunks*(chunkHeight) + whatsLeft - 2);
                }

                // When scroll to right
                if ($(window).scrollLeft() + $(window).width() >= $(document).width() - offset) {
					var whatsLeft = $(document).width() - $(window).scrollLeft() - $(window).width();					
					var numbChunks = Math.ceil($(window).width() / chunkWidth);
					//alert("("+numbChunks+"*("+chunkWidth+") + 2) - "+$(window).width()+" - "+whatsLeft);
					$(window).scrollLeft((numbChunks*(chunkWidth) + 2) - ($(window).width() + whatsLeft));
                }

                // When scroll to left
                if ($(window).scrollLeft() <= offset) {
					var whatsLeft = $(window).scrollLeft();
					var numbChunks = Math.ceil($(window).width() / chunkWidth);
					
					$(window).scrollLeft($(document).width() - numbChunks*(chunkWidth) + whatsLeft - 2);
                }
            };
        </script>
    </head>
    
    <body>
        <!-- Add your site or application content here -->
        <div id="thumbs-container">
            <table class="thumbs-table">
                <tr class="masterrow" id="row1">
                    <td class="thumbs-cell" id="td1"></td>
                    <td class="thumbs-cell" id="td2"></td>
                </tr>
                
                <tr class="masterrow" id="row2">
                    <td class="thumbs-cell" id="td3"></td>
                    <td class="thumbs-cell" id="td4"></td>
                </tr>

                <tr class="masterrow" id="row3">
                    <td class="thumbs-cell" id="td5"></td>
                    <td class="thumbs-cell" id="td6"></td>
    			</tr>
            </table>
        </div><commit_msg>Removed alert<commit_after><!DOCTYPE html>
<!--[if IEMobile 7 ]>    <html class="no-js iem7"> <![endif]-->
<!--[if (gt IEMobile 7)|!(IEMobile)]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <title></title>
        <meta name="description" content="">
        <meta name="HandheldFriendly" content="True">
        <meta name="MobileOptimized" content="320">
        <meta name="viewport" content="width-device-width, user-scalable=no">
        <meta http-equiv="cleartype" content="on">

        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/touch/apple-touch-icon-144x144-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/touch/apple-touch-icon-114x114-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/touch/apple-touch-icon-72x72-precomposed.png">
        <link rel="apple-touch-icon-precomposed" href="img/touch/apple-touch-icon-57x57-precomposed.png">
        <link rel="shortcut icon" href="img/touch/apple-touch-icon.png">

        <!-- For iOS web apps. Delete if not needed. https://github.com/h5bp/mobile-boilerplate/issues/94 -->
        <!--
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        -->
        
        <!-- This script prevents links from opening in Mobile Safari. https://gist.github.com/1042026 -->
        <!--
        <script>(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone")</script>
        -->

        <link rel="stylesheet" href="normalize.css">
        <link rel="stylesheet" href="main.css">
                
        <!--<script src="js/vendor/modernizr-2.6.1.min.js"></script>-->
        <script src="js/helper.js"></script>
        
        <script type="text/javascript" src="js/vendor/jquery-1.7.2.min.js"></script>
        
        <!-- Add fancyBox -->
        <link rel="stylesheet" href="js/fancybox/jquery.fancybox.css?v=2.1.1" type="text/css" media="screen" />
        <script type="text/javascript" src="js/fancybox/jquery.fancybox.pack.js?v=2.1.1"></script>
        
        <!-- Helpers - button, thumbnail and/or media -->
        <link rel="stylesheet" href="js/fancybox/helpers/jquery.fancybox-buttons.css?v=1.0.4" type="text/css" media="screen" />
        <script type="text/javascript" src="js/fancybox/helpers/jquery.fancybox-buttons.js?v=1.0.4"></script>
        <script type="text/javascript" src="js/fancybox/helpers/jquery.fancybox-media.js?v=1.0.4"></script>
        
        <link rel="stylesheet" href="js/fancybox/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
        <script type="text/javascript" src="js/fancybox/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
        
		<script>
            // Wait for window load
            $(window).load(function() {
                // Animate loader off screen
                $("#loader").fadeOut("slow");				
            });
        </script>

        <script>
            
            postsArray = [];
            indexes = [];
			
			// Class for template divs
            templateClass = "template";
			// Unique ID for the templates on the page
            unique = 0;
			// Template height
            chunkHeight = 0;
			// Template width
            chunkWidth = 0;
			// Total number of templates to choose from
            numberTemplates = 4;
			
			// Store  images to preload
			toPreLoad = [];
			
			// Run data retrieval and page construction
			parseJson();
			
			offset = 200;
			
			function createAddImage(source, width, height, container, id){
					var linkImg = $('<img/>') // create img
                        .attr({ // set attributes
                            //src: "img/grey.jpg",
							//class: "lazy",
							src: source
                        })
                        .css({
                            width: width,
                            height: height
                        });
                    
                    linkImg.attr("id", id);
                    $(container).html(linkImg); // append to td
				}
            <!-- Parse Json to get all posts and images -->
            function parseJson(){
				// Server IP
                var ipAddress = "172.18.171.148";
                $.get("http://"+ipAddress+":8080/PortFolio/wordpress/?json=get_recent_posts&dev=1&custom_fields=shown", function(json){
                    var deJson = jQuery.parseJSON(json);
                    var posts = deJson.posts;
                    var count = deJson.count;
                    
                    $.each(posts, function( intIndex, post ){
                        var images = post.attachments[0].images;
						var toShow = post.custom_fields.shown;
						if(toShow == "true"){
							var postVal = {
											title       : post.title, 
											fullimg     : images.large.url.replace("localhost", ipAddress),
											smallthumb  : images.smallthumb.url.replace("localhost", ipAddress),
											bigthumb    : images.bigthumb.url.replace("localhost", ipAddress),
											widethumb   : images.widethumb.url.replace("localhost", ipAddress),
											highthumb   : images.highthumb.url.replace("localhost", ipAddress)
										};
							postsArray.push(postVal);
							indexes.push({intIndex : 0});
							toPreLoad.push(postVal.fullimg);
						}
                    });					                   
					
					//$("img.lazy").lazyload({ threshold : 200 });
					
					// Images preloading					
					//pix = new PreLoader();

					// Fill each of the cells in the page grid with a new template
                    $("#thumbs-container td").each(function(index, element) {
                        newTemplate(element.getAttribute("id"));
                    });
					
                    var rows = $(".masterrow");

					// Duplicate the top row(s)
					var numbRowsDup = Math.ceil(($(window).height() + offset) / chunkHeight);
					for(var i = 0; i < numbRowsDup ; i++) {
						var toDup = $(".masterrow").eq(i).clone();
						toDup.insertAfter($(".masterrow:last"));
					}
															
					// Duplicate the left column(s)
                    var rows = $(".masterrow");
                    var cols;

                    rows.each(function() {
                        cols = jQuery(this).children('th, td');
                        cols.eq(0).clone().insertAfter(cols.eq(1));
                    });

					/*// Place b-i logo somewhere random
					var minSmall = 1;
					var maxSmall = $('.tdsmall').length;
					var indexLogo = Math.floor(Math.random() * (maxSmall - minSmall + 1)) + minSmall;
					
					var source = "img/blue.jpg";
					var scale = 0.2;
					if (typeof( window.innerHeight ) == 'number' ) {
                        var vpHeight = window.innerHeight;
                        var vpWidth = window.innerWidth;
                    }
					var imgWidth = vpWidth*scale;  
					var imgHeight = imgWidth;
					
					createAddImage(source, imgWidth, imgHeight, $('.tdsmall').eq(indexLogo), "blue");

					scrollLeft = $(window).scrollLeft();
					scrollTop = $(window).scrollTop();
					docWidth = $(document).width();
					docHeight = $(document).height();
					
					if(scrollLeft > (docWidth - vpWidth) || scrollTop > (docHeight - vpHeight) || scrollLeft == 0 || scrollTop == 0){
						var viewportWidth = jQuery(window).width(),
						viewportHeight = jQuery(window).height(),
						$foo = jQuery('#blue'),
						elWidth = $foo.width(),
						elHeight = $foo.height(),
						elOffset = $foo.offset();
						jQuery(window).scrollLeft(elOffset.left  - (elWidth/2));
						jQuery(window).scrollTop(elOffset.top - elHeight/2);
					}*/
						jQuery(window).scrollLeft(1000);
						jQuery(window).scrollTop(1000);

                });
            }
			
			function PreLoader(){
				this.images=[];  
								
				for(var i=0, len=toPreLoad.length; i<len; i++){
					this.images[i]=new Image();
					this.images[i].src=toPreLoad[i];
				}
			}
            
            <!--Load a random template and fill it with images-->            
            function newTemplate(tdID) {
                unique++;
                var templateID = "template"+unique;
                var min = 1;
                var max = numberTemplates;
                var tID = Math.floor(Math.random() * (max - min + 1)) + min;

                var toLoad = "templates/template"+tID+".html";
                var currentposition = $(window).scrollTop();
                var docHeight = $(document).height();
                $.ajax({
                    url: toLoad,
                    type: "GET",
                    async: false,
					dataType: "text",
                    success: function (response) {
                        if(postsArray.length == 0){
                            alert("No content to display");
                        } else {
                            var newdiv = document.createElement('div');
                            newdiv.className = templateClass;
                            newdiv.setAttribute("id", templateID);
                            newdiv.innerHTML = response;
                            $("#"+tdID).html(newdiv);
                            fillTemplate(templateID);
                        }
                    }
                });
            }
            
            <!--Fill template with images-->
            function fillTemplate(container){
                var count = postsArray.length;
                
                var min = 0;
                var toChoose = [];
                
                for(i = 0; i<count; i++){
                    toChoose.push(i);
                }

                var classT = "#"+container;
                
                $(classT).find("td").each(function(index) { //get all cells in table
                    var source = null;

                    var max = toChoose.length - 1;
                    var index = Math.floor(Math.random() * (max - min + 1)) + min;
                    
                    if(toChoose.length == 0){
                        for(i = 0; i<count; i++){
                            toChoose.push(i);
                        }
                    }
                    var random = toChoose[index];
                    toChoose.splice(index,1);
                       
                    <!--Set image sizes according to viewport-->
                    if (typeof( window.innerHeight ) == 'number' ) {
                        var vpHeight = window.innerHeight;
                        var vpWidth = window.innerWidth;
                    }
                    
                    var scale = 0.20;
                    
                    var imgHeight = 0;
                    var imgWidth = 0;
                    
                    switch($(this).attr('class')) {
                        case 'tdsmall':
                            source = postsArray[random].smallthumb;
                            imgWidth = vpWidth*scale;  
                            imgHeight = imgWidth;
                        break;
                        case 'tdbig':
                            source = postsArray[random].bigthumb;
                            imgWidth = vpWidth*scale*2;  
                            imgHeight = imgWidth;
                        break;
                        case 'tdhigh':
                            source = postsArray[random].highthumb;
                            imgHeight = vpWidth*scale*2;
                            imgWidth = imgHeight /2;  
                        break;
                        case 'tdwide':
                            source = postsArray[random].widethumb;
                            imgWidth = vpWidth*scale*2;  
                            imgHeight = imgWidth /2;
                        break;
                    }
					
					createAddImage(source, Math.ceil(imgWidth), Math.ceil(imgHeight), $(this), "");
					
					
                    <!--Add link to the current image for popup-->
                    $(this).find('img').each( function() {
                        var $img = $(this),
                        href = $img.attr('src');
                        
                        $img.wrap('<a class="fancybox" href="' + postsArray[random].fullimg + '"></a>');
                    });

                });
                
                <!--Save template size for scroll positionning-->
                chunkHeight = $(classT).height();
                chunkWidth = $(classT).width();			
            }
        </script>

        <script type="text/javascript">
            $(document).ready(function() {
                $(".fancybox").fancybox({
					openEffect	: 'elastic',
					closeEffect	: 'elastic',
                    padding : 0,
					helpers:  {
						overlay : {
							showEarly : true,
							speedOut   : 2
						}
					}

                  });
            });
        </script>

        <!--Make the page cyclic. Use a 3x3 grid, and move the scroll indicator around to implement pretend cyclicity-->
        <script type="text/javascript">
            offset = 200;
			//offset = Math.round(Math.min($(window).height(), $(window).width()) / 4);
			//offset = Math.min(offset, Math.min());
			window.onscroll = whenScroll;
			window.addEventListener('touchend', whenScroll, false);
			window.addEventListener('touchstart', whenScroll, false);
			window.addEventListener('touchmove', whenScroll, false);

			function whenScroll() {
                // When scroll to the bottom
                if ($(window).scrollTop() + $(window).height() >= $(document).height() - offset) {
					var whatsLeft = $(document).height() - $(window).scrollTop() - $(window).height();
					var numbChunks = Math.ceil($(window).height() / chunkHeight);
					$(window).scrollTop((numbChunks*(chunkHeight)) - $(window).height() - whatsLeft);
                }
                
                // When scroll to the top
                if ( $(window).scrollTop() <= offset ) {
					var whatsLeft = $(window).scrollTop();
					var numbChunks = Math.ceil($(window).height() / chunkHeight);
					$(window).scrollTop($(document).height() - numbChunks*(chunkHeight) + whatsLeft);
                }

                // When scroll to right
                if ($(window).scrollLeft() + $(window).width() >= $(document).width() - offset) {
					var whatsLeft = $(document).width() - $(window).scrollLeft() - $(window).width();					
					var numbChunks = Math.ceil($(window).width() / chunkWidth);
					//alert("("+numbChunks+"*("+chunkWidth+") + 2) - "+$(window).width()+" - "+whatsLeft);
					$(window).scrollLeft((numbChunks*(chunkWidth)) - ($(window).width() + whatsLeft));
                }

                // When scroll to left
                if ($(window).scrollLeft() <= offset) {
					var whatsLeft = $(window).scrollLeft();
					var numbChunks = Math.ceil($(window).width() / chunkWidth);
					
					$(window).scrollLeft($(document).width() - numbChunks*(chunkWidth) + whatsLeft);
                }
            };
        </script>
    </head>
    
    <body>
        <!-- Add your site or application content here -->
        <div id="thumbs-container">
            <table class="thumbs-table">
                <tr class="masterrow" id="row1">
                    <td class="thumbs-cell" id="td1"></td>
                    <td class="thumbs-cell" id="td2"></td>
                </tr>
                
                <tr class="masterrow" id="row2">
                    <td class="thumbs-cell" id="td3"></td>
                    <td class="thumbs-cell" id="td4"></td>
                </tr>

                <tr class="masterrow" id="row3">
                    <td class="thumbs-cell" id="td5"></td>
                    <td class="thumbs-cell" id="td6"></td>
    			</tr>
            </table>
        </div>
{'fraction_non_alphanumeric': 0.14697298975473455, 'fraction_numerical': 0.010493635516920211, 'mean_word_length': 1.4716850828729282, 'pattern_counts': {'":': 2, '<': 207, '<?xml version=': 0, '>': 201, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2786676', 'n_tokens_mistral': 10188, 'n_tokens_neox': 8565, 'n_words': 1696}