<!--
// Copyright 2007 Ronny Adsetts (ronny.adsetts@amazinginternet.com)

var AllowFade = true;

function galleryFade(objoff, objon, pause, step, time) {
	// If we're already running a fade or trying to fade the same image, bail out here
	if (!AllowFade || objoff == objon) {
		return false;
	}
	objon.match(/(^[a-z]+)(\d{8})/i);
	objonPref = RegExp.$1;
	objonID = RegExp.$2
	// Don't do the fade if the image has not yet loaded
	if (!GallNextPrev[objonID]['load']) {
		return false;
	}
	AllowFade = false;
	timetorun = Math.round(time * (100 / step));
	setThumbClass('str-GallThumb' + objonID, 'str-GallThumbCurr');
	GallCurrLive = objon;
	if (objoff) {
		if (objoff.match(/^[a-z]+(\d{8})/i)) {
			objoffID = RegExp.$1;
			//alert(objoffID);
		}
		setThumbClass('str-GallThumb' + objoffID, 'str-GallThumb');
		fadeintime = timetorun + pause;
		fadeIt(objoff, 0 - step, 0, time, 'setStyle(\'' + objoff + '\', \'display\', \'none\'); setStyle(\'' + objon + '\', \'display\', \'block\');');
	} else {
		fadeintime = pause;
	}
	galleryNavLinkAdj(objonPref, objonID);
	fadeIt(objon, step, fadeintime, time, 'AllowFade = true');
}

function galleryNext(dir, linkobj, pause, step, time) {
	GallCurrLive.match(/^([a-z]+)(\d{8})/i);
	currObjPref = RegExp.$1;
	currObjId = RegExp.$2;
	nextObjId = GallNextPrev[currObjId][dir];
	objon = currObjPref + nextObjId;
	galleryFade(GallCurrLive, objon, pause, step, time);
}

function galleryNavLinkAdj(linkobj, id) {
	// Adjust previous link
	var atag = bw.dom ? document.getElementById(linkobj + 'Prev') : bw.ie4 ? document.all[linkobj + 'Prev'] : 0;
	if (atag) {
		atag.href = atag.href.replace(/vw=\d{8}/, 'vw=' + GallNextPrev[id]['prev']);
	}
	// Adjust next link
	var atag = bw.dom ? document.getElementById(linkobj + 'Next') : bw.ie4 ? document.all[linkobj + 'Next'] : 0;
	if (atag) {
		atag.href = atag.href.replace(/vw=\d{8}/, 'vw=' + GallNextPrev[id]['next']);
	}

}

function setThumbClass(obj, style) {
	obj.match(/^[a-z\-]+(\d{8})/i);
	changeID = RegExp.$1;
	// Don't do the hover if the image has not yet loaded
	if (!GallNextPrev[changeID]['load']) {
		return false;
	}
	GallCurrLive.match(/^[a-z\-]+(\d{8})/i);
	currentID = RegExp.$1;
	// Don't do the hover if we're currently on this image
	if (changeID == currentID) {
		return false;
	}
	var thumb = bw.dom ? document.getElementById(obj) : bw.ie4 ? document.all[obj] : 0;
	if (thumb) {
		thumb.setAttribute("class", style);
		thumb.setAttribute("className", style);
	}
}

//-- > 

