// (C) 2003 by CodeLifter.com
// Free for all users, but leave in this header.


var sssf = 1000;
var sssn = 3000;
var ssss = 4500;
var sss =  sssn;
var CrossFadeDuration = 0.5;

var showHot = false;       // don't change this

var tss;
var iss;
var pss = Picture.length-1;
var ss=0;
var st;


var preLoad = new Array();

/* for (iss = 0; iss < pss+1; iss++){ */
preLoad[jss] = new Image();
preLoad[jss].src = Picture[jss]; 


function control(how)
{
	if (showHot)
	{
		if (how=="S") {ss=1;} else 
		{
		if (how=="F") jss++;
		if (how=="B") jss--;
		if (how=="1") {jss=0;moveIndex(0);}
		if (how=="L") {jss=pss;moveIndex(jss-viewPer);}
		}

		if (how=="St" && ss!=0) { clearTimeout(st); ss=0; jss--;}

		if (jss >= (pss)) 
		{	
			jss=pss;
			document.images.rightarrow1.src="/photo/images/menu/nextno.gif";
			document.images.rightarrow2.src="/photo/images/menu/lastno.gif";
		} else 
		{
			document.images.rightarrow1.src = "/photo/images/menu/next.gif";
			document.images.rightarrow2.src = "/photo/images/menu/last.gif";
			if (!preLoad[jss+1]) 
			{
				preLoad[jss+1] = new Image();
				preLoad[jss+1].src = Picture[jss+1];
			}
			
		}

		if (jss <= 0)
		{
			jss=0;
			document.images.leftarrow1.src = "/photo/images/menu/firstno.gif";
			document.images.leftarrow2.src = "/photo/images/menu/prevno.gif";
		} else 
		{
			document.images.leftarrow1.src = "/photo/images/menu/first.gif";
			document.images.leftarrow2.src = "/photo/images/menu/prev.gif";
			if (!preLoad[jss-1]) 
			{
				preLoad[jss-1] = new Image();
				preLoad[jss-1].src = Picture[jss-1];
			}
		}
			

		if (ss==1) 
		{
			switchpic(1,0);
		} else 
		{
			switchpic(0,0);
		}
	}
}

function switchpic(slide, loaded) 
{
// added by brian 091406
	hilited=jss;
	if (hilited > index+viewPer-1) 
	{
		// number of slots to move over on hitting end ...
		moveIndex('plus');
		moveIndex('plus');
		moveIndex('plus');
	} else 
	{
		moveIndex('initialize');
	}

	if (document.all && !dd.op)
	{
//	document.images.PictureBox.style.filter="blendTrans(duration=2)";
	document.images.PictureBox.style.filter="blendTrans(duration="+CrossFadeDuration+")";
	document.images.PictureBox.filters.blendTrans.Apply();
	}

	if (preLoad[jss]) {
		document.images.PictureBox.src = preLoad[jss].src;
	} else {
		document.images.PictureBox.src = Picture[jss];
	}

	if (document.getElementById) document.getElementById("NameBox").innerHTML= Name[jss];
	if (document.getElementById) document.getElementById("SizeBox").innerHTML= Size[jss];
	if (document.getElementById) document.getElementById("ResBox").innerHTML= Res[jss];
	if (document.getElementById) document.getElementById("NoteBox").innerHTML= Note[jss];
	if (document.getElementById && Picture[0] != "empty.jpg") document.getElementById("IndexBox").innerHTML= (jss+1)+' of '+(pss+1);
	
	if (document.all && !dd.op) document.images.PictureBox.filters.blendTrans.Play();


	if (slide && jss < pss ) {  
		jss++;
		if (!preLoad[jss+1]) {
			preLoad[jss+1] = new Image();
			preLoad[jss+1].src = Picture[jss+1];
		}
		if (document.images.PictureBox.complete) {
		st = setTimeout("switchpic(1,1)",sss);
		} else {
		st = setTimeout("switchpic(1,0)",sss);
		}
	} else { ss=0; }
	
	
	
	
}



