function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function setup() {
	stamp = new Date();
	year = stamp.getYear();
	date = stamp.getDate();
	month = (stamp.getMonth() + 1);
	if(year < 2000) year = 1900 + year;
	if(date <= 9) date = "0" + date;
	if(month <= 9) month = "0" + month;
	var runTime = new Date();
	var hours = runTime.getHours();
	var minutes = runTime.getMinutes();
	var seconds = runTime.getSeconds();
	if(hours == 0) hours="00";
	if(minutes <= 9) minutes="0"+minutes;
	if(seconds <= 9) seconds="0"+seconds;
	movingTime = "<font color='#FFFFFF' size='2'>"+hours+":"+minutes+"<br />"+date+"/"+month+"/"+year+"</font>";
	MM_findObj("clock").innerHTML=movingTime;
	
	aFade=15;
	aText=0;
	aStall=0;
	aFadeIO='i';
	
	animate();
}

function animate() {
	if(aText==0) {
		text="&quot;I was impressed with the speed that you<br />worked at, and also you supplied us with<br />exactly what we wanted with minimum fuss.&quot;<br /><b>Ros Rice<br />HillsAM Radio</b>";
		divL=25;
		divT=5;
	} else if(aText==1) {
		text="&quot;You did a great job. Thank you for your professionalism and patience! We love what you created.&quot;<br /><b>Amanda Beaumont</b>";
		divL=250;
		divT=10;
	} else if(aText==2) {
		text="&quot;Thanks a lot for all your hard work...<br />You've done a great job.<br />Thank you&quot;<br /><b>Sarah Stewart<br />Otago Polytechnic</b>";
		divL=450;
		divT=0;
	} else if(aText==3) {
		text="We <b>guarantee satisfaction</b><br />and will make sure you're happy with the site,<br />every step of the way";
		divL=80;
		divT=15;
	} else if(aText==4) {
		text="&quot;You definitely know what you're doing!<br />I'll be sure to recommend your work to others.&quot;<br /><b>James McNee<br />Alphaware NZ</b>";
		divL=400;
		divT=40;
	} else if(aText==5) {
		text="&quot;We appreciate Gareth's patience and skills as<br />we had a change of mind on a few occasions. <br />He is always prepared to listen and give <br />good advice where needed.&quot;<br /><b>Paul Dirks<br />Klassiek Real Estate</b>";
		divL=150;
		divT=10;
	} else if(aText==6) {
		text="&quot;[The system is] working well, so well done. Your efforts in meeting our schedule is much appreciated.&quot;<br /><b>Michael Gaffney<br />Children's Issues Centre<br />University of Otago</b>";
		divL=430;
		divT=0;
	} else aText = 0;

	c = aFade;
	
	if(c==10) c='A';
	else if(c==11) c='B';
	else if(c==12) c='C';
	else if(c==13) c='D';
	else if(c==14) c='E';
	else if(c==15) c='F';
	c = c+''+c+''+c+''+c+''+c+''+c;

	if(!aStall) {
		MM_findObj('anim').style.color = '#'+c;
		if(aFade >= 15) {
			MM_findObj('anim').innerHTML="<div style='left:"+divL+"px;top:"+divT+"px;position:relative;' class='anim'>"+text+"</div>";
		}
	}
	
	if(aFadeIO=='i') aFade--;
	else if(aFadeIO=='o') aFade++;
	else if(aFadeIO=='s') aStall++;
	
	if(aFade <= 0) aFadeIO = 's';
	else if(aFade >= 15) {
		aFadeIO='i';
		aText++;
		if(aText > 6) aText = 0;
	}
	
	if(aStall==50) {
		aFadeIO='o';
		aStall=0;
	}
	
	setTimeout("animate()",100);
}