// JavaScript Document
/*
function __PreviewImg(GalleryID, tb)
{
	// Load the preview box and make sure that tb is a textbox with a value
	var previewbox = document.getElementById(GalleryID + '_Preview');
	
	if ( previewbox == null || tb == null || !tb.value )
	{
		return;
	}
	
	// If the textbox contains a value, try to load the image and place it in the preview box
	// if the preview box already contains an image, remove it and add the new one in it's place
	
	
}
*/

function __InsertImg(GalleryID)	
{
	// Submit the form containing the image updates
	// Mark the action as "Add"
	
	var frm = document.forms[0];
	var actn = frm[GalleryID + '_Action'];
	
	if ( actn != null)
	{
		actn.value = 'Add';
		frm.submit();
	}
}

function __RemoveImg(GalleryID, ImageOrder)
{
	var frm = document.forms[0];
	var actn = frm[GalleryID + '_Action'];
	var ID = document.getElementById(GalleryID + '_ID');
	
	if ( actn != null )
	{
		actn.value = 'Remove';
		ID.value = ImageOrder;
		frm.submit();
	}
}

function __UpdateImg(GalleryID, ImageOrder)
{
	var frm = document.forms[0];
	var actn = document.getElementById(GalleryID + '_Action');
	var ID = document.getElementById(GalleryID + '_ID');
	//var desc = document.getElementById(GalleryID + '_desc');
	//var largeImg = document.getElementById(GalleryID + '_largeURL');
	//var smallImg = document.getElementById(GalleryID + '_smallURL');
	
	actn.value = 'Update';
	ID.value = ImageOrder;
	//desc.value = document.getElementById(GalleryID + '_txtDesc_' + ImageOrder).value;
	//largeImg.value = document.getElementById(GalleryID + '_txtLarge_' + ImageOrder).value;
	//smallImg.value = document.getElementById(GalleryID + '_txtSmall_' + ImageOrder).value;
	
	frm.submit();
}


