/*
	* Image enlargment for the "CONTRIBUTOR SPOTLIGHT" section
	* Modified by: Ricardo Zea
	* Project: LexisNexis' Communities
	* 
	* Original script from: http://net.tutsplus.com/javascript-ajax/build-a-top-panel-with-jquery/
*/

$(document).ready(function(){

	//get the width
	var Width = $('img.resize').width();
	//get the height
	var Height = $('img.resize').height();
	//we want to preserve the proportions of the image, so we get the multipler (you could always multipy the multiplier to get a large image
	var mpx = (1.1);
	
	//run a function when the image is hovered over
	$('img.resize')
		//mouseOver effect
		.hover(function(){
			//take the currently targeted img
			$(this)
				//stops the event from happening in case of an abrupt mouseOut
				.stop()
				//custom animation effect to change the width and height of the img
				.animate({
					//take the original width/height X multipler and tag on the 'px'
					width: (Width * mpx) +'px',
					height: (Height * mpx) +'px'
				//space the animation out over 1 sec (deals in milliseconds)
				},200);
				$(this).addClass("newImg");
				
		},
		//this is just like a mouseOut effect to take the img back to the original size
		function(){
			$(this)
				//stops the event from happening in case of an abrupt mouseOut
				.stop()
				.animate({
					width: Width +'px',
					height: Height +'px'
				},200);
				$(this).removeClass("newImg");
		});
});