//Fade-in image slideshow- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

var slideshow_width='120px'; //SET IMAGE WIDTH
var slideshow_height='79px'; //SET IMAGE HEIGHT
var pause=1500;

var fadeimagesL=new Array();
var fadeimagesR=new Array();
//SET IMAGE PATHS. Extend or contract array as needed
fadeimagesR[0]="sm_35.jpg";
fadeimagesR[1]="sm_30.jpg";
fadeimagesR[2]="sm_36.jpg";
fadeimagesR[3]="sm_37.jpg";
fadeimagesR[4]="sm_31.jpg";
fadeimagesR[5]="sm_38.jpg";
fadeimagesR[6]="sm_39.jpg";
fadeimagesR[7]="sm_32.jpg";
fadeimagesR[8]="sm_09.jpg";
fadeimagesR[9]="sm_10.jpg";
fadeimagesR[10]="sm_21.jpg";
fadeimagesR[11]="sm_33.jpg";
fadeimagesR[12]="sm_40.jpg";
//fadeimagesR[13]="sm_42.jpg"; uncomment this when we get another image to add to fadeImagesL array


fadeimagesL[0]="sm_13.jpg";
fadeimagesL[1]="sm_14.jpg";
fadeimagesL[2]="sm_15.jpg";
fadeimagesL[3]="sm_06.jpg";
fadeimagesL[4]="sm_25.jpg";
fadeimagesL[5]="sm_11.jpg";
fadeimagesL[6]="sm_23.jpg";
fadeimagesL[7]="sm_29.jpg";
fadeimagesL[8]="sm_26.jpg";
fadeimagesL[9]="sm_27.jpg";
fadeimagesL[10]="sm_28.jpg";
fadeimagesL[11]="sm_34.jpg";
fadeimagesL[12]="sm_41.jpg";

////NO need to edit beyond here/////////////
var preloadedimagesR=new Array();
var preloadedimagesL=new Array();
var bInitialLoad = true;
var sCrossBrowseDoc, ie4, ns4, dom, curposR, curposL, curcanvasR, curcanvasL, curimageindexR, curimageindexL, nextimageindexR, nextimageindexL;
function initSlideShowR()
{

	ie4=document.all;
	dom=document.getElementById;
	ns4=document.layers;

	if (ie4||dom) {
		document.write('<div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden"><div id="canvasR0" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"><a href="gallery.html"><img border="0" src="'+fadeimagesR[0]+'"></a></div><div id="canvasR1" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"><a href="gallery.html"><img border="0" src="'+fadeimagesR[1]+'"></a></div></div>'); }
	else if (ns4) {
		document.content.document.write('<a href="gallery.html"><img border="0" name="defaultslideR" src="'+fadeimagesR[0]+'"></a>'); }
	else {
		document.write('<a href="gallery.html"><img border="0" name="defaultslideR" src="'+fadeimagesR[0]+'"></a>'); }

	curposR=10;
	curposL=10;
	curcanvasR="canvasR0";
	curcanvasL="canvasL0";
	curimageindexR=0;
	curimageindexL=0;
	nextimageindexR=1;
	nextimageindexL=1;
}

function initSlideShowL()
{
	if (ie4||dom) {
		document.write('<div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden"><div id="canvasL0" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"><a href="gallery.html"><img border="0" src="'+fadeimagesL[0]+'"></a></div><div id="canvasL1" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"><a href="gallery.html"><img border="0" src="'+fadeimagesL[0]+'"></a></div></div>'); }
	else if (ns4) {
		document.content.document.write('<a href="gallery.html"><img border="0" name="defaultslideL" src="'+fadeimagesL[0]+'"></a>'); }
	else {
		document.write('<a href="gallery.html"><img border="0" name="defaultslideL" src="'+fadeimagesL[0]+'"></a>'); }
}

function startSlideShow()
{
	for (p=0;p<fadeimagesR.length;p++)
	{
		preloadedimagesR[p]=new Image();
		preloadedimagesR[p].src=fadeimagesR[p];
	}
	for (p=0;p<fadeimagesL.length;p++)
	{
		preloadedimagesL[p]=new Image();
		preloadedimagesL[p].src=fadeimagesL[p];
	}

	rotateimage();
}

function fadepicR()
{
	if (curposR<100)
	{
		curposR+=10;
		if (tempobjR.filters) {
			tempobjR.filters.alpha.opacity=curposR; }
		else if (tempobjR.style.MozOpacity) {
			tempobjR.style.MozOpacity=curposR/101; }
	}
	else
	{
		clearInterval(dropslideR);
		nextcanvasR=(curcanvasR=="canvasR0")? "canvasR0" : "canvasR1";
		tempobjR=ie4? eval("document.all."+nextcanvasR) : document.getElementById(nextcanvasR);
		tempobjR.innerHTML='<a href="gallery.html"><img border="0" src="'+fadeimagesR[nextimageindexR]+'"></a>';
		nextimageindexR=(nextimageindexR<fadeimagesR.length-1)? nextimageindexR+1 : 0;
		if (bInitialLoad)
		{
			bInitialLoad = false;
			rotateimageL();
		}
		else {
			setTimeout("rotateimageL()",pause); }
	}
}

function fadepicL()
{
	if (curposL<100)
	{
		curposL+=10;
		if (tempobjL.filters) {
			tempobjL.filters.alpha.opacity=curposL; }
		else if (tempobjL.style.MozOpacity) {
			tempobjL.style.MozOpacity=curposL/101; }
	}
	else
	{
		clearInterval(dropslideL);
		nextcanvasL=(curcanvasL=="canvasL0")? "canvasL0" : "canvasL1";
		tempobjL=ie4? eval("document.all."+nextcanvasL) : document.getElementById(nextcanvasL);
		tempobjL.innerHTML='<a href="gallery.html"><img border="0" src="'+fadeimagesL[nextimageindexL]+'"></a>';
		nextimageindexL=(nextimageindexL<fadeimagesL.length-1)? nextimageindexL+1 : 0;
		setTimeout("rotateimage()",pause);
	}
}

function rotateimage()
{
	rotateimageR();
}

function rotateimageR()
{
	if (ie4||dom)
	{
		resetitR(curcanvasR);
		var crossobjR=tempobjR=ie4? eval("document.all."+curcanvasR) : document.getElementById(curcanvasR);
		crossobjR.style.zIndex++;
		var tempR='setInterval("fadepicR()",50)';
		dropslideR=eval(tempR);
		curcanvasR=(curcanvasR=="canvasR0")? "canvasR1" : "canvasR0";
	}
	else
	{
		if (ns4)
		{
			document.content.document.images.defaultslideR.src=fadeimagesR[curimageindexR];
			curimageindexR=(curimageindexR<fadeimagesR.length-1)? curimageindexR+1 : 0;
		}
		else
		{
			document.images.defaultslideR.src=fadeimagesR[curimageindexR];
			curimageindexR=(curimageindexR<fadeimagesR.length-1)? curimageindexR+1 : 0;
		}
		setTimeout("rotateimageL()",pause);
	}
}

function rotateimageL()
{
	if (ie4||dom)
	{
		resetitL(curcanvasL);
		var crossobjL=tempobjL=ie4? eval("document.all."+curcanvasL) : document.getElementById(curcanvasL);
		crossobjL.style.zIndex++;
		var tempL='setInterval("fadepicL()",50)';
		dropslideL=eval(tempL);
		curcanvasL=(curcanvasL=="canvasL0")? "canvasL1" : "canvasL0";
	}
	else
	{
		if (ns4)
		{
			document.content.document.images.defaultslideL.src=fadeimagesL[curimageindexL];
			curimageindexL=(curimageindexL<fadeimagesL.length-1)? curimageindexL+1 : 0;
		}
		else
		{
			document.images.defaultslideL.src=fadeimagesL[curimageindexL];
			curimageindexL=(curimageindexL<fadeimagesL.length-1)? curimageindexL+1 : 0;
		}
		setTimeout("rotateimage()",pause);
	}
}

function resetitR(what)
{
	curposR=10;
	var crossobjR=ie4? eval("document.all."+what) : document.getElementById(what);
	if (crossobjR.filters) {
		crossobjR.filters.alpha.opacity=curposR; }
	else if (crossobjR.style.MozOpacity) {
		crossobjR.style.MozOpacity=curposR/100; }
}

function resetitL(what)
{
	curposL=10;
	var crossobjL=ie4? eval("document.all."+what) : document.getElementById(what);
	if (crossobjL.filters) {
		crossobjL.filters.alpha.opacity=curposL; }
	else if (crossobjL.style.MozOpacity) {
		crossobjL.style.MozOpacity=curposL/100; }
}