//captions for projects photos
projects=new Array(
	"Mastercard Australia, North Sydney",
	"Dynamic Web Training by Seek",
	"Berlei (Bonds Industries)",
	"Seek, North Sydney",
	"LAN Systems, St Leonards",
	"Mastercard Australia, North Sydney",
	"83-97 Kippax St, Surry Hills",
	"58 Kippax St, Surry Hills",
	"The Enterprise Centre, Port Macquarie",
	"Sydney Breast Clinic, Sydney",
	"Tracks Television and Post Production",
	"Mastercard Australia, North Sydney",
	"Encompass Credit Union, Parramatta"
);
management=new Array(
	"The Observatory, Port Macquarie",
	"58 Kippax St, Surry Hills",
	"Focus Apartments, Port Macquarie",
	"83-97 Kippax St, Surry Hills",
	"The Enterprise Centre, Port Macquarie",
	"Two Triple Four, Port Macquarie"
);
property=new Array(
	"The Observatory, Port Macquarie",
	"Focus Apartments, Port Macquarie",
	"The Enterprise Centre, Port Macquarie",
	"Two Triple Four, Port Macquarie"
);

function initphotos(path,count){
	if(document.getElementById){
		//number of steps in fade sequence (opacity increase per step = 100 / fadesteps)
			window.fadesteps=50;
		//number of milliseconds between fade sequence (after image is loaded)
			window.fadepause=2000;
		window.imagepath="images/"+path+"/"+path;
		window.imagecount=count;
		window.imagenumber=window.imageholder=Math.floor(Math.random()*count);
		window.fadecount=0;
		window.captions=window[path];
		loadimage();
	}
}
function loadimage(){
	imagenumber=(imagenumber<imagecount)?imagenumber+1:1;
	window.imageobject=new Image();
	imageobject.src=imagepath+((imagenumber<10)?"0"+imagenumber:imagenumber)+".jpg";
	checkload();
}
function checkload(){
	if(imageobject.complete)displayimage();
	else window.loadtime=window.setTimeout("checkload()",100);
}
function displayimage(){
	imageholder=(imageholder==1)?2:1;
	setopacity(document.getElementById(["photo"+imageholder]),0);
	document.getElementById(["photo"+imageholder]).style.visibility="visible";
	document.images["image"+imageholder].src=imageobject.src;
	fadeimages();
}
function setopacity(domobject,opacityindex){
	opacityindex=(opacityindex==100)?99.999:opacityindex;
	//IE/Win
		domobject.style.filter="alpha(opacity:"+opacityindex+")";
	//Safari<1.2, Konqueror
		domobject.style.KHTMLOpacity=opacityindex/100;
	//Older Mozilla and Firefox
		domobject.style.MozOpacity=opacityindex/100;
	//Safari 1.2, newer Firefox and Mozilla, CSS3
		domobject.style.opacity=opacityindex/100;
}
function fadeimages(){
	fadecount++;
	if(imageholder==1){
		setopacity(document.getElementById("photo1"),fadecount*(100/fadesteps));
		setopacity(document.getElementById("photo2"),((fadecount*-(100/fadesteps))+100));
	}
	else{
		setopacity(document.getElementById("photo2"),fadecount*(100/fadesteps));
		setopacity(document.getElementById("photo1"),((fadecount*-(100/fadesteps))+100));
	}
	if(fadecount<fadesteps)window.fadetime=window.setTimeout("fadeimages()",10);
	else{
		document.getElementById("photo_caption").innerHTML=captions[imagenumber-1];
		fadecount=1;
		window.pausetime=window.setTimeout("loadimage()",fadepause);
	}
}