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', {
30 parameters
: { image_id
: this.get_image_id(), size
: size
},
31 onSuccess: function(response
) {
32 var json
= response
.responseText
;
33 //alert('JSON: '+json)
34 var r
= eval ("("+json
+")");
36 var html_div
= document
.getElementById(div
);
38 html_div
.innerHTML
='<center>'+r
.html
+'</center>';
45 alert('An error occurred! ');