var imageset_data = new Array();
var loading_img = new Image()
loading_img.src = "/img/shared/misc/loading.gif";

function imageset_set_current(id, root, src, title, width, height) {
    var data        = new Array();
    element         = document.getElementById(id);
    element.src     = loading_img.src;
    element.src     = root + '/640/' + src;
    data['root']    = root;
    data['src']     = src;
    data['title']   = title;
    data['width']   = width;
    data['height']   = height;
    imageset_data[id] = data;
    return false;
}

function imageset_load_big(id) {
    var data    = imageset_data[id];
    var root    = data['root']
    var src     = data['src']
    var width   = data['width']
    var height  = data['height']
    var title   = data['title']
    
    var max_width = screen.width * 0.80;
    var max_height = screen.height * 0.80;
    
    if ( width > max_width ) width = max_width;
    if ( height > max_height ) height = max_height;
    
    new_window  = window.open( "", "", "location=no,menubar=no,statusbar=no,toolbar=no,resizable=yes,width=" + width + ",height=" + height + ",innerWidth=" + width + ",innerHeight=" + height );
    if ( new_window ) {
        new_window.document.write('<html><head><title>' + title + '</title></head><body style="margin: 0px; padding: 0px;"><img src="' + root + '/' + src + '" width="' + width + '" height="' + height + '"></body></html>' );
        new_window.document.close()
    } else {
        window.location = root + '/' + src;
    }
    return false;
}
