function getPics(yourTags, numPics) {

            /*gets data from flickr public feed in json format
            code adopted from jQuery.getJSON() page - http://api.jquery.com/jQuery.getJSON/ */
            $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",
        {
            tags: yourTags,
            tagmode: 'all',
            format: 'json'
        },
        function (data) {

            var textToInsert = '';

            $.each(data.items, function (i, item) {

                if (i == numPics) return false;

                /*the json does not contain links for image thumbnails and large pics, only for medium size pics
                so we need to create the urls for these image sizes (_t.jpg, _b.jpg, _m.jpg specify the image size in the url) 
                */
                var imgThumb = item.media.m.split('m.jpg')[0] + 's.jpg';

                var imgLarge = item.media.m.split('m.jpg')[0] + 'b.jpg';

                //get and format images
                textToInsert += '<a rel="flickr_group" href="' + imgLarge + '"><img src="' + imgThumb + '" /></a>';

            });

            //clear contents of div
            $('#images').empty();

            //add images to div
            $('#images').append(textToInsert);

            //fancybox code to create image gallery
            $("a[rel=flickr_group]").fancybox({
                'transitionIn': 'none',
                'transitionOut': 'none',
                'titlePosition': 'over',
                'titleFormat': function (title, currentArray, currentIndex, currentOpts) {
                    return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                }

            });

        });

        }
