$(function(){

  $('#nav li').hover(function(){ $(this).addClass('hover'); },function(){ $(this).removeClass('hover'); });
/*
  var content_h = $('#content').height();
  if( $('#sidebar').height() < content_h ) $('#sidebar').height(content_h);
*/
	$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");

	/* uses skypecheck js, included on a perpage basis using headspace
	 * see http://www.skype.com/share/buttons/advanced.html for more info
	 */
	if( typeof skypeCheck == 'function' )
	{
		$('a.skype-link').click(function(){ return skypeCheck(); });
	}
	$.fn.media.defaults.flvPlayer = THEMEURL+'swf/mediaplayer.swf';
	$('.media').each(function(){
		$t = $(this);
		$t.css('display','block');
		$t.media({
			width:$t.width(),
			height:$t.height(),
			src:$t.attr('href')
		});
	});

	$work_thumbs = $('.work-video-thumbs img');
	if( $work_thumbs.length > 0 )
	{
		$work_thumbs.wrap('<a></a>');
		$work_videos = $('.work-videos li');
		$work_videos.not('.first').hide();
		$work_thumbs.find('.first a').addClass('active');
		$('.work-video-thumbs a').click(function(){
			var $t = $(this);
			var cls = $t.find('img').attr('class');
			$('.work-videos .'+cls).parents('li').show().siblings().hide();
			return false;
		});
	}


});
