team_active_cv="";
function team_activate_cv(id) {
	if (team_active_cv!="") {
		$('#cv-'+team_active_cv).slideUp("slow");
		$('#more-'+team_active_cv).show();
	}
	$('#cv-'+id).slideDown("slow");
	$('#more-'+id).hide();
	team_active_cv=id;
}

function contact_send() {
	var contact_form_ok=true;
	var fields = ["name","lastname","email","comments"];
	$.each(fields, function() {
		if ($('#'+this).val()=="") {
			$('#error-'+this).show();
			contact_form_ok=false;
		} else {
			$('#error-'+this).hide();
		}
	});
	if (contact_form_ok) {
		$('#contact-form').submit()	
	}
}

var photos_numphotos;
var photos_currentpos=1;
var photos_list=new Array();
function photos_load(id,pos,description) {
	$('#photo-img img').attr("src","../imgdb/img-"+id+".jpg");
	photos_updatenavigator(pos);
	photos_currentpos=pos;
	if (description) {
		$('#photo-description').html("<div class='photo-description-container'>"+description+"</div>");
	} else {
		$('#photo-description').html("");
	}
}
function photos_load_nodb(id,pos,description) {
	$('#photo-img img').attr("src","photos/photo-"+id+".jpg");
	photos_updatenavigator(pos);
	photos_currentpos=pos;
	if (description) {
		$('#photo-description').html("<div class='photo-description-container'>"+description+"</div>");
	} else {
		$('#photo-description').html("");
	}
}
function photos_move(dir,nodb,description) {
	var new_pos=-1;
	if (dir=="l") {
		new_pos=photos_currentpos-1;
		if (new_pos==0) new_pos=photos_numphotos;
	} else {
		new_pos=photos_currentpos+1;
		if (new_pos>photos_numphotos) new_pos=1;
	}
	if (nodb) {
		photos_load_nodb(photos_list[new_pos],new_pos,description);
	} else {
		photos_load(photos_list[new_pos],new_pos,description);
	}
}
function photos_updatenavigator(pos) {
	$('#photos-navigator-'+photos_currentpos).removeClass("active");
	$('#photos-navigator-'+pos).addClass("active");	
}

