Код
var color = cookie...;
$('body').append('<div id="background" class='+color+'></div>');
function showphoto(id) {
var image = $(this).html('<div id="image">{image}</div>'), comments = $(this).html('{comments}'), data = image+comments;
$('.lightbox').append('<div id="lbouter"><div id="lbinner">'+data+'</div></div>');
$.get('/photo/1-2-'+id),function(commentsdata) {
...
};
}