// For IE hover flicker bug
try {
  document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

// Hello jQuery!
$j(document).ready(function(){
// Add class to body to tell the stylesheet that JavaScript is turned on
	$j("body").removeClass("jsOff").addClass("jsOn");
//	Media Gallery
	$j("#thumbs a").hover(
		function(){
			$j(this).parent().addClass("over");
		},
		function(){
			$j(this).parent().removeClass("over");			
		}
	);

	$j(window).load(function(){
		if ( $j("body").attr("id") == "pageGalleryPhoto" ){
			galleryImg();			
		}
	})

}); // Bye-bye jQuery!

function galleryImg(){
	var imgHeight = ( $j("#mainImg img").height() + 27 );
	var imgMargin = ( (592 - ( $j("#mainImg img").width() + 24 ) ) / 2 );
	$j("#mainImg").css("height", imgHeight);
	$j(".shadow").css("margin-left", imgMargin);
}

