var str = '';
var str2 = '';
var stitle = '';
var albumid = '';
var acoverid = '';
var j = 0;
function buildJSON (dJSON) {	
	i = 0;
	
	$.each (dJSON, function (x,y) {
		if (typeof y === 'object' && y.gphoto$id.$t !== '5602609722477640065' && y.gphoto$id.$t !== '5614492343806551953') {
			
			st = y.title.$t;
			albumid = y.gphoto$id.$t;
			iofst = st.indexOf('Projects');
			if(iofst != -1){
				st = st.substring(iofst+11);
			}else{
				est = escape(st);
				stitle = '<span class="title">' + st + '</span>' ;
				str += '<div class="talbum"><a href=albums.html?id='+ albumid +'&t='+ est +'>' + stitle + '</a></div>';
			}
			
		}else if (y.gphoto$id.$t === '5602609722477640065') {
				str2 = '<div class="imagerhome"><img class="thumSize" src="' + y.media$group.media$content[0].url + '"/></div>';	
		}
	});
	str += '<div class="talbum"><a href="projects.html"><span class="title">Projects</span></a></div>';
	$('#container').append(str).hide().fadeIn(300);
	$('#imgcontainer').attr('innerHTML' ,str2 );
	$('.foot').fadeIn(500);
	$('.thumSize').hide().fadeIn(300);
}
$.ajax({url: 'http://picasaweb.google.com/data/feed/api/user/goninariskin?alt=json', cache: false, dataType: 'jsonp',success: function(data) { buildJSON(data.feed.entry); }});
