/*
*	Author: Mike Dattilo
*
* Purpose: Allows multiple pictures to be flipped through on a page.  When click either pops up a 
*          link or email... see options below.
*
* Example:
*        <table border=0 cellpadding=2 cellspacing=0><tr><td align=center>
*          <a href="javascript:dolink( )"><img src="/images/construction.gif" name="PicFade" style="filter:revealTrans(duration=3,transition=23)" width=220 height=70 border=0></a></td></tr>
*        </table>
*
* Extension: To use this function for different pages, simply take the first three statements
*            that define the different arrays out of this file and place them on the pages you
*            want to display the fader on and include this file excluding the three array declarations.
*
*/

//location of pictures you want to show
var ARPicLinks=new Array("foto/svasta/index.jpg","foto/svasta/sveuciliste_studenti.jpg","foto/svasta/FTVT.jpg","foto/svasta/zbor.jpg","foto/svasta/pea.jpg", "foto/svasta/dubrovnik.jpg");

//does the fading
function applyFade(){
	if (document.all) {
		PicFade.style.filter="blendTrans(duration=4)";
		PicFade.style.filter="blendTrans(duration=CrossFadeDuration)";
		PicFade.filters.blendTrans.Apply();
	}
}

var arPos=0;          //where to start in array
var DelayTime = 3000; //milliseconds between flips

//flips through the pictures from first to last *Default*
function FadeForward( ){
	if(arPos<ARPicLinks.length-1) {	arPos++; }
	else { arPos=0; }
	
	applyFade();
	document.images.PicFade.src=ARPicLinks[arPos];
	if(document.all) { PicFade.filters.blendTrans.Play(); }
	window.setTimeout('FadeForward()',DelayTime);
}

//flips through the pictures from last to first -- change statement at bottom to use
function FadeBackward(){
	if(arPos>0) {	arPos--; }
	else  { arPos=ARPicLinks.length-1; }
	
	applyFade();
	document.images.PicFade.src=ARPicLinks[arPos];
	if(document.all) { PicFade.filters.blendTrans.Play(); }
	window.setTimeout('FadeBackward()',DelayTime);
}
window.setTimeout('FadeForward()',DelayTime);
