function plugin_gallery_image_show( int_id )
{
	$('plugin_gallery_'+int_id+'_image').setStyle({'width':'100px','height':'100px'});
	$('plugin_gallery_'+int_id+'_image').src = ".system/plugin/plugin_gallery/navigation_load.gif";

	new Effect.Parallel( [
							new Effect.Appear('plugin_gallery_'+int_id+'_background', { from:0, to:0.6, sync: true }),
						  	new Effect.Appear('plugin_gallery_'+int_id+'_show', { from:0, to:1, sync: true })
						], { duration: 0.3 }
						);
}

function plugin_gallery_image_hide( int_id )
{
	new Effect.Parallel( [
							new Effect.Fade('plugin_gallery_'+int_id+'_background', { sync: true } ),
							new Effect.Fade('plugin_gallery_'+int_id+'_show', { sync: true } )
						], { duration: 0.3 }
						);
}

function ajax_plugin_gallery_image( str_image, int_id )
{
	$('plugin_gallery_'+int_id+'_image').setStyle({'width':'100px','height':'100px'});
	$('plugin_gallery_'+int_id+'_image').src = ".system/plugin/plugin_gallery/navigation_load.gif";
	var viewportoffset = document.viewport.getScrollOffsets();
	$('plugin_gallery_'+int_id+'_background').setStyle({'top':viewportoffset['top']+'px','left':viewportoffset['left']+'px','width':document.viewport.getWidth()+'px','height':document.viewport.getHeight()+'px'});
	$('plugin_gallery_'+int_id+'_show').setStyle({'top':viewportoffset['top']+'px','left':viewportoffset['left']+'px','width':document.viewport.getWidth()+'px','height':document.viewport.getHeight()+'px'});

	new Ajax.Request('.system/plugin/plugin_gallery/plugin_gallery.ajax.image.php?img='+str_image,
	{
		method: 'get',
		onSuccess: function(transport)
			{
				$('plugin_gallery_'+int_id+'_image').src = transport.responseText;
				$('plugin_gallery_'+int_id+'_image').setStyle({'width':'','height':''});
			}
	});

	if( $('plugin_gallery_'+int_id+'_navigation_left') )
	{
		for( int_image = 0; int_image < plugin_gallery_images.length; int_image = int_image + 1 )
		{
			if( plugin_gallery_images[int_image] == str_image )
			{
				if( int_image > 0 )
					$('plugin_gallery_'+int_id+'_navigation_left').update('<a href="#" onclick="ajax_plugin_gallery_image(\''+plugin_gallery_images[(int_image-1)]+'\',\''+int_id+'\');"><img src=".system/plugin/plugin_gallery/navigation_left.png" alt="" style="width: 100px; height: 100px;" /></a>');
				else
					$('plugin_gallery_'+int_id+'_navigation_left').update('<img src=".system/plugin/plugin_gallery/navigation_left_off.png" alt="" style="width: 100px; height: 100px;" />');
				if( int_image < (plugin_gallery_images.length-1) )
					$('plugin_gallery_'+int_id+'_navigation_right').update('<a href="#" onclick="ajax_plugin_gallery_image(\''+plugin_gallery_images[(int_image+1)]+'\',\''+int_id+'\');"><img src=".system/plugin/plugin_gallery/navigation_right.png" alt="" style="width: 100px; height: 100px;" /></a>');
				else
					$('plugin_gallery_'+int_id+'_navigation_right').update('<img src=".system/plugin/plugin_gallery/navigation_right_off.png" alt="" style="width: 100px; height: 100px;" />');
			}
		}
	}
}
