
var numprofiles = 5; //number of profiles

//function to start with random intro photo
function switchload(){
	randmnum = Math.floor(Math.random()*numprofiles) + 1;
	switchprofile(randmnum);
}

//function to swap out intro photos
function switchprofile(num,stopauto) {

	/* auto rotate
	if (stopauto == true){
		window.clearTimeout(auto);
	}
	*/

	var pon = "profile" + num; //get on div id
	var plon = "plink" + num; // get on link id
	
	for (i=1; i <= numprofiles; i++){
		var poff = "profile" + i; //get off div ids
		var ploff = "plink" + i; // get off link ids
		
		if (i != num) {
			document.getElementById(poff).style.visibility = "hidden"; // hide other layers
		
			document.getElementById(ploff).style.backgroundColor = "#000"; //set bgcolor
		}
	}

	document.getElementById(pon).style.visibility = "visible"; // show on layer

	document.getElementById(plon).style.backgroundColor = "#820c25"; //set bgcolor
	
	/* auto rotate
	var next = parseFloat(num)+1;
	if (next > numprofiles ) {
		next = 1;	
	}
	var delay = 5000; //5 seconds in milliseconds
	auto = window.setTimeout("switchprofile("+next+")",delay);
	*/
}
