function startFunctionalDiagrams(){

//setup
overlay_opacity = 0.8;
modal_height = 508;
doc_height = $(document).height();
previous_diagram = "";
previous_title = "";
current_diagram = "sdi-analog";
current_title = $("#" + current_diagram).text();
$("#modal_nav").css({'opacity':.99});

//get offset
function getModalOffset(){
	var win_height = $(window).height();
	var scroll_y = $(window).scrollTop();
	var modal_y = ((win_height - modal_height) / 2) + scroll_y;
	return modal_y;
}

//launch modal
$(".diagram").click(function(){
	$("#overlay").css({'height':doc_height,'opacity':overlay_opacity}).fadeIn(250)
	.queue(function () {
		var mo = getModalOffset();
		$("#modal_container").css({'top':mo}).show();
		$(this).dequeue();
	})

	//first diagram
	$("#" + current_diagram + " a").hide();
	$("#" + current_diagram).append("<span>" + current_title + "</span>");
	$("#" + current_diagram).css({"background-position":"center 22px"});
	
	var image_path = $("#modal_nav td:first a").attr("href");
	var image_source = image_path + current_diagram + ".gif"
	$("#diagram img").attr({src:image_source});

	return false;
});

//change diagrams
$("#modal_nav td a").click(function(){
	previous_diagram = current_diagram;
	previous_title = current_title;
	current_diagram = $(this).parent().attr("id");
	current_title = $(this).text();

	$("#" + current_diagram + " a").hide();
	$("#" + current_diagram).append("<span>" + current_title + "</span>");
	$("#" + current_diagram).css({"background-position":"center 22px"});

	$("#" + previous_diagram + " span").remove();
	$("#" + previous_diagram + " a").show();
	$("#" + previous_diagram).css({"background-position":"center -22px"});
	
	var image_path = $("#sdi-analog a").attr("href");
	var image_source = image_path + current_diagram + ".gif"
	$("#diagram img").attr({src:image_source});
		
	return false;
});

//close modal
$("#close img").click(function(){
	$("#modal_container").hide();
	$("#overlay").fadeOut(250);
	$("#" + current_diagram + " span").remove();
});

$("#modal").mouseover(function(){
	$("#close").show();
});

$("#modal").mouseout(function(){
	$("#close").hide();
});

}//end of the startFunctionalDiagrams function