function 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=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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

if (document.images) {
	image_f3 = new Image(510 ,328); image_f3.src = "../images/image_01.jpg";
	image_f1 = new Image(510 ,328); image_f1.src = "../images/image_0.jpg";
	image_f4 = new Image(510 ,328); image_f4.src = "../images/image_02.jpg";
	image_f5 = new Image(510 ,328); image_f5.src = "../images/image_03.jpg";
	image_f6 = new Image(510 ,328); image_f6.src = "../images/image_04.jpg";
	image_f7 = new Image(510 ,328); image_f7.src = "../images/image_05.jpg";
	image_f8 = new Image(510 ,328); image_f8.src = "../images/image_06.jpg";
}
  
var posx=(screen.width/2)-350+30;
var posy=(screen.height/2)-250-45;
function doNothing(){
}

function doRandom(){
	// to add new images, simply follow the existing structure - eg: fact[x]="quick fact"
	// each image should be on a single line.
	// if a fact includes a " it will be required to put a backslash \ in front of it, otherwise it will give an error.
	// if a fact is added and/or removed, it will be required to update the equation random_num below.
	fact = new Array
	 fact[1]="<img src=\"images/random_01.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	 fact[2]="<img src=\"images/random_02.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	 fact[3]="<img src=\"images/random_03.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	 fact[4]="<img src=\"images/random_04.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	 fact[5]="<img src=\"images/random_05.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	 fact[6]="<img src=\"images/random_06.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	 fact[7]="<img src=\"images/random_07.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	 fact[8]="<img src=\"images/random_08.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	 fact[9]="<img src=\"images/random_09.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[10]="<img src=\"images/random_10.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[11]="<img src=\"images/random_11.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[12]="<img src=\"images/random_12.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[13]="<img src=\"images/random_13.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[14]="<img src=\"images/random_14.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[15]="<img src=\"images/random_15.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[16]="<img src=\"images/random_16.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[17]="<img src=\"images/random_17.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[18]="<img src=\"images/random_18.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[19]="<img src=\"images/random_19.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	fact[20]="<img src=\"images/random_20.jpg\" width=\"510\" height=\"328\" alt=\"\" border=\"0\" />"
	
	// in the code below, the number that is being multiplied should be one less than the number of facts in the list above.
	random_num = (Math.round((Math.random()*19)+1))
	
	document.write(fact[random_num]);
}