// Determine height of the banner's image.
if($('#banner').size() > 0)
{
	var bnrImgHeight = $('#banner img.photo').height();
	var bnrImgWidth = $('#banner img.photo').width();

	$('#banner').css({
		height: bnrImgHeight + 4 + 'px',
		minHeight: bnrImgHeight + 4 +'px',
		paddingRight: '18px'
	});

	//** Start of Hack for bad template which adds div tag around banner content.	
	// Comments by:  Chen Hui
	//
	// The following code is put in to move the banner image to the bottom right
	// corner of the banner section.  The added div tag causes the image to line
	// up badly and therefore needs to be moved.
	//
	// IE6 and 7/8 render this differently.  So, that's why the code moves the image
	// differently depending on the browser
	// 
	// If the div tag is removed, the following code will not do anything because
	// there will be no img tag under a div tag in the banner section
	//	

  var blnIE6 = 0;
  var strUserAgent = navigator.userAgent;

  var bnrTxtHeight = $('#banner div').height();
	var bnrTxtWidth = $('#banner div').width();
	var bnrSize = $('div#banner').height();
  var h1Size = $('div#banner h1').height();


  if (strUserAgent.indexOf('MSIE 6.') < 0)
  {

		$('#banner div img.photo').css({
			bottom: -(bnrSize-bnrTxtHeight-h1Size-11) + 'px',
			right: -(bnrTxtWidth-486) + 'px'
		});
	}
	else
  {
		var bnrPosTop = $('#banner').offset().top;
 		var imgPosTop = $('#banner div img.photo').offset().top;
 		var h1PosTop = $('div#banner h1').offset().top;
 		var x1 = $('#banner').outerHeight(true);
 		var x2 = $('#banner div img.photo').outerHeight(true);
 		//$('#testval').append('banner: ' + bnrPosTop + ', image: ' + imgPosTop + ', bnrheight: ' + bnrSize + ', imgheight: ' + bnrImgHeight + ', x1: ' + x1 + ', x2: ' + x2);
 
		$('#banner div img.photo').css({
			bottom: (imgPosTop-bnrPosTop-(h1PosTop-bnrPosTop)+6) + 'px',
			right: -(bnrTxtWidth-504) + 'px'
		});
	}
	
	//** End of Hack for bad template which adds div tag around banner content.	

}