	jQuery(document).ready(function($){
		$(".gallery").each(function(index, obj){
			var galleryid = Math.floor(Math.random()*10000);
			$(obj).find("a").colorbox({rel:galleryid, maxWidth:"95%", maxHeight:"95%"});
		});
		$("a.list_ref").each(function(index, obj){
			var relid=$(this).attr('title');
			if($(obj).find('img').html() != null) {
			$(obj).colorbox({rel:relid, maxWidth:"95%", maxHeight:"95%"});
			} else {
			$(obj).colorbox({rel:1000, maxWidth:"95%", maxHeight:"95%"});
			}
		});
//		$("a.list_ref").colorbox({maxWidth:"95%", maxHeight:"95%"});
	});
