$(document).ready(function(){
    selected_nav = $('#nav').find('.selected');
    $(selected_nav).prepend('<img id="topNavShade_left" style="z-index:99999;position:absolute;left:-5px;top:1px;" src="resources/media/nav_selected_shade_left.gif"/>');
    $(selected_nav).append('<img id=" id="topNavShade_left"" style="position:absolute;right:-5px;top:1px;" src="resources/media/nav_selected_shade_right.gif"/>');
    $('#nav a:last #topNavShade_left').css('display','none');
    
    $('a.external').attr('target','_blank');
	
});


//== 2011-03-13 by Alex for fixing the with/height of images inside Article
function fixArticleImages() {

  $('.article #articleBody img').each(function(index) {
    var maxWidth = 440;
	
		var ImgWidth = $(this).width(); // get the original image width
		if( ImgWidth > maxWidth) { 
		  var scale = ImgWidth/maxWidth; //== get the scale size
		  if(!scale) return;
		  var newHeight = parseInt( $(this).height()/scale );
		  $(this).width(maxWidth);
		  $(this).height(newHeight);
		}

  });

}
