// JavaScript Document

function togglePanel(id){
	// get handles to the one we want anf the current one:
	var current = '';
	var current_id = '';
	var want = '';
	for (i = 1; i <= 5; i++) {
		if ($('#panel_' + i).css('display') != 'none') {
			current = $('#panel_' + i);
			current_id = i;
		}
	}
	want = $('#panel_' + id);
	// if want id is the same as current id slide up
	if (id == current_id) {
		want.slideUp(800);
		return false;
	}
	if (!current) {
		want.slideDown(800);
	}
	else {
		current.fadeOut(function(){
			want.fadeIn(800);
		});
	}
	return false;
}

function toggleOtherPanel(id){
	// get handles to the one we want anf the current one:
	var current = '';
	var current_id = '';
	var want = '';
	for (i = 1; i <= 2; i++) {
		if ($('#other_panel_' + i).css('display') != 'none') {
			current = $('#other_panel_' + i);
			current_id = i;
		}
	}
	want = $('#other_panel_' + id);
	// if want id is the same as current id slide up
	if (id == current_id) {
		want.slideUp(800);
		return false;
	}
	if (!current) {
		want.slideDown(800);
	}
	else {
		current.fadeOut(function(){
			want.fadeIn(800);
		});
	}
	return false;
}

