﻿/* This file is used to load images via ajax */

function load_image(up_down, album, pic_key) {
    
    current_file = $('main_image').src;

    image_path = "images/"+album;
    new Ajax.Request('ajax/get_image_name.php',
        {
            method: 'post',
            parameters: { 'current_file': current_file, 'direction': up_down, 'image_path': image_path, 'pic_key':pic_key, 'album':album },
            onSuccess: function(transp) {
                var response = transp.responseText.evalJSON();
                $('main_image').src = response.new_src;
                $('img_caption').update(response.img_caption);
                $('nav_span').update(response.nav_links);
                location.hash = response.pic_key;
            }
        });


}//end load_image(up_down)