function GetFlickr(id, sid)
{
/*jQuery.noConflict();*/
var id = id;
var sid= sid;
jQuery(document).ready(function($) {
	
    var total = 8;

//flickr(id, sid, total);
//alert(id +"====="+ sid);
$.getJSON("http://api.flickr.com/services/feeds/photoset.gne?jsoncallback=?",
        {
            set: sid,
			nsid: id,
            format: 'json'
        },

        function (data) {

            var textToInsert = '';

            $.each(data.items, function (i, item) {

                if (i == total) 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] + 't.jpg';

                var imgLarge = item.media.m.split('m.jpg')[0] + 'b.jpg';

                //get and format images
                textToInsert += '<a rel="flickr_group" href="' + imgLarge + '" title="' + item.title + '"><img src="' + imgThumb + '" alt="' + item.title + '" width="90" /></a>';
				
            });
			
			

            //clear contents of div
            $('#photos').empty();

            //add images to div
            $('#photos').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>';
                }

            });

        });
		
		
}); 
}
