var images_g1 = new Array(8);
images_g1[0] = "img/photos/Photo_G1.jpg";
images_g1[1] = "img/photos/Photo_G2.jpg";
images_g1[2] = "img/photos/Photo_G3.jpg";
images_g1[3] = "img/photos/Photo_G4.jpg";
images_g1[4] = "img/photos/Photo_G5.jpg";
images_g1[5] = "img/photos/Photo_G6.jpg";
images_g1[6] = "img/photos/Photo_G7.jpg";
images_g1[7] = "img/photos/Photo_G8.jpg";

var images_g2 = new Array(3);
images_g2[0] = "img/photos/Photo_C1.jpg";
images_g2[1] = "img/photos/Photo_C2.jpg";
images_g2[2] = "img/photos/Photo_C3.jpg";

var images_g3 = new Array(3);
images_g3[0] = "img/photos/Photo_T1.jpg";
images_g3[1] = "img/photos/Photo_T2.jpg";
images_g3[2] = "img/photos/Photo_T3.jpg";

function pickRandom(range) { 
	if (Math.random) 
		return Math.round(Math.random() * (range-1)); 
	else { 
		var now = new Date(); 
		return (now.getTime() / 1000) % range; 
	}
} 

function getPhoto(gr){
	var index;
	if (gr == "g1") {
		index = Math.floor(Math.random() * images_g1.length);
		return images_g1[index];
	} else if (gr == "g2") {
		index = Math.floor(Math.random() * images_g2.length);
		return images_g2[index];
	} else if (gr == "g3") {
		index = Math.floor(Math.random() * images_g3.length);
		return images_g3[index];
	}
}

function MM_findImg(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 RandomizeImg() {
	var x;
	if ((x=MM_findImg("g1"))!=null){x.src=getPhoto("g1");}
	if ((x=MM_findImg("g2"))!=null){x.src=getPhoto("g2");}
	if ((x=MM_findImg("g3"))!=null){x.src=getPhoto("g3");}	
}

