// master.js - main javascript file for cambertx.com

// Once the page is ready
$(document).ready(function(){
	
	// Automatic image swapping code for the mouseovers.
	// Secondary image must end in "_over"
	$("#sideMenu ul li a img").mouseover(function(){
		path = $(this).attr("src");
		dotIndex = path.lastIndexOf(".");
		extension = path.slice(dotIndex);
		prefix = path.slice(0,dotIndex);
		result = prefix + "_over" + extension;
		$(this).attr("src", result);
	}).mouseout(function(){
		path = $(this).attr("src");
		path = path.replace(/_over/,"");
		$(this).attr("src", path);
	});

	var flashvars = {
		paramXMLPath: "http://cambertx.com/director/param.xml",
		initialURL: escape(document.location)
	}
	var params = { 
		base: ".",
		bgcolor: "#121212",
		allowfullscreen: "true"
	}                
	var attributes = {}
	swfobject.embedSWF("director/slideshowpro.swf", "flashcontent", "635", "441", "9.0.0", false, flashvars, params, attributes);
	
	$("#first_flight_slideshow").dialog({ height:480, width:660, autoOpen: false, modal:true, draggable:false, resizable:false });
	
	$("#t1a_first_flight_img").click(function(){
		$("#first_flight_slideshow").dialog("open");
	});
});



window.onload = function(){
	//Set height of news column to match content.
	contentHeight = $("#content").height();
	newsHeight = $("#news").height();
	if(contentHeight > newsHeight){ $("#news").height(contentHeight); }
}