
var img_array=new Array();
img_array[0]="/image/image_rotate/image1.jpg";
img_array[1]="/image/image_rotate/image2.jpg";
img_array[2]="/image/image_rotate/image3.jpg";
img_array[3]="/image/image_rotate/image1.jpg";
img_array[4]="/image/image_rotate/image2.jpg";
img_array[5]="/image/image_rotate/image3.jpg";

var steps=15;			// How many steps would you like for fading?. Max is 100, min is 1.
var gap=75;			// How long would you like the delay between each frame (in 1/1000 ths of a second)? Min is 1, max should be no more than 10000 (10 seconds).
var show_img_gap=3000;		// How long would you like to show the image for before it starts to fade out again.
var hide_img_gap=75;		// How long would you like to hide the image for before it starts to fade in again.

steps=(steps<1 || steps>100)?15:Math.round(steps);
gap=(gap<1)?75:Math.round(gap);
show_img_gap=(show_img_gap<1)?75:Math.round(show_img_gap);
hide_img_gap=(hide_img_gap<1)?75:Math.round(hide_img_gap);

function controler_of_fade(){

n=0;
m=0;
img_num=0;
fading="in";
fade();}

function fade(){

document.getElementById("fader").src=img_array[img_num];

m=Math.round(n/steps*100);

// m=Math.round(Math.pow((n/steps*Math.pow(100,(1/2))),2));		// Uncomment the beginning of this line for a different fade effect. It will spend more time faded in than faded out.

document.getElementById("fader").style.filter="alpha(opacity="+m+")";	// IE fade.
document.getElementById("fader").style.MozOpacity=m/100;		// Gecko fade.
document.getElementById("fader").style.Opacity=m/100;			// Standards fade.

n+=(fading=="in")?1:(-1);

if(n==steps+1){n-=2;fading="out";if(img_num!=img_array.length-1){setTimeout("fade()",show_img_gap);}}
else if(n==0){fading="in";img_num++;setTimeout("fade()",hide_img_gap);}
else{setTimeout("fade()",gap);}}

