//*******************************************************************************
//******************* WM 15061 ASMALLS ******************************************
//*******************************************************************************
//	In roster pages, when the cursor is hovered over a player's name, a popup window
//		is created which displays the player's photo, if one is available.
function initRosterPopups(){
	var minWidth=25;
	jQuery('.showPopup').hover(
		function(){																							//	On Hover
			var playerID=jQuery(this).attr('playerID');
//			var o=jQuery(this).offset();												//	Retrieve offset of the object
			var o=jQuery(this).position();												//	Retrieve position of the object
			var moveLeft=jQuery(this).width()*.30;
			var moveUp=-10;
			popup=jQuery('#rosterPopup'+playerID);								//	Save popup archive
			popup.show()																					//	Show and move the popup to be above the player
					.css('top', o.top+moveUp)
					.css('left', o.left + moveLeft);
			var height = popup.outerHeight();
			popup.css('margin-top', -height);

			var imgHeight=popup.find('img').height();							//	Retrieve height of popup image
			var imgWidth=popup.find('img').width();							//	Retrieve width of popup image
			if(imgWidth<minWidth)
			{
				imgWidth=minWidth;
			}
			popup.find('.left').height(imgHeight);								//	Setting bubble parameters
			popup.find('.right').height(imgHeight);
			popup.find('.up').width(imgWidth);										
			popup.find('.bot').width(imgWidth);										//	END setting bubble parameters
		},
		function(e){																							//	On Hover Exit
//			alert(jQuery(e.target));
			if(
				 !jQuery(e.target).is('.showPopup:text')
			){
				var playerID=jQuery(this).attr('playerID');
				jQuery('#rosterPopup'+playerID).hide();
			}
		});
}
