// JavaScript Document

$(function(){

	$('#samples_lnk').bind('click',
		function(e){ e.preventDefault(); $('#samples').toggle(); }
	);

	$('.th_samples span').css({opacity:0}).hover(
		function(){ $(this).stop(true,true).animate({opacity:0.5},400); },
		function(){ $(this).stop(true,true).animate({opacity:0},400); }
	);
	
	$('a[href*=www],a[href*=http],a[href*=pdf]').not('a[href*='+location.hostname+']').attr('target','_blank');

	// When an element that has class of video is clicked, the linked document is embeded into the element that has id="video" applied to it
	$('.video').click(function(e){ 
		// Setup video box for pages with a video links
		if(!$('#video').length) {
			$('.contentBox').append('<div id="video" style="width:350px; height:287px; background:white; margin:auto; border:0px solid green;"></div>');
		}
		
		$('#video').html('<embed src="'+$(this).attr('href')+'" width="100%" height="100%" />'); 
		e.preventDefault();
	})	   


});
