function switchprofile(num,stopauto) {

	if (stopauto == true){
		window.clearTimeout(auto);
	}

	var numprofiles = 8; //number of profiles
	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.textDecoration = "none"; //set other links
			document.getElementById(ploff).style.fontWeight = "100"; //regular
			document.getElementById(ploff).style.color ="003366";
			
		}
		
	}

	document.getElementById(pon).style.visibility = "visible"; // show on layer
	document.getElementById(plon).style.textDecoration = "none"; //set on link
	document.getElementById(plon).style.fontWeight = "900"; //bold
	document.getElementById(plon).style.color ="FF6600";
	
	
	var next = parseFloat(num)+1;
	if (next > numprofiles ) {
		next = 1;	
	}
	
	var previous = parseFloat(num)-1;
	if (previous < 1){
		previous = numprofiles;
	}

	var next = parseFloat(num)+1;
	if (next > numprofiles) {
		next = 1;	
	}
	
	//write out controller
	var prev = document.getElementById("prev");
	prev.innerHTML = '';
	prev.innerHTML = '<a href="javascript:switchprofile('+ previous +',true);" class="plinkoff"><image src="../images/arrow_btn_orange_lft.gif"></a>';
	
	var nxt = document.getElementById("nxt");
	nxt.innerHTML = '';
	nxt.innerHTML = '<a href="javascript:switchprofile('+ next +',true);" class="plinkoff"><image src="../images/arrow_btn_orange_rt.gif"></a>';
	
	var delay = 10000; // 10 seconds in milliseconds
	auto = window.setTimeout("switchprofile("+next+")",delay);
}



