3 // an image object that possibly should be expanded to retrieving other stuff
4 // such as description etc... here just a stub to retrieve the html for the
7 // Author: Lukas Mueller
9 if (!CXGN
) CXGN= function() {};
12 CXGN
.Image = function() {
18 CXGN
.Image
.prototype = {
20 set_image_id: function(image_id
) {
21 this.image_id
=image_id
;
24 get_image_id: function() {
28 image_html: function(div
, size
) {
29 new Ajax
.Request('/cgi-bin/image/ajax/fetch_image.pl', {
31 parameters
: { image_id
: this.get_image_id(), size
: size
},
32 onSuccess: function(response
) {
33 var json
= response
.responseText
;
34 //alert('JSON: '+json)
35 var r
= eval ("("+json
+")");
37 var html_div
= document
.getElementById(div
);
39 html_div
.innerHTML
='<center>'+r
.html
+'</center>';
46 alert('An error occurred! ');