/*****************
Image:			<BaseId>			IMG
Text:			<BaseId>_Text		DIV/TD
Link:			<BaseId>_Link<i>	A
Hidden Image:	<BaseId>_<i>		IMG
Hidden Text:	<BaseId>_Text<i>	DIV/TD
*****************/

function Gallery()
{
	this.sBaseId = 'detailImage';
	this.iSelectedImage = 1;
	this.sLinkClass = 'transON';
	this.sLinkClassSel = 'transOFF';
	
	this.bSetNav = true;
	this.bSetText = true;
	
	this.IE = false;
	if(navigator.appName == "Microsoft Internet Explorer") { this.IE = true; }


	//-----------------
	// switchImage
	//-----------------
	this.switchImage = function(iKey) {
		try {
			if(document.images) {
				if(iKey != "none") {
					objImage = document.images[this.sBaseId];
					objImageHidden = document.images[this.sBaseId + '_' + iKey];
					if(this.IE && objImage.filters[0]) { objImage.filters[0].apply(); }
					objImage.src = objImageHidden.src; 
					objImage.alt = objImageHidden.alt;
					if(this.IE && objImage.filters[0]) { objImage.filters[0].play(); }
				}
				this.iSelectedImage = iKey;
			}
			if(this.bSetNav) { this.setNav(this.iSelectedImage); }
			if(this.bSetText) { this.setText(this.iSelectedImage); }
		}
		catch(err) { return(true); }
	}

	//-----------------
	// setNav
	//-----------------
	this.setNav = function(iKey) {
		try { xGetElementById(this.sBaseId + '_Link' + iKey).className = this.sLinkClassSel; } 
		catch(e) { }

		var i = 1;
		while(1) {
			if(i == iKey) { i++; continue; }
			try { xGetElementById(this.sBaseId + '_Link' + i).className = this.sLinkClass; }
			catch(err) { return(true); }
			i++;
		}
	}

	//-----------------
	// setText
	//-----------------
	this.setText = function(iKey) {
		try { 
			if (xGetElementById(this.sBaseId + '_Text' + iKey).innerHTML=='') xGetElementById(this.sBaseId + '_Text').style.display = 'none';
			else {
				xGetElementById(this.sBaseId + '_Text').style.display = '';
				xGetElementById(this.sBaseId + '_Text').innerHTML = xGetElementById(this.sBaseId + '_Text' + iKey).innerHTML; 
			}
		} catch(err) { return(true); }
	}

}


/*****************

filter:progid:DXImageTransform.Microsoft.Blinds(Duration=2);

- EFFECTS -
Wave(freq=1,LightStrength=10,Phase=10,Strength=5);
Alpha(style=1,opacity=25,finishOpacity=100,startX=0,finishX=100,startY=100,finishY=0)
Microsoft.Shadow(direction=135,color=#aaaaaa,strength=5)

- TRANSITIONS -
Fade(Overlap=1.00,duration=0.5)
RandomDissolve(duration=0.5)
Wheel(duration=0.5,spokes=5)
Inset(duration=0.5)
Slide(slidestyle=HIDE,Bands=3,duration=0.5)
ZigZag(Duration=2)
Strips(Duration=2)
Stretch(Duration=2)
Spiral(Duration=2)
RandomBars(Duration=2)
RadialWipe(Duration=2)
Pixelate(Duration=2)
Iris(Duration=2)
CheckerBoard(Duration=2)
Barn(Duration=2)
Blinds(Duration=2)
GradientWipe(Duration=0.5,GradientSize=0.25,wipestyle=0,motion=reverse)

*****************/


