/*
Copyright Peter Crute 2008. All Right Reserved. This code may not be reproduced without permission

Peter Crute
www.cwas.org.au
webmaster@cwas.org.au
pcrute@une.edu.au
*/

var gallery = new Array(); 
var count = 0; 
var imageNo = 0;
var op =1;
var QuickStartID 	= 0;
gallery[imageNo++] = "http://www.cwas.org.au/commonFiles/images/slides/1.jpg";
gallery[imageNo++] = "http://www.cwas.org.au/commonFiles/images/slides/2.jpg";
gallery[imageNo++] = "http://www.cwas.org.au/commonFiles/images/slides/3.jpg";
gallery[imageNo++] = "http://www.cwas.org.au/commonFiles/images/slides/4.jpg";
gallery[imageNo++] = "http://www.cwas.org.au/commonFiles/images/slides/5.jpg";
gallery[imageNo++] = "http://www.cwas.org.au/commonFiles/images/slides/6.jpg";
gallery[imageNo++] = "http://www.cwas.org.au/commonFiles/images/slides/7.jpg";

function slideSwitch() {
	var next = new Image;
	src=gallery[count]; 
	next.src=src;
	
	if (document.images) {
		document.getElementById("slideshow").style.background = "url(" + document.getElementById("slide").src + ")"; 
		op=0;
		setOpacity();
		var slide = document.getElementById("slide");
		slide.src = next.src;
	}
	count++;
	if (count >= imageNo) count = 0;
	
	setTimeout("increase()",1500);
}


function setOpacity() {
    if (navigator.userAgent.indexOf("MSIE") != -1) {
        var normalized = Math.round(op * 100);
        document.getElementById("slide").style.filter = "alpha(opacity=" + normalized + ")"
    } else {
        document.getElementById("slide").style.opacity = op
    }
}

function increase(){
	op+=0.1;
	setOpacity();
	if (op<1){
		setTimeout("increase()",120);
	}
	else{
		setTimeout("slideSwitch()",1500);
	}
}
