Hurray,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" href="http://www.jacklmoore.com/colorbox/example1/colorbox.css" />
<script language="JavaScript" src="http://www.jacklmoore.com/colorbox/jquery.colorbox.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$(".photo").each(function (index, self) {
$("[rel^=group]",self).colorbox({width: 200,height:200});
})
})
</script>
</head>
<body>
<div class="photo">
<a href="http://javascript.ru/forum/images/smilies/smile.gif" rel="group1" class="show_popup-photo"><img src="http://javascript.ru/forum/images/smilies/smile.gif" alt=""></a>
<a href="http://javascript.ru/forum/images/smilies/victory.gif" rel="group1" class="show_popup-photo"><img src="http://javascript.ru/forum/images/smilies/victory.gif" alt=""></a>
<a href="http://javascript.ru/forum/images/smilies/dance3.gif" rel="group1" class="show_popup-photo"><img src="http://javascript.ru/forum/images/smilies/dance3.gif" alt=""></a>
<a href="http://javascript.ru/forum/images/smilies/cray.gif" rel="group1" class="show_popup-photo"><img src="http://javascript.ru/forum/images/smilies/cray.gif" alt=""></a>
</div>
<div class="photo">
<a href="http://javascript.ru/forum/images/smilies/write.gif" rel="group2" class="show_popup-photo"><img src="http://javascript.ru/forum/images/smilies/write.gif" alt=""></a>
<a href="http://javascript.ru/forum/images/smilies/yes4.gif" rel="group2" class="show_popup-photo"><img src="http://javascript.ru/forum/images/smilies/yes4.gif" alt=""></a>
<a href="http://javascript.ru/forum/images/smilies/lol.gif" rel="group2" class="show_popup-photo"><img src="http://javascript.ru/forum/images/smilies/lol.gif" alt=""></a>
<a href="http://javascript.ru/forum/images/smilies/tongue.gif" rel="group2" class="show_popup-photo"><img src="http://javascript.ru/forum/images/smilies/tongue.gif" alt=""></a>
</div>
</body>
</html>