function select_me(){
	if(q_me>0){
		//document.getElementById("me_button").className="C4 profile_bot profile_selbot";
		$("#me_button").attr("class","C4 profile_bot profile_selbot")
		if(q_samples>0) $("#samples_button").attr("class","C4 profile_bot") //document.getElementById("samples_button").className="C4 profile_bot";
		hide_photos();
		$("#me_1").show()
		//xDisplay('me_1','inline')
		$("#caption_me_1").show()
		//xDisplay('caption_me_1','inline')
		current_photo=1;
		current_cat=0;
		$("#pagination_me").html('1 of '+q_me)
		//document.getElementById('pagination_me').innerHTML='1 of '+q_me;
		$('#div_navigation_samples').hide()
		//xDisplay('div_navigation_samples','none');
		$('#div_navigation_me').show()
		//xDisplay('div_navigation_me','block');
	}
	format_arrows();
}

function select_samples(){
	if(q_samples>0){
		$("#samples_button").attr("class","C4 profile_bot profile_selbot")
		//document.getElementById("samples_button").className="C4 profile_bot profile_selbot";
		if(q_me>0) $("#me_button").attr("class","C4 profile_bot")//document.getElementById("me_button").className="C4 profile_bot";
		hide_photos();
		$("#samples_1").show()
		//xDisplay('samples_1','inline')
		$("#caption_samples_1").show()
		//xDisplay('caption_samples_1','inline')
		current_photo=1;
		current_cat=1;
		$("#pagination_samples").html('1 of '+q_samples)
		//document.getElementById('pagination_samples').innerHTML='1 of '+q_samples;
		$('#div_navigation_me').hide()
		//xDisplay('div_navigation_me','none');
		$('#div_navigation_samples').show()
		//xDisplay('div_navigation_samples','block');
	}
	format_arrows();
}

function next_photo(){
	if(current_cat==0){
		if(q_me<=current_photo) return false;
		else{
			$("#me_"+current_photo).hide()
			//xDisplay('me_'+current_photo,'none')
			$("#caption_me_"+current_photo).hide()
			//xDisplay('caption_me_'+current_photo,'none')
			current_photo++;
			$('#me_'+current_photo).show()
			//xDisplay('me_'+current_photo,'inline')
			$('#caption_me_'+current_photo).show();
			//xDisplay('caption_me_'+current_photo,'inline')
			$('#pagination_me').html(current_photo+' of '+q_me)
			//document.getElementById('pagination_me').innerHTML=current_photo+' of '+q_me;
		}
	}else{
		if(q_samples<=current_photo) return false;
		else{
			$('#samples_'+current_photo).hide()
			//xDisplay('samples_'+current_photo,'none')
			$('#caption_samples_'+current_photo).hide()
			//xDisplay('caption_samples_'+current_photo,'none')
			current_photo++;
			$('#samples_'+current_photo).show()
			//xDisplay('samples_'+current_photo,'inline')
			$('#caption_samples_'+current_photo).show()
			//xDisplay('caption_samples_'+current_photo,'inline')
			$("#pagination_samples").html(current_photo+' of '+q_samples)
			//document.getElementById('pagination_samples').innerHTML=current_photo+' of '+q_samples;
		}
	}
	format_arrows();
}

function previous_photo(){
	if(current_cat==0){
		if(1>=current_photo) return false;
		else{
			$('#me_'+current_photo).hide()
			//xDisplay('me_'+current_photo,'none')
			$('#caption_me_'+current_photo).hide()
			//xDisplay('caption_me_'+current_photo,'none')
			current_photo--;
			$('#me_'+current_photo).show()
			//xDisplay('me_'+current_photo,'inline')
			$('#caption_me_'+current_photo).show()
			//xDisplay('caption_me_'+current_photo,'inline')
			$("#pagination_me").html(current_photo+' of '+q_me)
			//document.getElementById('pagination_me').innerHTML=current_photo+' of '+q_me;
		}
	}else{
		if(1>=current_photo) return false;
		else{
			$('#samples_'+current_photo).hide()
			//xDisplay('samples_'+current_photo,'none')
			$('#caption_samples_'+current_photo).hide()
			//xDisplay('caption_samples_'+current_photo,'none')
			current_photo--;
			$('#samples_'+current_photo).show()
			//xDisplay('samples_'+current_photo,'inline')
			$('#caption_samples_'+current_photo).show()
			//xDisplay('caption_samples_'+current_photo,'inline')
			$("#pagination_samples").html(current_photo+' of '+q_samples)
			//document.getElementById('pagination_samples').innerHTML=current_photo+' of '+q_samples;
		}
	}
	format_arrows();
}

function hide_photos(){
	for(i=1;i<=q_me;i++){
		$('#me_'+i).hide()
		//xDisplay('me_'+i,'none');
		$('#caption_me_'+i).hide()
		//xDisplay('caption_me_'+i,'none');
	}
	for(i=1;i<=q_samples;i++){
		$('#samples_'+i).hide()
		//xDisplay('samples_'+i,'none');
		$('#caption_samples_'+i).hide()
		//xDisplay('caption_samples_'+i,'none');
	}
}

function format_arrows(){
	if(current_cat==0){
		if(1>=current_photo) $('#a_previous_photo_me').attr("class","profile_arrow1_dis");
		else $('#a_previous_photo_me').attr("class","profile_arrow1");
		if(q_me<=current_photo) $('#a_next_photo_me').attr("class","profile_arrow2_dis");
		else $('#a_next_photo_me').attr("class","profile_arrow2");
	}else{
		if(1>=current_photo) $('#a_previous_photo_samples').attr("class","profile_arrow1_dis");
		else $('#a_previous_photo_samples').attr("class","profile_arrow1");
		if(q_samples<=current_photo) $('#a_next_photo_samples').attr("class","profile_arrow2_dis");
		else $('#a_next_photo_samples').attr("class","profile_arrow2");
	}

}
