/*===========================================================================
	Presentational (Attorneys)
	
	This JavaScript executes dynamic behaviors such as:
	* Preloading images
	* Flash Replacements (i.e. sIFR, UFO, SWFObject, etc.)
===========================================================================*/

$(function() { // DOM Ready
	// get vid name based on body class for attorney section
	var video;
	if ( $('body').is('.alan-loewinsohn') )
		video = 'alan_expectations';
	else if ( $('body').is('.david-deary') )
		video = 'david_results';
	else if ( $('body').is('.jim-flegle') )
		video = 'group_on_jim';
	else if ( !$('body').is('.individual-bio') ) // video for main attorney page
		video = 'alan_evaluating';
	
	if (video) // if there is a video, setup the link
		$('<p class="watchVideo"><a href="/_media/videos/video.htm?video='+video+'" title="Watch Video">Watch Video</a></p>')
			// insert after summary
			.insertAfter('#summary')
			.find('a')
				// prepare video launcher for when clicked (defined in global actions)
				.prepareVideoLauncher();
});

YAHOO.util.Event.addListener(window, "load", function() {
	window.setTimeout(function() {
		var pageBody = document.getElementsByTagName("body")[0];
		
		pageBody.className = pageBody.className; // reflow IE
	}, 15);
});