var GalleryBrowserLoad = true;
var CurrentPicture = 'null';
var CurrentGallery = 'null';

function GalleryBrowserInit() {
	if(Gallery1.length > 0) setGalleryPicture(1,0);
	else if(Gallery2.length > 0) setGalleryPicture(2,0);
	else if(Gallery3.length > 0) setGalleryPicture(3,0);
	}
	
function setGalleryPicture(GalleryID,PictureID) {
	var Gallery = eval('Gallery' + GalleryID);
	if(CurrentPicture != 'null') setTimeout("document.g"+ CurrentGallery + "_" + CurrentPicture + ".src = \"" + webSiteUrl + "/_Static/neutral/" + webSiteName + "/Images/spc.gif\"",1);
	setTimeout("document.g"+ GalleryID + "_" + PictureID + ".src = \"" + webSiteUrl + "/_Static/neutral/" + webSiteName + "/Images/SpcBlck.gif\"",1);
	setTimeout("document.SmallPicture.src = \"" + Gallery[0][PictureID] + "\"",1);
	CurrentGallery = GalleryID;
	CurrentPicture = PictureID;
	}
	
function rollGallery(GalleryID,PictureID,state) {
	if((CurrentGallery != GalleryID) || (CurrentPicture != PictureID)) {
		state = (state) ? "SpcBlck" : "spc";
		eval("document.g" + GalleryID + "_" + PictureID + ".src = \"" + webSiteUrl + "/_Static/neutral/" + webSiteName + "/Images/" + state + ".gif\"");
		}
	}	

function savePicture(size) {
	var Gallery = eval('Gallery' + CurrentGallery);
	GalleryBrowser = window.open(Gallery[size][CurrentPicture],'GalleryBrowser','toolbar=1,location=0,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
	if(window.focus) GalleryBrowser.focus()
	}
	
//MediumPicture
//LargePicture